diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index fc19325e594..fe9b20e0e69 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -5,6 +5,7 @@ density = 1 anchored = 1 use_power = NO_POWER_USE + max_integrity = 100 var/obj/item/circuitboard/circuit = null var/list/components = null var/list/req_components = null @@ -15,6 +16,19 @@ var/list/connected_parts = list() var/pattern_idx=0 +/obj/machinery/constructable_frame/deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/metal(src.loc, 5) + if(state >= 3) + var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil(loc) + A.amount = 5 + if(circuit) + circuit.forceMove(loc) + circuit = null + return ..() + +/obj/machinery/constructable_frame/obj_break(damage_flag) + deconstruct() + // unfortunately, we have to instance the objects really quickly to get the names // fortunately, this is only called once when the board is added and the items are immediately GC'd // and none of the parts do much in their constructors @@ -89,8 +103,7 @@ if(istype(P, /obj/item/wrench)) playsound(src.loc, P.usesound, 75, 1) to_chat(user, "You dismantle the frame.") - new /obj/item/stack/sheet/metal(src.loc, 5) - qdel(src) + deconstruct(TRUE) if(2) if(istype(P, /obj/item/circuitboard)) var/obj/item/circuitboard/B = P diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 8ba96d65e82..ccbd37f2f4c 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -18,7 +18,7 @@ var/check_friendly_fire = 0 // Should the ranged mob check for friendlies when shooting var/retreat_distance = null //If our mob runs from players when they're too close, set in tile distance. By default, mobs do not retreat. var/minimum_distance = 1 //Minimum approach distance, so ranged mobs chase targets down, but still keep their distance set in tiles to the target, set higher to make mobs keep distance - + //These vars are related to how mobs locate and target var/robust_searching = 0 //By default, mobs have a simple searching method, set this to 1 for the more scrutinous searching (stat_attack, stat_exclusive, etc), should be disabled on most mobs var/vision_range = 9 //How big of an area to search for targets in, a vision of 9 attempts to find targets as soon as they walk into screen view @@ -42,6 +42,7 @@ /obj/structure/girder, /obj/structure/rack, /obj/structure/computerframe, + /obj/machinery/constructable_frame, /obj/structure/barricade) //turned into a typecache in New() var/atom/targets_from = null //all range/attack/etc. calculations should be done from this atom, defaults to the mob itself, useful for Vehicles and such var/list/emote_taunt = list()