diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index c72cfe1dbda..83c7bdf8b9f 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -4,10 +4,30 @@ name = "computer frame" icon = 'icons/obj/stock_parts.dmi' icon_state = "0" + max_integrity = 100 var/state = 0 var/obj/item/circuitboard/circuit = null + var/base_mineral = /obj/item/stack/sheet/metal // weight = 1.0E8 +/obj/structure/computerframe/deconstruct(disassembled = TRUE) + drop_computer_parts() + return ..() // will qdel the frame + +/obj/structure/computerframe/obj_break(damage_flag) + deconstruct() + +/obj/structure/computerframe/proc/drop_computer_parts() + new base_mineral(loc, 5) + if(circuit) + circuit.forceMove(loc) + circuit = null + if(state >= 3) + var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc ) + A.amount = 5 + if(state >= 4) + new /obj/item/stack/sheet/glass(loc, 2) + /obj/item/circuitboard density = 0 anchored = 0 @@ -420,8 +440,7 @@ if(do_after(user, 20 * WT.toolspeed, target = src)) if(!src || !WT.isOn()) return to_chat(user, "You deconstruct the frame.") - new /obj/item/stack/sheet/metal(loc, 5) - qdel(src) + deconstruct(TRUE) if(1) if(istype(P, /obj/item/wrench)) playsound(loc, P.usesound, 50, 1) @@ -525,6 +544,7 @@ /obj/structure/computerframe/HONKputer name = "Bananium Computer-frame" icon = 'icons/obj/machines/HONKputer.dmi' + base_mineral = /obj/item/stack/sheet/mineral/bananium /obj/structure/computerframe/HONKputer/attackby(obj/item/P as obj, mob/user as mob, params) switch(state) @@ -544,8 +564,7 @@ if(do_after(user, 20 * WT.toolspeed, target = src)) if(!src || !WT.isOn()) return to_chat(user, "You deconstruct the frame.") - new /obj/item/stack/sheet/mineral/bananium(loc, 5) - qdel(src) + deconstruct(TRUE) if(1) if(istype(P, /obj/item/wrench)) playsound(loc, P.usesound, 50, 1) 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 ad20789fa41..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 @@ -41,6 +41,8 @@ /obj/structure/grille, /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()