From 83bc9a7ebfc45e34a560c000f9f671228cbfbfd8 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Thu, 20 Jun 2024 19:09:48 -0400 Subject: [PATCH] Underfloor refactor + Mild codebase cleanup (#6518) refactors deprecated and old level / hide system to a more orchestrated and slightly more efficient one --- citadel.dme | 13 +- code/__DEFINES/dcs/signals/README.md | 15 +- ...m => signals_element_conflict_checking.dm} | 0 .../signals_module_fishing.dm} | 0 code/__DEFINES/dcs/signals/signals_action.dm | 19 - code/__DEFINES/dcs/signals/signals_admin.dm | 13 - .../signals_atom/signals_atom_appearance.dm | 2 + .../signals_atom/signals_atom_attack.dm | 37 -- ...stem.dm => signals_atom_context_system.dm} | 0 .../signals_atom/signals_atom_defense.dm | 1 + .../signals_atom/signals_atom_explosion.dm | 14 - .../signals_atom/signals_atom_lighting.dm | 31 -- .../signals_atom/signals_atom_movable.dm | 34 +- .../signals_atom/signals_atom_radiation.dm | 12 +- ..._system.dm => signals_atom_tool_system.dm} | 0 .../signals_atom/signals_atom_visuals.dm | 9 - .../signals_atom/signals_atom_x_act.dm | 35 -- code/__DEFINES/dcs/signals/signals_datum.dm | 34 -- .../signals_item/signals_item_inventory.dm | 6 - .../signals_mob/signals_mob_abilities.dm | 24 -- .../signals/signals_mob/signals_mob_arcade.dm | 12 - .../signals/signals_mob/signals_mob_carbon.dm | 98 ----- .../signals/signals_mob/signals_mob_living.dm | 76 ---- .../signals/signals_mob/signals_mob_main.dm | 130 +------ .../signals/signals_mob/signals_mob_organs.dm | 7 +- .../signals_mob/signals_mob_silicon.dm | 10 - .../signals/signals_mob/signals_mob_simple.dm | 9 - code/__DEFINES/dcs/signals/signals_object.dm | 348 +----------------- code/__DEFINES/dcs/signals/signals_turf.dm | 13 - code/__DEFINES/misc.dm | 32 +- code/__DEFINES/objects/objects.dm | 34 ++ code/datums/components/simple_access.dm | 1 + code/game/area/area.dm | 1 - code/game/atoms/atom.dm | 7 +- code/game/atoms/defense.dm | 3 + code/game/machinery/beacon.dm | 13 +- code/game/machinery/magnet.dm | 13 +- code/game/machinery/navbeacon.dm | 18 +- code/game/machinery/pipe/construction.dm | 1 - .../objects/items/devices/radio/beacon.dm | 9 +- code/game/objects/items/devices/t_scanner.dm | 10 +- code/game/objects/items/godfigures.dm | 2 +- code/game/objects/items/id_cards/cards.dm | 2 - code/game/objects/items/weapons/nullrod.dm | 2 +- code/game/objects/objs.dm | 133 ++++++- code/game/objects/structures/safe.dm | 11 +- code/game/objects/structures/transit_tubes.dm | 5 - code/game/turfs/change_turf.dm | 2 +- code/game/turfs/simulated.dm | 2 - code/game/turfs/simulated/floor/floor.dm | 19 +- .../turfs/simulated/floor/floor_static.dm | 24 -- code/game/turfs/simulated/wall/wall.dm | 14 +- code/game/turfs/space/space.dm | 9 +- code/game/turfs/turf.dm | 33 +- .../modules/admin/verbs/SDQL2/wrappers/map.dm | 178 +++++++++ .../components/binary_devices/dp_vent_pump.dm | 12 +- .../components/binary_devices/heat_pump.dm | 6 +- .../components/binary_devices/passive_gate.dm | 5 +- .../components/binary_devices/pump.dm | 5 +- .../components/binary_devices/valve.dm | 5 +- .../components/binary_devices/volume_pump.dm | 1 - .../machinery/components/component.dm | 4 +- .../components/omni_devices/omni_base.dm | 7 +- .../components/trinary_devices/filter.dm | 1 - .../components/trinary_devices/mixer.dm | 1 - .../trinary_devices/molar_filter.dm | 1 - .../trinary_devices/trinary_base.dm | 4 +- .../components/trinary_devices/tvalve.dm | 5 +- .../components/unary/heat_exchanger.dm | 3 +- .../components/unary/outlet_injector.dm | 6 +- .../components/unary/portables_connector.dm | 5 +- .../machinery/components/unary/vent_pump.dm | 16 +- .../components/unary/vent_scrubber.dm | 11 +- .../atmospherics/machinery/machinery.dm | 45 ++- .../atmospherics/machinery/mainspipe.dm | 42 +-- code/modules/atmospherics/machinery/meter.dm | 2 +- .../atmospherics/machinery/pipes/cap.dm | 9 +- .../atmospherics/machinery/pipes/he_pipes.dm | 7 +- .../atmospherics/machinery/pipes/manifold.dm | 7 +- .../machinery/pipes/manifold4w.dm | 7 +- .../atmospherics/machinery/pipes/pipe_base.dm | 19 +- .../atmospherics/machinery/pipes/simple.dm | 9 +- .../atmospherics/machinery/pipes/tank.dm | 5 +- .../atmospherics/machinery/pipes/universal.dm | 2 +- .../atmospherics/machinery/pipes/vent.dm | 20 +- code/modules/multiz/structures/pipes.dm | 27 +- code/modules/multiz/turfs/open.dm | 11 +- .../modules/overmap/legacy/overmap_shuttle.dm | 4 - code/modules/overmap/legacy/sectors.dm | 4 - code/modules/power/cable.dm | 16 +- code/modules/power/terminal.dm | 23 +- .../recycling/disposal-construction.dm | 26 +- code/modules/recycling/disposal.dm | 10 +- .../machinery/destructive_analyzer.dm | 2 +- code/modules/shieldgen/shield_diffuser.dm | 18 +- .../archive/stationCollision.dmm | 10 +- .../class_h/AuxiliaryResearchFacility.dmm | 8 +- .../shuttles/overmaps/generic/bearcat.dmm | 6 +- maps/tether/levels/station1.dmm | 1 - maps/tether/levels/station2.dmm | 2 - maps/tether/levels/surface2.dmm | 1 - 101 files changed, 639 insertions(+), 1382 deletions(-) rename code/__DEFINES/dcs/signals/elements/{conflict.dm => signals_element_conflict_checking.dm} (100%) rename code/__DEFINES/dcs/signals/{signals_fish.dm => modules/signals_module_fishing.dm} (100%) delete mode 100644 code/__DEFINES/dcs/signals/signals_action.dm delete mode 100644 code/__DEFINES/dcs/signals/signals_admin.dm rename code/__DEFINES/dcs/signals/signals_atom/{context_system.dm => signals_atom_context_system.dm} (100%) delete mode 100644 code/__DEFINES/dcs/signals/signals_atom/signals_atom_explosion.dm delete mode 100644 code/__DEFINES/dcs/signals/signals_atom/signals_atom_lighting.dm rename code/__DEFINES/dcs/signals/signals_atom/{tool_system.dm => signals_atom_tool_system.dm} (100%) delete mode 100644 code/__DEFINES/dcs/signals/signals_atom/signals_atom_visuals.dm delete mode 100644 code/__DEFINES/dcs/signals/signals_mob/signals_mob_abilities.dm delete mode 100644 code/__DEFINES/dcs/signals/signals_mob/signals_mob_arcade.dm delete mode 100644 code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm delete mode 100644 code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm delete mode 100644 code/__DEFINES/dcs/signals/signals_mob/signals_mob_silicon.dm create mode 100644 code/__DEFINES/objects/objects.dm delete mode 100644 code/game/turfs/simulated/floor/floor_static.dm create mode 100644 code/modules/admin/verbs/SDQL2/wrappers/map.dm diff --git a/citadel.dme b/citadel.dme index bf643de07695..d9224a0277fe 100644 --- a/citadel.dme +++ b/citadel.dme @@ -163,28 +163,26 @@ #include "code\__DEFINES\dcs\signals\global_signals.dm" #include "code\__DEFINES\dcs\signals\signals_area.dm" #include "code\__DEFINES\dcs\signals\signals_datum.dm" -#include "code\__DEFINES\dcs\signals\signals_fish.dm" #include "code\__DEFINES\dcs\signals\signals_object.dm" #include "code\__DEFINES\dcs\signals\signals_turf.dm" #include "code\__DEFINES\dcs\signals\datums\signals_beam.dm" #include "code\__DEFINES\dcs\signals\datums\signals_perspective.dm" -#include "code\__DEFINES\dcs\signals\elements\conflict.dm" +#include "code\__DEFINES\dcs\signals\elements\signals_element_conflict_checking.dm" #include "code\__DEFINES\dcs\signals\items\signals_inducer.dm" -#include "code\__DEFINES\dcs\signals\signals_atom\context_system.dm" +#include "code\__DEFINES\dcs\signals\modules\signals_module_fishing.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_appearance.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_attack.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_buckling.dm" +#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_context_system.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_defense.dm" -#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_lighting.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_main.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_mouse.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movable.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_radiation.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_throwing.dm" -#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_visuals.dm" +#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_tool_system.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_x_act.dm" -#include "code\__DEFINES\dcs\signals\signals_atom\tool_system.dm" #include "code\__DEFINES\dcs\signals\signals_item\signals_item_economy.dm" #include "code\__DEFINES\dcs\signals\signals_item\signals_item_inventory.dm" #include "code\__DEFINES\dcs\signals\signals_item\signals_item_mouse.dm" @@ -260,6 +258,7 @@ #include "code\__DEFINES\mobs\silicon_privileges.dm" #include "code\__DEFINES\mobs\sprite_accessories.dm" #include "code\__DEFINES\mobs\stat.dm" +#include "code\__DEFINES\objects\objects.dm" #include "code\__DEFINES\objects\type_generation.dm" #include "code\__DEFINES\overmaps\misc.dm" #include "code\__DEFINES\overmaps\overmap.dm" @@ -2029,7 +2028,6 @@ #include "code\game\turfs\simulated\floor\floor_attackby.dm" #include "code\game\turfs\simulated\floor\floor_damage.dm" #include "code\game\turfs\simulated\floor\floor_icon.dm" -#include "code\game\turfs\simulated\floor\floor_static.dm" #include "code\game\turfs\simulated\floor\floor_types.dm" #include "code\game\turfs\simulated\floor\floor_types_eris.dm" #include "code\game\turfs\simulated\floor\floor_types_vr.dm" @@ -2181,6 +2179,7 @@ #include "code\modules\admin\verbs\SDQL2\SDQL_2.dm" #include "code\modules\admin\verbs\SDQL2\SDQL_2_parser.dm" #include "code\modules\admin\verbs\SDQL2\SDQL_2_wrappers.dm" +#include "code\modules\admin\verbs\SDQL2\wrappers\map.dm" #include "code\modules\admin\verbs\server\admin_reboot.dm" #include "code\modules\admin\view_variables\admin_delete.dm" #include "code\modules\admin\view_variables\color_matrix_editor.dm" diff --git a/code/__DEFINES/dcs/signals/README.md b/code/__DEFINES/dcs/signals/README.md index d5915b585ceb..0f3407bb03f1 100644 --- a/code/__DEFINES/dcs/signals/README.md +++ b/code/__DEFINES/dcs/signals/README.md @@ -1,9 +1,10 @@ # Hierarchy -- /components - component-specific signals -- /datums - datum-specific signals -- /elements - element-specific signals -- /items - item-specific signals -- /signals_atom - /atom signals -- /signals_item - /item signals -- /signals_mob - /mob signals +- /components - component-specific signals, `signals_component_*` +- /datums - datum-specific signals, `signals_` +- /elements - element-specific signals, `signals_element_*` +- /items - item-specific signals, `signals_` +- /modules - sets of signals for a module, `signals_module_*` +- /signals_atom - /atom signals, `signals_atom_*` or `signals_movable_*` +- /signals_item - /item signals, `signals_item_*` +- /signals_mob - /mob signals, `signals_mob_*` diff --git a/code/__DEFINES/dcs/signals/elements/conflict.dm b/code/__DEFINES/dcs/signals/elements/signals_element_conflict_checking.dm similarity index 100% rename from code/__DEFINES/dcs/signals/elements/conflict.dm rename to code/__DEFINES/dcs/signals/elements/signals_element_conflict_checking.dm diff --git a/code/__DEFINES/dcs/signals/signals_fish.dm b/code/__DEFINES/dcs/signals/modules/signals_module_fishing.dm similarity index 100% rename from code/__DEFINES/dcs/signals/signals_fish.dm rename to code/__DEFINES/dcs/signals/modules/signals_module_fishing.dm diff --git a/code/__DEFINES/dcs/signals/signals_action.dm b/code/__DEFINES/dcs/signals/signals_action.dm deleted file mode 100644 index 12651813c3b7..000000000000 --- a/code/__DEFINES/dcs/signals/signals_action.dm +++ /dev/null @@ -1,19 +0,0 @@ -/** - *! ## Action Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//# /datum/action signals -/// From base of datum/action/proc/Trigger(): (datum/action) -////#define COMSIG_ACTION_TRIGGER "action_trigger" - ////#define COMPONENT_ACTION_BLOCK_TRIGGER (1<<0) - -//# Cooldown action signals - -/// From base of /datum/action/cooldown/proc/PreActivate(), sent to the action owner: (datum/action/cooldown/activated) -////#define COMSIG_MOB_ABILITY_STARTED "mob_ability_base_started" - /// Return to block the ability from starting / activating - ////#define COMPONENT_BLOCK_ABILITY_START (1<<0) -/// From base of /datum/action/cooldown/proc/PreActivate(), sent to the action owner: (datum/action/cooldown/finished) -////#define COMSIG_MOB_ABILITY_FINISHED "mob_ability_base_finished" diff --git a/code/__DEFINES/dcs/signals/signals_admin.dm b/code/__DEFINES/dcs/signals/signals_admin.dm deleted file mode 100644 index 739717949ad4..000000000000 --- a/code/__DEFINES/dcs/signals/signals_admin.dm +++ /dev/null @@ -1,13 +0,0 @@ -/** - *! ## Admin Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! Admin helps -/// From /datum/admin_help/RemoveActive(). -/// Fired when an adminhelp is made inactive either due to closing or resolving. -////#define COMSIG_ADMIN_HELP_MADE_INACTIVE "admin_help_made_inactive" - -/// Called when the player replies. From /client/proc/cmd_admin_pm(). -////#define COMSIG_ADMIN_HELP_REPLIED "admin_help_replied" diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_appearance.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_appearance.dm index 250185c0b854..c84b4eb4da3c 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_appearance.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_appearance.dm @@ -4,6 +4,8 @@ * * All signals send the source datum of the signal as the first argument */ +// todo: rethink this if needed + /// From base of [/atom/proc/update_appearance]: (updates) #define COMSIG_ATOM_UPDATE_APPEARANCE "atom_update_appearance" /// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its name. diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm index f3e1f47a1ace..a49c4a001b93 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm @@ -4,42 +4,5 @@ * * All signals send the source datum of the signal as the first argument */ -/// From base of atom/attackby(): (/obj/item, /mob/living, params) -////#define COMSIG_PARENT_ATTACKBY "atom_attackby" -/// From base of [atom/proc/attacby_secondary()]: (/obj/item/weapon, /mob/user, params) -////#define COMSIG_PARENT_ATTACKBY_SECONDARY "atom_attackby_secondary" -/// From base of [/atom/proc/attack_hand_secondary]: (mob/user, list/modifiers) - Called when the atom receives a secondary unarmed attack. -////#define COMSIG_ATOM_ATTACK_HAND_SECONDARY "atom_attack_hand_secondary" - ///? Return this in response if you don't want afterattack to be called - ////#define COMPONENT_NO_AFTERATTACK (1<<0) -/// From base of atom/attack_hulk(): (/mob/living/carbon/human) -////#define COMSIG_ATOM_HULK_ATTACK "hulk_attack" -/// From base of atom/animal_attack(): (/mob/user) -////#define COMSIG_ATOM_ATTACK_ANIMAL "attack_animal" -/// From base of atom/attack_basic_mob(): (/mob/user) -////#define COMSIG_ATOM_ATTACK_BASIC_MOB "attack_basic_mob" -/// From /atom/proc/atom_break: () -////#define COMSIG_ATOM_BREAK "atom_break" -/// From base of [/atom/proc/atom_fix]: () -////#define COMSIG_ATOM_FIX "atom_fix" -/// From base of [/atom/proc/update_integrity]: (old_value, new_value) -////#define COMSIG_ATOM_INTEGRITY_CHANGED "atom_integrity_changed" -/// From base of [/atom/proc/take_damage]: (damage_amount, damage_type, damage_flag, sound_effect, attack_dir, aurmor_penetration) -////#define COMSIG_ATOM_TAKE_DAMAGE "atom_take_damage" - ///? Return bitflags for the above signal which prevents the atom taking any damage. - ////#define COMPONENT_NO_TAKE_DAMAGE (1<<0) - -//* Attack signals. They should share the returned flags, to standardize the attack chain. *// -/// tool_act -> pre_attack -> target.attackby (item.attack) -> afterattack - ///? Ends the attack chain. If sent early might cause posterior attacks not to happen. - ////#define COMPONENT_CANCEL_ATTACK_CHAIN (1<<0) - ///? Skips the specific attack step, continuing for the next one to happen. - ////#define COMPONENT_SKIP_ATTACK (1<<1) /// From base of atom/attack_ghost(): (mob/observer/dead/ghost) #define COMSIG_ATOM_ATTACK_GHOST "atom_attack_ghost" -/// From base of atom/attack_hand(mob/user, list/params): (mob/user, list/modifiers) -////#define COMSIG_ATOM_ATTACK_HAND "atom_attack_hand" -/// From base of atom/attack_paw(): (mob/user) -////#define COMSIG_ATOM_ATTACK_PAW "atom_attack_paw" - ///? Works on all 3. - ////#define COMPONENT_NO_ATTACK_HAND (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_atom/context_system.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_context_system.dm similarity index 100% rename from code/__DEFINES/dcs/signals/signals_atom/context_system.dm rename to code/__DEFINES/dcs/signals/signals_atom/signals_atom_context_system.dm diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_defense.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_defense.dm index fbe58fa32a65..89d0a90cfe37 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_defense.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_defense.dm @@ -2,3 +2,4 @@ //* Copyright (c) 2023 Citadel Station developers. *// // todo: this file left intentionally empty since shieldcalls were moved to datums +// todo: add signals for integrity diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_explosion.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_explosion.dm deleted file mode 100644 index 7f777f51bbde..000000000000 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_explosion.dm +++ /dev/null @@ -1,14 +0,0 @@ -/** - *! ## Atom Explosion Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From [/datum/controller/subsystem/explosions/proc/explode]: (/list(/atom, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke, explosion_cause)) -////#define COMSIG_ATOM_EXPLODE "atom_explode" -/// From [/datum/controller/subsystem/explosions/proc/explode]: (/list(/atom, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke, explosion_cause)) -////#define COMSIG_ATOM_INTERNAL_EXPLOSION "atom_internal_explosion" -/// From [/datum/controller/subsystem/explosions/proc/explode]: (/list(/atom, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke, explosion_cause)) -////#define COMSIG_AREA_INTERNAL_EXPLOSION "area_internal_explosion" - ///? When returned on a signal hooked to [COMSIG_ATOM_EXPLODE], [COMSIG_ATOM_INTERNAL_EXPLOSION], or [COMSIG_AREA_INTERNAL_EXPLOSION] it prevents the explosion from being propagated further. - ////#define COMSIG_CANCEL_EXPLOSION (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_lighting.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_lighting.dm deleted file mode 100644 index 5bda78628cb1..000000000000 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_lighting.dm +++ /dev/null @@ -1,31 +0,0 @@ -/** - *! ## Atom Lighting Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! ## Lighting: -/// From base of [atom/proc/set_light]: (l_range, l_power, l_color, l_on) -#define COMSIG_ATOM_SET_LIGHT "atom_set_light" - /// Blocks [/atom/proc/set_light], [/atom/proc/set_light_power], [/atom/proc/set_light_range], [/atom/proc/set_light_color], [/atom/proc/set_light_on], and [/atom/proc/set_light_flags]. - ////#define COMPONENT_BLOCK_LIGHT_UPDATE (1<<0) -/// Called right before the atom changes the value of light_power to a different one, from base [atom/proc/set_light_power]: (new_power) -////#define COMSIG_ATOM_SET_LIGHT_POWER "atom_set_light_power" -/// Called right after the atom changes the value of light_power to a different one, from base of [/atom/proc/set_light_power]: (old_power) -////#define COMSIG_ATOM_UPDATE_LIGHT_POWER "atom_update_light_power" -/// Called right before the atom changes the value of light_range to a different one, from base [atom/proc/set_light_range]: (new_range) -////#define COMSIG_ATOM_SET_LIGHT_RANGE "atom_set_light_range" -/// Called right after the atom changes the value of light_range to a different one, from base of [/atom/proc/set_light_range]: (old_range) -////#define COMSIG_ATOM_UPDATE_LIGHT_RANGE "atom_update_light_range" -/// Called right before the atom changes the value of light_color to a different one, from base [atom/proc/set_light_color]: (new_color) -////#define COMSIG_ATOM_SET_LIGHT_COLOR "atom_set_light_color" -/// Called right after the atom changes the value of light_color to a different one, from base of [/atom/proc/set_light_color]: (old_color) -////#define COMSIG_ATOM_UPDATE_LIGHT_COLOR "atom_update_light_color" -/// Called right before the atom changes the value of light_on to a different one, from base [atom/proc/set_light_on]: (new_value) -////#define COMSIG_ATOM_SET_LIGHT_ON "atom_set_light_on" -/// Called right after the atom changes the value of light_on to a different one, from base of [/atom/proc/set_light_on]: (old_value) -////#define COMSIG_ATOM_UPDATE_LIGHT_ON "atom_update_light_on" -/// Called right before the atom changes the value of light_flags to a different one, from base [atom/proc/set_light_flags]: (new_flags) -////#define COMSIG_ATOM_SET_LIGHT_FLAGS "atom_set_light_flags" -/// Called right after the atom changes the value of light_flags to a different one, from base of [/atom/proc/set_light_flags]: (old_flags) -////#define COMSIG_ATOM_UPDATE_LIGHT_FLAGS "atom_update_light_flags" diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm index 60a4bd0b49b4..37d19cb427ec 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm @@ -4,12 +4,17 @@ * * All signals send the source datum of the signal as the first argument */ +//* Movement - Move / Moved *// + /// From base of atom/movable/Moved(): (/atom) #define COMSIG_MOVABLE_PRE_MOVE "movable_pre_move" #define COMPONENT_MOVABLE_BLOCK_PRE_MOVE (1<<0) /// From base of atom/movable/Moved(): (atom/old_loc, dir, forced, list/old_locs, momentum_change) #define COMSIG_MOVABLE_MOVED "movable_moved" -// todo: abstract move and attach_loc or whatever from tg, no more cross/uncross!!! + +//* Movement - Collision *// + +// todo: crossers and uncrossers!!! /// From base of atom/movable/Cross(): (/atom/movable) #define COMSIG_MOVABLE_CROSS "movable_cross" /// From base of atom/movable/Crossed(): (/atom/movable) @@ -21,24 +26,23 @@ #define COMSIG_MOVABLE_UNCROSSED "movable_uncrossed" /// From base of atom/movable/Bump(): (/atom) #define COMSIG_MOVABLE_BUMP "movable_bump" -/// From base of atom/movable/newtonian_move(): (inertia_direction) -//#define COMSIG_MOVABLE_NEWTONIAN_MOVE "movable_newtonian_move" - //#define COMPONENT_MOVABLE_NEWTONIAN_BLOCK (1<<0) + +//* Movement - Z Change *// + /// From base of atom/movable/on_changed_z_level(): (old_z, new_z) #define COMSIG_MOVABLE_Z_CHANGED "movable_ztransit" -/// From base of atom/movable/Hear(): (proc args list(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, list/message_mods = list())) -//#define COMSIG_MOVABLE_HEAR "movable_hear" - //#define HEARING_MESSAGE 1 - //#define HEARING_SPEAKER 2 - //#define HEARING_LANGUAGE 3 - //#define HEARING_RAW_MESSAGE 4 - /* #define HEARING_RADIO_FREQ 5 - #define HEARING_SPANS 6 - #define HEARING_MESSAGE_MODE 7 */ -/// Called when the movable sucessfully has it's anchored var changed, from base atom/movable/set_anchored(): (value) -#define COMSIG_MOVABLE_SET_ANCHORED "movable_set_anchored" +//* Movement - Glide Size *// + /// Called when the movable's glide size is updated: (new_glide_size) #define COMSIG_MOVABLE_UPDATE_GLIDE_SIZE "movable_glide_size" + +//* Pixel Offsets *// + /// called when we have a drastic pixel x/y change and things should update #define COMSIG_MOVABLE_PIXEL_OFFSET_CHANGED "pixel_offset_changed" + +//* State Changes *// + +/// Called when the movable sucessfully has it's anchored var changed, from base atom/movable/set_anchored(): (value) +#define COMSIG_MOVABLE_SET_ANCHORED "movable_set_anchored" diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_radiation.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_radiation.dm index 6195a98585d1..35ced29027af 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_radiation.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_radiation.dm @@ -4,10 +4,14 @@ * * All signals send the source datum of the signal as the first argument */ -//! STOP. Are you about to add RAD_PROBE? -//! Well, don't. Add a trait system to manage rad_flags & RAD_BLOCK_CONTENTS, because -//! that's all it does, and there's literally no point in sending arg-less signals! -//! If we ever decide to make the signal have an arg, then yes, feel free to. For now, DON'T. +//* -- READ THIS -- *// +/// STOP. Are you about to add RAD_PROBE? +/// Well, don't. Add a trait system to manage rad_flags & RAD_BLOCK_CONTENTS, because +/// that's all it does, and there's literally no point in sending arg-less signals! +/// If we ever decide to make the signal have an arg, then yes, feel free to. For now, DON'T. +//* -- END -- *// /// From /datum/radiation_wave's iteration: (strength, datum/radiation_wave/wave) #define COMSIG_ATOM_RAD_PULSE_ITERATE "rad_pulse_iterate" +/// From base on atom/rad_act(): (strength, datum/radiation_wave/wave) +#define COMSIG_ATOM_RAD_ACT "atom_rad_act" diff --git a/code/__DEFINES/dcs/signals/signals_atom/tool_system.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_tool_system.dm similarity index 100% rename from code/__DEFINES/dcs/signals/signals_atom/tool_system.dm rename to code/__DEFINES/dcs/signals/signals_atom/signals_atom_tool_system.dm diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_visuals.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_visuals.dm deleted file mode 100644 index 8c1d29c8f2a8..000000000000 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_visuals.dm +++ /dev/null @@ -1,9 +0,0 @@ -/** - *! ## Atom Signals - Visuals / VFX. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// generally called before temporary non-parallel animate()s on the atom (animation_duration) -// todo: this is a good idea but not going to be implemented this way. -// #define COMSIG_ATOM_TEMPORARY_ANIMATION_START "atom_temp_animate_start" diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm index 0dc880593dab..d3390ab9bad9 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm @@ -7,40 +7,5 @@ //! ## /x_act Signals. /// from base of atom/ex_act: (power, dir, wave datum) #define COMSIG_ATOM_EX_ACT "atom_ex_act" -/// From the [LEGACY_EX_ACT] wrapper macro: (severity, target) -////#define COMSIG_ATOM_LEGACY_EX_ACT "atom_legacy_ex_act" /// From base of atom/emp_act(): (severity) #define COMSIG_ATOM_EMP_ACT "atom_emp_act" -/// From base of atom/fire_act(): (exposed_temperature, exposed_volume) -////#define COMSIG_ATOM_FIRE_ACT "atom_fire_act" -/// From base of atom/bullet_act(): (/obj/projectile, def_zone) -////#define COMSIG_ATOM_BULLET_ACT "atom_bullet_act" -/// From base of atom/CheckParts(): (list/parts_list, datum/crafting_recipe/R) -////#define COMSIG_ATOM_CHECKPARTS "atom_checkparts" -/// From base of atom/CheckParts(): (atom/movable/new_craft) - The atom has just been used in a crafting recipe and has been moved inside new_craft. -////#define COMSIG_ATOM_USED_IN_CRAFT "atom_used_in_craft" -/// From base of atom/blob_act(): (/obj/structure/blob) -////#define COMSIG_ATOM_BLOB_ACT "atom_blob_act" - //? If returned, forces nothing to happen when the atom is attacked by a blob - ////#define COMPONENT_CANCEL_BLOB_ACT (1<<0) -/// From base of atom/acid_act(): (acidpwr, acid_volume) -////#define COMSIG_ATOM_ACID_ACT "atom_acid_act" -/// From base of atom/emag_act(): (/mob/user) -////#define COMSIG_ATOM_EMAG_ACT "atom_emag_act" -/// From base of atom/narsie_act(): () -////#define COMSIG_ATOM_NARSIE_ACT "atom_narsie_act" -/// From base of atom/ratvar_act(): () -////#define COMSIG_ATOM_RATVAR_ACT "atom_ratvar_act" -/// From base of atom/rcd_act(): (/mob, /obj/item/construction/rcd, passed_mode) -////#define COMSIG_ATOM_RCD_ACT "atom_rcd_act" -/// From base of atom/singularity_pull(): (/datum/component/singularity, current_size) -////#define COMSIG_ATOM_SING_PULL "atom_sing_pull" -/// From obj/machinery/bsa/full/proc/fire(): () -////#define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass" - ////#define COMSIG_ATOM_BLOCKS_BSA_BEAM (1<<0) -/// From base on atom/rad_act(): (strength, /datum/radiation_wave_legacy) -#define COMSIG_ATOM_RAD_ACT "atom_rad_act" - -/// Called when teleporting into a protected turf: (channel, turf/origin) -#define COMSIG_ATOM_INTERCEPT_TELEPORT "intercept_teleport" - #define COMPONENT_BLOCK_TELEPORT (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_datum.dm b/code/__DEFINES/dcs/signals/signals_datum.dm index 215b2d1ddef2..aa6ad2642db7 100644 --- a/code/__DEFINES/dcs/signals/signals_datum.dm +++ b/code/__DEFINES/dcs/signals/signals_datum.dm @@ -13,41 +13,7 @@ #define COMSIG_PARENT_PREQDELETED "parent_preqdeleted" /// Just before a datum's Destroy() is called: (force), at this point none of the other components chose to interrupt qdel and Destroy will be called #define COMSIG_PARENT_QDELETING "parent_qdeleting" -/// Handler for vv_do_topic (usr, href_list) -////#define COMSIG_VV_TOPIC "vv_topic" - ////#define COMPONENT_VV_HANDLED (1<<0) /// From datum ui_act (usr, action, list/params, datum/tgui/ui, datum/tgui_module_context/module_context) #define COMSIG_DATUM_UI_ACT "ui_act" /// From datum push_ui_data: (mob/user, datum/tgui/ui, list/data) #define COMSIG_DATUM_PUSH_UI_DATA "push_ui_data" - -/// Fires on the target datum when an element is attached to it (/datum/element) -////#define COMSIG_ELEMENT_ATTACH "element_attach" -/// Fires on the target datum when an element is attached to it (/datum/element) -////#define COMSIG_ELEMENT_DETACH "element_detach" - -//! ## Merger datum signals -/// Called on the object being added to a merger group: (datum/merger/new_merger) -////#define COMSIG_MERGER_ADDING "comsig_merger_adding" -/// Called on the object being removed from a merger group: (datum/merger/old_merger) -////#define COMSIG_MERGER_REMOVING "comsig_merger_removing" -/// Called on the merger after finishing a refresh: (list/leaving_members, list/joining_members) -////#define COMSIG_MERGER_REFRESH_COMPLETE "comsig_merger_refresh_complete" - -//! ## Gas mixture signals -/// From /datum/gas_mixture/proc/merge: () -////#define COMSIG_GASMIX_MERGED "comsig_gasmix_merged" -/// From /datum/gas_mixture/proc/remove: () -////#define COMSIG_GASMIX_REMOVED "comsig_gasmix_removed" -/// From /datum/gas_mixture/proc/react: () -////#define COMSIG_GASMIX_REACTED "comsig_gasmix_reacted" - -//! ## Modular computer's file signals. Tells the program datum something is going on. -/// From /obj/item/computer_hardware/hard_drive/proc/store_file: () -////#define COMSIG_MODULAR_COMPUTER_FILE_ADDING "comsig_modular_computer_file_adding" -/// From /obj/item/computer_hardware/hard_drive/proc/store_file: () -////#define COMSIG_MODULAR_COMPUTER_FILE_ADDED "comsig_modular_computer_file_adding" -/// From /obj/item/computer_hardware/hard_drive/proc/remove_file: () -////#define COMSIG_MODULAR_COMPUTER_FILE_DELETING "comsig_modular_computer_file_deleting" -/// From /obj/item/computer_hardware/hard_drive/proc/store_file: () -////#define COMSIG_MODULAR_COMPUTER_FILE_DELETED "comsig_modular_computer_file_adding" diff --git a/code/__DEFINES/dcs/signals/signals_item/signals_item_inventory.dm b/code/__DEFINES/dcs/signals/signals_item/signals_item_inventory.dm index fccb01f6f7c0..070449036739 100644 --- a/code/__DEFINES/dcs/signals/signals_item/signals_item_inventory.dm +++ b/code/__DEFINES/dcs/signals/signals_item/signals_item_inventory.dm @@ -8,9 +8,3 @@ #define COMSIG_ITEM_EQUIPPED "item_equip" /// From base of obj/item/unequipped(): (/mob/unequipped, slot, accessory) #define COMSIG_ITEM_UNEQUIPPED "item_unequip" -/// Called on [/obj/item] before unequip from base of [mob/proc/doUnEquip]: (force, atom/newloc, no_move, invdrop, silent) -////#define COMSIG_ITEM_PRE_UNEQUIP "item_pre_unequip" - ///? Only the pre unequip can be cancelled. - ////#define COMPONENT_ITEM_BLOCK_UNEQUIP (1<<0) -/// Called on [/obj/item] AFTER unequip from base of [mob/proc/doUnEquip]: (force, atom/newloc, no_move, invdrop, silent) -////#define COMSIG_ITEM_POST_UNEQUIP "item_post_unequip" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_abilities.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_abilities.dm deleted file mode 100644 index 1fd1b08a729e..000000000000 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_abilities.dm +++ /dev/null @@ -1,24 +0,0 @@ -/** - *! ## Mob Ability Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -// todo: this is all needing a redo - -/// From base of /datum/action/cooldown/proc/PreActivate(): (datum/action/cooldown/activated) -////#define COMSIG_ABILITY_STARTED "mob_ability_base_started" - ////#define COMPONENT_BLOCK_ABILITY_START (1<<0) -/// From base of /datum/action/cooldown/proc/PreActivate(): (datum/action/cooldown/finished) -////#define COMSIG_ABILITY_FINISHED "mob_ability_base_finished" - -/// From base of /datum/action/cooldown/mob_cooldown/blood_warp/proc/blood_warp(): () -////#define COMSIG_BLOOD_WARP "mob_ability_blood_warp" -/// From base of /datum/action/cooldown/mob_cooldown/charge/proc/do_charge(): () -////#define COMSIG_STARTED_CHARGE "mob_ability_charge_started" -/// From base of /datum/action/cooldown/mob_cooldown/charge/proc/do_charge(): () -////#define COMSIG_FINISHED_CHARGE "mob_ability_charge_finished" -/// From base of /datum/action/cooldown/mob_cooldown/lava_swoop/proc/swoop_attack(): () -////#define COMSIG_SWOOP_INVULNERABILITY_STARTED "mob_swoop_invulnerability_started" -/// From base of /datum/action/cooldown/mob_cooldown/lava_swoop/proc/swoop_attack(): () -////#define COMSIG_LAVA_ARENA_FAILED "mob_lava_arena_failed" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_arcade.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_arcade.dm deleted file mode 100644 index 71ac6d986219..000000000000 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_arcade.dm +++ /dev/null @@ -1,12 +0,0 @@ -/** - *! ## Mob Videogame Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when a mob plays a videogame. -////#define COMSIG_MOB_PLAYED_VIDEOGAME "mob_played_videogame" -/// Called when a mob loses a videogame. -////#define COMSIG_MOB_LOST_VIDEOGAME "mob_lost_videogame" -/// Called when a mob wins a videogame. -////#define COMSIG_MOB_WON_VIDEOGAME "mob_won_videogame" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm deleted file mode 100644 index 5e5990349ebb..000000000000 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm +++ /dev/null @@ -1,98 +0,0 @@ -/** - *! ## Carbon Mob Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// When a carbon mob hugs someone, this is called on the carbon that is hugging. (mob/living/hugger, mob/living/hugged) -////#define COMSIG_CARBON_HUG "carbon_hug" -/// When a carbon mob is hugged, this is called on the carbon that is hugged. (mob/living/hugger) -////#define COMSIG_CARBON_HUGGED "carbon_hugged" -/// When a carbon mob is headpatted, this is called on the carbon that is headpatted. (mob/living/headpatter) -////#define COMSIG_CARBON_HEADPAT "carbon_headpatted" -/// When a carbon mob has their tail pulled, this is called on the carbon that is the target. (mob/living/tailpuller) -////#define COMSIG_CARBON_TAILPULL "carbon_tailpulled" -/// Before a carbon mob is shoved, sent to the turf we're trying to shove onto (mob/living/carbon/shover, mob/living/carbon/target) -////#define COMSIG_CARBON_DISARM_PRESHOVE "carbon_disarm_preshove" - ////#define COMSIG_CARBON_ACT_SOLID (1<<0) //Tells disarm code to act as if the mob was shoved into something solid, even we we're not -/// When a carbon mob is disarmed, this is sent to the turf we're trying to shove onto (mob/living/carbon/shover, mob/living/carbon/target, shove_blocked) -////#define COMSIG_CARBON_DISARM_COLLIDE "carbon_disarm_collision" - ////#define COMSIG_CARBON_SHOVE_HANDLED (1<<0) - -/// When a carbon slips. Called on /turf/open/handle_slip() -////#define COMSIG_ON_CARBON_SLIP "carbon_slip" -/// When a carbon gets a vending machine tilted on them -////#define COMSIG_ON_VENDOR_CRUSH "carbon_vendor_crush" - -//! /mob/living/carbon physiology signals -/// From /datum/wound/proc/apply_wound() (/mob/living/carbon/C, /datum/wound/W, /obj/item/bodypart/L) -////#define COMSIG_CARBON_GAIN_WOUND "carbon_gain_wound" -/// From /datum/wound/proc/remove_wound() (/mob/living/carbon/C, /datum/wound/W, /obj/item/bodypart/L) -////#define COMSIG_CARBON_LOSE_WOUND "carbon_lose_wound" -/// From base of /obj/item/bodypart/proc/attach_limb(): (new_limb, special) allows you to fail limb attachment. -////#define COMSIG_CARBON_ATTACH_LIMB "carbon_attach_limb" - ////#define COMPONENT_NO_ATTACH (1<<0) -/// From base of /obj/item/bodypart/proc/drop_limb(lost_limb, dismembered) -////#define COMSIG_CARBON_REMOVE_LIMB "carbon_remove_limb" -/// From /obj/item/bodypart/proc/apply_gauze(/obj/item/stack/gauze) -////#define COMSIG_BODYPART_GAUZED "bodypart_gauzed" -/// From [/obj/item/bodypart/proc/seep_gauze] when it runs out of absorption -////#define COMSIG_BODYPART_GAUZE_DESTROYED "bodypart_degauzed" - -/// From base of mob/living/carbon/soundbang_act(): (list(intensity)) -////////#define COMSIG_CARBON_SOUNDBANG "carbon_soundbang" -/// From /mob/living/carbon/doUnEquip(obj/item/I, force, newloc, no_move, invdrop, silent) -////////#define COMSIG_CARBON_EQUIP_HAT "carbon_equip_hat" -/// From /mob/living/carbon/doUnEquip(obj/item/I, force, newloc, no_move, invdrop, silent) -////////#define COMSIG_CARBON_UNEQUIP_HAT "carbon_unequip_hat" -/// From /mob/living/carbon/doUnEquip(obj/item/I, force, newloc, no_move, invdrop, silent) -////////#define COMSIG_CARBON_UNEQUIP_SHOECOVER "carbon_unequip_shoecover" -#////define COMSIG_CARBON_EQUIP_SHOECOVER "carbon_equip_shoecover" -///? Defined twice, in carbon and human's topics, fired when interacting with a valid embedded_object to pull it out (mob/living/carbon/target, /obj/item, /obj/item/bodypart/L) -////////#define COMSIG_CARBON_EMBED_RIP "item_embed_start_rip" -/// Called when removing a given item from a mob, from mob/living/carbon/remove_embedded_object(mob/living/carbon/target, /obj/item) -////////#define COMSIG_CARBON_EMBED_REMOVAL "item_embed_remove_safe" -/// Called when someone attempts to cuff a carbon -////////#define COMSIG_CARBON_CUFF_ATTEMPTED "carbon_attempt_cuff" -/// Called when a carbon mutates (source = dna, mutation = mutation added) -////////#define COMSIG_CARBON_GAIN_MUTATION "carbon_gain_mutation" -/// Called when a carbon loses a mutation (source = dna, mutation = mutation lose) -////////#define COMSIG_CARBON_LOSE_MUTATION "carbon_lose_mutation" -/// Called when a carbon becomes addicted (source = what addiction datum, addicted_mind = mind of the addicted carbon) -////////#define COMSIG_CARBON_GAIN_ADDICTION "carbon_gain_addiction" -/// Called when a carbon is no longer addicted (source = what addiction datum was lost, addicted_mind = mind of the freed carbon) -////////#define COMSIG_CARBON_LOSE_ADDICTION "carbon_lose_addiction" -/// Called when a carbon gets a brain trauma (source = carbon, trauma = what trauma was added) - this is before on_gain() -////////#define COMSIG_CARBON_GAIN_TRAUMA "carbon_gain_trauma" -/// Called when a carbon loses a brain trauma (source = carbon, trauma = what trauma was removed) -////////#define COMSIG_CARBON_LOSE_TRAUMA "carbon_lose_trauma" -/// Called when a carbon updates their health (source = carbon) -////////#define COMSIG_CARBON_HEALTH_UPDATE "carbon_health_update" -/// Called when a carbon updates their sanity (source = carbon) -////////#define COMSIG_CARBON_SANITY_UPDATE "carbon_sanity_update" - -//! /mob/living/carbon/human signals -/// Hit by successful disarm attack (mob/living/carbon/human/attacker,zone_targeted) -////#define COMSIG_HUMAN_DISARM_HIT "human_disarm_hit" -/// Whenever EquipRanked is called, called after job is set -////#define COMSIG_JOB_RECEIVED "job_received" -/// From /mob/living/carbon/human/proc/set_coretemperature(): (oldvalue, newvalue) -////#define COMSIG_HUMAN_CORETEMP_CHANGE "human_coretemp_change" -/// From /datum/species/handle_fire. Called when the human is set on fire and burning clothes and stuff -////#define COMSIG_HUMAN_BURNING "human_burning" -/// From mob/living/carbon/human/UnarmedAttack(): (atom/target, proximity, modifiers) -////#define COMSIG_HUMAN_EARLY_UNARMED_ATTACK "human_early_unarmed_attack" -/// From mob/living/carbon/human/UnarmedAttack(): (atom/target, proximity, modifiers) -////#define COMSIG_HUMAN_MELEE_UNARMED_ATTACK "human_melee_unarmed_attack" -//from /mob/living/carbon/human/proc/check_shields(): (atom/hit_by, damage, attack_text, attack_type, armour_penetration) -////#define COMSIG_HUMAN_CHECK_SHIELDS "human_check_shields" - ////#define SHIELD_BLOCK (1<<0) - -//! Mob transformation signals -/// Called when a human turns into a monkey, from /mob/living/carbon/proc/finish_monkeyize() -////#define COMSIG_HUMAN_MONKEYIZE "human_monkeyize" -/// Called when a monkey turns into a human, from /mob/living/carbon/proc/finish_humanize(species) -////#define COMSIG_MONKEY_HUMANIZE "monkey_humanize" - -/// From mob/living/carbon/human/suicide() -////#define COMSIG_HUMAN_SUICIDE_ACT "human_suicide_act" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm deleted file mode 100644 index 93f10b3c11e5..000000000000 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm +++ /dev/null @@ -1,76 +0,0 @@ -/** - *! ## /mob/living Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called on /living when attempting to pick up an item, from base of /mob/living/put_in_hand_check(): (obj/item/I) -////#define COMSIG_LIVING_TRY_PUT_IN_HAND "living_try_put_in_hand" - ///? Can't pick up - ////#define COMPONENT_LIVING_CANT_PUT_IN_HAND (1<<0) - -/// From /obj/structure/door/crush(): (mob/living/crushed, /obj/machinery/door/crushing_door) -////#define COMSIG_LIVING_DOORCRUSHED "living_doorcrush" -/// From base of mob/living/resist() (/mob/living) -////#define COMSIG_LIVING_RESIST "living_resist" -/// From base of mob/living/IgniteMob() (/mob/living) -////#define COMSIG_LIVING_IGNITED "living_ignite" -/// From base of mob/living/extinguish_mob() (/mob/living) -////#define COMSIG_LIVING_EXTINGUISHED "living_extinguished" -/// From base of mob/living/electrocute_act(): (shock_damage, source, siemens_coeff, flags) -////#define COMSIG_LIVING_ELECTROCUTE_ACT "living_electrocute_act" -///sent when items with siemen coeff. of 0 block a shock: (power_source, source, siemens_coeff, dist_check) -////#define COMSIG_LIVING_SHOCK_PREVENTED "living_shock_prevented" -///sent by stuff like stunbatons and tasers: () -////#define COMSIG_LIVING_MINOR_SHOCK "living_minor_shock" -/// From base of mob/living/revive() (full_heal, admin_revive) -////#define COMSIG_LIVING_REVIVE "living_revive" -/// From base of /mob/living/regenerate_limbs(): (noheal, excluded_limbs) -////#define COMSIG_LIVING_REGENERATE_LIMBS "living_regen_limbs" -/// From base of mob/living/set_body_position() -////#define COMSIG_LIVING_SET_BODY_POSITION "living_set_body_position" -/// From post-can inject check of syringe after attack (mob/user) -////#define COMSIG_LIVING_TRY_SYRINGE "living_try_syringe" - -/// From base of element/bane/activate(): (item/weapon, mob/user) -////#define COMSIG_LIVING_BANED "living_baned" -///Sent when bloodcrawl ends in mob/living/phasein(): (phasein_decal) -////#define COMSIG_LIVING_AFTERPHASEIN "living_phasein" - -/// From base of mob/living/death(): (gibbed) -////#define COMSIG_LIVING_DEATH "living_death" - -/// From base of mob/living/Write_Memory(): (dead, gibbed) -////#define COMSIG_LIVING_WRITE_MEMORY "living_write_memory" - ////#define COMPONENT_DONT_WRITE_MEMORY (1<<0) - -/// From /proc/healthscan(): (list/scan_results, advanced, mob/user, mode) -/// Consumers are allowed to mutate the scan_results list to add extra information -////#define COMSIG_LIVING_HEALTHSCAN "living_healthscan" - -//! ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS! !// - -/// From base of /mob/living/can_track(): (mob/user) -////#define COMSIG_LIVING_CAN_TRACK "mob_cantrack" - ////#define COMPONENT_CANT_TRACK (1<<0) -/// From end of fully_heal(): (admin_revive) -////#define COMSIG_LIVING_POST_FULLY_HEAL "living_post_fully_heal" -/// from start of /mob/living/handle_breathing(): (delta_time, times_fired) -////#define COMSIG_LIVING_HANDLE_BREATHING "living_handle_breathing" -/// From /obj/item/hand_item/slapper/attack_atom(): (source=mob/living/slammer, obj/structure/table/slammed_table) -////#define COMSIG_LIVING_SLAM_TABLE "living_slam_table" -/// From /obj/item/hand_item/slapper/attack(): (source=mob/living/slapper, mob/living/slapped) -////#define COMSIG_LIVING_SLAP_MOB "living_slap_mob" -///(NOT on humans) from mob/living/*/UnarmedAttack(): (atom/target, proximity, modifiers) -////#define COMSIG_LIVING_UNARMED_ATTACK "living_unarmed_attack" -/// From base of mob/living/MobBump() (mob/living) -////#define COMSIG_LIVING_MOB_BUMP "living_mob_bump" -/// From base of mob/living/ZImpactDamage() (mob/living, levels, turf/t) -////#define COMSIG_LIVING_Z_IMPACT "living_z_impact" - ////#define NO_Z_IMPACT_DAMAGE (1<<0) - -/// From mob/living/treat_message(): (list/message_args) -////#define COMSIG_LIVING_TREAT_MESSAGE "living_treat_message" - -/// From obj/item/toy/crayon/spraycan -////#define COMSIG_LIVING_MOB_PAINTED "living_mob_painted" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm index 3dc6401c22eb..1b5736943b21 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm @@ -4,162 +4,34 @@ * * All signals send the source datum of the signal as the first argument */ -/// Called on user, from base of /datum/strippable_item/alternate_action() (atom/target) -////#define COMSIG_TRY_ALT_ACTION "try_alt_action" - ////#define COMPONENT_CANT_ALT_ACTION (1<<0) -/// Called on /basic when updating its speed, from base of /mob/living/basic/update_basic_mob_varspeed(): () -////#define POST_BASIC_MOB_UPDATE_VARSPEED "post_basic_mob_update_varspeed" -/// From base of /mob/Login(): () -////#define COMSIG_MOB_LOGIN "mob_login" -/// From base of /mob/Logout(): () -////#define COMSIG_MOB_LOGOUT "mob_logout" -/// From base of mob/set_stat(): (new_stat, old_stat) -////#define COMSIG_MOB_STATCHANGE "mob_statchange" -/// From base of mob/clickon(): (atom/A, params) -////#define COMSIG_MOB_CLICKON "mob_clickon" -/// From base of mob/MiddleClickOn(): (atom/A) -////#define COMSIG_MOB_MIDDLECLICKON "mob_middleclickon" -/// From base of mob/AltClickOn(): (atom/A) -////#define COMSIG_MOB_ALTCLICKON "mob_altclickon" - ////#define COMSIG_MOB_CANCEL_CLICKON (1<<0) -/// From base of mob/alt_click_on_secodary(): (atom/A) -////#define COMSIG_MOB_ALTCLICKON_SECONDARY "mob_altclickon_secondary" -/// From base of /mob/living/simple_animal/bot/proc/bot_step() -////#define COMSIG_MOB_BOT_PRE_STEP "mob_bot_pre_step" - ///? Should always match COMPONENT_MOVABLE_BLOCK_PRE_MOVE as these are interchangeable and used to block movement. - ////#define COMPONENT_MOB_BOT_BLOCK_PRE_STEP COMPONENT_MOVABLE_BLOCK_PRE_MOVE -/// From base of /mob/living/simple_animal/bot/proc/bot_step() -////#define COMSIG_MOB_BOT_STEP "mob_bot_step" - -/// From base of /client/Move() -////#define COMSIG_MOB_CLIENT_PRE_MOVE "mob_client_pre_move" - ///? Should always match COMPONENT_MOVABLE_BLOCK_PRE_MOVE as these are interchangeable and used to block movement. - ////#define COMSIG_MOB_CLIENT_BLOCK_PRE_MOVE COMPONENT_MOVABLE_BLOCK_PRE_MOVE -/// From base of /client/Move() -////#define COMSIG_MOB_CLIENT_PRE_LIVING_MOVE "mob_client_pre_living_move" - ///? Should we stop the current living movement attempt - ////#define COMSIG_MOB_CLIENT_BLOCK_PRE_LIVING_MOVE COMPONENT_MOVABLE_BLOCK_PRE_MOVE -/// From base of /client/Move() -////#define COMSIG_MOB_CLIENT_MOVED "mob_client_moved" -/// From base of /client/proc/change_view() (mob/source, new_size) -////#define COMSIG_MOB_CLIENT_CHANGE_VIEW "mob_client_change_view" -/// From base of /mob/proc/reset_perspective() (mob/source) -////#define COMSIG_MOB_RESET_PERSPECTIVE "mob_reset_perspective" - -/// From mind/transfer_to. Sent to the receiving mob. -////#define COMSIG_MOB_MIND_TRANSFERRED_INTO "mob_mind_transferred_into" - /// From base of obj/allowed(mob/M): (/obj) returns ACCESS_ALLOWED if mob has id access to the obj +// todo: this doesn't work #define COMSIG_MOB_TRIED_ACCESS "tried_access" #define ACCESS_ALLOWED (1<<0) #define ACCESS_DISALLOWED (1<<1) #define LOCKED_ATOM_INCOMPATIBLE (1<<2) -/// From base of mob/can_cast_magic(): (mob/user, magic_flags, charge_cost) -////#define COMSIG_MOB_RESTRICT_MAGIC "mob_cast_magic" /// From base of mob/can_block_magic(): (mob/user, casted_magic_flags, charge_cost) #define COMSIG_MOB_RECEIVE_MAGIC "mob_receive_magic" #define COMPONENT_MAGIC_BLOCKED (1<<0) -/// From base of mob/create_mob_hud(): () -////#define COMSIG_MOB_HUD_CREATED "mob_hud_created" - -/// From base of /mob/living/proc/apply_damage(): (damage, damagetype, def_zone) -////#define COMSIG_MOB_APPLY_DAMAGE "mob_apply_damage" -/// From base of /mob/living/attack_alien(): (user) -////#define COMSIG_MOB_ATTACK_ALIEN "mob_attack_alien" -/// From base of /mob/throw_item(): (atom/target) -////#define COMSIG_MOB_THROW "mob_throw" /// From base of /mob/verb/examinate(): (atom/target) #define COMSIG_MOB_EXAMINATE "mob_examinate" -/// From /mob/living/handle_eye_contact(): (mob/living/other_mob) -#define COMSIG_MOB_EYECONTACT "mob_eyecontact" - ///? return this if you want to block printing this message to this person, if you want to print your own (does not affect the other person's message) - #define COMSIG_BLOCK_EYECONTACT (1<<0) /// From base of /mob/update_sight(): () #define COMSIG_MOB_UPDATE_SIGHT "mob_update_sight" //// From /mob/living/say(): () #define COMSIG_MOB_SAY "mob_say" - ////#define COMPONENT_UPPERCASE_SPEECH (1<<0) - //? used to access COMSIG_MOB_SAY argslist - ////#define SPEECH_MESSAGE 1 - // #define SPEECH_BUBBLE_TYPE 2 - ////#define SPEECH_SPANS 3 - // #define SPEECH_SANITIZE 4 - ////#define SPEECH_LANGUAGE 5 - /* #define SPEECH_IGNORE_SPAM 6 - #define SPEECH_FORCED 7 */ - ////#define SPEECH_RANGE 8 -/// From /mob/say_dead(): (mob/speaker, message) -////#define COMSIG_MOB_DEADSAY "mob_deadsay" - ////#define MOB_DEADSAY_SIGNAL_INTERCEPT (1<<0) -/// From /mob/living/emote(): () -////#define COMSIG_MOB_EMOTE "mob_emote" /// Sent on custom emote. (mob, raw_emote) #define COMSIG_MOB_CUSTOM_EMOTE "custom_emote" /// Sent on subtle/subtler. (mob, raw_emote) #define COMSIG_MOB_SUBTLE_EMOTE "subtle_emote" -/// From base of mob/swap_hand(): (obj/item) -////#define COMSIG_MOB_SWAP_HANDS "mob_swap_hands" - ////#define COMPONENT_BLOCK_SWAP (1<<0) -/// From base of /mob/verb/pointed: (atom/A) -////#define COMSIG_MOB_POINTED "mob_pointed" -/// Mob is trying to open the wires of a target [/atom], from /datum/wires/interactable(): (atom/target) -////#define COMSIG_TRY_WIRES_INTERACT "try_wires_interact" - ////#define COMPONENT_CANT_INTERACT_WIRES (1<<0) -////#define COMSIG_MOB_EMOTED(emote_key) "mob_emoted_[emote_key]" /// Sent when a mob/login() finishes: (client) #define COMSIG_MOB_CLIENT_LOGIN "comsig_mob_client_login" /// Sent when a mob/logout() begins: (client) #define COMSIG_MOB_CLIENT_LOGOUT "comsig_mob_client_logout" -/// From base of client/MouseDown(): (/client, object, location, control, params) -////#define COMSIG_CLIENT_MOUSEDOWN "client_mousedown" -/// From base of client/MouseUp(): (/client, object, location, control, params) -////#define COMSIG_CLIENT_MOUSEUP "client_mouseup" - ////#define COMPONENT_CLIENT_MOUSEUP_INTERCEPT (1<<0) -/// From base of client/MouseUp(): (/client, object, location, control, params) -////#define COMSIG_CLIENT_MOUSEDRAG "client_mousedrag" -/// Called on user, from base of /datum/strippable_item/try_(un)equip() (atom/target, obj/item/equipping?) -////#define COMSIG_TRY_STRIP "try_strip" - ////#define COMPONENT_CANT_STRIP (1<<0) -/// From /datum/component/creamed/Initialize() -////#define COMSIG_MOB_CREAMED "mob_creamed" -/// From /obj/item/gun/proc/check_botched() -////#define COMSIG_MOB_CLUMSY_SHOOT_FOOT "mob_clumsy_shoot_foot" -/// From /obj/item/hand_item/slapper/attack_atom(): (source=obj/structure/table/slammed_table, mob/living/slammer) -////#define COMSIG_TABLE_SLAMMED "table_slammed" -/// From base of atom/attack_hand(mob/user, list/params): (mob/user, modifiers) -////#define COMSIG_MOB_ATTACK_HAND "mob_attack_hand" -/// From base of /obj/item/attack(): (mob/M, mob/user) -////#define COMSIG_MOB_ITEM_ATTACK "mob_item_attack" - ////#define COMPONENT_ITEM_NO_ATTACK (1<<0) -/// From base of obj/item/afterattack(atom/target, mob/user, clickchain_flags, list/params) -////#define COMSIG_MOB_ITEM_AFTERATTACK "mob_item_afterattack" -/// From base of obj/item/afterattack_secondary(): (atom/target, obj/item/weapon, proximity_flag, click_parameters) -////#define COMSIG_MOB_ITEM_AFTERATTACK_SECONDARY "mob_item_afterattack_secondary" -/// From base of obj/item/attack_qdeleted(): (atom/target, mob/user, proximity_flag, click_parameters) -////#define COMSIG_MOB_ITEM_ATTACK_QDELETED "mob_item_attack_qdeleted" -/// From base of mob/RangedAttack(): (atom/A, modifiers) -////#define COMSIG_MOB_ATTACK_RANGED "mob_attack_ranged" -/// From base of mob/ranged_secondary_attack(): (atom/target, modifiers) -////#define COMSIG_MOB_ATTACK_RANGED_SECONDARY "mob_attack_ranged_secondary" -/// From base of atom/ctrl_click(): (atom/A) -////#define COMSIG_MOB_CTRL_CLICKED "mob_ctrl_clicked" -/// From base of mob/update_movespeed():area -////#define COMSIG_MOB_MOVESPEED_UPDATED "mob_update_movespeed" -/// From /atom/movable/screen/zone_sel/proc/set_selected_zone. -/// Fires when the user has changed their selected body target. -////#define COMSIG_MOB_SELECTED_ZONE_SET "mob_set_selected_zone" -/// From base of [/client/proc/handle_spam_prevention] (message, mute_type) -////#define COMSIG_MOB_AUTOMUTE_CHECK "client_automute_check" // The check is performed by the client. - ///? Prevents the automute system checking this client for repeated messages. - ////#define WAIVE_AUTOMUTE_CHECK (1<<0) /// From base of mob/Life(): (seconds, times_fired) #define COMSIG_MOB_ON_LIFE "mob_life" #define COMPONENT_INTERRUPT_PHYSICAL_LIFE (1<<0) #define COMPONENT_INTERRUPT_BIOLOGICAL_LIFE (1<<1) - -/// called when we update lying: (new_lying) -#define COMSIG_MOB_UPDATE_LYING "mob_update_lying" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_organs.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_organs.dm index 169a53fb45aa..bf0ad0a5e632 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_organs.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_organs.dm @@ -4,11 +4,6 @@ * * All signals send the source datum of the signal as the first argument */ -/// Called on the organ when it is implanted into someone (mob/living/carbon/receiver) -////#define COMSIG_ORGAN_IMPLANTED "comsig_organ_implanted" /// Called on the organ when it is removed from someone (mob/living/carbon/old_owner) +// todo: this doesn't work #define COMSIG_ORGAN_REMOVED "comsig_organ_remove" -/// From /item/organ/proc/Insert() (/obj/item/organ/) -////#define COMSIG_CARBON_GAIN_ORGAN "carbon_gain_organ" -/// From /item/organ/proc/Remove() (/obj/item/organ/) -////#define COMSIG_CARBON_LOSE_ORGAN "carbon_lose_organ" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_silicon.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_silicon.dm deleted file mode 100644 index 44d89c54e0b6..000000000000 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_silicon.dm +++ /dev/null @@ -1,10 +0,0 @@ -/** - *! ## /mob/silicon Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Sent from borg recharge stations: (amount, repairs) -////#define COMSIG_PROCESS_BORGCHARGER_OCCUPANT "living_charge" -/// Sent from borg mobs to itself, for tools to catch an upcoming destroy() due to safe decon (rather than detonation) -////#define COMSIG_BORG_SAFE_DECONSTRUCT "borg_safe_decon" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_simple.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_simple.dm index d7927ce13201..da96fa77ada4 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_simple.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_simple.dm @@ -4,18 +4,9 @@ * * All signals send the source datum of the signal as the first argument */ -//! simple_animal signals -/// Called when a simplemob is given sentience from a potion (target = person who sentienced) -////#define COMSIG_SIMPLEMOB_SENTIENCEPOTION "simplemob_sentiencepotion" - //! /mob/living/simple_animal/hostile signals /// Before attackingtarget has happened, source is the attacker and target is the attacked #define COMSIG_HOSTILE_PRE_ATTACKINGTARGET "hostile_pre_attackingtarget" #define COMPONENT_HOSTILE_NO_ATTACK (1<<0) //cancel the attack, only works before attack happens /// After attackingtarget has happened, source is the attacker and target is the attacked, extra argument for if the attackingtarget was successful #define COMSIG_HOSTILE_POST_ATTACKINGTARGET "hostile_post_attackingtarget" -/// From base of mob/living/simple_animal/hostile/regalrat: (mob/living/simple_animal/hostile/regalrat/king) -////#define COMSIG_RAT_INTERACT "rat_interaction" -/// From mob/living/simple_animal/hostile/ooze/eat_atom(): (atom/target, edible_flags) -////#define COMSIG_OOZE_EAT_ATOM "ooze_eat_atom" - ////#define COMPONENT_ATOM_EATEN (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object.dm index 2a57ef92c019..070bace22243 100644 --- a/code/__DEFINES/dcs/signals/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object.dm @@ -4,358 +4,14 @@ * * All signals send the source datum of the signal as the first argument */ -//! /obj signals -/// From base of obj/deconstruct(): (disassembled) -////#define COMSIG_OBJ_DECONSTRUCT "obj_deconstruct" -/// From base of code/game/machinery -////#define COMSIG_OBJ_DEFAULT_UNFASTEN_WRENCH "obj_default_unfasten_wrench" -/// From base of /turf/proc/levelupdate(). (intact) true to hide and false to unhide -////#define COMSIG_OBJ_HIDE "obj_hide" -/// From /obj/item/toy/crayon/spraycan/afterattack: (color_is_dark) -////#define COMSIG_OBJ_PAINTED "obj_painted" - -//! /obj/machinery signals -/// From /obj/machinery/atom_break(damage_flag): (damage_flag) -////#define COMSIG_MACHINERY_BROKEN "machinery_broken" -/// From base power_change() when power is lost -////#define COMSIG_MACHINERY_POWER_LOST "machinery_power_lost" -/// From base power_change() when power is restored -////#define COMSIG_MACHINERY_POWER_RESTORED "machinery_power_restored" -/// From /obj/machinery/set_occupant(atom/movable/O): (new_occupant) -////#define COMSIG_MACHINERY_SET_OCCUPANT "machinery_set_occupant" -/// From /obj/machinery/destructive_scanner/proc/open(aggressive): Runs when the destructive scanner scans a group of objects. (list/scanned_atoms) -////#define COMSIG_MACHINERY_DESTRUCTIVE_SCAN "machinery_destructive_scan" /// From /obj/machinery/computer/arcade/prizevend(mob/user, prizes = 1) #define COMSIG_ARCADE_PRIZEVEND "arcade_prizevend" -/// From /datum/controller/subsystem/air/proc/start_processing_machine: () -////#define COMSIG_MACHINERY_START_PROCESSING_AIR "start_processing_air" -/// From /datum/controller/subsystem/air/proc/stop_processing_machine: () -////#define COMSIG_MACHINERY_STOP_PROCESSING_AIR "stop_processing_air" - -/// From /obj/machinery/can_interact(mob/user): Called on user when attempting to interact with a machine (obj/machinery/machine) -////#define COMSIG_TRY_USE_MACHINE "try_use_machine" - ///? Can't interact with the machine - ////#define COMPONENT_CANT_USE_MACHINE_INTERACT (1<<0) - ///? Can't use tools on the machine - ////#define COMPONENT_CANT_USE_MACHINE_TOOLS (1<<1) - -/// From obj/machinery/iv_drip/IV_attach(target, usr) : (attachee) -////#define COMSIG_IV_ATTACH "iv_attach" -/// From obj/machinery/iv_drip/IV_detach() : (detachee) -////#define COMSIG_IV_DETACH "iv_detach" - - -//! /obj/machinery/computer/teleporter -/// From /obj/machinery/computer/teleporter/proc/set_target(target, old_target) -////#define COMSIG_TELEPORTER_NEW_TARGET "teleporter_new_target" - -//! /obj/machinery/power/supermatter_crystal signals -/// From /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM delam reaches the point of sounding alarms -////#define COMSIG_SUPERMATTER_DELAM_START_ALARM "sm_delam_start_alarm" -/// From /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM sounds an audible alarm -////#define COMSIG_SUPERMATTER_DELAM_ALARM "sm_delam_alarm" - -//! /obj/machinery/atmospherics/components/unary/cryo_cell signals - -/// From /obj/machinery/atmospherics/components/unary/cryo_cell/set_on(bool): (on) -////#define COMSIG_CRYO_SET_ON "cryo_set_on" - -//! /obj/machinery/atmospherics/components/binary/valve signals - -/// From /obj/machinery/atmospherics/components/binary/valve/toggle(): (on) -////#define COMSIG_VALVE_SET_OPEN "valve_toggled" - -/// From /obj/machinery/atmospherics/set_on(active): (on) -////#define COMSIG_ATMOS_MACHINE_SET_ON "atmos_machine_set_on" - -/// From /obj/machinery/light_switch/set_lights(), sent to every switch in the area: (status) -////#define COMSIG_LIGHT_SWITCH_SET "light_switch_set" - -/// From /obj/machinery/fire_alarm/reset(), /obj/machinery/fire_alarm/alarm(): (status) -////#define COMSIG_FIREALARM_ON_TRIGGER "firealarm_trigger" -////#define COMSIG_FIREALARM_ON_RESET "firealarm_reset" - -//! /obj access signals -#define COMSIG_OBJ_ALLOWED "door_try_to_activate" - #define COMPONENT_OBJ_ALLOW (1<<0) - -////#define COMSIG_AIRLOCK_SHELL_ALLOWED "airlock_shell_try_allowed" - ////#define COMPONENT_AIRLOCK_SHELL_ALLOW (1<<0) - -//! /obj/machinery/door/airlock signals -/// From /obj/machinery/door/airlock/open(): (forced) -////#define COMSIG_AIRLOCK_OPEN "airlock_open" -/// From /obj/machinery/door/airlock/close(): (forced) -////#define COMSIG_AIRLOCK_CLOSE "airlock_close" -/// From /obj/machinery/door/airlock/set_bolt(): -////#define COMSIG_AIRLOCK_SET_BOLT "airlock_set_bolt" - -//! /obj/item signals -/// From base of obj/item/on_grind(): ()) -////#define COMSIG_ITEM_ON_GRIND "on_grind" -/// From base of obj/item/on_juice(): () -////#define COMSIG_ITEM_ON_JUICE "on_juice" -/// From /obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params) when an object is used as compost: (mob/user) -////#define COMSIG_ITEM_ON_COMPOSTED "on_composted" -/// Called when an item is dried by a drying rack: -////#define COMSIG_ITEM_DRIED "item_dried" -/// From base of mob/living/carbon/attacked_by(): (mob/living/carbon/target, mob/living/user, hit_zone) -////#define COMSIG_ITEM_ATTACK_ZONE "item_attack_zone" -///return a truthy value to prevent ensouling, checked in /obj/effect/proc_holder/spell/targeted/lichdom/cast(): (mob/user) -////#define COMSIG_ITEM_IMBUE_SOUL "item_imbue_soul" - ////#define COMPONENT_BLOCK_IMBUE (1 << 0) -/// Called before marking an object for retrieval, checked in /obj/effect/proc_holder/spell/targeted/summonitem/cast() : (mob/user) -////#define COMSIG_ITEM_MARK_RETRIEVAL "item_mark_retrieval" - ////#define COMPONENT_BLOCK_MARK_RETRIEVAL (1<<0) -/// From base of obj/item/hit_reaction(): (list/args) -////#define COMSIG_ITEM_HIT_REACT "item_hit_react" - ////#define COMPONENT_HIT_REACTION_BLOCK (1<<0) -/// Called on item when microwaved (): (obj/machinery/microwave/M) -////#define COMSIG_ITEM_MICROWAVE_ACT "microwave_act" - ////#define COMPONENT_SUCCESFUL_MICROWAVE (1<<0) -/// Called on item when created through microwaving (): (obj/machinery/microwave/M, cooking_efficiency) -////#define COMSIG_ITEM_MICROWAVE_COOKED "microwave_cooked" -/// From base of item/sharpener/attackby(): (amount, max) -////#define COMSIG_ITEM_SHARPEN_ACT "sharpen_act" - ////#define COMPONENT_BLOCK_SHARPEN_APPLIED (1<<0) - ////#define COMPONENT_BLOCK_SHARPEN_BLOCKED (1<<1) - ////#define COMPONENT_BLOCK_SHARPEN_ALREADY (1<<2) - ////#define COMPONENT_BLOCK_SHARPEN_MAXED (1<<3) -/// Called when an object is grilled ontop of a griddle -////#define COMSIG_ITEM_GRILLED "item_griddled" - ////#define COMPONENT_HANDLED_GRILLING (1<<0) -/// Called when an object is turned into another item through grilling ontop of a griddle -////#define COMSIG_GRILL_COMPLETED "item_grill_completed" -/// Called when an object is meant to be grilled through a grill: (atom/fry_object, grill_time) -////#define COMSIG_GRILL_FOOD "item_grill_food" -//Called when an object is in an oven -////#define COMSIG_ITEM_BAKED "item_baked" - ////#define COMPONENT_HANDLED_BAKING (1<<0) - ////#define COMPONENT_BAKING_GOOD_RESULT (1<<1) - ////#define COMPONENT_BAKING_BAD_RESULT (1<<2) -/// Called when an object is turned into another item through baking in an oven -////#define COMSIG_BAKE_COMPLETED "item_bake_completed" -/// Called when an armor plate is successfully applied to an object -////#define COMSIG_ARMOR_PLATED "armor_plated" -/// Called when an item gets recharged by the ammo powerup -////#define COMSIG_ITEM_RECHARGED "item_recharged" -/// Called when an item is being offered, from [/obj/item/proc/on_offered(mob/living/carbon/offerer)] -////#define COMSIG_ITEM_OFFERING "item_offering" - ///? Interrupts the offer proc - ////#define COMPONENT_OFFER_INTERRUPT (1<<0) -/// Called when an someone tries accepting an offered item, from [/obj/item/proc/on_offer_taken(mob/living/carbon/offerer, mob/living/carbon/taker)] -////#define COMSIG_ITEM_OFFER_TAKEN "item_offer_taken" - ///? Interrupts the offer acceptance - ////#define COMPONENT_OFFER_TAKE_INTERRUPT (1<<0) -/// sent from obj/effect/attackby(): (/obj/effect/hit_effect, /mob/living/attacker, params) -////#define COMSIG_ITEM_ATTACK_EFFECT "item_effect_attacked" - -/// From base of [/obj/item/proc/tool_check_callback]: (mob/living/user) -////#define COMSIG_TOOL_IN_USE "tool_in_use" -/// From base of [/obj/item/proc/tool_start_check]: (mob/living/user) -////#define COMSIG_TOOL_START_USE "tool_start_use" -/// From [/obj/item/proc/disableEmbedding]: -////#define COMSIG_ITEM_DISABLE_EMBED "item_disable_embed" -/// From [/obj/effect/mine/proc/triggermine]: -////#define COMSIG_MINE_TRIGGERED "minegoboom" -/// From [/obj/structure/closet/supplypod/proc/preOpen]: -////#define COMSIG_SUPPLYPOD_LANDED "supplypodgoboom" - -/// From /obj/item/storage/book/bible/afterattack(atom/target, mob/user, clickchain_flags, list/params) -////#define COMSIG_BIBLE_SMACKED "bible_smacked" - ///? Stops the bible chain from continuing. When all of the effects of the bible smacking have been moved to a signal we can kill this - ////#define COMSIG_END_BIBLE_CHAIN (1<<0) -/// Closets -/// From base of [/obj/structure/closet/proc/insert]: (atom/movable/inserted) -////#define COMSIG_CLOSET_INSERT "closet_insert" - ///? Used to interrupt insertion - ////#define COMPONENT_CLOSET_INSERT_INTERRUPT (1<<0) - -/// From open: (forced) -////#define COMSIG_CLOSET_PRE_OPEN "closet_pre_open" - ////#define BLOCK_OPEN (1<<0) -/// From open: (forced) -////#define COMSIG_CLOSET_POST_OPEN "closet_post_open" - -/// A deliver_first element closet was successfully delivered -////#define COMSIG_CLOSET_DELIVERED "crate_delivered" - -//! Eigenstasium Signals -/// From base of [/datum/controller/subsystem/eigenstates/proc/use_eigenlinked_atom]: (var/target) -////#define COMSIG_EIGENSTATE_ACTIVATE "eigenstate_activate" - -//! /obj Signals for economy -/// Called when the payment component tries to charge an account. -////#define COMSIG_OBJ_ATTEMPT_CHARGE "obj_attempt_simple_charge" - ////#define COMPONENT_OBJ_CANCEL_CHARGE (1<<0) -/// Called when a payment component changes value -////#define COMSIG_OBJ_ATTEMPT_CHARGE_CHANGE "obj_attempt_simple_charge_change" - -//! /obj/item signals for economy -/// Called before an item is sold by the exports system. -////#define COMSIG_ITEM_PRE_EXPORT "item_pre_sold" - ///? Stops the export from calling sell_object() on the item, so you can handle it manually. - ////#define COMPONENT_STOP_EXPORT (1<<0) -/// Called when an item is sold by the exports subsystem -////#define COMSIG_ITEM_EXPORTED "item_sold" - ///? Stops the export from adding the export information to the report, so you can handle it manually. - ////#define COMPONENT_STOP_EXPORT_REPORT (1<<0) -/// Called when a wrapped up item is opened by hand -////#define COMSIG_ITEM_UNWRAPPED "item_unwrapped" -/// Called when getting the item's exact ratio for cargo's profit. -////#define COMSIG_ITEM_SPLIT_PROFIT "item_split_profits" -/// Called when getting the item's exact ratio for cargo's profit, without selling the item. -////#define COMSIG_ITEM_SPLIT_PROFIT_DRY "item_split_profits_dry" - -//! /obj/item/clothing signals -/// From [/mob/living/carbon/human/Move]: () -////#define COMSIG_SHOES_STEP_ACTION "shoes_step_action" -/// From base of /obj/item/clothing/suit/space/proc/toggle_spacesuit(): (obj/item/clothing/suit/space/suit) -////#define COMSIG_SUIT_SPACE_TOGGLE "suit_space_toggle" - -//! /obj/item/implant signals -/// From base of /obj/item/implant/proc/activate(): () -////#define COMSIG_IMPLANT_ACTIVATED "implant_activated" -/// From base of /obj/item/implant/proc/implant(): (list/args) -////#define COMSIG_IMPLANT_IMPLANTING "implant_implanting" - ////#define COMPONENT_STOP_IMPLANTING (1<<0) -/// Called on already installed implants when a new one is being added in /obj/item/implant/proc/implant(): (list/args, obj/item/implant/new_implant) -////#define COMSIG_IMPLANT_OTHER "implant_other" - ///? The name makes sense for both - ////#define COMPONENT_STOP_IMPLANTING (1<<0) - ////#define COMPONENT_DELETE_NEW_IMPLANT (1<<1) - ////#define COMPONENT_DELETE_OLD_IMPLANT (1<<2) - -/// Called on implants, after a successful implantation: (mob/living/target, mob/user, silent, force) -////#define COMSIG_IMPLANT_IMPLANTED "implant_implanted" /// Called on implants, after an implant has been removed: (mob/living/source, silent, special) +// todo: this doesn't work, and probably shouldn't be here! #define COMSIG_IMPLANT_REMOVED "implant_removed" -/// Called as a mindshield is implanted: (mob/user) -////#define COMSIG_PRE_MINDSHIELD_IMPLANT "pre_mindshield_implant" - ///? Did they successfully get mindshielded? - ////#define COMPONENT_MINDSHIELD_PASSED (NONE) - ///? Did they resist the mindshield? - ////#define COMPONENT_MINDSHIELD_RESISTED (1<<0) - -/// Called once a mindshield is implanted: (mob/user) -////#define COMSIG_MINDSHIELD_IMPLANTED "mindshield_implanted" - ///? Are we the reason for deconversion? - ////#define COMPONENT_MINDSHIELD_DECONVERTED (1<<0) - -/// Called on implants being implanted into someone with an uplink implant: (datum/component/uplink) -////#define COMSIG_IMPLANT_EXISTING_UPLINK "implant_uplink_exists" - //? This uses all return values of COMSIG_IMPLANT_OTHER - -//! /obj/item/pda signals -/// Called on pda when the user changes the ringtone: (mob/living/user, new_ringtone) -////#define COMSIG_PDA_CHANGE_RINGTONE "pda_change_ringtone" - ////#define COMPONENT_STOP_RINGTONE_CHANGE (1<<0) -////#define COMSIG_PDA_CHECK_DETONATE "pda_check_detonate" - ////#define COMPONENT_PDA_NO_DETONATE (1<<0) - -//! /obj/item/radio signals -/// Called from base of /obj/item/radio/proc/set_frequency(): (list/args) -////#define COMSIG_RADIO_NEW_FREQUENCY "radio_new_frequency" - -//! /obj/item/pen signals - -/// Called after rotation in /obj/item/pen/attack_self(): (rotation, mob/living/carbon/user) -////#define COMSIG_PEN_ROTATED "pen_rotated" - -//! /obj/item/gun signals -/// Called in /obj/item/gun/process_fire (src, target, params, zone_override) -////#define COMSIG_MOB_FIRED_GUN "mob_fired_gun" -/// Called in /obj/item/gun/process_fire (user, target, params, zone_override) -////#define COMSIG_GUN_FIRED "gun_fired" -/// Called in /obj/item/gun/process_chamber (src) -////#define COMSIG_GUN_CHAMBER_PROCESSED "gun_chamber_processed" -/// Called in /obj/item/gun/ballistic/process_chamber (casing) -////#define COMSIG_CASING_EJECTED "casing_ejected" - -//! /obj/effect/proc_holder/spell signals -/// Called from /obj/effect/proc_holder/spell/cast_check (src) -////#define COMSIG_MOB_PRE_CAST_SPELL "mob_cast_spell" - ///? Return to cancel the cast from beginning. - ////#define COMPONENT_CANCEL_SPELL (1<<0) -/// Called from /obj/effect/proc_holder/spell/perform (src) -////#define COMSIG_MOB_CAST_SPELL "mob_cast_spell" - -//! /obj/item/camera signals -/// From /obj/item/camera/captureimage(): (atom/target, mob/user) -////#define COMSIG_CAMERA_IMAGE_CAPTURED "camera_image_captured" - -//! /obj/item/grenade signals -/// Called in /obj/item/gun/process_fire (user, target, params, zone_override) -////#define COMSIG_GRENADE_DETONATE "grenade_prime" -/// Called from many places in grenade code (armed_by, nade, det_time, delayoverride) -////#define COMSIG_MOB_GRENADE_ARMED "grenade_mob_armed" -/// Called in /obj/item/gun/process_fire (user, target, params, zone_override) -////#define COMSIG_GRENADE_ARMED "grenade_armed" - -//! /obj/projectile signals (sent to the firer) -/// From base of /obj/projectile/proc/on_hit(), like COMSIG_PROJECTILE_ON_HIT but on the projectile itself and with the hit limb (if any): (atom/movable/firer, atom/target, Angle, hit_limb) -////#define COMSIG_PROJECTILE_SELF_ON_HIT "projectile_self_on_hit" -/// From base of /obj/projectile/proc/on_hit(): (atom/movable/firer, atom/target, Angle) -////#define COMSIG_PROJECTILE_ON_HIT "projectile_on_hit" -/// From base of /obj/projectile/proc/fire(): (obj/projectile, atom/original_target) -////#define COMSIG_PROJECTILE_BEFORE_FIRE "projectile_before_fire" -/// From the base of /obj/projectile/proc/fire(): () -////#define COMSIG_PROJECTILE_FIRE "projectile_fire" -/// Sent to targets during the process_hit proc of projectiles -////#define COMSIG_PROJECTILE_PREHIT "com_proj_prehit" -/// Sent to targets during the process_hit proc of projectiles -////#define COMSIG_PROJECTILE_RANGE_OUT "projectile_range_out" -/// From [/obj/item/proc/tryEmbed] sent when trying to force an embed (mainly for projectiles and eating glass) -////#define COMSIG_EMBED_TRY_FORCE "item_try_embed" - ////#define COMPONENT_EMBED_SUCCESS (1<<1) - -/// Sent to targets during the process_hit proc of projectiles -////#define COMSIG_PELLET_CLOUD_INIT "pellet_cloud_init" - -//! /obj/vehicle/sealed/mecha signals -/// Sent from mecha action buttons to the mecha they're linked to -////#define COMSIG_MECHA_ACTION_TRIGGER "mecha_action_activate" - -/// Sent from clicking while you have no equipment selected. Sent before cooldown and adjacency checks, so you can use this for infinite range things if you want. -////#define COMSIG_MECHA_MELEE_CLICK "mecha_action_melee_click" - ///? Prevents click from happening. - ////#define COMPONENT_CANCEL_MELEE_CLICK (1<<0) -/// Sent from clicking while you have equipment selected. -////#define COMSIG_MECHA_EQUIPMENT_CLICK "mecha_action_equipment_click" - ///? Prevents click from happening. - ////#define COMPONENT_CANCEL_EQUIPMENT_CLICK (1<<0) - +// todo: these two shouldn't be here #define COMSIG_ITEM_ATTACK "item_attack" /// From base of obj/item/attack_self(): (/mob) #define COMSIG_ITEM_ATTACK_SELF "item_attack_self" -/// From base of obj/item/attack_self_secondary(): (/mob) -////#define COMSIG_ITEM_ATTACK_SELF_SECONDARY "item_attack_self_secondary" -/// From base of obj/item/attack_atom(): (/obj, /mob) -////#define COMSIG_ITEM_ATTACK_OBJ "item_attack_object" -/// From base of obj/item/pre_attack(): (atom/target, mob/user, params) -////#define COMSIG_ITEM_PRE_ATTACK "item_pre_attack" -/// From base of [/obj/item/proc/pre_attack_secondary()]: (atom/target, mob/user, params) -////#define COMSIG_ITEM_PRE_ATTACK_SECONDARY "item_pre_attack_secondary" - ////#define COMPONENT_SECONDARY_CANCEL_ATTACK_CHAIN (1<<0) - ////#define COMPONENT_SECONDARY_CONTINUE_ATTACK_CHAIN (1<<1) - ////#define COMPONENT_SECONDARY_CALL_NORMAL_ATTACK_CHAIN (1<<2) -/// From base of [/obj/item/proc/attack_secondary()]: (atom/target, mob/user, params) -////#define COMSIG_ITEM_ATTACK_SECONDARY "item_pre_attack_secondary" -/// From base of obj/item/afterattack(atom/target, mob/user, clickchain_flags, list/params) -////#define COMSIG_ITEM_AFTERATTACK "item_afterattack" -/// From base of obj/item/afterattack_secondary(): (atom/target, mob/user, proximity_flag, click_parameters) -////#define COMSIG_ITEM_AFTERATTACK_SECONDARY "item_afterattack_secondary" -/// From base of obj/item/attack_qdeleted(): (atom/target, mob/user, params) -////#define COMSIG_ITEM_ATTACK_QDELETED "item_attack_qdeleted" - -/// From /obj/item/assembly/proc/pulsed() -////#define COMSIG_ASSEMBLY_PULSED "assembly_pulsed" - -/// From base of /obj/item/mmi/set_brainmob(): (mob/living/brain/new_brainmob) -////#define COMSIG_MMI_SET_BRAINMOB "mmi_set_brainmob" - -/// From base of /obj/item/slimepotion/speed/afterattack(atom/target, mob/user, clickchain_flags, list/params) -////#define COMSIG_SPEED_POTION_APPLIED "speed_potion" - ////#define SPEED_POTION_STOP (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_turf.dm b/code/__DEFINES/dcs/signals/signals_turf.dm index 29cc6fdd01e1..207e2f83ec58 100644 --- a/code/__DEFINES/dcs/signals/signals_turf.dm +++ b/code/__DEFINES/dcs/signals/signals_turf.dm @@ -8,20 +8,7 @@ /// `post_change_callbacks` is a list that signal handlers can mutate to append `/datum/callback` objects. /// They will be called with the new turf after the turf has changed. #define COMSIG_TURF_CHANGE "turf_change" -/// From base of atom/has_gravity(): (atom/asker, list/forced_gravities) -////#define COMSIG_TURF_HAS_GRAVITY "turf_has_gravity" /// From base of turf/multiz_turf_del(): (turf/source, direction) #define COMSIG_TURF_MULTIZ_DEL "turf_multiz_del" /// From base of turf/multiz_turf_new: (turf/source, direction) #define COMSIG_TURF_MULTIZ_NEW "turf_multiz_new" -/// From base of turf/proc/onShuttleMove(): (turf/new_turf) -////#define COMSIG_TURF_ON_SHUTTLE_MOVE "turf_on_shuttle_move" -/// From /turf/open/temperature_expose(datum/gas_mixture/air, exposed_temperature) -////#define COMSIG_TURF_EXPOSE "turf_expose" -/// From /turf/proc/immediate_calculate_adjacent_turfs() -////#define COMSIG_TURF_CALCULATED_ADJACENT_ATMOS "turf_calculated_adjacent_atmos" -/// Called when an industrial lift enters this turf -////#define COMSIG_TURF_INDUSTRIAL_LIFT_ENTER "turf_industrial_life_enter" - -/// From /datum/element/decal/Detach(): (description, cleanable, directional, mutable_appearance/pic) -////#define COMSIG_TURF_DECAL_DETACHED "turf_decal_detached" diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index f5c83ecf306f..34d76cb7f739 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -14,24 +14,44 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s //define THIS_PROC_TYPE_WEIRD_STR "[THIS_PROC_TYPE_WEIRD]" //Included for completeness //define THIS_PROC_TYPE_WEIRD_STR_WITH_ARGS "[THIS_PROC_TYPE_WEIRD]([args.Join(",")])" //Ditto -#define NOT_IMPLEMENTED "NOT_IMPLEMENTED" +/// Invisibility constants. These should only be used for TRUE invisibility, AKA nothing living players touch +/// +/// * Invisibility is different from just hiding something via plane masters. +/// * They're more akin to images, where we actively block the client from seeing it if they don't have it +/// * They're not as secure as images, because invisibility is still a client-side check +/// * Invisibility completely hides objects from view() queries, verb queries, and more. +/// +/// That said, this is nowhere near as granular and arbitrarily controllable as planes, so, +/// the only things we use invisibility on are +/// +/// * Lighting (TODO: should we remove this? we use planes now) +/// * Fullscreens (piggybacks off lighting) +/// * Observers / Ghosts (we don't want them to be interactable at all) +/// * Underfloor objects (we don't want them to be interactable at all) +/// * Abstract objects (we don't want them to be interactable at all) -// Invisibility constants. These should only be used for TRUE invisibility, AKA nothing living players touch #define INVISIBILITY_LIGHTING 20 #define INVISIBILITY_LEVEL_ONE 35 #define INVISIBILITY_LEVEL_TWO 45 #define INVISIBILITY_OBSERVER 60 #define INVISIBILITY_EYE 61 -#define SEE_INVISIBLE_LIVING 25 +#define SEE_INVISIBLE_MINIMUM 5 #define SEE_INVISIBLE_NOLIGHTING 15 +#define SEE_INVISIBLE_LIVING 25 #define SEE_INVISIBLE_LEVEL_ONE 35 #define SEE_INVISIBLE_LEVEL_TWO 45 #define SEE_INVISIBLE_CULT 60 #define SEE_INVISIBLE_OBSERVER 61 -#define SEE_INVISIBLE_MINIMUM 5 +/// Underfloor things are by default, this invisibility. +#define INVISIBILITY_UNDERFLOOR 90 +/// Maximum invisibility without being abstract. #define INVISIBILITY_MAXIMUM 100 +/// At this invisibility, some weird things happen. +/// +/// * The thing basically isn't a real object anymore for some contexts. +/// * view(), range(), etc, won't pick the atom up. #define INVISIBILITY_ABSTRACT 101 /// Pseudo-Invis, like Ninja, Ling, Etc. @@ -378,10 +398,6 @@ GLOBAL_LIST_EMPTY(##LIST_NAME);\ #define MR_UNSURE 1 #define MR_DEAD 2 -//Holy Weapon defines from Main. Lists null rod weapons and classifies them as HOLY. -#define HOLY_WEAPONS /obj/item/nullrod -#define HOLY_ICONS /obj/item/godfig - // Used by radios to indicate that they have sent a message via something other than subspace #define RADIO_CONNECTION_FAIL 0 #define RADIO_CONNECTION_NON_SUBSPACE 1 diff --git a/code/__DEFINES/objects/objects.dm b/code/__DEFINES/objects/objects.dm new file mode 100644 index 000000000000..5a0c9709e8b7 --- /dev/null +++ b/code/__DEFINES/objects/objects.dm @@ -0,0 +1,34 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +//* /obj/var/hides_underfloor + +/// do not change these willy-nilly, these are strings for the map editor. + +/// just Don't +#define OBJ_UNDERFLOOR_DISABLED "disabled" +/// never underfloor, even if floor isn't plating +#define OBJ_UNDERFLOOR_NEVER "never" +/// always underfloor, as long as floor isn't plating +#define OBJ_UNDERFLOOR_ALWAYS "always" +/// automatic +/// +/// * gets set to UNDERFLOOR_NONE if we were made while the floor is intact +/// * gets set to UNDERFLOOR_ALWAYS if we were made while the floor isn't intact +#define OBJ_UNDERFLOOR_IF_COVERED "initially-covered" +/// automatic +/// +/// * DEPENDS_ON_CREATION, but always underfloor if made in mapload +#define OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP "initially-underfloor" + +DEFINE_ENUM("obj_hides_underfloor", list( + /obj = list( + "hides_underfloor", + ), +), list( + "Disabled" = OBJ_UNDERFLOOR_DISABLED, + "Never" = OBJ_UNDERFLOOR_NEVER, + "Always" = OBJ_UNDERFLOOR_ALWAYS, + "If Covered (Init Only)" = OBJ_UNDERFLOOR_IF_COVERED, + "If Created On Floor (Init Only)" = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP, +)) diff --git a/code/datums/components/simple_access.dm b/code/datums/components/simple_access.dm index 7a5209a1d603..4410622cddc4 100644 --- a/code/datums/components/simple_access.dm +++ b/code/datums/components/simple_access.dm @@ -1,3 +1,4 @@ +// todo: this doesn't work ///This component allows us to give a mob access without giving them an ID card. /datum/component/simple_access dupe_mode = COMPONENT_DUPE_ALLOWED diff --git a/code/game/area/area.dm b/code/game/area/area.dm index ecec56102f38..23ff60980ae0 100644 --- a/code/game/area/area.dm +++ b/code/game/area/area.dm @@ -4,7 +4,6 @@ * A grouping of tiles into a logical space, mostly used by map editors */ /area - level = null name = "Unknown" icon = 'icons/turf/areas.dmi' icon_state = "unknown" diff --git a/code/game/atoms/atom.dm b/code/game/atoms/atom.dm index 488b97298fb4..395ad0d6ef6e 100644 --- a/code/game/atoms/atom.dm +++ b/code/game/atoms/atom.dm @@ -21,7 +21,6 @@ var/pass_flags_self = NONE //? Unsorted / Legacy - var/level = 2 /// Used for changing icon states for different base sprites. var/base_icon_state /// Holder for the last time we have been bumped. @@ -928,8 +927,10 @@ /** * called when we're hit by a radiation wave * - * this is only called on the top level atoms directly on a turf - * for nested atoms, you need /datum/component/radiation_listener + * * this is only called directly on turfs + * * this is also called directly if an outgoing pulse is shielded by something, so it hits everything inside it instead + * * for any other atom on turf, you need /datum/component/radiation_listener + * * /datum/element/z_radiation_listener is needed if you want to listen to z-wide and other high-gain rad pulses */ /atom/proc/rad_act(strength, datum/radiation_wave/wave) SHOULD_CALL_PARENT(TRUE) diff --git a/code/game/atoms/defense.dm b/code/game/atoms/defense.dm index cb37faf013e8..6fbf61c69c72 100644 --- a/code/game/atoms/defense.dm +++ b/code/game/atoms/defense.dm @@ -4,6 +4,8 @@ //! Welcome to the atom damage module. //! Enjoy the bitfield and #define vomit. +// todo: everything needs comsigs comsigs comsigs + //? Hooks / External /** @@ -91,6 +93,7 @@ //? Hitsound API // todo: stuff like metal limbs punching walls making special sounds +// todo: this probably needs a rework /** * gets hitsound override. return a value to be fed into playsound, or null for default. diff --git a/code/game/machinery/beacon.dm b/code/game/machinery/beacon.dm index b5e702642790..6f4eae330a94 100644 --- a/code/game/machinery/beacon.dm +++ b/code/game/machinery/beacon.dm @@ -3,7 +3,8 @@ icon_state = "floor_beaconf" name = "Bluespace Gigabeacon" desc = "A device that draws power from bluespace and creates a permanent tracking beacon." - level = 1 // underfloor + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor_update_icon = TRUE layer = UNDER_JUNK_LAYER anchored = TRUE use_power = USE_POWER_IDLE @@ -17,26 +18,20 @@ Beacon.invisibility = INVISIBILITY_MAXIMUM Beacon.loc = T - hide(!T.is_plating()) - /obj/machinery/bluespace_beacon/Destroy() if(Beacon) qdel(Beacon) ..() -// update the invisibility and icon -/obj/machinery/bluespace_beacon/hide(intact) - invisibility = intact ? 101 : 0 - update_icon() - // update the icon_state -/obj/machinery/bluespace_beacon/update_icon() +/obj/machinery/bluespace_beacon/update_icon_state() var/state = "floor_beacon" if(invisibility) icon_state = "[state]f" else icon_state = "[state]" + return ..() /obj/machinery/bluespace_beacon/process(delta_time) if(!Beacon) diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 43ceb5a84901..26fe2224563b 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -13,6 +13,8 @@ anchored = TRUE use_power = USE_POWER_IDLE idle_power_usage = 50 + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor_update_icon = TRUE /// Radio frequency. var/freq = 1449 @@ -35,7 +37,6 @@ /obj/machinery/magnetic_module/Initialize(mapload, newdir) . = ..() var/turf/T = loc - hide(!T.is_plating()) center = T spawn(10) // must wait for map loading to finish @@ -45,13 +46,9 @@ spawn() magnetic_process() -// update the invisibility and icon -/obj/machinery/magnetic_module/hide(intact) - invisibility = intact ? 101 : 0 - updateicon() - // update the icon_state -/obj/machinery/magnetic_module/proc/updateicon() +/obj/machinery/magnetic_module/update_icon() + . = ..() var/state="floor_magnet" var/onstate="" if(!on) @@ -162,7 +159,7 @@ qdel(src) */ - updateicon() + update_icon() /obj/machinery/magnetic_module/proc/magnetic_process() // proc that actually does the pull_active if(pull_active) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 4d181a2c78d9..a889e28216b4 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -9,6 +9,8 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w name = "navigation beacon" desc = "A beacon used for bot navigation." plane = TURF_PLANE + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor_update_icon = TRUE anchored = TRUE /// TRUE if cover is open. var/open = FALSE @@ -30,8 +32,6 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w if(freq) warning("[src] at [x],[y],[z] has deprecated var freq=[freq]. Replace it with proper type.") - var/turf/T = loc - hide(!T.is_plating()) navbeacons += src // set the transponder codes assoc list from codes_txt @@ -54,17 +54,8 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w else codes[e] = "1" -/obj/machinery/navbeacon/hides_under_flooring() - return 1 - -// called when turf state changes -// hide the object if turf is intact -/obj/machinery/navbeacon/hide(var/intact) - invisibility = intact ? 101 : 0 - updateicon() - // update the icon_state -/obj/machinery/navbeacon/proc/updateicon() +/obj/machinery/navbeacon/update_icon_state() var/state="navbeacon[open]" if(invisibility) @@ -72,6 +63,7 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w // in case revealed by T-scanner else icon_state = "[state]" + return ..() /obj/machinery/navbeacon/attackby(obj/item/I, mob/user) var/turf/T = loc @@ -83,7 +75,7 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w playsound(src, I.tool_sound, 50, 1) user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") - updateicon() + update_icon() else if(I.GetID()) if(open) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index d63fd7c04691..478ccd977a13 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -14,7 +14,6 @@ Buildable meters icon_state = "simple" item_state = "buildpipe" w_class = WEIGHT_CLASS_TINY - level = 2 var/piping_layer = PIPING_LAYER_DEFAULT var/dispenser_class // Tells the dispenser what orientations we support, so RPD can show previews. diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index e217dc918c61..9fca2ae5cf86 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -45,17 +45,10 @@ GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/radio/beacon) desc = "A beacon used by a teleporter. This one appears to be bolted to the ground." anchored = TRUE w_class = WEIGHT_CLASS_HUGE - //randpixel = 0 + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP var/repair_fail_chance = 35 - -/obj/item/radio/beacon/anchored/Initialize(mapload) - . = ..() - var/turf/T = get_turf(src) - hide(hides_under_flooring() && !T.is_plating()) - - /obj/item/radio/beacon/anchored/attackby(obj/item/I, mob/living/user) ..() if(istype(I, /obj/item/stack/nanopaste)) diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index 0ae210b3278a..94d875c003a6 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -110,14 +110,18 @@ . = list() var/turf/center = get_turf(src.loc) - if(!center) return + if(!center) + return + // the reason we don't just obj in range is because some things + // will INVISIBILITY_ABSTRACt while hiding underfloor, + // so normal range won't pick it up for(var/turf/T in range(scan_range, center)) - if(!!T.is_plating()) + if(!T.hides_underfloor_objects()) continue for(var/obj/O in T.contents) - if(O.level != 1) + if(O.hides_underfloor == OBJ_UNDERFLOOR_NEVER) continue if(!O.invisibility) continue //if it's already visible don't need an overlay for it diff --git a/code/game/objects/items/godfigures.dm b/code/game/objects/items/godfigures.dm index c2e1f7f31049..9bf1714db7cd 100644 --- a/code/game/objects/items/godfigures.dm +++ b/code/game/objects/items/godfigures.dm @@ -18,7 +18,7 @@ /obj/item/godfig/proc/resprite_figure(mob/living/L) var/obj/item/holy_icon - var/list/holy_icons_list = subtypesof(/obj/item/godfig) + list(HOLY_ICONS) + var/list/holy_icons_list = typesof(/obj/item/godfig) var/list/display_names = list() var/list/holy_icons = list() for(var/G in holy_icons_list) diff --git a/code/game/objects/items/id_cards/cards.dm b/code/game/objects/items/id_cards/cards.dm index e6bd11dd4d72..c5a3467204c9 100644 --- a/code/game/objects/items/id_cards/cards.dm +++ b/code/game/objects/items/id_cards/cards.dm @@ -71,12 +71,10 @@ name = "\proper the coordinates to clown planet" icon_state = "rainbow" item_state = "card-id" - level = 2 desc = "This card contains coordinates to the fabled Clown Planet. Handle with care." function = "teleporter" data = "Clown Land" - /// FLUFF PERMIT /obj/item/card_fluff diff --git a/code/game/objects/items/weapons/nullrod.dm b/code/game/objects/items/weapons/nullrod.dm index 4186a7a7d889..b70acf30e7b3 100644 --- a/code/game/objects/items/weapons/nullrod.dm +++ b/code/game/objects/items/weapons/nullrod.dm @@ -57,7 +57,7 @@ if(GLOB.holy_weapon_type) return var/obj/item/holy_weapon - var/list/holy_weapons_list = subtypesof(/obj/item/nullrod) + list(HOLY_WEAPONS) + var/list/holy_weapons_list = typesof(/obj/item/nullrod) var/list/display_names = list() var/list/nullrod_icons = list() for(var/V in holy_weapons_list) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 9cc2b6640501..8f7c4d2d45a1 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -127,6 +127,38 @@ /// storage system var/datum/object_system/storage/obj_storage + //* Underfloor *// + + /// do we hide underfloor? + /// + /// * uses OBJ_UNDERFLOOR_* defines + /// * gets set_underfloor(is_underfloor = TRUE | FALSE) called on init or turf init + /// * we are assumed to not be underfloor when we are first made + /// * if you want a var to track this make one yourself; we don't have one for memory concerns. + var/hides_underfloor = OBJ_UNDERFLOOR_DISABLED + /// call update icon after update_hiding_underfloor() + /// + /// * update_icon() called regardless of [hides_underfloor_defaulting] if TRUE + var/hides_underfloor_update_icon = FALSE + /// are we fully INVISIBILITY_ABSTRACT while hidden? + /// + /// this has implications. + /// * range(), view(), and others will not target things that are abstract-invisible + /// * verbs don't work at all (not a bad thing necessarily) + /// * basically this thing acts like it's not there + /// + /// this is sometimes desired for things like mostly impactless objects for performance, + /// but is not always desireable + /// + /// as an example, if the codebase's t-ray scanners use range(), you're not going to get anything + /// that is abstract-invisible on a scan. + /// + /// * if this is FALSE, we use [INVISIBILITY_UNDERFLOOR] + /// * automatic invisibility updates require [hides_underfloor_defaulting] + var/hides_underfloor_invisibility_abstract = FALSE + /// perform default behavior if hiding underfloor? + var/hides_underfloor_defaulting = TRUE + //? misc / legacy /// Set when a player renames a renamable object. var/renamed_by_player = FALSE @@ -183,6 +215,8 @@ // init material parts only if it wasn't initialized already if(!(obj_flags & OBJ_MATERIAL_INITIALIZED)) init_material_parts() + if(hides_underfloor != OBJ_UNDERFLOOR_NEVER) + initialize_hiding_underfloor(mapload) if (set_obj_flags) var/flagslist = splittext(set_obj_flags,";") var/list/string_to_objflag = GLOB.bitfields["obj_flags"] @@ -277,12 +311,6 @@ if(istype(M) && M.client && M.machine == src) src.attack_self(M) -/obj/proc/hide(h) - return - -/obj/proc/hides_under_flooring() - return 0 - /obj/proc/hear_talk(mob/M as mob, text, verb, datum/language/speaking) if(talking_atom) talking_atom.catchMessage(text, M) @@ -616,14 +644,6 @@ for(var/atom/movable/inside in obj_storage.contents()) inside.emp_act(severity) -//* Hiding / Underfloor *// - -/obj/proc/is_hidden_underfloor() - return FALSE - -/obj/proc/should_hide_underfloor() - return FALSE - //* Inventory *// /obj/AllowDrop() @@ -880,3 +900,88 @@ otherwise_self = SPAN_NOTICE("You remove the cell from [src]."), ) return CLICKCHAIN_DID_SOMETHING | CLICKCHAIN_DO_NOT_PROPAGATE + +//* Underfloor *// + +/** + * sets our hides_underfloor + */ +/obj/proc/set_hides_underfloor(new_value, mapload) + switch(new_value) + if(OBJ_UNDERFLOOR_IF_COVERED, OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP) + var/turf/where_we_are = loc + if(istype(where_we_are) && where_we_are.hides_underfloor_objects()) + new_value = OBJ_UNDERFLOOR_ALWAYS + else + new_value = OBJ_UNDERFLOOR_NEVER + hides_underfloor = new_value + reconsider_hiding_underfloor() + +/** + * called to inform us we should / shouldn't be underfloor + * + * * this must be idempotent. we can get called at will by reconsider_hiding_underfloor() as we do not track if we are currently underfloor. + * * we are assumed to not be underfloor when we are first made + * * that means this is called during Initialize() if and only if we need to be hiding underfloor + */ +/obj/proc/update_hiding_underfloor(new_value) + if(hides_underfloor_defaulting) + invisibility = new_value? (hides_underfloor_invisibility_abstract? INVISIBILITY_ABSTRACT : INVISIBILITY_UNDERFLOOR) : 0 + if(hides_underfloor_update_icon) + update_icon() + return TRUE + +/** + * **guesses** if we're hidden underfloor + * this is not the actual state! + */ +/obj/proc/is_probably_hidden_underfloor() + switch(hides_underfloor) + if(OBJ_UNDERFLOOR_ALWAYS) + var/turf/where_we_are = loc + return where_we_are.hides_underfloor_objects() + if(OBJ_UNDERFLOOR_NEVER) + return FALSE + return FALSE + +/** + * called at init + */ +/obj/proc/initialize_hiding_underfloor(mapload) + switch(hides_underfloor) + if(OBJ_UNDERFLOOR_IF_COVERED, OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP) + var/turf/where_we_are = loc + var/hide_anyways = (hides_underfloor == OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP) && mapload + if(istype(where_we_are) && (hide_anyways || where_we_are.hides_underfloor_objects())) + hides_underfloor = OBJ_UNDERFLOOR_ALWAYS + if(!mapload) + update_hiding_underfloor(TRUE) + else + hides_underfloor = OBJ_UNDERFLOOR_NEVER + if(OBJ_UNDERFLOOR_ALWAYS) + var/turf/where_we_are = loc + if(!mapload && istype(where_we_are) && where_we_are.hides_underfloor_objects()) + update_hiding_underfloor(TRUE) + +/** + * called to re-call update_hiding_underfloor + */ +/obj/proc/reconsider_hiding_underfloor() + var/turf/where_we_are = loc + var/turf_will_cover = istype(where_we_are) && where_we_are.hides_underfloor_objects() + switch(hides_underfloor) + if(OBJ_UNDERFLOOR_ALWAYS) + update_hiding_underfloor(turf_will_cover) + if(OBJ_UNDERFLOOR_NEVER) + update_hiding_underfloor(FALSE) + else + // we're way beyond initialize, so.. + hides_underfloor = OBJ_UNDERFLOOR_DISABLED + +//* VV hooks *// + +/obj/vv_edit_var(var_name, var_value, mass_edit, raw_edit) + . = ..() + switch(var_name) + if(NAMEOF(src, hides_underfloor)) + set_hides_underfloor(var_value) diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 8b1d00b6e755..bd806f04746a 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -169,19 +169,10 @@ FLOOR SAFES name = "floor safe" icon_state = "floorsafe" density = 0 - level = 1 //underfloor plane = TURF_PLANE layer = BELOW_TURF_LAYER + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP /obj/structure/safe/floor/Initialize(mapload) . = ..() - var/turf/T = loc - if(istype(T) && !T.is_plating()) - hide(1) update_icon() - -/obj/structure/safe/floor/hide(var/intact) - invisibility = intact ? 101 : 0 - -/obj/structure/safe/floor/hides_under_flooring() - return 1 diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index c0a849a6e404..8c2052ee6146 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -14,8 +14,6 @@ var/exit_delay = 2 var/enter_delay = 1 - level = 2 - // alldirs in global.dm is the same list of directions, but since // the specific order matters to get a usable icon_state, it is // copied here so that, in the unlikely case that alldirs is changed, @@ -30,7 +28,6 @@ //A variant that will can be hidden underneath tiles similiar to pipes and such /obj/structure/transit_tube/hidden - level = 1 plane = TURF_PLANE layer = BELOW_TURF_LAYER @@ -83,8 +80,6 @@ if(tube_dirs == null) init_dirs() - var/turf/T = loc - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/structure/transit_tube/Bumped(mob/AM as mob|obj) diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 286e072022f3..e31a3e24bd51 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -435,7 +435,7 @@ GLOBAL_LIST_INIT(multiz_hole_baseturfs, typecacheof(list( //If you modify this function, ensure it works correctly with lateloaded map templates. /turf/proc/AfterChange(flags, oldType) //called after a turf has been replaced in ChangeTurf() - levelupdate() + update_underfloor_objects() if (above) above.update_mimic() diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index 0da1a9cd3dfe..24fdc0cf95e6 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -27,8 +27,6 @@ /turf/simulated/Initialize(mapload) . = ..() - if(mapload) - levelupdate() if(outdoors) SSplanets.addTurf(src) diff --git a/code/game/turfs/simulated/floor/floor.dm b/code/game/turfs/simulated/floor/floor.dm index 49495574537c..4bce892e52db 100644 --- a/code/game/turfs/simulated/floor/floor.dm +++ b/code/game/turfs/simulated/floor/floor.dm @@ -43,6 +43,9 @@ /turf/simulated/floor/is_plating() return !flooring +/turf/simulated/floor/hides_underfloor_objects() + return flooring + /turf/simulated/floor/Initialize(mapload, floortype) . = ..() if(!floortype && initial_flooring) @@ -51,10 +54,12 @@ set_flooring(get_flooring_data(floortype), TRUE) else footstep_sounds = base_footstep_sounds + update_underfloor_objects() if(mapload && can_dirty && can_start_dirty) if(prob(dirty_prob)) dirt += rand(50,100) update_dirt() //5% chance to start with dirt on a floor tile- give the janitor something to do + update_layer() /turf/simulated/proc/make_outdoors() outdoors = TRUE @@ -81,6 +86,8 @@ /turf/simulated/floor/proc/set_flooring(singleton/flooring/newflooring, init) if(flooring == newflooring) + if(init) + update_underfloor_objects() return make_plating(null, TRUE, TRUE) flooring = newflooring @@ -105,7 +112,8 @@ if(!init) QUEUE_SMOOTH(src) QUEUE_SMOOTH_NEIGHBORS(src) - levelupdate() + update_underfloor_objects() + update_layer() //This proc will set floor_type to null and the update_icon() proc will then change the icon_state of the turf //This proc auto corrects the grass tiles' siding. @@ -133,17 +141,14 @@ footstep_sounds = base_footstep_sounds QUEUE_SMOOTH(src) QUEUE_SMOOTH_NEIGHBORS(src) - levelupdate() + update_underfloor_objects() + update_layer() broken = null burnt = null flooring_override = null - -/turf/simulated/floor/levelupdate() - for(var/obj/O in src) - O.hide(O.hides_under_flooring() && src.flooring) - +/turf/simulated/floor/proc/update_layer() if(flooring) layer = TURF_LAYER else diff --git a/code/game/turfs/simulated/floor/floor_static.dm b/code/game/turfs/simulated/floor/floor_static.dm deleted file mode 100644 index 1603b448fdce..000000000000 --- a/code/game/turfs/simulated/floor/floor_static.dm +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This type of flooring cannot be altered short of being destroyed and rebuilt. - * Use this to bypass the flooring system entirely ie. event areas, holodeck, etc. - */ -/turf/simulated/floor/fixed - name = "floor" - icon = 'icons/turf/flooring/tiles.dmi' - icon_state = "steel" - initial_flooring = null - is_outside = OUTSIDE_AREA - -/turf/simulated/floor/fixed/attackby(var/obj/item/C, var/mob/user) - if(istype(C, /obj/item/stack) && !istype(C, /obj/item/stack/cable_coil)) - return - return ..() - -/turf/simulated/floor/fixed/update_icon() - return - -/turf/simulated/floor/fixed/is_plating() - return FALSE - -/turf/simulated/floor/fixed/set_flooring() - return diff --git a/code/game/turfs/simulated/wall/wall.dm b/code/game/turfs/simulated/wall/wall.dm index 4c0d36694403..d51f9cd78b8f 100644 --- a/code/game/turfs/simulated/wall/wall.dm +++ b/code/game/turfs/simulated/wall/wall.dm @@ -87,11 +87,15 @@ clear_plants() return ..() -// Walls always hide the stuff below them. -/turf/simulated/wall/levelupdate() - for(var/obj/O in src) - O.hide(1) - +/// walls **do not** hide things underfloor +/// why, even though it makes sense? +/// because balance-wise we don't want to make you have to tear down +/// walls just to run pipes through +/// +/// if there's a way to do it later then we can set this back to yes but for now, hell no. +/// do not change this without permission ~silicons +/turf/simulated/wall/hides_underfloor_objects() + return FALSE /turf/simulated/wall/proc/clear_plants() for(var/obj/effect/overlay/wallrot/WR in src) diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index a06f652ce77f..88fa14d618b3 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -84,10 +84,11 @@ /turf/space/is_open() return TRUE -// Override for space turfs, since they should never hide anything -/turf/space/levelupdate() - for(var/obj/O in src) - O.hide(0) +/turf/space/is_plating() + return FALSE + +/turf/space/hides_underfloor_objects() + return FALSE /turf/space/is_solid_structure() return locate(/obj/structure/lattice, src) // Counts as solid structure if it has a lattice diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 5239b08b647b..d8c34019b0ee 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -6,7 +6,6 @@ layer = TURF_LAYER plane = TURF_PLANE luminosity = 1 - level = 1 //* Atmospherics /** @@ -362,10 +361,6 @@ /turf/proc/is_plating() return 0 -/turf/proc/levelupdate() - for(var/obj/O in src) - O.hide(O.hides_under_flooring() && !is_plating()) - /turf/proc/AdjacentTurfs(var/check_blockage = TRUE) . = list() for(var/t in (trange(1,src) - src)) @@ -645,3 +640,31 @@ /turf/proc/update_rad_insulation() rad_insulation_contents = 1 + +//* Underfloor *// + +/** + * returns if we should hide underfloor objects + * + * * override this on child types for speed! + * * if the turf has an is_plating() override, it probably needs an override for this! + * + * @return a truthy value. Do not use this value for anything else; all we care is whether or not it's truthy. + */ +/turf/proc/hides_underfloor_objects() + return !is_plating() + +/** + * tell all objects on us to reconsider their underfloor status + * + * we are always called at mapload by turfs that can hide underfloor objects, + * because objs are configured to only check themselves outside of mapload. + */ +/turf/proc/update_underfloor_objects() + var/we_should_cover = hides_underfloor_objects() + for(var/obj/thing in contents) + if(thing.hides_underfloor == OBJ_UNDERFLOOR_DISABLED) + continue + thing.update_hiding_underfloor( + (thing.hides_underfloor != OBJ_UNDERFLOOR_NEVER) && we_should_cover, + ) diff --git a/code/modules/admin/verbs/SDQL2/wrappers/map.dm b/code/modules/admin/verbs/SDQL2/wrappers/map.dm new file mode 100644 index 000000000000..10eb86995ca1 --- /dev/null +++ b/code/modules/admin/verbs/SDQL2/wrappers/map.dm @@ -0,0 +1,178 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +// * Mapping Functions * // + +/// These are not super optimized, but work fine enough; using them outside of SDQL is allowed, +/// These are usually typechecked, and will silently remove invalid inputs. Keep that in mind. + +//* Deduping *// + +/proc/sdql_list_dedupe(list/L) + . = list() + for(var/thing in L) + . |= thing + +//* Type filtering *// + +/** + * datums only + */ +/proc/sdql_typecache_filter(list/datum/things, list/typecache) + . = list() + for(var/datum/thing as anything in things) + if(!isdatum(thing) || !typecache[thing.type]) + continue + . += thing + +/** + * datums only + */ +/proc/sdql_typecache_filter_exclude(list/datum/things, list/typecache) + . = list() + for(var/datum/thing as anything in things) + if(!isdatum(thing) || typecache[thing.type]) + continue + . += thing + +/** + * datums only + */ +/proc/sdql_type_filter(list/datum/things, type) + . = list() + for(var/datum/thing as anything in things) + if(!istype(thing, type)) + continue + . += thing + +/** + * datums only + */ +/proc/sdql_type_filter_exclude(list/datum/things, type) + . = list() + for(var/datum/thing as anything in things) + if(!isdatum(thing) || istype(thing, type)) + continue + . += thing + +//* Turfs to contents *// + +/** + * this will **not** dupe filter + */ +/proc/sdql_turfs_to_contents(list/turf/turfs, forbid_atom_flags, any_atom_flags, all_atom_flags) + . = list() + // i wish byond would compiler optimize this + // but silicons, for once, will not write a hand-optimized 500 line monstrosity + for(var/turf/T in turfs) + for(var/atom/movable/AM as anything in T.contents) + if(forbid_atom_flags && (AM.atom_flags & forbid_atom_flags)) + continue + if(any_atom_flags && !(AM.atom_flags & any_atom_flags)) + continue + if(all_atom_flags && ((AM.atom_flags & all_atom_flags) != all_atom_flags)) + continue + . += AM + +/** + * ignores NONWORLD and ABSTRACT mobs + */ +/proc/sdql_turfs_to_game_mobs(list/turf/turfs) + . = list() + for(var/turf/T in turfs) + for(var/mob/M in T) + if(M.atom_flags & (ATOM_NONWORLD | ATOM_ABSTRACT)) + continue + . += M + +/** + * ignores NONWORLD and ABSTRACT objs + * + * * warning: /atom/movables may or may not be objs. blame byond. + */ +/proc/sdql_turfs_to_game_objs(list/turf/turfs) + . = list() + for(var/turf/T in turfs) + for(var/obj/O in T) + if(O.atom_flags & (ATOM_NONWORLD | ATOM_ABSTRACT)) + continue + . += O + +//* Movables to loc *// + +/proc/sdql_movable_to_loc(list/atom/movable/movables, allow_dupe = FALSE, allow_null = FALSE) + . = list() + if(allow_dupe) + if(allow_null) + for(var/atom/movable/AM in movables) + . += AM.loc + else + for(var/atom/movable/AM in movables) + if(!AM.loc) + continue + . += AM.loc + else + if(allow_null) + for(var/atom/movable/AM in movables) + . |= AM.loc + else + for(var/atom/movable/AM in movables) + if(!AM.loc) + continue + . |= AM.loc + +/proc/sdql_movable_to_on_turf(list/atom/movable/movables, allow_dupe = FALSE) + . = list() + if(allow_dupe) + for(var/atom/movable/AM in movables) + if(!isturf(AM.loc)) + continue + . += AM.loc + else + for(var/atom/movable/AM in movables) + if(!isturf(AM.loc)) + continue + . |= AM.loc + +/proc/sdql_movable_to_get_turf(list/atom/movable/movables, allow_dupe = FALSE, allow_null = FALSE) + . = list() + for(var/atom/movable/AM in movables) + var/turf/location = get_turf(AM) + if(!allow_null && !location) + continue + if(allow_dupe) + . += location + else + . |= location + +//* spatial query / ranging *// + +/proc/sdql_atoms_to_turfs_in_range(list/atom/movables, radius = 0, allow_dupe = FALSE) + . = list() + var/safety = 100000 // a bit more than 1MB + var/list/results + if(allow_dupe) + for(var/atom/A in movables) + results = range(radius, A) + if(!length(results)) + continue + if(length(.) > safety) + stack_trace("hit safety limit") + return + else + var/list/hashed = list() + for(var/atom/A in movables) + results = range(radius, A) + if(!length(results)) + continue + for(var/turf/T as anything in results) + hashed[T] = TRUE + if(length(hashed) > safety) // a bit more than 3MB due to assoclist... + stack_trace("hit safety limit") + break + // we want a flat list + for(var/key in hashed) + . += key + +// todo: in view +// todo: in dview diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index d48486f4f728..232a6bac8d05 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -18,8 +18,6 @@ name = "Dual Port Air Vent" desc = "Has a valve and pump attached to it. There are two ports." - level = 1 - use_power = USE_POWER_OFF idle_power_usage = 150 //internal circuitry, friction losses and stuff power_rating = 7500 //7500 W ~ 10 HP @@ -27,6 +25,8 @@ pipe_flags = PIPING_ALL_LAYER connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_SUPPLY|CONNECT_TYPE_SCRUBBER //connects to regular, supply and scrubbers pipes + hides_underfloor_underlays = TRUE + var/pump_direction = 1 //0 = siphoning, 1 = releasing var/external_pressure_bound = EXTERNAL_PRESSURE_BOUND @@ -72,7 +72,7 @@ if(!istype(T)) return - if(!T.is_plating() && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe)) + if(T.hides_underfloor_objects() && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe) && node1.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS && node2.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) vent_icon += "h" if(!powered()) @@ -88,7 +88,7 @@ var/turf/T = get_turf(src) if(!istype(T)) return - if(!T.is_plating() && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe)) + if(T.hides_underfloor_objects() && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe) && node1.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS && node2.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) return else if (node1) @@ -100,9 +100,9 @@ else add_underlay(T, node2, dir) -/obj/machinery/atmospherics/component/binary/dp_vent_pump/hide(var/i) +/obj/machinery/atmospherics/component/binary/dp_vent_pump/update_hiding_underfloor(new_value) + . = ..() update_icon() - update_underlays() /obj/machinery/atmospherics/component/binary/dp_vent_pump/process(delta_time) ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/heat_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/heat_pump.dm index a391234ada30..f9fa8cb4c6a7 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/heat_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/heat_pump.dm @@ -5,14 +5,13 @@ name = "heat pump" desc = "A heat pump, used to transfer heat between two pipe systems." - level = 1 - icon = 'icons/atmos/heat_pump.dmi' icon_state = "map_off" construction_type = /obj/item/pipe/directional pipe_state = "pump" connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_AUX + hides_underfloor_underlays = TRUE use_power = USE_POWER_OFF //Internal circuitry, friction losses and stuff @@ -89,9 +88,6 @@ add_underlay(T, node1, turn(dir, 180)) add_underlay(T, node2, dir) -/obj/machinery/atmospherics/component/binary/heat_pump/hide(var/i) - update_underlays() - /obj/machinery/atmospherics/component/binary/heat_pump/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/pen)) var/new_name = input(user, "Please enter the new name for this device:", "New Name") as text|null diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm index a93a66e7a0ec..7cbe517906e0 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm @@ -8,10 +8,10 @@ icon_state = "map" construction_type = /obj/item/pipe/directional pipe_state = "passivegate" - level = 1 name = "pressure regulator" desc = "A one-way air valve that can be used to regulate input or output pressure, and flow rate. Does not require power." + hides_underfloor_underlays = TRUE use_power = USE_POWER_OFF @@ -48,9 +48,6 @@ add_underlay(T, node1, turn(dir, 180)) add_underlay(T, node2, dir) -/obj/machinery/atmospherics/component/binary/passive_gate/hide(var/i) - update_underlays() - /obj/machinery/atmospherics/component/binary/passive_gate/process(delta_time) ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm index 5420eaf6c469..3ad9ead3179c 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm @@ -17,7 +17,7 @@ Thus, the two variables affect pump operation are set in New(): icon_state = "map_off" construction_type = /obj/item/pipe/directional pipe_state = "pump" - level = 1 + hides_underfloor_underlays = TRUE var/base_icon = "pump" name = "gas pump" @@ -116,9 +116,6 @@ Thus, the two variables affect pump operation are set in New(): add_underlay(T, node1, turn(dir, -180), node1?.icon_connect_type) add_underlay(T, node2, dir, node2?.icon_connect_type) -/obj/machinery/atmospherics/component/binary/pump/hide(var/i) - update_underlays() - /obj/machinery/atmospherics/component/binary/pump/process(delta_time) last_power_draw_legacy = 0 last_flow_rate_legacy = 0 diff --git a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm index 3412cd5b5762..b7259bbe650e 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm @@ -6,8 +6,8 @@ name = "manual valve" desc = "A pipe valve" + hides_underfloor_underlays = TRUE - level = 1 dir = SOUTH initialize_directions = SOUTH|NORTH @@ -37,9 +37,6 @@ add_underlay(T, node1, get_dir(src, node1)) add_underlay(T, node2, get_dir(src, node2)) -/obj/machinery/atmospherics/valve/hide(var/i) - update_underlays() - /obj/machinery/atmospherics/valve/init_dir() switch(dir) if(NORTH, SOUTH) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm index 8b0e44b5c435..b5569a6e056f 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm @@ -3,7 +3,6 @@ icon_state = "map_off" construction_type = /obj/item/pipe/directional pipe_state = "volumepump" - level = 1 name = "high power gas pump" desc = "A pump. Has double the power rating of the standard gas pump." diff --git a/code/modules/atmospherics/machinery/components/component.dm b/code/modules/atmospherics/machinery/components/component.dm index 5948abc1c676..bdb0da1c8604 100644 --- a/code/modules/atmospherics/machinery/components/component.dm +++ b/code/modules/atmospherics/machinery/components/component.dm @@ -113,7 +113,7 @@ if(!default_access_interface) return FALSE // todo: refactor silicon interaction - if(interface_require_exposed && is_hidden_underfloor() && !issilicon(user)) + if(interface_require_exposed && is_probably_hidden_underfloor() && !issilicon(user)) return FALSE return ..() @@ -132,7 +132,7 @@ return if(isnull(default_multitool_hijack)) return FALSE - if(hijack_require_exposed && is_hidden_underfloor()) + if(hijack_require_exposed && is_probably_hidden_underfloor()) e_args.chat_feedback(SPAN_WARNING("You can't reach the controls of [src] while it's covered by flooring."), src) return TRUE e_args.visible_feedback( diff --git a/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm b/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm index c628bd8994e8..77818a186c5c 100644 --- a/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm +++ b/code/modules/atmospherics/machinery/components/omni_devices/omni_base.dm @@ -8,7 +8,7 @@ use_power = USE_POWER_IDLE initialize_directions = 0 construction_type = /obj/item/pipe/quaternary - level = 1 + hides_underfloor_underlays = TRUE var/configuring = 0 //var/target_pressure = ONE_ATMOSPHERE //a base type as abstract as this should NOT be making these kinds of assumptions @@ -191,7 +191,7 @@ var/turf/T = get_turf(src) if(!istype(T)) return - if(!T.is_plating() && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 ) + if(T.hides_underfloor_objects() && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) //pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node)) pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "down") else @@ -205,9 +205,6 @@ P.update = 1 update_ports() -/obj/machinery/atmospherics/component/quaternary/hide(var/i) - update_underlays() - /obj/machinery/atmospherics/component/quaternary/proc/update_ports() sort_ports() update_port_icons() diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index 9b4494fb2e4c..60c3472956ea 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -5,7 +5,6 @@ density = FALSE construction_type = /obj/item/pipe/trinary/flippable pipe_state = "filter" - level = 1 use_power = USE_POWER_IDLE idle_power_usage = 150 diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm index 3d096b613794..f5c4892d1606 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm @@ -4,7 +4,6 @@ construction_type = /obj/item/pipe/trinary/flippable pipe_state = "mixer" density = 0 - level = 1 name = "Gas mixer" diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/molar_filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/molar_filter.dm index 9075c54bb305..96095f077568 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/molar_filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/molar_filter.dm @@ -7,7 +7,6 @@ density = FALSE construction_type = /obj/item/pipe/trinary/flippable pipe_state = "filter" - level = 1 use_power = USE_POWER_IDLE idle_power_usage = 150 diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/trinary_base.dm b/code/modules/atmospherics/machinery/components/trinary_devices/trinary_base.dm index ca882a302f7b..bd86cf9d8584 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/trinary_base.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/trinary_base.dm @@ -3,6 +3,7 @@ initialize_directions = SOUTH|NORTH|WEST use_power = USE_POWER_OFF pipe_flags = PIPING_DEFAULT_LAYER_ONLY|PIPING_ONE_PER_TURF + hides_underfloor_underlays = TRUE var/mirrored = FALSE var/tee = FALSE @@ -38,9 +39,6 @@ add_underlay(T, node2, node_connects[2]) add_underlay(T, node3, node_connects[3]) -/obj/machinery/atmospherics/component/trinary/hide(var/i) - update_underlays() - /obj/machinery/atmospherics/component/trinary/power_change() var/old_stat = machine_stat . = ..() diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm b/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm index 7ff6f13fe17a..d9cc0b620281 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/tvalve.dm @@ -7,9 +7,9 @@ name = "manual switching valve" desc = "A pipe valve" - level = 1 dir = SOUTH initialize_directions = SOUTH|NORTH|WEST + hides_underfloor_underlays = TRUE var/state = 0 // 0 = go straight, 1 = go to side @@ -44,9 +44,6 @@ add_underlay(T, node2, node_connects[2]) add_underlay(T, node3, node_connects[3]) -/obj/machinery/atmospherics/tvalve/hide(var/i) - update_underlays() - /obj/machinery/atmospherics/tvalve/init_dir() initialize_directions = get_initialize_directions_trinary(dir, mirrored) diff --git a/code/modules/atmospherics/machinery/components/unary/heat_exchanger.dm b/code/modules/atmospherics/machinery/components/unary/heat_exchanger.dm index 5b0b62bdf6a3..77598c5502bf 100644 --- a/code/modules/atmospherics/machinery/components/unary/heat_exchanger.dm +++ b/code/modules/atmospherics/machinery/components/unary/heat_exchanger.dm @@ -66,8 +66,7 @@ /obj/machinery/atmospherics/component/unary/heat_exchanger/attackby(var/obj/item/W as obj, var/mob/user as mob) if (!W.is_wrench()) return ..() - var/turf/T = src.loc - if (level==1 && isturf(T) && !T.is_plating()) + if(is_probably_hidden_underfloor()) to_chat(user, "You must remove the plating first.") return 1 if(unsafe_pressure()) diff --git a/code/modules/atmospherics/machinery/components/unary/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary/outlet_injector.dm index 22662a5f222a..9e3fccd31a00 100644 --- a/code/modules/atmospherics/machinery/components/unary/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary/outlet_injector.dm @@ -13,6 +13,7 @@ use_power = USE_POWER_OFF idle_power_usage = 150 //internal circuitry, friction losses and stuff power_rating = 15000 //15000 W ~ 20 HP + hides_underfloor_underlays = TRUE var/injecting = 0 @@ -22,8 +23,6 @@ var/id = null var/datum/radio_frequency/radio_connection - level = 1 - /obj/machinery/atmospherics/component/unary/outlet_injector/Initialize(mapload) . = ..() air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //Give it a small reservoir for injecting. Also allows it to have a higher flow rate limit than vent pumps, to differentiate injectors a bit more. @@ -194,9 +193,6 @@ broadcast_status() update_icon() -/obj/machinery/atmospherics/component/unary/outlet_injector/hide(var/i) - update_underlays() - /obj/machinery/atmospherics/component/unary/outlet_injector/attack_hand(mob/user, list/params) ui_interact(user) diff --git a/code/modules/atmospherics/machinery/components/unary/portables_connector.dm b/code/modules/atmospherics/machinery/components/unary/portables_connector.dm index f6a44039e037..525aeffd03eb 100644 --- a/code/modules/atmospherics/machinery/components/unary/portables_connector.dm +++ b/code/modules/atmospherics/machinery/components/unary/portables_connector.dm @@ -10,6 +10,7 @@ construction_type = /obj/item/pipe/directional pipe_state = "connector" pipe_flags = PIPING_DEFAULT_LAYER_ONLY|PIPING_ONE_PER_TURF + hides_underfloor_underlays = TRUE var/obj/machinery/portable_atmospherics/connected_device @@ -19,7 +20,6 @@ var/on = 0 use_power = USE_POWER_OFF - level = 1 /obj/machinery/atmospherics/portables_connector/fuel icon_state = "map_connector-fuel" @@ -49,9 +49,6 @@ return add_underlay(T, node, dir, node?.icon_connect_type) -/obj/machinery/atmospherics/portables_connector/hide(var/i) - update_underlays() - /obj/machinery/atmospherics/portables_connector/process(delta_time) ..() if(!on) diff --git a/code/modules/atmospherics/machinery/components/unary/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary/vent_pump.dm index 29295778aac6..9635f2fcafc8 100644 --- a/code/modules/atmospherics/machinery/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary/vent_pump.dm @@ -16,8 +16,7 @@ default_multitool_hijack = TRUE tgui_interface = "AtmosVentPump" atmos_component_ui_flags = NONE - - level = 1 + hides_underfloor_underlays = TRUE /// registered area var/area/registered_area @@ -101,7 +100,7 @@ if(!istype(T)) return - if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe)) + if(is_probably_hidden_underfloor() && istype(node, /obj/machinery/atmospherics/pipe) && node.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) vent_icon += "h" if(welded) @@ -119,7 +118,7 @@ var/turf/T = get_turf(src) if(!istype(T)) return - if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe)) + if(is_probably_hidden_underfloor() && istype(node, /obj/machinery/atmospherics/pipe) && node.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) return else if(node) @@ -127,9 +126,9 @@ else add_underlay(T,, dir) -/obj/machinery/atmospherics/component/unary/vent_pump/hide() +/obj/machinery/atmospherics/component/unary/vent_pump/update_hiding_underfloor(new_value) + . = ..() update_icon() - update_underlays() /obj/machinery/atmospherics/component/unary/vent_pump/proc/can_pump() if(machine_stat & (NOPOWER|BROKEN)) @@ -277,8 +276,7 @@ if (!(machine_stat & NOPOWER) && on) to_chat(user, "You cannot unwrench \the [src], turn it off first.") return 1 - var/turf/T = src.loc - if (node && node.level==1 && isturf(T) && !T.is_plating()) + if(is_probably_hidden_underfloor() && node?.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) to_chat(user, "You must remove the plating first.") return 1 if(unsafe_pressure()) @@ -499,7 +497,7 @@ if(!istype(T)) return - if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe)) + if(T.hides_underfloor_objects() && istype(node, /obj/machinery/atmospherics/pipe) && node.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) vent_icon += "h" if(welded) diff --git a/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm index 0b39402a8f48..a3551e56ae16 100644 --- a/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary/vent_scrubber.dm @@ -11,12 +11,11 @@ connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_SCRUBBER //connects to regular and scrubber pipes - level = 1 - hijack_require_exposed = TRUE default_multitool_hijack = TRUE tgui_interface = "AtmosVentScrubber" atmos_component_ui_flags = NONE + hides_underfloor_underlays = TRUE /// registered area var/area/registered_area @@ -132,7 +131,7 @@ var/turf/T = get_turf(src) if(!istype(T)) return - if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe)) + if(T.hides_underfloor_objects() && istype(node, /obj/machinery/atmospherics/pipe) && node.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) return else if(node) @@ -218,9 +217,9 @@ return 1 -/obj/machinery/atmospherics/component/unary/vent_scrubber/hide(var/i) //to make the little pipe section invisible, the icon changes. +/obj/machinery/atmospherics/component/unary/vent_scrubber/update_hiding_underfloor(new_value) + . = ..() update_icon() - update_underlays() /obj/machinery/atmospherics/component/unary/vent_scrubber/power_change() var/old_stat = machine_stat @@ -235,7 +234,7 @@ to_chat(user, "You cannot unwrench \the [src], turn it off first.") return 1 var/turf/T = src.loc - if (node && node.level==1 && isturf(T) && !T.is_plating()) + if(T?.hides_underfloor_objects() && node?.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) to_chat(user, "You must remove the plating first.") return 1 if(unsafe_pressure()) diff --git a/code/modules/atmospherics/machinery/machinery.dm b/code/modules/atmospherics/machinery/machinery.dm index f0c718dafdf3..ca15e774e69b 100644 --- a/code/modules/atmospherics/machinery/machinery.dm +++ b/code/modules/atmospherics/machinery/machinery.dm @@ -22,6 +22,12 @@ Pipelines + Other Objects -> Pipe network atom_colouration_system = FALSE climb_allowed = FALSE depth_projected = FALSE + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor_defaulting = FALSE + + //* Underfloor *// + /// automatically update_underlays() during update_underfloor + var/hides_underfloor_underlays = FALSE ///The color of the pipe var/pipe_color @@ -99,7 +105,7 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/proc/add_underlay(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type) if(node) - if(!T.is_plating() && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe)) + if(istype(node, /obj/machinery/atmospherics/pipe) && (node.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) && T.hides_underfloor_objects()) //underlays += icon_manager.get_atmos_icon("underlay_down", direction, color_cache_name(node)) underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type) else @@ -188,8 +194,6 @@ Pipelines + Other Objects -> Pipe network pipe_color = obj_color setPipingLayer(set_layer) // TODO - M.connect_types = src.connect_types - Or otherwise copy from item? Or figure it out from piping layer? - var/turf/T = get_turf(src) - level = !T.is_plating() ? 2 : 1 atmos_init() if(QDELETED(src)) return // TODO - Eventually should get rid of the need for this. @@ -234,20 +238,33 @@ Pipelines + Other Objects -> Pipe network // pixel_y = PIPE_PIXEL_OFFSET_Y(piping_layer) // layer = initial(layer) + PIPE_LAYER_OFFSET(piping_layer) -/obj/machinery/atmospherics/hide(do_hide) - if(do_hide && level == 1) - layer = PIPE_LAYER +/obj/machinery/atmospherics/proc/get_standard_layer(underfloor) + if(underfloor) + switch(piping_layer) + if(PIPING_LAYER_SCRUBBER) + return PIPES_SCRUBBER_LAYER + if(PIPING_LAYER_SUPPLY) + return PIPES_SUPPLY_LAYER + if(PIPING_LAYER_FUEL) + return PIPES_FUEL_LAYER + if(PIPING_LAYER_AUX) + return PIPES_AUX_LAYER + else + return PIPE_LAYER else - reset_plane_and_layer() - -// todo: refactor + return EXPOSED_PIPE_LAYER -/obj/machinery/atmospherics/is_hidden_underfloor() - var/turf/T = loc - return istype(T) && (level == 1) && !T.is_plating() +/obj/machinery/atmospherics/reset_plane_and_layer() + set_plane(TURF_PLANE) + set_base_layer(get_standard_layer()) -/obj/machinery/atmospherics/should_hide_underfloor() - return level == 1 +/obj/machinery/atmospherics/update_hiding_underfloor(new_value) + . = ..() + if(!.) + return + reset_plane_and_layer() + if(hides_underfloor_underlays) + update_underlays() /** * currently unimplemented diff --git a/code/modules/atmospherics/machinery/mainspipe.dm b/code/modules/atmospherics/machinery/mainspipe.dm index dfccd70ae348..eb7e7a86b625 100644 --- a/code/modules/atmospherics/machinery/mainspipe.dm +++ b/code/modules/atmospherics/machinery/mainspipe.dm @@ -36,6 +36,7 @@ icon = 'icons/obj/atmospherics/mainspipe.dmi' plane = TURF_PLANE layer = PIPE_LAYER + hides_underfloor_defaulting = TRUE var/volume = 0 @@ -68,11 +69,6 @@ aux.volume = volume aux.nodes.len = nodes.len -/obj/machinery/atmospherics/mains_pipe/hide(var/i) - if(level == 1 && istype(loc, /turf/simulated)) - invisibility = i ? 101 : 0 - update_icon() - /obj/machinery/atmospherics/mains_pipe/proc/burst() for(var/obj/machinery/atmospherics/pipe/mains_component/pipe in contents) burst() @@ -183,16 +179,13 @@ ..() // initialize internal pipes - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/mains_pipe/simple/hidden - level = 1 icon_state = "intact-f" /obj/machinery/atmospherics/mains_pipe/simple/visible - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER icon_state = "intact" /obj/machinery/atmospherics/mains_pipe/manifold @@ -245,8 +238,6 @@ ..() // initialize internal pipes - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/mains_pipe/manifold/update_icon_state() @@ -254,11 +245,10 @@ icon_state = "manifold[invisibility ? "-f" : "" ]" /obj/machinery/atmospherics/mains_pipe/manifold/hidden - level = 1 icon_state = "manifold-f" /obj/machinery/atmospherics/mains_pipe/manifold/visible - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER icon_state = "manifold" /obj/machinery/atmospherics/mains_pipe/manifold4w @@ -296,8 +286,6 @@ ..() // initialize internal pipes - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/mains_pipe/manifold4w/update_icon_state() @@ -305,11 +293,10 @@ icon_state = "manifold4w[invisibility ? "-f" : "" ]" /obj/machinery/atmospherics/mains_pipe/manifold4w/hidden - level = 1 icon_state = "manifold4w-f" /obj/machinery/atmospherics/mains_pipe/manifold4w/visible - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER icon_state = "manifold4w" /obj/machinery/atmospherics/mains_pipe/split @@ -358,8 +345,6 @@ if(N1 && N2) N1.merge(N2) - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/mains_pipe/split/update_icon_state() @@ -377,18 +362,15 @@ split_node = supply */ /obj/machinery/atmospherics/mains_pipe/split/hidden/supply - level = 1 icon_state = "split-supply-f" /obj/machinery/atmospherics/mains_pipe/split/hidden/scrubbers - level = 1 icon_state = "split-scrubbers-f" /obj/machinery/atmospherics/mains_pipe/split/hidden/aux - level = 1 icon_state = "split-aux-f" /obj/machinery/atmospherics/mains_pipe/split/visible/suppy - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER icon_state = "split-supply" /obj/machinery/atmospherics/mains_pipe/split/scrubbers @@ -400,7 +382,7 @@ /obj/machinery/atmospherics/mains_pipe/split/visible - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER icon_state = "split-scrubbers" /obj/machinery/atmospherics/mains_pipe/split/aux @@ -411,7 +393,7 @@ split_node = aux /obj/machinery/atmospherics/mains_pipe/split/visible - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER icon_state = "split-aux" /obj/machinery/atmospherics/mains_pipe/split3 @@ -480,8 +462,6 @@ if(N1 && N2) N1.merge(N2) - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/mains_pipe/split3/update_icon() @@ -499,11 +479,10 @@ return A /obj/machinery/atmospherics/mains_pipe/split3/hidden - level = 1 icon_state = "split-t-f" /obj/machinery/atmospherics/mains_pipe/split3/visible - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER icon_state = "split-t" /obj/machinery/atmospherics/mains_pipe/cap @@ -530,14 +509,11 @@ ..() - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/mains_pipe/cap/hidden - level = 1 icon_state = "cap-f" /obj/machinery/atmospherics/mains_pipe/cap/visible - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER icon_state = "cap" diff --git a/code/modules/atmospherics/machinery/meter.dm b/code/modules/atmospherics/machinery/meter.dm index a7ff981a3b35..768aad460259 100644 --- a/code/modules/atmospherics/machinery/meter.dm +++ b/code/modules/atmospherics/machinery/meter.dm @@ -25,7 +25,7 @@ /obj/machinery/meter/proc/select_target() var/obj/machinery/atmospherics/pipe/P for(P in loc) - if(!P.hides_under_flooring()) + if(!P.is_probably_hidden_underfloor()) break if(!P) P = locate(/obj/machinery/atmospherics/pipe) in loc diff --git a/code/modules/atmospherics/machinery/pipes/cap.dm b/code/modules/atmospherics/machinery/pipes/cap.dm index 30d494c28a5a..4bb605aa5eef 100644 --- a/code/modules/atmospherics/machinery/pipes/cap.dm +++ b/code/modules/atmospherics/machinery/pipes/cap.dm @@ -6,8 +6,6 @@ desc = "An endcap for pipes" icon = 'icons/atmos/pipes.dmi' icon_state = "" - level = 2 - volume = 35 dir = SOUTH @@ -61,12 +59,10 @@ node = target break - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/pipe/cap/visible - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER icon_state = "cap" /obj/machinery/atmospherics/pipe/cap/visible/scrubbers @@ -109,10 +105,7 @@ icon_connect_type = "-aux" color = PIPE_COLOR_CYAN - - /obj/machinery/atmospherics/pipe/cap/hidden - level = 1 icon_state = "cap" /obj/machinery/atmospherics/pipe/cap/hidden/scrubbers diff --git a/code/modules/atmospherics/machinery/pipes/he_pipes.dm b/code/modules/atmospherics/machinery/pipes/he_pipes.dm index 620729c01827..4e10d7350f59 100644 --- a/code/modules/atmospherics/machinery/pipes/he_pipes.dm +++ b/code/modules/atmospherics/machinery/pipes/he_pipes.dm @@ -6,7 +6,7 @@ icon_state = "intact" pipe_icon = "hepipe" color = "#404040" - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER connect_types = CONNECT_TYPE_HE pipe_flags = PIPING_DEFAULT_LAYER_ONLY construction_type = /obj/item/pipe/binary/bendable @@ -34,6 +34,9 @@ /obj/machinery/atmospherics/pipe/simple/heat_exchanging/get_init_dirs() return ..() | initialize_directions_he +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/get_standard_layer(underfloor) + return PIPES_HE_LAYER + // Use initialize_directions_he to connect to neighbors instead. /obj/machinery/atmospherics/pipe/simple/heat_exchanging/can_be_node(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target) if(!istype(target)) @@ -128,7 +131,7 @@ icon = 'icons/atmos/junction.dmi' icon_state = "intact" pipe_icon = "hejunction" - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_HE construction_type = /obj/item/pipe/directional pipe_state = "junction" diff --git a/code/modules/atmospherics/machinery/pipes/manifold.dm b/code/modules/atmospherics/machinery/pipes/manifold.dm index e3ff5ba22092..81514c4bc765 100644 --- a/code/modules/atmospherics/machinery/pipes/manifold.dm +++ b/code/modules/atmospherics/machinery/pipes/manifold.dm @@ -17,8 +17,6 @@ var/obj/machinery/atmospherics/node3 - level = 1 - /obj/machinery/atmospherics/pipe/manifold/Initialize(mapload) . = ..() alpha = 255 @@ -153,13 +151,11 @@ qdel(src) return - var/turf/T = get_turf(src) - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/pipe/manifold/visible icon_state = "map" - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER /obj/machinery/atmospherics/pipe/manifold/visible/scrubbers name="Scrubbers pipe manifold" @@ -224,7 +220,6 @@ /obj/machinery/atmospherics/pipe/manifold/hidden icon_state = "map" - level = 1 alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game /obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers diff --git a/code/modules/atmospherics/machinery/pipes/manifold4w.dm b/code/modules/atmospherics/machinery/pipes/manifold4w.dm index c6865be2456d..bf2b52ea8d87 100644 --- a/code/modules/atmospherics/machinery/pipes/manifold4w.dm +++ b/code/modules/atmospherics/machinery/pipes/manifold4w.dm @@ -18,8 +18,6 @@ var/obj/machinery/atmospherics/node3 var/obj/machinery/atmospherics/node4 - level = 1 - /obj/machinery/atmospherics/pipe/manifold4w/Initialize(mapload) . = ..() alpha = 255 @@ -155,13 +153,11 @@ qdel(src) return - var/turf/T = get_turf(src) - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/pipe/manifold4w/visible icon_state = "map_4way" - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER /obj/machinery/atmospherics/pipe/manifold4w/visible/scrubbers name="4-way scrubbers pipe manifold" @@ -227,7 +223,6 @@ /obj/machinery/atmospherics/pipe/manifold4w/hidden icon_state = "map_4way" - level = 1 /obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers name="4-way scrubbers pipe manifold" diff --git a/code/modules/atmospherics/machinery/pipes/pipe_base.dm b/code/modules/atmospherics/machinery/pipes/pipe_base.dm index 68bb5addb2be..d3b4f438ab15 100644 --- a/code/modules/atmospherics/machinery/pipes/pipe_base.dm +++ b/code/modules/atmospherics/machinery/pipes/pipe_base.dm @@ -6,6 +6,8 @@ buckle_flags = BUCKLING_REQUIRES_RESTRAINTS use_power = USE_POWER_OFF + hides_underfloor_update_icon = TRUE + hides_underfloor_defaulting = TRUE pipe_flags = NONE // Does not have PIPING_DEFAULT_LAYER_ONLY flag. @@ -21,13 +23,12 @@ //minimum pressure before check_pressure(...) should be called /obj/machinery/atmospherics/pipe/Initialize(mapload, newdir) - if(istype(get_turf(src), /turf/simulated/wall) || istype(get_turf(src), /turf/simulated/shuttle/wall) || istype(get_turf(src), /turf/unsimulated/wall)) - level = 1 + // pipes are always underfloor if inside a wall + // we just check for loc.density 'cause speed lmao + if(loc.density) + hides_underfloor = OBJ_UNDERFLOOR_ALWAYS return ..() -/obj/machinery/atmospherics/pipe/hides_under_flooring() - return level != 2 - /obj/machinery/atmospherics/pipe/proc/pipeline_expansion() return null @@ -89,8 +90,7 @@ if (!W.is_wrench()) return ..() - var/turf/T = src.loc - if (level==1 && isturf(T) && !T.is_plating()) + if (is_probably_hidden_underfloor()) to_chat(user, "You must remove the plating first.") return 1 if(unsafe_pressure()) @@ -127,11 +127,6 @@ else return pipe_color -/obj/machinery/atmospherics/pipe/hide(var/i) - if(istype(loc, /turf/simulated)) - invisibility = i ? 100 : 0 - update_icon() - /obj/machinery/atmospherics/pipe/process(delta_time) if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle ..() diff --git a/code/modules/atmospherics/machinery/pipes/simple.dm b/code/modules/atmospherics/machinery/pipes/simple.dm index 178cb2c3fe1e..93ebe7b68559 100644 --- a/code/modules/atmospherics/machinery/pipes/simple.dm +++ b/code/modules/atmospherics/machinery/pipes/simple.dm @@ -24,8 +24,6 @@ var/fatigue_pressure = 55*ONE_ATMOSPHERE alert_pressure = 55*ONE_ATMOSPHERE - level = 1 - /obj/machinery/atmospherics/pipe/simple/Initialize(mapload) . = ..() @@ -144,8 +142,6 @@ qdel(src) return - var/turf/T = loc - if(level == 1 && !T.is_plating()) hide(1) update_icon() /obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference) @@ -165,7 +161,7 @@ /obj/machinery/atmospherics/pipe/simple/visible icon_state = "intact" - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER /obj/machinery/atmospherics/pipe/simple/visible/scrubbers name = "Scrubbers pipe" @@ -230,7 +226,6 @@ /obj/machinery/atmospherics/pipe/simple/hidden icon_state = "intact" - level = 1 /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers name = "Scrubbers pipe" @@ -302,4 +297,4 @@ fatigue_pressure = 900*ONE_ATMOSPHERE alert_pressure = 900*ONE_ATMOSPHERE - level = 2 + hides_underfloor = OBJ_UNDERFLOOR_NEVER diff --git a/code/modules/atmospherics/machinery/pipes/tank.dm b/code/modules/atmospherics/machinery/pipes/tank.dm index 928e23754e57..abed0d867283 100644 --- a/code/modules/atmospherics/machinery/pipes/tank.dm +++ b/code/modules/atmospherics/machinery/pipes/tank.dm @@ -11,11 +11,11 @@ volume = 10000 //in liters, 1 meters by 1 meters by 2 meters ~tweaked it a little to simulate a pressure tank without needing to recode them yet layer = EXPOSED_PIPE_LAYER - level = 1 dir = SOUTH initialize_directions = SOUTH pipe_flags = PIPING_DEFAULT_LAYER_ONLY density = TRUE + hides_underfloor_underlays = TRUE var/start_pressure = 75*ONE_ATMOSPHERE @@ -44,9 +44,6 @@ return add_underlay(T, node1, dir) -/obj/machinery/atmospherics/pipe/tank/hide() - update_underlays() - /obj/machinery/atmospherics/pipe/tank/atmos_init() var/connect_direction = dir diff --git a/code/modules/atmospherics/machinery/pipes/universal.dm b/code/modules/atmospherics/machinery/pipes/universal.dm index a1b022f8491e..ff049e78369c 100644 --- a/code/modules/atmospherics/machinery/pipes/universal.dm +++ b/code/modules/atmospherics/machinery/pipes/universal.dm @@ -121,7 +121,7 @@ /obj/machinery/atmospherics/proc/add_underlay_adapter(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type) //modified from add_underlay, does not make exposed underlays if(node) - if(!T.is_plating() && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe)) + if(T.hides_underfloor_objects() && istype(node, /obj/machinery/atmospherics/pipe) && node.hides_underfloor == OBJ_UNDERFLOOR_ALWAYS) underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type) else underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type) diff --git a/code/modules/atmospherics/machinery/pipes/vent.dm b/code/modules/atmospherics/machinery/pipes/vent.dm index 6dafd48919a7..cd43dbb8159a 100644 --- a/code/modules/atmospherics/machinery/pipes/vent.dm +++ b/code/modules/atmospherics/machinery/pipes/vent.dm @@ -8,8 +8,6 @@ name = "Vent" desc = "A large air vent" - level = 1 - volume = 250 dir = SOUTH @@ -17,6 +15,8 @@ pipe_flags = PIPING_DEFAULT_LAYER_ONLY construction_type = /obj/item/pipe/directional pipe_state = "passive vent" + hides_underfloor_defaulting = FALSE + hides_underfloor_update_icon = TRUE /obj/machinery/atmospherics/pipe/vent/init_dir() initialize_directions = dir @@ -41,10 +41,11 @@ /obj/machinery/atmospherics/pipe/vent/update_icon() if(node1) - icon_state = "intact" - + if(is_probably_hidden_underfloor()) + icon_state = "hintact" + else + icon_state = "intact" setDir(get_dir(src, node1)) - else icon_state = "exposed" @@ -68,9 +69,6 @@ return null -/obj/machinery/atmospherics/pipe/vent/hide(var/i) //to make the little pipe section invisible, the icon changes. - if(node1) - icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact" - setDir(get_dir(src, node1)) - else - icon_state = "exposed" +/obj/machinery/atmospherics/pipe/vent/update_hiding_underfloor(new_value) + . = ..() + update_icon() diff --git a/code/modules/multiz/structures/pipes.dm b/code/modules/multiz/structures/pipes.dm index bf5d119634a5..25b78c13a414 100644 --- a/code/modules/multiz/structures/pipes.dm +++ b/code/modules/multiz/structures/pipes.dm @@ -28,8 +28,6 @@ var/fatigue_pressure = 55*ONE_ATMOSPHERE alert_pressure = 55*ONE_ATMOSPHERE - level = 1 - /obj/machinery/atmospherics/pipe/zpipe/Initialize(mapload, newdir) . = ..() init_dir() @@ -53,11 +51,6 @@ if(SOUTHWEST) initialize_directions = SOUTH -/obj/machinery/atmospherics/pipe/zpipe/hide(var/i) - if(istype(loc, /turf/simulated)) - invisibility = i ? 101 : 0 - update_icon() - /obj/machinery/atmospherics/pipe/zpipe/process(delta_time) if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle ..() @@ -105,7 +98,6 @@ /obj/machinery/atmospherics/pipe/zpipe/update_icon() color = pipe_color - return /obj/machinery/atmospherics/pipe/zpipe/disconnect(obj/machinery/atmospherics/reference) if(reference == node1) @@ -123,11 +115,13 @@ // the elusive up pipe // ///////////////////////// /obj/machinery/atmospherics/pipe/zpipe/up - icon = 'icons/obj/structures.dmi' - icon_state = "up" + icon = 'icons/obj/structures.dmi' + icon_state = "up" - name = "upwards pipe" - desc = "A pipe segment to connect upwards." + name = "upwards pipe" + desc = "A pipe segment to connect upwards." + + hides_underfloor = OBJ_UNDERFLOOR_NEVER /obj/machinery/atmospherics/pipe/zpipe/up/atmos_init() normalize_dir() @@ -151,11 +145,6 @@ node2 = target break -/* Citadel change, why are upwards pipes capable of being hidden by tiles???? - var/turf/T = src.loc // hide if turf is not intact - hide(!T.is_plating()) -*/ - /////////////////////// // and the down pipe // /////////////////////// @@ -189,10 +178,6 @@ node2 = target break - - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) // but respect level - /////////////////////// // supply/scrubbers // /////////////////////// diff --git a/code/modules/multiz/turfs/open.dm b/code/modules/multiz/turfs/open.dm index 2a629990ab9e..f9f46dad3f51 100644 --- a/code/modules/multiz/turfs/open.dm +++ b/code/modules/multiz/turfs/open.dm @@ -32,11 +32,6 @@ /turf/simulated/open/smooth_icon() return // Nope.amv -// Override to make sure nothing is hidden -/turf/simulated/open/levelupdate() - for(var/obj/O in src) - O.hide(0) - /turf/simulated/open/examine(mob/user, distance, infix, suffix) . = ..() if(distance <= 2) @@ -45,9 +40,11 @@ depth += 1 to_chat(user, "It is about [depth] level\s deep.") -// Most things use is_plating to test if there is a cover tile on top (like regular floors) /turf/simulated/open/is_plating() - return TRUE + return FALSE + +/turf/simulated/open/hides_underfloor_objects() + return FALSE /turf/simulated/open/is_space() return below()?.is_space() diff --git a/code/modules/overmap/legacy/overmap_shuttle.dm b/code/modules/overmap/legacy/overmap_shuttle.dm index 19c6f1649f0b..f2fdfca0e9d5 100644 --- a/code/modules/overmap/legacy/overmap_shuttle.dm +++ b/code/modules/overmap/legacy/overmap_shuttle.dm @@ -171,7 +171,3 @@ return to_chat(user, SPAN_WARNING("You install [W] in [src].")) update_icon() - -// Walls hide stuff inside them, but we want to be visible. -/obj/structure/fuel_port/hide() - return diff --git a/code/modules/overmap/legacy/sectors.dm b/code/modules/overmap/legacy/sectors.dm index 822f1c0c7aec..608619913ac8 100644 --- a/code/modules/overmap/legacy/sectors.dm +++ b/code/modules/overmap/legacy/sectors.dm @@ -190,10 +190,6 @@ icon_state = "sector" anchored = TRUE -// Because of the way these are spawned, they will potentially have their invisibility adjusted by the turfs they are mapped on -// prior to being moved to the overmap. This blocks that. Use set_invisibility to adjust invisibility as needed instead. -/obj/overmap/entity/visitable/sector/hide() - /obj/overmap/entity/visitable/proc/distress(mob/user) if(has_distress_beacon) return FALSE diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 21701f8a7d10..7b3a20412984 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -54,7 +54,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( layer = EXPOSED_WIRE_LAYER color = COLOR_RED - level = 1 + hides_underfloor = OBJ_UNDERFLOOR_ALWAYS anchored =1 rad_flags = RAD_BLOCK_CONTENTS | RAD_NO_CONTAMINATE @@ -91,10 +91,6 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( // handle maploader turning setDir(dir) - var/turf/T = src.loc // hide if turf is not intact - if(level==1 && T) - hide(!T.is_plating()) - cable_list += src //add it to the global cable list if(auto_merge) auto_merge() @@ -185,13 +181,9 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( /////////////////////////////////// //If underfloor, hide the cable -/obj/structure/cable/hide(var/i) - if(istype(loc, /turf)) - invisibility = i ? 101 : 0 - update_icon() - -/obj/structure/cable/hides_under_flooring() - return 1 +/obj/structure/cable/update_hiding_underfloor(new_value) + . = ..() + alpha = new_value? 127 : 255 /obj/structure/cable/update_icon() if(!(atom_flags & ATOM_INITIALIZED)) diff --git a/code/modules/power/terminal.dm b/code/modules/power/terminal.dm index 3e6e41f8ffeb..969ed08f3b30 100644 --- a/code/modules/power/terminal.dm +++ b/code/modules/power/terminal.dm @@ -7,18 +7,11 @@ name = "terminal" icon_state = "term" desc = "It's an underfloor wiring terminal for power equipment." - level = 1 var/obj/machinery/power/master = null anchored = 1 plane = TURF_PLANE layer = EXPOSED_WIRE_TERMINAL_LAYER - - -/obj/machinery/power/terminal/Initialize(mapload, newdir) - . = ..() - var/turf/T = src.loc - if(level==1) - hide(!T.is_plating()) + hides_underfloor = OBJ_UNDERFLOOR_ALWAYS /obj/machinery/power/terminal/Destroy() if(master) @@ -26,12 +19,16 @@ master = null return ..() -/obj/machinery/power/terminal/hide(var/i) - invisibility = i ? 101 : 0 - icon_state = i ? "term-f" : "term" +/obj/machinery/power/terminal/update_hiding_underfloor(new_value) + . = ..() + update_icon() -/obj/machinery/power/terminal/hides_under_flooring() - return 1 +/obj/machinery/power/terminal/update_icon_state() + if(is_probably_hidden_underfloor()) + icon_state = "term-f" + else + icon_state = "term" + return ..() // Needed so terminals are not removed from machines list. // Powernet rebuilds need this to work properly. diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index 56483c413aac..3a239b67f9c6 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -2,7 +2,6 @@ // This is the pipe that you drag around, not the attached ones. /obj/structure/disposalconstruct - name = "disposal pipe segment" desc = "A huge pipe segment used for constructing disposal systems." icon = 'icons/obj/pipes/disposal.dmi' @@ -11,7 +10,6 @@ density = 0 pressure_resistance = 5*ONE_ATMOSPHERE materials_base = list(MAT_STEEL = 1850) - level = 2 var/sortType = "" var/ptype = 0 var/subtype = 0 @@ -45,8 +43,13 @@ else update() // do_a_flip() calls update anyway, so, lazy way of catching unupdated pipe! -// update iconstate and dpdir due to dir and type /obj/structure/disposalconstruct/proc/update() + // todo: rework this.. + update_icon() + +// update iconstate and dpdir due to dir and type +/obj/structure/disposalconstruct/update_icon() + . = ..() var/flip = turn(dir, 180) var/left = turn(dir, 90) var/right = turn(dir, -90) @@ -120,13 +123,6 @@ alpha = 255 //otherwise burying half-finished pipes under floors causes them to half-fade -// hide called by levelupdate if turf intact status changes -// change visibility status and force update of icon -/obj/structure/disposalconstruct/hide(var/intact) - invisibility = (intact && level==1) ? 101: 0 // hide if floor is intact - update() - - // flip and rotate verbs /obj/structure/disposalconstruct/verb/rotate() set category = VERB_CATEGORY_OBJECT @@ -260,7 +256,7 @@ if(anchored) anchored = 0 if(ispipe) - level = 2 + set_hides_underfloor(OBJ_UNDERFLOOR_NEVER) density = 0 else density = 1 @@ -286,7 +282,7 @@ anchored = 1 if(ispipe) - level = 1 // We don't want disposal bins to disappear under the floors + set_hides_underfloor(OBJ_UNDERFLOOR_ALWAYS) density = 0 else density = 1 // We don't want disposal bins or outlets to go density 0 @@ -350,12 +346,6 @@ to_chat(user, "You need to attach it to the plating first!") return -/obj/structure/disposalconstruct/hides_under_flooring() - if(anchored) - return 1 - else - return 0 - /obj/structure/disposalconstruct/proc/is_pipe() return (ptype != DISPOSAL_PIPE_BIN && ptype != DISPOSAL_PIPE_OUTLET && ptype != DISPOSAL_PIPE_CHUTE) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index c9ebcae5d921..885b1df83216 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -685,7 +685,7 @@ desc = "An underfloor disposal pipe." anchored = 1 density = 0 - level = 1 // underfloor only + hides_underfloor = OBJ_UNDERFLOOR_ALWAYS dir = 0 // dir will contain dominant direction for junction pipes plane = TURF_PLANE layer = DISPOSAL_LAYER // slightly lower than wires and other pipes. @@ -950,14 +950,6 @@ expel(H, T, 0) ..() -/obj/structure/disposalpipe/hides_under_flooring() - return 1 - -// *** TEST verb -//client/verb/dispstop() -// for(var/obj/structure/disposalholder/H in world) -// H.active = 0 - // a straight or bent segment /obj/structure/disposalpipe/segment icon_state = "pipe-s" diff --git a/code/modules/research/machinery/destructive_analyzer.dm b/code/modules/research/machinery/destructive_analyzer.dm index 213dd7b62847..424eeb5b10c0 100644 --- a/code/modules/research/machinery/destructive_analyzer.dm +++ b/code/modules/research/machinery/destructive_analyzer.dm @@ -87,7 +87,7 @@ Note: Must be placed within 3 tiles of the R&D Console /obj/machinery/r_n_d/destructive_analyzer/MouseDroppedOnLegacy(atom/dropping, mob/living/user) if(istype(dropping, /obj/item/storage/part_replacer)) var/obj/item/storage/part_replacer/replacer = dropping - replacer.hide() + replacer.obj_storage?.hide() if(!linked_console) to_chat(user, "\The [src] must be linked to an R&D console first.") return 0 diff --git a/code/modules/shieldgen/shield_diffuser.dm b/code/modules/shieldgen/shield_diffuser.dm index a52ca181682a..eae73e2ff688 100644 --- a/code/modules/shieldgen/shield_diffuser.dm +++ b/code/modules/shieldgen/shield_diffuser.dm @@ -10,25 +10,11 @@ active_power_usage = 500 // Previously 2000 anchored = TRUE density = FALSE - level = 1 + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor_update_icon = TRUE var/alarm = FALSE var/enabled = TRUE -/obj/machinery/shield_diffuser/Initialize(mapload) - . = ..() - - var/turf/T = get_turf(src) - hide(!T.is_plating()) - -//If underfloor, hide the cable^H^H diffuser -/obj/machinery/shield_diffuser/hide(var/i) - if(istype(loc, /turf)) - invisibility = i ? 101 : 0 - update_icon() - -/obj/machinery/shield_diffuser/hides_under_flooring() - return TRUE - /obj/machinery/shield_diffuser/process(delta_time) if(alarm) alarm-- diff --git a/maps/away_missions/archive/stationCollision.dmm b/maps/away_missions/archive/stationCollision.dmm index 14eb7f5c755b..c6d6e8660a04 100644 --- a/maps/away_missions/archive/stationCollision.dmm +++ b/maps/away_missions/archive/stationCollision.dmm @@ -390,7 +390,7 @@ /obj/machinery/atmospherics/pipe/simple{ dir = 4; icon_state = "intact"; - level = 2 + hides_underfloor = "never" }, /turf/simulated/floor/airless, /area/awaymission/northblock) @@ -587,7 +587,7 @@ /obj/machinery/atmospherics/pipe/simple{ dir = 9; icon_state = "intact"; - level = 2 + hides_underfloor = "never" }, /turf/simulated/floor/airless, /area/awaymission/northblock) @@ -1019,7 +1019,7 @@ /obj/machinery/atmospherics/pipe/manifold{ dir = 8; icon_state = "manifold"; - level = 2 + hides_underfloor = "never" }, /turf/simulated/floor/airless, /area/awaymission/research) @@ -1027,7 +1027,7 @@ /obj/machinery/atmospherics/pipe/simple{ dir = 4; icon_state = "intact"; - level = 2 + hides_underfloor = "never" }, /turf/simulated/floor/airless, /area/awaymission/research) @@ -1035,7 +1035,7 @@ /obj/machinery/atmospherics/pipe/simple{ dir = 9; icon_state = "intact"; - level = 2 + hides_underfloor = "never" }, /obj/machinery/light/small{ dir = 4 diff --git a/maps/submaps/level_specific/class_h/AuxiliaryResearchFacility.dmm b/maps/submaps/level_specific/class_h/AuxiliaryResearchFacility.dmm index 6252eec547c5..3d68d3e47247 100644 --- a/maps/submaps/level_specific/class_h/AuxiliaryResearchFacility.dmm +++ b/maps/submaps/level_specific/class_h/AuxiliaryResearchFacility.dmm @@ -114,7 +114,7 @@ /obj/structure/railing{ dir = 1 }, -/turf/simulated/floor/fixed, +/turf/simulated/floor, /area/class_h/POIs/AuxiliaryResearchFacility) "cm" = ( /obj/effect/debris/cleanable/dirt, @@ -1496,7 +1496,7 @@ /obj/structure/railing{ dir = 1 }, -/turf/simulated/floor/fixed, +/turf/simulated/floor, /area/class_h/POIs/AuxiliaryResearchFacility) "HL" = ( /obj/machinery/artifact_analyser, @@ -1859,7 +1859,7 @@ /obj/structure/railing{ dir = 8 }, -/turf/simulated/floor/fixed, +/turf/simulated/floor, /area/class_h/POIs/AuxiliaryResearchFacility) "Qy" = ( /obj/structure/closet/hydrant, @@ -2193,7 +2193,7 @@ /obj/structure/railing{ dir = 4 }, -/turf/simulated/floor/fixed, +/turf/simulated/floor, /area/class_h/POIs/AuxiliaryResearchFacility) "Ym" = ( /obj/effect/debris/cleanable/dirt, diff --git a/maps/templates/shuttles/overmaps/generic/bearcat.dmm b/maps/templates/shuttles/overmaps/generic/bearcat.dmm index d01aec97171d..3f5cf1514afb 100644 --- a/maps/templates/shuttles/overmaps/generic/bearcat.dmm +++ b/maps/templates/shuttles/overmaps/generic/bearcat.dmm @@ -957,7 +957,7 @@ /obj/machinery/atmospherics/pipe/simple{ dir = 4; icon_state = "intact"; - level = 2 + hides_underfloor = "never" }, /obj/structure/cable{ icon_state = "4-8" @@ -2063,7 +2063,7 @@ "fp" = ( /obj/machinery/atmospherics/pipe/simple{ icon_state = "intact"; - level = 2 + hides_underfloor = "never" }, /obj/structure/disposalpipe/segment, /obj/structure/cable{ @@ -2592,7 +2592,7 @@ /obj/machinery/atmospherics/pipe/simple{ dir = 5; icon_state = "intact"; - level = 2 + hides_underfloor = "never" }, /obj/machinery/meter, /turf/simulated/floor/plating, diff --git a/maps/tether/levels/station1.dmm b/maps/tether/levels/station1.dmm index 9d9ba555e3ee..90956b31de12 100644 --- a/maps/tether/levels/station1.dmm +++ b/maps/tether/levels/station1.dmm @@ -15457,7 +15457,6 @@ /obj/machinery/computer/general_air_control{ dir = 4; frequency = 1443; - level = 3; name = "Distribution and Waste Monitor"; sensors = list("dist_main_meter"="Surface - Distribution Loop","scrub_main_meter"="Surface - Scrubbers Loop","mair_main_meter"="Surface - Mixed Air Tank","dist_aux_meter"="Station - Distribution Loop","scrub_aux_meter"="Station - Scrubbers Loop","mair_aux_meter"="Station - Mixed Air Tank","mair_mining_meter"="Mining Outpost - Mixed Air Tank") }, diff --git a/maps/tether/levels/station2.dmm b/maps/tether/levels/station2.dmm index 86fd2620735c..0eb957b45a93 100644 --- a/maps/tether/levels/station2.dmm +++ b/maps/tether/levels/station2.dmm @@ -19354,7 +19354,6 @@ icon_state = "pdoor0"; id = "englockdown"; layer = 1; - level = 1; name = "Engineering Lockdown"; opacity = 0; open_layer = 1 @@ -24808,7 +24807,6 @@ icon_state = "pdoor0"; id = "englockdown"; layer = 1; - level = 1; name = "Engineering Lockdown"; opacity = 0; open_layer = 1 diff --git a/maps/tether/levels/surface2.dmm b/maps/tether/levels/surface2.dmm index cf2c88bf1265..24a893edf85e 100644 --- a/maps/tether/levels/surface2.dmm +++ b/maps/tether/levels/surface2.dmm @@ -3482,7 +3482,6 @@ dir = 10 }, /obj/machinery/status_display{ - level = 4; pixel_y = -32 }, /turf/simulated/floor/tiled/white,