From 6dc40ca522d4d4d6a4f226fc9b6654052ded84ed Mon Sep 17 00:00:00 2001 From: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Date: Fri, 5 Apr 2024 06:25:51 +0530 Subject: [PATCH] Standardizes object deconstruction throughout the codebase. (#82280) ## About The Pull Request When it comes to deconstructing an object we have `proc/deconstruct()` & `NO_DECONSTRUCT` Lets talk about the flag first. **Problems with `NO_DECONSTRUCTION`** I know what the comment says on what it should do https://github.com/tgstation/tgstation/blob/b5593bc6930cb60803214869a7b94c84e7baa02c/code/__DEFINES/obj_flags.dm#L18 But everywhere people have decided to give their own meaning/definition to this flag. Here are some examples on how this flag is used **1. Make the object just disappear(not drop anything) when deconstructed** This is by far the largest use case everywhere. If an object is deconstructed(either via tools or smashed apart) then if it has this flag it should not drop any of its contents but just disappear. You have seen this code pattern used everywhere https://github.com/tgstation/tgstation/blob/b5593bc6930cb60803214869a7b94c84e7baa02c/code/game/machinery/constructable_frame.dm#L26-L31 This behaviour is then leveraged by 2 important components. When an object is frozen, if it is deconstructed it should just disappear without leaving any traces behind https://github.com/tgstation/tgstation/blob/b5593bc6930cb60803214869a7b94c84e7baa02c/code/datums/elements/frozen.dm#L66-L67 By hologram objects. Obviously if you destroy an hologram nothing real should drop out https://github.com/tgstation/tgstation/blob/b5593bc6930cb60803214869a7b94c84e7baa02c/code/modules/holodeck/computer.dm#L301-L304 And there are other use cases as well but we won't go into them as they aren't as significant as these. **2. To stop an object from being wrenched ??** Yeah this one is weird. Like why? I understand in some instances (chair, table, rack etc) a wrench can be used to deconstruct a object so using the flag there to stop it from happening makes sense but why can't we even anchor an object just because of this flag? https://github.com/tgstation/tgstation/blob/b5593bc6930cb60803214869a7b94c84e7baa02c/code/game/objects/objs.dm#L368-L369 This is one of those instances where somebody just decided this behaviour for their own convenience just like the above example with no explanation as to why **3. To stop using tools to deconstruct the object** This was the original intent of the flag but it is enforced in few places far & between. One example is when deconstructing the a machine via crowbar. https://github.com/tgstation/tgstation/blob/b5593bc6930cb60803214869a7b94c84e7baa02c/code/game/machinery/_machinery.dm#L811 But machines are a special dual use case for this flag. Because if you look at its deconstruct proc the flag also prevents the machine from spawning a frame. https://github.com/tgstation/tgstation/blob/b5593bc6930cb60803214869a7b94c84e7baa02c/code/game/machinery/_machinery.dm#L820-L822 How can 1 flag serve 2 purposes within the same type? **4. Simply forget to check for this flag altogether** Yup if you find this flag not doing its job for some objects don't be surprised. People & sometimes even maintainers just forget that it even exists https://github.com/tgstation/tgstation/blob/b5593bc6930cb60803214869a7b94c84e7baa02c/code/game/objects/items/piggy_bank.dm#L66-L67 **Solution** These are the main examples i found. As you can see the same flag can perform 2 different functions within the same type and do something else in a different object & in some instances don't even work cause people just forget, etc. In order to bring consistency to this flag we need to move it to the atom level where it means the same thing everywhere. Where in the atom you may ask? .Well, I'll just post what MrMelbert said in https://github.com/tgstation/tgstation/pull/81656#discussion_r1503086862 > ...Ideally the .deconstruct call would handle NO_DECONSTRUCTION handling as it wants, Yup that's the ideal case now. This flag is checked directly in `deconstruct()`. Now like i said we want to give a universal definition to this flag and as you have seen from my examples it is used in 3 cases 1) Make an object disappear(doesn't dropping anything) when deconstructed 2) Stop it from being wrenched 3) Stop it from being deconstructed via tools We can't enforce points 2 & 3 inside `deconstruct()` which leaves us with only case 1) i.e. make the object disappear. And that's what i have done. Therefore after more than a decade or since this flag got introduced `NO_DECONSTRUCT` now has a new definition as of 2024 _"Make an object disappear(don't dropping anything) when deconstructed either via tools or forcefully smashed apart"_ Now i very well understand this will open up bugs in places where cases 2 & 3 are required but its worth it. In fact they could even be qol changes for all we know so who knows it might even benefit us but for now we need to give a universal definition to this flag to bring some consistency & that's what this PR does. **Problem with deconstruct()** This proc actually sends out a signal which is currently used by the material container but could be used by other objects later on. https://github.com/tgstation/tgstation/blob/3e84c3e6dad33c831ac259f52f2f023680e4899b/code/game/objects/obj_defense.dm#L160 So objects that override this proc should call its parent. Sadly that isn't the case in many instances like such https://github.com/tgstation/tgstation/blob/3e84c3e6dad33c831ac259f52f2f023680e4899b/code/game/machinery/deployable.dm#L20-L23 Instead of `return ..()` which would delete the object & send the signal it deletes the object directly thus the signal never gets sent. **Solution** Make this proc non overridable. For objects to add their own custom deconstruction behaviour a new proc has been introduced `atom_deconstruct()` Subtypes should now override this proc to handle object deconstruction. If objects have certain important stuff inside them (like mobs in machines for example) they want to drop by handling `NO_DECONSTRUCT` flag in a more carefully customized way they can do this by overriding `handle_deconstruct()` which by default delegates to `atom_deconstruct()` if the `NO_DECONSTRUCT` flag is absent. This proc will allow you to handle the flag in a more customized way if you ever need to. ## Why It's Good For The Game 1) I'm goanna post the full comment from MrMelbert https://github.com/tgstation/tgstation/pull/81656#discussion_r1503086862 > ...Ideally the .deconstruct call would handle NO_DECONSTRUCTION handling as it wants, but there's a shocking lack of consistency around NO_DECONSTRUCTION, where some objects treat it as "allow deconstruction, but make it drop no parts" and others simply "disallow deconstruction at all" This PR now makes `NO_DECONSTRUCTION` handled by `deconstruct()` & gives this flag the consistency it deserves. Not to mention as shown in case 4 there are objects that simply forgot to check for this flag. Now it applies for those missing instances as well. 2) No more copying pasting the most overused code pattern in this code base history `if(obj_flags & NO_DECONSTRUCTION)`. Just makes code cleaner everywhere 3) All objects now send the `COMSIG_OBJ_DECONSTRUCT` signal on object deconstruction which is now available for use should you need it ## Changelog :cl: refactor: refactors how objects are deconstructed in relation to the `NO_DECONSTRUCTION` flag. Certain objects & machinery may display different tool interactions & behaviours when destroyed/deconstructed. Report these changes if you feel like they are bugs /:cl: --------- Co-authored-by: san7890 --- code/__DEFINES/obj_flags.dm | 2 +- code/datums/elements/screentips/README.md | 19 ++-- code/game/machinery/_machinery.dm | 20 ++--- code/game/machinery/barsigns.dm | 2 +- code/game/machinery/camera/camera.dm | 33 ++++--- code/game/machinery/computer/_computer.dm | 2 +- .../computer/atmos_computers/_air_sensor.dm | 8 +- .../game/machinery/computer/buildandrepair.dm | 22 +++-- code/game/machinery/constructable_frame.dm | 13 +-- code/game/machinery/dance_machine.dm | 2 - code/game/machinery/deployable.dm | 9 +- code/game/machinery/doors/windowdoor.dm | 4 - code/game/machinery/harvester.dm | 2 +- code/game/machinery/hologram.dm | 8 +- code/game/machinery/limbgrower.dm | 1 - code/game/machinery/machine_frame.dm | 9 +- code/game/machinery/sleepers.dm | 2 +- code/game/machinery/suit_storage_unit.dm | 6 +- .../machinery/telecomms/machines/allinone.dm | 6 ++ code/game/objects/items/cardboard_cutouts.dm | 6 +- code/game/objects/items/grenades/_grenade.dm | 4 +- code/game/objects/items/piggy_bank.dm | 2 +- code/game/objects/items/rcd/RCD.dm | 5 ++ code/game/objects/items/surgery_tray.dm | 10 +-- code/game/objects/items/tanks/tanks.dm | 2 +- code/game/objects/obj_defense.dm | 41 ++++++++- code/game/objects/objs.dm | 2 - code/game/objects/structures/ai_core.dm | 3 +- code/game/objects/structures/aliens.dm | 11 +-- .../structures/beds_chairs/alien_nest.dm | 10 ++- .../objects/structures/beds_chairs/bed.dm | 16 ++-- .../objects/structures/beds_chairs/chair.dm | 25 +++--- code/game/objects/structures/bedsheet_bin.dm | 2 - .../structures/crates_lockers/closets.dm | 28 +++--- .../crates_lockers/closets/secure/freezer.dm | 6 +- .../structures/destructible_structures.dm | 21 ++--- code/game/objects/structures/displaycase.dm | 16 ++-- code/game/objects/structures/door_assembly.dm | 33 ++++--- .../objects/structures/door_assembly_types.dm | 31 +++---- code/game/objects/structures/dresser.dm | 6 +- code/game/objects/structures/extinguisher.dm | 20 ++--- code/game/objects/structures/false_walls.dm | 28 +++--- code/game/objects/structures/fans.dm | 14 +-- code/game/objects/structures/fireaxe.dm | 22 ++--- code/game/objects/structures/flora.dm | 10 +-- code/game/objects/structures/girders.dm | 14 ++- code/game/objects/structures/grille.dm | 21 ++--- code/game/objects/structures/headpike.dm | 3 +- .../structures/icemoon/cave_entrance.dm | 3 +- code/game/objects/structures/kitchen_spike.dm | 3 +- code/game/objects/structures/lattice.dm | 9 +- .../structures/lavaland/necropolis_tendril.dm | 3 +- code/game/objects/structures/maintenance.dm | 8 +- code/game/objects/structures/mineral_doors.dm | 4 +- code/game/objects/structures/mirror.dm | 14 ++- code/game/objects/structures/morgue.dm | 9 +- code/game/objects/structures/noticeboard.dm | 12 ++- .../objects/structures/petrified_statue.dm | 3 +- code/game/objects/structures/pinatas.dm | 5 +- code/game/objects/structures/plasticflaps.dm | 6 +- code/game/objects/structures/railings.dm | 7 +- code/game/objects/structures/secure_safe.dm | 3 +- code/game/objects/structures/shower.dm | 3 - code/game/objects/structures/stairs.dm | 3 +- code/game/objects/structures/table_frames.dm | 3 +- code/game/objects/structures/tables_racks.dm | 88 +++++++------------ .../game/objects/structures/tank_dispenser.dm | 12 ++- code/game/objects/structures/tank_holder.dm | 3 +- .../transit_tubes/transit_tube_pod.dm | 20 ++--- code/game/objects/structures/votingbox.dm | 3 +- code/game/objects/structures/watercloset.dm | 55 +++++------- code/game/objects/structures/window.dm | 29 ++---- .../heretic/structures/mawed_crucible.dm | 3 +- code/modules/art/statues.dm | 33 +++---- .../atmospherics/machinery/components/tank.dm | 3 +- code/modules/economy/holopay.dm | 3 +- .../food_and_drinks/machinery/griddle.dm | 2 - code/modules/holodeck/items.dm | 2 +- code/modules/hydroponics/beekeeping/beebox.dm | 3 +- code/modules/hydroponics/hydroponics.dm | 6 ++ code/modules/library/bookcase.dm | 3 +- .../lavalandruin_code/elephantgraveyard.dm | 2 +- .../ruins/objects_and_mobs/ash_walker_den.dm | 3 +- code/modules/mining/abandoned_crates.dm | 2 +- .../mining/equipment/marker_beacons.dm | 10 +-- code/modules/mining/equipment/survival_pod.dm | 2 - code/modules/mining/satchel_ore_box.dm | 4 +- .../gutlunchers/gutluncher_foodtrough.dm | 5 +- code/modules/mob/living/brain/MMI.dm | 3 +- .../computers/item/computer.dm | 20 ++--- code/modules/paperwork/filingcabinet.dm | 10 +-- code/modules/paperwork/paper_cutter.dm | 3 +- code/modules/paperwork/paperbin.dm | 2 +- code/modules/photography/photos/frame.dm | 21 ++--- code/modules/power/cable.dm | 8 +- .../modules/power/lighting/light_construct.dm | 6 +- code/modules/power/pipecleaners.dm | 16 ++-- .../chemistry/machinery/chem_dispenser.dm | 8 +- code/modules/reagents/reagent_dispenser.dm | 9 +- code/modules/recycling/disposal/pipe.dm | 40 ++++----- code/modules/recycling/sortingmachinery.dm | 3 +- code/modules/surgery/bodyparts/_bodyparts.dm | 3 +- .../modules/transport/tram/tram_structures.dm | 14 ++- code/modules/vending/_vending.dm | 2 +- code/modules/wiremod/shell/dispenser.dm | 3 +- code/modules/wiremod/shell/moneybot.dm | 3 +- 106 files changed, 488 insertions(+), 662 deletions(-) diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index 8ace303b843..469811c96dc 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -15,7 +15,7 @@ #define IGNORE_DENSITY (1<<11) //! Can we ignore density when building on this object? (for example, directional windows and grilles) #define INFINITE_RESKIN (1<<12) // We can reskin this item infinitely #define CONDUCTS_ELECTRICITY (1<<13) //! Can this object conduct electricity? -#define NO_DECONSTRUCTION (1<<14) //! Prevent deconstruction of this object. +#define NO_DECONSTRUCTION (1<<14) //! Atoms don't spawn anything when deconstructed. They just vanish // If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support diff --git a/code/datums/elements/screentips/README.md b/code/datums/elements/screentips/README.md index 92a66ca9dd4..30d0e7a90cc 100644 --- a/code/datums/elements/screentips/README.md +++ b/code/datums/elements/screentips/README.md @@ -35,18 +35,17 @@ Example: ```dm /obj/structure/table/Initialize(mapload) - if (!(obj_flags & NO_DECONSTRUCTION)) - var/static/list/tool_behaviors = list( - TOOL_SCREWDRIVER = list( - SCREENTIP_CONTEXT_RMB = "Disassemble", - ), + var/static/list/tool_behaviors = list( + TOOL_SCREWDRIVER = list( + SCREENTIP_CONTEXT_RMB = "Disassemble", + ), - TOOL_WRENCH = list( - SCREENTIP_CONTEXT_RMB = "Deconstruct", - ), - ) + TOOL_WRENCH = list( + SCREENTIP_CONTEXT_RMB = "Deconstruct", + ), + ) - AddElement(/datum/element/contextual_screentip_tools, tool_behaviors) + AddElement(/datum/element/contextual_screentip_tools, tool_behaviors) ``` This will display "RMB: Deconstruct" when the user hovers over a table with a wrench. diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 6d7f8a49606..edf2cd21534 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -798,7 +798,7 @@ SEND_SIGNAL(src, COMSIG_MACHINERY_REFRESH_PARTS) /obj/machinery/proc/default_pry_open(obj/item/crowbar, close_after_pry = FALSE, open_density = FALSE, closed_density = TRUE) - . = !(state_open || panel_open || is_operational || (obj_flags & NO_DECONSTRUCTION)) && crowbar.tool_behaviour == TOOL_CROWBAR + . = !(state_open || panel_open || is_operational) && crowbar.tool_behaviour == TOOL_CROWBAR if(!.) return crowbar.play_tool_sound(src, 50) @@ -808,23 +808,23 @@ close_machine(density_to_set = closed_density) /obj/machinery/proc/default_deconstruction_crowbar(obj/item/crowbar, ignore_panel = 0, custom_deconstruct = FALSE) - . = (panel_open || ignore_panel) && !(obj_flags & NO_DECONSTRUCTION) && crowbar.tool_behaviour == TOOL_CROWBAR + . = (panel_open || ignore_panel) && crowbar.tool_behaviour == TOOL_CROWBAR if(!. || custom_deconstruct) return crowbar.play_tool_sound(src, 50) deconstruct(TRUE) -/obj/machinery/deconstruct(disassembled = TRUE) +/obj/machinery/handle_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. + dump_inventory_contents() //drop stuff we consider important + return //Just delete us, no need to call anything else. on_deconstruction(disassembled) if(!LAZYLEN(component_parts)) dump_contents() //drop everything inside us - return ..() //we don't have any parts. + return //we don't have any parts. spawn_frame(disassembled) for(var/part in component_parts) @@ -848,8 +848,6 @@ //to handle their contents before we dump them dump_contents() - return ..() - /** * Spawns a frame where this machine is. If the machine was not disassmbled, the * frame is spawned damaged. If the frame couldn't exist on this turf, it's smashed @@ -881,7 +879,7 @@ /obj/machinery/atom_break(damage_flag) . = ..() - if(!(machine_stat & BROKEN) && !(obj_flags & NO_DECONSTRUCTION)) + if(!(machine_stat & BROKEN)) set_machine_stat(machine_stat | BROKEN) SEND_SIGNAL(src, COMSIG_MACHINERY_BROKEN, damage_flag) update_appearance() @@ -928,7 +926,7 @@ qdel(atom_part) /obj/machinery/proc/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver) - if((obj_flags & NO_DECONSTRUCTION) || screwdriver.tool_behaviour != TOOL_SCREWDRIVER) + if(screwdriver.tool_behaviour != TOOL_SCREWDRIVER) return FALSE screwdriver.play_tool_sound(src, 50) @@ -955,7 +953,7 @@ if(!istype(replacer_tool)) return FALSE - if((obj_flags & NO_DECONSTRUCTION) && !replacer_tool.works_from_distance) + if(!replacer_tool.works_from_distance) return FALSE var/shouldplaysound = FALSE diff --git a/code/game/machinery/barsigns.dm b/code/game/machinery/barsigns.dm index faa29c2673e..006620ec5f4 100644 --- a/code/game/machinery/barsigns.dm +++ b/code/game/machinery/barsigns.dm @@ -88,7 +88,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32) /obj/machinery/barsign/atom_break(damage_flag) . = ..() - if((machine_stat & BROKEN) && !(obj_flags & NO_DECONSTRUCTION)) + if(machine_stat & BROKEN) set_sign(new /datum/barsign/hiddensigns/signoff) /obj/machinery/barsign/on_deconstruction(disassembled) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 33dde81af58..28dcf2de5e8 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -302,23 +302,22 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/camera/xray, 0) toggle_cam(null, 0) /obj/machinery/camera/on_deconstruction(disassembled) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(disassembled) - var/obj/item/wallframe/camera/dropped_cam = new(drop_location()) - dropped_cam.update_integrity(dropped_cam.max_integrity * 0.5) - if(camera_construction_state >= CAMERA_STATE_WIRED) - new /obj/item/stack/cable_coil(drop_location(), 2) - if(xray_module) - drop_upgrade(xray_module) - if(emp_module) - drop_upgrade(emp_module) - if(proximity_monitor) - drop_upgrade(proximity_monitor) - else - if(camera_construction_state >= CAMERA_STATE_WIRED) - new /obj/item/stack/cable_coil(drop_location(), 2) - new /obj/item/stack/sheet/iron(loc) - return ..() + if(!disassembled) + if(camera_construction_state >= CAMERA_STATE_WIRED) + new /obj/item/stack/cable_coil(drop_location(), 2) + new /obj/item/stack/sheet/iron(loc) + return + + var/obj/item/wallframe/camera/dropped_cam = new(drop_location()) + dropped_cam.update_integrity(dropped_cam.max_integrity * 0.5) + if(camera_construction_state >= CAMERA_STATE_WIRED) + new /obj/item/stack/cable_coil(drop_location(), 2) + if(xray_module) + drop_upgrade(xray_module) + if(emp_module) + drop_upgrade(emp_module) + if(proximity_monitor) + drop_upgrade(proximity_monitor) /obj/machinery/camera/update_icon_state() //TO-DO: Make panel open states, xray camera, and indicator lights overlays instead. var/xray_module diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm index 36480be6e90..c2ef2258e33 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -63,7 +63,7 @@ /obj/machinery/computer/screwdriver_act(mob/living/user, obj/item/I) if(..()) return TRUE - if(circuit && !(obj_flags & NO_DECONSTRUCTION)) + if(circuit) balloon_alert(user, "disconnecting monitor...") if(I.use_tool(src, user, time_to_unscrew, volume=50)) deconstruct(TRUE) diff --git a/code/game/machinery/computer/atmos_computers/_air_sensor.dm b/code/game/machinery/computer/atmos_computers/_air_sensor.dm index d9d461149bc..1c365dd0876 100644 --- a/code/game/machinery/computer/atmos_computers/_air_sensor.dm +++ b/code/game/machinery/computer/atmos_computers/_air_sensor.dm @@ -221,8 +221,6 @@ deconstruct(TRUE) return ITEM_INTERACT_SUCCESS -/obj/item/air_sensor/deconstruct(disassembled) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/analyzer(loc) - new /obj/item/stack/sheet/iron(loc, 1) - return ..() +/obj/item/air_sensor/atom_deconstruct(disassembled) + new /obj/item/analyzer(loc) + new /obj/item/stack/sheet/iron(loc, 1) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 1fc8322bb78..fc4b5fcb516 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -11,18 +11,16 @@ AddComponent(/datum/component/simple_rotation) register_context() -/obj/structure/frame/computer/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/atom/drop_loc = drop_location() - if(state == FRAME_COMPUTER_STATE_GLASSED) - if(disassembled) - new /obj/item/stack/sheet/glass(drop_loc, 2) - else - new /obj/item/shard(drop_loc) - new /obj/item/shard(drop_loc) - if(state >= FRAME_COMPUTER_STATE_WIRED) - new /obj/item/stack/cable_coil(drop_loc, 5) - +/obj/structure/frame/computer/atom_deconstruct(disassembled = TRUE) + var/atom/drop_loc = drop_location() + if(state == FRAME_COMPUTER_STATE_GLASSED) + if(disassembled) + new /obj/item/stack/sheet/glass(drop_loc, 2) + else + new /obj/item/shard(drop_loc) + new /obj/item/shard(drop_loc) + if(state >= FRAME_COMPUTER_STATE_WIRED) + new /obj/item/stack/cable_coil(drop_loc, 5) return ..() /obj/structure/frame/computer/add_context(atom/source, list/context, obj/item/held_item, mob/user) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index e6830fd1848..f47948753ab 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -22,13 +22,10 @@ if(circuit) . += "It has \a [circuit] installed." -/obj/structure/frame/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/atom/movable/drop_loc = drop_location() - new /obj/item/stack/sheet/iron(drop_loc, 5) - circuit?.forceMove(drop_loc) - - return ..() +/obj/structure/frame/atom_deconstruct(disassembled = TRUE) + var/atom/movable/drop_loc = drop_location() + new /obj/item/stack/sheet/iron(drop_loc, 5) + circuit?.forceMove(drop_loc) /// Called when circuit has been set to a new board /obj/structure/frame/proc/circuit_added(obj/item/circuitboard/added) @@ -61,8 +58,6 @@ /obj/structure/frame/proc/try_dissassemble(mob/living/user, obj/item/tool, disassemble_time = 8 SECONDS) if(state != FRAME_STATE_EMPTY) return NONE - if(obj_flags & NO_DECONSTRUCTION) - return NONE if(anchored && state == FRAME_STATE_EMPTY) //when using a screwdriver on an incomplete frame(missing components) no point checking for this balloon_alert(user, "must be unanchored first!") return ITEM_INTERACT_BLOCKING diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index 9d19d0d9be9..53799d6dfc1 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -32,8 +32,6 @@ /obj/machinery/jukebox/wrench_act(mob/living/user, obj/item/tool) if(!isnull(music_player.active_song_sound)) return NONE - if(obj_flags & NO_DECONSTRUCTION) - return NONE if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN) return ITEM_INTERACT_SUCCESS diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 0d3c04ccd6f..a9a4336e5bb 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -17,12 +17,13 @@ var/proj_pass_rate = 50 //How many projectiles will pass the cover. Lower means stronger cover var/bar_material = METAL -/obj/structure/barricade/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - make_debris() - qdel(src) +/obj/structure/barricade/atom_deconstruct(disassembled = TRUE) + make_debris() +/// Spawn debris & stuff upon deconstruction /obj/structure/barricade/proc/make_debris() + PROTECTED_PROC(TRUE) + return /obj/structure/barricade/attackby(obj/item/I, mob/living/user, params) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 1dc343a0c0b..0849a5ad8c5 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -347,8 +347,6 @@ /obj/machinery/door/window/screwdriver_act(mob/living/user, obj/item/tool) . = ..() - if(obj_flags & NO_DECONSTRUCTION) - return if(density || operating) to_chat(user, span_warning("You need to open the door to access the maintenance panel!")) return @@ -360,8 +358,6 @@ /obj/machinery/door/window/crowbar_act(mob/living/user, obj/item/tool) . = ..() - if(obj_flags & NO_DECONSTRUCTION) - return if(!panel_open || density || operating) return add_fingerprint(user) diff --git a/code/game/machinery/harvester.dm b/code/game/machinery/harvester.dm index 33d08def9d2..09599b0cbff 100644 --- a/code/game/machinery/harvester.dm +++ b/code/game/machinery/harvester.dm @@ -171,7 +171,7 @@ return TRUE /obj/machinery/harvester/default_pry_open(obj/item/tool) //wew - . = !(state_open || panel_open || (obj_flags & NO_DECONSTRUCTION)) && tool.tool_behaviour == TOOL_CROWBAR //We removed is_operational here + . = !(state_open || panel_open) && tool.tool_behaviour == TOOL_CROWBAR //We removed is_operational here if(.) tool.play_tool_sound(src, 50) visible_message(span_notice("[usr] pries open \the [src]."), span_notice("You pry open [src].")) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 05c0fe24246..88c2959416c 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -111,6 +111,9 @@ Possible to do for anyone motivated enough: ) AddElement(/datum/element/contextual_screentip_mob_typechecks, hovering_mob_typechecks) + if(on_network) + holopads += src + /obj/machinery/holopad/secure name = "secure holopad" desc = "It's a floor-mounted device for projecting holographic images. This one will refuse to auto-connect incoming calls." @@ -175,11 +178,6 @@ Possible to do for anyone motivated enough: if(!replay_mode && (disk?.record)) replay_start() -/obj/machinery/holopad/Initialize(mapload) - . = ..() - if(on_network) - holopads += src - /obj/machinery/holopad/Destroy() if(outgoing_call) outgoing_call.ConnectionFailure(src) diff --git a/code/game/machinery/limbgrower.dm b/code/game/machinery/limbgrower.dm index 1fe2f542ba2..b63d13648eb 100644 --- a/code/game/machinery/limbgrower.dm +++ b/code/game/machinery/limbgrower.dm @@ -283,7 +283,6 @@ /obj/machinery/limbgrower/fullupgrade //Inherently cheaper organ production. This is to NEVER be inherently emagged, no valids. desc = "It grows new limbs using Synthflesh. This alien model seems more efficient." - obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION circuit = /obj/item/circuitboard/machine/limbgrower/fullupgrade /obj/machinery/limbgrower/fullupgrade/Initialize(mapload) diff --git a/code/game/machinery/machine_frame.dm b/code/game/machinery/machine_frame.dm index 84c58d32823..4edb3215e2b 100644 --- a/code/game/machinery/machine_frame.dm +++ b/code/game/machinery/machine_frame.dm @@ -17,11 +17,10 @@ QDEL_LIST(components) return ..() -/obj/structure/frame/machine/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(state >= FRAME_STATE_WIRED) - new /obj/item/stack/cable_coil(drop_location(), 5) - dump_contents() +/obj/structure/frame/machine/atom_deconstruct(disassembled = TRUE) + if(state >= FRAME_STATE_WIRED) + new /obj/item/stack/cable_coil(drop_location(), 5) + dump_contents() return ..() /obj/structure/frame/machine/add_context(atom/source, list/context, obj/item/held_item, mob/user) diff --git a/code/game/machinery/sleepers.dm b/code/game/machinery/sleepers.dm index 68b4026b744..f768381548a 100644 --- a/code/game/machinery/sleepers.dm +++ b/code/game/machinery/sleepers.dm @@ -147,7 +147,7 @@ return FALSE /obj/machinery/sleeper/default_pry_open(obj/item/I) //wew - . = !(state_open || panel_open || (obj_flags & NO_DECONSTRUCTION)) && I.tool_behaviour == TOOL_CROWBAR + . = !(state_open || panel_open) && I.tool_behaviour == TOOL_CROWBAR if(.) I.play_tool_sound(src, 50) visible_message(span_notice("[usr] pries open [src]."), span_notice("You pry open [src].")) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 1b7b041a7a9..255cf3ce7f1 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -794,21 +794,21 @@ causes the SSU to break due to state_open being set to TRUE at the end, and the panel becoming inaccessible. */ /obj/machinery/suit_storage_unit/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver) - if(!(obj_flags & NO_DECONSTRUCTION) && screwdriver.tool_behaviour == TOOL_SCREWDRIVER && (uv || locked)) + if(screwdriver.tool_behaviour == TOOL_SCREWDRIVER && (uv || locked)) to_chat(user, span_warning("You cant open the panel while its [locked ? "locked" : "decontaminating"]")) return TRUE return ..() /obj/machinery/suit_storage_unit/default_pry_open(obj/item/crowbar)//needs to check if the storage is locked. - . = !(state_open || panel_open || is_operational || locked || (obj_flags & NO_DECONSTRUCTION)) && crowbar.tool_behaviour == TOOL_CROWBAR + . = !(state_open || panel_open || is_operational || locked) && crowbar.tool_behaviour == TOOL_CROWBAR if(.) crowbar.play_tool_sound(src, 50) visible_message(span_notice("[usr] pries open \the [src]."), span_notice("You pry open \the [src].")) open_machine() /obj/machinery/suit_storage_unit/default_deconstruction_crowbar(obj/item/crowbar, ignore_panel, custom_deconstruct) - . = (!locked && panel_open && !(obj_flags & NO_DECONSTRUCTION) && crowbar.tool_behaviour == TOOL_CROWBAR) + . = (!locked && panel_open && crowbar.tool_behaviour == TOOL_CROWBAR) if(.) return ..() diff --git a/code/game/machinery/telecomms/machines/allinone.dm b/code/game/machinery/telecomms/machines/allinone.dm index f8a6b66c049..f159339193e 100644 --- a/code/game/machinery/telecomms/machines/allinone.dm +++ b/code/game/machinery/telecomms/machines/allinone.dm @@ -22,6 +22,12 @@ resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION +/obj/machinery/telecomms/allinone/indestructible/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver) + return NONE + +/obj/machinery/telecomms/allinone/indestructible/default_deconstruction_crowbar(obj/item/crowbar, ignore_panel, custom_deconstruct) + return NONE + /obj/machinery/telecomms/allinone/receive_signal(datum/signal/subspace/signal) if(!istype(signal) || signal.transmission_method != TRANSMISSION_SUBSPACE) // receives on subspace only return diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm index e50963a855e..71f3a244a30 100644 --- a/code/game/objects/items/cardboard_cutouts.dm +++ b/code/game/objects/items/cardboard_cutouts.dm @@ -92,10 +92,8 @@ if((damage_flag == BULLET || damage_flag == MELEE) && (damage_type == BRUTE) && prob(damage_sustained)) push_over() -/obj/item/cardboard_cutout/deconstruct(disassembled) - if(!(flags_1 & HOLOGRAM_1) || !(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/stack/sheet/cardboard(loc, 1) - return ..() +/obj/item/cardboard_cutout/atom_deconstruct(disassembled) + new /obj/item/stack/sheet/cardboard(loc, 1) /proc/get_cardboard_cutout_instance(datum/cardboard_cutout/cardboard_cutout) ASSERT(ispath(cardboard_cutout), "[cardboard_cutout] is not a path of /datum/cardboard_cutout") diff --git a/code/game/objects/items/grenades/_grenade.dm b/code/game/objects/items/grenades/_grenade.dm index e7e592eabac..4c737ed53f3 100644 --- a/code/game/objects/items/grenades/_grenade.dm +++ b/code/game/objects/items/grenades/_grenade.dm @@ -63,11 +63,9 @@ sleep(det_time)//so you dont die instantly return dud_flags ? SHAME : BRUTELOSS -/obj/item/grenade/deconstruct(disassembled = TRUE) +/obj/item/grenade/atom_deconstruct(disassembled = TRUE) if(!disassembled) detonate() - if(!QDELETED(src)) - qdel(src) /obj/item/grenade/apply_fantasy_bonuses(bonus) . = ..() diff --git a/code/game/objects/items/piggy_bank.dm b/code/game/objects/items/piggy_bank.dm index 8d50e8a39e8..b6294dbc4dd 100644 --- a/code/game/objects/items/piggy_bank.dm +++ b/code/game/objects/items/piggy_bank.dm @@ -63,7 +63,7 @@ persistence_cb = null return ..() -/obj/item/piggy_bank/deconstruct(disassembled = TRUE) +/obj/item/piggy_bank/atom_deconstruct(disassembled = TRUE) for(var/obj/item/thing as anything in contents) thing.forceMove(loc) //Smashing the piggy after the round is over doesn't count. diff --git a/code/game/objects/items/rcd/RCD.dm b/code/game/objects/items/rcd/RCD.dm index d050da4fa5e..b4e5ffb35ee 100644 --- a/code/game/objects/items/rcd/RCD.dm +++ b/code/game/objects/items/rcd/RCD.dm @@ -203,6 +203,11 @@ * * [mob][user]- the user building this structure */ /obj/item/construction/rcd/proc/rcd_create(atom/target, mob/user) + //straight up cant touch this + if(mode == RCD_DECONSTRUCT && (target.resistance_flags & INDESTRUCTIBLE)) + balloon_alert(user, "too durable!") + return + //does this atom allow for rcd actions? var/list/rcd_results = target.rcd_vals(user, src) if(!rcd_results) diff --git a/code/game/objects/items/surgery_tray.dm b/code/game/objects/items/surgery_tray.dm index e31b8f24cb8..028366481d4 100644 --- a/code/game/objects/items/surgery_tray.dm +++ b/code/game/objects/items/surgery_tray.dm @@ -150,12 +150,10 @@ for(var/atom/movable/tool as anything in contents) tool.forceMove(drop_point) -/obj/item/surgery_tray/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - dump_contents() - new /obj/item/stack/rods(drop_location(), 2) - new /obj/item/stack/sheet/mineral/silver(drop_location()) - return ..() +/obj/item/surgery_tray/atom_deconstruct(disassembled = TRUE) + dump_contents() + new /obj/item/stack/rods(drop_location(), 2) + new /obj/item/stack/sheet/mineral/silver(drop_location()) /obj/item/surgery_tray/deployed is_portable = FALSE diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index e198f7d75d7..8772e2f41c9 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -174,7 +174,7 @@ if(tank_assembly) . += span_warning("There is some kind of device [EXAMINE_HINT("rigged")] to the tank!") -/obj/item/tank/deconstruct(disassembled = TRUE) +/obj/item/tank/atom_deconstruct(disassembled = TRUE) var/atom/location = loc if(location) location.assume_air(air_contents) diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index 9b118ea7c2f..4731ad4395f 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -155,9 +155,48 @@ var/mob/living/buckled_mob = m buckled_mob.electrocute_act((clamp(round(strength * 1.25e-3), 10, 90) + rand(-5, 5)), src, flags = SHOCK_TESLA) -///the obj is deconstructed into pieces, whether through careful disassembly or when destroyed. +/** + * Custom behaviour per atom subtype on how they should deconstruct themselves + * Arguments + * + * * disassembled - TRUE means we cleanly took this atom apart using tools. FALSE means this was destroyed in a violent way + */ +/obj/proc/atom_deconstruct(disassembled = TRUE) + PROTECTED_PROC(TRUE) + + return + +/** + * The interminate proc between deconstruct() & atom_deconstruct(). By default this delegates deconstruction to + * atom_deconstruct if NO_DECONSTRUCTION is absent but subtypes can override this to handle NO_DECONSTRUCTION in their + * own unique way. Override this if for example you want to dump out important content like mobs from the + * atom before deconstruction regardless if NO_DECONSTRUCTION is present or not + * Arguments + * + * * disassembled - TRUE means we cleanly took this atom apart using tools. FALSE means this was destroyed in a violent way + */ +/obj/proc/handle_deconstruct(disassembled = TRUE) + SHOULD_CALL_PARENT(FALSE) + + if(!(obj_flags & NO_DECONSTRUCTION)) + atom_deconstruct(disassembled) + +/** + * The obj is deconstructed into pieces, whether through careful disassembly or when destroyed. + * Arguments + * + * * disassembled - TRUE means we cleanly took this atom apart using tools. FALSE means this was destroyed in a violent way + */ /obj/proc/deconstruct(disassembled = TRUE) + SHOULD_NOT_OVERRIDE(TRUE) + + //allow objects to deconstruct themselves + handle_deconstruct(disassembled) + + //inform objects we were deconstructed SEND_SIGNAL(src, COMSIG_OBJ_DECONSTRUCT, disassembled) + + //delete our self qdel(src) ///what happens when the obj's integrity reaches zero. diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index c2183728d4f..1872f62d907 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -367,8 +367,6 @@ GLOBAL_LIST_EMPTY(objects_by_id_tag) /// If we can unwrench this object; returns SUCCESSFUL_UNFASTEN and FAILED_UNFASTEN, which are both TRUE, or CANT_UNFASTEN, which isn't. /obj/proc/can_be_unfasten_wrench(mob/user, silent) - if(obj_flags & NO_DECONSTRUCTION) - return CANT_UNFASTEN if(!(isfloorturf(loc) || isindestructiblefloor(loc)) && !anchored) to_chat(user, span_warning("[src] needs to be on the floor to be secured!")) return FAILED_UNFASTEN diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index 7615a37a88b..70c9c954591 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -380,7 +380,7 @@ icon_state = "ai-empty" return ..() -/obj/structure/ai_core/deconstruct(disassembled = TRUE) +/obj/structure/ai_core/atom_deconstruct(disassembled = TRUE) if(state >= GLASS_CORE) new /obj/item/stack/sheet/rglass(loc, 2) if(state >= CABLED_CORE) @@ -389,7 +389,6 @@ circuit.forceMove(loc) circuit = null new /obj/item/stack/sheet/plasteel(loc, 4) - qdel(src) /// Quick proc to call to see if the brainmob inside of us has suicided. Returns TRUE if we have, FALSE in any other scenario. /obj/structure/ai_core/proc/suicide_check() diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm index 886d0b9bcba..c5a69bfa329 100644 --- a/code/game/objects/structures/aliens.dm +++ b/code/game/objects/structures/aliens.dm @@ -41,10 +41,8 @@ icon = 'icons/obj/fluff/general.dmi' icon_state = "gelmound" -/obj/structure/alien/gelpod/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/effect/mob_spawn/corpse/human/damaged(get_turf(src)) - qdel(src) +/obj/structure/alien/gelpod/atom_deconstruct(disassembled = TRUE) + new /obj/effect/mob_spawn/corpse/human/damaged(get_turf(src)) /* * Resin @@ -446,9 +444,8 @@ /obj/structure/alien/egg/atom_break(damage_flag) . = ..() - if(!(obj_flags & NO_DECONSTRUCTION)) - if(status != BURST) - Burst(kill=TRUE) + if(status != BURST) + Burst(kill=TRUE) /obj/structure/alien/egg/HasProximity(atom/movable/AM) if(status == GROWN) diff --git a/code/game/objects/structures/beds_chairs/alien_nest.dm b/code/game/objects/structures/beds_chairs/alien_nest.dm index 0a157dc98a1..1654cecff45 100644 --- a/code/game/objects/structures/beds_chairs/alien_nest.dm +++ b/code/game/objects/structures/beds_chairs/alien_nest.dm @@ -12,10 +12,18 @@ smoothing_groups = SMOOTH_GROUP_ALIEN_NEST canSmoothWith = SMOOTH_GROUP_ALIEN_NEST build_stack_type = null - obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION elevation = 0 var/static/mutable_appearance/nest_overlay = mutable_appearance('icons/mob/nonhuman-player/alien.dmi', "nestoverlay", LYING_MOB_LAYER) +/obj/structure/bed/nest/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + if(held_item?.tool_behaviour == TOOL_WRENCH) + return NONE + + return ..() + +/obj/structure/bed/nest/wrench_act_secondary(mob/living/user, obj/item/weapon) + return ITEM_INTERACT_BLOCKING + /obj/structure/bed/nest/user_unbuckle_mob(mob/living/buckled_mob, mob/living/user) if(has_buckled_mobs()) for(var/buck in buckled_mobs) //breaking a nest releases all the buckled mobs, because the nest isn't holding them down anymore diff --git a/code/game/objects/structures/beds_chairs/bed.dm b/code/game/objects/structures/beds_chairs/bed.dm index e2038cb623b..5c5fac60eaa 100644 --- a/code/game/objects/structures/beds_chairs/bed.dm +++ b/code/game/objects/structures/beds_chairs/bed.dm @@ -34,12 +34,11 @@ /obj/structure/bed/examine(mob/user) . = ..() - if(!(obj_flags & NO_DECONSTRUCTION)) - . += span_notice("It's held together by a couple of bolts.") + . += span_notice("It's held together by a couple of bolts.") /obj/structure/bed/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) if(held_item) - if(held_item.tool_behaviour != TOOL_WRENCH || obj_flags & NO_DECONSTRUCTION) + if(held_item.tool_behaviour != TOOL_WRENCH) return context[SCREENTIP_CONTEXT_RMB] = "Dismantle" @@ -49,19 +48,14 @@ context[SCREENTIP_CONTEXT_LMB] = "Unbuckle" return CONTEXTUAL_SCREENTIP_SET -/obj/structure/bed/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(build_stack_type) - new build_stack_type(loc, build_stack_amount) - ..() +/obj/structure/bed/atom_deconstruct(disassembled = TRUE) + if(build_stack_type) + new build_stack_type(loc, build_stack_amount) /obj/structure/bed/attack_paw(mob/user, list/modifiers) return attack_hand(user, modifiers) /obj/structure/bed/wrench_act_secondary(mob/living/user, obj/item/weapon) - if(obj_flags & NO_DECONSTRUCTION) - return TRUE - ..() weapon.play_tool_sound(src) deconstruct(disassembled = TRUE) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 0c4555bf390..74546e2ccd7 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -36,16 +36,12 @@ SSjob.latejoin_trackers -= src //These may be here due to the arrivals shuttle return ..() -/obj/structure/chair/deconstruct(disassembled) - // If we have materials, and don't have the NOCONSTRUCT flag - if(!(obj_flags & NO_DECONSTRUCTION)) - if(buildstacktype) - new buildstacktype(loc,buildstackamount) - else - for(var/i in custom_materials) - var/datum/material/M = i - new M.sheet_type(loc, FLOOR(custom_materials[M] / SHEET_MATERIAL_AMOUNT, 1)) - ..() +/obj/structure/chair/atom_deconstruct(disassembled) + if(buildstacktype) + new buildstacktype(loc,buildstackamount) + else + for(var/datum/material/mat as anything in custom_materials) + new mat.sheet_type(loc, FLOOR(custom_materials[mat] / SHEET_MATERIAL_AMOUNT, 1)) /obj/structure/chair/attack_paw(mob/user, list/modifiers) return attack_hand(user, modifiers) @@ -56,8 +52,6 @@ qdel(src) /obj/structure/chair/attackby(obj/item/W, mob/user, params) - if(obj_flags & NO_DECONSTRUCTION) - return . = ..() if(istype(W, /obj/item/assembly/shock_kit) && !HAS_TRAIT(src, TRAIT_ELECTRIFIED_BUCKLE)) electrify_self(W, user) return @@ -85,8 +79,6 @@ /obj/structure/chair/wrench_act_secondary(mob/living/user, obj/item/weapon) - if(obj_flags & NO_DECONSTRUCTION) - return TRUE ..() weapon.play_tool_sound(src) deconstruct(disassembled = TRUE) @@ -274,7 +266,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool, 0) /obj/structure/chair/MouseDrop(over_object, src_location, over_location) . = ..() if(over_object == usr && Adjacent(usr)) - if(!item_chair || has_buckled_mobs() || src.obj_flags & NO_DECONSTRUCTION) + if(!item_chair || has_buckled_mobs()) return if(!usr.can_perform_action(src, NEED_DEXTERITY|NEED_HANDS)) return @@ -490,6 +482,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0) obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION alpha = 0 +/obj/structure/chair/mime/wrench_act_secondary(mob/living/user, obj/item/weapon) + return ITEM_INTERACT_BLOCKING + /obj/structure/chair/mime/post_buckle_mob(mob/living/M) M.pixel_y += 5 diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 50fcae8dec1..108ca3fe9b8 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -609,8 +609,6 @@ LINEN BINS ..() /obj/structure/bedsheetbin/screwdriver_act(mob/living/user, obj/item/tool) - if(obj_flags & NO_DECONSTRUCTION) - return FALSE if(amount) to_chat(user, span_warning("The [src] must be empty first!")) return ITEM_INTERACT_SUCCESS diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index dc273bdc938..3eb29fc1526 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -581,25 +581,23 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets) else return open(user) -/obj/structure/closet/deconstruct(disassembled = TRUE) - if (!(obj_flags & NO_DECONSTRUCTION)) - if(ispath(material_drop) && material_drop_amount) - new material_drop(loc, material_drop_amount) - if (secure) - var/obj/item/electronics/airlock/electronics = new(drop_location()) - if(length(req_one_access)) - electronics.one_access = TRUE - electronics.accesses = req_one_access - else - electronics.accesses = req_access - if(card_reader_installed) - new /obj/item/stock_parts/card_reader(drop_location()) +/obj/structure/closet/atom_deconstruct(disassembled = TRUE) + if(ispath(material_drop) && material_drop_amount) + new material_drop(loc, material_drop_amount) + if (secure) + var/obj/item/electronics/airlock/electronics = new(drop_location()) + if(length(req_one_access)) + electronics.one_access = TRUE + electronics.accesses = req_one_access + else + electronics.accesses = req_access + if(card_reader_installed) + new /obj/item/stock_parts/card_reader(drop_location()) dump_contents() - qdel(src) /obj/structure/closet/atom_break(damage_flag) . = ..() - if(!broken && !(obj_flags & NO_DECONSTRUCTION)) + if(!broken) bust_open() /obj/structure/closet/CheckParts(list/parts_list) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm b/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm index 1ac7e65884e..1e19671a455 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm @@ -36,10 +36,8 @@ flags_1 &= ~PREVENT_CONTENTS_EXPLOSION_1 return FALSE -/obj/structure/closet/secure_closet/freezer/deconstruct(disassembled) - if (!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/assembly/igniter/condenser(drop_location()) - . = ..() +/obj/structure/closet/secure_closet/freezer/atom_deconstruct(disassembled) + new /obj/item/assembly/igniter/condenser(drop_location()) /obj/structure/closet/secure_closet/freezer/empty name = "freezer" diff --git a/code/game/objects/structures/destructible_structures.dm b/code/game/objects/structures/destructible_structures.dm index f33c99b681a..beffa5d4fd7 100644 --- a/code/game/objects/structures/destructible_structures.dm +++ b/code/game/objects/structures/destructible_structures.dm @@ -4,16 +4,13 @@ var/break_sound = 'sound/magic/clockwork/invoke_general.ogg' //The sound played when a structure breaks var/list/debris = null //Parts left behind when a structure breaks, takes the form of list(path = amount_to_spawn) -/obj/structure/destructible/deconstruct(disassembled = TRUE) +/obj/structure/destructible/atom_deconstruct(disassembled = TRUE) if(!disassembled) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(islist(debris)) - for(var/I in debris) - for(var/i in 1 to debris[I]) - new I (get_turf(src)) - if(break_message) - visible_message(break_message) - if(break_sound) - playsound(src, break_sound, 50, TRUE) - qdel(src) - return 1 + if(islist(debris)) + for(var/I in debris) + for(var/i in 1 to debris[I]) + new I (get_turf(src)) + if(break_message) + visible_message(break_message) + if(break_sound) + playsound(src, break_sound, 50, TRUE) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index d7deb5b42cf..b9b4698d780 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -81,17 +81,15 @@ if(BURN) playsound(src, 'sound/items/welder.ogg', 100, TRUE) -/obj/structure/displaycase/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - dump() - if(!disassembled) - new /obj/item/shard(drop_location()) - trigger_alarm() - qdel(src) +/obj/structure/displaycase/atom_deconstruct(disassembled = TRUE) + dump() + if(!disassembled) + new /obj/item/shard(drop_location()) + trigger_alarm() /obj/structure/displaycase/atom_break(damage_flag) . = ..() - if(!broken && !(obj_flags & NO_DECONSTRUCTION)) + if(!broken) set_density(FALSE) broken = TRUE new /obj/item/shard(drop_location()) @@ -673,7 +671,7 @@ /obj/structure/displaycase/forsale/atom_break(damage_flag) . = ..() - if(!broken && !(obj_flags & NO_DECONSTRUCTION)) + if(!broken) broken = TRUE playsound(src, SFX_SHATTER, 70, TRUE) update_appearance() diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index f110cd8b43e..b6cac0aa5be 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -363,25 +363,22 @@ target.update_name() qdel(source) -/obj/structure/door_assembly/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/turf/T = get_turf(src) - if(!disassembled) - material_amt = rand(2,4) - new material_type(T, material_amt) - if(glass) - if(disassembled) - if(heat_proof_finished) - new /obj/item/stack/sheet/rglass(T) - else - new /obj/item/stack/sheet/glass(T) +/obj/structure/door_assembly/atom_deconstruct(disassembled = TRUE) + var/turf/target_turf = get_turf(src) + if(!disassembled) + material_amt = rand(2,4) + new material_type(target_turf, material_amt) + if(glass) + if(disassembled) + if(heat_proof_finished) + new /obj/item/stack/sheet/rglass(target_turf) else - new /obj/item/shard(T) - if(mineral) - var/obj/item/stack/sheet/mineral/mineral_path = text2path("/obj/item/stack/sheet/mineral/[mineral]") - new mineral_path(T, 2) - qdel(src) - + new /obj/item/stack/sheet/glass(target_turf) + else + new /obj/item/shard(target_turf) + if(mineral) + var/obj/item/stack/sheet/mineral/mineral_path = text2path("/obj/item/stack/sheet/mineral/[mineral]") + new mineral_path(target_turf, 2) /obj/structure/door_assembly/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) if(the_rcd.mode == RCD_DECONSTRUCT) diff --git a/code/game/objects/structures/door_assembly_types.dm b/code/game/objects/structures/door_assembly_types.dm index 589cad42bca..dd06f7e42a9 100644 --- a/code/game/objects/structures/door_assembly_types.dm +++ b/code/game/objects/structures/door_assembly_types.dm @@ -271,24 +271,21 @@ name = "large public airlock assembly" base_name = "large public airlock" -/obj/structure/door_assembly/door_assembly_material/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/turf/T = get_turf(src) - for(var/material in custom_materials) - var/datum/material/material_datum = material - var/material_count = FLOOR(custom_materials[material_datum] / SHEET_MATERIAL_AMOUNT, 1) - if(!disassembled) - material_count = rand(FLOOR(material_count/2, 1), material_count) - new material_datum.sheet_type(T, material_count) - if(glass) - if(disassembled) - if(heat_proof_finished) - new /obj/item/stack/sheet/rglass(T) - else - new /obj/item/stack/sheet/glass(T) +/obj/structure/door_assembly/door_assembly_material/atom_deconstruct(disassembled = TRUE) + var/turf/target_turf = get_turf(src) + for(var/datum/material/material_datum as anything in custom_materials) + var/material_count = FLOOR(custom_materials[material_datum] / SHEET_MATERIAL_AMOUNT, 1) + if(!disassembled) + material_count = rand(FLOOR(material_count/2, 1), material_count) + new material_datum.sheet_type(target_turf, material_count) + if(glass) + if(disassembled) + if(heat_proof_finished) + new /obj/item/stack/sheet/rglass(target_turf) else - new /obj/item/shard(T) - qdel(src) + new /obj/item/stack/sheet/glass(target_turf) + else + new /obj/item/shard(target_turf) /obj/structure/door_assembly/door_assembly_material/finish_door() var/obj/machinery/door/airlock/door = ..() diff --git a/code/game/objects/structures/dresser.dm b/code/game/objects/structures/dresser.dm index 0d9b3664cb2..4296ac33684 100644 --- a/code/game/objects/structures/dresser.dm +++ b/code/game/objects/structures/dresser.dm @@ -16,10 +16,8 @@ else return ..() -/obj/structure/dresser/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/stack/sheet/mineral/wood(drop_location(), 10) - qdel(src) +/obj/structure/dresser/atom_deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/mineral/wood(drop_location(), 10) /obj/structure/dresser/attack_hand(mob/user, list/modifiers) . = ..() diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index fb925cdb7da..e78b71f14e9 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -160,7 +160,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet, 29) /obj/structure/extinguisher_cabinet/atom_break(damage_flag) . = ..() - if(!broken && !(obj_flags & NO_DECONSTRUCTION)) + if(!broken) broken = 1 opened = 1 if(stored_extinguisher) @@ -169,16 +169,14 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet, 29) update_appearance(UPDATE_ICON) -/obj/structure/extinguisher_cabinet/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(disassembled) - new /obj/item/wallframe/extinguisher_cabinet(loc) - else - new /obj/item/stack/sheet/iron (loc, 2) - if(stored_extinguisher) - stored_extinguisher.forceMove(loc) - stored_extinguisher = null - qdel(src) +/obj/structure/extinguisher_cabinet/atom_deconstruct(disassembled = TRUE) + if(disassembled) + new /obj/item/wallframe/extinguisher_cabinet(loc) + else + new /obj/item/stack/sheet/iron (loc, 2) + if(stored_extinguisher) + stored_extinguisher.forceMove(loc) + stored_extinguisher = null /obj/item/wallframe/extinguisher_cabinet name = "extinguisher cabinet frame" diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index eaf830b7db7..bfae4706535 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -133,14 +133,12 @@ playsound(src, 'sound/items/welder.ogg', 100, TRUE) deconstruct(disassembled) -/obj/structure/falsewall/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(disassembled) - new girder_type(loc) - if(mineral_amount) - for(var/i in 1 to mineral_amount) - new mineral(loc) - qdel(src) +/obj/structure/falsewall/atom_deconstruct(disassembled = TRUE) + if(disassembled) + new girder_type(loc) + if(mineral_amount) + for(var/i in 1 to mineral_amount) + new mineral(loc) /obj/structure/falsewall/get_dumping_location() return null @@ -387,14 +385,12 @@ canSmoothWith = SMOOTH_GROUP_MATERIAL_WALLS material_flags = MATERIAL_EFFECTS | MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS -/obj/structure/falsewall/material/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(disassembled) - new girder_type(loc) - for(var/material in custom_materials) - var/datum/material/material_datum = material - new material_datum.sheet_type(loc, FLOOR(custom_materials[material_datum] / SHEET_MATERIAL_AMOUNT, 1)) - qdel(src) +/obj/structure/falsewall/material/atom_deconstruct(disassembled = TRUE) + if(disassembled) + new girder_type(loc) + for(var/material in custom_materials) + var/datum/material/material_datum = material + new material_datum.sheet_type(loc, FLOOR(custom_materials[material_datum] / SHEET_MATERIAL_AMOUNT, 1)) /obj/structure/falsewall/material/mat_update_desc(mat) desc = "A huge chunk of [mat] used to separate rooms." diff --git a/code/game/objects/structures/fans.dm b/code/game/objects/structures/fans.dm index 924da72ee30..4f0a5fc450b 100644 --- a/code/game/objects/structures/fans.dm +++ b/code/game/objects/structures/fans.dm @@ -10,21 +10,15 @@ var/buildstackamount = 5 can_atmos_pass = ATMOS_PASS_NO -/obj/structure/fans/deconstruct() - if(!(obj_flags & NO_DECONSTRUCTION)) - if(buildstacktype) - new buildstacktype(loc,buildstackamount) - qdel(src) +/obj/structure/fans/atom_deconstruct(disassembled = TRUE) + if(buildstacktype) + new buildstacktype(loc,buildstackamount) /obj/structure/fans/wrench_act(mob/living/user, obj/item/I) - ..() - if(obj_flags & NO_DECONSTRUCTION) - return TRUE - user.visible_message(span_warning("[user] disassembles [src]."), span_notice("You start to disassemble [src]..."), span_hear("You hear clanking and banging noises.")) if(I.use_tool(src, user, 20, volume=50)) - deconstruct() + deconstruct(TRUE) return TRUE /obj/structure/fans/tiny diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm index ab7d410f096..ab69b7bc7a4 100644 --- a/code/game/objects/structures/fireaxe.dm +++ b/code/game/objects/structures/fireaxe.dm @@ -108,19 +108,17 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fireaxecabinet, 32) /obj/structure/fireaxecabinet/atom_break(damage_flag) . = ..() - if(!broken && !(obj_flags & NO_DECONSTRUCTION)) + if(!broken) update_appearance() broken = TRUE playsound(src, 'sound/effects/glassbr3.ogg', 100, TRUE) new /obj/item/shard(loc) new /obj/item/shard(loc) -/obj/structure/fireaxecabinet/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(held_item && loc) - held_item.forceMove(loc) - new /obj/item/wallframe/fireaxecabinet(loc) - qdel(src) +/obj/structure/fireaxecabinet/atom_deconstruct(disassembled = TRUE) + if(held_item && loc) + held_item.forceMove(loc) + new /obj/item/wallframe/fireaxecabinet(loc) /obj/structure/fireaxecabinet/blob_act(obj/structure/blob/B) if(held_item) @@ -230,12 +228,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fireaxecabinet/empty, 32) MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fireaxecabinet/mechremoval, 32) -/obj/structure/fireaxecabinet/mechremoval/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(held_item && loc) - held_item.forceMove(loc) - new /obj/item/wallframe/fireaxecabinet/mechremoval(loc) - qdel(src) +/obj/structure/fireaxecabinet/mechremoval/atom_deconstruct(disassembled = TRUE) + if(held_item && loc) + held_item.forceMove(loc) + new /obj/item/wallframe/fireaxecabinet/mechremoval(loc) /obj/structure/fireaxecabinet/mechremoval/empty populate_contents = FALSE diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index e7060a145e9..8749691c91d 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -263,13 +263,11 @@ var/matrix/M = matrix(transform) transform = M.Turn(-previous_rotation) -/obj/structure/flora/deconstruct() - if(!(obj_flags & NO_DECONSTRUCTION)) - if(harvested) - return ..() +/obj/structure/flora/atom_deconstruct(disassembled = TRUE) + if(harvested) + return ..() - harvest(product_amount_multiplier = 0.6) - . = ..() + harvest(product_amount_multiplier = 0.6) /********* * Trees * diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 3bb24147f5c..513525ffca3 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -384,11 +384,9 @@ return TRUE return FALSE -/obj/structure/girder/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/remains = pick(/obj/item/stack/rods, /obj/item/stack/sheet/iron) - new remains(loc) - qdel(src) +/obj/structure/girder/atom_deconstruct(disassembled = TRUE) + var/remains = pick(/obj/item/stack/rods, /obj/item/stack/sheet/iron) + new remains(loc) /obj/structure/girder/narsie_act() new /obj/structure/girder/cult(loc) @@ -461,10 +459,8 @@ /obj/structure/girder/cult/narsie_act() return -/obj/structure/girder/cult/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/stack/sheet/runed_metal(drop_location(), 1) - qdel(src) +/obj/structure/girder/cult/atom_deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/runed_metal(drop_location(), 1) /obj/structure/girder/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) switch(the_rcd.mode) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index da023942518..a25dfaada50 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -52,8 +52,6 @@ /obj/structure/grille/examine(mob/user) . = ..() - if(obj_flags & NO_DECONSTRUCTION) - return if(anchored) . += span_notice("It's secured in place with screws. The rods look like they could be cut through.") @@ -200,10 +198,8 @@ add_fingerprint(user) if(shock(user, 100)) return - if(obj_flags & NO_DECONSTRUCTION) - return FALSE tool.play_tool_sound(src, 100) - deconstruct() + deconstruct(TRUE) return ITEM_INTERACT_SUCCESS /obj/structure/grille/screwdriver_act(mob/living/user, obj/item/tool) @@ -212,8 +208,6 @@ add_fingerprint(user) if(shock(user, 90)) return FALSE - if(obj_flags & NO_DECONSTRUCTION) - return FALSE if(!tool.use_tool(src, user, 0, volume=100)) return FALSE set_anchored(!anchored) @@ -296,18 +290,13 @@ playsound(src, 'sound/items/welder.ogg', 80, TRUE) -/obj/structure/grille/deconstruct(disassembled = TRUE) - if(!loc) //if already qdel'd somehow, we do nothing - return - if(!(obj_flags & NO_DECONSTRUCTION)) - var/obj/R = new rods_type(drop_location(), rods_amount) - transfer_fingerprints_to(R) - qdel(src) - ..() +/obj/structure/grille/atom_deconstruct(disassembled = TRUE) + var/obj/rods = new rods_type(drop_location(), rods_amount) + transfer_fingerprints_to(rods) /obj/structure/grille/atom_break() . = ..() - if(!broken && !(obj_flags & NO_DECONSTRUCTION)) + if(!broken) icon_state = "brokengrille" set_density(FALSE) atom_integrity = 20 diff --git a/code/game/objects/structures/headpike.dm b/code/game/objects/structures/headpike.dm index b48cafc85d9..0c29d92d53b 100644 --- a/code/game/objects/structures/headpike.dm +++ b/code/game/objects/structures/headpike.dm @@ -64,7 +64,7 @@ if(!QDELETED(src)) deconstruct(TRUE) -/obj/structure/headpike/deconstruct(disassembled) +/obj/structure/headpike/atom_deconstruct(disassembled) var/obj/item/bodypart/head/our_head = victim var/obj/item/spear/our_spear = spear victim = null @@ -73,7 +73,6 @@ if(!disassembled) return ..() our_spear?.forceMove(drop_location()) - return ..() /obj/structure/headpike/attack_hand(mob/user, list/modifiers) . = ..() diff --git a/code/game/objects/structures/icemoon/cave_entrance.dm b/code/game/objects/structures/icemoon/cave_entrance.dm index 20f14844c12..4401b87d23e 100644 --- a/code/game/objects/structures/icemoon/cave_entrance.dm +++ b/code/game/objects/structures/icemoon/cave_entrance.dm @@ -40,10 +40,9 @@ GLOBAL_LIST_INIT(ore_probability, list( var/turf/closed/mineral/clearable = potential clearable.ScrapeAway(flags = CHANGETURF_IGNORE_AIR) -/obj/structure/spawner/ice_moon/deconstruct(disassembled) +/obj/structure/spawner/ice_moon/atom_deconstruct(disassembled) destroy_effect() drop_loot() - return ..() /** * Effects and messages created when the spawner is destroyed diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index 7a7307b0431..bfb26d481a2 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -159,13 +159,12 @@ buckled_mob.pixel_y = buckled_mob.base_pixel_y + PIXEL_Y_OFFSET_LYING REMOVE_TRAIT(buckled_mob, TRAIT_MOVE_UPSIDE_DOWN, REF(src)) -/obj/structure/kitchenspike/deconstruct(disassembled = TRUE) +/obj/structure/kitchenspike/atom_deconstruct(disassembled = TRUE) if(disassembled) var/obj/structure/meatspike_frame = new /obj/structure/kitchenspike_frame(src.loc) transfer_fingerprints_to(meatspike_frame) else new /obj/item/stack/sheet/iron(src.loc, 4) new /obj/item/stack/rods(loc, MEATSPIKE_IRONROD_REQUIREMENT) - qdel(src) #undef MEATSPIKE_IRONROD_REQUIREMENT diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 72f28ed8251..6d65705586a 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -57,10 +57,8 @@ var/turf/T = get_turf(src) return T.attackby(C, user) //hand this off to the turf instead (for building plating, catwalks, etc) -/obj/structure/lattice/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new build_material(get_turf(src), number_of_mats) - qdel(src) +/obj/structure/lattice/atom_deconstruct(disassembled = TRUE) + new build_material(get_turf(src), number_of_mats) /obj/structure/lattice/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) if(the_rcd.mode == RCD_TURF) @@ -113,11 +111,10 @@ C.deconstruct() ..() -/obj/structure/lattice/catwalk/deconstruct() +/obj/structure/lattice/catwalk/atom_deconstruct(disassembled = TRUE) var/turf/T = loc for(var/obj/structure/cable/C in T) C.deconstruct() - ..() /obj/structure/lattice/catwalk/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) if(the_rcd.mode == RCD_DECONSTRUCT) diff --git a/code/game/objects/structures/lavaland/necropolis_tendril.dm b/code/game/objects/structures/lavaland/necropolis_tendril.dm index 6d6b2e6af37..357fdaa9677 100644 --- a/code/game/objects/structures/lavaland/necropolis_tendril.dm +++ b/code/game/objects/structures/lavaland/necropolis_tendril.dm @@ -42,9 +42,8 @@ GLOBAL_LIST_INIT(tendrils, list()) AddComponent(/datum/component/gps, "Eerie Signal") GLOB.tendrils += src -/obj/structure/spawner/lavaland/deconstruct(disassembled) +/obj/structure/spawner/lavaland/atom_deconstruct(disassembled) new /obj/effect/collapse(loc) - return ..() /obj/structure/spawner/lavaland/examine(mob/user) var/list/examine_messages = ..() diff --git a/code/game/objects/structures/maintenance.dm b/code/game/objects/structures/maintenance.dm index f9ed6d93c1e..ecd6f54d255 100644 --- a/code/game/objects/structures/maintenance.dm +++ b/code/game/objects/structures/maintenance.dm @@ -303,11 +303,9 @@ at the cost of risking a vicious bite.**/ deconstruct() return TRUE -/obj/structure/steam_vent/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/stack/sheet/iron(loc, 1) - new /obj/item/stock_parts/water_recycler(loc, 1) - qdel(src) +/obj/structure/steam_vent/atom_deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/iron(loc, 1) + new /obj/item/stock_parts/water_recycler(loc, 1) /** * Creates "steam" smoke, and determines when the vent needs to block line of sight via reset_opacity. diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index 03e37346c57..d794f24dd08 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -204,14 +204,12 @@ /////////////////////// END TOOL OVERRIDES /////////////////////// -/obj/structure/mineral_door/deconstruct(disassembled = TRUE) +/obj/structure/mineral_door/atom_deconstruct(disassembled = TRUE) var/turf/T = get_turf(src) if(disassembled) new sheetType(T, sheetAmount) else new sheetType(T, max(sheetAmount - 2, 1)) - qdel(src) - /obj/structure/mineral_door/iron name = "iron door" diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index f796bae34cf..f15cabd707e 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -260,7 +260,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28) /obj/structure/mirror/atom_break(damage_flag, mapload) . = ..() - if(broken || (obj_flags & NO_DECONSTRUCTION)) + if(broken) return icon_state = "mirror_broke" if(!mapload) @@ -269,13 +269,11 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28) desc = "Oh no, seven years of bad luck!" broken = TRUE -/obj/structure/mirror/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(!disassembled) - new /obj/item/shard(loc) - else - new /obj/item/wallframe/mirror(loc) - qdel(src) +/obj/structure/mirror/atom_deconstruct(disassembled = TRUE) + if(!disassembled) + new /obj/item/shard(loc) + else + new /obj/item/wallframe/mirror(loc) /obj/structure/mirror/welder_act(mob/living/user, obj/item/I) ..() diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 05af991303f..698bc37c893 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -104,10 +104,8 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an return return attack_hand(user) -/obj/structure/bodycontainer/deconstruct(disassembled = TRUE) - if (!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/stack/sheet/iron(loc, 5) - qdel(src) +/obj/structure/bodycontainer/atom_deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/iron(loc, 5) /obj/structure/bodycontainer/container_resist_act(mob/living/user) if(!locked) @@ -473,9 +471,8 @@ GLOBAL_LIST_EMPTY(crematoriums) connected = null return ..() -/obj/structure/tray/deconstruct(disassembled = TRUE) +/obj/structure/tray/atom_deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/iron (loc, 2) - qdel(src) /obj/structure/tray/attack_paw(mob/user, list/modifiers) return attack_hand(user, modifiers) diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm index c737f21e6d9..841da899725 100644 --- a/code/game/objects/structures/noticeboard.dm +++ b/code/game/objects/structures/noticeboard.dm @@ -110,15 +110,13 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/noticeboard, 32) notices-- update_appearance(UPDATE_ICON) -/obj/structure/noticeboard/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(!disassembled) - new /obj/item/stack/sheet/mineral/wood(loc) - else - new /obj/item/wallframe/noticeboard(loc) +/obj/structure/noticeboard/atom_deconstruct(disassembled = TRUE) + if(!disassembled) + new /obj/item/stack/sheet/mineral/wood(loc) + else + new /obj/item/wallframe/noticeboard(loc) for(var/obj/item/content in contents) remove_item(content) - qdel(src) /obj/item/wallframe/noticeboard name = "notice board" diff --git a/code/game/objects/structures/petrified_statue.dm b/code/game/objects/structures/petrified_statue.dm index a752faba40c..5383436d4db 100644 --- a/code/game/objects/structures/petrified_statue.dm +++ b/code/game/objects/structures/petrified_statue.dm @@ -73,7 +73,7 @@ petrified_mob.forceMove(loc) return ..() -/obj/structure/statue/petrified/deconstruct(disassembled = TRUE) +/obj/structure/statue/petrified/atom_deconstruct(disassembled = TRUE) var/destruction_message = "[src] shatters!" if(!disassembled) if(petrified_mob) @@ -89,7 +89,6 @@ destruction_message = "[src] shatters, a solid brain tumbling out!" petrified_mob.dust() visible_message(span_danger(destruction_message)) - qdel(src) /obj/structure/statue/petrified/animate_atom_living(mob/living/owner) if(isnull(petrified_mob)) diff --git a/code/game/objects/structures/pinatas.dm b/code/game/objects/structures/pinatas.dm index 116de95c167..63502f12ad5 100644 --- a/code/game/objects/structures/pinatas.dm +++ b/code/game/objects/structures/pinatas.dm @@ -41,9 +41,8 @@ if(BURN) playsound(src, 'sound/items/welder.ogg', 100, TRUE) -/obj/structure/pinata/deconstruct(disassembled) +/obj/structure/pinata/atom_deconstruct(disassembled) new debris(get_turf(src)) - return ..() ///An item that when used inhand spawns an immovable pinata /obj/item/pinata @@ -72,7 +71,7 @@ base_icon_state = "pinata_syndie_placed" destruction_loot = 2 debris = /obj/effect/decal/cleanable/wrapping/pinata/syndie - candy_options = list( + candy_options = list( /obj/item/food/bubblegum, /obj/item/food/candy, /obj/item/food/chocolatebar, diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index 6dd3eb800a3..a2a1e1c04bc 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -124,10 +124,8 @@ return FALSE //If you're not laying down, or a small creature, or a ventcrawler, then no pass. -/obj/structure/plasticflaps/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/stack/sheet/plastic/five(loc) - qdel(src) +/obj/structure/plasticflaps/atom_deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/plastic/five(loc) /obj/structure/plasticflaps/Initialize(mapload) . = ..() diff --git a/code/game/objects/structures/railings.dm b/code/game/objects/structures/railings.dm index 3604bd06c63..95cf4fc58e5 100644 --- a/code/game/objects/structures/railings.dm +++ b/code/game/objects/structures/railings.dm @@ -98,19 +98,14 @@ deconstruct() return TRUE -/obj/structure/railing/deconstruct(disassembled) - if((obj_flags & NO_DECONSTRUCTION)) - return ..() +/obj/structure/railing/atom_deconstruct(disassembled) var/rods_to_make = istype(src,/obj/structure/railing/corner) ? 1 : 2 var/obj/rod = new item_deconstruct(drop_location(), rods_to_make) transfer_fingerprints_to(rod) - return ..() ///Implements behaviour that makes it possible to unanchor the railing. /obj/structure/railing/wrench_act(mob/living/user, obj/item/I) . = ..() - if(obj_flags & NO_DECONSTRUCTION) - return to_chat(user, span_notice("You begin to [anchored ? "unfasten the railing from":"fasten the railing to"] the floor...")) if(I.use_tool(src, user, volume = 75, extra_checks = CALLBACK(src, PROC_REF(check_anchored), anchored))) set_anchored(!anchored) diff --git a/code/game/objects/structures/secure_safe.dm b/code/game/objects/structures/secure_safe.dm index bc73eea6ec0..76c3ab4575f 100644 --- a/code/game/objects/structures/secure_safe.dm +++ b/code/game/objects/structures/secure_safe.dm @@ -45,12 +45,11 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/secure_safe, 32) if(mapload) PopulateContents() -/obj/structure/secure_safe/deconstruct(disassembled) +/obj/structure/secure_safe/atom_deconstruct(disassembled) if(!density) //if we're a wall item, we'll drop a wall frame. var/obj/item/wallframe/secure_safe/new_safe = new(get_turf(src)) for(var/obj/item in contents) item.forceMove(new_safe) - return ..() /obj/structure/secure_safe/proc/PopulateContents() new /obj/item/paper(src) diff --git a/code/game/objects/structures/shower.dm b/code/game/objects/structures/shower.dm index c71bd3c7e0c..48fa379b416 100644 --- a/code/game/objects/structures/shower.dm +++ b/code/game/objects/structures/shower.dm @@ -184,9 +184,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/shower, (-16)) /obj/machinery/shower/wrench_act(mob/living/user, obj/item/I) . = ..() - if(obj_flags & NO_DECONSTRUCTION) - return - I.play_tool_sound(src) deconstruct() return TRUE diff --git a/code/game/objects/structures/stairs.dm b/code/game/objects/structures/stairs.dm index 169f76a4b57..a26354211dc 100644 --- a/code/game/objects/structures/stairs.dm +++ b/code/game/objects/structures/stairs.dm @@ -209,9 +209,8 @@ deconstruct(TRUE) return TRUE -/obj/structure/stairs_frame/deconstruct(disassembled = TRUE) +/obj/structure/stairs_frame/atom_deconstruct(disassembled = TRUE) new frame_stack(get_turf(src), frame_stack_amount) - qdel(src) /obj/structure/stairs_frame/attackby(obj/item/attacked_by, mob/user, params) if(!isstack(attacked_by)) diff --git a/code/game/objects/structures/table_frames.dm b/code/game/objects/structures/table_frames.dm index ba654d10b91..331667c506e 100644 --- a/code/game/objects/structures/table_frames.dm +++ b/code/game/objects/structures/table_frames.dm @@ -75,9 +75,8 @@ T.set_custom_materials(custom_materials) qdel(src) -/obj/structure/table_frame/deconstruct(disassembled = TRUE) +/obj/structure/table_frame/atom_deconstruct(disassembled = TRUE) new framestack(get_turf(src), framestackamount) - qdel(src) /obj/structure/table_frame/narsie_act() new /obj/structure/table_frame/wood(src.loc) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 997d23c4139..eff8aa8ba36 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -73,7 +73,7 @@ context[SCREENTIP_CONTEXT_RMB] = "Deal card faceup" . = CONTEXTUAL_SCREENTIP_SET - if(!(obj_flags & NO_DECONSTRUCTION) && deconstruction_ready) + if(deconstruction_ready) if(held_item.tool_behaviour == TOOL_SCREWDRIVER) context[SCREENTIP_CONTEXT_RMB] = "Disassemble" . = CONTEXTUAL_SCREENTIP_SET @@ -207,7 +207,7 @@ pushed_mob.add_mood_event("table", /datum/mood_event/table_limbsmash, banged_limb) /obj/structure/table/screwdriver_act_secondary(mob/living/user, obj/item/tool) - if(obj_flags & NO_DECONSTRUCTION || !deconstruction_ready) + if(!deconstruction_ready) return FALSE to_chat(user, span_notice("You start disassembling [src]...")) if(tool.use_tool(src, user, 2 SECONDS, volume=50)) @@ -215,12 +215,12 @@ return ITEM_INTERACT_SUCCESS /obj/structure/table/wrench_act_secondary(mob/living/user, obj/item/tool) - if(obj_flags & NO_DECONSTRUCTION || !deconstruction_ready) + if(!deconstruction_ready) return FALSE to_chat(user, span_notice("You start deconstructing [src]...")) if(tool.use_tool(src, user, 4 SECONDS, volume=50)) playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE) - deconstruct(TRUE, 1) + deconstruct(TRUE) return ITEM_INTERACT_SUCCESS /obj/structure/table/attackby(obj/item/I, mob/living/user, params) @@ -297,20 +297,14 @@ /obj/structure/table/proc/AfterPutItemOnTable(obj/item/thing, mob/living/user) return -/obj/structure/table/deconstruct(disassembled = TRUE, wrench_disassembly = 0) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/turf/T = get_turf(src) - if(buildstack) - new buildstack(T, buildstackamount) - else - for(var/i in custom_materials) - var/datum/material/M = i - new M.sheet_type(T, FLOOR(custom_materials[M] / SHEET_MATERIAL_AMOUNT, 1)) - if(!wrench_disassembly) - new frame(T) - else - new framestack(T, framestackamount) - qdel(src) +/obj/structure/table/atom_deconstruct(disassembled = TRUE) + var/turf/target_turf = get_turf(src) + if(buildstack) + new buildstack(target_turf, buildstackamount) + else + for(var/datum/material/mat in custom_materials) + new mat.sheet_type(target_turf, FLOOR(custom_materials[mat] / SHEET_MATERIAL_AMOUNT, 1)) + new framestack(target_turf, framestackamount) /obj/structure/table/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) if(the_rcd.mode == RCD_DECONSTRUCT) @@ -437,8 +431,7 @@ /obj/structure/table/glass/proc/on_entered(datum/source, atom/movable/AM) SIGNAL_HANDLER - if(obj_flags & NO_DECONSTRUCTION) - return + if(!isliving(AM)) return // Don't break if they're just flying past @@ -469,19 +462,16 @@ victim.Paralyze(100) qdel(src) -/obj/structure/table/glass/deconstruct(disassembled = TRUE, wrench_disassembly = 0) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(disassembled) - ..() - return - else - var/turf/T = get_turf(src) - playsound(T, SFX_SHATTER, 50, TRUE) +/obj/structure/table/glass/atom_deconstruct(disassembled = TRUE) + if(disassembled) + ..() + return + else + var/turf/T = get_turf(src) + playsound(T, SFX_SHATTER, 50, TRUE) - new frame(loc) - new glass_shard_type(loc) - - qdel(src) + new frame(loc) + new glass_shard_type(loc) /obj/structure/table/glass/narsie_act() color = NARSIE_WINDOW_COLOUR @@ -841,10 +831,9 @@ if(isnull(held_item)) return NONE - if(!(obj_flags & NO_DECONSTRUCTION)) - if(held_item.tool_behaviour == TOOL_WRENCH) - context[SCREENTIP_CONTEXT_RMB] = "Deconstruct" - return CONTEXTUAL_SCREENTIP_SET + if(held_item.tool_behaviour == TOOL_WRENCH) + context[SCREENTIP_CONTEXT_RMB] = "Deconstruct" + return CONTEXTUAL_SCREENTIP_SET return NONE @@ -860,8 +849,6 @@ return TRUE /obj/structure/rack/wrench_act_secondary(mob/living/user, obj/item/tool) - if(obj_flags & NO_DECONSTRUCTION) - return NONE tool.play_tool_sound(src) deconstruct(TRUE) return ITEM_INTERACT_SUCCESS @@ -901,12 +888,10 @@ * Rack destruction */ -/obj/structure/rack/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - set_density(FALSE) - var/obj/item/rack_parts/newparts = new(loc) - transfer_fingerprints_to(newparts) - qdel(src) +/obj/structure/rack/atom_deconstruct(disassembled = TRUE) + set_density(FALSE) + var/obj/item/rack_parts/newparts = new(loc) + transfer_fingerprints_to(newparts) /* @@ -935,24 +920,19 @@ context[SCREENTIP_CONTEXT_LMB] = "Construct Rack" return CONTEXTUAL_SCREENTIP_SET - if(!(obj_flags & NO_DECONSTRUCTION)) - if(held_item.tool_behaviour == TOOL_WRENCH) - context[SCREENTIP_CONTEXT_LMB] = "Deconstruct" - return CONTEXTUAL_SCREENTIP_SET + if(held_item.tool_behaviour == TOOL_WRENCH) + context[SCREENTIP_CONTEXT_LMB] = "Deconstruct" + return CONTEXTUAL_SCREENTIP_SET return NONE /obj/item/rack_parts/wrench_act(mob/living/user, obj/item/tool) - if(obj_flags & NO_DECONSTRUCTION) - return NONE tool.play_tool_sound(src) deconstruct(TRUE) return ITEM_INTERACT_SUCCESS -/obj/item/rack_parts/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/stack/sheet/iron(drop_location()) - return ..() +/obj/item/rack_parts/atom_deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/iron(drop_location()) /obj/item/rack_parts/attack_self(mob/user) if(building) diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index ec00eb110a7..2c0b3bdc95b 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -103,13 +103,11 @@ return TRUE -/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - for(var/X in src) - var/obj/item/I = X - I.forceMove(loc) - new /obj/item/stack/sheet/iron (loc, 2) - qdel(src) +/obj/structure/tank_dispenser/atom_deconstruct(disassembled = TRUE) + for(var/X in src) + var/obj/item/I = X + I.forceMove(loc) + new /obj/item/stack/sheet/iron (loc, 2) /obj/structure/tank_dispenser/proc/dispense(tank_type, mob/receiver) var/existing_tank = locate(tank_type) in src diff --git a/code/game/objects/structures/tank_holder.dm b/code/game/objects/structures/tank_holder.dm index 5b7c9d2ed55..34284b1f1dd 100644 --- a/code/game/objects/structures/tank_holder.dm +++ b/code/game/objects/structures/tank_holder.dm @@ -63,12 +63,11 @@ deconstruct(TRUE) return TRUE -/obj/structure/tank_holder/deconstruct(disassembled = TRUE) +/obj/structure/tank_holder/atom_deconstruct(disassembled = TRUE) var/atom/Tsec = drop_location() new /obj/item/stack/rods(Tsec, 2) if(tank) tank.forceMove(Tsec) - qdel(src) /obj/structure/tank_holder/attack_paw(mob/user, list/modifiers) return attack_hand(user, modifiers) diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm index 67d3d4c9510..b1168302f68 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm @@ -35,22 +35,16 @@ user.visible_message(span_notice("[user] empties \the [src]."), span_notice("You empty \the [src].")) empty_pod() else - deconstruct(TRUE, user) + deconstruct(TRUE) else return ..() -/obj/structure/transit_tube_pod/deconstruct(disassembled = TRUE, mob/user) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/atom/location = get_turf(src) - if(user) - location = user.loc - add_fingerprint(user) - user.visible_message(span_notice("[user] removes [src]."), span_notice("You remove [src].")) - var/obj/structure/c_transit_tube_pod/R = new/obj/structure/c_transit_tube_pod(location) - transfer_fingerprints_to(R) - R.setDir(dir) - empty_pod(location) - qdel(src) +/obj/structure/transit_tube_pod/atom_deconstruct(disassembled = TRUE) + var/atom/location = get_turf(src) + var/obj/structure/c_transit_tube_pod/tube_pod = new/obj/structure/c_transit_tube_pod(location) + transfer_fingerprints_to(tube_pod) + tube_pod.setDir(dir) + empty_pod(location) /obj/structure/transit_tube_pod/ex_act(severity, target) . = ..() diff --git a/code/game/objects/structures/votingbox.dm b/code/game/objects/structures/votingbox.dm index 00eeeb55ae2..42ccd625093 100644 --- a/code/game/objects/structures/votingbox.dm +++ b/code/game/objects/structures/votingbox.dm @@ -149,9 +149,8 @@ for(var/atom/movable/AM in contents) AM.forceMove(droppoint) -/obj/structure/votebox/deconstruct(disassembled) +/obj/structure/votebox/atom_deconstruct(disassembled) dump_contents() - . = ..() /obj/structure/votebox/proc/raffle(mob/user) var/list/options = list() diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index eac58d119a8..ecdd4bdacdd 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -83,17 +83,15 @@ icon_state = "toilet[open][cistern]" return ..() -/obj/structure/toilet/deconstruct() - if(!(obj_flags & NO_DECONSTRUCTION)) - for(var/obj/toilet_item in contents) - toilet_item.forceMove(drop_location()) - if(buildstacktype) - new buildstacktype(loc,buildstackamount) - else - for(var/i in custom_materials) - var/datum/material/M = i - new M.sheet_type(loc, FLOOR(custom_materials[M] / SHEET_MATERIAL_AMOUNT, 1)) - ..() +/obj/structure/toilet/atom_deconstruct(dissambled = TRUE) + for(var/obj/toilet_item in contents) + toilet_item.forceMove(drop_location()) + if(buildstacktype) + new buildstacktype(loc,buildstackamount) + else + for(var/i in custom_materials) + var/datum/material/M = i + new M.sheet_type(loc, FLOOR(custom_materials[M] / SHEET_MATERIAL_AMOUNT, 1)) /obj/structure/toilet/attackby(obj/item/I, mob/living/user, params) add_fingerprint(user) @@ -105,7 +103,7 @@ cistern = !cistern update_appearance() return COMPONENT_CANCEL_ATTACK_CHAIN - else if(I.tool_behaviour == TOOL_WRENCH && !(obj_flags & NO_DECONSTRUCTION)) + else if(I.tool_behaviour == TOOL_WRENCH) I.play_tool_sound(src) deconstruct() return TRUE @@ -227,10 +225,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/urinal, 32) exposed = !exposed return TRUE -/obj/structure/urinal/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/wallframe/urinal(loc) - qdel(src) +/obj/structure/urinal/atom_deconstruct(disassembled = TRUE) + new /obj/item/wallframe/urinal(loc) /obj/item/wallframe/urinal name = "urinal frame" @@ -419,7 +415,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sink, (-14)) playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE) return - if(O.tool_behaviour == TOOL_WRENCH && !(obj_flags & NO_DECONSTRUCTION)) + if(O.tool_behaviour == TOOL_WRENCH) O.play_tool_sound(src) deconstruct() return @@ -495,12 +491,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sink, (-14)) else return ..() -/obj/structure/sink/deconstruct() - if(!(obj_flags & NO_DECONSTRUCTION)) - drop_materials() - if(has_water_reclaimer) - new /obj/item/stock_parts/water_recycler(drop_location()) - ..() +/obj/structure/sink/atom_deconstruct(dissambled = TRUE) + drop_materials() + if(has_water_reclaimer) + new /obj/item/stock_parts/water_recycler(drop_location()) /obj/structure/sink/process(seconds_per_tick) // Water reclamation complete? @@ -571,10 +565,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sink/kitchen, (-16)) deconstruct() return TRUE -/obj/structure/sinkframe/deconstruct() - if(!(obj_flags & NO_DECONSTRUCTION)) - drop_materials() - return ..() +/obj/structure/sinkframe/atom_deconstruct(dissambled = TRUE) + drop_materials() /obj/structure/sinkframe/proc/drop_materials() for(var/datum/material/material as anything in custom_materials) @@ -725,9 +717,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sink/kitchen, (-16)) . = ..() icon_state = "puddle" -/obj/structure/water_source/puddle/deconstruct(disassembled = TRUE) - qdel(src) - //End legacy sink @@ -804,11 +793,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sink/kitchen, (-16)) playsound(loc, 'sound/effects/curtain.ogg', 50, TRUE) toggle() -/obj/structure/curtain/deconstruct(disassembled = TRUE) +/obj/structure/curtain/atom_deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/cloth (loc, 2) new /obj/item/stack/sheet/plastic (loc, 2) new /obj/item/stack/rods (loc, 1) - qdel(src) /obj/structure/curtain/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) switch(damage_type) @@ -840,10 +828,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sink/kitchen, (-16)) alpha = 255 opaque_closed = TRUE -/obj/structure/curtain/cloth/deconstruct(disassembled = TRUE) +/obj/structure/curtain/cloth/atom_deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/cloth (loc, 4) new /obj/item/stack/rods (loc, 1) - qdel(src) /obj/structure/curtain/cloth/fancy icon_type = "cur_fancy" diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 730735b8b3a..4fd6c061068 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -78,8 +78,6 @@ /obj/structure/window/examine(mob/user) . = ..() - if(obj_flags & NO_DECONSTRUCTION) - return switch(state) if(WINDOW_SCREWED_TO_FRAME) @@ -210,8 +208,6 @@ return ITEM_INTERACT_SUCCESS /obj/structure/window/screwdriver_act(mob/living/user, obj/item/tool) - if(obj_flags & NO_DECONSTRUCTION) - return switch(state) if(WINDOW_SCREWED_TO_FRAME) @@ -240,7 +236,7 @@ /obj/structure/window/wrench_act(mob/living/user, obj/item/tool) if(anchored) return FALSE - if((obj_flags & NO_DECONSTRUCTION) || (reinf && state >= RWINDOW_FRAME_BOLTED)) + if(reinf && state >= RWINDOW_FRAME_BOLTED) return FALSE to_chat(user, span_notice("You begin to disassemble [src]...")) @@ -255,7 +251,7 @@ return ITEM_INTERACT_SUCCESS /obj/structure/window/crowbar_act(mob/living/user, obj/item/tool) - if(!anchored || (obj_flags & NO_DECONSTRUCTION)) + if(!anchored) return FALSE switch(state) @@ -330,18 +326,13 @@ playsound(src, 'sound/items/welder.ogg', 100, TRUE) -/obj/structure/window/deconstruct(disassembled = TRUE) - if(QDELETED(src)) - return +/obj/structure/window/atom_deconstruct(disassembled = TRUE) if(!disassembled) playsound(src, break_sound, 70, TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - for(var/obj/item/shard/debris in spawn_debris(drop_location())) - transfer_fingerprints_to(debris) // transfer fingerprints to shards only - qdel(src) + for(var/obj/item/shard/debris in spawn_debris(drop_location())) + transfer_fingerprints_to(debris) // transfer fingerprints to shards only update_nearby_icons() - ///Spawns shard and debris decal based on the glass_material_datum, spawns rods if window is reinforned and number of shards/rods is determined by the window being fulltile or not. /obj/structure/window/proc/spawn_debris(location) var/datum/material/glass_material_ref = GET_MATERIAL_REF(glass_material_datum) @@ -480,9 +471,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/unanchored/spawner, 0) return FALSE /obj/structure/window/reinforced/attackby_secondary(obj/item/tool, mob/user, params) - if(obj_flags & NO_DECONSTRUCTION) - return ..() - switch(state) if(RWINDOW_SECURE) if(tool.tool_behaviour == TOOL_WELDER) @@ -546,7 +534,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/unanchored/spawner, 0) /obj/structure/window/reinforced/crowbar_act(mob/living/user, obj/item/tool) if(!anchored) return FALSE - if((obj_flags & NO_DECONSTRUCTION) || (state != WINDOW_OUT_OF_FRAME)) + if(state != WINDOW_OUT_OF_FRAME) return FALSE to_chat(user, span_notice("You begin to lever the window back into the frame...")) if(tool.use_tool(src, user, 10 SECONDS, volume = 75, extra_checks = CALLBACK(src, PROC_REF(check_state_and_anchored), state, anchored))) @@ -561,8 +549,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/unanchored/spawner, 0) /obj/structure/window/reinforced/examine(mob/user) . = ..() - if(obj_flags & NO_DECONSTRUCTION) - return + switch(state) if(RWINDOW_SECURE) . += span_notice("It's been screwed in with one way screws, you'd need to heat them to have any chance of backing them out.") @@ -803,9 +790,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/reinforced/tinted/frosted/spaw /obj/structure/window/reinforced/shuttle/indestructible name = "hardened shuttle window" - obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION flags_1 = PREVENT_CLICK_UNDER_1 resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF + obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION /obj/structure/window/reinforced/shuttle/indestructible/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) return FALSE diff --git a/code/modules/antagonists/heretic/structures/mawed_crucible.dm b/code/modules/antagonists/heretic/structures/mawed_crucible.dm index 7c1208b1e44..8e5410f0f67 100644 --- a/code/modules/antagonists/heretic/structures/mawed_crucible.dm +++ b/code/modules/antagonists/heretic/structures/mawed_crucible.dm @@ -21,8 +21,7 @@ . = ..() break_message = span_warning("[src] falls apart with a thud!") -/obj/structure/destructible/eldritch_crucible/deconstruct(disassembled = TRUE) - +/obj/structure/destructible/eldritch_crucible/atom_deconstruct(disassembled = TRUE) // Create a spillage if we were destroyed with leftover mass if(current_mass) break_message = span_warning("[src] falls apart with a thud, spilling shining extract everywhere!") diff --git a/code/modules/art/statues.dm b/code/modules/art/statues.dm index caebda50766..428bb5d8e06 100644 --- a/code/modules/art/statues.dm +++ b/code/modules/art/statues.dm @@ -30,35 +30,30 @@ /obj/structure/statue/wrench_act(mob/living/user, obj/item/tool) . = ..() - if(obj_flags & NO_DECONSTRUCTION) - return FALSE default_unfasten_wrench(user, tool) return ITEM_INTERACT_SUCCESS /obj/structure/statue/attackby(obj/item/W, mob/living/user, params) add_fingerprint(user) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(W.tool_behaviour == TOOL_WELDER) - if(!W.tool_start_check(user, amount=1)) - return FALSE - user.balloon_alert(user, "slicing apart...") - if(W.use_tool(src, user, 40, volume=50)) - deconstruct(TRUE) - return + if(W.tool_behaviour == TOOL_WELDER) + if(!W.tool_start_check(user, amount=1)) + return FALSE + user.balloon_alert(user, "slicing apart...") + if(W.use_tool(src, user, 40, volume=50)) + deconstruct(TRUE) + return return ..() /obj/structure/statue/AltClick(mob/user) return ..() // This hotkey is BLACKLISTED since it's used by /datum/component/simple_rotation -/obj/structure/statue/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/amount_mod = disassembled ? 0 : -2 - for(var/mat in custom_materials) - var/datum/material/custom_material = GET_MATERIAL_REF(mat) - var/amount = max(0,round(custom_materials[mat]/SHEET_MATERIAL_AMOUNT) + amount_mod) - if(amount > 0) - new custom_material.sheet_type(drop_location(), amount) - qdel(src) +/obj/structure/statue/atom_deconstruct(disassembled = TRUE) + var/amount_mod = disassembled ? 0 : -2 + for(var/mat in custom_materials) + var/datum/material/custom_material = GET_MATERIAL_REF(mat) + var/amount = max(0,round(custom_materials[mat]/SHEET_MATERIAL_AMOUNT) + amount_mod) + if(amount > 0) + new custom_material.sheet_type(drop_location(), amount) //////////////////////////////////////STATUES///////////////////////////////////////////////////////////// ////////////////////////uranium/////////////////////////////////// diff --git a/code/modules/atmospherics/machinery/components/tank.dm b/code/modules/atmospherics/machinery/components/tank.dm index cf18488f052..8df616c179c 100644 --- a/code/modules/atmospherics/machinery/components/tank.dm +++ b/code/modules/atmospherics/machinery/components/tank.dm @@ -459,11 +459,10 @@ var/welder_hint = EXAMINE_HINT("welder") . += span_notice("The plating has been firmly attached and would need a [crowbar_hint] to detach, but still needs to be sealed by a [welder_hint].") -/obj/structure/tank_frame/deconstruct(disassembled) +/obj/structure/tank_frame/atom_deconstruct(disassembled) if(disassembled) for(var/datum/material/mat as anything in custom_materials) new mat.sheet_type(drop_location(), custom_materials[mat] / SHEET_MATERIAL_AMOUNT) - return ..() /obj/structure/tank_frame/update_icon(updates) . = ..() diff --git a/code/modules/economy/holopay.dm b/code/modules/economy/holopay.dm index 3f11d096205..15247d19d57 100644 --- a/code/modules/economy/holopay.dm +++ b/code/modules/economy/holopay.dm @@ -65,9 +65,8 @@ if(BURN) playsound(loc, 'sound/weapons/egloves.ogg', 80, TRUE) -/obj/structure/holopay/deconstruct() +/obj/structure/holopay/atom_deconstruct(dissambled = TRUE) dissipate() - return ..() /obj/structure/holopay/Destroy() linked_card?.my_store = null diff --git a/code/modules/food_and_drinks/machinery/griddle.dm b/code/modules/food_and_drinks/machinery/griddle.dm index f997b049feb..b54a470897f 100644 --- a/code/modules/food_and_drinks/machinery/griddle.dm +++ b/code/modules/food_and_drinks/machinery/griddle.dm @@ -37,8 +37,6 @@ /obj/machinery/griddle/crowbar_act(mob/living/user, obj/item/I) . = ..() - if(obj_flags & NO_DECONSTRUCTION) - return if(default_deconstruction_crowbar(I, ignore_panel = TRUE)) return variant = rand(1,3) diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm index eb0261739ad..3d80ef6d968 100644 --- a/code/modules/holodeck/items.dm +++ b/code/modules/holodeck/items.dm @@ -140,7 +140,7 @@ for (var/list/zlevel_turfs as anything in currentarea.get_zlevel_turf_lists()) for(var/turf/area_turf as anything in zlevel_turfs) for(var/obj/structure/window/barrier in area_turf) - if((barrier.obj_flags & NO_DECONSTRUCTION) || (barrier.flags_1 & HOLOGRAM_1))// Just in case: only holo-windows + if(barrier.flags_1 & HOLOGRAM_1)// Just in case: only holo-windows qdel(barrier) for(var/mob/contestant in area_turf) diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 6636fedd25c..521afd6b539 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -249,7 +249,7 @@ visible_message(span_notice("[user] removes the queen from the apiary.")) queen_bee = null -/obj/structure/beebox/deconstruct(disassembled = TRUE) +/obj/structure/beebox/atom_deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/mineral/wood (loc, 20) for(var/mob/living/basic/bee/worker as anything in bees) if(worker.loc == src) @@ -260,7 +260,6 @@ if(frame.loc == src) frame.forceMove(get_turf(src)) honey_frames -= frame - qdel(src) /obj/structure/beebox/unwrenched anchored = FALSE diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 0752d418a4e..cc432d4bbad 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -1164,6 +1164,12 @@ self_sustaining_overlay_icon_state = null maxnutri = 15 +/obj/machinery/hydroponics/soil/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver) + return NONE + +/obj/machinery/hydroponics/soil/default_deconstruction_crowbar(obj/item/crowbar, ignore_panel, custom_deconstruct) + return NONE + /obj/machinery/hydroponics/soil/update_icon(updates=ALL) . = ..() if(self_sustaining) diff --git a/code/modules/library/bookcase.dm b/code/modules/library/bookcase.dm index be2beca42ba..822e4ae583c 100644 --- a/code/modules/library/bookcase.dm +++ b/code/modules/library/bookcase.dm @@ -172,14 +172,13 @@ choice.forceMove(drop_location()) update_appearance() -/obj/structure/bookcase/deconstruct(disassembled = TRUE) +/obj/structure/bookcase/atom_deconstruct(disassembled = TRUE) var/atom/Tsec = drop_location() new /obj/item/stack/sheet/mineral/wood(Tsec, 4) for(var/obj/item/I in contents) if(!isbook(I)) //Wake me up inside continue I.forceMove(Tsec) - return ..() /obj/structure/bookcase/update_icon_state() if(state == BOOKCASE_UNANCHORED || state == BOOKCASE_ANCHORED) diff --git a/code/modules/mapfluff/ruins/lavalandruin_code/elephantgraveyard.dm b/code/modules/mapfluff/ruins/lavalandruin_code/elephantgraveyard.dm index 97a543fa7e7..3c29a6a3945 100644 --- a/code/modules/mapfluff/ruins/lavalandruin_code/elephantgraveyard.dm +++ b/code/modules/mapfluff/ruins/lavalandruin_code/elephantgraveyard.dm @@ -107,7 +107,7 @@ /obj/structure/sink/oil_well/attackby(obj/item/O, mob/living/user, params) flick("puddle-oil-splash",src) - if(O.tool_behaviour == TOOL_SHOVEL && !(obj_flags & NO_DECONSTRUCTION)) //attempt to deconstruct the puddle with a shovel + if(O.tool_behaviour == TOOL_SHOVEL) //attempt to deconstruct the puddle with a shovel to_chat(user, "You fill in the oil well with soil.") O.play_tool_sound(src) deconstruct() diff --git a/code/modules/mapfluff/ruins/objects_and_mobs/ash_walker_den.dm b/code/modules/mapfluff/ruins/objects_and_mobs/ash_walker_den.dm index a1391f92ed3..21c96f0aeaa 100644 --- a/code/modules/mapfluff/ruins/objects_and_mobs/ash_walker_den.dm +++ b/code/modules/mapfluff/ruins/objects_and_mobs/ash_walker_den.dm @@ -35,11 +35,10 @@ STOP_PROCESSING(SSprocessing, src) return ..() -/obj/structure/lavaland/ash_walker/deconstruct(disassembled) +/obj/structure/lavaland/ash_walker/atom_deconstruct(disassembled) var/core_to_drop = pick(subtypesof(/obj/item/assembly/signaler/anomaly)) new core_to_drop (get_step(loc, pick(GLOB.alldirs))) new /obj/effect/collapse(loc) - return ..() /obj/structure/lavaland/ash_walker/process() consume() diff --git a/code/modules/mining/abandoned_crates.dm b/code/modules/mining/abandoned_crates.dm index ce42eaa43c2..5022dac212c 100644 --- a/code/modules/mining/abandoned_crates.dm +++ b/code/modules/mining/abandoned_crates.dm @@ -121,7 +121,7 @@ return return ..() -/obj/structure/closet/crate/secure/loot/deconstruct(disassembled = TRUE) +/obj/structure/closet/crate/secure/loot/atom_deconstruct(disassembled = TRUE) if(locked) boom() return diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm index 67eb767f767..38dda48d345 100644 --- a/code/modules/mining/equipment/marker_beacons.dm +++ b/code/modules/mining/equipment/marker_beacons.dm @@ -99,12 +99,10 @@ GLOBAL_LIST_INIT(marker_beacon_colors, sort_list(list( picked_color = set_color update_appearance() -/obj/structure/marker_beacon/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/obj/item/stack/marker_beacon/M = new(loc) - M.picked_color = picked_color - M.update_appearance() - qdel(src) +/obj/structure/marker_beacon/atom_deconstruct(disassembled = TRUE) + var/obj/item/stack/marker_beacon/beacon = new(loc) + beacon.picked_color = picked_color + beacon.update_appearance() /obj/structure/marker_beacon/examine(mob/user) . = ..() diff --git a/code/modules/mining/equipment/survival_pod.dm b/code/modules/mining/equipment/survival_pod.dm index f4463434066..d40589dd3f8 100644 --- a/code/modules/mining/equipment/survival_pod.dm +++ b/code/modules/mining/equipment/survival_pod.dm @@ -214,8 +214,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/door/window/survival_pod/left, 0) /obj/item/gps/computer/wrench_act(mob/living/user, obj/item/I) ..() - if(obj_flags & NO_DECONSTRUCTION) - return TRUE user.visible_message(span_warning("[user] disassembles [src]."), span_notice("You start to disassemble [src]..."), span_hear("You hear clanking and banging noises.")) diff --git a/code/modules/mining/satchel_ore_box.dm b/code/modules/mining/satchel_ore_box.dm index 3b2a5ce054c..b94796b1614 100644 --- a/code/modules/mining/satchel_ore_box.dm +++ b/code/modules/mining/satchel_ore_box.dm @@ -19,13 +19,11 @@ for(var/obj/item/weapon in src) weapon.forceMove(drop) -/obj/structure/ore_box/deconstruct(disassembled = TRUE) +/obj/structure/ore_box/atom_deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/mineral/wood(loc, 4) dump_box_contents() - return ..() - /obj/structure/ore_box/add_context(atom/source, list/context, obj/item/held_item, mob/user) . = NONE if(isnull(held_item)) diff --git a/code/modules/mob/living/basic/lavaland/gutlunchers/gutluncher_foodtrough.dm b/code/modules/mob/living/basic/lavaland/gutlunchers/gutluncher_foodtrough.dm index 1ac43c13eb4..734d431912f 100644 --- a/code/modules/mob/living/basic/lavaland/gutlunchers/gutluncher_foodtrough.dm +++ b/code/modules/mob/living/basic/lavaland/gutlunchers/gutluncher_foodtrough.dm @@ -22,11 +22,8 @@ list_of_materials -= mover.type return ..() -/obj/structure/ore_container/gutlunch_trough/deconstruct(disassembled = TRUE) - if(obj_flags & NO_DECONSTRUCTION) - return +/obj/structure/ore_container/gutlunch_trough/atom_deconstruct(disassembled = TRUE) new /obj/item/stack/sheet/mineral/wood(drop_location(), 5) - qdel(src) /obj/structure/ore_container/gutlunch_trough/update_overlays() . = ..() diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 74e5931163b..56693b20b36 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -289,10 +289,9 @@ brainmob.emp_damage = min(brainmob.emp_damage + rand(0,10), 30) brainmob.emote("alarm") -/obj/item/mmi/deconstruct(disassembled = TRUE) +/obj/item/mmi/atom_deconstruct(disassembled = TRUE) if(brain) eject_brain() - qdel(src) /obj/item/mmi/examine(mob/user) . = ..() diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index da3e378ef30..f47210901df 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -901,20 +901,18 @@ update_appearance() return ITEM_INTERACT_SUCCESS -/obj/item/modular_computer/deconstruct(disassembled = TRUE) +/obj/item/modular_computer/atom_deconstruct(disassembled = TRUE) remove_pai() eject_aicard() - if(!(obj_flags & NO_DECONSTRUCTION)) - if (disassembled) - internal_cell?.forceMove(drop_location()) - computer_id_slot?.forceMove(drop_location()) - inserted_disk?.forceMove(drop_location()) - new /obj/item/stack/sheet/iron(drop_location(), steel_sheet_cost) - else - physical.visible_message(span_notice("\The [src] breaks apart!")) - new /obj/item/stack/sheet/iron(drop_location(), round(steel_sheet_cost * 0.5)) + if (disassembled) + internal_cell?.forceMove(drop_location()) + computer_id_slot?.forceMove(drop_location()) + inserted_disk?.forceMove(drop_location()) + new /obj/item/stack/sheet/iron(drop_location(), steel_sheet_cost) + else + physical.visible_message(span_notice("\The [src] breaks apart!")) + new /obj/item/stack/sheet/iron(drop_location(), round(steel_sheet_cost * 0.5)) relay_qdel() - return ..() // Ejects the inserted intellicard, if one exists. Used when the computer is deconstructed. /obj/item/modular_computer/proc/eject_aicard() diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 140bdffcf87..8a62f6a87b9 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -37,12 +37,10 @@ if(I.w_class < WEIGHT_CLASS_NORMAL) //there probably shouldn't be anything placed ontop of filing cabinets in a map that isn't meant to go in them I.forceMove(src) -/obj/structure/filingcabinet/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/stack/sheet/iron(loc, 2) - for(var/obj/item/I in src) - I.forceMove(loc) - qdel(src) +/obj/structure/filingcabinet/atom_deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/iron(loc, 2) + for(var/obj/item/obj in src) + obj.forceMove(loc) /obj/structure/filingcabinet/attackby(obj/item/P, mob/living/user, params) var/list/modifiers = params2list(params) diff --git a/code/modules/paperwork/paper_cutter.dm b/code/modules/paperwork/paper_cutter.dm index 9878249a6d1..ae93a1daad8 100644 --- a/code/modules/paperwork/paper_cutter.dm +++ b/code/modules/paperwork/paper_cutter.dm @@ -61,8 +61,7 @@ return CONTEXTUAL_SCREENTIP_SET -/obj/item/papercutter/deconstruct(disassembled) - ..() +/obj/item/papercutter/atom_deconstruct(disassembled) if(!disassembled) return diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 86db803322f..3d7177dcb3e 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -240,7 +240,7 @@ if(total_paper == 0) deconstruct(FALSE) -/obj/item/paper_bin/bundlenatural/deconstruct(disassembled) +/obj/item/paper_bin/bundlenatural/atom_deconstruct(disassembled) dump_contents(drop_location()) return ..() diff --git a/code/modules/photography/photos/frame.dm b/code/modules/photography/photos/frame.dm index 4fbe3e034d8..9efde283e07 100644 --- a/code/modules/photography/photos/frame.dm +++ b/code/modules/photography/photos/frame.dm @@ -173,18 +173,15 @@ if(framed) . += framed -/obj/structure/sign/picture_frame/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/obj/item/wallframe/picture/F = new /obj/item/wallframe/picture(loc) - if(framed) - F.displayed = framed - set_and_save_framed(null) - if(contents.len) - var/obj/item/I = pick(contents) - I.forceMove(F) - F.update_appearance() - qdel(src) - +/obj/structure/sign/picture_frame/atom_deconstruct(disassembled = TRUE) + var/obj/item/wallframe/picture/showcase = new /obj/item/wallframe/picture(loc) + if(framed) + showcase.displayed = framed + set_and_save_framed(null) + if(contents.len) + var/obj/item/I = pick(contents) + I.forceMove(showcase) + showcase.update_appearance() /obj/structure/sign/picture_frame/showroom name = "distinguished crew display" diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 4480dc981ef..ffda41a42b0 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -141,11 +141,9 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri return ..() // then go ahead and delete the cable -/obj/structure/cable/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/obj/item/stack/cable_coil/cable = new(drop_location(), 1) - cable.set_cable_color(cable_color) - qdel(src) +/obj/structure/cable/atom_deconstruct(disassembled = TRUE) + var/obj/item/stack/cable_coil/cable = new(drop_location(), 1) + cable.set_cable_color(cable_color) /////////////////////////////////// // General procedures diff --git a/code/modules/power/lighting/light_construct.dm b/code/modules/power/lighting/light_construct.dm index 905ae72c2e3..8b79c33d69b 100644 --- a/code/modules/power/lighting/light_construct.dm +++ b/code/modules/power/lighting/light_construct.dm @@ -162,10 +162,8 @@ if(attacking_blob && attacking_blob.loc == loc) qdel(src) -/obj/structure/light_construct/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - new /obj/item/stack/sheet/iron(loc, sheets_refunded) - qdel(src) +/obj/structure/light_construct/atom_deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/iron(loc, sheets_refunded) /obj/structure/light_construct/small name = "small light fixture frame" diff --git a/code/modules/power/pipecleaners.dm b/code/modules/power/pipecleaners.dm index 2f18bab660a..2a41c70bdfe 100644 --- a/code/modules/power/pipecleaners.dm +++ b/code/modules/power/pipecleaners.dm @@ -106,15 +106,13 @@ By design, d1 is the smallest direction and d2 is the highest QDEL_NULL(stored) return ..() // then go ahead and delete the pipe_cleaner -/obj/structure/pipe_cleaner/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - var/turf/T = get_turf(loc) - if(T) - stored.forceMove(T) - stored = null - else - qdel(stored) - qdel(src) +/obj/structure/pipe_cleaner/atom_deconstruct(disassembled = TRUE) + var/turf/location = get_turf(loc) + if(location) + stored.forceMove(location) + stored = null + else + qdel(stored) /////////////////////////////////// // General procedures diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index bacef74180b..d406e9f489f 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -570,8 +570,7 @@ /obj/machinery/chem_dispenser/drinks/fullupgrade //fully ugpraded stock parts, emagged desc = "Contains a large reservoir of soft drinks. This model has had its safeties shorted out." - obj_flags = CAN_BE_HIT | EMAGGED | NO_DECONSTRUCTION - circuit = /obj/item/circuitboard/machine/chem_dispenser/drinks/fullupgrade + obj_flags = CAN_BE_HIT | EMAGGED /obj/machinery/chem_dispenser/drinks/fullupgrade/Initialize(mapload) . = ..() @@ -630,7 +629,7 @@ /obj/machinery/chem_dispenser/drinks/beer/fullupgrade //fully ugpraded stock parts, emagged desc = "Contains a large reservoir of the good stuff. This model has had its safeties shorted out." - obj_flags = CAN_BE_HIT | EMAGGED | NO_DECONSTRUCTION + obj_flags = CAN_BE_HIT | EMAGGED circuit = /obj/item/circuitboard/machine/chem_dispenser/drinks/beer/fullupgrade /obj/machinery/chem_dispenser/drinks/beer/fullupgrade/Initialize(mapload) @@ -654,7 +653,6 @@ /obj/machinery/chem_dispenser/mutagensaltpeter name = "botanical chemical dispenser" desc = "Creates and dispenses chemicals useful for botany." - obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION circuit = /obj/item/circuitboard/machine/chem_dispenser/mutagensaltpeter /// The default list of dispensable reagents available in the mutagensaltpeter chem dispenser @@ -680,7 +678,7 @@ /obj/machinery/chem_dispenser/fullupgrade //fully ugpraded stock parts, emagged desc = "Creates and dispenses chemicals. This model has had its safeties shorted out." - obj_flags = CAN_BE_HIT | EMAGGED | NO_DECONSTRUCTION + obj_flags = CAN_BE_HIT | EMAGGED circuit = /obj/item/circuitboard/machine/chem_dispenser/fullupgrade /obj/machinery/chem_dispenser/fullupgrade/Initialize(mapload) diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 5dd5e8b93dd..b3238f73493 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -196,12 +196,9 @@ explosion(src, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 6, flame_range = 8) qdel(src) -/obj/structure/reagent_dispensers/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(!disassembled) - boom() - else - qdel(src) +/obj/structure/reagent_dispensers/atom_deconstruct(disassembled = TRUE) + if(!disassembled) + boom() /obj/structure/reagent_dispensers/proc/tank_leak() if(leaking && reagents && reagents.total_volume >= amount_to_leak) diff --git a/code/modules/recycling/disposal/pipe.dm b/code/modules/recycling/disposal/pipe.dm index 69519874cd2..9a1ad786e72 100644 --- a/code/modules/recycling/disposal/pipe.dm +++ b/code/modules/recycling/disposal/pipe.dm @@ -170,27 +170,24 @@ return TRUE // called when pipe is cut with welder -/obj/structure/disposalpipe/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(disassembled) - if(spawn_pipe) - var/obj/structure/disposalconstruct/construct = stored - if(!construct) // Don't have something? Make one now - construct = new /obj/structure/disposalconstruct(src, null, SOUTH, FALSE, src) - stored = null - construct.forceMove(loc) - transfer_fingerprints_to(construct) - construct.setDir(dir) - spawn_pipe = FALSE - else - var/turf/T = get_turf(src) - for(var/D in GLOB.cardinals) - if(D & dpdir) - var/obj/structure/disposalpipe/broken/P = new(T) - P.setDir(D) +/obj/structure/disposalpipe/atom_deconstruct(disassembled = TRUE) + if(disassembled) + if(spawn_pipe) + var/obj/structure/disposalconstruct/construct = stored + if(!construct) // Don't have something? Make one now + construct = new /obj/structure/disposalconstruct(src, null, SOUTH, FALSE, src) + stored = null + construct.forceMove(loc) + transfer_fingerprints_to(construct) + construct.setDir(dir) + spawn_pipe = FALSE + else + var/turf/location = get_turf(src) + for(var/dir in GLOB.cardinals) + if(dir & dpdir) + var/obj/structure/disposalpipe/broken/pipe = new(location) + pipe.setDir(dir) spew_forth() - qdel(src) - /obj/structure/disposalpipe/singularity_pull(S, current_size) ..() @@ -323,9 +320,6 @@ spawn_pipe = FALSE anchored = FALSE -/obj/structure/disposalpipe/broken/deconstruct() - qdel(src) - /obj/structure/disposalpipe/rotator icon_state = "pipe-r1" initialize_dirs = DISP_DIR_LEFT | DISP_DIR_RIGHT | DISP_DIR_FLIP diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index a178bcd6ad5..278030fbc44 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -51,10 +51,9 @@ if(EXPLODE_LIGHT) SSexplosions.low_mov_atom += contents -/obj/item/delivery/deconstruct() +/obj/item/delivery/atom_deconstruct(dissambled = TRUE) unwrap_contents() post_unwrap_contents() - return ..() /obj/item/delivery/examine(mob/user) . = ..() diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 58e91646c0f..7cfbcf05e5e 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -1085,10 +1085,11 @@ bodypart_overlays -= overlay overlay.removed_from_limb(src) -/obj/item/bodypart/deconstruct(disassembled = TRUE) +/obj/item/bodypart/atom_deconstruct(disassembled = TRUE) SHOULD_CALL_PARENT(TRUE) drop_organs() + return ..() /// INTERNAL PROC, DO NOT USE diff --git a/code/modules/transport/tram/tram_structures.dm b/code/modules/transport/tram/tram_structures.dm index 74532d87be7..f868fe21c48 100644 --- a/code/modules/transport/tram/tram_structures.dm +++ b/code/modules/transport/tram/tram_structures.dm @@ -212,14 +212,12 @@ return ..() -/obj/structure/tram/deconstruct(disassembled = TRUE) - if(!(obj_flags & NO_DECONSTRUCTION)) - if(disassembled) - new girder_type(loc) - if(mineral_amount) - for(var/i in 1 to mineral_amount) - new mineral(loc) - qdel(src) +/obj/structure/tram/atom_deconstruct(disassembled = TRUE) + if(disassembled) + new girder_type(loc) + if(mineral_amount) + for(var/i in 1 to mineral_amount) + new mineral(loc) /obj/structure/tram/attackby(obj/item/item, mob/user, params) . = ..() diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index cf966727abb..4a37ba6cc9a 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -1142,7 +1142,7 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) /obj/machinery/vending/exchange_parts(mob/user, obj/item/storage/part_replacer/replacer) if(!istype(replacer)) return FALSE - if((obj_flags & NO_DECONSTRUCTION) && !replacer.works_from_distance) + if(!replacer.works_from_distance) return FALSE if(!component_parts || !refill_canister) return FALSE diff --git a/code/modules/wiremod/shell/dispenser.dm b/code/modules/wiremod/shell/dispenser.dm index 4ea2d03c9d7..4a00f7fed88 100644 --- a/code/modules/wiremod/shell/dispenser.dm +++ b/code/modules/wiremod/shell/dispenser.dm @@ -18,10 +18,9 @@ var/list/obj/item/stored_items = list() var/locked = FALSE -/obj/structure/dispenser_bot/deconstruct(disassembled) +/obj/structure/dispenser_bot/atom_deconstruct(disassembled = TRUE) for(var/obj/item/stored_item as anything in stored_items) remove_item(stored_item) - return ..() /obj/structure/dispenser_bot/Destroy() QDEL_LIST(stored_items) diff --git a/code/modules/wiremod/shell/moneybot.dm b/code/modules/wiremod/shell/moneybot.dm index cacb457149d..f3c2dfe93da 100644 --- a/code/modules/wiremod/shell/moneybot.dm +++ b/code/modules/wiremod/shell/moneybot.dm @@ -15,9 +15,8 @@ var/stored_money = 0 var/locked = FALSE -/obj/structure/money_bot/deconstruct(disassembled) +/obj/structure/money_bot/atom_deconstruct(disassembled = TRUE) new /obj/item/holochip(drop_location(), stored_money) - return ..() /obj/structure/money_bot/proc/add_money(to_add) stored_money += to_add