[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:
CHOMPStation2StaffMirrorBot
2025-04-06 11:24:11 -07:00
committed by GitHub
parent 6b699a2b5b
commit 5069c8c6a6
25 changed files with 843 additions and 809 deletions

View File

@@ -0,0 +1,6 @@
#define HAS_PLANET_EFFECT 0x1
#define EFFECT_ALL_MOBS 0x2
#define EFFECT_ONLY_HUMANS 0x4
#define EFFECT_ONLY_LIVING 0x8
#define EFFECT_ONLY_ROBOTS 0x10
#define EFFECT_ALWAYS_HITS 0x20

View File

@@ -24,8 +24,17 @@ SUBSYSTEM_DEF(planets)
for(var/P in planet_datums)
var/datum/planet/NP = new P()
planets.Add(NP)
// Delete those following two lines with https://github.com/CHOMPStation2/CHOMPStation2/pull/10295
for(var/Z in NP.expected_z_levels)
if(Z > z_to_planet.len)
/* Requires the map update https://github.com/CHOMPStation2/CHOMPStation2/pull/10295
for(var/index in 1 to length(NP.expected_z_levels))
var/Z = NP.expected_z_levels[index]
if(!isnum(Z))
Z = GLOB.map_templates_loaded[Z]
NP.expected_z_levels[index] = Z
if(Z > length(z_to_planet))
*/
z_to_planet.len = Z
if(z_to_planet[Z])
admin_notice(span_danger("Z[Z] is shared by more than one planet!"), R_DEBUG)

View File

@@ -590,14 +590,14 @@ var/list/global/slot_flags_enumeration = list(
if(!(usr)) //BS12 EDIT
return
if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr))
if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr) || usr.is_incorporeal())
return
if(isanimal(usr)) //VOREStation Edit Start - Allows simple mobs with hands to use the pickup verb
var/mob/living/simple_mob/s = usr
if(!s.has_hands)
to_chat(usr, span_warning("You can't pick things up!"))
return
else if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain
else if((!iscarbon(usr)) || (isbrain(usr)))//Is humanoid, and is not a brain
to_chat(usr, span_warning("You can't pick things up!"))
return
var/mob/living/L = usr
@@ -610,7 +610,7 @@ var/list/global/slot_flags_enumeration = list(
if(L.get_active_hand()) //Hand is not full //VOREStation Edit End
to_chat(usr, span_warning("Your hand is full."))
return
if(!istype(src.loc, /turf)) //Object is on a turf
if(!isturf(src.loc)) //Object is on a turf
to_chat(usr, span_warning("You can't pick that up!"))
return
//All checks are done, time to pick it up!
@@ -634,7 +634,7 @@ var/list/global/slot_flags_enumeration = list(
/obj/item/proc/get_loc_turf()
var/atom/L = loc
while(L && !istype(L, /turf/))
while(L && !isturf(L))
L = L.loc
return loc

View File

@@ -42,6 +42,8 @@
if(vorgans == "No")
organs = 0
var/flavor = tgui_alert(src, "Spawn mob with their character's flavor text?", "Flavor text", list("General", "Robot", "Cancel"))
var/spawnloc
if(!src.mob)
to_chat(src, "Can't spawn them in unless you're in a valid spawn location!")
@@ -61,10 +63,18 @@
new_mob.key = picked_client.key //Finally put them in the mob
if(flavor == "General")
new_mob.flavor_text = new_mob?.client?.prefs?.flavor_texts["general"]
if(flavor == "Robot")
new_mob.flavor_text = new_mob?.client?.prefs?.flavour_texts_robot["Default"]
if(organs)
new_mob.copy_from_prefs_vr()
if(LAZYLEN(new_mob.vore_organs))
new_mob.vore_selected = new_mob.vore_organs[1]
if(isanimal(new_mob))
var/mob/living/simple_mob/Sm = new_mob
Sm.vore_active = TRUE
Sm.voremob_loaded = TRUE
log_admin("[key_name_admin(src)] has spawned [new_mob.key] as mob [new_mob.type].")
message_admins("[key_name_admin(src)] has spawned [new_mob.key] as mob [new_mob.type].", 1)

View File

@@ -279,7 +279,7 @@
var/list/vorestrings = list()
vorestrings += examine_weight()
vorestrings += examine_nutrition()
vorestrings += examine_reagent_bellies() //CHOMP reagent bellies
vorestrings += examine_reagent_bellies() // reagent bellies
vorestrings += examine_bellies()
vorestrings += examine_pickup_size()
vorestrings += examine_step_size()

View File

@@ -183,7 +183,9 @@
// This handles the drag-open inventory panel.
/mob/living/MouseDrop(atom/over_object)
var/mob/living/L = over_object
if(istype(L) && L != src && L == usr && Adjacent(L) && !L.is_incorporeal())
if(L.is_incorporeal())
return
if(istype(L) && L != src && L == usr && Adjacent(L))
show_inventory_panel(L)
. = ..()

View File

@@ -49,6 +49,9 @@
if(istype(nest, /obj/structure/blob/factory))
var/obj/structure/blob/factory/F = nest
F.spores -= src
if(istype(nest, /obj/structure/mob_spawner))
var/obj/structure/mob_spawner/S = nest
S.get_death_report(src)
nest = null
if(buckled)
buckled.unbuckle_mob(src, TRUE)

View File

@@ -6,7 +6,7 @@
if(!src.client) . += "It appears to be in stand-by mode." //afk
if(UNCONSCIOUS) . += span_warning("It doesn't seem to be responding.")
if(DEAD) . += span_deadsay("It looks completely unsalvageable.")
. += attempt_vr(src,"examine_reagent_bellies",args) //CHOMP reagent bellies
. += attempt_vr(src,"examine_reagent_bellies",args) // reagent bellies
// VOREStation Edit: Start
. += attempt_vr(src,"examine_bellies",args) //VOREStation Edit

View File

@@ -29,7 +29,7 @@
. += "It appears to be in stand-by mode." //afk
if(UNCONSCIOUS) . += span_warning("It doesn't seem to be responding.")
if(DEAD) . += span_deadsay("It looks completely unsalvageable.")
. += attempt_vr(src,"examine_reagent_bellies",args) //CHOMP reagent bellies
. += attempt_vr(src,"examine_reagent_bellies",args) // reagent bellies
// VOREStation Edit: Start
. += attempt_vr(src,"examine_bellies_borg",args) //VOREStation Edit

View File

@@ -25,6 +25,13 @@
else
. += span_notice("It can be [harvest_verb] now.")
. += attempt_vr(src,"examine_reagent_bellies",args)
. += attempt_vr(src,"examine_bellies",args)
. += ""
if(print_flavor_text()) . += "<br>[print_flavor_text()]"
/mob/living/simple_mob/proc/livestock_harvest(var/obj/item/tool, var/mob/living/user)
if(!LAZYLEN(harvest_results)) // Might be a unique interaction of an object using the proc to do something weird, or just someone's a donk.
harvest_recent = world.time

View File

@@ -55,6 +55,8 @@
// Release belly contents before being gc'd!
/mob/living/simple_mob/Destroy()
if(mob_radio)
QDEL_NULL(mob_radio)
release_vore_contents()
LAZYCLEARLIST(prey_excludes)
return ..()

View File

@@ -129,6 +129,7 @@
var/obj/belly/B = new /obj/belly/macrophage(src)
vore_selected = B
. = ..()
/datum/ai_holder/simple_mob/melee/macrophage
var/datum/disease/virus = null

View File

@@ -200,6 +200,7 @@
"The stinging and aching gives way to numbness as you're slowly smothered out. Your body is steadily reduced to nutrients and energy for the creature to continue on its way.",
"The chaos of being digested fades as you're snuffed out by a harsh clench! You're steadily broken down into a thick paste, processed and absorbed by the predator!"
)
. = ..()
/mob/living/simple_mob/shadekin/Life()
. = ..()

View File

@@ -240,7 +240,7 @@ var/datum/planet/borealis2/planet_borealis2 = null
)
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/borealis2/blizzard/process_effects()
..()
@@ -252,8 +252,7 @@ var/datum/planet/borealis2/planet_borealis2 = null
if(istype(T, /turf/simulated/floor/outdoors) && prob(50))
T.chill()
for(var/thing in living_mob_list)
var/mob/living/L = thing
/datum/weather/borealis2/blizzard/planet_effect(mob/living/L)
if(L.z in holder.our_planet.expected_z_levels)
var/turf/T = get_turf(L)
if(!T.outdoors || istype(L, /mob/living/simple_mob))
@@ -280,10 +279,9 @@ var/datum/planet/borealis2/planet_borealis2 = null
transition_messages = list(
"The sky is dark, and rain falls down upon you."
)
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/borealis2/rain/process_effects()
..()
for(var/mob/living/L in living_mob_list)
/datum/weather/borealis2/rain/planet_effect(mob/living/L)
if(L.z in holder.our_planet.expected_z_levels)
var/turf/T = get_turf(L)
if(!T.outdoors)
@@ -326,18 +324,15 @@ var/datum/planet/borealis2/planet_borealis2 = null
"A bright flash heralds the approach of a storm."
)
transition_chances = list(
WEATHER_RAIN = 45,
WEATHER_STORM = 40,
WEATHER_HAIL = 10,
WEATHER_OVERCAST = 5
)
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/borealis2/storm/process_effects()
..()
for(var/mob/living/L in living_mob_list)
/datum/weather/borealis2/storm/planet_effect(mob/living/L)
if(L.z in holder.our_planet.expected_z_levels)
var/turf/T = get_turf(L)
if(!T.outdoors)
@@ -379,7 +374,8 @@ var/datum/planet/borealis2/planet_borealis2 = null
if(show_message)
to_chat(L, effect_message)
/datum/weather/borealis2/storm/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.
@@ -412,10 +408,9 @@ var/datum/planet/borealis2/planet_borealis2 = null
"It begins to hail.",
"An intense chill is felt, and chunks of ice start to fall from the sky, towards you."
)
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
/datum/weather/borealis2/hail/process_effects()
..()
for(var/mob/living/carbon/human/H in living_mob_list)
/datum/weather/borealis2/hail/planet_effect(mob/living/carbon/H)
if(H.z in holder.our_planet.expected_z_levels)
var/turf/T = get_turf(H)
if(!T.outdoors)
@@ -506,11 +501,9 @@ var/datum/planet/borealis2/planet_borealis2 = null
// Lets recycle.
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/borealis2/ash_storm/process_effects()
..()
for(var/thing in living_mob_list)
var/mob/living/L = thing
/datum/weather/borealis2/ash_storm/planet_effect(mob/living/L)
if(L.z in holder.our_planet.expected_z_levels)
var/turf/T = get_turf(L)
if(!T.outdoors)
@@ -543,11 +536,9 @@ var/datum/planet/borealis2/planet_borealis2 = 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/borealis2/fallout/process_effects()
..()
for(var/thing in living_mob_list)
var/mob/living/L = thing
/datum/weather/borealis2/fallout/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)

