Adds the Solar Storm event.

New Random Event: Solar Storms. Similar to a radiation storm, but anywhere inside the station is safe.
Also boosts solar panel output significantly for the duration.
This commit is contained in:
Techhead0
2016-06-06 17:42:06 -04:00
committed by Yoshax
parent 8d5560aa75
commit 111310ef32
5 changed files with 67 additions and 2 deletions

View File

@@ -158,6 +158,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 0, list(ASSIGNMENT_MEDICAL = 50), 1),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Random Antagonist", /datum/event/random_antag, 2.5, list(ASSIGNMENT_SECURITY = 1), 1, 0, 5),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Rogue Drones", /datum/event/rogue_drone, 20, list(ASSIGNMENT_SECURITY = 20)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Solar Storm", /datum/event/solar_storm, 10, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_SECURITY = 10), 1),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Space Dust", /datum/event/dust, 30, list(ASSIGNMENT_ENGINEER = 5)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, 100, list(ASSIGNMENT_SECURITY = 30), 1),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Virology Breach", /datum/event/prison_break/virology, 0, list(ASSIGNMENT_MEDICAL = 100)),

View File

@@ -0,0 +1,52 @@
/datum/event/solar_storm
startWhen = 45
announceWhen = 1
var/const/rad_interval = 5 //Same interval period as radiation storms.
var/base_solar_gen_rate
/datum/event/solar_storm/setup()
endWhen = startWhen + rand(30,90) + rand(30,90) //2-6 minute duration
/datum/event/solar_storm/announce()
command_announcement.Announce("A solar storm has been detected approaching the station. Please halt all EVA activites immediately and return to the interior of the station.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
adjust_solar_output(1.5)
/datum/event/solar_storm/proc/adjust_solar_output(var/mult = 1)
if(isnull(base_solar_gen_rate)) base_solar_gen_rate = solar_gen_rate
solar_gen_rate = mult * base_solar_gen_rate
/datum/event/solar_storm/start()
command_announcement.Announce("The solar storm has reached the station. Please refain from EVA and remain inside the station until it has passed.", "Anomaly Alert")
adjust_solar_output(5)
/datum/event/solar_storm/tick()
if(activeFor % rad_interval == 0)
radiate()
/datum/event/solar_storm/proc/radiate()
for(var/mob/living/L in living_mob_list)
var/turf/T = get_turf(L)
if(!T || !(T.z in using_map.player_levels))
continue
if(!istype(T.loc,/area/space) && !istype(T,/turf/space)) //Make sure you're in a space area or on a space turf
continue
//Todo: Apply some burn damage from the heat of the sun. Until then, enjoy some moderate radiation.
L.apply_effect((rand(15,30)),IRRADIATE,blocked = L.getarmor(null, "rad"))
/datum/event/solar_storm/end()
command_announcement.Announce("The solar storm has passed the station. It is now safe to resume EVA activities. Please report to medbay if you experience any unusual symptoms. ", "Anomaly Alert")
adjust_solar_output()
//For a false alarm scenario.
/datum/event/solar_storm/syndicate/adjust_solar_output()
return
/datum/event/solar_storm/syndicate/radiate()
return