mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
[MIRROR] [MIRROR] Optimizes SSplanets initialization (#1788)
* Merge pull request #10119 from VOREStation/upstream-merge-8015 [MIRROR] Optimizes SSplanets initialization * [MIRROR] Optimizes SSplanets initialization Co-authored-by: Novacat <35587478+Novacat@users.noreply.github.com>
This commit is contained in:
@@ -58,7 +58,8 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
|
||||
#define INIT_ORDER_SKYBOX 30
|
||||
#define INIT_ORDER_MAPPING 25
|
||||
#define INIT_ORDER_DECALS 20
|
||||
#define INIT_ORDER_PLANTS 18 // Must initialize before atoms.
|
||||
#define INIT_ORDER_PLANTS 19 // Must initialize before atoms.
|
||||
#define INIT_ORDER_PLANETS 18
|
||||
#define INIT_ORDER_JOB 17
|
||||
#define INIT_ORDER_ALARM 16 // Must initialize before atoms.
|
||||
#define INIT_ORDER_ATOMS 15
|
||||
@@ -69,7 +70,6 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
|
||||
#define INIT_ORDER_LIGHTING 0
|
||||
#define INIT_ORDER_AIR -1
|
||||
#define INIT_ORDER_ASSETS -3
|
||||
#define INIT_ORDER_PLANETS -4
|
||||
#define INIT_ORDER_HOLOMAPS -5
|
||||
#define INIT_ORDER_NIGHTSHIFT -6
|
||||
#define INIT_ORDER_OVERLAY -7
|
||||
|
||||
@@ -6,9 +6,6 @@ SUBSYSTEM_DEF(planets)
|
||||
flags = SS_BACKGROUND
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/static/list/new_outdoor_turfs = list()
|
||||
var/static/list/new_outdoor_walls = list()
|
||||
|
||||
var/static/list/planets = list()
|
||||
var/static/list/z_to_planet = list()
|
||||
|
||||
@@ -20,7 +17,6 @@ SUBSYSTEM_DEF(planets)
|
||||
/datum/controller/subsystem/planets/Initialize(timeofday)
|
||||
admin_notice("<span class='danger'>Initializing planetary weather.</span>", R_DEBUG)
|
||||
createPlanets()
|
||||
allocateTurfs(TRUE)
|
||||
..()
|
||||
|
||||
/datum/controller/subsystem/planets/proc/createPlanets()
|
||||
@@ -36,64 +32,36 @@ SUBSYSTEM_DEF(planets)
|
||||
continue
|
||||
z_to_planet[Z] = NP
|
||||
|
||||
/datum/controller/subsystem/planets/proc/addTurf(var/turf/T,var/is_edge)
|
||||
if(is_edge)
|
||||
new_outdoor_walls |= T
|
||||
else
|
||||
new_outdoor_turfs |= T
|
||||
// DO NOT CALL THIS DIRECTLY UNLESS IT'S IN INITIALIZE,
|
||||
// USE turf/simulated/proc/make_indoors() and\
|
||||
// tyrf/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]
|
||||
if(!istype(P))
|
||||
return
|
||||
if(istype(T, /turf/unsimulated/wall/planetary))
|
||||
P.planet_walls += T
|
||||
else if(istype(T, /turf/simulated) && T.outdoors)
|
||||
P.planet_floors += T
|
||||
T.vis_contents |= P.weather_holder.visuals
|
||||
T.vis_contents |= P.weather_holder.special_visuals
|
||||
|
||||
|
||||
/datum/controller/subsystem/planets/proc/removeTurf(var/turf/T,var/is_edge)
|
||||
if(is_edge)
|
||||
new_outdoor_walls -= T
|
||||
else
|
||||
new_outdoor_turfs -= T
|
||||
|
||||
if(z_to_planet.len >= T.z)
|
||||
var/datum/planet/P = z_to_planet[T.z]
|
||||
if(!P)
|
||||
return
|
||||
if(is_edge)
|
||||
P.planet_floors -= T
|
||||
else
|
||||
if(istype(T, /turf/unsimulated/wall/planetary))
|
||||
P.planet_walls -= T
|
||||
T.vis_contents -= P.weather_holder.visuals
|
||||
T.vis_contents -= P.weather_holder.special_visuals
|
||||
|
||||
/datum/controller/subsystem/planets/proc/allocateTurfs(var/initial = FALSE)
|
||||
var/list/currentlist = new_outdoor_turfs
|
||||
while(currentlist.len)
|
||||
var/turf/simulated/OT = currentlist[currentlist.len]
|
||||
currentlist.len--
|
||||
if(istype(OT) && OT.outdoors && z_to_planet.len >= OT.z && z_to_planet[OT.z])
|
||||
var/datum/planet/P = z_to_planet[OT.z]
|
||||
P.planet_floors |= OT
|
||||
OT.vis_contents |= P.weather_holder.visuals
|
||||
OT.vis_contents |= P.weather_holder.special_visuals
|
||||
if(!initial && MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
currentlist = new_outdoor_walls
|
||||
while(currentlist.len)
|
||||
var/turf/unsimulated/wall/planetary/PW = currentlist[currentlist.len]
|
||||
currentlist.len--
|
||||
if(istype(PW) && z_to_planet.len >= PW.z && z_to_planet[PW.z])
|
||||
var/datum/planet/P = z_to_planet[PW.z]
|
||||
P.planet_walls |= PW
|
||||
if(!initial && MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/planets/proc/unallocateTurf(var/turf/simulated/T)
|
||||
if(istype(T) && z_to_planet[T.z])
|
||||
var/datum/planet/P = z_to_planet[T.z]
|
||||
P.planet_floors -= T
|
||||
T.vis_contents -= P.weather_holder.visuals
|
||||
T.vis_contents -= P.weather_holder.special_visuals
|
||||
else
|
||||
P.planet_floors -= T
|
||||
T.vis_contents -= P.weather_holder.visuals
|
||||
T.vis_contents -= P.weather_holder.special_visuals
|
||||
|
||||
|
||||
/datum/controller/subsystem/planets/fire(resumed = 0)
|
||||
if(new_outdoor_turfs.len || new_outdoor_walls.len)
|
||||
allocateTurfs()
|
||||
|
||||
if(!resumed)
|
||||
src.currentrun = planets.Copy()
|
||||
|
||||
@@ -153,8 +121,7 @@ SUBSYSTEM_DEF(planets)
|
||||
var/lum_g = new_brightness * GetGreenPart(new_color) / 255
|
||||
var/lum_b = new_brightness * GetBluePart (new_color) / 255
|
||||
var/static/update_gen = -1 // Used to prevent double-processing corners. Otherwise would happen when looping over adjacent turfs.
|
||||
for(var/I in P.planet_floors)
|
||||
var/turf/simulated/T = I
|
||||
for(var/turf/simulated/T as anything in P.planet_floors)
|
||||
if(!T.lighting_corners_initialised)
|
||||
T.generate_missing_corners()
|
||||
for(var/C in T.get_corners())
|
||||
|
||||
@@ -31,10 +31,14 @@ var/list/turf_edge_cache = list()
|
||||
return ..()
|
||||
|
||||
/turf/simulated/proc/make_outdoors()
|
||||
if(outdoors)
|
||||
return
|
||||
outdoors = TRUE
|
||||
SSplanets.addTurf(src)
|
||||
|
||||
/turf/simulated/proc/make_indoors()
|
||||
if(!outdoors)
|
||||
return
|
||||
outdoors = FALSE
|
||||
SSplanets.removeTurf(src)
|
||||
|
||||
|
||||
@@ -216,15 +216,17 @@ var/datum/planet/sif/planet_sif = null
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/outside_snow
|
||||
indoor_sounds_type = /datum/looping_sound/weather/inside_snow
|
||||
|
||||
/*
|
||||
/datum/weather/sif/snow/process_effects()
|
||||
..()
|
||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
for(var/turf/simulated/floor/outdoors/snow/S as anything in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
if(S.z in holder.our_planet.expected_z_levels)
|
||||
for(var/dir_checked in cardinal)
|
||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||
if(istype(T))
|
||||
if(istype(T, /turf/simulated/floor/outdoors) && prob(33))
|
||||
T.chill()
|
||||
*/
|
||||
|
||||
/datum/weather/sif/blizzard
|
||||
name = "blizzard"
|
||||
@@ -249,15 +251,17 @@ var/datum/planet/sif/planet_sif = null
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
|
||||
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
|
||||
|
||||
/*
|
||||
/datum/weather/sif/blizzard/process_effects()
|
||||
..()
|
||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
for(var/turf/simulated/floor/outdoors/snow/S as anything in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
if(S.z in holder.our_planet.expected_z_levels)
|
||||
for(var/dir_checked in cardinal)
|
||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||
if(istype(T))
|
||||
if(istype(T, /turf/simulated/floor/outdoors) && prob(50))
|
||||
T.chill()
|
||||
*/
|
||||
|
||||
/datum/weather/sif/rain
|
||||
name = "rain"
|
||||
@@ -283,25 +287,21 @@ var/datum/planet/sif/planet_sif = null
|
||||
|
||||
/datum/weather/sif/rain/process_effects()
|
||||
..()
|
||||
for(var/mob/living/L 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)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.outdoors)
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = L.get_inactive_hand()
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
|
||||
L.water_act(1)
|
||||
if(show_message)
|
||||
@@ -340,24 +340,21 @@ var/datum/planet/sif/planet_sif = null
|
||||
|
||||
/datum/weather/sif/storm/process_effects()
|
||||
..()
|
||||
for(var/mob/living/L 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)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.outdoors)
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = L.get_inactive_hand()
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
|
||||
|
||||
L.water_act(2)
|
||||
@@ -401,20 +398,18 @@ var/datum/planet/sif/planet_sif = null
|
||||
|
||||
/datum/weather/sif/hail/process_effects()
|
||||
..()
|
||||
for(var/humie in human_mob_list)
|
||||
var/mob/living/carbon/human/H = humie
|
||||
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)
|
||||
continue // They're indoors, so no need to pelt them with ice.
|
||||
|
||||
// If they have an open umbrella, it'll guard from hail
|
||||
var/obj/item/weapon/melee/umbrella/U
|
||||
if(istype(H.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
U = H.get_active_hand()
|
||||
else if(istype(H.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = H.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = H.get_inactive_hand()
|
||||
if(U && U.open)
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(H, "<span class='notice'>Hail patters onto your umbrella.</span>")
|
||||
continue
|
||||
|
||||
@@ -156,15 +156,17 @@ var/datum/planet/virgo3b_better/planet_virgo3b_better = null
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/outside_snow
|
||||
indoor_sounds_type = /datum/looping_sound/weather/inside_snow
|
||||
|
||||
/*
|
||||
/datum/weather/virgo3b_better/snow/process_effects()
|
||||
..()
|
||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
for(var/turf/simulated/floor/outdoors/snow/S as anything in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
if(S.z in holder.our_planet.expected_z_levels)
|
||||
for(var/dir_checked in cardinal)
|
||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||
if(istype(T))
|
||||
if(istype(T, /turf/simulated/floor/outdoors) && prob(33))
|
||||
T.chill()
|
||||
*/
|
||||
|
||||
/datum/weather/virgo3b_better/blizzard
|
||||
name = "blizzard"
|
||||
@@ -189,15 +191,17 @@ var/datum/planet/virgo3b_better/planet_virgo3b_better = null
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
|
||||
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
|
||||
|
||||
/*
|
||||
/datum/weather/virgo3b_better/blizzard/process_effects()
|
||||
..()
|
||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
for(var/turf/simulated/floor/outdoors/snow/S as anything in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
if(S.z in holder.our_planet.expected_z_levels)
|
||||
for(var/dir_checked in cardinal)
|
||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||
if(istype(T))
|
||||
if(istype(T, /turf/simulated/floor/outdoors) && prob(50))
|
||||
T.chill()
|
||||
*/
|
||||
|
||||
/datum/weather/virgo3b_better/rain
|
||||
name = "rain"
|
||||
@@ -220,25 +224,21 @@ var/datum/planet/virgo3b_better/planet_virgo3b_better = null
|
||||
|
||||
/datum/weather/virgo3b_better/rain/process_effects()
|
||||
..()
|
||||
for(var/mob/living/L 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)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.outdoors)
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = L.get_inactive_hand()
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
|
||||
L.water_act(1)
|
||||
if(show_message)
|
||||
@@ -275,25 +275,21 @@ var/datum/planet/virgo3b_better/planet_virgo3b_better = null
|
||||
|
||||
/datum/weather/virgo3b_better/storm/process_effects()
|
||||
..()
|
||||
for(var/mob/living/L 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)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.outdoors)
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = L.get_inactive_hand()
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
|
||||
|
||||
L.water_act(2)
|
||||
@@ -335,20 +331,18 @@ var/datum/planet/virgo3b_better/planet_virgo3b_better = null
|
||||
|
||||
/datum/weather/virgo3b_better/hail/process_effects()
|
||||
..()
|
||||
for(var/humie in human_mob_list)
|
||||
var/mob/living/carbon/human/H = humie
|
||||
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)
|
||||
continue // They're indoors, so no need to pelt them with ice.
|
||||
|
||||
// If they have an open umbrella, it'll guard from hail
|
||||
var/obj/item/weapon/melee/umbrella/U
|
||||
if(istype(H.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
U = H.get_active_hand()
|
||||
else if(istype(H.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = H.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = H.get_inactive_hand()
|
||||
if(U && U.open)
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(H, "<span class='notice'>Hail patters onto your umbrella.</span>")
|
||||
continue
|
||||
|
||||
@@ -203,15 +203,17 @@ var/datum/planet/virgo3b/planet_virgo3b = null
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/outside_snow
|
||||
indoor_sounds_type = /datum/looping_sound/weather/inside_snow
|
||||
|
||||
/*
|
||||
/datum/weather/virgo3b/snow/process_effects()
|
||||
..()
|
||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
for(var/turf/simulated/floor/outdoors/snow/S as anything in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
if(S.z in holder.our_planet.expected_z_levels)
|
||||
for(var/dir_checked in cardinal)
|
||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||
if(istype(T))
|
||||
if(istype(T, /turf/simulated/floor/outdoors) && prob(33))
|
||||
T.chill()
|
||||
*/
|
||||
|
||||
/datum/weather/virgo3b/blizzard
|
||||
name = "blizzard"
|
||||
@@ -236,15 +238,17 @@ var/datum/planet/virgo3b/planet_virgo3b = null
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
|
||||
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
|
||||
|
||||
/*
|
||||
/datum/weather/virgo3b/blizzard/process_effects()
|
||||
..()
|
||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
for(var/turf/simulated/floor/outdoors/snow/S as anything in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
if(S.z in holder.our_planet.expected_z_levels)
|
||||
for(var/dir_checked in cardinal)
|
||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||
if(istype(T))
|
||||
if(istype(T, /turf/simulated/floor/outdoors) && prob(50))
|
||||
T.chill()
|
||||
*/
|
||||
|
||||
/datum/weather/virgo3b/rain
|
||||
name = "rain"
|
||||
@@ -270,25 +274,21 @@ var/datum/planet/virgo3b/planet_virgo3b = null
|
||||
|
||||
/datum/weather/virgo3b/rain/process_effects()
|
||||
..()
|
||||
for(var/mob/living/L 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)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.outdoors)
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = L.get_inactive_hand()
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
|
||||
L.water_act(1)
|
||||
if(show_message)
|
||||
@@ -325,25 +325,21 @@ var/datum/planet/virgo3b/planet_virgo3b = null
|
||||
|
||||
/datum/weather/virgo3b/storm/process_effects()
|
||||
..()
|
||||
for(var/mob/living/L 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)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.outdoors)
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = L.get_inactive_hand()
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
|
||||
|
||||
L.water_act(2)
|
||||
@@ -385,20 +381,18 @@ var/datum/planet/virgo3b/planet_virgo3b = null
|
||||
|
||||
/datum/weather/virgo3b/hail/process_effects()
|
||||
..()
|
||||
for(var/humie in human_mob_list)
|
||||
var/mob/living/carbon/human/H = humie
|
||||
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)
|
||||
continue // They're indoors, so no need to pelt them with ice.
|
||||
|
||||
// If they have an open umbrella, it'll guard from hail
|
||||
var/obj/item/weapon/melee/umbrella/U
|
||||
if(istype(H.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
U = H.get_active_hand()
|
||||
else if(istype(H.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = H.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = H.get_inactive_hand()
|
||||
if(U && U.open)
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(H, "<span class='notice'>Hail patters onto your umbrella.</span>")
|
||||
continue
|
||||
|
||||
@@ -187,15 +187,17 @@ var/datum/planet/virgo4/planet_virgo4 = null
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/outside_snow
|
||||
indoor_sounds_type = /datum/looping_sound/weather/inside_snow
|
||||
|
||||
/*
|
||||
/datum/weather/virgo4/snow/process_effects()
|
||||
..()
|
||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
for(var/turf/simulated/floor/outdoors/snow/S as anything in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
if(S.z in holder.our_planet.expected_z_levels)
|
||||
for(var/dir_checked in cardinal)
|
||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||
if(istype(T))
|
||||
if(istype(T, /turf/simulated/floor/outdoors) && prob(33))
|
||||
T.chill()
|
||||
*/
|
||||
|
||||
/datum/weather/virgo4/blizzard
|
||||
name = "blizzard"
|
||||
@@ -217,15 +219,17 @@ var/datum/planet/virgo4/planet_virgo4 = null
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
|
||||
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
|
||||
|
||||
/*
|
||||
/datum/weather/virgo4/blizzard/process_effects()
|
||||
..()
|
||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
for(var/turf/simulated/floor/outdoors/snow/S as anything in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||
if(S.z in holder.our_planet.expected_z_levels)
|
||||
for(var/dir_checked in cardinal)
|
||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||
if(istype(T))
|
||||
if(istype(T, /turf/simulated/floor/outdoors) && prob(50))
|
||||
T.chill()
|
||||
*/
|
||||
|
||||
/datum/weather/virgo4/rain
|
||||
name = "rain"
|
||||
@@ -248,25 +252,21 @@ var/datum/planet/virgo4/planet_virgo4 = null
|
||||
|
||||
/datum/weather/virgo4/rain/process_effects()
|
||||
..()
|
||||
for(var/mob/living/L 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)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.outdoors)
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = L.get_inactive_hand()
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella.</span>")
|
||||
continue
|
||||
|
||||
L.water_act(1)
|
||||
if(show_message)
|
||||
@@ -298,25 +298,21 @@ var/datum/planet/virgo4/planet_virgo4 = null
|
||||
|
||||
/datum/weather/virgo4/storm/process_effects()
|
||||
..()
|
||||
for(var/mob/living/L 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)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.outdoors)
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
||||
if(U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = L.get_inactive_hand()
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(L, "<span class='notice'>Rain showers loudly onto your umbrella!</span>")
|
||||
continue
|
||||
|
||||
|
||||
L.water_act(2)
|
||||
@@ -355,20 +351,18 @@ var/datum/planet/virgo4/planet_virgo4 = null
|
||||
|
||||
/datum/weather/virgo4/hail/process_effects()
|
||||
..()
|
||||
for(var/humie in human_mob_list)
|
||||
var/mob/living/carbon/human/H = humie
|
||||
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)
|
||||
continue // They're indoors, so no need to pelt them with ice.
|
||||
|
||||
// If they have an open umbrella, it'll guard from hail
|
||||
var/obj/item/weapon/melee/umbrella/U
|
||||
if(istype(H.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||
U = H.get_active_hand()
|
||||
else if(istype(H.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||
var/obj/item/weapon/melee/umbrella/U = H.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = H.get_inactive_hand()
|
||||
if(U && U.open)
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(H, "<span class='notice'>Hail patters onto your umbrella.</span>")
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user