From bcbabdf8a1d98054eb0963ef226c104134bda3f8 Mon Sep 17 00:00:00 2001 From: Markolie Date: Mon, 21 Sep 2015 22:21:16 +0200 Subject: [PATCH] Fix aliens/animals attacking turrets --- code/game/machinery/portable_turret.dm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index b58c9a215d8..c7e83d7647e 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -392,6 +392,31 @@ var/list/turret_icons attacked = 0 ..() + +/obj/machinery/porta_turret/attack_animal(mob/living/simple_animal/M) + M.changeNext_move(CLICK_CD_MELEE) + M.do_attack_animation(src) + if(M.melee_damage_upper == 0) + return + if(!(stat & BROKEN)) + visible_message("[M] [M.attacktext] [src]!") + add_logs(M, src, "attacked") + take_damage(M.melee_damage_upper) + else + M << "That object is useless to you." + return + +/obj/machinery/porta_turret/attack_alien(mob/living/carbon/alien/humanoid/M) + M.changeNext_move(CLICK_CD_MELEE) + M.do_attack_animation(src) + if(!(stat & BROKEN)) + playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1) + visible_message("[M] has slashed at [src]!") + add_logs(M, src, "attacked") + take_damage(15) + else + M << "That object is useless to you." + return /obj/machinery/porta_turret/emag_act(user as mob) if(!emagged)