View File

@@ -301,14 +301,13 @@ var/datum/planet/sif/planet_sif = null
)
outdoor_sounds_type = /datum/looping_sound/weather/rain
indoor_sounds_type = /datum/looping_sound/weather/rain/indoors
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/sif/rain/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
if(L?.z in holder.our_planet.expected_z_levels) // CHOMPedit Add a check that L has to be valid and not null
/datum/weather/sif/rain/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -318,7 +317,7 @@ var/datum/planet/sif/planet_sif = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain patters softly onto your umbrella."))
continue
return
L.water_act(1)
if(show_message)
@@ -355,14 +354,13 @@ var/datum/planet/sif/planet_sif = null
WEATHER_FOG = 3,
WEATHER_OVERCAST = 2
)
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/sif/storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/sif/storm/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -372,13 +370,15 @@ var/datum/planet/sif/planet_sif = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain showers loudly onto your umbrella!"))
continue
return
L.water_act(2)
if(show_message)
to_chat(L, effect_message)
/datum/weather/sif/storm/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.
@@ -413,14 +413,13 @@ var/datum/planet/sif/planet_sif = null
"It begins to hail.",
"An intense chill is felt, and chunks of ice start to fall from the sky, towards you."
)
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
/datum/weather/sif/hail/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
/datum/weather/sif/hail/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())
continue // They're indoors, so no need to pelt them with ice.
return // 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/melee/umbrella/U = H.get_active_hand()
@@ -430,7 +429,7 @@ var/datum/planet/sif/planet_sif = null
if(istype(U) && U.open)
if(show_message)
to_chat(H, span_notice("Hail patters onto your umbrella."))
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "melee")
@@ -439,11 +438,11 @@ var/datum/planet/sif/planet_sif = null
var/damage = rand(1,3)
if(amount_blocked >= 30)
continue // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
return // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
//Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30.
if(amount_soaked >= damage)
continue // No need to apply damage.
return // No need to apply damage.
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "hail")
if(show_message)
@@ -532,14 +531,13 @@ var/datum/planet/sif/planet_sif = null
// Lets recycle.
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/sif/ash_storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/sif/ash_storm/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())
continue // They're indoors, so no need to burn them with ash.
return // They're indoors, so no need to burn them with ash.
L.inflict_heat_damage(rand(1, 3))
@@ -569,15 +567,14 @@ var/datum/planet/sif/planet_sif = 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/sif/fallout/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/sif/fallout/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())
continue // They're indoors, so no need to irradiate them with fallout.
return // They're indoors, so no need to irradiate them with fallout.
L.rad_act(rand(direct_rad_low, direct_rad_high))

