Merge pull request #10773 from VOREStation/upstream-merge-8155

[MIRROR] Adds optional area-based definition for outdoors-ness
This commit is contained in:
Aronai Sieyes
2021-08-01 11:41:25 -04:00
committed by GitHub
26 changed files with 98 additions and 58 deletions
+2 -2
View File
@@ -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.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)
if(istype(rod_turf) && thing.anchored && rod_turf.is_outdoors())
ground = thing
if(coil) // Coil gets highest priority.
+1 -1
View File
@@ -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.is_outdoors()) // They're inside.
to_chat(usr, "You see nothing interesting.")
return
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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.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
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)
@@ -167,7 +167,7 @@
// 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.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
@@ -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)
+6 -6
View File
@@ -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.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)
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)
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)
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)
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)
if(T.is_outdoors())
SSradiation.radiate(T, rand(fallout_rad_low, fallout_rad_high))
+6 -6
View File
@@ -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))
+6 -6
View File
@@ -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
+2 -2
View File
@@ -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.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) // Mob is currently outdoors.
if(T.is_outdoors()) // Mob is currently outdoors.
hear_outdoor_sounds(M, TRUE)
hear_indoor_sounds(M, FALSE)