mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] Reworks weather effects to no longer hurt phased entities (#10595)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
6b699a2b5b
commit
5069c8c6a6
@@ -116,39 +116,38 @@
|
||||
WEATHER_OVERCAST = 100
|
||||
)
|
||||
imminent_transition_message = "The sky fills with green clouds."
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
|
||||
|
||||
/datum/weather/sif/toxinrain/process_effects()
|
||||
..()
|
||||
for(var/mob/living/carbon/H as anything in human_mob_list)
|
||||
if(H?.z in holder.our_planet.expected_z_levels) // CHOMPedit Add a check that L has to be valid and not null
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
continue
|
||||
/datum/weather/sif/toxinrain/planet_effect(mob/living/carbon/H)
|
||||
if(H.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
return
|
||||
|
||||
var/obj/item/melee/umbrella/U = H.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = H.get_inactive_hand()
|
||||
var/obj/item/melee/umbrella/U = H.get_active_hand()
|
||||
if(!istype(U) || !U.open)
|
||||
U = H.get_inactive_hand()
|
||||
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(H, span_notice("Rain patters onto your umbrella."))
|
||||
continue
|
||||
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "bio")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "bio")
|
||||
|
||||
var/damage = rand(1,5)
|
||||
|
||||
if(amount_blocked >= 40)
|
||||
continue
|
||||
|
||||
if(amount_soaked >= damage)
|
||||
continue // No need to apply damage.
|
||||
|
||||
H.apply_damage(damage, BURN, target_zone, amount_blocked, amount_soaked, used_weapon = "acidic rain")
|
||||
if(istype(U) && U.open)
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
to_chat(H, span_notice("Rain patters onto your umbrella."))
|
||||
return
|
||||
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "bio")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "bio")
|
||||
|
||||
var/damage = rand(1,5)
|
||||
|
||||
if(amount_blocked >= 40)
|
||||
return
|
||||
|
||||
if(amount_soaked >= damage)
|
||||
return // No need to apply damage.
|
||||
|
||||
H.apply_damage(damage, BURN, target_zone, amount_blocked, amount_soaked, used_weapon = "acidic rain")
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
|
||||
/datum/weather/sif/sandstorm
|
||||
name = "Sandstorm"
|
||||
@@ -159,31 +158,29 @@
|
||||
WEATHER_OVERCAST = 100
|
||||
)
|
||||
imminent_transition_message = "Pebbles fly through the sky."
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
|
||||
|
||||
/datum/weather/sif/sandstorm/planet_effect(mob/living/carbon/H)
|
||||
if(H.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
return
|
||||
|
||||
/datum/weather/sif/sandstorm/process_effects()
|
||||
..()
|
||||
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.is_outdoors())
|
||||
continue
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "melee")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "melee")
|
||||
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "melee")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "melee")
|
||||
var/damage = rand(1,2)
|
||||
|
||||
var/damage = rand(1,2)
|
||||
if(amount_blocked >= 10)
|
||||
return
|
||||
|
||||
if(amount_blocked >= 10)
|
||||
continue
|
||||
if(amount_soaked >= damage)
|
||||
return // No need to apply damage.
|
||||
|
||||
if(amount_soaked >= damage)
|
||||
continue // No need to apply damage.
|
||||
|
||||
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "sand")
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "sand")
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
|
||||
//datum/weather/sif/stupidbrainwantingthingsinfives
|
||||
|
||||
@@ -198,15 +195,14 @@
|
||||
WEATHER_OVERCAST = 100
|
||||
)
|
||||
imminent_transition_message = "Stars begin to dance closer then before."
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
|
||||
|
||||
/datum/weather/sif/starryrift/process_effects()
|
||||
..()
|
||||
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.is_outdoors())
|
||||
continue
|
||||
H.add_modifier(/datum/modifier/starrynight_boon, 1 SECONDS, src)
|
||||
/datum/weather/sif/starryrift/planet_effect(mob/living/carbon/H)
|
||||
if(H.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
return
|
||||
H.add_modifier(/datum/modifier/starrynight_boon, 1 SECONDS, src)
|
||||
|
||||
/datum/modifier/starrynight_boon
|
||||
name = "Starry Night"
|
||||
@@ -246,15 +242,14 @@
|
||||
WEATHER_OVERCAST = 100
|
||||
)
|
||||
imminent_transition_message = "Fog emerges from nowhere."
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
|
||||
|
||||
/datum/weather/sif/midnightfog/process_effects()
|
||||
..()
|
||||
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.is_outdoors())
|
||||
continue
|
||||
H.add_modifier(/datum/modifier/midnightfog_boon, 1 SECONDS, src)
|
||||
/datum/weather/sif/midnightfog/planet_effect(mob/living/carbon/H)
|
||||
if(H.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
return
|
||||
H.add_modifier(/datum/modifier/midnightfog_boon, 1 SECONDS, src)
|
||||
|
||||
/datum/weather/sif/fallout/temp
|
||||
name = "short-term fallout"
|
||||
@@ -314,32 +309,33 @@
|
||||
)
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/rainheavy
|
||||
indoor_sounds_type = /datum/looping_sound/weather/rainindoors
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
|
||||
|
||||
/datum/weather/sif/downpour/planet_effect(mob/living/L)
|
||||
if(L.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.is_outdoors())
|
||||
return // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, knock it off, this is more then an umbrella
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
var/obj/item/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_notice("The rain pushes the umbrella off your hands!"))
|
||||
H.drop_both_hands()
|
||||
|
||||
L.water_act(2)
|
||||
L.Weaken(3)
|
||||
if(show_message)
|
||||
to_chat(L, effect_message)
|
||||
|
||||
/datum/weather/sif/downpour/process_effects()
|
||||
..()
|
||||
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.is_outdoors())
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, knock it off, this is more then an umbrella
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
var/obj/item/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_notice("The rain pushes the umbrella off your hands!"))
|
||||
H.drop_both_hands()
|
||||
|
||||
L.water_act(2)
|
||||
L.Weaken(3)
|
||||
if(show_message)
|
||||
to_chat(L, effect_message)
|
||||
|
||||
handle_lightning()
|
||||
|
||||
// This gets called to do lightning periodically.
|
||||
@@ -376,45 +372,45 @@
|
||||
//No transition message, supposed to be the 'actual' rain
|
||||
outdoor_sounds_type = /datum/looping_sound/weather/rainextreme
|
||||
indoor_sounds_type = /datum/looping_sound/weather/rainindoors
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
|
||||
|
||||
/datum/weather/sif/downpourfatal/planet_effect(mob/living/L)
|
||||
if(L.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.is_outdoors())
|
||||
return // They're indoors, so no need to rain on them.
|
||||
|
||||
// Knock the umbrella off your hands, aint protecting you c:
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
var/obj/item/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_notice("The rain pushes the umbrella off your hands!"))
|
||||
H.drop_both_hands()
|
||||
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = L.run_armor_check(target_zone, "melee")
|
||||
var/amount_soaked = L.get_armor_soak(target_zone, "melee")
|
||||
|
||||
var/damage = rand(10,30) //Ow
|
||||
|
||||
if(amount_blocked >= 30)
|
||||
return
|
||||
|
||||
if(amount_soaked >= damage)
|
||||
return // No need to apply damage.
|
||||
|
||||
L.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "rain bludgoning")
|
||||
L.Weaken(3)
|
||||
if(show_message)
|
||||
to_chat(L, effect_message)
|
||||
|
||||
/datum/weather/sif/downpourfatal/process_effects()
|
||||
..()
|
||||
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.is_outdoors())
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// Knock the umbrella off your hands, aint protecting you c:
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
var/obj/item/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_notice("The rain pushes the umbrella off your hands!"))
|
||||
H.drop_both_hands()
|
||||
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = L.run_armor_check(target_zone, "melee")
|
||||
var/amount_soaked = L.get_armor_soak(target_zone, "melee")
|
||||
|
||||
var/damage = rand(10,30) //Ow
|
||||
|
||||
if(amount_blocked >= 30)
|
||||
continue
|
||||
|
||||
if(amount_soaked >= damage)
|
||||
continue // No need to apply damage.
|
||||
|
||||
L.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "rain bludgoning")
|
||||
L.Weaken(3)
|
||||
if(show_message)
|
||||
to_chat(L, effect_message)
|
||||
|
||||
|
||||
handle_lightning()
|
||||
|
||||
// This gets called to do lightning periodically.
|
||||
|
||||
@@ -160,30 +160,29 @@ var/datum/planet/tyr/planet_tyr = null
|
||||
sky_visible = TRUE
|
||||
observed_message = "The sky is on fire."
|
||||
imminent_transition_message = "The sky is set ablaze."
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
|
||||
|
||||
/datum/weather/tyr/flamestorm/process_effects()
|
||||
..()
|
||||
for(var/mob/living/carbon/H as anything in human_mob_list)
|
||||
if(H?.z in holder.our_planet.expected_z_levels) // CHOMPedit Add a check that L has to be valid and not null
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
continue
|
||||
/datum/weather/tyr/flamestorm/planet_effect(mob/living/carbon/H)
|
||||
if(H.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
return
|
||||
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "bio")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "bio")
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "bio")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "bio")
|
||||
|
||||
var/damage = rand(1,1)
|
||||
var/damage = rand(1,1)
|
||||
|
||||
if(amount_blocked >= 40)
|
||||
continue
|
||||
if(amount_blocked >= 40)
|
||||
return
|
||||
|
||||
if(amount_soaked >= damage)
|
||||
continue // No need to apply damage.
|
||||
if(amount_soaked >= damage)
|
||||
return // No need to apply damage.
|
||||
|
||||
H.apply_damage(damage, BURN, target_zone, amount_blocked, amount_soaked, used_weapon = "burning ash")
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
H.apply_damage(damage, BURN, target_zone, amount_blocked, amount_soaked, used_weapon = "burning ash")
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
|
||||
/datum/weather/tyr/sandstorm
|
||||
name = "sandstorm"
|
||||
@@ -198,31 +197,29 @@ var/datum/planet/tyr/planet_tyr = null
|
||||
sky_visible = TRUE
|
||||
observed_message = "The sky is full of sand."
|
||||
imminent_transition_message = "Pebbles begin to fill the sky."
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
|
||||
|
||||
/datum/weather/tyr/sandstorm/planet_effect(mob/living/carbon/H)
|
||||
if(H.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
return
|
||||
|
||||
/datum/weather/tyr/sandstorm/process_effects()
|
||||
..()
|
||||
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.is_outdoors())
|
||||
continue
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "melee")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "melee")
|
||||
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "melee")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "melee")
|
||||
var/damage = rand(2,2)
|
||||
|
||||
var/damage = rand(2,2)
|
||||
if(amount_blocked >= 10)
|
||||
return
|
||||
|
||||
if(amount_blocked >= 10)
|
||||
continue
|
||||
if(amount_soaked >= damage)
|
||||
return // No need to apply damage.
|
||||
|
||||
if(amount_soaked >= damage)
|
||||
continue // No need to apply damage.
|
||||
|
||||
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "sand")
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "sand")
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
|
||||
/datum/weather/tyr/sandstorm_fierce
|
||||
name = "fierce sandstorm"
|
||||
@@ -240,30 +237,29 @@ var/datum/planet/tyr/planet_tyr = null
|
||||
light_modifier = 0.5
|
||||
|
||||
imminent_transition_message = "The sky is blocked out by rock."
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
|
||||
|
||||
/datum/weather/tyr/sandstorm_fierce/process_effects()
|
||||
..()
|
||||
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.is_outdoors())
|
||||
continue
|
||||
/datum/weather/tyr/sandstorm_fierce/planet_effect(mob/living/carbon/H)
|
||||
if(H.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
return
|
||||
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "melee")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "melee")
|
||||
var/target_zone = pick(BP_ALL)
|
||||
var/amount_blocked = H.run_armor_check(target_zone, "melee")
|
||||
var/amount_soaked = H.get_armor_soak(target_zone, "melee")
|
||||
|
||||
var/damage = rand(5,5)
|
||||
var/damage = rand(5,5)
|
||||
|
||||
if(amount_blocked >= 40)
|
||||
continue
|
||||
if(amount_blocked >= 40)
|
||||
return
|
||||
|
||||
if(amount_soaked >= damage)
|
||||
continue // No need to apply damage.
|
||||
if(amount_soaked >= damage)
|
||||
return // No need to apply damage.
|
||||
|
||||
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "sand")
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "sand")
|
||||
if(show_message)
|
||||
to_chat(H, effect_message)
|
||||
|
||||
//Anomalous/summonable weather
|
||||
/datum/weather/tyr/starrynight
|
||||
@@ -274,15 +270,14 @@ var/datum/planet/tyr/planet_tyr = null
|
||||
WEATHER_FALLOUT_TEMP = 50)
|
||||
|
||||
imminent_transition_message = "The sky is rapidly begins to glow."
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
|
||||
|
||||
/datum/weather/tyr/starrynight/process_effects()
|
||||
..()
|
||||
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.is_outdoors())
|
||||
continue
|
||||
H.add_modifier(/datum/modifier/starrynight_boon, 1 SECONDS, src)
|
||||
/datum/weather/tyr/starrynight/planet_effect(mob/living/carbon/H)
|
||||
if(H.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T.is_outdoors())
|
||||
return
|
||||
H.add_modifier(/datum/modifier/starrynight_boon, 1 SECONDS, src)
|
||||
|
||||
/datum/weather/tyr/blizzard
|
||||
name = "blizzard"
|
||||
@@ -319,17 +314,16 @@ var/datum/planet/tyr/planet_tyr = null
|
||||
// How much radiation is bursted onto a random tile near a mob.
|
||||
var/fallout_rad_low = RAD_LEVEL_HIGH
|
||||
var/fallout_rad_high = RAD_LEVEL_VERY_HIGH
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
|
||||
|
||||
/datum/weather/tyr/storm/process_effects()
|
||||
..()
|
||||
for(var/mob/living/L as anything in living_mob_list)
|
||||
if(L.z in holder.our_planet.expected_z_levels)
|
||||
irradiate_nearby_turf(L)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.is_outdoors())
|
||||
continue // They're indoors, so no need to irradiate them with fallout.
|
||||
/datum/weather/tyr/storm/planet_effect(mob/living/L)
|
||||
if(L.z in holder.our_planet.expected_z_levels)
|
||||
irradiate_nearby_turf(L)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.is_outdoors())
|
||||
return // 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))
|
||||
|
||||
// This makes random tiles near people radioactive for awhile.
|
||||
// Tiles far away from people are left alone, for performance.
|
||||
@@ -359,30 +353,31 @@ var/datum/planet/tyr/planet_tyr = null
|
||||
var/next_lightning_strike = 0 // world.time when lightning will strike.
|
||||
var/min_lightning_cooldown = 5 SECONDS
|
||||
var/max_lightning_cooldown = 1 MINUTE
|
||||
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
|
||||
|
||||
/datum/weather/tyr/fog/planet_effect(mob/living/L)
|
||||
if(L.z in holder.our_planet.expected_z_levels)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T.is_outdoors())
|
||||
return // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
var/obj/item/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_notice("Rain showers loudly onto your umbrella!"))
|
||||
return
|
||||
|
||||
|
||||
L.water_act(2)
|
||||
if(show_message)
|
||||
to_chat(L, effect_message)
|
||||
|
||||
/datum/weather/tyr/fog/process_effects()
|
||||
..()
|
||||
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.is_outdoors())
|
||||
continue // They're indoors, so no need to rain on them.
|
||||
|
||||
// If they have an open umbrella, it'll guard from rain
|
||||
var/obj/item/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_notice("Rain showers loudly onto your umbrella!"))
|
||||
continue
|
||||
|
||||
|
||||
L.water_act(2)
|
||||
if(show_message)
|
||||
to_chat(L, effect_message)
|
||||
|
||||
handle_lightning()
|
||||
|
||||
// This gets called to do lightning periodically.
|
||||
|
||||
Reference in New Issue
Block a user