View File

@@ -268,14 +268,13 @@ var/datum/planet/thor/planet_thor = null
imminent_transition_message = "Light drips of water are starting to fall from the sky."
outdoor_sounds_type = /datum/looping_sound/weather/rain
indoor_sounds_type = /datum/looping_sound/weather/rain/indoors
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/thor/rain/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/thor/rain/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -285,7 +284,7 @@ var/datum/planet/thor/planet_thor = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain patters softly onto your umbrella."))
continue
return
L.water_act(1)
if(show_message)
@@ -318,14 +317,13 @@ var/datum/planet/thor/planet_thor = null
WEATHER_STORM = 10,
WEATHER_RAIN = 80
)
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/thor/storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/thor/storm/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -335,13 +333,15 @@ var/datum/planet/thor/planet_thor = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain showers loudly onto your umbrella!"))
continue
return
L.water_act(2)
if(show_message)
to_chat(L, effect_message)
/datum/weather/thor/storm/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.
@@ -374,14 +374,13 @@ var/datum/planet/thor/planet_thor = null
"An intense chill is felt, and chunks of ice start to fall from the sky, towards you."
)
imminent_transition_message = "Small bits of ice are falling from the sky, growing larger by the second. Hail is starting, get to cover!"
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
/datum/weather/thor/hail/process_effects()
..()
for(var/mob/living/carbon/H as anything in human_mob_list)
/datum/weather/thor/hail/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())
continue // They're indoors, so no need to pelt them with ice.
return // 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/melee/umbrella/U = H.get_active_hand()
@@ -391,7 +390,7 @@ var/datum/planet/thor/planet_thor = null
if(istype(U) && U.open)
if(show_message)
to_chat(H, span_notice("Hail patters onto your umbrella."))
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "melee")
@@ -400,11 +399,11 @@ var/datum/planet/thor/planet_thor = null
var/damage = rand(1,3)
if(amount_blocked >= 30)
continue // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
return // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
//Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30.
if(amount_soaked >= damage)
continue // No need to apply damage.
return // No need to apply damage.
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "hail")
if(show_message)
@@ -494,14 +493,13 @@ var/datum/planet/thor/planet_thor = null
// Lets recycle.
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/thor/ash_storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/thor/ash_storm/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())
continue // They're indoors, so no need to burn them with ash.
return // They're indoors, so no need to burn them with ash.
L.inflict_heat_damage(rand(1, 3))
@@ -554,15 +552,14 @@ var/datum/planet/thor/planet_thor = 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/thor/fallout/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/thor/fallout/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())
continue // They're indoors, so no need to irradiate them with fallout.
return // They're indoors, so no need to irradiate them with fallout.
L.rad_act(rand(direct_rad_low, direct_rad_high))
@@ -646,14 +643,13 @@ var/datum/planet/thor/planet_thor = null
)
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/thor/downpour/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/thor/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())
continue // They're indoors, so no need to rain on them.
return // They're indoors, so no need to rain on them.
// If they have an open umbrella, knock it off
if(ishuman(L))
@@ -672,6 +668,8 @@ var/datum/planet/thor/planet_thor = null
if(show_message)
to_chat(L, effect_message)
/datum/weather/thor/downpour/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.
@@ -706,14 +704,13 @@ var/datum/planet/thor/planet_thor = null
//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/thor/downpourfatal/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/thor/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())
continue // They're indoors, so no need to rain on them.
return // They're indoors, so no need to rain on them.
// Knock the umbrella off your hands, aint protecting you c:
if(ishuman(L))
@@ -734,17 +731,18 @@ var/datum/planet/thor/planet_thor = null
var/damage = rand(10,30) //Ow
if(amount_blocked >= 30)
continue
return
if(amount_soaked >= damage)
continue // No need to apply 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/thor/downpourfatal/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.

