Merge pull request #121 from unusualcrow/solarflare
Solar Flare Weather Event
This commit is contained in:
@@ -154,12 +154,56 @@
|
||||
|
||||
L.adjustToxLoss(4)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/weather/rad_storm/end()
|
||||
if(..())
|
||||
return
|
||||
priority_announce("The radiation threat has passed. Please return to your workplaces.", "Anomaly Alert")
|
||||
spawn(300) revoke_maint_all_access()
|
||||
spawn(300) revoke_maint_all_access()
|
||||
|
||||
/datum/weather/solar_flare
|
||||
name = "solar flare"
|
||||
desc = "A solar flare from the local star knocks out power on the station."
|
||||
|
||||
telegraph_duration = 300
|
||||
telegraph_message = "<span class='danger'>You feel a slight tingling in the air.</span>"
|
||||
|
||||
weather_message = "<span class='userdanger'><i>Everything shuts off all at once, and the station becomes dark and lifeless.</i></span>"
|
||||
weather_duration_lower = 450
|
||||
weather_duration_upper = 900
|
||||
weather_sound = 'sound/effects/powerdown.ogg'
|
||||
|
||||
end_duration = 100
|
||||
end_message = "<span class='notice'>The buzz of electronics returns once more as the power turns back on.</span>"
|
||||
end_sound = 'sound/effects/powerup.ogg'
|
||||
|
||||
area_type = /area
|
||||
protected_areas = list(/area/maintenance, /area/turret_protected/ai_upload, /area/turret_protected/ai_upload_foyer, /area/turret_protected/ai, /area/engine/engineering)
|
||||
target_z = ZLEVEL_STATION
|
||||
|
||||
immunity_type = null
|
||||
|
||||
/datum/weather/solar_flare/update_areas()
|
||||
for(var/V in impacted_areas)
|
||||
var/area/A = V
|
||||
if(stage == MAIN_STAGE)
|
||||
A.power_light = 0
|
||||
A.power_equip = 0
|
||||
A.power_environ = 0
|
||||
A.power_change()
|
||||
for(var/obj/machinery/power/apc/apc in machines)
|
||||
apc.shorted_old = apc.shorted
|
||||
var/area/C = get_area(apc)
|
||||
if(C in impacted_areas)
|
||||
apc.shorted = TRUE
|
||||
else
|
||||
A.power_light = 1
|
||||
A.power_equip = 1
|
||||
A.power_environ = 1
|
||||
A.power_change()
|
||||
for(var/obj/machinery/power/apc/apc in machines)
|
||||
apc.shorted = apc.shorted_old
|
||||
|
||||
/datum/weather/solar_flare/end()
|
||||
if(..())
|
||||
return
|
||||
addtimer(GLOBAL_PROC, "priority_announce", 60, FALSE, "The solar flare has ended. Please return to work.", "Anomaly Alert")
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/datum/round_event_control/solar_flare
|
||||
name = "Solar Flare"
|
||||
typepath = /datum/round_event/solar_flare
|
||||
max_occurrences = 1
|
||||
|
||||
/datum/round_event/solar_flare
|
||||
|
||||
/datum/round_event/solar_flare/setup()
|
||||
startWhen = 3
|
||||
endWhen = startWhen + 1
|
||||
announceWhen = 1
|
||||
|
||||
/datum/round_event/solar_flare/announce()
|
||||
priority_announce("Incoming solar flare detected near the station. Expect power outages in all exposed areas for a short duration.", "Anomaly Alert", 'sound/effects/alert.ogg')
|
||||
|
||||
/datum/round_event/solar_flare/start()
|
||||
SSweather.run_weather("solar flare",1)
|
||||
@@ -55,6 +55,7 @@
|
||||
var/cell_type = 2500 // 0=no cell, 1=regular, 2=high-cap (x5) <- old, now it's just 0=no cell, otherwise dictate cellcapacity by changing this value. 1 used to be 1000, 2 was 2500
|
||||
var/opened = 0 //0=closed, 1=opened, 2=cover removed
|
||||
var/shorted = 0
|
||||
var/shorted_old = 0 //for solar flare
|
||||
var/lighting = 3
|
||||
var/equipment = 3
|
||||
var/environ = 3
|
||||
@@ -1156,4 +1157,4 @@
|
||||
/obj/item/weapon/electronics/apc
|
||||
name = "power control module"
|
||||
icon_state = "power_mod"
|
||||
desc = "Heavy-duty switching circuits for power control."
|
||||
desc = "Heavy-duty switching circuits for power control."
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1112,6 +1112,7 @@
|
||||
#include "code\modules\events\processor_overload.dm"
|
||||
#include "code\modules\events\radiation_storm.dm"
|
||||
#include "code\modules\events\shuttle_loan.dm"
|
||||
#include "code\modules\events\solar_flare.dm"
|
||||
#include "code\modules\events\spacevine.dm"
|
||||
#include "code\modules\events\spider_infestation.dm"
|
||||
#include "code\modules\events\spontaneous_appendicitis.dm"
|
||||
|
||||
Reference in New Issue
Block a user