New Content Update (#43)
* New Content Update * readded shuttle autocall
This commit is contained in:
committed by
TalkingCactus
parent
8a9bbcf97d
commit
24c10b1b7f
@@ -0,0 +1,143 @@
|
||||
//The effects of weather occur across an entire z-level. For instance, lavaland has periodic ash storms that scorch most unprotected creatures.
|
||||
|
||||
#define STARTUP_STAGE 1
|
||||
#define MAIN_STAGE 2
|
||||
#define WIND_DOWN_STAGE 3
|
||||
#define END_STAGE 4
|
||||
|
||||
/datum/weather
|
||||
var/name = "space wind"
|
||||
var/desc = "Heavy gusts of wind blanket the area, periodically knocking down anyone caught in the open."
|
||||
|
||||
var/telegraph_message = "<span class='warning'>The wind begins to pick up.</span>" //The message displayed in chat to foreshadow the weather's beginning
|
||||
var/telegraph_duration = 300 //In deciseconds, how long from the beginning of the telegraph until the weather begins
|
||||
var/telegraph_sound //The sound file played to everyone on an affected z-level
|
||||
var/telegraph_overlay //The overlay applied to all tiles on the z-level
|
||||
|
||||
var/weather_message = "<span class='userdanger'>The wind begins to blow ferociously!</span>" //Displayed in chat once the weather begins in earnest
|
||||
var/weather_duration = 1200 //In deciseconds, how long the weather lasts once it begins
|
||||
var/weather_duration_lower = 1200 //See above - this is the lowest possible duration
|
||||
var/weather_duration_upper = 1500 //See above - this is the highest possible duration
|
||||
var/weather_sound
|
||||
var/weather_overlay
|
||||
var/weather_color = null
|
||||
|
||||
var/end_message = "<span class='danger'>The wind relents its assault.</span>" //Displayed once the wather is over
|
||||
var/end_duration = 300 //In deciseconds, how long the "wind-down" graphic will appear before vanishing entirely
|
||||
var/end_sound
|
||||
var/end_overlay
|
||||
|
||||
var/area_type = /area/space //Types of area to affect
|
||||
var/list/impacted_areas = list() //Areas to be affected by the weather, calculated when the weather begins
|
||||
var/list/protected_areas = list()//Areas that are protected and excluded from the affected areas.
|
||||
var/target_z = ZLEVEL_STATION //The z-level to affect
|
||||
|
||||
var/overlay_layer = AREA_LAYER //Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that.
|
||||
var/aesthetic = FALSE //If the weather has no purpose other than looks
|
||||
var/immunity_type = "storm" //Used by mobs to prevent them from being affected by the weather
|
||||
|
||||
var/stage = END_STAGE //The stage of the weather, from 1-4
|
||||
|
||||
var/probability = FALSE //Percent chance to happen if there are other possible weathers on the z-level
|
||||
|
||||
/datum/weather/New()
|
||||
..()
|
||||
SSweather.existing_weather |= src
|
||||
|
||||
/datum/weather/Destroy()
|
||||
SSweather.existing_weather -= src
|
||||
..()
|
||||
|
||||
/datum/weather/proc/telegraph()
|
||||
if(stage == STARTUP_STAGE)
|
||||
return
|
||||
stage = STARTUP_STAGE
|
||||
var/list/affectareas = list()
|
||||
for(var/V in get_areas(area_type))
|
||||
affectareas += V
|
||||
for(var/V in protected_areas)
|
||||
affectareas -= get_areas(V)
|
||||
for(var/V in affectareas)
|
||||
var/area/A = V
|
||||
if(A.z == target_z)
|
||||
impacted_areas |= A
|
||||
weather_duration = rand(weather_duration_lower, weather_duration_upper)
|
||||
update_areas()
|
||||
for(var/V in player_list)
|
||||
var/mob/M = V
|
||||
if(M.z == target_z)
|
||||
if(telegraph_message)
|
||||
M << telegraph_message
|
||||
if(telegraph_sound)
|
||||
M << sound(telegraph_sound)
|
||||
addtimer(src, "start", telegraph_duration)
|
||||
|
||||
/datum/weather/proc/start()
|
||||
if(stage >= MAIN_STAGE)
|
||||
return
|
||||
stage = MAIN_STAGE
|
||||
update_areas()
|
||||
for(var/V in player_list)
|
||||
var/mob/M = V
|
||||
if(M.z == target_z)
|
||||
if(weather_message)
|
||||
M << weather_message
|
||||
if(weather_sound)
|
||||
M << sound(weather_sound)
|
||||
START_PROCESSING(SSweather, src)
|
||||
addtimer(src, "wind_down", weather_duration)
|
||||
|
||||
/datum/weather/proc/wind_down()
|
||||
if(stage >= WIND_DOWN_STAGE)
|
||||
return
|
||||
stage = WIND_DOWN_STAGE
|
||||
update_areas()
|
||||
for(var/V in player_list)
|
||||
var/mob/M = V
|
||||
if(M.z == target_z)
|
||||
if(end_message)
|
||||
M << end_message
|
||||
if(end_sound)
|
||||
M << sound(end_sound)
|
||||
STOP_PROCESSING(SSweather, src)
|
||||
addtimer(src, "end", end_duration)
|
||||
|
||||
/datum/weather/proc/end()
|
||||
if(stage == END_STAGE)
|
||||
return 1
|
||||
stage = END_STAGE
|
||||
update_areas()
|
||||
|
||||
/datum/weather/proc/can_impact(mob/living/L) //Can this weather impact a mob?
|
||||
if(L.z != target_z)
|
||||
return
|
||||
if(immunity_type in L.weather_immunities)
|
||||
return
|
||||
if(!(get_area(L) in impacted_areas))
|
||||
return
|
||||
return 1
|
||||
|
||||
/datum/weather/proc/impact(mob/living/L) //What effect does this weather have on the hapless mob?
|
||||
return
|
||||
|
||||
/datum/weather/proc/update_areas()
|
||||
for(var/V in impacted_areas)
|
||||
var/area/N = V
|
||||
N.layer = overlay_layer
|
||||
N.icon = 'icons/effects/weather_effects.dmi'
|
||||
N.invisibility = 0
|
||||
N.color = weather_color
|
||||
switch(stage)
|
||||
if(STARTUP_STAGE)
|
||||
N.icon_state = telegraph_overlay
|
||||
if(MAIN_STAGE)
|
||||
N.icon_state = weather_overlay
|
||||
if(WIND_DOWN_STAGE)
|
||||
N.icon_state = end_overlay
|
||||
if(END_STAGE)
|
||||
N.color = null
|
||||
N.icon_state = initial(N.icon_state)
|
||||
N.icon = 'icons/turf/areas.dmi'
|
||||
N.layer = AREA_LAYER //Just default back to normal area stuff since I assume setting a var is faster than initial
|
||||
N.invisibility = INVISIBILITY_MAXIMUM
|
||||
N.opacity = 0
|
||||
@@ -0,0 +1,164 @@
|
||||
//Different types of weather.
|
||||
|
||||
/datum/weather/floor_is_lava //The Floor is Lava: Makes all turfs damage anyone on them unless they're standing on a solid object.
|
||||
name = "the floor is lava"
|
||||
desc = "The ground turns into surprisingly cool lava, lightly damaging anything on the floor."
|
||||
|
||||
telegraph_message = "<span class='warning'>Waves of heat emanate from the ground...</span>"
|
||||
telegraph_duration = 150
|
||||
|
||||
weather_message = "<span class='userdanger'>The floor is lava! Get on top of something!</span>"
|
||||
weather_duration_lower = 300
|
||||
weather_duration_upper = 600
|
||||
weather_overlay = "lava"
|
||||
|
||||
end_message = "<span class='danger'>The ground cools and returns to its usual form.</span>"
|
||||
end_duration = 0
|
||||
|
||||
area_type = /area
|
||||
target_z = ZLEVEL_STATION
|
||||
|
||||
overlay_layer = ABOVE_OPEN_TURF_LAYER //Covers floors only
|
||||
immunity_type = "lava"
|
||||
|
||||
/datum/weather/floor_is_lava/impact(mob/living/L)
|
||||
for(var/obj/structure/O in L.loc)
|
||||
if(O.density)
|
||||
return
|
||||
if(L.loc.density)
|
||||
return
|
||||
if(!L.client) //Only sentient people are going along with it!
|
||||
return
|
||||
L.adjustFireLoss(3)
|
||||
|
||||
|
||||
/datum/weather/advanced_darkness //Advanced Darkness: Restricts the vision of all affected mobs to a single tile in the cardinal directions.
|
||||
name = "advanced darkness"
|
||||
desc = "Everything in the area is effectively blinded, unable to see more than a foot or so around itself."
|
||||
|
||||
telegraph_message = "<span class='warning'>The lights begin to dim... is the power going out?</span>"
|
||||
telegraph_duration = 150
|
||||
|
||||
weather_message = "<span class='userdanger'>This isn't your average everday darkness... this is <i>advanced</i> darkness!</span>"
|
||||
weather_duration_lower = 300
|
||||
weather_duration_upper = 300
|
||||
|
||||
end_message = "<span class='danger'>At last, the darkness recedes.</span>"
|
||||
end_duration = 0
|
||||
|
||||
area_type = /area
|
||||
target_z = ZLEVEL_STATION
|
||||
|
||||
/datum/weather/advanced_darkness/update_areas()
|
||||
for(var/V in impacted_areas)
|
||||
var/area/A = V
|
||||
if(stage == MAIN_STAGE)
|
||||
A.invisibility = 0
|
||||
A.opacity = 1
|
||||
A.layer = overlay_layer
|
||||
A.icon = 'icons/effects/weather_effects.dmi'
|
||||
A.icon_state = "darkness"
|
||||
else
|
||||
A.invisibility = INVISIBILITY_MAXIMUM
|
||||
A.opacity = 0
|
||||
|
||||
|
||||
/datum/weather/ash_storm //Ash Storms: Common happenings on lavaland. Heavily obscures vision and deals heavy fire damage to anyone caught outside.
|
||||
name = "ash storm"
|
||||
desc = "An intense atmospheric storm lifts ash off of the planet's surface and billows it down across the area, dealing intense fire damage to the unprotected."
|
||||
|
||||
telegraph_message = "<span class='boldwarning'>An eerie moan rises on the wind. Sheets of burning ash blacken the horizon. Seek shelter.</span>"
|
||||
telegraph_duration = 300
|
||||
telegraph_sound = 'sound/lavaland/ash_storm_windup.ogg'
|
||||
telegraph_overlay = "light_ash"
|
||||
|
||||
weather_message = "<span class='userdanger'><i>Smoldering clouds of scorching ash billow down around you! Get inside!</i></span>"
|
||||
weather_duration_lower = 600
|
||||
weather_duration_upper = 1500
|
||||
weather_sound = 'sound/lavaland/ash_storm_start.ogg'
|
||||
weather_overlay = "ash_storm"
|
||||
|
||||
end_message = "<span class='boldannounce'>The shrieking wind whips away the last of the ash falls to its usual murmur. It should be safe to go outside now.</span>"
|
||||
end_duration = 300
|
||||
end_sound = 'sound/lavaland/ash_storm_end.ogg'
|
||||
end_overlay = "light_ash"
|
||||
|
||||
area_type = /area/lavaland/surface/outdoors
|
||||
target_z = ZLEVEL_LAVALAND
|
||||
|
||||
immunity_type = "ash"
|
||||
|
||||
probability = 90
|
||||
|
||||
/datum/weather/ash_storm/impact(mob/living/L)
|
||||
if(istype(L.loc, /obj/mecha))
|
||||
return
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
var/thermal_protection = H.get_thermal_protection()
|
||||
if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT)
|
||||
return
|
||||
L.adjustFireLoss(4)
|
||||
|
||||
/datum/weather/ash_storm/emberfall //Emberfall: An ash storm passes by, resulting in harmless embers falling like snow. 10% to happen in place of an ash storm.
|
||||
name = "emberfall"
|
||||
desc = "A passing ash storm blankets the area in harmless embers."
|
||||
|
||||
weather_message = "<span class='notice'>Gentle embers waft down around you like grotesque snow. The storm seems to have passed you by...</span>"
|
||||
weather_sound = 'sound/lavaland/ash_storm_windup.ogg'
|
||||
weather_overlay = "light_ash"
|
||||
|
||||
end_message = "<span class='notice'>The emberfall slows, stops. Another layer of hardened soot to the basalt beneath your feet.</span>"
|
||||
|
||||
aesthetic = TRUE
|
||||
|
||||
probability = 10
|
||||
|
||||
/datum/weather/rad_storm
|
||||
name = "radiation storm"
|
||||
desc = "A cloud of intense radiation passes through the area dealing rad damage to those who are unprotected."
|
||||
|
||||
telegraph_duration = 600
|
||||
telegraph_message = "<span class='danger'>The air begins to grow warm.</span>"
|
||||
|
||||
weather_message = "<span class='userdanger'><i>You feel waves of heat wash over you! Find shelter!</i></span>"
|
||||
weather_overlay = "radiation"
|
||||
weather_duration_lower = 600
|
||||
weather_duration_upper = 1500
|
||||
weather_color = "green"
|
||||
weather_sound = 'sound/misc/bloblarm.ogg'
|
||||
|
||||
end_duration = 100
|
||||
end_message = "<span class='notice'>The air seems to be cooling off again.</span>"
|
||||
|
||||
area_type = /area
|
||||
protected_areas = list(/area/maintenance, /area/turret_protected/ai_upload, /area/turret_protected/ai_upload_foyer, /area/turret_protected/ai)
|
||||
target_z = ZLEVEL_STATION
|
||||
|
||||
immunity_type = "rad"
|
||||
|
||||
/datum/weather/rad_storm/impact(mob/living/L)
|
||||
if(prob(20))
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
if(H.dna && H.dna.species)
|
||||
if(!(RADIMMUNE in H.dna.species.specflags))
|
||||
if(prob(50))
|
||||
randmuti(H)
|
||||
if(prob(90))
|
||||
randmutb(H)
|
||||
else
|
||||
randmutg(H)
|
||||
H.domutcheck()
|
||||
L.rad_act(20,1)
|
||||
|
||||
L.adjustToxLoss(4)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/weather/rad_storm/end()
|
||||
if(..())
|
||||
return
|
||||
priority_announce("The radiation threat has passed. Please return to your workplaces.", "Anomaly Alert")
|
||||
Reference in New Issue
Block a user