Cherry-pick of all NO DESTRUCTION (#27477)

* [NO GBP] Patches & renaming for `NO_DECONSTRUCTION` flag (#82547)

## About The Pull Request

1. Renames `NO_DECONSTRUCTION` -> `NO_DEBRIS_AFTER_DECONSTRUCTION`. As
the name suggests when the object is deconstructed it won't drop any
items/debris. After my last refactor for this flag it now serves a new
purpose so its name has been changed to match that

2. Fixes objects that are now using `NO_DECONSTRUCTION` incorrectly.
Some of these changes include
- Removing the flag in objects where there are no means to deconstruct
them (e.g. jukebox, hydroponics soil, flora etc)
- Replacing the flags old purpose by overriding its tool procs so that
it regains its old behaviour(e.g. You once again cannot deconstruct ctf
reinforced tables, survival pods, indestructible windows etc)

## Changelog
🆑
code: renamed `NO_DECONSTRUCTION` to `NO_DEBRIS_AFTER_DECONSTRUCTION` so
its name matches its intended purpose
fix: fixes some items that incorrectly used `NO_DECONSTRUCTION` prior to
its refactor, meaning makes some objects non deconstructable again
/🆑

* NO DESTRUCTION

* Linter fix

* Fixes standard RPEDs not working on machines (#82528)

## About The Pull Request

Previously, `exchange_parts(...)` would cancel if both the
`NO_DECONSTRUCTION` flag was set and you couldn't use your part replacer
from a distance.

https://github.com/tgstation/tgstation/blob/1583cf0cc968cd9f5da2398035feb8d70d58bcf2/code/game/machinery/_machinery.dm#L958-L959
Our recent removal of `NO_DECONSTRUCTION`, however, has left this to
_only_ be the latter.

https://github.com/tgstation/tgstation/blob/f0ed4ba4ce6b114509c10ee2f36ab0af6d7c81d2/code/game/machinery/_machinery.dm#L956-L957
Buuuuut this makes it unconditionally cancel for normal RPEDs, instead
of only blocking them if `NO_DECONSTRUCTION` was set.

As `NO_DECONSTRUCTION` is very much no longer relevant for this purpose,
we simply remove the ranged RPED check altogether.
This fixes our issue.
## Why It's Good For The Game

Fixes #82525.
## Changelog
🆑
fix: Standard RPEDs work on machines again.
/🆑

* Machinery Destroy() side effect clean up (#82659)

## About The Pull Request

I have combed over implementations of `Destroy()` for `obj/machinery`,
and noticed quite a few was spawning items or playing sounds.

**Slot machines**:
Moved payout to on_deconstruction()

**Windoors**:
Break sound moved to on_deconstruction().
I have also slightly cleaned up Destroy(), the windoor calls
air_update_turf directly, as that proc already retrieves the turf it is
on.
 
**Atmospheric pipe**:
Releases air and deconstructs meter objects on_deconstruction().

**Portable atmospheric devices**:
Drop hyper noblium crystal on on_destruction().

**Pump, Scrubbers**:
Releases air on_deconstruction().

**PACMAN power generator**:
Spawns dropped fuel on_deconstruction().

**Runic vendor**:
Moved vanishing effects to on_deconstruction().

I did not change Destroy side effects in the following instances:

- side effects are critical for the round (e.g. doomsday device, nuke,
blackbox recorder dropping the tape, gulag item reclaimer [less critical
but still])
- might spawn messages and noises, but moving them to on_deconstruct
would put linked items into an unusable state if deleted directly (e.g.
express order console, cyborg lockdown console, tram paired sensors)
- would potentially delete mobs we don't want deleted (e.g. disposals,
slime camera console)

Out of 220 Destroy defines, I found only 8 side effects that could not
be moved to other procs, so `machinery\Destroy()` has almost always been
used properly! I really hope `structure` will be as well made.

Other changes:

- Stasis beds had a completely empty destroy, removed
- Mass drivers had two destroy procs, merged

## Why It's Good For The Game

The Destroy() proc should only contain reference clean ups, barring edge
cases that would harm playability.

## Changelog

Nothing player facing.

* Fix linter

* icon fix

* icon fix again

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: Profakos <profakos@gmail.com>
This commit is contained in:
SpaceLoveSs13
2024-04-27 03:16:47 +02:00
committed by GitHub
co-authored by SyncIt21 _0Steven Profakos
parent a9d8b6d6c3
commit 91946bbab6
65 changed files with 352 additions and 248 deletions
@@ -22,7 +22,9 @@
/obj/machinery/meter/Destroy()
SSair.stop_processing_machine(src)
target = null
if(!isnull(target))
UnregisterSignal(target, COMSIG_QDELETING)
target = null
return ..()
/obj/machinery/meter/Initialize(mapload, new_piping_layer)
@@ -45,8 +47,14 @@
candidate = pipe
if(candidate)
target = candidate
RegisterSignal(target, COMSIG_QDELETING, PROC_REF(drop_meter))
setAttachLayer(candidate.piping_layer)
///Called when the parent pipe is removed
/obj/machinery/meter/proc/drop_meter()
SIGNAL_HANDLER
deconstruct(FALSE)
/obj/machinery/meter/proc/setAttachLayer(new_layer)
target_layer = new_layer
PIPING_LAYER_DOUBLE_SHIFT(src, target_layer)
@@ -135,7 +143,8 @@
return TRUE
/obj/machinery/meter/on_deconstruction(disassembled)
new /obj/item/pipe_meter(loc)
var/obj/item/pipe_meter/meter_object = new /obj/item/pipe_meter(get_turf(src))
transfer_fingerprints_to(meter_object)
/obj/machinery/meter/interact(mob/user)
if(machine_stat & (NOPOWER|BROKEN))
@@ -34,18 +34,13 @@
if(hide)
AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) //if changing this, change the subtypes RemoveElements too, because thats how bespoke works
/obj/machinery/atmospherics/pipe/Destroy()
QDEL_NULL(parent)
/obj/machinery/atmospherics/pipe/on_deconstruction(disassembled)
releaseAirToTurf()
var/turf/local_turf = loc
for(var/obj/machinery/meter/meter in local_turf)
if(meter.target != src)
continue
var/obj/item/pipe_meter/meter_object = new (local_turf)
meter.transfer_fingerprints_to(meter_object)
qdel(meter)
return ..()
/obj/machinery/atmospherics/pipe/Destroy()
QDEL_NULL(parent)
return ..()
//-----------------
@@ -46,14 +46,17 @@
AddElement(/datum/element/climbable, climb_time = 3 SECONDS, climb_stun = 3 SECONDS)
AddElement(/datum/element/elevation, pixel_shift = 8)
/obj/machinery/portable_atmospherics/on_deconstruction(disassembled)
if(nob_crystal_inserted)
new /obj/item/hypernoblium_crystal(src)
return ..()
/obj/machinery/portable_atmospherics/Destroy()
disconnect()
air_contents = null
SSair.stop_processing_machine(src)
if(nob_crystal_inserted)
new /obj/item/hypernoblium_crystal(src)
return ..()
/obj/machinery/portable_atmospherics/examine(mob/user)
@@ -12,7 +12,7 @@
volume = 1000
/obj/machinery/portable_atmospherics/pump/Destroy()
/obj/machinery/portable_atmospherics/pump/on_deconstruction(disassembled)
var/turf/local_turf = get_turf(src)
local_turf.assume_air(air_contents)
return ..()
@@ -31,9 +31,9 @@
/datum/gas/halon,
)
/obj/machinery/portable_atmospherics/scrubber/Destroy()
var/turf/T = get_turf(src)
T.assume_air(air_contents)
/obj/machinery/portable_atmospherics/scrubber/on_deconstruction(disassembled)
var/turf/local_turf = get_turf(src)
local_turf.assume_air(air_contents)
return ..()
/obj/machinery/portable_atmospherics/scrubber/update_icon_state()
@@ -1,20 +1,27 @@
/obj/structure/window/reinforced/fulltile/indestructible
name = "robust 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/structure/window/reinforced/fulltile/indestructible/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
return FALSE
/obj/structure/window/reinforced/fulltile/indestructible/screwdriver_act(mob/living/user, obj/item/tool)
return NONE
/obj/structure/window/reinforced/fulltile/indestructible/wrench_act(mob/living/user, obj/item/tool)
return NONE
/obj/structure/window/reinforced/fulltile/indestructible/crowbar_act(mob/living/user, obj/item/tool)
return NONE
/obj/structure/grille/indestructible
obj_flags = CONDUCTS_ELECTRICITY | NO_DECONSTRUCTION
obj_flags = CONDUCTS_ELECTRICITY
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
/obj/structure/grille/indestructible/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
return FALSE
/obj/structure/grille/indestructible/screwdriver_act(mob/living/user, obj/item/tool)
return NONE
/obj/structure/grille/indestructible/wirecutter_act(mob/living/user, obj/item/tool)
return NONE
/obj/effect/spawner/structure/window/reinforced/indestructible
spawn_list = list(/obj/structure/grille/indestructible, /obj/structure/window/reinforced/fulltile/indestructible)
+6 -1
View File
@@ -463,7 +463,12 @@
/obj/structure/table/reinforced/ctf
resistance_flags = INDESTRUCTIBLE
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
/obj/structure/table/reinforced/ctf/wrench_act_secondary(mob/living/user, obj/item/tool)
return NONE
/obj/structure/table/reinforced/ctf/screwdriver_act_secondary(mob/living/user, obj/item/tool)
return NONE
#define CTF_LOADING_UNLOADED 0
#define CTF_LOADING_LOADING 1
@@ -8,7 +8,7 @@
anchored = FALSE
use_power = NO_POWER_USE
req_access = list(ACCESS_KITCHEN)
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
obj_flags = parent_type::obj_flags | NO_DEBRIS_AFTER_DECONSTRUCTION
var/unpacked = FALSE
var/obj/machinery/griddle/stand/cart_griddle
var/obj/machinery/smartfridge/food/cart_smartfridge
+2 -2
View File
@@ -292,12 +292,12 @@ GLOBAL_LIST_INIT(typecache_holodeck_linked_floorcheck_ok, typecacheof(list(/turf
holo_object.resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
if(isstructure(holo_object))
holo_object.obj_flags |= NO_DECONSTRUCTION
holo_object.obj_flags |= NO_DEBRIS_AFTER_DECONSTRUCTION
return
if(ismachinery(holo_object))
var/obj/machinery/holo_machine = holo_object
holo_machine.obj_flags |= NO_DECONSTRUCTION
holo_machine.obj_flags |= NO_DEBRIS_AFTER_DECONSTRUCTION
holo_machine.power_change()
if(istype(holo_machine, /obj/machinery/button))
+1 -1
View File
@@ -50,7 +50,7 @@
var/newtype = pick(subtypesof(/obj/item/book/manual) - banned_books)
var/obj/item/book/manual/to_spawn = new newtype(loc)
to_spawn.flags_1 |= HOLOGRAM_1
to_spawn.obj_flags |= NO_DECONSTRUCTION
to_spawn.obj_flags |= NO_DEBRIS_AFTER_DECONSTRUCTION
return to_spawn
/obj/effect/holodeck_effect/mobspawner
-1
View File
@@ -1159,7 +1159,6 @@
circuit = null
density = FALSE
use_power = NO_POWER_USE
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
unwrenchable = FALSE
self_sustaining_overlay_icon_state = null
maxnutri = 15
@@ -159,9 +159,14 @@
mask = /obj/item/clothing/mask/fakemoustache/italian
/obj/machinery/vending/hotdog/museum
obj_flags = parent_type::obj_flags|NO_DECONSTRUCTION
onstation_override = TRUE
/obj/machinery/vending/hotdog/museum/screwdriver_act(mob/living/user, obj/item/attack_item)
return NONE
/obj/machinery/vending/hotdog/museum/crowbar_act(mob/living/user, obj/item/attack_item)
return NONE
#define CAFE_KEYCARD_TOILETS "museum_cafe_key_toilets"
///Do not place these beyond the cafeteria shutters, or you might lock people out of reaching it.
+12 -1
View File
@@ -249,7 +249,18 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/door/window/survival_pod/left, 0)
light_color = COLOR_VERY_PALE_LIME_GREEN
max_n_of_items = 10
pixel_y = -4
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
/obj/machinery/smartfridge/survival_pod/welder_act(mob/living/user, obj/item/tool)
return NONE
/obj/machinery/smartfridge/survival_pod/wrench_act(mob/living/user, obj/item/tool)
return NONE
/obj/machinery/smartfridge/survival_pod/screwdriver_act(mob/living/user, obj/item/tool)
return NONE
/obj/machinery/smartfridge/survival_pod/crowbar_act(mob/living/user, obj/item/tool)
return NONE
/obj/machinery/smartfridge/survival_pod/Initialize(mapload)
AddElement(/datum/element/update_icon_blocker)
+1 -1
View File
@@ -98,7 +98,7 @@
var/obj/S = sheet_path
sheet_name = initial(S.name)
/obj/machinery/power/port_gen/pacman/Destroy()
/obj/machinery/power/port_gen/pacman/on_deconstruction(disassembled)
DropFuel()
return ..()
@@ -6,14 +6,16 @@
base_icon_state = "dispenser"
amount = 10
resistance_flags = INDESTRUCTIBLE | FIRE_PROOF | ACID_PROOF | LAVA_PROOF
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
use_power = NO_POWER_USE
var/static/list/shortcuts = list(
"meth" = /datum/reagent/drug/methamphetamine
)
///The purity of the created reagent in % (purity uses 0-1 values)
var/purity = 100
/obj/machinery/chem_dispenser/chem_synthesizer/screwdriver_act(mob/living/user, obj/item/tool)
return NONE
/obj/machinery/chem_dispenser/chem_synthesizer/crowbar_act(mob/living/user, obj/item/tool)
return NONE
/obj/machinery/chem_dispenser/chem_synthesizer/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
@@ -5,7 +5,6 @@
icon_state = "beacon_active"
base_icon_state = "beacon"
density = TRUE
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
/// Locked beacons cannot be jumped to by ships.
var/locked = FALSE
+12 -2
View File
@@ -79,7 +79,6 @@
var/obj/machinery/power/emitter/energycannon/magical/our_statue
var/list/mob/living/sleepers = list()
var/never_spoken = TRUE
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
/obj/structure/table/abductor/wabbajack/Initialize(mapload)
. = ..()
@@ -89,6 +88,12 @@
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/structure/table/abductor/wabbajack/screwdriver_act(mob/living/user, obj/item/tool)
return NONE
/obj/structure/table/abductor/wabbajack/wrench_act(mob/living/user, obj/item/tool)
return NONE
/obj/structure/table/abductor/wabbajack/process()
if(isnull(our_statue))
our_statue = locate() in orange(4, src)
@@ -173,7 +178,6 @@
/obj/structure/table/wood/shuttle_bar
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
max_integrity = 1000
var/boot_dir = 1
@@ -184,6 +188,12 @@
)
AddElement(/datum/element/connect_loc, loc_connections)
/obj/structure/table/wood/shuttle_bar/screwdriver_act(mob/living/user, obj/item/tool)
return NONE
/obj/structure/table/wood/shuttle_bar/wrench_act(mob/living/user, obj/item/tool)
return NONE
/obj/structure/table/wood/shuttle_bar/proc/on_entered(datum/source, atom/movable/AM)
SIGNAL_HANDLER
var/mob/living/M = AM
+3 -1
View File
@@ -11,7 +11,9 @@
shuttleId = "syndicate"
possible_destinations = "syndicate_away;syndicate_z5;syndicate_ne;syndicate_nw;syndicate_n;syndicate_se;syndicate_sw;syndicate_s;syndicate_custom"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
/obj/machinery/computer/shuttle/syndicate/screwdriver_act(mob/living/user, obj/item/I)
return NONE
/obj/machinery/computer/shuttle/syndicate/launch_check(mob/user)
. = ..()
@@ -708,7 +708,9 @@
/obj/machinery/transport/tram_controller/hilbert
configured_transport_id = HILBERT_LINE_1
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
/obj/machinery/transport/tram_controller/wrench_act_secondary(mob/living/user, obj/item/tool)
return NONE
/obj/machinery/transport/tram_controller/Initialize(mapload)
. = ..()
@@ -847,7 +849,7 @@
return
playsound(loc, 'sound/items/deconstruct.ogg', 50, vary = TRUE)
balloon_alert(user, "unsecured")
deconstruct()
deconstruct(TRUE)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
/obj/machinery/transport/tram_controller/screwdriver_act_secondary(mob/living/user, obj/item/tool)
-2
View File
@@ -1157,8 +1157,6 @@ 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(!replacer.works_from_distance)
return FALSE
if(!component_parts || !refill_canister)
return FALSE
+6 -5
View File
@@ -9,6 +9,7 @@
vend_reply = "Please, stand still near the vending machine for your special package!"
resistance_flags = FIRE_PROOF
light_mask = "RunicVendor-light-mask"
obj_flags = parent_type::obj_flags | NO_DEBRIS_AFTER_DECONSTRUCTION
/// How long the vendor stays up before it decays.
var/time_to_decay = 30 SECONDS
/// Area around the vendor that will pushback nearby mobs.
@@ -60,15 +61,16 @@
return .
/obj/machinery/vending/runic_vendor/handle_deconstruct(disassembled)
SHOULD_NOT_OVERRIDE(TRUE)
/obj/machinery/vending/runic_vendor/Destroy()
visible_message(span_warning("[src] flickers and disappears!"))
playsound(src,'sound/weapons/resonator_blast.ogg',25,TRUE)
return ..()
/obj/machinery/vending/runic_vendor/proc/runic_explosion()
explosion(src, light_impact_range = 2)
qdel(src)
deconstruct(FALSE)
/obj/machinery/vending/runic_vendor/proc/runic_pulse()
var/pulse_locs = spiral_range_turfs(pulse_distance, get_turf(src))
@@ -82,10 +84,9 @@
mob_to_be_pulsed_back.throw_at(target, 4, 4)
/obj/machinery/vending/runic_vendor/screwdriver_act(mob/living/user, obj/item/I)
explosion(src, light_impact_range = 2)
qdel(src)
runic_explosion()
/obj/machinery/vending/runic_vendor/proc/decay()
qdel(src)
deconstruct(FALSE)
#undef PULSE_DISTANCE_RANGE