From 78f31a9b2d88db93db9a1a7f17231a02158519a4 Mon Sep 17 00:00:00 2001 From: Neerti Date: Mon, 28 Jun 2021 01:46:10 -0400 Subject: [PATCH 1/7] Adds optional area-based definition for outdoors-ness --- code/__defines/turfs.dm | 10 +++++ code/controllers/subsystems/planets.dm | 2 +- code/game/objects/effects/step_triggers.dm | 2 +- code/game/turfs/simulated/floor_attackby.dm | 4 +- code/game/turfs/simulated/lava.dm | 2 +- .../game/turfs/simulated/outdoors/outdoors.dm | 38 ++++++++++++++----- code/game/turfs/simulated/outdoors/sky.dm | 2 +- code/game/turfs/simulated/wall_attacks.dm | 2 +- code/game/turfs/simulated/water.dm | 6 +-- code/modules/admin/verbs/lightning_strike.dm | 4 +- code/modules/flufftext/look_up.dm | 2 +- code/modules/mining/fulton.dm | 4 +- .../mob/living/carbon/human/human_movement.dm | 4 ++ code/modules/planet/sif.dm | 15 +++++--- code/modules/planet/weather.dm | 4 +- maps/southern_cross/southern_cross_areas.dm | 6 +++ maps/southern_cross/turfs/outdoors.dm | 6 +-- 17 files changed, 79 insertions(+), 34 deletions(-) diff --git a/code/__defines/turfs.dm b/code/__defines/turfs.dm index 679b83fa4a..0d7ee328ee 100644 --- a/code/__defines/turfs.dm +++ b/code/__defines/turfs.dm @@ -19,6 +19,16 @@ #define isCardinal(x) (x == NORTH || x == SOUTH || x == EAST || x == WEST) #define isDiagonal(x) (x == NORTHEAST || x == SOUTHEAST || x == NORTHWEST || x == SOUTHWEST) +<<<<<<< HEAD #define IS_OPAQUE_TURF(turf) (turf.directional_opacity == ALL_CARDINALS) #define IS_OPAQUE_TURF_DIR(turf, dir) (turf.directional_opacity & dir) #define FOOTSTEP_SPRITE_AMT 2 +======= +#define FOOTSTEP_SPRITE_AMT 2 + +// Used to designate if a turf (or its area) should initialize as outdoors or not. +#define OUTDOORS_YES 1 // This being 1 helps with backwards compatibility. +#define OUTDOORS_NO 0 // Ditto. +#define OUTDOORS_AREA -1 // If a turf has this, it will defer to the area's settings on init. + // Note that after init, it will be either YES or NO. +>>>>>>> 6782e64... Adds optional area-based definition for outdoors-ness. (#8155) diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm index 5486034871..042d7c71d7 100644 --- a/code/controllers/subsystems/planets.dm +++ b/code/controllers/subsystems/planets.dm @@ -42,7 +42,7 @@ SUBSYSTEM_DEF(planets) return if(istype(T, /turf/unsimulated/wall/planetary)) P.planet_walls += T - else if(istype(T, /turf/simulated) && T.outdoors) + else if(istype(T, /turf/simulated) && T.outdoors == OUTDOORS_YES) P.planet_floors += T P.weather_holder.apply_to_turf(T) P.sun_holder.apply_to_turf(T) diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 957cd246e6..c8c8b764c4 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -220,7 +220,7 @@ var/global/list/tele_landmarks = list() // Terrible, but the alternative is loop if(!istype(candidate) || istype(candidate, /turf/simulated/sky)) safety-- continue - else if(candidate && !candidate.outdoors) + else if(candidate && !candidate.outdoors == OUTDOORS_YES) safety-- continue else diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index 8342a5d6e8..f8338039e2 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -46,10 +46,10 @@ return // Create a ceiling to shield from the weather - if(src.outdoors) + if(src.outdoors == OUTDOORS_YES) for(var/dir in cardinal) var/turf/A = get_step(src, dir) - if(A && !A.outdoors) + if(A && !A.outdoors == OUTDOORS_YES) if(expended_tile || R.use(1)) make_indoors() playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) diff --git a/code/game/turfs/simulated/lava.dm b/code/game/turfs/simulated/lava.dm index f2902abdfe..6a539ec7b6 100644 --- a/code/game/turfs/simulated/lava.dm +++ b/code/game/turfs/simulated/lava.dm @@ -17,7 +17,7 @@ initial_flooring = /decl/flooring/lava // Defining this in case someone DOES step on lava and survive. Somehow. /turf/simulated/floor/lava/outdoors - outdoors = TRUE + outdoors = OUTDOORS_YES // For maximum pedantry. /turf/simulated/floor/lava/Initialize() diff --git a/code/game/turfs/simulated/outdoors/outdoors.dm b/code/game/turfs/simulated/outdoors/outdoors.dm index 8ca1659d1b..f04f0dac02 100644 --- a/code/game/turfs/simulated/outdoors/outdoors.dm +++ b/code/game/turfs/simulated/outdoors/outdoors.dm @@ -5,7 +5,12 @@ var/list/turf_edge_cache = list() // and if those adjacent turfs have a lower edge_blending_priority. var/edge_blending_priority = 0 // Outdoors var determines if the game should consider the turf to be 'outdoors', which controls certain things such as weather effects. - var/outdoors = FALSE + var/outdoors = OUTDOORS_AREA + +/area + // If a turf's `outdoors` variable is set to `OUTDOORS_AREA`, + // it will decide if it's outdoors or not when being initialized based on this var. + var/outdoors = OUTDOORS_NO /turf/simulated/floor/outdoors name = "generic ground" @@ -13,7 +18,7 @@ var/list/turf_edge_cache = list() icon = 'icons/turf/outdoors.dmi' icon_state = null edge_blending_priority = 1 - outdoors = TRUE // This variable is used for weather effects. + outdoors = OUTDOORS_YES // This variable is used for weather effects. can_dirty = FALSE // Looks hideous with dirt on it. can_build_into_floor = TRUE @@ -21,31 +26,46 @@ var/list/turf_edge_cache = list() var/list/turf_layers = list(/turf/simulated/floor/outdoors/rocks) /turf/simulated/floor/Initialize(mapload) - if(outdoors) + if(should_be_outdoors()) SSplanets.addTurf(src) . = ..() /turf/simulated/floor/Destroy() - if(outdoors) + if(should_be_outdoors()) SSplanets.removeTurf(src) return ..() +// Turfs can decide if they should be indoors or outdoors. +// By default they choose based on their area's setting. +// This helps cut down on ten billion `/outdoors` subtypes being needed. +/turf/simulated/proc/should_be_outdoors() + switch(outdoors) + if(OUTDOORS_YES) + return TRUE + if(OUTDOORS_NO) + return FALSE + if(OUTDOORS_AREA) + var/area/A = loc + if(A.outdoors == OUTDOORS_YES) + return TRUE + return FALSE + /turf/simulated/proc/make_outdoors() - if(outdoors) + if(outdoors == OUTDOORS_YES) return - outdoors = TRUE + outdoors = OUTDOORS_YES SSplanets.addTurf(src) /turf/simulated/proc/make_indoors() - if(!outdoors) + if(!outdoors == OUTDOORS_NO) return - outdoors = FALSE + outdoors = OUTDOORS_NO SSplanets.removeTurf(src) /turf/simulated/post_change() ..() // If it was outdoors and still is, it will not get added twice when the planet controller gets around to putting it in. - if(outdoors) + if(outdoors == OUTDOORS_YES) make_outdoors() else make_indoors() diff --git a/code/game/turfs/simulated/outdoors/sky.dm b/code/game/turfs/simulated/outdoors/sky.dm index 3188302288..2f9f8106bb 100644 --- a/code/game/turfs/simulated/outdoors/sky.dm +++ b/code/game/turfs/simulated/outdoors/sky.dm @@ -4,7 +4,7 @@ desc = "Hope you don't have a fear of heights." icon = 'icons/turf/floors.dmi' icon_state = "sky_slow" - outdoors = TRUE + outdoors = OUTDOORS_YES // Assume there's a vacuum for the purposes of avoiding active edges at initialization, as well as ZAS fun if a window breaks. oxygen = 0 diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 72edce4503..0372c3f770 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -171,7 +171,7 @@ return // Create a ceiling to shield from the weather - if(outdoors) + if(outdoors == OUTDOORS_YES) if(expended_tile || R.use(1)) // Don't need to check adjacent turfs for a wall, we're building on one make_indoors() if(!expended_tile) // Would've already played a sound diff --git a/code/game/turfs/simulated/water.dm b/code/game/turfs/simulated/water.dm index eaef2357b8..d1f0dd37dd 100644 --- a/code/game/turfs/simulated/water.dm +++ b/code/game/turfs/simulated/water.dm @@ -8,7 +8,7 @@ var/under_state = "rock" edge_blending_priority = -1 movement_cost = 4 - outdoors = TRUE + outdoors = OUTDOORS_YES layer = WATER_FLOOR_LAYER @@ -106,12 +106,12 @@ name = "pool" desc = "Don't worry, it's not closed." under_state = "pool" - outdoors = FALSE + outdoors = OUTDOORS_NO /turf/simulated/floor/water/deep/pool name = "deep pool" desc = "Don't worry, it's not closed." - outdoors = FALSE + outdoors = OUTDOORS_NO /mob/living/proc/can_breathe_water() return FALSE diff --git a/code/modules/admin/verbs/lightning_strike.dm b/code/modules/admin/verbs/lightning_strike.dm index 96f5419f99..dcd5807793 100644 --- a/code/modules/admin/verbs/lightning_strike.dm +++ b/code/modules/admin/verbs/lightning_strike.dm @@ -40,13 +40,13 @@ for(var/obj/machinery/power/thing in range(LIGHTNING_REDIRECT_RANGE, T)) if(istype(thing, /obj/machinery/power/tesla_coil)) var/turf/simulated/coil_turf = get_turf(thing) - if(istype(coil_turf) && thing.anchored && coil_turf.outdoors) + if(istype(coil_turf) && thing.anchored && coil_turf.outdoors == OUTDOORS_YES) coil = thing break if(istype(thing, /obj/machinery/power/grounding_rod)) var/turf/simulated/rod_turf = get_turf(thing) - if(istype(rod_turf) && thing.anchored && rod_turf.outdoors) + if(istype(rod_turf) && thing.anchored && rod_turf.outdoors == OUTDOORS_YES) ground = thing if(coil) // Coil gets highest priority. diff --git a/code/modules/flufftext/look_up.dm b/code/modules/flufftext/look_up.dm index 6be3713c03..846925c4db 100644 --- a/code/modules/flufftext/look_up.dm +++ b/code/modules/flufftext/look_up.dm @@ -12,7 +12,7 @@ to_chat(usr, span("warning", "You appear to be in a place without any sort of concept of direction. You have bigger problems to worry about.")) return - if(!T.outdoors) // They're inside. + if(T.outdoors == OUTDOORS_NO) // They're inside. to_chat(usr, "You see nothing interesting.") return diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index c5c939b2f1..f3a96b94b9 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -42,7 +42,7 @@ var/global/list/total_extraction_beacons = list() return if(!can_use_indoors) var/turf/T = get_turf(A) - if(T && !T.outdoors) + if(T && T.outdoors == OUTDOORS_NO) to_chat(user, "[src] can only be used on things that are outdoors!") return if(!flag) @@ -145,7 +145,7 @@ var/global/list/total_extraction_beacons = list() /obj/item/fulton_core/attack_self(mob/user) var/turf/T = get_turf(user) - var/outdoors = T.outdoors + var/outdoors = T.outdoors == OUTDOORS_YES if(do_after(user,15,target = user) && !QDELETED(src) && outdoors) new /obj/structure/extraction_point(get_turf(user)) qdel(src) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 202d0c2f34..27cb7f79d9 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -164,10 +164,14 @@ . += turf_move_cost // Wind makes it easier or harder to move, depending on if you're with or against the wind. +<<<<<<< HEAD // I don't like that so I'm commenting it out :) // VOREstation Edit Start /* if(T.outdoors && (T.z <= SSplanets.z_to_planet.len)) +======= + if((T.outdoors == OUTDOORS_YES) && (T.z <= SSplanets.z_to_planet.len)) +>>>>>>> 6782e64... Adds optional area-based definition for outdoors-ness. (#8155) var/datum/planet/P = SSplanets.z_to_planet[z] if(P) var/datum/weather_holder/WH = P.weather_holder diff --git a/code/modules/planet/sif.dm b/code/modules/planet/sif.dm index 1d2e4b0af0..5c422cf58e 100644 --- a/code/modules/planet/sif.dm +++ b/code/modules/planet/sif.dm @@ -296,7 +296,7 @@ var/datum/planet/sif/planet_sif = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(!T.outdoors) + if(T.outdoors == OUTDOORS_NO) continue // They're indoors, so no need to rain on them. // If they have an open umbrella, it'll guard from rain @@ -349,7 +349,7 @@ var/datum/planet/sif/planet_sif = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(!T.outdoors) + if(T.outdoors == OUTDOORS_NO) continue // They're indoors, so no need to rain on them. // If they have an open umbrella, it'll guard from rain @@ -407,7 +407,7 @@ var/datum/planet/sif/planet_sif = null for(var/mob/living/carbon/H as anything in human_mob_list) if(H.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(H) - if(!T.outdoors) + if(T.outdoors == OUTDOORS_NO) continue // They're indoors, so no need to pelt them with ice. // If they have an open umbrella, it'll guard from hail @@ -502,7 +502,7 @@ var/datum/planet/sif/planet_sif = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(!T.outdoors) + if(T.outdoors == OUTDOORS_NO) continue // They're indoors, so no need to burn them with ash. L.inflict_heat_damage(rand(1, 3)) @@ -539,7 +539,7 @@ var/datum/planet/sif/planet_sif = null if(L.z in holder.our_planet.expected_z_levels) irradiate_nearby_turf(L) var/turf/T = get_turf(L) - if(!T.outdoors) + if(T.outdoors == OUTDOORS_NO) continue // They're indoors, so no need to irradiate them with fallout. L.rad_act(rand(direct_rad_low, direct_rad_high)) @@ -553,5 +553,10 @@ var/datum/planet/sif/planet_sif = null var/turf/T = pick(turfs) // We get one try per tick. if(!istype(T)) return +<<<<<<< HEAD if(T.outdoors) SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high)) +======= + if(T.outdoors == OUTDOORS_YES) + SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high)) +>>>>>>> 6782e64... Adds optional area-based definition for outdoors-ness. (#8155) diff --git a/code/modules/planet/weather.dm b/code/modules/planet/weather.dm index bbe2318a27..43d7dcc4ea 100644 --- a/code/modules/planet/weather.dm +++ b/code/modules/planet/weather.dm @@ -137,7 +137,7 @@ for(var/mob/M in player_list) // Don't need to care about clientless mobs. if(M.z in our_planet.expected_z_levels) var/turf/T = get_turf(M) - if(!T.outdoors) + if(T.outdoors == OUTDOORS_NO) continue to_chat(M, message) @@ -213,7 +213,7 @@ // Otherwise they should hear some sounds, depending on if they're inside or not. var/turf/T = get_turf(M) if(istype(T)) - if(T.outdoors) // Mob is currently outdoors. + if(T.outdoors == OUTDOORS_YES) // Mob is currently outdoors. hear_outdoor_sounds(M, TRUE) hear_indoor_sounds(M, FALSE) diff --git a/maps/southern_cross/southern_cross_areas.dm b/maps/southern_cross/southern_cross_areas.dm index 94d357763b..4d9c76f95f 100644 --- a/maps/southern_cross/southern_cross_areas.dm +++ b/maps/southern_cross/southern_cross_areas.dm @@ -61,6 +61,7 @@ ambience = AMBIENCE_SIF always_unpowered = TRUE flags = AREA_FLAG_IS_NOT_PERSISTENT + outdoors = OUTDOORS_YES // The area near the outpost, so POIs don't show up right next to the outpost. /area/surface/outside/plains/outpost @@ -163,10 +164,12 @@ /area/surface/outpost/mining_main name = "North Mining Outpost" icon_state = "outpost_mine_main" + outdoors = OUTDOORS_NO /area/surface/outpost/mining_main/exterior name = "North Mining Outpost Exterior" icon_state = "outpost_mine_main" + outdoors = OUTDOORS_YES /area/surface/outpost/mining_main/crew_area name = "North Mining Crew Area" @@ -205,6 +208,7 @@ /area/surface/outpost/research icon_state = "outpost_research" + outdoors = OUTDOORS_NO /area/surface/outpost/research/xenoresearch name = "\improper Xenoresearch" @@ -291,6 +295,7 @@ /area/surface/outpost/main name = "\improper Main Outpost" icon_state = "Sleep" + outdoors = OUTDOORS_NO /area/surface/outpost/main/gen_room name = "\improper Main Outpost SMES" @@ -371,6 +376,7 @@ /area/outpost/mining_station icon_state = "outpost_mine_main" name = "Mining Station" + outdoors = OUTDOORS_NO /area/outpost/mining_station/dorms name = "Mining Station Dormitory" diff --git a/maps/southern_cross/turfs/outdoors.dm b/maps/southern_cross/turfs/outdoors.dm index 167b1256f5..7f7b39fc4a 100644 --- a/maps/southern_cross/turfs/outdoors.dm +++ b/maps/southern_cross/turfs/outdoors.dm @@ -24,19 +24,19 @@ oxygen = MOLES_O2SIF nitrogen = MOLES_N2SIF temperature = TEMPERATURE_SIF - outdoors = TRUE + outdoors = OUTDOORS_YES /turf/simulated/floor/tiled/steel/sif/planetuse oxygen = MOLES_O2SIF nitrogen = MOLES_N2SIF temperature = TEMPERATURE_SIF - outdoors = TRUE + outdoors = OUTDOORS_YES /turf/simulated/floor/plating/sif/planetuse oxygen = MOLES_O2SIF nitrogen = MOLES_N2SIF temperature = TEMPERATURE_SIF - outdoors = TRUE + outdoors = OUTDOORS_YES /turf/simulated/floor/outdoors/snow/sif/planetuse oxygen = MOLES_O2SIF From 2996c843b5c0942ab06e8b18c0ca569e7012d05c Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Sun, 11 Jul 2021 23:41:54 -0400 Subject: [PATCH 2/7] Update turfs.dm --- code/__defines/turfs.dm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/__defines/turfs.dm b/code/__defines/turfs.dm index 0d7ee328ee..1c4b228b63 100644 --- a/code/__defines/turfs.dm +++ b/code/__defines/turfs.dm @@ -19,16 +19,12 @@ #define isCardinal(x) (x == NORTH || x == SOUTH || x == EAST || x == WEST) #define isDiagonal(x) (x == NORTHEAST || x == SOUTHEAST || x == NORTHWEST || x == SOUTHWEST) -<<<<<<< HEAD #define IS_OPAQUE_TURF(turf) (turf.directional_opacity == ALL_CARDINALS) #define IS_OPAQUE_TURF_DIR(turf, dir) (turf.directional_opacity & dir) #define FOOTSTEP_SPRITE_AMT 2 -======= -#define FOOTSTEP_SPRITE_AMT 2 // Used to designate if a turf (or its area) should initialize as outdoors or not. #define OUTDOORS_YES 1 // This being 1 helps with backwards compatibility. #define OUTDOORS_NO 0 // Ditto. #define OUTDOORS_AREA -1 // If a turf has this, it will defer to the area's settings on init. // Note that after init, it will be either YES or NO. ->>>>>>> 6782e64... Adds optional area-based definition for outdoors-ness. (#8155) From e4d96d979007770b068ed2af878049d5f23d1cb7 Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Sun, 11 Jul 2021 23:42:33 -0400 Subject: [PATCH 3/7] Update human_movement.dm --- code/modules/mob/living/carbon/human/human_movement.dm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 27cb7f79d9..0aed111890 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -164,14 +164,10 @@ . += turf_move_cost // Wind makes it easier or harder to move, depending on if you're with or against the wind. -<<<<<<< HEAD // I don't like that so I'm commenting it out :) // VOREstation Edit Start /* - if(T.outdoors && (T.z <= SSplanets.z_to_planet.len)) -======= if((T.outdoors == OUTDOORS_YES) && (T.z <= SSplanets.z_to_planet.len)) ->>>>>>> 6782e64... Adds optional area-based definition for outdoors-ness. (#8155) var/datum/planet/P = SSplanets.z_to_planet[z] if(P) var/datum/weather_holder/WH = P.weather_holder From 56a2160924a64f098a035f6a54435afe06a199da Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Sun, 11 Jul 2021 23:42:52 -0400 Subject: [PATCH 4/7] Update sif.dm --- code/modules/planet/sif.dm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/modules/planet/sif.dm b/code/modules/planet/sif.dm index 5c422cf58e..399ac93973 100644 --- a/code/modules/planet/sif.dm +++ b/code/modules/planet/sif.dm @@ -553,10 +553,5 @@ var/datum/planet/sif/planet_sif = null var/turf/T = pick(turfs) // We get one try per tick. if(!istype(T)) return -<<<<<<< HEAD - if(T.outdoors) - SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high)) -======= if(T.outdoors == OUTDOORS_YES) SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high)) ->>>>>>> 6782e64... Adds optional area-based definition for outdoors-ness. (#8155) From 9d84e7881c3cdfc0aeba1009066612dfe2734740 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Sat, 24 Jul 2021 10:15:49 -0700 Subject: [PATCH 5/7] Fixes Indoor Rain --- code/controllers/subsystems/planets.dm | 4 ++-- code/game/objects/effects/step_triggers.dm | 2 +- code/game/turfs/simulated/floor_attackby.dm | 4 ++-- .../game/turfs/simulated/outdoors/outdoors.dm | 19 ++++++++++++------- code/game/turfs/simulated/wall_attacks.dm | 2 +- code/modules/admin/verbs/lightning_strike.dm | 4 ++-- code/modules/flufftext/look_up.dm | 2 +- code/modules/mining/fulton.dm | 4 ++-- .../mob/living/carbon/human/human_movement.dm | 2 +- code/modules/planet/sif.dm | 12 ++++++------ code/modules/planet/weather.dm | 4 ++-- 11 files changed, 32 insertions(+), 27 deletions(-) diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm index 042d7c71d7..4dae77ccbe 100644 --- a/code/controllers/subsystems/planets.dm +++ b/code/controllers/subsystems/planets.dm @@ -34,7 +34,7 @@ SUBSYSTEM_DEF(planets) // DO NOT CALL THIS DIRECTLY UNLESS IT'S IN INITIALIZE, // USE turf/simulated/proc/make_indoors() and -// tyrf/simulated/proc/make_outdoors() +// turf/simulated/proc/make_outdoors() /datum/controller/subsystem/planets/proc/addTurf(var/turf/T) if(z_to_planet.len >= T.z && z_to_planet[T.z]) var/datum/planet/P = z_to_planet[T.z] @@ -42,7 +42,7 @@ SUBSYSTEM_DEF(planets) return if(istype(T, /turf/unsimulated/wall/planetary)) P.planet_walls += T - else if(istype(T, /turf/simulated) && T.outdoors == OUTDOORS_YES) + else if(istype(T, /turf/simulated) && T.is_outdoors()) P.planet_floors += T P.weather_holder.apply_to_turf(T) P.sun_holder.apply_to_turf(T) diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index c8c8b764c4..56cc000dc9 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -220,7 +220,7 @@ var/global/list/tele_landmarks = list() // Terrible, but the alternative is loop if(!istype(candidate) || istype(candidate, /turf/simulated/sky)) safety-- continue - else if(candidate && !candidate.outdoors == OUTDOORS_YES) + else if(candidate && !candidate.is_outdoors()) safety-- continue else diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index f8338039e2..4f70fc5918 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -46,10 +46,10 @@ return // Create a ceiling to shield from the weather - if(src.outdoors == OUTDOORS_YES) + if(src.is_outdoors()) for(var/dir in cardinal) var/turf/A = get_step(src, dir) - if(A && !A.outdoors == OUTDOORS_YES) + if(A && !A.is_outdoors()) if(expended_tile || R.use(1)) make_indoors() playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) diff --git a/code/game/turfs/simulated/outdoors/outdoors.dm b/code/game/turfs/simulated/outdoors/outdoors.dm index f04f0dac02..2d97bcf802 100644 --- a/code/game/turfs/simulated/outdoors/outdoors.dm +++ b/code/game/turfs/simulated/outdoors/outdoors.dm @@ -1,6 +1,6 @@ var/list/turf_edge_cache = list() -/turf/ +/turf // If greater than 0, this turf will apply edge overlays on top of other turfs cardinally adjacent to it, if those adjacent turfs are of a different icon_state, // and if those adjacent turfs have a lower edge_blending_priority. var/edge_blending_priority = 0 @@ -26,19 +26,22 @@ var/list/turf_edge_cache = list() var/list/turf_layers = list(/turf/simulated/floor/outdoors/rocks) /turf/simulated/floor/Initialize(mapload) - if(should_be_outdoors()) + if(is_outdoors()) SSplanets.addTurf(src) . = ..() /turf/simulated/floor/Destroy() - if(should_be_outdoors()) + if(is_outdoors()) SSplanets.removeTurf(src) return ..() // Turfs can decide if they should be indoors or outdoors. // By default they choose based on their area's setting. // This helps cut down on ten billion `/outdoors` subtypes being needed. -/turf/simulated/proc/should_be_outdoors() +/turf/proc/is_outdoors() + return FALSE + +/turf/simulated/is_outdoors() switch(outdoors) if(OUTDOORS_YES) return TRUE @@ -50,14 +53,16 @@ var/list/turf_edge_cache = list() return TRUE return FALSE +/// Makes the turf explicitly outdoors. /turf/simulated/proc/make_outdoors() - if(outdoors == OUTDOORS_YES) + if(is_outdoors()) // Already outdoors. return outdoors = OUTDOORS_YES SSplanets.addTurf(src) +/// Makes the turf explicitly indoors. /turf/simulated/proc/make_indoors() - if(!outdoors == OUTDOORS_NO) + if(!is_outdoors()) // Already indoors. return outdoors = OUTDOORS_NO SSplanets.removeTurf(src) @@ -65,7 +70,7 @@ var/list/turf_edge_cache = list() /turf/simulated/post_change() ..() // If it was outdoors and still is, it will not get added twice when the planet controller gets around to putting it in. - if(outdoors == OUTDOORS_YES) + if(is_outdoors()) make_outdoors() else make_indoors() diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 0372c3f770..036cfd5728 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -171,7 +171,7 @@ return // Create a ceiling to shield from the weather - if(outdoors == OUTDOORS_YES) + if(is_outdoors()) if(expended_tile || R.use(1)) // Don't need to check adjacent turfs for a wall, we're building on one make_indoors() if(!expended_tile) // Would've already played a sound diff --git a/code/modules/admin/verbs/lightning_strike.dm b/code/modules/admin/verbs/lightning_strike.dm index dcd5807793..d00fb4a1af 100644 --- a/code/modules/admin/verbs/lightning_strike.dm +++ b/code/modules/admin/verbs/lightning_strike.dm @@ -40,13 +40,13 @@ for(var/obj/machinery/power/thing in range(LIGHTNING_REDIRECT_RANGE, T)) if(istype(thing, /obj/machinery/power/tesla_coil)) var/turf/simulated/coil_turf = get_turf(thing) - if(istype(coil_turf) && thing.anchored && coil_turf.outdoors == OUTDOORS_YES) + if(istype(coil_turf) && thing.anchored && coil_turf.is_outdoors()) coil = thing break if(istype(thing, /obj/machinery/power/grounding_rod)) var/turf/simulated/rod_turf = get_turf(thing) - if(istype(rod_turf) && thing.anchored && rod_turf.outdoors == OUTDOORS_YES) + if(istype(rod_turf) && thing.anchored && rod_turf.is_outdoors()) ground = thing if(coil) // Coil gets highest priority. diff --git a/code/modules/flufftext/look_up.dm b/code/modules/flufftext/look_up.dm index 846925c4db..10cd25b288 100644 --- a/code/modules/flufftext/look_up.dm +++ b/code/modules/flufftext/look_up.dm @@ -12,7 +12,7 @@ to_chat(usr, span("warning", "You appear to be in a place without any sort of concept of direction. You have bigger problems to worry about.")) return - if(T.outdoors == OUTDOORS_NO) // They're inside. + if(!T.is_outdoors()) // They're inside. to_chat(usr, "You see nothing interesting.") return diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index f3a96b94b9..dd4993bce2 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -42,7 +42,7 @@ var/global/list/total_extraction_beacons = list() return if(!can_use_indoors) var/turf/T = get_turf(A) - if(T && T.outdoors == OUTDOORS_NO) + if(T && !T.is_outdoors()) to_chat(user, "[src] can only be used on things that are outdoors!") return if(!flag) @@ -145,7 +145,7 @@ var/global/list/total_extraction_beacons = list() /obj/item/fulton_core/attack_self(mob/user) var/turf/T = get_turf(user) - var/outdoors = T.outdoors == OUTDOORS_YES + var/outdoors = T.is_outdoors() if(do_after(user,15,target = user) && !QDELETED(src) && outdoors) new /obj/structure/extraction_point(get_turf(user)) qdel(src) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 0aed111890..fad2b7cf25 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -167,7 +167,7 @@ // I don't like that so I'm commenting it out :) // VOREstation Edit Start /* - if((T.outdoors == OUTDOORS_YES) && (T.z <= SSplanets.z_to_planet.len)) + if((T.is_outdoors()) && (T.z <= SSplanets.z_to_planet.len)) var/datum/planet/P = SSplanets.z_to_planet[z] if(P) var/datum/weather_holder/WH = P.weather_holder diff --git a/code/modules/planet/sif.dm b/code/modules/planet/sif.dm index 399ac93973..e09b808a3a 100644 --- a/code/modules/planet/sif.dm +++ b/code/modules/planet/sif.dm @@ -296,7 +296,7 @@ var/datum/planet/sif/planet_sif = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(T.outdoors == OUTDOORS_NO) + if(!T.is_outdoors()) continue // They're indoors, so no need to rain on them. // If they have an open umbrella, it'll guard from rain @@ -349,7 +349,7 @@ var/datum/planet/sif/planet_sif = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(T.outdoors == OUTDOORS_NO) + if(!T.is_outdoors()) continue // They're indoors, so no need to rain on them. // If they have an open umbrella, it'll guard from rain @@ -407,7 +407,7 @@ var/datum/planet/sif/planet_sif = null for(var/mob/living/carbon/H as anything in human_mob_list) if(H.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(H) - if(T.outdoors == OUTDOORS_NO) + if(!T.is_outdoors()) continue // They're indoors, so no need to pelt them with ice. // If they have an open umbrella, it'll guard from hail @@ -502,7 +502,7 @@ var/datum/planet/sif/planet_sif = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(T.outdoors == OUTDOORS_NO) + if(!T.is_outdoors()) continue // They're indoors, so no need to burn them with ash. L.inflict_heat_damage(rand(1, 3)) @@ -539,7 +539,7 @@ var/datum/planet/sif/planet_sif = null if(L.z in holder.our_planet.expected_z_levels) irradiate_nearby_turf(L) var/turf/T = get_turf(L) - if(T.outdoors == OUTDOORS_NO) + if(!T.is_outdoors()) continue // They're indoors, so no need to irradiate them with fallout. L.rad_act(rand(direct_rad_low, direct_rad_high)) @@ -553,5 +553,5 @@ var/datum/planet/sif/planet_sif = null var/turf/T = pick(turfs) // We get one try per tick. if(!istype(T)) return - if(T.outdoors == OUTDOORS_YES) + if(T.is_outdoors()) SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high)) diff --git a/code/modules/planet/weather.dm b/code/modules/planet/weather.dm index 43d7dcc4ea..c354e8bde3 100644 --- a/code/modules/planet/weather.dm +++ b/code/modules/planet/weather.dm @@ -137,7 +137,7 @@ for(var/mob/M in player_list) // Don't need to care about clientless mobs. if(M.z in our_planet.expected_z_levels) var/turf/T = get_turf(M) - if(T.outdoors == OUTDOORS_NO) + if(!T.is_outdoors()) continue to_chat(M, message) @@ -213,7 +213,7 @@ // Otherwise they should hear some sounds, depending on if they're inside or not. var/turf/T = get_turf(M) if(istype(T)) - if(T.outdoors == OUTDOORS_YES) // Mob is currently outdoors. + if(T.is_outdoors()) // Mob is currently outdoors. hear_outdoor_sounds(M, TRUE) hear_indoor_sounds(M, FALSE) From fff3f0ceaf12367d3ff408e3b1c741072472f49d Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Aug 2021 11:26:43 -0400 Subject: [PATCH 6/7] Further tweaks for is_outdoors usage --- code/game/mecha/equipment/weapons/ballistic/mortar.dm | 2 +- code/game/turfs/simulated/floor_icon.dm | 2 +- code/game/turfs/simulated/lava.dm | 2 +- code/modules/metric/activity.dm | 2 +- code/modules/metric/count.dm | 2 +- .../mob/living/silicon/robot/subtypes/thinktank/_thinktank.dm | 3 ++- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/game/mecha/equipment/weapons/ballistic/mortar.dm b/code/game/mecha/equipment/weapons/ballistic/mortar.dm index c192d0fc9b..df734af78c 100644 --- a/code/game/mecha/equipment/weapons/ballistic/mortar.dm +++ b/code/game/mecha/equipment/weapons/ballistic/mortar.dm @@ -18,7 +18,7 @@ /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/mortar/action_checks(atom/target) var/turf/MT = get_turf(chassis) var/turf/TT = get_turf(target) - if(!MT.outdoors || !TT.outdoors) + if(!MT.outdoors || !TT.is_outdoors()) to_chat(chassis.occupant, "\The [src]'s control system prevents you from firing due to a blocked firing arc.") return 0 return ..() \ No newline at end of file diff --git a/code/game/turfs/simulated/floor_icon.dm b/code/game/turfs/simulated/floor_icon.dm index d975f81090..420d8628b5 100644 --- a/code/game/turfs/simulated/floor_icon.dm +++ b/code/game/turfs/simulated/floor_icon.dm @@ -87,7 +87,7 @@ var/image/no_ceiling_image = null // Show 'ceilingless' overlay. var/turf/above = GetAbove(src) - if(above && isopenspace(above) && !istype(src, /turf/simulated/floor/outdoors)) // This won't apply to outdoor turfs since its assumed they don't have a ceiling anyways. + if(!is_outdoors() && above && isopenspace(above)) // This won't apply to outdoor turfs since its assumed they don't have a ceiling anyways. add_overlay(no_ceiling_image) // Update our 'them-to-us' edges, aka edges from external turfs we feel should spill onto us diff --git a/code/game/turfs/simulated/lava.dm b/code/game/turfs/simulated/lava.dm index 6a539ec7b6..e44ac49a66 100644 --- a/code/game/turfs/simulated/lava.dm +++ b/code/game/turfs/simulated/lava.dm @@ -21,7 +21,7 @@ // For maximum pedantry. /turf/simulated/floor/lava/Initialize() - if(!outdoors) + if(!is_outdoors()) name = "magma" update_icon() update_light() diff --git a/code/modules/metric/activity.dm b/code/modules/metric/activity.dm index c33c88adca..dd93b90179 100644 --- a/code/modules/metric/activity.dm +++ b/code/modules/metric/activity.dm @@ -86,7 +86,7 @@ var/num = 0 for(var/mob/living/L in player_list) var/turf/T = get_turf(L) - if(istype(T) && !istype(T, /turf/space) && T.outdoors) + if(istype(T) && !istype(T, /turf/space) && T.is_outdoors()) . += assess_player_activity(L) num++ if(num) diff --git a/code/modules/metric/count.dm b/code/modules/metric/count.dm index ba3678295f..e0b1843d77 100644 --- a/code/modules/metric/count.dm +++ b/code/modules/metric/count.dm @@ -6,7 +6,7 @@ var/num = 0 for(var/mob/living/L in player_list) var/turf/T = get_turf(L) - if(istype(T) && !istype(T, /turf/space) && T.outdoors) + if(istype(T) && !istype(T, /turf/space) && T.is_outdoors()) if(assess_player_activity(L) >= cutoff) num++ return num diff --git a/code/modules/mob/living/silicon/robot/subtypes/thinktank/_thinktank.dm b/code/modules/mob/living/silicon/robot/subtypes/thinktank/_thinktank.dm index cc0b3785b6..4efce708e8 100644 --- a/code/modules/mob/living/silicon/robot/subtypes/thinktank/_thinktank.dm +++ b/code/modules/mob/living/silicon/robot/subtypes/thinktank/_thinktank.dm @@ -136,7 +136,8 @@ if(stat != DEAD && cell) // TODO generalize solar occlusion to charge from the actual sun. - var/new_recharge_state = istype(loc, /turf/simulated/floor/outdoors) || /*, /turf/exterior) */ istype(loc, /turf/space) + var/turf/T = get_turf(src) + var/new_recharge_state = T?.is_outdoors() || isspace(T) if(new_recharge_state != last_recharge_state) last_recharge_state = new_recharge_state if(last_recharge_state) From fd418d7d5ea04817ea4b1faf7765c82b396dadc9 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Aug 2021 11:26:50 -0400 Subject: [PATCH 7/7] VR fixes --- code/modules/lighting/lighting_fake_sun_vr.dm | 2 +- code/modules/planet/virgo3b_vr.dm | 12 ++++++------ code/modules/planet/virgo4_vr.dm | 12 ++++++------ maps/southern_cross/events/wildlife_encounter.dm | 4 +++- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/code/modules/lighting/lighting_fake_sun_vr.dm b/code/modules/lighting/lighting_fake_sun_vr.dm index 8f1d68a6f7..41fb677fb6 100644 --- a/code/modules/lighting/lighting_fake_sun_vr.dm +++ b/code/modules/lighting/lighting_fake_sun_vr.dm @@ -100,7 +100,7 @@ var/list/all_turfs = block(locate(1, 1, min), locate(world.maxx, world.maxy, max)) var/list/turfs_to_use = list() for(var/turf/T as anything in all_turfs) - if(T.outdoors) + if(T.is_outdoors()) turfs_to_use += T if(!turfs_to_use.len) diff --git a/code/modules/planet/virgo3b_vr.dm b/code/modules/planet/virgo3b_vr.dm index d2faf2315d..822faa2d7e 100644 --- a/code/modules/planet/virgo3b_vr.dm +++ b/code/modules/planet/virgo3b_vr.dm @@ -276,7 +276,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to rain on them. // If they have an open umbrella, it'll guard from rain @@ -327,7 +327,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to rain on them. // If they have an open umbrella, it'll guard from rain @@ -383,7 +383,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null for(var/mob/living/carbon/H as anything in human_mob_list) if(H.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(H) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to pelt them with ice. // If they have an open umbrella, it'll guard from hail @@ -474,7 +474,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to burn them with ash. L.inflict_heat_damage(rand(1, 3)) @@ -511,7 +511,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null if(L.z in holder.our_planet.expected_z_levels) irradiate_nearby_turf(L) var/turf/T = get_turf(L) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to irradiate them with fallout. L.rad_act(rand(direct_rad_low, direct_rad_high)) @@ -525,6 +525,6 @@ var/datum/planet/virgo3b/planet_virgo3b = null var/turf/T = pick(turfs) // We get one try per tick. if(!istype(T)) return - if(T.outdoors) + if(T.is_outdoors()) SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high)) diff --git a/code/modules/planet/virgo4_vr.dm b/code/modules/planet/virgo4_vr.dm index 18f4298aa1..74cd6c33b4 100644 --- a/code/modules/planet/virgo4_vr.dm +++ b/code/modules/planet/virgo4_vr.dm @@ -255,7 +255,7 @@ var/datum/planet/virgo4/planet_virgo4 = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to rain on them. // If they have an open umbrella, it'll guard from rain @@ -301,7 +301,7 @@ var/datum/planet/virgo4/planet_virgo4 = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to rain on them. // If they have an open umbrella, it'll guard from rain @@ -354,7 +354,7 @@ var/datum/planet/virgo4/planet_virgo4 = null for(var/mob/living/carbon/H as anything in human_mob_list) if(H.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(H) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to pelt them with ice. // If they have an open umbrella, it'll guard from hail @@ -447,7 +447,7 @@ var/datum/planet/virgo4/planet_virgo4 = null for(var/mob/living/L as anything in living_mob_list) if(L.z in holder.our_planet.expected_z_levels) var/turf/T = get_turf(L) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to burn them with ash. L.inflict_heat_damage(rand(1, 3)) @@ -484,7 +484,7 @@ var/datum/planet/virgo4/planet_virgo4 = null if(L.z in holder.our_planet.expected_z_levels) irradiate_nearby_turf(L) var/turf/T = get_turf(L) - if(!T.outdoors) + if(!T.is_outdoors()) continue // They're indoors, so no need to irradiate them with fallout. L.rad_act(rand(direct_rad_low, direct_rad_high)) @@ -498,7 +498,7 @@ var/datum/planet/virgo4/planet_virgo4 = null var/turf/T = pick(turfs) // We get one try per tick. if(!istype(T)) return - if(T.outdoors) + if(T.is_outdoors()) SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high)) /turf/unsimulated/wall/planetary/normal/virgo4 diff --git a/maps/southern_cross/events/wildlife_encounter.dm b/maps/southern_cross/events/wildlife_encounter.dm index 0a045f9f17..57fde54ef1 100644 --- a/maps/southern_cross/events/wildlife_encounter.dm +++ b/maps/southern_cross/events/wildlife_encounter.dm @@ -24,7 +24,9 @@ // continue // Not on the right z-level. if(L.stat) continue // Don't want dead people. - if(istype(get_turf(L), /turf/simulated/floor/outdoors) && istype(get_area(L),/area/surface/outside/wilderness)) + var/turf/T = get_turf(L) + var/area/A = get_area(L) + if(T?.is_outdoors() && istype(A, /area/tether/outpost/exploration_plains)) // VOREStation Edit potential_victims += L if(potential_victims.len)