diff --git a/code/modules/events/aurora_caelus.dm b/code/modules/events/aurora_caelus.dm new file mode 100644 index 0000000000..be3108b0ec --- /dev/null +++ b/code/modules/events/aurora_caelus.dm @@ -0,0 +1,62 @@ +/datum/round_event_control/aurora_caelus + name = "Aurora Caelus" + typepath = /datum/round_event/aurora_caelus + max_occurrences = 1 + weight = 15 + earliest_start = 5 MINUTES + +/datum/round_event_control/aurora_caelus/canSpawnEvent(players, gamemode) + if(!CONFIG_GET(flag/starlight)) + return FALSE + return ..() + +/datum/round_event/aurora_caelus + announceWhen = 1 + startWhen = 9 + endWhen = 50 + var/list/aurora_colors = list("#A2FF80", "#A2FF8B", "#A2FF96", "#A2FFA5", "#A2FFB6", "#A2FFC7", "#A2FFDE") + var/aurora_progress = 0 //this cycles from 1 to 7, slowly changing colors from gentle green to gentle blue + +/datum/round_event/aurora_caelus/announce() + priority_announce("[station_name()]: A harmless cloud of ions is approaching your station, and will exhaust their energy battering the hull. Nanotrasen has approved a short break for all employees to relax and observe this very rare event. During this time, starlight will be bright but gentle, shifting between quiet green and blue colors. Any staff who would like to view these lights for themselves may proceed to the area nearest to them with viewing ports to open space. We hope you enjoy the lights.", + sound = 'sound/misc/notice2.ogg', + sender_override = "Nanotrasen Meteorology Division") + for(var/V in GLOB.player_list) + var/mob/M = V + if((M.client.prefs.toggles & SOUND_MIDI) && is_station_level(M.z)) + M.playsound_local(M, 'sound/ambience/aurora_caelus.ogg', 20, FALSE, pressure_affected = FALSE) + +/datum/round_event/aurora_caelus/start() + for(var/area in GLOB.sortedAreas) + var/area/A = area + if(initial(A.dynamic_lighting) == DYNAMIC_LIGHTING_IFSTARLIGHT) + for(var/turf/open/space/S in A) + S.set_light(S.light_range * 3, S.light_power * 0.5) + +/datum/round_event/aurora_caelus/tick() + if(activeFor % 5 == 0) + aurora_progress++ + var/aurora_color = aurora_colors[aurora_progress] + for(var/area in GLOB.sortedAreas) + var/area/A = area + if(initial(A.dynamic_lighting) == DYNAMIC_LIGHTING_IFSTARLIGHT) + for(var/turf/open/space/S in A) + S.set_light(l_color = aurora_color) + +/datum/round_event/aurora_caelus/end() + for(var/area in GLOB.sortedAreas) + var/area/A = area + if(initial(A.dynamic_lighting) == DYNAMIC_LIGHTING_IFSTARLIGHT) + for(var/turf/open/space/S in A) + fade_to_black(S) + priority_announce("The aurora caelus event is now ending. Starlight conditions will slowly return to normal. When this has concluded, please return to your workplace and continue work as normal. Have a pleasant shift, [station_name()], and thank you for watching with us.", + sound = 'sound/misc/notice2.ogg', + sender_override = "Nanotrasen Meteorology Division") + +/datum/round_event/aurora_caelus/proc/fade_to_black(turf/open/space/S) + set waitfor = FALSE + var/new_light = initial(S.light_range) + while(S.light_range > new_light) + S.set_light(S.light_range - 0.2) + sleep(30) + S.set_light(new_light, initial(S.light_power), initial(S.light_color)) diff --git a/sound/ambience/LICENSE.txt b/sound/ambience/LICENSE.txt index d1d18306a6..5fb0ece74d 100644 --- a/sound/ambience/LICENSE.txt +++ b/sound/ambience/LICENSE.txt @@ -2,3 +2,5 @@ ambidet1.ogg is Fast Talking by Kevin Macleod. It has been licensed under the CC It has been cropped for use ingame. ambidet2.ogg is Night on the Docks, Piano by Kevin Macleod. It has been licensed under CC-BY 3.0 license. It has been cropped for use ingame, and also fades in. +aurora_caelus.ogg is Music for Manatees, by Kevin Macleod. It has been licensed under CC-BY 3.0 license. + It has been cropped for use ingame, and also fades out. diff --git a/sound/ambience/aurora_caelus.ogg b/sound/ambience/aurora_caelus.ogg new file mode 100644 index 0000000000..0c741678d5 Binary files /dev/null and b/sound/ambience/aurora_caelus.ogg differ diff --git a/tgstation.dme b/tgstation.dme index ad9623390b..5f971c4690 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -1444,6 +1444,7 @@ #include "code\modules\events\anomaly_grav.dm" #include "code\modules\events\anomaly_pyro.dm" #include "code\modules\events\anomaly_vortex.dm" +#include "code\modules\events\aurora_caelus.dm" #include "code\modules\events\blob.dm" #include "code\modules\events\brand_intelligence.dm" #include "code\modules\events\camerafailure.dm"