mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
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:
@@ -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)),
|
||||
|
||||
52
code/modules/events/solar_storm.dm
Normal file
52
code/modules/events/solar_storm.dm
Normal 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
|
||||
@@ -1,6 +1,6 @@
|
||||
#define SOLAR_MAX_DIST 40
|
||||
#define SOLARGENRATE 1500
|
||||
|
||||
var/solar_gen_rate = 1500
|
||||
var/list/solars_list = list()
|
||||
|
||||
/obj/machinery/power/solar
|
||||
@@ -130,7 +130,7 @@ var/list/solars_list = list()
|
||||
if(powernet == control.powernet)//check if the panel is still connected to the computer
|
||||
if(obscured) //get no light from the sun, so don't generate power
|
||||
return
|
||||
var/sgen = SOLARGENRATE * sunfrac
|
||||
var/sgen = solar_gen_rate * sunfrac
|
||||
add_avail(sgen)
|
||||
control.gen += sgen
|
||||
else //if we're no longer on the same powernet, remove from control computer
|
||||
|
||||
11
html/changelogs/Techhead-SunStorm.yml
Normal file
11
html/changelogs/Techhead-SunStorm.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
author: Techhead
|
||||
|
||||
delete-after: True
|
||||
|
||||
# Any changes you've made. See valid prefix list above.
|
||||
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||
# SCREW THIS UP AND IT WON'T WORK.
|
||||
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||
changes:
|
||||
- rscadd: "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."
|
||||
@@ -1283,6 +1283,7 @@
|
||||
#include "code\modules\events\radiation_storm.dm"
|
||||
#include "code\modules\events\random_antagonist.dm"
|
||||
#include "code\modules\events\rogue_drones.dm"
|
||||
#include "code\modules\events\solar_storm.dm"
|
||||
#include "code\modules\events\space_ninja.dm"
|
||||
#include "code\modules\events\spacevine.dm"
|
||||
#include "code\modules\events\spider_infestation.dm"
|
||||
|
||||
Reference in New Issue
Block a user