mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Refactors how machines are deconstructed (#81291)
## About The Pull Request This refactors how machines are deconstructed in the following ways - You can no longer override `obj/machinery/deconstruct()`. If you want customized behaviour then override `on_deconstruction()` instead. This comes with the added benifit of no longer needing to check for the `NO_DECONSTRUCTION` flag because the machine base proc does that for us & if it finds that flag it won't proceed to call `on_deconstruction()` meaning no machine will have a chance to spawn anything which is the current behaviour. This is required to make #81290 work for all machines at least so that machine can send the `COMSIG_OBJ_DECONSTRUCT` signal without subtypes overriding & forgetting to call the parent proc - `dump_contents()` only gets called when the machine is deconstructed not destroyed thus not leaving behind any of its contents inside. Fixes https://github.com/tgstation/tgstation/pull/81290#issuecomment-1925752583 ## Changelog 🆑 fix: machines that should not drop contents when deleted no longer do. refactor: refactors how machines are deconstructed. report bugs on github. /🆑 --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
QDEL_NULL(stored_id_card)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/pdapainter/on_deconstruction()
|
||||
/obj/machinery/pdapainter/on_deconstruction(disassembled)
|
||||
// Don't use ejection procs as we're gonna be destroyed anyway, so no need to update icons or anything.
|
||||
if(stored_pda)
|
||||
stored_pda.forceMove(loc)
|
||||
|
||||
@@ -198,9 +198,8 @@
|
||||
end_processing()
|
||||
|
||||
clear_components()
|
||||
dump_contents()
|
||||
|
||||
unset_static_power()
|
||||
|
||||
return ..()
|
||||
|
||||
/**
|
||||
@@ -818,11 +817,15 @@
|
||||
deconstruct(TRUE)
|
||||
|
||||
/obj/machinery/deconstruct(disassembled = TRUE)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
|
||||
if(obj_flags & NO_DECONSTRUCTION)
|
||||
dump_contents() //drop everything inside us
|
||||
return ..() //Just delete us, no need to call anything else.
|
||||
|
||||
on_deconstruction()
|
||||
on_deconstruction(disassembled)
|
||||
if(!LAZYLEN(component_parts))
|
||||
dump_contents() //drop everything inside us
|
||||
return ..() //we don't have any parts.
|
||||
spawn_frame(disassembled)
|
||||
|
||||
@@ -841,8 +844,12 @@
|
||||
continue
|
||||
var/obj/item/stack/stack_path = component
|
||||
new stack_path(loc, board.req_components[component])
|
||||
|
||||
LAZYCLEARLIST(component_parts)
|
||||
|
||||
//drop everything inside us. we do this last to give machines a chance
|
||||
//to handle their contents before we dump them
|
||||
dump_contents()
|
||||
|
||||
return ..()
|
||||
|
||||
/**
|
||||
@@ -1128,8 +1135,14 @@
|
||||
/obj/machinery/proc/on_construction(mob/user)
|
||||
return
|
||||
|
||||
//called on deconstruction before the final deletion
|
||||
/obj/machinery/proc/on_deconstruction()
|
||||
/**
|
||||
* called on deconstruction before the final deletion
|
||||
* Arguments
|
||||
*
|
||||
* * disassembled - if TRUE means we used tools to deconstruct it, FALSE means it got destroyed by other means
|
||||
*/
|
||||
/obj/machinery/proc/on_deconstruction(disassembled)
|
||||
PROTECTED_PROC(TRUE)
|
||||
return
|
||||
|
||||
/obj/machinery/proc/can_be_overridden()
|
||||
|
||||
@@ -91,15 +91,12 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)
|
||||
if((machine_stat & BROKEN) && !(obj_flags & NO_DECONSTRUCTION))
|
||||
set_sign(new /datum/barsign/hiddensigns/signoff)
|
||||
|
||||
/obj/machinery/barsign/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
if(disassembled)
|
||||
new disassemble_result(drop_location())
|
||||
else
|
||||
new /obj/item/stack/sheet/iron(drop_location(), 2)
|
||||
new /obj/item/stack/cable_coil(drop_location(), 2)
|
||||
|
||||
qdel(src)
|
||||
/obj/machinery/barsign/on_deconstruction(disassembled)
|
||||
if(disassembled)
|
||||
new disassemble_result(drop_location())
|
||||
else
|
||||
new /obj/item/stack/sheet/iron(drop_location(), 2)
|
||||
new /obj/item/stack/cable_coil(drop_location(), 2)
|
||||
|
||||
/obj/machinery/barsign/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
|
||||
switch(damage_type)
|
||||
|
||||
@@ -443,21 +443,20 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/camera/xray, 0)
|
||||
triggerCameraAlarm()
|
||||
toggle_cam(null, 0)
|
||||
|
||||
/obj/machinery/camera/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
if(disassembled)
|
||||
var/obj/structure/camera_assembly/assembly = assembly_ref?.resolve()
|
||||
if(!assembly)
|
||||
assembly = new()
|
||||
assembly.forceMove(drop_location())
|
||||
assembly.state = 1
|
||||
assembly.setDir(dir)
|
||||
assembly_ref = null
|
||||
else
|
||||
var/obj/item/I = new /obj/item/wallframe/camera (loc)
|
||||
I.update_integrity(I.max_integrity * 0.5)
|
||||
new /obj/item/stack/cable_coil(loc, 2)
|
||||
qdel(src)
|
||||
/obj/machinery/camera/on_deconstruction(disassembled)
|
||||
if(disassembled)
|
||||
var/obj/structure/camera_assembly/assembly = assembly_ref?.resolve()
|
||||
if(!assembly)
|
||||
assembly = new()
|
||||
assembly.forceMove(drop_location())
|
||||
assembly.state = 1
|
||||
assembly.setDir(dir)
|
||||
assembly_ref = null
|
||||
return
|
||||
|
||||
var/obj/item/I = new /obj/item/wallframe/camera (loc)
|
||||
I.update_integrity(I.max_integrity * 0.5)
|
||||
new /obj/item/stack/cable_coil(loc, 2)
|
||||
|
||||
/obj/machinery/camera/update_icon_state() //TO-DO: Make panel open states, xray camera, and indicator lights overlays instead.
|
||||
var/xray_module
|
||||
|
||||
@@ -72,10 +72,9 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/cell_charger/deconstruct()
|
||||
/obj/machinery/cell_charger/on_deconstruction(disassembled)
|
||||
if(charging)
|
||||
charging.forceMove(drop_location())
|
||||
return ..()
|
||||
|
||||
/obj/machinery/cell_charger/Destroy()
|
||||
QDEL_NULL(charging)
|
||||
|
||||
@@ -98,33 +98,25 @@
|
||||
if(prob(10))
|
||||
atom_break(ENERGY)
|
||||
|
||||
/obj/machinery/computer/deconstruct(disassembled = TRUE, mob/user)
|
||||
on_deconstruction()
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
if(circuit) //no circuit, no computer frame
|
||||
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer(src.loc)
|
||||
A.setDir(dir)
|
||||
A.circuit = circuit
|
||||
// Circuit removal code is handled in /obj/machinery/Exited()
|
||||
circuit.forceMove(A)
|
||||
A.set_anchored(TRUE)
|
||||
if(machine_stat & BROKEN)
|
||||
if(user)
|
||||
to_chat(user, span_notice("The broken glass falls out."))
|
||||
else
|
||||
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, TRUE)
|
||||
new /obj/item/shard(drop_location())
|
||||
new /obj/item/shard(drop_location())
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
else
|
||||
if(user)
|
||||
to_chat(user, span_notice("You disconnect the monitor."))
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
for(var/obj/C in src)
|
||||
C.forceMove(loc)
|
||||
qdel(src)
|
||||
/obj/machinery/computer/spawn_frame(disassembled)
|
||||
if(QDELETED(circuit)) //no circuit, no computer frame
|
||||
return
|
||||
|
||||
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer(src.loc)
|
||||
A.setDir(dir)
|
||||
A.circuit = circuit
|
||||
// Circuit removal code is handled in /obj/machinery/Exited()
|
||||
circuit.forceMove(A)
|
||||
A.set_anchored(TRUE)
|
||||
if(machine_stat & BROKEN)
|
||||
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, TRUE)
|
||||
new /obj/item/shard(drop_location())
|
||||
new /obj/item/shard(drop_location())
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
else
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
|
||||
/obj/machinery/computer/AltClick(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -138,6 +138,6 @@
|
||||
QDEL_NULL(occupier)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/aifixer/on_deconstruction()
|
||||
/obj/machinery/computer/aifixer/on_deconstruction(disassembled)
|
||||
if(occupier)
|
||||
QDEL_NULL(occupier)
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
/// ID card currently inserted into the computer.
|
||||
VAR_FINAL/obj/item/card/id/advanced/prisoner/contained_id
|
||||
|
||||
/obj/machinery/computer/prisoner/deconstruct(disassembled, mob/user)
|
||||
/obj/machinery/computer/prisoner/on_deconstruction(disassembled)
|
||||
contained_id?.forceMove(drop_location())
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/prisoner/Destroy()
|
||||
QDEL_NULL(contained_id)
|
||||
|
||||
@@ -21,10 +21,8 @@
|
||||
result_path = /obj/machinery/computer/security/telescreen
|
||||
pixel_shift = 32
|
||||
|
||||
/obj/machinery/computer/security/telescreen/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
new frame_type(loc)
|
||||
qdel(src)
|
||||
/obj/machinery/computer/security/telescreen/on_deconstruction(disassembled)
|
||||
new frame_type(loc)
|
||||
|
||||
/obj/machinery/computer/security/telescreen/update_icon_state()
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
@@ -69,16 +69,13 @@
|
||||
. = ..()
|
||||
emag_act()
|
||||
|
||||
/obj/machinery/digital_clock/deconstruct(disassembled = TRUE)
|
||||
if(obj_flags & NO_DECONSTRUCTION)
|
||||
return
|
||||
/obj/machinery/digital_clock/on_deconstruction(disassembled)
|
||||
if(disassembled)
|
||||
new /obj/item/wallframe/digital_clock(drop_location())
|
||||
else
|
||||
new /obj/item/stack/sheet/iron(drop_location(), 2)
|
||||
new /obj/item/shard(drop_location())
|
||||
new /obj/item/shard(drop_location())
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/digital_clock/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
@@ -1511,38 +1511,32 @@
|
||||
assembly.update_name()
|
||||
assembly.update_appearance()
|
||||
|
||||
/obj/machinery/door/airlock/deconstruct(disassembled = TRUE, mob/user)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
var/obj/structure/door_assembly/A
|
||||
if(assemblytype)
|
||||
A = new assemblytype(loc)
|
||||
else
|
||||
A = new /obj/structure/door_assembly(loc)
|
||||
//If you come across a null assemblytype, it will produce the default assembly instead of disintegrating.
|
||||
prepare_deconstruction_assembly(A)
|
||||
/obj/machinery/door/airlock/on_deconstruction(disassembled)
|
||||
var/obj/structure/door_assembly/A
|
||||
if(assemblytype)
|
||||
A = new assemblytype(loc)
|
||||
else
|
||||
A = new /obj/structure/door_assembly(loc)
|
||||
//If you come across a null assemblytype, it will produce the default assembly instead of disintegrating.
|
||||
prepare_deconstruction_assembly(A)
|
||||
|
||||
if(!disassembled)
|
||||
A?.update_integrity(A.max_integrity * 0.5)
|
||||
else if(obj_flags & EMAGGED)
|
||||
if(user)
|
||||
to_chat(user, span_warning("You discard the damaged electronics."))
|
||||
else
|
||||
if(user)
|
||||
to_chat(user, span_notice("You remove the airlock electronics."))
|
||||
|
||||
var/obj/item/electronics/airlock/ae
|
||||
if(!electronics)
|
||||
ae = new/obj/item/electronics/airlock(loc)
|
||||
if(length(req_one_access))
|
||||
ae.one_access = 1
|
||||
ae.accesses = req_one_access
|
||||
else
|
||||
ae.accesses = req_access
|
||||
if(!disassembled)
|
||||
A?.update_integrity(A.max_integrity * 0.5)
|
||||
else if(obj_flags & EMAGGED)
|
||||
//no electronics nothing
|
||||
else
|
||||
var/obj/item/electronics/airlock/ae
|
||||
if(!electronics)
|
||||
ae = new/obj/item/electronics/airlock(loc)
|
||||
if(length(req_one_access))
|
||||
ae.one_access = 1
|
||||
ae.accesses = req_one_access
|
||||
else
|
||||
ae = electronics
|
||||
electronics = null
|
||||
ae.forceMove(drop_location())
|
||||
qdel(src)
|
||||
ae.accesses = req_access
|
||||
else
|
||||
ae = electronics
|
||||
electronics = null
|
||||
ae.forceMove(drop_location())
|
||||
|
||||
/obj/machinery/door/airlock/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
||||
switch(the_rcd.mode)
|
||||
|
||||
@@ -658,20 +658,18 @@
|
||||
if(old_activity != active) //Something changed while we were sleeping
|
||||
correct_state() //So we should re-evaluate our state
|
||||
|
||||
/obj/machinery/door/firedoor/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
var/turf/targetloc = get_turf(src)
|
||||
if(disassembled || prob(40))
|
||||
var/obj/structure/firelock_frame/unbuilt_lock = new assemblytype(targetloc)
|
||||
if(disassembled)
|
||||
unbuilt_lock.constructionStep = CONSTRUCTION_PANEL_OPEN
|
||||
else
|
||||
unbuilt_lock.constructionStep = CONSTRUCTION_NO_CIRCUIT
|
||||
unbuilt_lock.update_integrity(unbuilt_lock.max_integrity * 0.5)
|
||||
unbuilt_lock.update_appearance()
|
||||
/obj/machinery/door/firedoor/on_deconstruction(disassembled)
|
||||
var/turf/targetloc = get_turf(src)
|
||||
if(disassembled || prob(40))
|
||||
var/obj/structure/firelock_frame/unbuilt_lock = new assemblytype(targetloc)
|
||||
if(disassembled)
|
||||
unbuilt_lock.constructionStep = CONSTRUCTION_PANEL_OPEN
|
||||
else
|
||||
new /obj/item/electronics/firelock (targetloc)
|
||||
qdel(src)
|
||||
unbuilt_lock.constructionStep = CONSTRUCTION_NO_CIRCUIT
|
||||
unbuilt_lock.update_integrity(unbuilt_lock.max_integrity * 0.5)
|
||||
unbuilt_lock.update_appearance()
|
||||
else
|
||||
new /obj/item/electronics/firelock (targetloc)
|
||||
|
||||
/obj/machinery/door/firedoor/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
|
||||
. = ..()
|
||||
|
||||
@@ -301,15 +301,16 @@
|
||||
playsound(src, 'sound/items/welder.ogg', 100, TRUE)
|
||||
|
||||
|
||||
/obj/machinery/door/window/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION) && !disassembled)
|
||||
for(var/i in 1 to shards)
|
||||
drop_debris(new /obj/item/shard(src))
|
||||
if(rods)
|
||||
drop_debris(new /obj/item/stack/rods(src, rods))
|
||||
if(cable)
|
||||
drop_debris(new /obj/item/stack/cable_coil(src, cable))
|
||||
qdel(src)
|
||||
/obj/machinery/door/window/on_deconstruction(disassembled)
|
||||
if(disassembled)
|
||||
return
|
||||
|
||||
for(var/i in 1 to shards)
|
||||
drop_debris(new /obj/item/shard(src))
|
||||
if(rods)
|
||||
drop_debris(new /obj/item/stack/rods(src, rods))
|
||||
if(cable)
|
||||
drop_debris(new /obj/item/stack/cable_coil(src, cable))
|
||||
|
||||
/obj/machinery/door/window/proc/drop_debris(obj/item/debris)
|
||||
debris.forceMove(loc)
|
||||
|
||||
@@ -260,11 +260,6 @@
|
||||
if(break_sound)
|
||||
playsound(src, break_sound, 50, TRUE)
|
||||
|
||||
/obj/machinery/drone_dispenser/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
new /obj/item/stack/sheet/iron(loc, 5)
|
||||
qdel(src)
|
||||
|
||||
#undef DRONE_PRODUCTION
|
||||
#undef DRONE_RECHARGING
|
||||
#undef DRONE_READY
|
||||
|
||||
@@ -440,16 +440,14 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/firealarm/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
new /obj/item/stack/sheet/iron(loc, 1)
|
||||
if(buildstage > FIRE_ALARM_BUILD_NO_CIRCUIT)
|
||||
var/obj/item/item = new /obj/item/electronics/firealarm(loc)
|
||||
if(!disassembled)
|
||||
item.update_integrity(item.max_integrity * 0.5)
|
||||
if(buildstage > FIRE_ALARM_BUILD_NO_WIRES)
|
||||
new /obj/item/stack/cable_coil(loc, 3)
|
||||
qdel(src)
|
||||
/obj/machinery/firealarm/on_deconstruction(disassembled)
|
||||
new /obj/item/stack/sheet/iron(loc, 1)
|
||||
if(buildstage > FIRE_ALARM_BUILD_NO_CIRCUIT)
|
||||
var/obj/item/item = new /obj/item/electronics/firealarm(loc)
|
||||
if(!disassembled)
|
||||
item.update_integrity(item.max_integrity * 0.5)
|
||||
if(buildstage > FIRE_ALARM_BUILD_NO_WIRES)
|
||||
new /obj/item/stack/cable_coil(loc, 3)
|
||||
|
||||
// Allows users to examine the state of the thermal sensor
|
||||
/obj/machinery/firealarm/examine(mob/user)
|
||||
|
||||
@@ -144,18 +144,16 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/flasher, 26)
|
||||
bulb.burn_out()
|
||||
power_change()
|
||||
|
||||
/obj/machinery/flasher/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
if(bulb)
|
||||
bulb.forceMove(loc)
|
||||
if(disassembled)
|
||||
var/obj/item/wallframe/flasher/flasher_obj = new(get_turf(src))
|
||||
transfer_fingerprints_to(flasher_obj)
|
||||
flasher_obj.id = id
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
else
|
||||
new /obj/item/stack/sheet/iron (loc, 2)
|
||||
qdel(src)
|
||||
/obj/machinery/flasher/on_deconstruction(disassembled)
|
||||
if(bulb)
|
||||
bulb.forceMove(loc)
|
||||
if(disassembled)
|
||||
var/obj/item/wallframe/flasher/flasher_obj = new(get_turf(src))
|
||||
transfer_fingerprints_to(flasher_obj)
|
||||
flasher_obj.id = id
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
else
|
||||
new /obj/item/stack/sheet/iron (loc, 2)
|
||||
|
||||
/obj/machinery/flasher/portable //Portable version of the flasher. Only flashes when anchored
|
||||
name = "portable flasher"
|
||||
|
||||
@@ -55,11 +55,9 @@
|
||||
deconstruct(TRUE)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/machinery/igniter/deconstruct(disassembled)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
new /obj/item/stack/sheet/iron(loc, 5)
|
||||
new /obj/item/assembly/igniter(loc)
|
||||
return ..()
|
||||
/obj/machinery/igniter/on_deconstruction(disassembled)
|
||||
new /obj/item/stack/sheet/iron(loc, 5)
|
||||
new /obj/item/assembly/igniter(loc)
|
||||
|
||||
/obj/machinery/igniter/multitool_act(mob/living/user, obj/item/tool)
|
||||
var/change_id = tgui_input_number(user, "Set the igniter controller's ID", "Igniter ID", id, 100)
|
||||
@@ -200,10 +198,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/sparker, 26)
|
||||
deconstruct(TRUE)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/machinery/sparker/deconstruct(disassembled)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
new /obj/item/wallframe/sparker(loc)
|
||||
return ..()
|
||||
/obj/machinery/sparker/on_deconstruction(disassembled)
|
||||
new /obj/item/wallframe/sparker(loc)
|
||||
|
||||
/obj/machinery/sparker/multitool_act(mob/living/user, obj/item/tool)
|
||||
var/change_id = tgui_input_number(user, "Set the sparker controller's ID", "Sparker ID", id, 100)
|
||||
|
||||
@@ -164,16 +164,11 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/incident_display/tram, 32)
|
||||
delam_record = rand(1,99)
|
||||
update_appearance()
|
||||
|
||||
/obj/machinery/incident_display/deconstruct()
|
||||
if(obj_flags & NO_DECONSTRUCTION)
|
||||
return
|
||||
|
||||
/obj/machinery/incident_display/on_deconstruction(disassembled)
|
||||
new /obj/item/stack/sheet/mineral/titanium(drop_location(), 2)
|
||||
new /obj/item/shard(drop_location())
|
||||
new /obj/item/shard(drop_location())
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/incident_display/proc/update_delam_count(new_count, record)
|
||||
delam_record = record
|
||||
last_delam = min(new_count, 199)
|
||||
|
||||
@@ -217,10 +217,8 @@
|
||||
return ..()
|
||||
set_transfer_rate(transfer_rate > MIN_IV_TRANSFER_RATE ? MIN_IV_TRANSFER_RATE : MAX_IV_TRANSFER_RATE)
|
||||
|
||||
/obj/machinery/iv_drip/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
new /obj/item/stack/sheet/iron(loc)
|
||||
qdel(src)
|
||||
/obj/machinery/iv_drip/on_deconstruction(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/iron(loc)
|
||||
|
||||
/obj/machinery/iv_drip/process(seconds_per_tick)
|
||||
if(!attached)
|
||||
|
||||
@@ -107,10 +107,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light_switch, 26)
|
||||
if(!(machine_stat & (BROKEN|NOPOWER)))
|
||||
power_change()
|
||||
|
||||
/obj/machinery/light_switch/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
new /obj/item/wallframe/light_switch(loc)
|
||||
qdel(src)
|
||||
/obj/machinery/light_switch/on_deconstruction(disassembled)
|
||||
new /obj/item/wallframe/light_switch(loc)
|
||||
|
||||
/obj/item/wallframe/light_switch
|
||||
name = "light switch"
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/limbgrower/on_deconstruction()
|
||||
/obj/machinery/limbgrower/on_deconstruction(disassembled)
|
||||
for(var/obj/item/reagent_containers/cup/our_beaker in component_parts)
|
||||
reagents.trans_to(our_beaker, our_beaker.reagents.maximum_volume)
|
||||
return ..()
|
||||
|
||||
@@ -534,12 +534,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/newscaster, 30)
|
||||
playsound(src.loc, 'sound/items/welder.ogg', 100, TRUE)
|
||||
|
||||
|
||||
/obj/machinery/newscaster/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
new /obj/item/stack/sheet/iron(loc, 2)
|
||||
new /obj/item/shard(loc)
|
||||
new /obj/item/shard(loc)
|
||||
qdel(src)
|
||||
/obj/machinery/newscaster/on_deconstruction(disassembled)
|
||||
new /obj/item/stack/sheet/iron(loc, 2)
|
||||
new /obj/item/shard(loc)
|
||||
new /obj/item/shard(loc)
|
||||
|
||||
/obj/machinery/newscaster/atom_break(damage_flag)
|
||||
. = ..()
|
||||
|
||||
@@ -402,9 +402,6 @@ DEFINE_BITFIELD(turret_flags, list(
|
||||
/obj/machinery/porta_turret/proc/reset_attacked()
|
||||
turret_flags &= ~TURRET_FLAG_SHOOT_ALL_REACT
|
||||
|
||||
/obj/machinery/porta_turret/deconstruct(disassembled = TRUE)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/porta_turret/atom_break(damage_flag)
|
||||
. = ..()
|
||||
if(.)
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
L.Unconscious(100)
|
||||
L.adjustBruteLoss(crush_damage)
|
||||
|
||||
/obj/machinery/recycler/on_deconstruction()
|
||||
/obj/machinery/recycler/on_deconstruction(disassembled)
|
||||
safety_mode = TRUE
|
||||
|
||||
/obj/machinery/recycler/deathtrap
|
||||
|
||||
@@ -394,10 +394,8 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/requests_console/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
new /obj/item/wallframe/requests_console(loc)
|
||||
qdel(src)
|
||||
/obj/machinery/requests_console/on_deconstruction(disassembled)
|
||||
new /obj/item/wallframe/requests_console(loc)
|
||||
|
||||
/obj/machinery/requests_console/auto_name // Register an autoname variant and then make the directional helpers before undefing all the magic bits
|
||||
auto_name = TRUE
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
set_panel_open(TRUE)
|
||||
QDEL_NULL(cell)
|
||||
|
||||
/obj/machinery/space_heater/on_deconstruction()
|
||||
/obj/machinery/space_heater/on_deconstruction(disassembled)
|
||||
if(cell)
|
||||
LAZYADD(component_parts, cell)
|
||||
cell = null
|
||||
|
||||
@@ -72,16 +72,13 @@
|
||||
update_appearance()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/status_display/deconstruct(disassembled = TRUE)
|
||||
if(obj_flags & NO_DECONSTRUCTION)
|
||||
return
|
||||
/obj/machinery/status_display/on_deconstruction(disassembled)
|
||||
if(!disassembled)
|
||||
new /obj/item/stack/sheet/iron(drop_location(), 2)
|
||||
new /obj/item/shard(drop_location())
|
||||
new /obj/item/shard(drop_location())
|
||||
else
|
||||
new /obj/item/wallframe/status_display(drop_location())
|
||||
qdel(src)
|
||||
|
||||
/// Immediately change the display to the given picture.
|
||||
/obj/machinery/status_display/proc/set_picture(state)
|
||||
|
||||
@@ -307,13 +307,9 @@
|
||||
storage = null
|
||||
set_occupant(null)
|
||||
|
||||
/obj/machinery/suit_storage_unit/deconstruct(disassembled = TRUE)
|
||||
if(!(obj_flags & NO_DECONSTRUCTION))
|
||||
open_machine()
|
||||
dump_inventory_contents()
|
||||
if(card_reader_installed)
|
||||
new /obj/item/stock_parts/card_reader(loc)
|
||||
return ..()
|
||||
/obj/machinery/suit_storage_unit/on_deconstruction(disassembled)
|
||||
if(card_reader_installed)
|
||||
new /obj/item/stock_parts/card_reader(loc)
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/access_check(mob/living/user)
|
||||
if(!isnull(id_card))
|
||||
|
||||
@@ -415,10 +415,8 @@ GLOBAL_LIST_INIT(dye_registry, list(
|
||||
/obj/machinery/washing_machine/attack_ai_secondary(mob/user, modifiers)
|
||||
return attack_hand_secondary(user, modifiers)
|
||||
|
||||
/obj/machinery/washing_machine/deconstruct(disassembled = TRUE)
|
||||
if (!(obj_flags & NO_DECONSTRUCTION))
|
||||
new /obj/item/stack/sheet/iron(drop_location(), 2)
|
||||
qdel(src)
|
||||
/obj/machinery/washing_machine/on_deconstruction(disassembled)
|
||||
new /obj/item/stack/sheet/iron(drop_location(), 2)
|
||||
|
||||
/obj/machinery/washing_machine/open_machine(drop = TRUE, density_to_set = FALSE)
|
||||
. = ..()
|
||||
|
||||
@@ -410,7 +410,7 @@ effective or pretty fucking useless.
|
||||
|
||||
balloon_alert(user, "repaired!")
|
||||
|
||||
/obj/machinery/porta_turret/syndicate/toolbox/deconstruct(disassembled)
|
||||
/obj/machinery/porta_turret/syndicate/toolbox/on_deconstruction(disassembled)
|
||||
if(disassembled)
|
||||
var/atom/movable/old_toolbox = toolbox
|
||||
toolbox = null
|
||||
|
||||
@@ -315,11 +315,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/shower, (-16))
|
||||
|
||||
reagents.remove_any(SHOWER_SPRAY_VOLUME)
|
||||
|
||||
/obj/machinery/shower/deconstruct(disassembled = TRUE)
|
||||
/obj/machinery/shower/on_deconstruction(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/iron(drop_location(), 2)
|
||||
if(has_water_reclaimer)
|
||||
new /obj/item/stock_parts/water_recycler(drop_location())
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/shower/proc/check_heat(mob/living/L)
|
||||
var/mob/living/carbon/C = L
|
||||
|
||||
Reference in New Issue
Block a user