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
🆑
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
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
This commit is contained in:
SyncIt21
2024-04-04 18:55:51 -06:00
committed by GitHub
co-authored by san7890
parent ec991f8c1d
commit 6dc40ca522
106 changed files with 488 additions and 662 deletions
+1 -1
View File
@@ -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
+9 -10
View File
@@ -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.
+9 -11
View File
@@ -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
+1 -1
View File
@@ -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)
+16 -17
View File
@@ -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
+1 -1
View File
@@ -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)
@@ -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)
+10 -12
View File
@@ -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)
+4 -9
View File
@@ -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
-2
View File
@@ -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
+5 -4
View File
@@ -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)
-4
View File
@@ -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)
+1 -1
View File
@@ -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]."))
+3 -5
View File
@@ -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)
-1
View File
@@ -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)
+4 -5
View File
@@ -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)
+1 -1
View File
@@ -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]."))
+3 -3
View File
@@ -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 ..()
@@ -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
+2 -4
View File
@@ -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")
+1 -3
View File
@@ -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)
. = ..()
+1 -1
View File
@@ -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.
+5
View File
@@ -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)
+4 -6
View File
@@ -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
+1 -1
View File
@@ -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)
+40 -1
View File
@@ -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.
-2
View File
@@ -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
+1 -2
View File
@@ -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()
+4 -7
View File
@@ -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)
@@ -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
@@ -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 <b>bolts</b>.")
. += span_notice("It's held together by a couple of <b>bolts</b>.")
/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)
@@ -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
@@ -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
@@ -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)
@@ -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"
@@ -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)
+7 -9
View File
@@ -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()
+15 -18
View File
@@ -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)
@@ -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 = ..()
+2 -4
View File
@@ -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)
. = ..()
+9 -11
View File
@@ -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"
+12 -16
View File
@@ -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."
+4 -10
View File
@@ -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
+9 -13
View File
@@ -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
+4 -6
View File
@@ -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 *
+5 -9
View File
@@ -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)
+5 -16
View File
@@ -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 <b>screws</b>. The rods look like they could be <b>cut</b> 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
+1 -2
View File
@@ -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)
. = ..()
@@ -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
@@ -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
+3 -6
View File
@@ -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)
@@ -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 = ..()
+3 -5
View File
@@ -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.
@@ -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"
+6 -8
View File
@@ -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)
..()
+3 -6
View File
@@ -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)
+5 -7
View File
@@ -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"
@@ -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))
+2 -3
View File
@@ -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,
+2 -4
View File
@@ -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)
. = ..()
+1 -6
View File
@@ -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)
+1 -2
View File
@@ -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)
-3
View File
@@ -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
+1 -2
View File
@@ -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))
+1 -2
View File
@@ -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)
+34 -54
View File
@@ -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)
@@ -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
+1 -2
View File
@@ -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)
@@ -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)
. = ..()
+1 -2
View File
@@ -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()
+21 -34
View File
@@ -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"
+8 -21
View File
@@ -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 <b>heat them</b> 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
@@ -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!")
+14 -19
View File
@@ -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///////////////////////////////////
@@ -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)
. = ..()
+1 -2
View File
@@ -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
@@ -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)
+1 -1
View File
@@ -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)
@@ -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
+6
View File
@@ -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)
+1 -2
View File
@@ -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)
@@ -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()
@@ -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()
+1 -1
View File
@@ -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
@@ -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)
. = ..()
@@ -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."))
+1 -3
View File
@@ -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))
@@ -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()
. = ..()
+1 -2
View File
@@ -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)
. = ..()
@@ -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()
+4 -6
View File
@@ -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)
+1 -2
View File
@@ -61,8 +61,7 @@
return CONTEXTUAL_SCREENTIP_SET
/obj/item/papercutter/deconstruct(disassembled)
..()
/obj/item/papercutter/atom_deconstruct(disassembled)
if(!disassembled)
return
+1 -1
View File
@@ -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 ..()
+9 -12
View File
@@ -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"
+3 -5
View File
@@ -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
@@ -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"
+7 -9
View File
@@ -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
@@ -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)
+3 -6
View File
@@ -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)
+17 -23
View File
@@ -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

Some files were not shown because too many files have changed in this diff Show More