View File

@@ -285,14 +285,13 @@ var/datum/planet/virgo3b/planet_virgo3b = null
imminent_transition_message = "Light drips of water are starting to fall from the sky."
outdoor_sounds_type = /datum/looping_sound/weather/rain
indoor_sounds_type = /datum/looping_sound/weather/rain/indoors
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/virgo3b/rain/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo3b/rain/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -302,7 +301,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain patters softly onto your umbrella."))
continue
return
L.water_act(1)
if(show_message)
@@ -338,14 +337,13 @@ var/datum/planet/virgo3b/planet_virgo3b = null
WEATHER_HAIL = 10,
WEATHER_OVERCAST = 5
)
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/virgo3b/storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo3b/storm/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -355,13 +353,15 @@ var/datum/planet/virgo3b/planet_virgo3b = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain patters softly onto your umbrella."))
continue
return
L.water_act(2)
if(show_message)
to_chat(L, effect_message)
/datum/weather/virgo3b/storm/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.
@@ -396,14 +396,13 @@ var/datum/planet/virgo3b/planet_virgo3b = null
"An intense chill is felt, and chunks of ice start to fall from the sky, towards you."
)
imminent_transition_message = "Small bits of ice are falling from the sky, growing larger by the second. Hail is starting, get to cover!"
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
/datum/weather/virgo3b/hail/process_effects()
..()
for(var/mob/living/carbon/H as anything in human_mob_list)
/datum/weather/virgo3b/hail/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())
continue // They're indoors, so no need to pelt them with ice.
return // 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/melee/umbrella/U = H.get_active_hand()
@@ -413,7 +412,7 @@ var/datum/planet/virgo3b/planet_virgo3b = null
if(istype(U) && U.open)
if(show_message)
to_chat(H, span_notice("Hail patters onto your umbrella."))
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "melee")
@@ -422,11 +421,11 @@ var/datum/planet/virgo3b/planet_virgo3b = null
var/damage = rand(1,3)
if(amount_blocked >= 30)
continue // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
return // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
//Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30.
if(amount_soaked >= damage)
continue // No need to apply damage.
return // No need to apply damage.
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked)
if(show_message)
@@ -516,14 +515,13 @@ var/datum/planet/virgo3b/planet_virgo3b = null
// Lets recycle.
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/virgo3b/ash_storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo3b/ash_storm/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())
continue // They're indoors, so no need to burn them with ash.
return // They're indoors, so no need to burn them with ash.
L.inflict_heat_damage(rand(1, 3))
@@ -575,15 +573,14 @@ var/datum/planet/virgo3b/planet_virgo3b = 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/virgo3b/fallout/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo3b/fallout/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())
continue // They're indoors, so no need to irradiate them with fallout.
return // They're indoors, so no need to irradiate them with fallout.
L.rad_act(rand(direct_rad_low, direct_rad_high))

View File

@@ -274,14 +274,13 @@ var/datum/planet/virgo3c/planet_virgo3c = null
"The sky is dark, and rain falls down upon you."
)
imminent_transition_message = "Light drips of water are starting to fall from the sky."
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/virgo3c/rain/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo3c/rain/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -291,7 +290,7 @@ var/datum/planet/virgo3c/planet_virgo3c = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain patters softly onto your umbrella."))
continue
return
L.water_act(1)
if(show_message)
@@ -328,14 +327,13 @@ var/datum/planet/virgo3c/planet_virgo3c = null
WEATHER_BLIZZARD = 5,
WEATHER_HAIL = 5
)
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/virgo3c/storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo3c/storm/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -345,13 +343,15 @@ var/datum/planet/virgo3c/planet_virgo3c = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain showers loudly onto your umbrella!"))
continue
return
L.water_act(2)
if(show_message)
to_chat(L, effect_message)
/datum/weather/virgo3c/storm/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.
@@ -386,14 +386,13 @@ var/datum/planet/virgo3c/planet_virgo3c = null
"An intense chill is felt, and chunks of ice start to fall from the sky, towards you."
)
imminent_transition_message = "Small bits of ice are falling from the sky, growing larger by the second. Hail is starting, get to cover!"
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
/datum/weather/virgo3c/hail/process_effects()
..()
for(var/mob/living/carbon/H as anything in human_mob_list)
/datum/weather/virgo3c/hail/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())
continue // They're indoors, so no need to pelt them with ice.
return // 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/melee/umbrella/U = H.get_active_hand()
@@ -403,7 +402,7 @@ var/datum/planet/virgo3c/planet_virgo3c = null
if(istype(U) && U.open)
if(show_message)
to_chat(H, span_notice("Hail patters onto your umbrella."))
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "melee")
@@ -412,11 +411,11 @@ var/datum/planet/virgo3c/planet_virgo3c = null
var/damage = rand(1,3)
if(amount_blocked >= 30)
continue // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
return // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
//Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30.
if(amount_soaked >= damage)
continue // No need to apply damage.
return // No need to apply damage.
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked)
if(show_message)
@@ -515,16 +514,15 @@ var/datum/planet/virgo3c/planet_virgo3c = null
// Lets recycle.
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/virgo3c/ash_storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo3c/ash_storm/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())
continue // They're indoors, so no need to burn them with ash.
return // They're indoors, so no need to burn them with ash.
else if (isanimal(L))
continue //Don't murder the wildlife, they live here it's fine
return //Don't murder the wildlife, they live here it's fine
L.inflict_heat_damage(1)
to_chat(L, span_warning("Smoldering ash singes you!"))
@@ -579,15 +577,14 @@ var/datum/planet/virgo3c/planet_virgo3c = 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/virgo3c/fallout/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo3c/fallout/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())
continue // They're indoors, so no need to irradiate them with fallout.
return // They're indoors, so no need to irradiate them with fallout.
L.rad_act(rand(direct_rad_low, direct_rad_high))

View File

@@ -264,14 +264,13 @@ var/datum/planet/virgo4/planet_virgo4 = null
imminent_transition_message = "Light drips of water are starting to fall from the sky."
outdoor_sounds_type = /datum/looping_sound/weather/rain
indoor_sounds_type = /datum/looping_sound/weather/rain/indoors
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/virgo4/rain/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo4/rain/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -281,7 +280,7 @@ var/datum/planet/virgo4/planet_virgo4 = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain patters softly onto your umbrella."))
continue
return
L.water_act(1)
if(show_message)
@@ -314,14 +313,13 @@ var/datum/planet/virgo4/planet_virgo4 = null
WEATHER_STORM = 10,
WEATHER_RAIN = 80
)
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/virgo4/storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo4/storm/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -331,13 +329,15 @@ var/datum/planet/virgo4/planet_virgo4 = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain showers loudly onto your umbrella!"))
continue
return
L.water_act(2)
if(show_message)
to_chat(L, effect_message)
/datum/weather/virgo4/storm/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.
@@ -370,14 +370,13 @@ var/datum/planet/virgo4/planet_virgo4 = null
"An intense chill is felt, and chunks of ice start to fall from the sky, towards you."
)
imminent_transition_message = "Small bits of ice are falling from the sky, growing larger by the second. Hail is starting, get to cover!"
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
/datum/weather/virgo4/hail/process_effects()
..()
for(var/mob/living/carbon/H as anything in human_mob_list)
/datum/weather/virgo4/hail/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())
continue // They're indoors, so no need to pelt them with ice.
return // 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/melee/umbrella/U = H.get_active_hand()
@@ -387,7 +386,7 @@ var/datum/planet/virgo4/planet_virgo4 = null
if(istype(U) && U.open)
if(show_message)
to_chat(H, span_notice("Hail patters onto your umbrella."))
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "melee")
@@ -396,11 +395,11 @@ var/datum/planet/virgo4/planet_virgo4 = null
var/damage = rand(1,3)
if(amount_blocked >= 30)
continue // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
return // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head.
//Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30.
if(amount_soaked >= damage)
continue // No need to apply damage.
return // No need to apply damage.
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked)
if(show_message)
@@ -490,14 +489,13 @@ var/datum/planet/virgo4/planet_virgo4 = null
// Lets recycle.
outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard
indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING
/datum/weather/virgo4/ash_storm/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo4/ash_storm/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())
continue // They're indoors, so no need to burn them with ash.
return // They're indoors, so no need to burn them with ash.
L.inflict_heat_damage(rand(1, 3))
@@ -550,15 +548,14 @@ var/datum/planet/virgo4/planet_virgo4 = 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/virgo4/fallout/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/datum/weather/virgo4/fallout/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())
continue // They're indoors, so no need to irradiate them with fallout.
return // They're indoors, so no need to irradiate them with fallout.
L.rad_act(rand(direct_rad_low, direct_rad_high))

View File

@@ -202,6 +202,7 @@
var/datum/looping_sound/indoor_sounds = null
var/outdoor_sounds_type = null
var/indoor_sounds_type = null
var/effect_flags = NONE
/datum/weather/New()
if(outdoor_sounds_type)
@@ -215,6 +216,29 @@
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
if(effect_flags & HAS_PLANET_EFFECT)
if(effect_flags & EFFECT_ALL_MOBS)
for(var/mob/M as anything in mob_list)
if(M.is_incorporeal() && !(effect_flags & EFFECT_ALWAYS_HITS))
continue
planet_effect(M)
if(effect_flags & EFFECT_ONLY_LIVING)
for(var/mob/living/L as anything in living_mob_list)
if(L.is_incorporeal() && !(effect_flags & EFFECT_ALWAYS_HITS))
continue
planet_effect(L)
if(effect_flags & EFFECT_ONLY_HUMANS)
for(var/mob/living/carbon/H as anything in human_mob_list)
if(H.is_incorporeal() && !(effect_flags & EFFECT_ALWAYS_HITS))
continue
planet_effect(H)
if(effect_flags & EFFECT_ONLY_ROBOTS)
for(var/mob/living/silicon/R as anything in silicon_mob_list)
if(R.is_incorporeal() && !(effect_flags & EFFECT_ALWAYS_HITS))
continue
planet_effect(R)
/datum/weather/proc/planet_effect(mob/living/L)
return
/datum/weather/proc/process_sounds()

View File

@@ -50,6 +50,6 @@
. = ..()
if(istype(over_object))
if(!QDELETED(src) && istype(loc, /turf) && is_anomalous() && Adjacent(over_object) && CanMouseDrop(over_object, usr))
if(!QDELETED(src) && isturf(loc) && is_anomalous() && Adjacent(over_object) && CanMouseDrop(over_object, usr))
Bumped(usr)
over_object.contain(src)

View File

