From c04abab2bfad0d572c27a713fda142dcb45b451e Mon Sep 17 00:00:00 2001 From: Time-Green Date: Mon, 16 Mar 2020 08:37:59 +0100 Subject: [PATCH] [READY] Makes plumbing mappable and reworks hiding (#49644) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🆑 tweak: Ducts can now be hidden under tiles code: tile hiding is now an element and way cooler and sexier /🆑 Ducts can now be hidden under tiles Plumbing machinery connects can now be hidden aswell Plumbing can now also be properly mapped in without breaking anything Plumbing component now uses the normal overlay systeem instead of being a weird exception You can now add the /datum/element/undertile element to instantly make something hidable under tiles when appropriate. --- _maps/RandomZLevels/moonoutpost19.dmm | 3 +- _maps/RandomZLevels/undergroundoutpost45.dmm | 5 -- code/__DEFINES/dcs/signals.dm | 1 + code/__DEFINES/misc.dm | 3 + code/controllers/subsystem/minor_mapping.dm | 6 +- code/datums/components/plumbing/_plumbing.dm | 59 ++++++++++++++----- code/datums/elements/undertile.dm | 59 +++++++++++++++++++ code/game/area/areas.dm | 1 - code/game/atoms.dm | 1 - code/game/machinery/Beacon.dm | 20 +------ code/game/machinery/magnet.dm | 16 ++--- code/game/machinery/navbeacon.dm | 20 +------ code/game/machinery/pipe/construction.dm | 1 - .../effects/effect_system/effects_foam.dm | 4 -- .../effects/effect_system/effects_smoke.dm | 2 - .../objects/items/devices/pressureplates.dm | 26 +++----- code/game/objects/items/devices/scanners.dm | 2 - code/game/objects/items/puzzle_pieces.dm | 5 +- code/game/objects/items/storage/backpack.dm | 17 ++---- code/game/objects/obj_defense.dm | 8 --- code/game/objects/objs.dm | 3 - code/game/objects/structures/safe.dm | 10 +--- code/game/objects/structures/window.dm | 7 +-- code/game/turfs/open/floor.dm | 3 +- code/game/turfs/open/floor/plating.dm | 7 +-- code/game/turfs/turf.dm | 26 ++------ .../atmospherics/machinery/atmosmachinery.dm | 7 --- .../binary_devices/binary_devices.dm | 4 -- .../components/binary_devices/dp_vent_pump.dm | 1 - .../machinery/components/components_base.dm | 21 ++++--- .../unary_devices/outlet_injector.dm | 1 - .../components/unary_devices/passive_vent.dm | 1 - .../unary_devices/portables_connector.dm | 4 -- .../components/unary_devices/unary_devices.dm | 4 -- .../components/unary_devices/vent_pump.dm | 1 - .../components/unary_devices/vent_scrubber.dm | 1 - .../atmospherics/machinery/other/meter.dm | 2 - .../machinery/pipes/heat_exchange/he_pipes.dm | 4 -- .../machinery/pipes/heat_exchange/junction.dm | 2 - .../machinery/pipes/heat_exchange/manifold.dm | 2 - .../pipes/heat_exchange/manifold4w.dm | 2 - .../machinery/pipes/heat_exchange/simple.dm | 2 - .../machinery/pipes/layermanifold.dm | 5 -- .../atmospherics/machinery/pipes/manifold.dm | 1 - .../machinery/pipes/manifold4w.dm | 1 - .../atmospherics/machinery/pipes/mapping.dm | 4 -- .../atmospherics/machinery/pipes/pipes.dm | 25 ++------ .../atmospherics/machinery/pipes/simple.dm | 1 - code/modules/mob/dead/observer/observer.dm | 2 - code/modules/plumbing/ducts.dm | 14 ++++- code/modules/power/cable.dm | 13 +--- code/modules/power/terminal.dm | 15 +---- .../projectiles/guns/misc/beam_rifle.dm | 2 - .../recycling/disposal/construction.dm | 12 +--- code/modules/recycling/disposal/pipe.dm | 14 +---- code/modules/shuttle/on_move.dm | 21 +------ config/admins.txt | 1 + tgstation.dme | 1 + 58 files changed, 187 insertions(+), 319 deletions(-) create mode 100644 code/datums/elements/undertile.dm diff --git a/_maps/RandomZLevels/moonoutpost19.dmm b/_maps/RandomZLevels/moonoutpost19.dmm index 153a3ca27e4..2f6d0af8bde 100644 --- a/_maps/RandomZLevels/moonoutpost19.dmm +++ b/_maps/RandomZLevels/moonoutpost19.dmm @@ -2178,8 +2178,7 @@ /area/awaymission/moonoutpost19/research) "ex" = ( /obj/machinery/atmospherics/pipe/manifold{ - dir = 4; - level = 2 + dir = 4 }, /obj/structure/cable, /turf/open/floor/plasteel/white, diff --git a/_maps/RandomZLevels/undergroundoutpost45.dmm b/_maps/RandomZLevels/undergroundoutpost45.dmm index b58ef84501e..4215651a728 100644 --- a/_maps/RandomZLevels/undergroundoutpost45.dmm +++ b/_maps/RandomZLevels/undergroundoutpost45.dmm @@ -1184,7 +1184,6 @@ "cM" = ( /obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{ dir = 5; - level = 2 }, /turf/open/floor/plating{ heat_capacity = 1e+006 @@ -3873,7 +3872,6 @@ "hU" = ( /obj/machinery/atmospherics/pipe/simple/supply/hidden{ dir = 4; - level = 2 }, /obj/structure/table, /obj/item/book/manual/chef_recipes, @@ -3886,7 +3884,6 @@ /obj/effect/spawner/structure/window/reinforced, /obj/machinery/atmospherics/pipe/simple/supply/hidden{ dir = 4; - level = 2 }, /turf/open/floor/plating{ heat_capacity = 1e+006 @@ -9399,7 +9396,6 @@ }, /obj/machinery/atmospherics/pipe/simple/supply/hidden{ dir = 4; - level = 2 }, /obj/machinery/door/airlock/maintenance{ name = "Research Maintenance"; @@ -11265,7 +11261,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/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 46c75d05b93..b4f95f407b8 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -248,6 +248,7 @@ #define COMSIG_OBJ_DECONSTRUCT "obj_deconstruct" //from base of obj/deconstruct(): (disassembled) #define COMSIG_OBJ_SETANCHORED "obj_setanchored" //called in /obj/structure/setAnchored(): (value) #define COMSIG_OBJ_DEFAULT_UNFASTEN_WRENCH "obj_default_unfasten_wrench" //from base of code/game/machinery +#define COMSIG_OBJ_HIDE "obj_hide" //from base of /turf/proc/levelupdate(). (intact) true to hide and false to unhide // /obj/machinery signals #define COMSIG_MACHINERY_BROKEN "machinery_broken" //from /obj/machinery/obj_break(damage_flag): (damage_flag) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 2dc7aa59607..18c4bfef74d 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -482,3 +482,6 @@ GLOBAL_LIST_INIT(pda_styles, sortList(list(MONO, VT, ORBITRON, SHARE))) #define ALIGNMENT_GOOD "good" #define ALIGNMENT_NEUT "neutral" #define ALIGNMENT_EVIL "evil" + +// The alpha we give to stuff under tiles, if they want it +#define ALPHA_UNDERTILE 128 diff --git a/code/controllers/subsystem/minor_mapping.dm b/code/controllers/subsystem/minor_mapping.dm index 8f471e40dce..08cd08780b8 100644 --- a/code/controllers/subsystem/minor_mapping.dm +++ b/code/controllers/subsystem/minor_mapping.dm @@ -29,10 +29,10 @@ SUBSYSTEM_DEF(minor_mapping) while(turfs.len && amount > 0) var/turf/T = pick_n_take(turfs) - var/obj/item/storage/backpack/satchel/flat/S = new(T) - S.hide(intact=TRUE) - amount-- + var/obj/item/storage/backpack/satchel/flat/F = new(T) + SEND_SIGNAL(F, COMSIG_OBJ_HIDE, T.intact) + amount-- /proc/find_exposed_wires() var/list/exposed_wires = list() diff --git a/code/datums/components/plumbing/_plumbing.dm b/code/datums/components/plumbing/_plumbing.dm index 2bc2fc3c86b..31e1931b23b 100644 --- a/code/datums/components/plumbing/_plumbing.dm +++ b/code/datums/components/plumbing/_plumbing.dm @@ -3,10 +3,10 @@ var/list/datum/ductnet/ducts = list() ///shortcut to our parents' reagent holder var/datum/reagents/reagents - ///TRUE if we wanna add proper pipe outless under our parent object. this is pretty good if i may so so myself + ///TRUE if we wanna add proper pipe overlays under our parent object. this is pretty good if i may so so myself var/use_overlays = TRUE - ///We can't just cut all of the parents' overlays, so we'll track them here - var/list/image/ducterlays + ///Whether our tile is covered and we should hide our ducts + var/tile_covered = FALSE ///directions in wich we act as a supplier var/supply_connects ///direction in wich we act as a demander @@ -17,8 +17,9 @@ var/turn_connects = TRUE /datum/component/plumbing/Initialize(start=TRUE, _turn_connects=TRUE) //turn_connects for wheter or not we spin with the object to change our pipes - if(parent && !ismovable(parent)) + if(!ismovable(parent)) return COMPONENT_INCOMPATIBLE + var/atom/movable/AM = parent if(!AM.reagents) return COMPONENT_INCOMPATIBLE @@ -27,9 +28,13 @@ RegisterSignal(parent, list(COMSIG_MOVABLE_MOVED,COMSIG_PARENT_PREQDELETED), .proc/disable) RegisterSignal(parent, list(COMSIG_OBJ_DEFAULT_UNFASTEN_WRENCH), .proc/toggle_active) + RegisterSignal(parent, list(COMSIG_OBJ_HIDE), .proc/hide) + RegisterSignal(parent, list(COMSIG_ATOM_UPDATE_OVERLAYS), .proc/create_overlays) if(start) - enable() + //timer 0 so it can finish returning initialize, after which we're added to the parent. + //Only then can we tell the duct next to us they can connect, because only then is the component really added. this was a fun one + addtimer(CALLBACK(src, .proc/enable), 0) if(use_overlays) create_overlays() @@ -42,6 +47,7 @@ for(var/D in GLOB.cardinals) if(D & demand_connects) send_request(D) + ///Can we be added to the ductnet? /datum/component/plumbing/proc/can_add(datum/ductnet/D, dir) if(!active) @@ -52,9 +58,11 @@ return FALSE return TRUE + ///called from in process(). only calls process_request(), but can be overwritten for children with special behaviour /datum/component/plumbing/proc/send_request(dir) process_request(amount = MACHINE_REAGENT_TRANSFER, reagent = null, dir = dir) + ///check who can give us what we want, and how many each of them will give us /datum/component/plumbing/proc/process_request(amount, reagent, dir) var/list/valid_suppliers = list() @@ -69,6 +77,7 @@ for(var/A in valid_suppliers) var/datum/component/plumbing/give = A give.transfer_to(src, amount / valid_suppliers.len, reagent, net) + ///returns TRUE when they can give the specified amount and reagent. called by process request /datum/component/plumbing/proc/can_give(amount, reagent, datum/ductnet/net) if(amount <= 0) @@ -81,6 +90,7 @@ return TRUE else if(reagents.total_volume > 0) //take whatever return TRUE + ///this is where the reagent is actually transferred and is thus the finish point of our process() /datum/component/plumbing/proc/transfer_to(datum/component/plumbing/target, amount, reagent, datum/ductnet/net) if(!reagents || !target || !target.reagents) @@ -89,13 +99,12 @@ reagents.trans_id_to(target.parent, reagent, amount) else reagents.trans_to(target.parent, amount, round_robin = TRUE)//we deal with alot of precise calculations so we round_robin=TRUE. Otherwise we get floating point errors, 1 != 1 and 2.5 + 2.5 = 6 + ///We create our luxurious piping overlays/underlays, to indicate where we do what. only called once if use_overlays = TRUE in Initialize() -/datum/component/plumbing/proc/create_overlays() - var/atom/movable/AM = parent - for(var/image/I in ducterlays) - AM.overlays.Remove(I) - qdel(I) - ducterlays = list() +/datum/component/plumbing/proc/create_overlays(atom/A, list/overlays) + if(tile_covered || !use_overlays) + return + for(var/D in GLOB.cardinals) var/color var/direction @@ -105,6 +114,7 @@ color = "blue" //blue is nice and gives else continue + var/image/I if(turn_connects) switch(D) @@ -116,21 +126,25 @@ direction = "east" if(WEST) direction = "west" - I = image('icons/obj/plumbing/plumbers.dmi', "[direction]-[color]", layer = AM.layer - 1) + I = image('icons/obj/plumbing/plumbers.dmi', "[direction]-[color]", layer = A.layer - 1) else - I = image('icons/obj/plumbing/plumbers.dmi', color, layer = AM.layer - 1) //color is not color as in the var, it's just the name + I = image('icons/obj/plumbing/plumbers.dmi', color, layer = A.layer - 1) //color is not color as in the var, it's just the name I.dir = D - AM.add_overlay(I) - ducterlays += I + overlays += I + ///we stop acting like a plumbing thing and disconnect if we are, so we can safely be moved and stuff /datum/component/plumbing/proc/disable() if(!active) return + STOP_PROCESSING(SSfluids, src) + for(var/A in ducts) var/datum/ductnet/D = ducts[A] D.remove_plumber(src) + active = FALSE + for(var/D in GLOB.cardinals) if(D & (demand_connects | supply_connects)) for(var/obj/machinery/duct/duct in get_step(parent, D)) @@ -141,8 +155,10 @@ /datum/component/plumbing/proc/enable() if(active) return + update_dir() active = TRUE + var/atom/movable/AM = parent for(var/obj/machinery/duct/D in AM.loc) //Destroy any ducts under us. Ducts also self destruct if placed under a plumbing machine. machines disable when they get moved if(D.anchored) //that should cover everything @@ -152,8 +168,10 @@ START_PROCESSING(SSfluids, src) for(var/D in GLOB.cardinals) + if(D & (demand_connects | supply_connects)) for(var/atom/movable/A in get_step(parent, D)) + if(istype(A, /obj/machinery/duct)) var/obj/machinery/duct/duct = A duct.attempt_connect() @@ -168,17 +186,20 @@ enable() else disable() + /** We update our connects only when we settle down by taking our current and original direction to find our new connects * If someone wants it to fucking spin while connected to something go actually knock yourself out */ /datum/component/plumbing/proc/update_dir() if(!turn_connects) return + var/atom/movable/AM = parent var/new_demand_connects var/new_supply_connects var/new_dir = AM.dir var/angle = 180 - dir2angle(new_dir) + if(new_dir == SOUTH) demand_connects = initial(demand_connects) supply_connects = initial(supply_connects) @@ -190,10 +211,12 @@ new_supply_connects += turn(D, angle) demand_connects = new_demand_connects supply_connects = new_supply_connects + ///Give the direction of a pipe, and it'll return wich direction it originally was when it's object pointed SOUTH /datum/component/plumbing/proc/get_original_direction(dir) var/atom/movable/AM = parent return turn(dir, dir2angle(AM.dir) - 180) + //special case in-case we want to connect directly with another machine without a duct /datum/component/plumbing/proc/direct_connect(datum/component/plumbing/P, dir) if(!P.active) @@ -204,12 +227,18 @@ net.add_plumber(src, dir) net.add_plumber(P, opposite_dir) +/datum/component/plumbing/proc/hide(atom/movable/AM, intact) + tile_covered = intact + AM.update_icon() + ///has one pipe input that only takes, example is manual output pipe /datum/component/plumbing/simple_demand demand_connects = NORTH + ///has one pipe output that only supplies. example is liquid pump and manual input pipe /datum/component/plumbing/simple_supply supply_connects = NORTH + ///input and output, like a holding tank /datum/component/plumbing/tank demand_connects = WEST diff --git a/code/datums/elements/undertile.dm b/code/datums/elements/undertile.dm new file mode 100644 index 00000000000..7bdbae2aa14 --- /dev/null +++ b/code/datums/elements/undertile.dm @@ -0,0 +1,59 @@ +///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 shouldnt 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) + source.invisibility = covered ? invisibility_level : 0 + + var/turf/T = get_turf(source) + + if(covered) + if(invisibility_trait) + ADD_TRAIT(source, invisibility_trait, TRAIT_GENERIC) + if(tile_overlay) + T.add_overlay(tile_overlay) + if(use_alpha) + source.alpha = ALPHA_UNDERTILE + if(use_anchor) + source.anchored = TRUE + + else + if(invisibility_trait) + REMOVE_TRAIT(source, invisibility_trait, TRAIT_GENERIC) + if(tile_overlay) + T.overlays -= tile_overlay + if(use_alpha) + source.alpha = 255 + if(use_anchor) + source.anchored = FALSE + +/datum/element/undertile/Detach(atom/movable/AM, visibility_trait, invisibility_level = INVISIBILITY_MAXIMUM) + . = ..() + + hide(AM, FALSE) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 139fe43fe9c..55dcfd04a25 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -4,7 +4,6 @@ * A grouping of tiles into a logical space, mostly used by map editors */ /area - level = null name = "Space" icon = 'icons/turf/areas.dmi' icon_state = "unknown" diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 52b02101ee0..9005e43bd25 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -7,7 +7,6 @@ /atom layer = TURF_LAYER plane = GAME_PLANE - 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 3d0931d534b..7593e392fc8 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -4,7 +4,6 @@ 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 idle_power_usage = 0 @@ -16,27 +15,12 @@ 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 - updateicon() - -// update the icon_state -/obj/machinery/bluespace_beacon/proc/updateicon() - var/state="floor_beacon" - - if(invisibility) - icon_state = "[state]f" - - else - icon_state = "[state]" - /obj/machinery/bluespace_beacon/process() if(!Beacon) var/turf/T = loc @@ -44,5 +28,3 @@ Beacon.invisibility = INVISIBILITY_MAXIMUM else if (Beacon.loc != loc) Beacon.forceMove(loc) - - updateicon() diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 43daf1ec5f1..02c320f2a48 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 @@ -30,9 +29,11 @@ /obj/machinery/magnetic_module/Initialize() ..() var/turf/T = loc - hide(T.intact) center = T SSradio.add_object(src, freq, RADIO_MAGNETS) + + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) + return INITIALIZE_HINT_LATELOAD /obj/machinery/magnetic_module/LateInitialize() @@ -43,23 +44,16 @@ 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" var/onstate="" + if(!on) onstate="0" - if(invisibility) - icon_state = "[state][onstate]-f" // if invisible, set icon to faded version - // in case of being revealed by T-scanner - else - icon_state = "[state][onstate]" + icon_state = "[state][onstate]" /obj/machinery/magnetic_module/receive_signal(datum/signal/signal) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 4cb33e4d1a1..64ea63081cf 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -7,7 +7,6 @@ icon_state = "navbeacon0-f" name = "navigation beacon" desc = "A radio beacon used for bot navigation and crew wayfinding." - 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) @@ -36,11 +35,10 @@ set_codes() - var/turf/T = loc - hide(T.intact) - glob_lists_register(init=TRUE) + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) + /obj/machinery/navbeacon/Destroy() glob_lists_deregister() return ..() @@ -90,21 +88,9 @@ if(codes["wayfinding"]) GLOB.wayfindingbeacons += src -// called when turf state changes -// hide the object if turf is intact -/obj/machinery/navbeacon/hide(intact) - invisibility = intact ? INVISIBILITY_MAXIMUM : 0 - update_icon() - // update the icon_state /obj/machinery/navbeacon/update_icon_state() - var/state="navbeacon[open]" - - if(invisibility) - icon_state = "[state]-f" // if invisible, set icon to faded version - // in case revealed by T-scanner - else - icon_state = "[state]" + icon_state = "navbeacon[open]" /obj/machinery/navbeacon/attackby(obj/item/I, mob/user, params) var/turf/T = loc diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index e5d42354373..25c9bddeff0 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -18,7 +18,6 @@ Buildable meters icon_state = "simple" item_state = "buildpipe" w_class = WEIGHT_CLASS_NORMAL - level = 2 var/piping_layer = PIPING_LAYER_DEFAULT var/RPD_type diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index c6461b6baac..1edd966ce0b 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -141,10 +141,6 @@ for(var/obj/O in range(0,src)) if(O.type == src.type) continue - if(isturf(O.loc)) - var/turf/T = O.loc - if(T.intact && O.level == 1) //hidden under the floor - continue if(lifetime % reagent_divisor) reagents.reaction(O, VAPOR, fraction) var/hit = 0 diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 0493a176827..daff05e223c 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -232,8 +232,6 @@ for(var/atom/movable/AM in T) if(AM.type == src.type) continue - if(T.intact && AM.level == 1) //hidden under the floor - continue reagents.reaction(AM, TOUCH, fraction) reagents.reaction(T, TOUCH, fraction) diff --git a/code/game/objects/items/devices/pressureplates.dm b/code/game/objects/items/devices/pressureplates.dm index 60fa1fbadb4..50b105220dd 100644 --- a/code/game/objects/items/devices/pressureplates.dm +++ b/code/game/objects/items/devices/pressureplates.dm @@ -4,7 +4,6 @@ icon = 'icons/obj/puzzle_small.dmi' item_state = "flash" icon_state = "pressureplate" - level = 1 layer = LOW_OBJ_LAYER var/trigger_mob = TRUE var/trigger_item = FALSE @@ -30,8 +29,9 @@ sigdev = new sigdev.code = roundstart_signaller_code sigdev.frequency = roundstart_signaller_freq - if(isopenturf(loc)) - hide(TRUE) + + AddElement(/datum/element/undertile, tile_overlay = tile_overlay, use_anchor = TRUE) + RegisterSignal(src, COMSIG_OBJ_HIDE, .proc/ToggleActive) /obj/item/pressure_plate/Crossed(atom/movable/AM) . = ..() @@ -76,19 +76,7 @@ else to_chat(user, "You turn [src] off.") -/obj/item/pressure_plate/hide(yes) - if(yes) - invisibility = INVISIBILITY_MAXIMUM - anchored = TRUE - icon_state = null - active = TRUE - can_trigger = TRUE - if(tile_overlay) - loc.add_overlay(tile_overlay) - else - invisibility = initial(invisibility) - anchored = FALSE - icon_state = initial(icon_state) - active = FALSE - if(tile_overlay) - loc.overlays -= tile_overlay +///Called from COMSIG_OBJ_HIDE to toggle the active part, because yeah im not making a special exception on the element to support it +/obj/item/pressure_plate/proc/ToggleActive(datum/source, covered) + active = covered + diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index b02b4f84b05..6b8e96368fd 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -65,8 +65,6 @@ GENE SCANNER return var/list/t_ray_images = list() for(var/obj/O in orange(distance, viewer) ) - if(O.level != 1) - continue if(O.invisibility == INVISIBILITY_MAXIMUM || HAS_TRAIT(O, TRAIT_T_RAY_VISIBLE)) var/image/I = new(loc = get_turf(O)) diff --git a/code/game/objects/items/puzzle_pieces.dm b/code/game/objects/items/puzzle_pieces.dm index 69cc78fe135..24fd1a30044 100644 --- a/code/game/objects/items/puzzle_pieces.dm +++ b/code/game/objects/items/puzzle_pieces.dm @@ -116,9 +116,10 @@ var/reward = /obj/item/reagent_containers/food/snacks/cookie var/claimed = FALSE -/obj/item/pressure_plate/hologrid/hide(yes) +/obj/item/pressure_plate/hologrid/Initialize() . = ..() - anchored = TRUE + + AddElement(/datum/element/undertile, tile_overlay = tile_overlay) //we remove use_anchor here, so it ALWAYS stays anchored /obj/item/pressure_plate/hologrid/examine(mob/user) . = ..() diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 59463a09fbf..947fc25548e 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -302,7 +302,10 @@ icon_state = "satchel-flat" item_state = "satchel-flat" w_class = WEIGHT_CLASS_NORMAL //Can fit in backpacks itself. - level = 1 + +/obj/item/storage/backpack/satchel/flat/Initialize(mapload) + . = ..() + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE, INVISIBILITY_OBSERVER, use_anchor = TRUE) /obj/item/storage/backpack/satchel/flat/ComponentInitialize() . = ..() @@ -310,18 +313,6 @@ STR.max_combined_w_class = 15 STR.set_holdable(null, list(/obj/item/storage/backpack/satchel/flat)) //muh recursive backpacks) -/obj/item/storage/backpack/satchel/flat/hide(intact) - if(intact) - invisibility = INVISIBILITY_OBSERVER - anchored = TRUE //otherwise you can start pulling, cover it, and drag around an invisible backpack. - icon_state = "[initial(icon_state)]2" - ADD_TRAIT(src, TRAIT_T_RAY_VISIBLE, TRAIT_GENERIC) - else - invisibility = initial(invisibility) - anchored = FALSE - icon_state = initial(icon_state) - REMOVE_TRAIT(src, TRAIT_T_RAY_VISIBLE, TRAIT_GENERIC) - /obj/item/storage/backpack/satchel/flat/PopulateContents() var/datum/supply_pack/costumes_toys/randomised/contraband/C = new for(var/i in 1 to 2) diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index e5a093a35d8..4208ec3e300 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -90,10 +90,6 @@ return TRUE /obj/blob_act(obj/structure/blob/B) - if(isturf(loc)) - var/turf/T = loc - if(T.intact && level == 1) //the blob doesn't destroy thing below the floor - return take_damage(400, BRUTE, "melee", 0, get_dir(src, B)) /obj/proc/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, armor_penetration = 0) //used by attack_alien, attack_animal, and attack_slime @@ -201,10 +197,6 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e ///Called when the obj is exposed to fire. /obj/fire_act(exposed_temperature, exposed_volume) - if(isturf(loc)) - var/turf/T = loc - if(T.intact && level == 1) //fire can't damage things hidden below the floor. - return if(exposed_temperature && !(resistance_flags & FIRE_PROOF)) take_damage(clamp(0.02 * exposed_temperature, 0, 20), BURN, "fire", 0) if(!(resistance_flags & ON_FIRE) && (resistance_flags & FLAMMABLE) && !(resistance_flags & FIRE_PROOF)) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 4cfa3482006..06921570865 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -198,9 +198,6 @@ if(istype(M) && M.client && M.machine == src) src.attack_self(M) -/obj/proc/hide(h) - return - /obj/singularity_pull(S, current_size) ..() if(!anchored || current_size >= STAGE_FIVE) diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 4a2b6a65448..0496aa49ed3 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -13,7 +13,7 @@ FLOOR SAFES anchored = TRUE density = TRUE resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF - interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT + interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT var/open = FALSE //is the safe open? var/tumbler_1_pos //the tumbler position- from 0 to 72 var/tumbler_1_open //the tumbler position to open at- 0 to 72 @@ -196,16 +196,10 @@ FLOOR SAFES name = "floor safe" icon_state = "floorsafe" density = FALSE - level = 1 //underfloor layer = LOW_OBJ_LAYER /obj/structure/safe/floor/Initialize(mapload) . = ..() - if(mapload) - var/turf/T = loc - hide(T.intact) - -/obj/structure/safe/floor/hide(var/intact) - invisibility = intact ? INVISIBILITY_MAXIMUM : 0 + AddElement(/datum/element/undertile) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index cb2c0d83539..2d3280c1c8b 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -634,7 +634,6 @@ smooth = SMOOTH_TRUE state = RWINDOW_SECURE canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile, /obj/structure/window/plasma/fulltile, /obj/structure/window/plasma/reinforced/fulltile) - level = 3 glass_amount = 2 /obj/structure/window/reinforced/fulltile/unanchored @@ -649,7 +648,6 @@ flags_1 = PREVENT_CLICK_UNDER_1 smooth = SMOOTH_TRUE canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile, /obj/structure/window/plasma/fulltile, /obj/structure/window/plasma/reinforced/fulltile) - level = 3 glass_amount = 2 /obj/structure/window/reinforced/fulltile/ice @@ -657,7 +655,6 @@ icon_state = "ice_window" max_integrity = 150 canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile, /obj/structure/window/plasma/fulltile, /obj/structure/window/plasma/reinforced/fulltile) - level = 3 glass_amount = 2 /obj/structure/window/shuttle @@ -676,7 +673,6 @@ smooth = SMOOTH_TRUE canSmoothWith = null explosion_block = 3 - level = 3 glass_type = /obj/item/stack/sheet/titaniumglass glass_amount = 2 @@ -704,8 +700,7 @@ smooth = SMOOTH_TRUE canSmoothWith = null explosion_block = 3 - damage_deflection = 11 //The same as normal reinforced windows. - level = 3 + damage_deflection = 11 //The same as normal reinforced windows.3 glass_type = /obj/item/stack/sheet/plastitaniumglass glass_amount = 2 rad_insulation = RAD_HEAVY_INSULATION diff --git a/code/game/turfs/open/floor.dm b/code/game/turfs/open/floor.dm index bfdbead98a9..d3f69c33003 100644 --- a/code/game/turfs/open/floor.dm +++ b/code/game/turfs/open/floor.dm @@ -98,8 +98,7 @@ /turf/open/floor/is_shielded() for(var/obj/structure/A in contents) - if(A.level == 3) - return 1 + return 1 /turf/open/floor/blob_act(obj/structure/blob/B) return diff --git a/code/game/turfs/open/floor/plating.dm b/code/game/turfs/open/floor/plating.dm index 4668993ac78..694fb778d18 100644 --- a/code/game/turfs/open/floor/plating.dm +++ b/code/game/turfs/open/floor/plating.dm @@ -69,10 +69,9 @@ else if(istype(C, /obj/item/stack/tile)) if(!broken && !burnt) for(var/obj/O in src) - if(O.level == 1) //ex. pipes laid underneath a tile - for(var/M in O.buckled_mobs) - to_chat(user, "Someone is buckled to \the [O]! Unbuckle [M] to move \him out of the way.") - return + for(var/M in O.buckled_mobs) + to_chat(user, "Someone is buckled to \the [O]! Unbuckle [M] to move \him out of the way.") + return var/obj/item/stack/tile/W = C if(!W.use(1)) return diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 89c6d6d22e5..00f0ff1bfed 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -1,6 +1,5 @@ /turf icon = 'icons/turf/floors.dmi' - level = 1 var/intact = 1 @@ -342,14 +341,12 @@ /turf/proc/levelupdate() for(var/obj/O in src) - if(O.level == 1 && (O.flags_1 & INITIALIZED_1)) - O.hide(src.intact) + if(O.flags_1 & INITIALIZED_1) + SEND_SIGNAL(O, COMSIG_OBJ_HIDE, intact) // override for space turfs, since they should never hide anything /turf/open/space/levelupdate() - for(var/obj/O in src) - if(O.level == 1 && (O.flags_1 & INITIALIZED_1)) - O.hide(0) + return // Removes all signs of lattice on the pos of the turf -Donkieyo /turf/proc/RemoveLattice() @@ -398,8 +395,6 @@ /turf/singularity_act() if(intact) for(var/obj/O in contents) //this is for deleting things like wires contained in the turf - if(O.level != 1) - continue if(O.invisibility == INVISIBILITY_MAXIMUM) O.singularity_act() ScrapeAway(flags = CHANGETURF_INHERIT_AIR) @@ -427,19 +422,10 @@ /turf/proc/is_shielded() /turf/contents_explosion(severity, target) - var/affecting_level - if(severity == 1) - affecting_level = 1 - else if(is_shielded()) - affecting_level = 3 - else if(intact) - affecting_level = 2 - else - affecting_level = 1 for(var/V in contents) var/atom/A = V - if(!QDELETED(A) && A.level >= affecting_level) + if(!QDELETED(A)) if(ismovable(A)) var/atom/movable/AM = A if(!AM.ex_check(explosion_id)) @@ -488,11 +474,9 @@ acid_type = /obj/effect/acid/alien var/has_acid_effect = FALSE for(var/obj/O in src) - if(intact && O.level == 1) //hidden under the floor - continue if(istype(O, acid_type)) var/obj/effect/acid/A = O - A.acid_level = min(A.level + acid_volume * acidpwr, 12000)//capping acid level to limit power of the acid + A.acid_level = min(acid_volume * acidpwr, 12000)//capping acid level to limit power of the acid has_acid_effect = 1 continue O.acid_act(acidpwr, acid_volume) diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index c670c07798f..49e0db945f8 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -185,11 +185,6 @@ if(!can_unwrench(user)) return ..() - var/turf/T = get_turf(src) - if (level==1 && isturf(T) && T.intact) - to_chat(user, "You must remove the plating first!") - return TRUE - var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() add_fingerprint(user) @@ -266,8 +261,6 @@ add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY) pipe_color = obj_color setPipingLayer(set_layer) - var/turf/T = get_turf(src) - level = T.intact ? 2 : 1 atmosinit() var/list/nodes = pipeline_expansion() for(var/obj/machinery/atmospherics/A in nodes) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm b/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm index 6167d7ea015..c4b14274e03 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm @@ -13,9 +13,5 @@ if(EAST, WEST) initialize_directions = EAST|WEST -/obj/machinery/atmospherics/components/binary/hide(intact) - update_icon() - ..() - /obj/machinery/atmospherics/components/binary/getNodeConnects() return list(turn(dir, 180), dir) 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 4bba6e94c04..c16ce682d40 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 @@ -14,7 +14,6 @@ name = "dual-port air vent" desc = "Has a valve and pump attached to it. There are two ports." - level = 1 var/frequency = 0 var/id = null var/datum/radio_frequency/radio_connection diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm index eee2f383561..4794762140f 100644 --- a/code/modules/atmospherics/machinery/components/components_base.dm +++ b/code/modules/atmospherics/machinery/components/components_base.dm @@ -20,26 +20,31 @@ A.volume = 200 airs[i] = A +/obj/machinery/atmospherics/components/Initialize() + . = ..() + + RegisterSignal(src, COMSIG_OBJ_HIDE, .proc/hide_pipe) + // Iconnery /obj/machinery/atmospherics/components/proc/update_icon_nopipes() return +/obj/machinery/atmospherics/components/proc/hide_pipe(datum/source, covered) + showpipe = !covered + update_icon() + /obj/machinery/atmospherics/components/update_icon() update_icon_nopipes() underlays.Cut() - var/turf/T = loc - if(level == 2 || (istype(T) && !T.intact)) - showpipe = TRUE - plane = GAME_PLANE - else - showpipe = FALSE - plane = FLOOR_PLANE + + + plane = showpipe ? GAME_PLANE : FLOOR_PLANE if(!showpipe) - return //no need to update the pipes if they aren't showing + return var/connected = 0 //Direction bitset diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm index 170b2179e52..0a91bcabff8 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm @@ -18,7 +18,6 @@ var/id = null var/datum/radio_frequency/radio_connection - level = 1 layer = GAS_SCRUBBER_LAYER pipe_state = "injector" diff --git a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm index a113484d20b..96ac0ac7caf 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm @@ -5,7 +5,6 @@ desc = "It is an open vent." can_unwrench = TRUE - level = 1 layer = GAS_SCRUBBER_LAYER pipe_state = "pvent" diff --git a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm index 03ae98bb6a6..8ff32706cf0 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm @@ -7,7 +7,6 @@ can_unwrench = TRUE use_power = NO_POWER_USE - level = 0 layer = GAS_FILTER_LAYER pipe_flags = PIPING_ONE_PER_TURF @@ -50,9 +49,6 @@ piping_layer = 3 icon_state = "connector_map-3" -/obj/machinery/atmospherics/components/unary/portables_connector/visible - level = 2 - /obj/machinery/atmospherics/components/unary/portables_connector/visible/layer1 piping_layer = 1 icon_state = "connector_map-1" diff --git a/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm b/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm index 40c2f0f5a8a..1d18dc83492 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm @@ -15,10 +15,6 @@ ..() update_icon() -/obj/machinery/atmospherics/components/unary/hide(intact) - update_icon() - ..(intact) - /obj/machinery/atmospherics/components/unary/proc/assign_uid_vents() uid = num2text(gl_uid++) return uid diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index ec64bd45fd7..7333355b3e2 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -14,7 +14,6 @@ use_power = IDLE_POWER_USE can_unwrench = TRUE welded = FALSE - level = 1 layer = GAS_SCRUBBER_LAYER var/id_tag = null diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index cb4e3ebc969..f7e9fc22604 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -11,7 +11,6 @@ active_power_usage = 60 can_unwrench = TRUE welded = FALSE - level = 1 layer = GAS_SCRUBBER_LAYER var/id_tag = null diff --git a/code/modules/atmospherics/machinery/other/meter.dm b/code/modules/atmospherics/machinery/other/meter.dm index 9a10a605038..239258a4058 100644 --- a/code/modules/atmospherics/machinery/other/meter.dm +++ b/code/modules/atmospherics/machinery/other/meter.dm @@ -44,8 +44,6 @@ for(var/obj/machinery/atmospherics/pipe/pipe in loc) if(pipe.piping_layer == target_layer) candidate = pipe - if(pipe.level == 2) - break if(candidate) target = candidate setAttachLayer(candidate.piping_layer) diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm index 6ffffb9c453..d240dd5b022 100644 --- a/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm +++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm @@ -1,5 +1,4 @@ /obj/machinery/atmospherics/pipe/heat_exchanging - level = 2 var/minimum_temperature_difference = 20 var/thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT color = "#404040" @@ -16,9 +15,6 @@ return FALSE . = ..() -/obj/machinery/atmospherics/pipe/heat_exchanging/hide() - return - /obj/machinery/atmospherics/pipe/heat_exchanging/process_atmos() var/environment_temperature = 0 var/datum/gas_mixture/pipe_air = return_air() diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/junction.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/junction.dm index ad5f65f9d3d..531c5e113a8 100644 --- a/code/modules/atmospherics/machinery/pipes/heat_exchange/junction.dm +++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/junction.dm @@ -33,8 +33,6 @@ /obj/machinery/atmospherics/pipe/heat_exchanging/junction/update_icon() icon_state = "pipe[nodes[1] ? "1" : "0"][nodes[2] ? "1" : "0"]-[piping_layer]" update_layer() - update_alpha() - /obj/machinery/atmospherics/pipe/heat_exchanging/junction/layer1 piping_layer = 1 diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm index 6d4b824fb14..3eed910ecdb 100644 --- a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm +++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm @@ -38,8 +38,6 @@ add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) ) update_layer() - update_alpha() - /obj/machinery/atmospherics/pipe/heat_exchanging/manifold/layer1 piping_layer = 1 diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold4w.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold4w.dm index 88086e44e23..a8425629c9a 100644 --- a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold4w.dm +++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold4w.dm @@ -36,8 +36,6 @@ add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) ) update_layer() - update_alpha() - /obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/layer1 piping_layer = 1 diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm index e3ed1a6c37a..c5304c3416e 100644 --- a/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm +++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm @@ -27,8 +27,6 @@ /obj/machinery/atmospherics/pipe/heat_exchanging/simple/update_icon() icon_state = "pipe[nodes[1] ? "1" : "0"][nodes[2] ? "1" : "0"]-[piping_layer]" update_layer() - update_alpha() - /obj/machinery/atmospherics/pipe/heat_exchanging/simple/layer1 piping_layer = 1 diff --git a/code/modules/atmospherics/machinery/pipes/layermanifold.dm b/code/modules/atmospherics/machinery/pipes/layermanifold.dm index 1d1f7ccac3b..1aff2b3af16 100644 --- a/code/modules/atmospherics/machinery/pipes/layermanifold.dm +++ b/code/modules/atmospherics/machinery/pipes/layermanifold.dm @@ -46,8 +46,6 @@ for(var/node in back_nodes) add_attached_images(node) - update_alpha() - /obj/machinery/atmospherics/pipe/layer_manifold/proc/add_attached_images(obj/machinery/atmospherics/A) if(!A) return @@ -99,8 +97,6 @@ /obj/machinery/atmospherics/pipe/layer_manifold/atmosinit() normalize_cardinal_directions() findAllConnections() - var/turf/T = loc // hide if turf is not intact - hide(T.intact) /obj/machinery/atmospherics/pipe/layer_manifold/setPipingLayer() piping_layer = PIPING_LAYER_DEFAULT @@ -134,5 +130,4 @@ to_chat(user, "You align yourself with the [user.ventcrawl_layer]\th output.") /obj/machinery/atmospherics/pipe/layer_manifold/visible - level = PIPE_VISIBLE_LEVEL layer = GAS_PIPE_VISIBLE_LAYER diff --git a/code/modules/atmospherics/machinery/pipes/manifold.dm b/code/modules/atmospherics/machinery/pipes/manifold.dm index 8c487dc8dce..fb458aee7cb 100644 --- a/code/modules/atmospherics/machinery/pipes/manifold.dm +++ b/code/modules/atmospherics/machinery/pipes/manifold.dm @@ -43,4 +43,3 @@ add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) ) update_layer() - update_alpha() diff --git a/code/modules/atmospherics/machinery/pipes/manifold4w.dm b/code/modules/atmospherics/machinery/pipes/manifold4w.dm index 4d98cbc2f59..b80e6eaeb4b 100644 --- a/code/modules/atmospherics/machinery/pipes/manifold4w.dm +++ b/code/modules/atmospherics/machinery/pipes/manifold4w.dm @@ -37,4 +37,3 @@ add_overlay( getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i])) ) update_layer() - update_alpha() diff --git a/code/modules/atmospherics/machinery/pipes/mapping.dm b/code/modules/atmospherics/machinery/pipes/mapping.dm index c868d377ea4..c52482e88f1 100644 --- a/code/modules/atmospherics/machinery/pipes/mapping.dm +++ b/code/modules/atmospherics/machinery/pipes/mapping.dm @@ -6,7 +6,6 @@ color = Color; \ } \ ##Fulltype/visible { \ - level = PIPE_VISIBLE_LEVEL; \ layer = GAS_PIPE_VISIBLE_LAYER; \ } \ ##Fulltype/visible/layer1 { \ @@ -17,9 +16,6 @@ piping_layer = 3; \ icon_state = Iconbase + "-3"; \ } \ - ##Fulltype/hidden { \ - level = PIPE_HIDDEN_LEVEL; \ - } \ ##Fulltype/hidden/layer1 { \ piping_layer = 1; \ icon_state = Iconbase + "-1"; \ diff --git a/code/modules/atmospherics/machinery/pipes/pipes.dm b/code/modules/atmospherics/machinery/pipes/pipes.dm index 2ebf1cfdff7..1684a6e92e6 100644 --- a/code/modules/atmospherics/machinery/pipes/pipes.dm +++ b/code/modules/atmospherics/machinery/pipes/pipes.dm @@ -3,8 +3,6 @@ var/datum/gas_mixture/air_temporary //used when reconstructing a pipeline that broke var/volume = 0 - level = 1 - use_power = NO_POWER_USE can_unwrench = 1 var/datum/pipeline/parent = null @@ -19,6 +17,12 @@ volume = 35 * device_type ..() +///I have no idea why there's a new and at this point I'm too afraid to ask +/obj/machinery/atmospherics/pipe/Initialize(mapload) + . = ..() + + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) + /obj/machinery/atmospherics/pipe/nullifyNode(i) var/obj/machinery/atmospherics/oldN = nodes[i] ..() @@ -33,16 +37,6 @@ parent = new parent.build_pipeline(src) -/obj/machinery/atmospherics/pipe/atmosinit() - var/turf/T = loc // hide if turf is not intact - hide(T.intact) - ..() - -/obj/machinery/atmospherics/pipe/hide(i) - if(level == 1 && isturf(loc)) - invisibility = i ? INVISIBILITY_MAXIMUM : 0 - update_icon() - /obj/machinery/atmospherics/pipe/proc/releaseAirToTurf() if(air_temporary) var/turf/T = loc @@ -86,13 +80,6 @@ qdel(meter) . = ..() -/obj/machinery/atmospherics/pipe/update_icon() - . = ..() - update_alpha() - -/obj/machinery/atmospherics/pipe/proc/update_alpha() - alpha = invisibility ? 64 : 255 - /obj/machinery/atmospherics/pipe/proc/update_node_icon() for(var/i in 1 to device_type) if(nodes[i]) diff --git a/code/modules/atmospherics/machinery/pipes/simple.dm b/code/modules/atmospherics/machinery/pipes/simple.dm index 40afb39ec1b..0450c7eebcb 100644 --- a/code/modules/atmospherics/machinery/pipes/simple.dm +++ b/code/modules/atmospherics/machinery/pipes/simple.dm @@ -30,4 +30,3 @@ /obj/machinery/atmospherics/pipe/simple/update_icon() icon_state = "pipe[nodes[1] ? "1" : "0"][nodes[2] ? "1" : "0"]-[piping_layer]" update_layer() - update_alpha() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index b11cf37f123..5e4eada12f1 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -893,8 +893,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/list/t_ray_images = list() var/static/list/stored_t_ray_images = list() for(var/obj/O in orange(client.view, src) ) - if(O.level != 1) - continue if(O.invisibility == INVISIBILITY_MAXIMUM) var/image/I = new(loc = get_turf(O)) diff --git a/code/modules/plumbing/ducts.dm b/code/modules/plumbing/ducts.dm index 0b141d764a3..9d8699db3b4 100644 --- a/code/modules/plumbing/ducts.dm +++ b/code/modules/plumbing/ducts.dm @@ -7,7 +7,7 @@ All the important duct code: name = "fluid duct" icon = 'icons/obj/plumbing/fluid_ducts.dmi' icon_state = "nduct" - level = 1 + ///bitfield with the directions we're connected in var/connects ///set to TRUE to disable smart duct behaviour @@ -36,14 +36,16 @@ All the important duct code: ///wheter we just unanchored or drop whatever is in the variable. either is safe var/drop_on_wrench = /obj/item/stack/ducts -/obj/machinery/duct/Initialize(mapload, no_anchor, color_of_duct, layer_of_duct = DUCT_LAYER_DEFAULT, force_connects) +/obj/machinery/duct/Initialize(mapload, no_anchor, color_of_duct = "#ffffff", layer_of_duct = DUCT_LAYER_DEFAULT, force_connects) . = ..() + if(no_anchor) active = FALSE anchored = FALSE else if(!can_anchor()) qdel(src) CRASH("Overlapping ducts detected") + if(force_connects) connects = force_connects //skip change_connects() because we're still initializing and we need to set our connects at one point if(!lock_layers) @@ -52,15 +54,20 @@ All the important duct code: duct_color = color_of_duct if(duct_color) add_atom_colour(duct_color, FIXED_COLOUR_PRIORITY) + handle_layer() + for(var/obj/machinery/duct/D in loc) if(D == src) continue if(D.duct_layer & duct_layer) disconnect_duct() + if(active) attempt_connect() + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) + ///start looking around us for stuff to connect to /obj/machinery/duct/proc/attempt_connect() @@ -289,7 +296,7 @@ All the important duct code: if(!T) T = get_turf(src) for(var/obj/machinery/duct/D in T) - if(!anchored) + if(!anchored || D == src) continue for(var/A in GLOB.cardinals) if(A & connects && A & D.connects) @@ -325,6 +332,7 @@ All the important duct code: add_neighbour(D, direction) connect_network(D, direction, TRUE) update_icon() + ///has a total of 5 layers and doesnt give a shit about color. its also dumb so doesnt autoconnect. /obj/machinery/duct/multilayered name = "duct layer-manifold" diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index b2e452c0f63..9e65edb2206 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -17,7 +17,6 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri icon = 'icons/obj/power_cond/layer_cable.dmi' icon_state = "l2-1-2-4-8-node" color = "yellow" - level = 1 //is underfloor layer = WIRE_LAYER //Above hidden pipes, GAS_PIPE_HIDDEN_LAYER anchored = TRUE obj_flags = CAN_BE_HIT | ON_BLUEPRINTS @@ -41,12 +40,11 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri /obj/structure/cable/Initialize(mapload) . = ..() - var/turf/T = get_turf(src) // hide if turf is not intact - if(level==1) - hide(T.intact) GLOB.cable_list += src //add it to the global cable list connect_wire() + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) + /obj/structure/cable/proc/connect_wire(clear_before_updating = FALSE) var/under_thing = NONE if(clear_before_updating) @@ -115,12 +113,6 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri // General procedures /////////////////////////////////// -//If underfloor, hide the cable -/obj/structure/cable/hide(i) - if(level == 1 && isturf(loc)) - invisibility = i ? INVISIBILITY_MAXIMUM : 0 - update_icon() - /obj/structure/cable/update_icon_state() if(!linked_dirs) icon_state = "l[cable_layer]-noconnection" @@ -562,7 +554,6 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list(new/datum/stack_recipe("cable restrain desc = "A bridge to connect different cable layers, or link terminals to incompatible cable layers." icon = 'icons/obj/power.dmi' icon_state = "cable_bridge" - level = 1 //is underfloor layer = WIRE_LAYER + 0.02 //Above all the cables but below terminals anchored = TRUE obj_flags = CAN_BE_HIT | ON_BLUEPRINTS diff --git a/code/modules/power/terminal.dm b/code/modules/power/terminal.dm index a1c11b9dca0..0077193b250 100644 --- a/code/modules/power/terminal.dm +++ b/code/modules/power/terminal.dm @@ -7,16 +7,14 @@ name = "terminal" icon_state = "term" desc = "It's an underfloor wiring terminal for power equipment." - level = 1 layer = WIRE_TERMINAL_LAYER //a bit above wires var/obj/machinery/power/master = null /obj/machinery/power/terminal/Initialize() . = ..() - var/turf/T = get_turf(src) - if(level == 1) - hide(T.intact) + + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE, use_alpha = TRUE) /obj/machinery/power/terminal/Destroy() if(master) @@ -27,15 +25,6 @@ /obj/machinery/power/terminal/should_have_node() return TRUE -/obj/machinery/power/terminal/hide(i) - if(i) - invisibility = INVISIBILITY_MAXIMUM - icon_state = "term-f" - else - invisibility = 0 - icon_state = "term" - - /obj/machinery/power/proc/can_terminal_dismantle() . = FALSE diff --git a/code/modules/projectiles/guns/misc/beam_rifle.dm b/code/modules/projectiles/guns/misc/beam_rifle.dm index 5e5fa7a0c06..00c490db743 100644 --- a/code/modules/projectiles/guns/misc/beam_rifle.dm +++ b/code/modules/projectiles/guns/misc/beam_rifle.dm @@ -446,8 +446,6 @@ new /obj/effect/hotspot(T) for(var/obj/O in range(aoe_structure_range, epicenter)) if(!isitem(O)) - if(O.level == 1) //Please don't break underfloor items! - continue O.take_damage(aoe_structure_damage * get_damage_coeff(O), BURN, "laser", FALSE) /obj/projectile/beam/beam_rifle/proc/check_pierce(atom/target) diff --git a/code/modules/recycling/disposal/construction.dm b/code/modules/recycling/disposal/construction.dm index 566228adb52..b97d3a77b5f 100644 --- a/code/modules/recycling/disposal/construction.dm +++ b/code/modules/recycling/disposal/construction.dm @@ -9,7 +9,6 @@ anchored = FALSE density = FALSE pressure_resistance = 5*ONE_ATMOSPHERE - level = 2 max_integrity = 200 var/obj/pipe_type = /obj/structure/disposalpipe/segment var/pipename @@ -34,6 +33,8 @@ update_icon() + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) + /obj/structure/disposalconstruct/Move() var/old_dir = dir ..() @@ -45,10 +46,8 @@ if(is_pipe()) icon_state = "con[icon_state]" if(anchored) - level = initial(pipe_type.level) layer = initial(pipe_type.layer) else - level = initial(level) layer = initial(layer) else if(ispath(pipe_type, /obj/machinery/disposal/bin)) @@ -58,13 +57,6 @@ else icon_state = "condisposal" - -// 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) ? INVISIBILITY_MAXIMUM: 0 // hide if floor is intact - update_icon() - /obj/structure/disposalconstruct/proc/get_disposal_dir() if(!is_pipe()) return NONE diff --git a/code/modules/recycling/disposal/pipe.dm b/code/modules/recycling/disposal/pipe.dm index 7f8e26b64ae..b488f636798 100644 --- a/code/modules/recycling/disposal/pipe.dm +++ b/code/modules/recycling/disposal/pipe.dm @@ -7,7 +7,6 @@ anchored = TRUE density = FALSE obj_flags = CAN_BE_HIT | ON_BLUEPRINTS - level = 1 // underfloor only dir = NONE // dir will contain dominant direction for junction pipes max_integrity = 200 armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 30) @@ -42,7 +41,8 @@ dpdir |= turn(dir, -90) if(initialize_dirs & DISP_DIR_FLIP) dpdir |= turn(dir, 180) - update() + + AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) // pipe is deleted // ensure if holder is present, it is expelled @@ -81,16 +81,6 @@ H.forceMove(get_turf(src)) return null -// update the icon_state to reflect hidden status -/obj/structure/disposalpipe/proc/update() - var/turf/T = get_turf(src) - hide(T.intact && !isspaceturf(T)) // space never hides pipes - -// hide called by levelupdate if turf intact status changes -// change visibility status and force update of icon -/obj/structure/disposalpipe/hide(var/intact) - invisibility = intact ? INVISIBILITY_MAXIMUM: 0 // hide if floor is intact - // expel the held objects into a turf // called when there is a break in the pipe /obj/structure/disposalpipe/proc/expel(obj/structure/disposalholder/H, turf/T, direction) diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm index 7b304832b37..e2035244bff 100644 --- a/code/modules/shuttle/on_move.dm +++ b/code/modules/shuttle/on_move.dm @@ -256,11 +256,6 @@ All ShuttleMove procs go here // atmosinit() calls update_icon(), so we don't need to call it update_icon() -/obj/machinery/atmospherics/pipe/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) - . = ..() - var/turf/T = loc - hide(T.intact) - /obj/machinery/navbeacon/beforeShuttleMove(turf/newT, rotation, move_mode, obj/docking_port/mobile/moving_dock) . = ..() GLOB.navbeacons["[z]"] -= src @@ -268,8 +263,7 @@ All ShuttleMove procs go here /obj/machinery/navbeacon/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) . = ..() - var/turf/T = loc - hide(T.intact) + if(codes["patrol"]) if(!GLOB.navbeacons["[z]"]) GLOB.navbeacons["[z]"] = list() @@ -278,12 +272,6 @@ All ShuttleMove procs go here GLOB.deliverybeacons += src GLOB.deliverybeacontags += location -/obj/machinery/power/terminal/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) - . = ..() - var/turf/T = src.loc - if(level==1) - hide(T.intact) - /************************************Item move procs************************************/ /obj/item/storage/pod/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) @@ -338,19 +326,12 @@ All ShuttleMove procs go here if(. & MOVE_AREA) . |= MOVE_CONTENTS -/obj/structure/disposalpipe/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) - . = ..() - update() - /obj/structure/cable/beforeShuttleMove(turf/newT, rotation, move_mode, obj/docking_port/mobile/moving_dock) . = ..() cut_cable_from_powernet(FALSE) /obj/structure/cable/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) . = ..() - var/turf/T = loc - if(level==1) - hide(T.intact) connect_wire(TRUE) propogate_if_no_network() diff --git a/config/admins.txt b/config/admins.txt index 640651cb5a6..351e54ba2f6 100644 --- a/config/admins.txt +++ b/config/admins.txt @@ -139,3 +139,4 @@ LoserWasTaken = Game Master Fikou = Game Master Skoglol = Game Master 4dplanner = Game Master +Time-Green = Game Master diff --git a/tgstation.dme b/tgstation.dme index 8647cfa4b49..dfba0817a6c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -537,6 +537,7 @@ #include "code\datums\elements\snail_crawl.dm" #include "code\datums\elements\squish.dm" #include "code\datums\elements\tool_flash.dm" +#include "code\datums\elements\undertile.dm" #include "code\datums\elements\update_icon_blocker.dm" #include "code\datums\elements\update_icon_updates_onmob.dm" #include "code\datums\elements\waddling.dm"