From f6a19e33f27f041da913cf19be07a5f013c9398b Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 13 Apr 2022 19:06:28 -0300 Subject: [PATCH 01/16] Upload files --- .../away_mission/moonoutpost19.dmm | 5 +- .../away_mission/undergroundoutpost45.dmm | 21 +- _maps/map_files/BoxStation/BoxStation.dmm | 4 +- code/__DEFINES/dcs/signals.dm | 17 +- code/__DEFINES/layers.dm | 216 ++++++++++++++++++ code/__DEFINES/traits.dm | 4 + code/__DEFINES/turfs.dm | 3 + code/_globalvars/traits.dm | 1 + code/_onclick/hud/families.dm | 2 +- code/controllers/subsystem/minor_mapping.dm | 2 +- .../subsystem/persistence/secret_satchels.dm | 4 +- code/datums/elements/undertile.dm | 66 ++++++ code/game/atoms.dm | 1 - code/game/machinery/Beacon.dm | 26 +-- code/game/machinery/magnet.dm | 11 +- code/game/machinery/navbeacon.dm | 108 ++++----- code/game/machinery/pipe/construction.dm | 1 - code/game/objects/effects/anomalies.dm | 2 +- .../effects/effect_system/effects_foam.dm | 2 +- .../effects/effect_system/effects_smoke.dm | 2 +- code/game/objects/items/RCL.dm | 6 +- code/game/objects/items/devices/powersink.dm | 2 +- .../objects/items/devices/pressureplates.dm | 22 +- code/game/objects/items/devices/scanners.dm | 5 +- code/game/objects/items/puzzle_pieces.dm | 5 - code/game/objects/items/stacks/rods.dm | 2 +- .../game/objects/items/stacks/sheets/glass.dm | 4 +- .../objects/items/stacks/tiles/tile_types.dm | 92 +++++++- code/game/objects/items/storage/backpack.dm | 27 +-- code/game/objects/obj_defense.dm | 15 +- code/game/objects/objs.dm | 3 - code/game/objects/structures/safe.dm | 5 +- code/game/objects/structures/window.dm | 6 - code/game/turfs/open/floor/catwalk_plating.dm | 89 ++++++-- code/game/turfs/simulated/floor.dm | 11 +- code/game/turfs/simulated/floor/plating.dm | 10 +- code/game/turfs/simulated/glass.dm | 63 ++--- code/game/turfs/simulated/openspace.dm | 3 +- code/game/turfs/space/space.dm | 6 +- code/game/turfs/turf.dm | 60 ++--- .../antagonists/blob/blob/blob_report.dm | 8 +- .../revenant/revenant_abilities.dm | 2 +- .../atmospherics/gasmixtures/reactions.dm | 2 +- .../atmospherics/machinery/atmosmachinery.dm | 26 ++- .../binary_devices/binary_devices.dm | 4 - .../components/binary_devices/dp_vent_pump.dm | 2 +- .../machinery/components/components_base.dm | 41 ++-- .../unary_devices/outlet_injector.dm | 2 +- .../components/unary_devices/passive_vent.dm | 2 +- .../unary_devices/portables_connector.dm | 4 +- .../components/unary_devices/unary_devices.dm | 6 +- .../components/unary_devices/vent_pump.dm | 2 +- .../components/unary_devices/vent_scrubber.dm | 2 +- .../atmospherics/machinery/other/meter.dm | 2 - .../atmospherics/machinery/pipes/bluespace.dm | 24 +- .../machinery/pipes/heat_exchange/he_pipes.dm | 6 +- .../machinery/pipes/layermanifold.dm | 2 - .../atmospherics/machinery/pipes/mapping.dm | 66 +++--- .../atmospherics/machinery/pipes/pipes.dm | 19 +- code/modules/holodeck/computer.dm | 10 +- code/modules/holodeck/turfs.dm | 2 +- .../network_builder/atmos_pipe.dm | 1 - .../living/simple_animal/friendly/mouse.dm | 2 +- .../living/simple_animal/hostile/plaguerat.dm | 2 +- .../living/simple_animal/hostile/regalrat.dm | 2 +- code/modules/power/apc.dm | 2 +- code/modules/power/cable.dm | 21 +- code/modules/power/power.dm | 2 +- code/modules/power/smes.dm | 2 +- code/modules/power/terminal.dm | 17 +- .../projectiles/guns/misc/beam_rifle.dm | 2 - .../recycling/disposal/construction.dm | 34 +-- code/modules/recycling/disposal/pipe.dm | 17 +- code/modules/shuttle/on_move.dm | 34 +-- icons/obj/tiles.dmi | Bin 18024 -> 19739 bytes icons/turf/floors/catwalk_plating.dmi | Bin 396 -> 4353 bytes icons/turf/floors/glass.dmi | Bin 3463 -> 9535 bytes icons/turf/floors/reinf_glass.dmi | Bin 2961 -> 6051 bytes modular_citadel/code/modules/festive/turfs.dm | 7 +- tgstation.dme | 3 + 80 files changed, 785 insertions(+), 531 deletions(-) create mode 100644 code/__DEFINES/layers.dm create mode 100644 code/__DEFINES/turfs.dm create mode 100644 code/datums/elements/undertile.dm diff --git a/_maps/RandomZLevels/away_mission/moonoutpost19.dmm b/_maps/RandomZLevels/away_mission/moonoutpost19.dmm index f342f8e36be0..ec370e6a4aef 100644 --- a/_maps/RandomZLevels/away_mission/moonoutpost19.dmm +++ b/_maps/RandomZLevels/away_mission/moonoutpost19.dmm @@ -2201,9 +2201,8 @@ /obj/structure/cable{ icon_state = "1-2" }, -/obj/machinery/atmospherics/pipe/manifold{ - dir = 4; - level = 2 +/obj/machinery/atmospherics/pipe/manifold/visible{ + dir = 4 }, /turf/open/floor/plasteel/white, /area/awaymission/moonoutpost19/research) diff --git a/_maps/RandomZLevels/away_mission/undergroundoutpost45.dmm b/_maps/RandomZLevels/away_mission/undergroundoutpost45.dmm index de2105e9d412..ac6d7ab92224 100644 --- a/_maps/RandomZLevels/away_mission/undergroundoutpost45.dmm +++ b/_maps/RandomZLevels/away_mission/undergroundoutpost45.dmm @@ -1197,9 +1197,8 @@ }, /area/awaymission/undergroundoutpost45/central) "cM" = ( -/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{ - dir = 5; - level = 2 +/obj/machinery/atmospherics/pipe/simple/scrubbers/visible{ + dir = 5 }, /turf/open/floor/plating{ heat_capacity = 1e+006 @@ -3826,9 +3825,8 @@ }, /area/awaymission/undergroundoutpost45/crew_quarters) "hU" = ( -/obj/machinery/atmospherics/pipe/simple/supply/hidden{ - dir = 4; - level = 2 +/obj/machinery/atmospherics/pipe/simple/supply/visible{ + dir = 4 }, /obj/structure/table, /obj/item/book/manual/chef_recipes, @@ -3839,9 +3837,8 @@ /area/awaymission/undergroundoutpost45/crew_quarters) "hV" = ( /obj/effect/spawner/structure/window/reinforced, -/obj/machinery/atmospherics/pipe/simple/supply/hidden{ - dir = 4; - level = 2 +/obj/machinery/atmospherics/pipe/simple/supply/visible{ + dir = 4 }, /turf/open/floor/plating{ heat_capacity = 1e+006 @@ -9601,9 +9598,8 @@ /obj/structure/disposalpipe/segment{ dir = 4 }, -/obj/machinery/atmospherics/pipe/simple/supply/hidden{ - dir = 4; - level = 2 +/obj/machinery/atmospherics/pipe/simple/supply/visible{ + dir = 4 }, /obj/machinery/door/airlock/maintenance{ name = "Research Maintenance"; @@ -11552,7 +11548,6 @@ /obj/machinery/atmospherics/pipe/simple/supply/hidden, /obj/machinery/computer/atmos_control{ dir = 4; - level = 3; name = "Distribution and Waste Monitor"; sensors = list("UO45_air_sensor" = "Mixed Air Supply Tank", "UO45_distro_meter" = "Distribution Loop", "UO45_waste_meter" = "Waste Loop") }, diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index 992cd9596bfe..36eee6be9c23 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -45085,9 +45085,7 @@ /turf/open/floor/plasteel, /area/maintenance/disposal/incinerator) "chi" = ( -/obj/machinery/atmospherics/pipe/manifold4w/general{ - level = 2 - }, +/obj/machinery/atmospherics/pipe/manifold4w/visible, /obj/machinery/meter, /turf/open/floor/plasteel, /area/maintenance/disposal/incinerator) diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 1039a07982b4..36797f039152 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -413,11 +413,18 @@ #define COMPONENT_HOSTILE_NO_ATTACK 1 // /obj signals -#define COMSIG_OBJ_DECONSTRUCT "obj_deconstruct" //from base of obj/deconstruct(): (disassembled) -#define COMSIG_OBJ_BREAK "obj_break" //from base of /obj/obj_break(): (damage_flag) -#define COMSIG_OBJ_SETANCHORED "obj_setanchored" //called in /obj/structure/setAnchored(): (value) -#define COMSIG_OBJ_DEFAULT_UNFASTEN_WRENCH "obj_default_unfasten_wrench" //called exclusively in plumbing, for now -#define COMSIG_OBJ_ATTACK_GENERIC "obj_attack_generic" //from base of atom/animal_attack(): (/mob/user) +///from base of obj/deconstruct(): (disassembled) +#define COMSIG_OBJ_DECONSTRUCT "obj_deconstruct" +///from base of /obj/obj_break(): (damage_flag) +#define COMSIG_OBJ_BREAK "obj_break" +///called in /obj/structure/setAnchored(): (value) +#define COMSIG_OBJ_SETANCHORED "obj_setanchored" +///called exclusively in plumbing, for now +#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 base of atom/animal_attack(): (/mob/user) +#define COMSIG_OBJ_ATTACK_GENERIC "obj_attack_generic" #define COMPONENT_STOP_GENERIC_ATTACK 1 diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm new file mode 100644 index 000000000000..4ce1c8b10f02 --- /dev/null +++ b/code/__DEFINES/layers.dm @@ -0,0 +1,216 @@ +//Defines for atom layers and planes +//KEEP THESE IN A NICE ACSCENDING ORDER, PLEASE + +//NEVER HAVE ANYTHING BELOW THIS PLANE ADJUST IF YOU NEED MORE SPACE +#define LOWEST_EVER_PLANE -200 + +#define FIELD_OF_VISION_BLOCKER_PLANE -199 +#define FIELD_OF_VISION_BLOCKER_RENDER_TARGET "*FIELD_OF_VISION_BLOCKER_RENDER_TARGET" + +#define CLICKCATCHER_PLANE -99 + +#define PLANE_SPACE -95 +#define PLANE_SPACE_PARALLAX -90 + +#define GRAVITY_PULSE_PLANE -11 +#define GRAVITY_PULSE_RENDER_TARGET "*GRAVPULSE_RENDER_TARGET" + +#define OPENSPACE_LAYER 600 //Openspace layer over all + +#define TRANSPARENT_FLOOR_PLANE -10 //Transparent plane that shows openspace underneath the floor +#define OPENSPACE_PLANE -9 //Openspace plane below all turfs +#define OPENSPACE_BACKDROP_PLANE -8 //Black square just over openspace plane to guaranteed cover all in openspace turf + + +#define FLOOR_PLANE -7 + +#define GAME_PLANE -6 +#define GAME_PLANE_FOV_HIDDEN -5 +#define GAME_PLANE_UPPER -4 +#define GAME_PLANE_UPPER_FOV_HIDDEN -3 + +#define ABOVE_GAME_PLANE -2 + +// PLANE_SPACE layer(s) +#define SPACE_LAYER 1.8 + +//#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define. Most floors (FLOOR_PLANE) and walls (GAME_PLANE) use this. + +// GAME_PLANE layers +#define CULT_OVERLAY_LAYER 2.01 +#define MID_TURF_LAYER 2.02 +#define HIGH_TURF_LAYER 2.03 +#define TURF_PLATING_DECAL_LAYER 2.031 +#define TURF_DECAL_LAYER 2.039 //Makes turf decals appear in DM how they will look inworld. +#define ABOVE_OPEN_TURF_LAYER 2.04 +#define CLOSED_TURF_LAYER 2.05 +#define BULLET_HOLE_LAYER 2.06 +#define ABOVE_NORMAL_TURF_LAYER 2.08 +#define LATTICE_LAYER 2.2 +#define DISPOSAL_PIPE_LAYER 2.3 +#define GAS_PIPE_HIDDEN_LAYER 2.35 //layer = initial(layer) + piping_layer / 1000 in atmospherics/update_icon() to determine order of pipe overlap +#define WIRE_LAYER 2.4 +#define WIRE_BRIDGE_LAYER 2.44 +#define WIRE_TERMINAL_LAYER 2.45 +#define GAS_SCRUBBER_LAYER 2.46 +#define GAS_PIPE_VISIBLE_LAYER 2.47 //layer = initial(layer) + piping_layer / 1000 in atmospherics/update_icon() to determine order of pipe overlap +#define GAS_FILTER_LAYER 2.48 +#define GAS_PUMP_LAYER 2.49 +#define LOW_OBJ_LAYER 2.5 +///catwalk overlay of /turf/open/floor/plating/catwalk_floor +#define CATWALK_LAYER 2.51 +#define LOW_SIGIL_LAYER 2.52 +#define SIGIL_LAYER 2.53 +#define HIGH_PIPE_LAYER 2.54 +// Anything aboe this layer is not "on" a turf for the purposes of washing +// I hate this life of ours +#define FLOOR_CLEAN_LAYER 2.55 + +#define BELOW_OPEN_DOOR_LAYER 2.6 +#define BLASTDOOR_LAYER 2.65 +#define OPEN_DOOR_LAYER 2.7 +#define DOOR_HELPER_LAYER 2.71 //keep this above OPEN_DOOR_LAYER +#define PROJECTILE_HIT_THRESHHOLD_LAYER 2.75 //projectiles won't hit objects at or below this layer if possible +#define TABLE_LAYER 2.8 +#define GATEWAY_UNDERLAY_LAYER 2.85 +#define BELOW_OBJ_LAYER 2.9 +#define LOW_ITEM_LAYER 2.95 +//#define OBJ_LAYER 3 //For easy recordkeeping; this is a byond define +#define CLOSED_DOOR_LAYER 3.1 +#define CLOSED_FIREDOOR_LAYER 3.11 +#define ABOVE_OBJ_LAYER 3.2 +#define CLOSED_BLASTDOOR_LAYER 3.3 // ABOVE WINDOWS AND DOORS +#define SHUTTER_LAYER 3.3 // HERE BE DRAGONS +#define ABOVE_WINDOW_LAYER 3.3 +#define SIGN_LAYER 3.4 +#define CORGI_ASS_PIN_LAYER 3.41 +#define NOT_HIGH_OBJ_LAYER 3.5 +#define HIGH_OBJ_LAYER 3.6 +#define BELOW_MOB_LAYER 3.7 + +// GAME_PLANE_FOV_HIDDEN layers +#define LOW_MOB_LAYER 3.75 +#define LYING_MOB_LAYER 3.8 +#define VEHICLE_LAYER 3.9 +#define MOB_BELOW_PIGGYBACK_LAYER 3.94 +//#define MOB_LAYER 4 //For easy recordkeeping; this is a byond define +#define MOB_SHIELD_LAYER 4.01 +#define MOB_ABOVE_PIGGYBACK_LAYER 4.06 +#define MOB_UPPER_LAYER 4.07 +#define HITSCAN_PROJECTILE_LAYER 4.09 //above all mob but still hidden by FoV + +// GAME_PLANE_UPPER layers +#define ABOVE_MOB_LAYER 4.1 +#define WALL_OBJ_LAYER 4.25 +#define EDGED_TURF_LAYER 4.3 +#define ON_EDGED_TURF_LAYER 4.35 +#define SPACEVINE_LAYER 4.4 + +// GAME_PLANE_UPPER_FOV_HIDDEN layers +#define LARGE_MOB_LAYER 4.5 +#define SPACEVINE_MOB_LAYER 4.6 + +// Intermediate layer used by both GAME_PLANE_FOV_HIDDEN and ABOVE_GAME_PLANE +#define ABOVE_ALL_MOB_LAYER 4.7 + +// ABOVE_GAME_PLANE layers +//#define FLY_LAYER 5 //For easy recordkeeping; this is a byond define +#define GASFIRE_LAYER 5.05 +#define RIPPLE_LAYER 5.1 + + +#define BLACKNESS_PLANE 0 //To keep from conflicts with SEE_BLACKNESS internals + +#define AREA_PLANE 60 +#define MASSIVE_OBJ_PLANE 70 +#define GHOST_PLANE 80 +#define POINT_PLANE 90 + +#define RAD_TEXT_PLANE 90 + +//---------- LIGHTING ------------- +///Normal 1 per turf dynamic lighting underlays +#define LIGHTING_PLANE 100 + +///Lighting objects that are "free floating" +#define O_LIGHTING_VISUAL_PLANE 110 +#define O_LIGHTING_VISUAL_RENDER_TARGET "O_LIGHT_VISUAL_PLANE" + +///Things that should render ignoring lighting +#define ABOVE_LIGHTING_PLANE 120 + +#define LIGHTING_PRIMARY_LAYER 15 //The layer for the main lights of the station +#define LIGHTING_PRIMARY_DIMMER_LAYER 15.1 //The layer that dims the main lights of the station +#define LIGHTING_SECONDARY_LAYER 16 //The colourful, usually small lights that go on top + + +///visibility + hiding of things outside of light source range +#define BYOND_LIGHTING_PLANE 130 + + +//---------- EMISSIVES ------------- +//Layering order of these is not particularly meaningful. +//Important part is the seperation of the planes for control via plane_master + +/// This plane masks out lighting to create an "emissive" effect, ie for glowing lights in otherwise dark areas. +#define EMISSIVE_PLANE 150 +/// The render target used by the emissive layer. +#define EMISSIVE_RENDER_TARGET "*EMISSIVE_PLANE" +/// The layer you should use if you _really_ don't want an emissive overlay to be blocked. +#define EMISSIVE_LAYER_UNBLOCKABLE 9999 + +///---------------- MISC ----------------------- + +///AI Camera Static +#define CAMERA_STATIC_PLANE 200 + +///Debug Atmos Overlays +#define ATMOS_GROUP_PLANE 450 + +///--------------- FULLSCREEN IMAGES ------------ + +#define FULLSCREEN_PLANE 500 +#define FLASH_LAYER 1 +#define FULLSCREEN_LAYER 2 +#define UI_DAMAGE_LAYER 3 +#define BLIND_LAYER 4 +#define CRIT_LAYER 5 +#define CURSE_LAYER 6 +#define FOV_EFFECTS_LAYER 10000 //Blindness effects are not layer 4, they lie to you + +///--------------- FULLSCREEN RUNECHAT BUBBLES ------------ + +///Popup Chat Messages +#define RUNECHAT_PLANE 501 +/// Plane for balloon text (text that fades up) +#define BALLOON_CHAT_PLANE 502 + +//-------------------- Rendering --------------------- +#define RENDER_PLANE_GAME 990 +#define RENDER_PLANE_NON_GAME 995 +#define RENDER_PLANE_MASTER 999 + +//-------------------- HUD --------------------- +//HUD layer defines +#define HUD_PLANE 1000 +#define ABOVE_HUD_PLANE 1100 + +#define RADIAL_BACKGROUND_LAYER 0 +///1000 is an unimportant number, it's just to normalize copied layers +#define RADIAL_CONTENT_LAYER 1000 + +#define ADMIN_POPUP_LAYER 1 + + +///Plane of the "splash" icon used that shows on the lobby screen. Nothing should ever be above this. +#define SPLASHSCREEN_PLANE 9999 + +#define LOBBY_BACKGROUND_LAYER 3 +#define LOBBY_BUTTON_LAYER 4 + +///cinematics are "below" the splash screen +#define CINEMATIC_LAYER -1 + +///Plane master controller keys +#define PLANE_MASTERS_GAME "plane_masters_game" +#define PLANE_MASTERS_COLORBLIND "plane_masters_colorblind" diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index cbfd8d7429d1..e773c0303fbd 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -268,6 +268,8 @@ // item traits #define TRAIT_NODROP "nodrop" #define TRAIT_SPOOKY_THROW "spooky_throw" +/// Visible on t-ray scanners if the atom/var/level == 1 +#define TRAIT_T_RAY_VISIBLE "t-ray-visible" // common trait sources #define TRAIT_GENERIC "generic" @@ -345,6 +347,8 @@ #define CORRUPTED_SYSTEM "corrupted-system" ///Turf trait for when a turf is transparent #define TURF_Z_TRANSPARENT_TRAIT "turf_z_transparent" +/// Trait applied by element +#define ELEMENT_TRAIT(source) "element_trait_[source]" /// This trait is added by the active directional block system. #define ACTIVE_BLOCK_TRAIT "active_block" /// This trait is added by the parry system. diff --git a/code/__DEFINES/turfs.dm b/code/__DEFINES/turfs.dm new file mode 100644 index 000000000000..db41db90fbf4 --- /dev/null +++ b/code/__DEFINES/turfs.dm @@ -0,0 +1,3 @@ +#define UNDERFLOOR_HIDDEN 0 +#define UNDERFLOOR_VISIBLE 1 +#define UNDERFLOOR_INTERACTABLE 2 diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 4a8156d268d1..3e5fdac7980a 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -133,6 +133,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( ), /obj/item = list( "TRAIT_NODROP" = TRAIT_NODROP, + "TRAIT_T_RAY_VISIBLE" = TRAIT_T_RAY_VISIBLE, "TRAIT_NO_TELEPORT" = TRAIT_NO_TELEPORT, "TRAIT_SPOOKY_THROW" = TRAIT_SPOOKY_THROW ), diff --git a/code/_onclick/hud/families.dm b/code/_onclick/hud/families.dm index eb09d53bc158..323a70e64980 100644 --- a/code/_onclick/hud/families.dm +++ b/code/_onclick/hud/families.dm @@ -5,7 +5,7 @@ icon_state = "wanted_0" screen_loc = ui_wanted_lvl /// Wanted level, affects the hud icon. Level 0 is default, and the level 0 icon is blank, so in case of no families gamemode (and thus no wanted level), this HUD element will never appear. - level = 2 + var/level = 2 /// Boolean, have the cops arrived? If so, the icon stops changing and remains the same. var/cops_arrived = 0 diff --git a/code/controllers/subsystem/minor_mapping.dm b/code/controllers/subsystem/minor_mapping.dm index d6cbf99f9743..e31bbaf2d8e7 100644 --- a/code/controllers/subsystem/minor_mapping.dm +++ b/code/controllers/subsystem/minor_mapping.dm @@ -36,7 +36,7 @@ SUBSYSTEM_DEF(minor_mapping) // var/turf/T = pick_n_take(turfs) // var/obj/item/storage/backpack/satchel/flat/F = new(T) -// SEND_SIGNAL(F, COMSIG_OBJ_HIDE, T.intact) +// SEND_SIGNAL(F, COMSIG_OBJ_HIDE, T.underfloor_accessibility < UNDERFLOOR_VISIBLE) // amount-- /proc/find_exposed_wires() diff --git a/code/controllers/subsystem/persistence/secret_satchels.dm b/code/controllers/subsystem/persistence/secret_satchels.dm index fa2a445317e3..a08d239aad14 100644 --- a/code/controllers/subsystem/persistence/secret_satchels.dm +++ b/code/controllers/subsystem/persistence/secret_satchels.dm @@ -35,8 +35,8 @@ path = text2path(old_secret_satchels[pos]["saved_obj"]) if(F) - if(isfloorturf(F.loc) && !isplatingturf(F.loc)) - F.hide(1) + var/turf/open/floor = get_turf(F) + SEND_SIGNAL(F, COMSIG_OBJ_HIDE, floor.underfloor_accessibility < UNDERFLOOR_VISIBLE) if(ispath(path)) var/spawned_item = new path(F) spawned_objects[spawned_item] = TRUE diff --git a/code/datums/elements/undertile.dm b/code/datums/elements/undertile.dm new file mode 100644 index 000000000000..baa17c55ee7a --- /dev/null +++ b/code/datums/elements/undertile.dm @@ -0,0 +1,66 @@ +/// The alpha we give to stuff under tiles, if they want it +#define ALPHA_UNDERTILE 128 + +///Add to an object if you want to be able to be hidden under tiles +/datum/element/undertile + element_flags = ELEMENT_BESPOKE | COMPONENT_DUPE_HIGHLANDER + id_arg_index = 2 + + ///the invisiblity trait applied, like TRAIT_T_RAY_VISIBLE + var/invisibility_trait + ///level of invisibility applied when under a tile. Could be INVISIBILITY_OBSERVER if you still want it to be visible to ghosts + var/invisibility_level + ///an overlay for the tile if we wish to apply that + var/tile_overlay + ///whether we use alpha or not. TRUE uses ALPHA_UNDERTILE because otherwise we have 200 different instances of this element for different alphas + var/use_alpha + ///We will switch between anchored and unanchored. for stuff like satchels that shouldn't be pullable under tiles but are otherwise unanchored + var/use_anchor + +/datum/element/undertile/Attach(datum/target, invisibility_trait, invisibility_level = INVISIBILITY_MAXIMUM, tile_overlay, use_alpha = TRUE, use_anchor = FALSE) + . = ..() + if(!ismovable(target)) + return ELEMENT_INCOMPATIBLE + + RegisterSignal(target, COMSIG_OBJ_HIDE, .proc/hide) + + src.invisibility_trait = invisibility_trait + src.invisibility_level = invisibility_level + src.tile_overlay = tile_overlay + src.use_alpha = use_alpha + src.use_anchor = use_anchor + +///called when a tile has been covered or uncovered +/datum/element/undertile/proc/hide(atom/movable/source, covered) + SIGNAL_HANDLER + + source.invisibility = covered ? invisibility_level : 0 + + var/turf/T = get_turf(source) + + if(covered) + if(invisibility_trait) + ADD_TRAIT(source, invisibility_trait, ELEMENT_TRAIT(type)) + if(tile_overlay) + T.add_overlay(tile_overlay) + if(use_alpha) + source.alpha = ALPHA_UNDERTILE + if(use_anchor) + source.set_anchored(TRUE) + + else + if(invisibility_trait) + REMOVE_TRAIT(source, invisibility_trait, ELEMENT_TRAIT(type)) + if(tile_overlay) + T.overlays -= tile_overlay + if(use_alpha) + source.alpha = 255 + if(use_anchor) + source.set_anchored(FALSE) + +/datum/element/undertile/Detach(atom/movable/AM, visibility_trait, invisibility_level = INVISIBILITY_MAXIMUM) + . = ..() + + hide(AM, FALSE) + +#undef ALPHA_UNDERTILE diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 6f8faad7c317..c35906f29edd 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -12,7 +12,6 @@ /// pass_flags that we are. If any of this matches a pass_flag on a moving thing, by default, we let them through. var/pass_flags_self = NONE - var/level = 2 ///If non-null, overrides a/an/some in all cases var/article diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index e9968dadd46d..76df121cc99f 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -4,45 +4,27 @@ icon_state = "floor_beaconf" name = "bluespace gigabeacon" desc = "A device that draws power from bluespace and creates a permanent tracking beacon." - level = 1 // underfloor layer = LOW_OBJ_LAYER - use_power = IDLE_POWER_USE + use_power = NO_POWER_USE idle_power_usage = 0 var/obj/item/beacon/Beacon -/obj/machinery/bluespace_beacon/Initialize() +/obj/machinery/bluespace_beacon/Initialize(mapload) . = ..() var/turf/T = loc Beacon = new(T) Beacon.invisibility = INVISIBILITY_MAXIMUM - hide(T.intact) + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) /obj/machinery/bluespace_beacon/Destroy() QDEL_NULL(Beacon) return ..() -// update the invisibility and icon -/obj/machinery/bluespace_beacon/hide(intact) - invisibility = intact ? INVISIBILITY_MAXIMUM : 0 - update_icon() - -// update the icon_state -/obj/machinery/bluespace_beacon/update_icon_state() - var/state="floor_beacon" - - if(invisibility) - icon_state = "[state]f" - - else - icon_state = "[state]" - /obj/machinery/bluespace_beacon/process() - if(!Beacon) + if(QDELETED(Beacon)) //Don't move it out of nullspace BACK INTO THE GAME for the love of god var/turf/T = loc Beacon = new(T) Beacon.invisibility = INVISIBILITY_MAXIMUM else if (Beacon.loc != loc) Beacon.forceMove(loc) - - update_icon() diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index c4494b822fe5..107523833dfa 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -9,7 +9,6 @@ icon_state = "floor_magnet-f" name = "electromagnetic generator" desc = "A device that uses station power to create points of magnetic energy." - level = 1 // underfloor layer = LOW_OBJ_LAYER use_power = IDLE_POWER_USE idle_power_usage = 50 @@ -29,9 +28,8 @@ /obj/machinery/magnetic_module/Initialize() ..() - var/turf/T = loc - hide(T.intact) - center = T + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) + center = get_turf(src) SSradio.add_object(src, freq, RADIO_MAGNETS) return INITIALIZE_HINT_LATELOAD @@ -43,11 +41,6 @@ center = null return ..() -// update the invisibility and icon -/obj/machinery/magnetic_module/hide(intact) - invisibility = intact ? INVISIBILITY_MAXIMUM : 0 - update_icon() - // update the icon_state /obj/machinery/magnetic_module/update_icon_state() var/state="floor_magnet" diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 6a30e98e4c41..b55a819dc0eb 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -5,41 +5,33 @@ icon = 'icons/obj/objects.dmi' icon_state = "navbeacon0-f" + base_icon_state = "navbeacon" name = "navigation beacon" desc = "A radio beacon used for bot navigation." - level = 1 // underfloor layer = LOW_OBJ_LAYER max_integrity = 500 armor = list(MELEE = 70, BULLET = 70, LASER = 70, ENERGY = 70, BOMB = 0, BIO = 0, RAD = 0, FIRE = 80, ACID = 80) - var/open = FALSE // true if cover is open - var/locked = TRUE // true if controls are locked + var/open = FALSE // true if cover is open + var/locked = TRUE // true if controls are locked var/freq = FREQ_NAV_BEACON - var/location = "" // location response text - var/list/codes // assoc. list of transponder codes - var/codes_txt = "" // codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" + var/location = "" // location response text + var/list/codes // assoc. list of transponder codes + var/codes_txt = "" // codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" req_one_access = list(ACCESS_ENGINE, ACCESS_ROBOTICS) -/obj/machinery/navbeacon/Initialize() +/obj/machinery/navbeacon/Initialize(mapload) . = ..() set_codes() - var/turf/T = loc - hide(T.intact) - if(codes["patrol"]) - if(!GLOB.navbeacons["[z]"]) - GLOB.navbeacons["[z]"] = list() - GLOB.navbeacons["[z]"] += src //Register with the patrol list! - if(codes["delivery"]) - GLOB.deliverybeacons += src - GLOB.deliverybeacontags += location + glob_lists_register(init=TRUE) + + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) /obj/machinery/navbeacon/Destroy() - if (GLOB.navbeacons["[z]"]) - GLOB.navbeacons["[z]"] -= src //Remove from beacon list, if in one. - GLOB.deliverybeacons -= src + glob_lists_deregister() return ..() /obj/machinery/navbeacon/onTransitZ(old_z, new_z) @@ -56,10 +48,10 @@ codes = new() - var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons + var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons for(var/e in entries) - var/index = findtext(e, "=") // format is "key=value" + var/index = findtext(e, "=") // format is "key=value" if(index) var/key = copytext(e, 1, index) var/val = copytext(e, index + length(e[index])) @@ -67,63 +59,71 @@ else codes[e] = "1" +/obj/machinery/navbeacon/proc/glob_lists_deregister() + if (GLOB.navbeacons["[z]"]) + GLOB.navbeacons["[z]"] -= src //Remove from beacon list, if in one. + GLOB.deliverybeacons -= src + GLOB.deliverybeacontags -= location -// called when turf state changes -// hide the object if turf is intact -/obj/machinery/navbeacon/hide(intact) - invisibility = intact ? INVISIBILITY_MAXIMUM : 0 - update_icon() +/obj/machinery/navbeacon/proc/glob_lists_register(init=FALSE) + if(!init) + glob_lists_deregister() + if(!codes) + return + if(codes["patrol"]) + if(!GLOB.navbeacons["[z]"]) + GLOB.navbeacons["[z]"] = list() + GLOB.navbeacons["[z]"] += src //Register with the patrol list! + if(codes["delivery"]) + GLOB.deliverybeacons += src + GLOB.deliverybeacontags += location // update the icon_state /obj/machinery/navbeacon/update_icon_state() - var/state="navbeacon[open]" + icon_state = "[base_icon_state][open]" + return ..() - if(invisibility) - icon_state = "[state]-f" // if invisible, set icon to faded version - // in case revealed by T-scanner - else - icon_state = "[state]" +/obj/machinery/navbeacon/screwdriver_act(mob/living/user, obj/item/tool) + add_fingerprint(user) + open = !open + user.visible_message(span_notice("[user] [open ? "opens" : "closes"] the beacon's cover."), span_notice("You [open ? "open" : "close"] the beacon's cover.")) + update_appearance() + tool.play_tool_sound(src, 50) + return TRUE /obj/machinery/navbeacon/attackby(obj/item/I, mob/user, params) var/turf/T = loc - if(T.intact) - return // prevent intraction when T-scanner revealed - - if(I.tool_behaviour == TOOL_SCREWDRIVER) - open = !open - - user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") - - update_icon() + if(T.underfloor_accessibility < UNDERFLOOR_INTERACTABLE) + return // prevent intraction when T-scanner revealed else if (istype(I, /obj/item/card/id)||istype(I, /obj/item/pda)) if(open) if (src.allowed(user)) src.locked = !src.locked - to_chat(user, "Controls are now [src.locked ? "locked" : "unlocked"].") + to_chat(user, span_notice("Controls are now [src.locked ? "locked" : "unlocked"].")) else - to_chat(user, "Access denied.") + to_chat(user, span_danger("Access denied.")) updateDialog() else - to_chat(user, "You must open the cover first!") + to_chat(user, span_warning("You must open the cover first!")) else return ..() /obj/machinery/navbeacon/attack_ai(mob/user) interact(user, 1) -/obj/machinery/navbeacon/attack_paw() +/obj/machinery/navbeacon/attack_paw(mob/user, list/modifiers) return /obj/machinery/navbeacon/ui_interact(mob/user) . = ..() var/ai = isAI(user) var/turf/T = loc - if(T.intact) - return // prevent intraction when T-scanner revealed + if(T.underfloor_accessibility < UNDERFLOOR_INTERACTABLE) + return // prevent intraction when T-scanner revealed - if(!open && !ai) // can't alter controls if not open, unless you're an AI - to_chat(user, "The beacon's control cover is closed!") + if(!open && !ai) // can't alter controls if not open, unless you're an AI + to_chat(user, span_warning("The beacon's control cover is closed!")) return @@ -150,9 +150,9 @@ Transponder Codes: