From 848b12db64e97a368012df888944c49d150b4671 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 5 Mar 2018 14:38:30 -0600 Subject: [PATCH] [MIRROR] [READY]Hostile mobs can attack assemblies (#5821) * [READY]Hostile mobs can attack assemblies (#36157) * new fenotype * attack * Update items.dm * Update assemblies.dm * Update assemblies.dm * Update items.dm * [READY]Hostile mobs can attack assemblies --- code/game/objects/items.dm | 4 +++- code/modules/mob/living/simple_animal/hostile/hostile.dm | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index b21d95e7ab..0cd102cb5a 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -674,6 +674,8 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) return 0 /obj/item/attack_animal(mob/living/simple_animal/M) + if (obj_flags & CAN_BE_HIT) + return ..() return 0 /obj/item/mech_melee_attack(obj/mecha/M) @@ -820,4 +822,4 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) // Returns a numeric value for sorting items used as parts in machines, so they can be replaced by the rped /obj/item/proc/get_part_rating() - return 0 \ No newline at end of file + return 0 diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 8207f321cd..edb6e47ca8 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -106,7 +106,7 @@ if(!search_objects) . = hearers(vision_range, targets_from) - src //Remove self, so we don't suicide - var/static/hostile_machines = typecacheof(list(/obj/machinery/porta_turret, /obj/mecha, /obj/structure/destructible/clockwork/ocular_warden)) + var/static/hostile_machines = typecacheof(list(/obj/machinery/porta_turret, /obj/mecha, /obj/structure/destructible/clockwork/ocular_warden,/obj/item/device/electronic_assembly)) for(var/HM in typecache_filter_list(range(vision_range, targets_from), hostile_machines)) if(can_see(targets_from, HM, vision_range)) @@ -209,6 +209,11 @@ return FALSE return TRUE + if(istype(the_target, /obj/item/device/electronic_assembly)) + var/obj/item/device/electronic_assembly/O = the_target + if(O.combat_circuits) + return TRUE + if(istype(the_target, /obj/structure/destructible/clockwork/ocular_warden)) var/obj/structure/destructible/clockwork/ocular_warden/OW = the_target if(OW.target != src)