Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Patches & renaming for NO_DECONSTRUCTION flag #2897

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
/turf/open/floor/iron/colony/bolts,
/area/ruin/colonist_homestead)
"t" = (
/obj/machinery/smartfridge/ration_shelf,
/obj/machinery/smartfridge/wooden/ration_shelf,
/turf/open/floor/iron/colony/bolts,
/area/ruin/colonist_homestead)
"u" = (
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/obj_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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) //! Atoms don't spawn anything when deconstructed. They just vanish
#define NO_DEBRIS_AFTER_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

Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ DEFINE_BITFIELD(obj_flags, list(
"EMAGGED" = EMAGGED,
"IGNORE_DENSITY" = IGNORE_DENSITY,
"IN_USE" = IN_USE,
"NO_DECONSTRUCTION" = NO_DECONSTRUCTION,
"NO_DEBRIS_AFTER_DECONSTRUCTION" = NO_DEBRIS_AFTER_DECONSTRUCTION,
"UNIQUE_RENAME" = UNIQUE_RENAME,
))

Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/frozen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0
else
log_combat(throwingdatum.thrower, target, "launched", addition = "shattering it due to being frozen.")
obj_target.visible_message(span_danger("[obj_target] shatters into a million pieces!"))
obj_target.obj_flags |= NO_DECONSTRUCTION // disable item spawning
obj_target.obj_flags |= NO_DEBRIS_AFTER_DECONSTRUCTION // disable item spawning
obj_target.deconstruct(FALSE) // call pre-deletion specialized code -- internals release gas etc

/// signal handler for COMSIG_MOVABLE_MOVED that unfreezes our target if it moves onto an open turf thats hotter than
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@
/obj/machinery/handle_deconstruct(disassembled = TRUE)
SHOULD_NOT_OVERRIDE(TRUE)

if(obj_flags & NO_DECONSTRUCTION)
if(obj_flags & NO_DEBRIS_AFTER_DECONSTRUCTION)
dump_inventory_contents() //drop stuff we consider important
return //Just delete us, no need to call anything else.

Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/dance_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@
req_access = null
anchored = TRUE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION

/obj/machinery/jukebox/disco/activate_music()
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@

/obj/machinery/door/airlock/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
if((damage_amount >= atom_integrity) && (damage_flag == BOMB))
obj_flags |= NO_DECONSTRUCTION //If an explosive took us out, don't drop the assembly
obj_flags |= NO_DEBRIS_AFTER_DECONSTRUCTION //If an explosive took us out, don't drop the assembly
. = ..()
if(atom_integrity < (0.75 * max_integrity))
update_appearance()
Expand Down
7 changes: 6 additions & 1 deletion code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ Possible to do for anyone motivated enough:

/obj/machinery/holopad/tutorial
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
on_network = FALSE
///Proximity monitor associated with this atom, needed for proximity checks.
var/datum/proximity_monitor/proximity_monitor
Expand All @@ -143,6 +142,12 @@ Possible to do for anyone motivated enough:
new_disk.forceMove(src)
disk = new_disk

/obj/machinery/holopad/tutorial/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver)
return NONE

/obj/machinery/holopad/tutorial/default_deconstruction_crowbar(obj/item/crowbar, ignore_panel, custom_deconstruct)
return NONE

/obj/machinery/holopad/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!loc)
Expand Down
8 changes: 7 additions & 1 deletion code/game/machinery/recycler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,15 @@

/obj/machinery/recycler/deathtrap
name = "dangerous old crusher"
obj_flags = CAN_BE_HIT | EMAGGED | NO_DECONSTRUCTION
obj_flags = CAN_BE_HIT | EMAGGED
crush_damage = 120

/obj/machinery/recycler/deathtrap/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver)
return NONE

/obj/machinery/recycler/deathtrap/default_deconstruction_crowbar(obj/item/crowbar, ignore_panel, custom_deconstruct)
return NONE

/obj/item/paper/guides/recycler
name = "paper - 'garbage duty instructions'"
default_raw_text = "<h2>New Assignment</h2> You have been assigned to collect garbage from trash bins, located around the station. The crewmembers will put their trash into it and you will collect said trash.<br><br>There is a recycling machine near your closet, inside maintenance; use it to recycle the trash for a small chance to get useful minerals. Then, deliver these minerals to cargo or engineering. You are our last hope for a clean station. Do not screw this up!"
Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/telecomms/machines/allinone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

/obj/machinery/telecomms/allinone/indestructible
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
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/obj_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,17 @@

/**
* 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
* atom_deconstruct if NO_DEBRIS_AFTER_DECONSTRUCTION is absent but subtypes can override this to handle NO_DEBRIS_AFTER_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
* atom before deconstruction regardless if NO_DEBRIS_AFTER_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))
if(!(obj_flags & NO_DEBRIS_AFTER_DECONSTRUCTION))
atom_deconstruct(disassembled)

/**
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/beds_chairs/chair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,11 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
icon_state = null
buildstacktype = null
item_chair = null
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
obj_flags = parent_type::obj_flags | NO_DEBRIS_AFTER_DECONSTRUCTION
alpha = 0

/obj/structure/chair/mime/wrench_act_secondary(mob/living/user, obj/item/weapon)
return ITEM_INTERACT_BLOCKING
return NONE

/obj/structure/chair/mime/post_buckle_mob(mob/living/M)
M.pixel_y += 5
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/structures/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@
icon_state = "pinepresents"
desc = "A wondrous decorated Christmas tree. It has presents!"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF //protected by the christmas spirit
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
var/gift_type = /obj/item/gift/anything
var/unlimited = FALSE
var/static/list/took_presents //shared between all xmas trees
Expand Down
14 changes: 11 additions & 3 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,18 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/reinforced/tinted/frosted/spaw
name = "hardened shuttle window"
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
/obj/structure/window/reinforced/shuttle/indestructible/welder_act(mob/living/user, obj/item/tool)
return NONE

/obj/structure/window/reinforced/shuttle/indestructible/screwdriver_act(mob/living/user, obj/item/tool)
return NONE

/obj/structure/window/reinforced/shuttle/indestructible/wrench_act(mob/living/user, obj/item/tool)
return NONE

/obj/structure/window/reinforced/shuttle/indestructible/crowbar_act(mob/living/user, obj/item/tool)
return NONE

/obj/structure/window/reinforced/plasma/plastitanium
name = "plastitanium window"
Expand Down
19 changes: 13 additions & 6 deletions code/modules/awaymissions/mission_code/murderdome.dm
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 6 additions & 1 deletion code/modules/capture_the_flag/ctf_game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/food_and_drinks/machinery/food_cart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions code/modules/holodeck/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/holodeck/holo_effect.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion code/modules/hydroponics/hydroponics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion code/modules/mapfluff/ruins/objects_and_mobs/museum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 12 additions & 1 deletion code/modules/mining/equipment/survival_pod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion code/modules/shuttle/spaceship_navigation_beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions code/modules/shuttle/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand All @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion code/modules/shuttle/syndicate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down
6 changes: 4 additions & 2 deletions code/modules/transport/tram/tram_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down Expand Up @@ -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)
Expand Down
Loading
Loading