mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-16 05:02:18 +00:00
Fixes Indoor Rain
This commit is contained in:
@@ -34,7 +34,7 @@ SUBSYSTEM_DEF(planets)
|
|||||||
|
|
||||||
// DO NOT CALL THIS DIRECTLY UNLESS IT'S IN INITIALIZE,
|
// DO NOT CALL THIS DIRECTLY UNLESS IT'S IN INITIALIZE,
|
||||||
// USE turf/simulated/proc/make_indoors() and
|
// 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)
|
/datum/controller/subsystem/planets/proc/addTurf(var/turf/T)
|
||||||
if(z_to_planet.len >= T.z && z_to_planet[T.z])
|
if(z_to_planet.len >= T.z && z_to_planet[T.z])
|
||||||
var/datum/planet/P = z_to_planet[T.z]
|
var/datum/planet/P = z_to_planet[T.z]
|
||||||
@@ -42,7 +42,7 @@ SUBSYSTEM_DEF(planets)
|
|||||||
return
|
return
|
||||||
if(istype(T, /turf/unsimulated/wall/planetary))
|
if(istype(T, /turf/unsimulated/wall/planetary))
|
||||||
P.planet_walls += T
|
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.planet_floors += T
|
||||||
T.vis_contents |= P.weather_holder.visuals
|
T.vis_contents |= P.weather_holder.visuals
|
||||||
T.vis_contents |= P.weather_holder.special_visuals
|
T.vis_contents |= P.weather_holder.special_visuals
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ var/global/list/tele_landmarks = list() // Terrible, but the alternative is loop
|
|||||||
if(!istype(candidate) || istype(candidate, /turf/simulated/sky))
|
if(!istype(candidate) || istype(candidate, /turf/simulated/sky))
|
||||||
safety--
|
safety--
|
||||||
continue
|
continue
|
||||||
else if(candidate && !candidate.outdoors == OUTDOORS_YES)
|
else if(candidate && !candidate.is_outdoors())
|
||||||
safety--
|
safety--
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -45,10 +45,10 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
// Create a ceiling to shield from the weather
|
// Create a ceiling to shield from the weather
|
||||||
if(src.outdoors == OUTDOORS_YES)
|
if(src.is_outdoors())
|
||||||
for(var/dir in cardinal)
|
for(var/dir in cardinal)
|
||||||
var/turf/A = get_step(src, dir)
|
var/turf/A = get_step(src, dir)
|
||||||
if(A && !A.outdoors == OUTDOORS_YES)
|
if(A && !A.is_outdoors())
|
||||||
if(expended_tile || R.use(1))
|
if(expended_tile || R.use(1))
|
||||||
make_indoors()
|
make_indoors()
|
||||||
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
|
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
var/list/turf_edge_cache = list()
|
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,
|
// 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.
|
// and if those adjacent turfs have a lower edge_blending_priority.
|
||||||
var/edge_blending_priority = 0
|
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)
|
var/list/turf_layers = list(/turf/simulated/floor/outdoors/rocks)
|
||||||
|
|
||||||
/turf/simulated/floor/Initialize(mapload)
|
/turf/simulated/floor/Initialize(mapload)
|
||||||
if(should_be_outdoors())
|
if(is_outdoors())
|
||||||
SSplanets.addTurf(src)
|
SSplanets.addTurf(src)
|
||||||
. = ..()
|
. = ..()
|
||||||
|
|
||||||
/turf/simulated/floor/Destroy()
|
/turf/simulated/floor/Destroy()
|
||||||
if(should_be_outdoors())
|
if(is_outdoors())
|
||||||
SSplanets.removeTurf(src)
|
SSplanets.removeTurf(src)
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
// Turfs can decide if they should be indoors or outdoors.
|
// Turfs can decide if they should be indoors or outdoors.
|
||||||
// By default they choose based on their area's setting.
|
// By default they choose based on their area's setting.
|
||||||
// This helps cut down on ten billion `/outdoors` subtypes being needed.
|
// 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)
|
switch(outdoors)
|
||||||
if(OUTDOORS_YES)
|
if(OUTDOORS_YES)
|
||||||
return TRUE
|
return TRUE
|
||||||
@@ -50,14 +53,16 @@ var/list/turf_edge_cache = list()
|
|||||||
return TRUE
|
return TRUE
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
|
/// Makes the turf explicitly outdoors.
|
||||||
/turf/simulated/proc/make_outdoors()
|
/turf/simulated/proc/make_outdoors()
|
||||||
if(outdoors == OUTDOORS_YES)
|
if(is_outdoors()) // Already outdoors.
|
||||||
return
|
return
|
||||||
outdoors = OUTDOORS_YES
|
outdoors = OUTDOORS_YES
|
||||||
SSplanets.addTurf(src)
|
SSplanets.addTurf(src)
|
||||||
|
|
||||||
|
/// Makes the turf explicitly indoors.
|
||||||
/turf/simulated/proc/make_indoors()
|
/turf/simulated/proc/make_indoors()
|
||||||
if(!outdoors == OUTDOORS_NO)
|
if(!is_outdoors()) // Already indoors.
|
||||||
return
|
return
|
||||||
outdoors = OUTDOORS_NO
|
outdoors = OUTDOORS_NO
|
||||||
SSplanets.removeTurf(src)
|
SSplanets.removeTurf(src)
|
||||||
@@ -65,7 +70,7 @@ var/list/turf_edge_cache = list()
|
|||||||
/turf/simulated/post_change()
|
/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 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()
|
make_outdoors()
|
||||||
else
|
else
|
||||||
make_indoors()
|
make_indoors()
|
||||||
|
|||||||
@@ -171,7 +171,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
// Create a ceiling to shield from the weather
|
// 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
|
if(expended_tile || R.use(1)) // Don't need to check adjacent turfs for a wall, we're building on one
|
||||||
make_indoors()
|
make_indoors()
|
||||||
if(!expended_tile) // Would've already played a sound
|
if(!expended_tile) // Would've already played a sound
|
||||||
|
|||||||
@@ -40,13 +40,13 @@
|
|||||||
for(var/obj/machinery/power/thing in range(LIGHTNING_REDIRECT_RANGE, T))
|
for(var/obj/machinery/power/thing in range(LIGHTNING_REDIRECT_RANGE, T))
|
||||||
if(istype(thing, /obj/machinery/power/tesla_coil))
|
if(istype(thing, /obj/machinery/power/tesla_coil))
|
||||||
var/turf/simulated/coil_turf = get_turf(thing)
|
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
|
coil = thing
|
||||||
break
|
break
|
||||||
|
|
||||||
if(istype(thing, /obj/machinery/power/grounding_rod))
|
if(istype(thing, /obj/machinery/power/grounding_rod))
|
||||||
var/turf/simulated/rod_turf = get_turf(thing)
|
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
|
ground = thing
|
||||||
|
|
||||||
if(coil) // Coil gets highest priority.
|
if(coil) // Coil gets highest priority.
|
||||||
|
|||||||
@@ -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."))
|
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
|
return
|
||||||
|
|
||||||
if(T.outdoors == OUTDOORS_NO) // They're inside.
|
if(!T.is_outdoors()) // They're inside.
|
||||||
to_chat(usr, "You see nothing interesting.")
|
to_chat(usr, "You see nothing interesting.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ var/global/list/total_extraction_beacons = list()
|
|||||||
return
|
return
|
||||||
if(!can_use_indoors)
|
if(!can_use_indoors)
|
||||||
var/turf/T = get_turf(A)
|
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!")
|
to_chat(user, "[src] can only be used on things that are outdoors!")
|
||||||
return
|
return
|
||||||
if(!flag)
|
if(!flag)
|
||||||
@@ -146,7 +146,7 @@ var/global/list/total_extraction_beacons = list()
|
|||||||
|
|
||||||
/obj/item/fulton_core/attack_self(mob/user)
|
/obj/item/fulton_core/attack_self(mob/user)
|
||||||
var/turf/T = get_turf(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)
|
if(do_after(user,15,target = user) && !QDELETED(src) && outdoors)
|
||||||
new /obj/structure/extraction_point(get_turf(user))
|
new /obj/structure/extraction_point(get_turf(user))
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
. += turf_move_cost
|
. += turf_move_cost
|
||||||
|
|
||||||
// Wind makes it easier or harder to move, depending on if you're with or against the wind.
|
// Wind makes it easier or harder to move, depending on if you're with or against the wind.
|
||||||
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]
|
var/datum/planet/P = SSplanets.z_to_planet[z]
|
||||||
if(P)
|
if(P)
|
||||||
var/datum/weather_holder/WH = P.weather_holder
|
var/datum/weather_holder/WH = P.weather_holder
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ var/datum/planet/sif/planet_sif = null
|
|||||||
for(var/mob/living/L as anything in living_mob_list)
|
for(var/mob/living/L as anything in living_mob_list)
|
||||||
if(L.z in holder.our_planet.expected_z_levels)
|
if(L.z in holder.our_planet.expected_z_levels)
|
||||||
var/turf/T = get_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 rain on them.
|
continue // They're indoors, so no need to rain on them.
|
||||||
|
|
||||||
// If they have an open umbrella, it'll guard from rain
|
// If they have an open umbrella, it'll guard from rain
|
||||||
@@ -352,7 +352,7 @@ var/datum/planet/sif/planet_sif = null
|
|||||||
for(var/mob/living/L as anything in living_mob_list)
|
for(var/mob/living/L as anything in living_mob_list)
|
||||||
if(L.z in holder.our_planet.expected_z_levels)
|
if(L.z in holder.our_planet.expected_z_levels)
|
||||||
var/turf/T = get_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 rain on them.
|
continue // They're indoors, so no need to rain on them.
|
||||||
|
|
||||||
// If they have an open umbrella, it'll guard from rain
|
// If they have an open umbrella, it'll guard from rain
|
||||||
@@ -410,7 +410,7 @@ var/datum/planet/sif/planet_sif = null
|
|||||||
for(var/mob/living/carbon/H as anything in human_mob_list)
|
for(var/mob/living/carbon/H as anything in human_mob_list)
|
||||||
if(H.z in holder.our_planet.expected_z_levels)
|
if(H.z in holder.our_planet.expected_z_levels)
|
||||||
var/turf/T = get_turf(H)
|
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.
|
continue // They're indoors, so no need to pelt them with ice.
|
||||||
|
|
||||||
// If they have an open umbrella, it'll guard from hail
|
// If they have an open umbrella, it'll guard from hail
|
||||||
@@ -506,7 +506,7 @@ var/datum/planet/sif/planet_sif = null
|
|||||||
var/mob/living/L = thing
|
var/mob/living/L = thing
|
||||||
if(L.z in holder.our_planet.expected_z_levels)
|
if(L.z in holder.our_planet.expected_z_levels)
|
||||||
var/turf/T = get_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 burn them with ash.
|
continue // They're indoors, so no need to burn them with ash.
|
||||||
|
|
||||||
L.inflict_heat_damage(rand(1, 3))
|
L.inflict_heat_damage(rand(1, 3))
|
||||||
@@ -544,7 +544,7 @@ var/datum/planet/sif/planet_sif = null
|
|||||||
if(L.z in holder.our_planet.expected_z_levels)
|
if(L.z in holder.our_planet.expected_z_levels)
|
||||||
irradiate_nearby_turf(L)
|
irradiate_nearby_turf(L)
|
||||||
var/turf/T = get_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.
|
continue // They're indoors, so no need to irradiate them with fallout.
|
||||||
|
|
||||||
L.rad_act(rand(direct_rad_low, direct_rad_high))
|
L.rad_act(rand(direct_rad_low, direct_rad_high))
|
||||||
@@ -558,5 +558,5 @@ var/datum/planet/sif/planet_sif = null
|
|||||||
var/turf/T = pick(turfs) // We get one try per tick.
|
var/turf/T = pick(turfs) // We get one try per tick.
|
||||||
if(!istype(T))
|
if(!istype(T))
|
||||||
return
|
return
|
||||||
if(T.outdoors == OUTDOORS_YES)
|
if(T.is_outdoors())
|
||||||
SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high))
|
SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high))
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
for(var/mob/M in player_list) // Don't need to care about clientless mobs.
|
for(var/mob/M in player_list) // Don't need to care about clientless mobs.
|
||||||
if(M.z in our_planet.expected_z_levels)
|
if(M.z in our_planet.expected_z_levels)
|
||||||
var/turf/T = get_turf(M)
|
var/turf/T = get_turf(M)
|
||||||
if(T.outdoors == OUTDOORS_NO)
|
if(!T.is_outdoors())
|
||||||
continue
|
continue
|
||||||
to_chat(M, message)
|
to_chat(M, message)
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
// Otherwise they should hear some sounds, depending on if they're inside or not.
|
// Otherwise they should hear some sounds, depending on if they're inside or not.
|
||||||
var/turf/T = get_turf(M)
|
var/turf/T = get_turf(M)
|
||||||
if(istype(T))
|
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_outdoor_sounds(M, TRUE)
|
||||||
hear_indoor_sounds(M, FALSE)
|
hear_indoor_sounds(M, FALSE)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user