@@ -116,14 +116,13 @@
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
/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())
continue
return
var/obj/item/melee/umbrella/U = H.get_active_hand()
if(!istype(U) || !U.open)
@@ -132,7 +131,7 @@
if(istype(U) && U.open)
if(show_message)
to_chat(H, span_notice("Rain patters onto your umbrella."))
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "bio")
@@ -141,10 +140,10 @@
var/damage = rand(1,5)
if(amount_blocked >= 40)
continue
return
if(amount_soaked >= damage)
continue // No need to apply 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)
@@ -159,15 +158,13 @@
WEATHER_OVERCAST = 100
)
imminent_transition_message = "Pebbles fly through the sky."
effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS
/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)
/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())
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "melee")
@@ -176,10 +173,10 @@
var/damage = rand(1,2)
if(amount_blocked >= 10)
continue
return
if(amount_soaked >= damage)
continue // No need to apply damage.
return // No need to apply damage.
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "sand")
if(show_message)
@@ -198,14 +195,13 @@
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)
/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())
continue
return
H.add_modifier(/datum/modifier/starrynight_boon, 1 SECONDS, src)
/datum/modifier/starrynight_boon
@@ -246,14 +242,13 @@
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)
/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())
continue
return
H.add_modifier(/datum/modifier/midnightfog_boon, 1 SECONDS, src)
/datum/weather/sif/fallout/temp
@@ -314,14 +309,13 @@
)
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/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/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())
continue // They're indoors, so no need to rain on them.
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))
@@ -340,6 +334,8 @@
if(show_message)
to_chat(L, effect_message)
/datum/weather/sif/downpour/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.
@@ -376,14 +372,13 @@
//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/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/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())
continue // They're indoors, so no need to rain on them.
return // They're indoors, so no need to rain on them.
// Knock the umbrella off your hands, aint protecting you c:
if(ishuman(L))
@@ -404,17 +399,18 @@
var/damage = rand(10,30) //Ow
if(amount_blocked >= 30)
continue
return
if(amount_soaked >= damage)
continue // No need to apply 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()
..()
handle_lightning()
// This gets called to do lightning periodically.

View File

@@ -160,14 +160,13 @@ 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
/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())
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "bio")
@@ -176,10 +175,10 @@ var/datum/planet/tyr/planet_tyr = null
var/damage = rand(1,1)
if(amount_blocked >= 40)
continue
return
if(amount_soaked >= damage)
continue // No need to apply 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)
@@ -198,15 +197,13 @@ 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/process_effects()
..()
for(var/mob/living/carbon/H as anything in human_mob_list)
if(H?.z in holder.our_planet.expected_z_levels)
/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())
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "melee")
@@ -215,10 +212,10 @@ var/datum/planet/tyr/planet_tyr = null
var/damage = rand(2,2)
if(amount_blocked >= 10)
continue
return
if(amount_soaked >= damage)
continue // No need to apply damage.
return // No need to apply damage.
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "sand")
if(show_message)
@@ -240,14 +237,13 @@ 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)
/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())
continue
return
var/target_zone = pick(BP_ALL)
var/amount_blocked = H.run_armor_check(target_zone, "melee")
@@ -256,10 +252,10 @@ var/datum/planet/tyr/planet_tyr = null
var/damage = rand(5,5)
if(amount_blocked >= 40)
continue
return
if(amount_soaked >= damage)
continue // No need to apply damage.
return // No need to apply damage.
H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "sand")
if(show_message)
@@ -274,14 +270,13 @@ 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)
/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())
continue
return
H.add_modifier(/datum/modifier/starrynight_boon, 1 SECONDS, src)
/datum/weather/tyr/blizzard
@@ -319,15 +314,14 @@ 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)
/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())
continue // They're indoors, so no need to irradiate them with fallout.
return // They're indoors, so no need to irradiate them with fallout.
L.rad_act(rand(direct_rad_low, direct_rad_high))
@@ -359,14 +353,13 @@ 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/process_effects()
..()
for(var/mob/living/L as anything in living_mob_list)
/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())
continue // They're indoors, so no need to rain on them.
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()
@@ -376,13 +369,15 @@ var/datum/planet/tyr/planet_tyr = null
if(istype(U) && U.open)
if(show_message)
to_chat(L, span_notice("Rain showers loudly onto your umbrella!"))
continue
return
L.water_act(2)
if(show_message)
to_chat(L, effect_message)
/datum/weather/tyr/fog/process_effects()
..()
handle_lightning()
// This gets called to do lightning periodically.

BIN
prof.dll

Binary file not shown.

View File

@@ -181,6 +181,7 @@
#include "code\__defines\vore_prefs.dm"
#include "code\__defines\vote.dm"
#include "code\__defines\vv.dm"
#include "code\__defines\weather.dm"
#include "code\__defines\webhooks.dm"
#include "code\__defines\wiki.dm"
#include "code\__defines\wires.dm"