mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
Merge pull request #3891 from VOREStation/upstream-merge-5350
[MIRROR] Weather is shorter, hail is less deadly.
This commit is contained in:
@@ -184,6 +184,7 @@ datum/weather/sif
|
|||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/sif/snow/process_effects()
|
/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 in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||||
if(S.z in holder.our_planet.expected_z_levels)
|
if(S.z in holder.our_planet.expected_z_levels)
|
||||||
for(var/dir_checked in cardinal)
|
for(var/dir_checked in cardinal)
|
||||||
@@ -207,6 +208,7 @@ datum/weather/sif
|
|||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/sif/blizzard/process_effects()
|
/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 in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||||
if(S.z in holder.our_planet.expected_z_levels)
|
if(S.z in holder.our_planet.expected_z_levels)
|
||||||
for(var/dir_checked in cardinal)
|
for(var/dir_checked in cardinal)
|
||||||
@@ -219,6 +221,8 @@ datum/weather/sif
|
|||||||
name = "rain"
|
name = "rain"
|
||||||
icon_state = "rain"
|
icon_state = "rain"
|
||||||
light_modifier = 0.5
|
light_modifier = 0.5
|
||||||
|
effect_message = "<span class='warning'>Rain falls on you.</span>"
|
||||||
|
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_OVERCAST = 25,
|
WEATHER_OVERCAST = 25,
|
||||||
WEATHER_LIGHT_SNOW = 10,
|
WEATHER_LIGHT_SNOW = 10,
|
||||||
@@ -228,6 +232,7 @@ datum/weather/sif
|
|||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/sif/rain/process_effects()
|
/datum/weather/sif/rain/process_effects()
|
||||||
|
..()
|
||||||
for(var/mob/living/L in living_mob_list)
|
for(var/mob/living/L 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)
|
||||||
@@ -238,16 +243,19 @@ datum/weather/sif
|
|||||||
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||||
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
var/obj/item/weapon/melee/umbrella/U = L.get_active_hand()
|
||||||
if(U.open)
|
if(U.open)
|
||||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella</span>")
|
if(show_message)
|
||||||
|
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella</span>")
|
||||||
continue
|
continue
|
||||||
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||||
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand()
|
||||||
if(U.open)
|
if(U.open)
|
||||||
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella</span>")
|
if(show_message)
|
||||||
|
to_chat(L, "<span class='notice'>Rain patters softly onto your umbrella</span>")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
L.water_act(1)
|
L.water_act(1)
|
||||||
to_chat(L, "<span class='warning'>Rain falls on you.</span>")
|
if(show_message)
|
||||||
|
to_chat(L, effect_message)
|
||||||
|
|
||||||
/datum/weather/sif/storm
|
/datum/weather/sif/storm
|
||||||
name = "storm"
|
name = "storm"
|
||||||
@@ -256,6 +264,8 @@ datum/weather/sif
|
|||||||
temp_low = 233.15 // -40c
|
temp_low = 233.15 // -40c
|
||||||
light_modifier = 0.3
|
light_modifier = 0.3
|
||||||
flight_failure_modifier = 10
|
flight_failure_modifier = 10
|
||||||
|
|
||||||
|
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_RAIN = 45,
|
WEATHER_RAIN = 45,
|
||||||
WEATHER_STORM = 40,
|
WEATHER_STORM = 40,
|
||||||
@@ -264,6 +274,7 @@ datum/weather/sif
|
|||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/sif/storm/process_effects()
|
/datum/weather/sif/storm/process_effects()
|
||||||
|
..()
|
||||||
for(var/mob/living/L in living_mob_list)
|
for(var/mob/living/L 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)
|
||||||
@@ -294,6 +305,10 @@ datum/weather/sif
|
|||||||
temp_low = 243.15 // -30c
|
temp_low = 243.15 // -30c
|
||||||
light_modifier = 0.3
|
light_modifier = 0.3
|
||||||
flight_failure_modifier = 15
|
flight_failure_modifier = 15
|
||||||
|
timer_low_bound = 2
|
||||||
|
timer_high_bound = 5
|
||||||
|
effect_message = "<span class='warning'>The hail smacks into you!</span>"
|
||||||
|
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_RAIN = 45,
|
WEATHER_RAIN = 45,
|
||||||
WEATHER_STORM = 40,
|
WEATHER_STORM = 40,
|
||||||
@@ -302,6 +317,7 @@ datum/weather/sif
|
|||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/sif/hail/process_effects()
|
/datum/weather/sif/hail/process_effects()
|
||||||
|
..()
|
||||||
for(var/mob/living/carbon/human/H in living_mob_list)
|
for(var/mob/living/carbon/human/H in living_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)
|
||||||
@@ -309,15 +325,18 @@ datum/weather/sif
|
|||||||
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 rain
|
// If they have an open umbrella, it'll guard from rain
|
||||||
|
// Message plays every time the umbrella gets stolen, just so they're especially aware of what's happening
|
||||||
if(istype(H.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
if(istype(H.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||||
var/obj/item/weapon/melee/umbrella/U = H.get_active_hand()
|
var/obj/item/weapon/melee/umbrella/U = H.get_active_hand()
|
||||||
if(U.open)
|
if(U.open)
|
||||||
to_chat(H, "<span class='notice'>Hail patters gently onto your umbrella.</span>")
|
if(show_message)
|
||||||
|
to_chat(H, "<span class='notice'>Hail patters gently onto your umbrella.</span>")
|
||||||
continue
|
continue
|
||||||
else if(istype(H.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
else if(istype(H.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||||
var/obj/item/weapon/melee/umbrella/U = H.get_inactive_hand()
|
var/obj/item/weapon/melee/umbrella/U = H.get_inactive_hand()
|
||||||
if(U.open)
|
if(U.open)
|
||||||
to_chat(H, "<span class='notice'>Hail patters gently onto your umbrella.</span>")
|
if(show_message)
|
||||||
|
to_chat(H, "<span class='notice'>Hail patters gently onto your umbrella.</span>")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
var/target_zone = pick(BP_ALL)
|
var/target_zone = pick(BP_ALL)
|
||||||
@@ -330,8 +349,9 @@ datum/weather/sif
|
|||||||
if(amount_soaked >= 10)
|
if(amount_soaked >= 10)
|
||||||
continue // No need to apply damage.
|
continue // No need to apply damage.
|
||||||
|
|
||||||
H.apply_damage(rand(5, 10), BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "hail")
|
H.apply_damage(rand(1, 3), BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "hail")
|
||||||
to_chat(H, "<span class='warning'>The hail smacks into you!</span>")
|
if(show_message)
|
||||||
|
to_chat(H, effect_message)
|
||||||
|
|
||||||
/datum/weather/sif/blood_moon
|
/datum/weather/sif/blood_moon
|
||||||
name = "blood moon"
|
name = "blood moon"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
if(current_weather)
|
if(current_weather)
|
||||||
old_light_modifier = current_weather.light_modifier // We store the old one, so we can determine if recalculating the sun is needed.
|
old_light_modifier = current_weather.light_modifier // We store the old one, so we can determine if recalculating the sun is needed.
|
||||||
current_weather = allowed_weather_types[new_weather]
|
current_weather = allowed_weather_types[new_weather]
|
||||||
next_weather_shift = world.time + rand(20, 30) MINUTES
|
next_weather_shift = world.time + rand(current_weather.timer_low_bound, current_weather.timer_high_bound) MINUTES
|
||||||
|
|
||||||
update_icon_effects()
|
update_icon_effects()
|
||||||
update_temperature()
|
update_temperature()
|
||||||
@@ -66,8 +66,20 @@
|
|||||||
var/flight_failure_modifier = 0 // Some types of weather make flying harder, and therefore make crashes more likely.
|
var/flight_failure_modifier = 0 // Some types of weather make flying harder, and therefore make crashes more likely.
|
||||||
var/transition_chances = list() // Assoc list
|
var/transition_chances = list() // Assoc list
|
||||||
var/datum/weather_holder/holder = null
|
var/datum/weather_holder/holder = null
|
||||||
|
var/timer_low_bound = 5 // How long this weather must run before it tries to change, in minutes
|
||||||
|
var/timer_high_bound = 10 // How long this weather can run before it tries to change, in minutes
|
||||||
|
|
||||||
|
var/effect_message = null // Should be a string, this is what is shown to a mob caught in the weather
|
||||||
|
var/last_message = 0 // Keeps track of when the weather last tells EVERY player it's hitting them
|
||||||
|
var/message_delay = 10 SECONDS // Delay in between weather hit messages
|
||||||
|
var/show_message = FALSE // Is set to TRUE and plays the messsage every [message_delay]
|
||||||
|
|
||||||
/datum/weather/proc/process_effects()
|
/datum/weather/proc/process_effects()
|
||||||
|
show_message = FALSE // Need to reset the show_message var, just in case
|
||||||
|
if(effect_message) // Only bother with the code below if we actually need to display something
|
||||||
|
if(world.time >= last_message + message_delay)
|
||||||
|
last_message = world.time // Reset the timer
|
||||||
|
show_message = TRUE // Tell the rest of the process that we need to make a message
|
||||||
return
|
return
|
||||||
|
|
||||||
// All this does is hold the weather icon.
|
// All this does is hold the weather icon.
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null
|
|||||||
WEATHER_HAIL = 2.5
|
WEATHER_HAIL = 2.5
|
||||||
)
|
)
|
||||||
|
|
||||||
datum/weather/virgo3b
|
/datum/weather/virgo3b
|
||||||
name = "virgo3b base"
|
name = "virgo3b base"
|
||||||
temp_high = 243.15 // -20c
|
temp_high = 243.15 // -20c
|
||||||
temp_low = 233.15 // -30c
|
temp_low = 233.15 // -30c
|
||||||
@@ -154,8 +154,8 @@ datum/weather/virgo3b
|
|||||||
/datum/weather/virgo3b/light_snow
|
/datum/weather/virgo3b/light_snow
|
||||||
name = "light snow"
|
name = "light snow"
|
||||||
icon_state = "snowfall_light"
|
icon_state = "snowfall_light"
|
||||||
temp_high = 238.15 // -25c
|
temp_high = 235
|
||||||
temp_low = 228.15 // -35c
|
temp_low = 225
|
||||||
light_modifier = 0.7
|
light_modifier = 0.7
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_OVERCAST = 20,
|
WEATHER_OVERCAST = 20,
|
||||||
@@ -167,9 +167,10 @@ datum/weather/virgo3b
|
|||||||
/datum/weather/virgo3b/snow
|
/datum/weather/virgo3b/snow
|
||||||
name = "moderate snow"
|
name = "moderate snow"
|
||||||
icon_state = "snowfall_med"
|
icon_state = "snowfall_med"
|
||||||
temp_high = 233.15 // -30c
|
temp_high = 230
|
||||||
temp_low = 223.15 // -40c
|
temp_low = 220
|
||||||
light_modifier = 0.5
|
light_modifier = 0.5
|
||||||
|
flight_failure_modifier = 5
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_LIGHT_SNOW = 20,
|
WEATHER_LIGHT_SNOW = 20,
|
||||||
WEATHER_SNOW = 50,
|
WEATHER_SNOW = 50,
|
||||||
@@ -179,7 +180,8 @@ datum/weather/virgo3b
|
|||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/virgo3b/snow/process_effects()
|
/datum/weather/virgo3b/snow/process_effects()
|
||||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This does not make sense
|
..()
|
||||||
|
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||||
if(S.z in holder.our_planet.expected_z_levels)
|
if(S.z in holder.our_planet.expected_z_levels)
|
||||||
for(var/dir_checked in cardinal)
|
for(var/dir_checked in cardinal)
|
||||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||||
@@ -190,9 +192,10 @@ datum/weather/virgo3b
|
|||||||
/datum/weather/virgo3b/blizzard
|
/datum/weather/virgo3b/blizzard
|
||||||
name = "blizzard"
|
name = "blizzard"
|
||||||
icon_state = "snowfall_heavy"
|
icon_state = "snowfall_heavy"
|
||||||
temp_high = 223.15 // -40c
|
temp_high = 215
|
||||||
temp_low = 203.15 // -60c
|
temp_low = 200
|
||||||
light_modifier = 0.3
|
light_modifier = 0.3
|
||||||
|
flight_failure_modifier = 10
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_SNOW = 45,
|
WEATHER_SNOW = 45,
|
||||||
WEATHER_BLIZZARD = 40,
|
WEATHER_BLIZZARD = 40,
|
||||||
@@ -201,7 +204,8 @@ datum/weather/virgo3b
|
|||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/virgo3b/blizzard/process_effects()
|
/datum/weather/virgo3b/blizzard/process_effects()
|
||||||
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This does not make sense
|
..()
|
||||||
|
for(var/turf/simulated/floor/outdoors/snow/S in SSplanets.new_outdoor_turfs) //This didn't make any sense before SSplanets, either
|
||||||
if(S.z in holder.our_planet.expected_z_levels)
|
if(S.z in holder.our_planet.expected_z_levels)
|
||||||
for(var/dir_checked in cardinal)
|
for(var/dir_checked in cardinal)
|
||||||
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
var/turf/simulated/floor/T = get_step(S, dir_checked)
|
||||||
@@ -213,6 +217,8 @@ datum/weather/virgo3b
|
|||||||
name = "rain"
|
name = "rain"
|
||||||
icon_state = "rain"
|
icon_state = "rain"
|
||||||
light_modifier = 0.5
|
light_modifier = 0.5
|
||||||
|
effect_message = "<span class='warning'>Rain falls on you.</span>"
|
||||||
|
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_OVERCAST = 25,
|
WEATHER_OVERCAST = 25,
|
||||||
WEATHER_LIGHT_SNOW = 10,
|
WEATHER_LIGHT_SNOW = 10,
|
||||||
@@ -222,21 +228,38 @@ datum/weather/virgo3b
|
|||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/virgo3b/rain/process_effects()
|
/datum/weather/virgo3b/rain/process_effects()
|
||||||
|
..()
|
||||||
for(var/mob/living/L in living_mob_list)
|
for(var/mob/living/L 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)
|
if(!T.outdoors)
|
||||||
return // They're indoors, so no need to rain on them.
|
continue // They're indoors, so no need to rain on them.
|
||||||
|
|
||||||
L.adjust_fire_stacks(-5)
|
// If they have an open umbrella, it'll guard from rain
|
||||||
to_chat(L, "<span class='warning'>Rain falls on you.</span>")
|
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
|
||||||
|
|
||||||
|
L.water_act(1)
|
||||||
|
if(show_message)
|
||||||
|
to_chat(L, effect_message)
|
||||||
|
|
||||||
/datum/weather/virgo3b/storm
|
/datum/weather/virgo3b/storm
|
||||||
name = "storm"
|
name = "storm"
|
||||||
icon_state = "storm"
|
icon_state = "storm"
|
||||||
temp_high = 233.15 // -30c
|
|
||||||
temp_low = 213.15 // -50c
|
|
||||||
light_modifier = 0.3
|
light_modifier = 0.3
|
||||||
|
flight_failure_modifier = 10
|
||||||
|
|
||||||
|
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_RAIN = 45,
|
WEATHER_RAIN = 45,
|
||||||
WEATHER_STORM = 40,
|
WEATHER_STORM = 40,
|
||||||
@@ -244,53 +267,89 @@ datum/weather/virgo3b
|
|||||||
WEATHER_OVERCAST = 5
|
WEATHER_OVERCAST = 5
|
||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/virgo3b/rain/process_effects()
|
/datum/weather/virgo3b/storm/process_effects()
|
||||||
|
..()
|
||||||
for(var/mob/living/L in living_mob_list)
|
for(var/mob/living/L 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)
|
if(!T.outdoors)
|
||||||
return // They're indoors, so no need to rain on them.
|
continue // They're indoors, so no need to rain on them.
|
||||||
|
|
||||||
L.adjust_fire_stacks(-10)
|
// If they have an open umbrella, it'll get stolen by the wind
|
||||||
|
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)
|
||||||
|
to_chat(L, "<span class='warning'>A gust of wind yanks the umbrella from your hand!</span>")
|
||||||
|
L.drop_from_inventory(U)
|
||||||
|
U.throw_at(get_edge_target_turf(U, pick(alldirs)), 8, 1, L)
|
||||||
|
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)
|
||||||
|
to_chat(L, "<span class='warning'>A gust of wind yanks the umbrella from your hand!</span>")
|
||||||
|
L.drop_from_inventory(U)
|
||||||
|
U.throw_at(get_edge_target_turf(U, pick(alldirs)), 8, 1, L)
|
||||||
|
|
||||||
|
L.water_act(2)
|
||||||
to_chat(L, "<span class='warning'>Rain falls on you, drenching you in water.</span>")
|
to_chat(L, "<span class='warning'>Rain falls on you, drenching you in water.</span>")
|
||||||
|
|
||||||
/datum/weather/virgo3b/hail
|
/datum/weather/virgo3b/hail
|
||||||
name = "hail"
|
name = "hail"
|
||||||
icon_state = "hail"
|
icon_state = "hail"
|
||||||
temp_high = 233.15 // -30c
|
|
||||||
temp_low = 213.15 // -50c
|
|
||||||
light_modifier = 0.3
|
light_modifier = 0.3
|
||||||
|
flight_failure_modifier = 15
|
||||||
|
timer_low_bound = 2
|
||||||
|
timer_high_bound = 5
|
||||||
|
effect_message = "<span class='warning'>The hail smacks into you!</span>"
|
||||||
|
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_RAIN = 45,
|
WEATHER_RAIN = 45,
|
||||||
WEATHER_STORM = 10,
|
WEATHER_STORM = 40,
|
||||||
WEATHER_HAIL = 40,
|
WEATHER_HAIL = 10,
|
||||||
WEATHER_OVERCAST = 5
|
WEATHER_OVERCAST = 5
|
||||||
)
|
)
|
||||||
|
|
||||||
/datum/weather/virgo3b/hail/process_effects()
|
/datum/weather/virgo3b/hail/process_effects()
|
||||||
for(var/mob/living/L in living_mob_list)
|
..()
|
||||||
if(L.z in holder.our_planet.expected_z_levels)
|
for(var/mob/living/carbon/human/H in living_mob_list)
|
||||||
var/turf/T = get_turf(L)
|
if(H.z in holder.our_planet.expected_z_levels)
|
||||||
|
var/turf/T = get_turf(H)
|
||||||
if(!T.outdoors)
|
if(!T.outdoors)
|
||||||
return // 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 rain
|
||||||
|
// Message plays every time the umbrella gets stolen, just so they're especially aware of what's happening
|
||||||
|
if(istype(H.get_active_hand(), /obj/item/weapon/melee/umbrella))
|
||||||
|
var/obj/item/weapon/melee/umbrella/U = H.get_active_hand()
|
||||||
|
if(U.open)
|
||||||
|
if(show_message)
|
||||||
|
to_chat(H, "<span class='notice'>Hail patters gently onto your umbrella.</span>")
|
||||||
|
continue
|
||||||
|
else if(istype(H.get_inactive_hand(), /obj/item/weapon/melee/umbrella))
|
||||||
|
var/obj/item/weapon/melee/umbrella/U = H.get_inactive_hand()
|
||||||
|
if(U.open)
|
||||||
|
if(show_message)
|
||||||
|
to_chat(H, "<span class='notice'>Hail patters gently onto your umbrella.</span>")
|
||||||
|
continue
|
||||||
|
|
||||||
var/target_zone = pick(BP_ALL)
|
var/target_zone = pick(BP_ALL)
|
||||||
var/amount_blocked = L.run_armor_check(target_zone, "melee")
|
var/amount_blocked = H.run_armor_check(target_zone, "melee")
|
||||||
var/amount_soaked = L.get_armor_soak(target_zone, "melee")
|
var/amount_soaked = H.get_armor_soak(target_zone, "melee")
|
||||||
|
|
||||||
if(amount_blocked >= 100)
|
if(amount_blocked >= 100)
|
||||||
return // No need to apply damage.
|
continue // No need to apply damage.
|
||||||
|
|
||||||
if(amount_soaked >= 10)
|
if(amount_soaked >= 10)
|
||||||
return // No need to apply damage.
|
continue // No need to apply damage.
|
||||||
|
|
||||||
L.apply_damage(rand(5, 10), BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "hail")
|
H.apply_damage(rand(1, 3), BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "hail")
|
||||||
to_chat(L, "<span class='warning'>The hail raining down on you [L.can_feel_pain() ? "hurts" : "damages you"]!</span>")
|
if(show_message)
|
||||||
|
to_chat(H, effect_message)
|
||||||
|
|
||||||
/datum/weather/virgo3b/blood_moon
|
/datum/weather/virgo3b/blood_moon
|
||||||
name = "blood moon"
|
name = "blood moon"
|
||||||
light_modifier = 0.5
|
light_modifier = 0.5
|
||||||
light_color = "#FF0000"
|
light_color = "#FF0000"
|
||||||
|
flight_failure_modifier = 25
|
||||||
transition_chances = list(
|
transition_chances = list(
|
||||||
WEATHER_BLOODMOON = 100
|
WEATHER_BLOODMOON = 100
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user