Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aurora Caelus rework #8886

Closed
wants to merge 12 commits into from
16 changes: 16 additions & 0 deletions code/game/gamemodes/meteor/meteors.dm
Expand Up @@ -16,6 +16,8 @@ GLOBAL_LIST_INIT(meteorsB, list(/obj/effect/meteor/meaty=5, /obj/effect/meteor/m

GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event

GLOBAL_LIST_INIT(meteorsAURORA, list(/obj/effect/meteor/aurora)) //for aurora caelus


///////////////////////////////
//Meteor spawning global procs
Expand Down Expand Up @@ -351,6 +353,20 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
dropamt = 1
threat = 100

//Aurora bolt
/obj/effect/meteor/aurora
name = "glowing bolt"
desc = "It's so pretty."
icon_state = "aurora"
hits = 0
hitpwr = 0
meteorsound = 'sound/effects/gravhit.ogg'
meteordrop = list(/obj/effect/temp_visual/impact_effect/ion)
dropamt = 1
ynot01 marked this conversation as resolved.
Show resolved Hide resolved

/obj/effect/meteor/aurora/Initialize(mapload, target)
. = ..()
Copy link
Contributor

@jcatjmeow jcatjmeow Jun 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. = ..()
. = ..()
var/xxx = round(world.maxx/2)
var/yyy = round(world.maxy/2)
chase_target(locate(xxx, yyy, 2))

This will make each bolt go towards the center of the station. It might not be the best but it does help more of them hit the windows.

I've also been asked to see if you would consider keeping the old event stuff too. Like the color changes to the starlight.

color = pick("#A2FF80", "#A2FF8B", "#A2FF96", "#A2FFA5", "#A2FFB6", "#A2FFC7", "#A2FFDE", "#A2FFEE")
//////////////////////////
//Spookoween meteors
/////////////////////////
Expand Down
48 changes: 9 additions & 39 deletions code/modules/events/aurora_caelus.dm
@@ -1,23 +1,20 @@
/datum/round_event_control/aurora_caelus
/datum/round_event_control/meteor_wave/aurora_caelus
name = "Aurora Caelus"
typepath = /datum/round_event/aurora_caelus
typepath = /datum/round_event/meteor_wave/aurora_caelus
max_occurrences = 1
weight = 1
earliest_start = 5 MINUTES

/datum/round_event_control/aurora_caelus/canSpawnEvent(players, gamemode)
/datum/round_event_control/meteor_wave/aurora_caelus/canSpawnEvent(players, gamemode)
if(!CONFIG_GET(flag/starlight))
return FALSE
return ..()

/datum/round_event/aurora_caelus
/datum/round_event/meteor_wave/aurora_caelus
wave_name = "aurora"
announceWhen = 1
startWhen = 9
endWhen = 50
var/list/aurora_colors = list("#A2FF80", "#A2FF8B", "#A2FF96", "#A2FFA5", "#A2FFB6", "#A2FFC7", "#A2FFDE", "#A2FFEE")
var/aurora_progress = 0 //this cycles from 1 to 8, slowly changing colors from gentle green to gentle blue

/datum/round_event/aurora_caelus/announce()
/datum/round_event/meteor_wave/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")
Expand All @@ -26,37 +23,10 @@
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/meteor_wave/aurora_caelus/start()
spawn_meteors(100, GLOB.meteorsAURORA)

/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)
/datum/round_event/meteor_wave/aurora_caelus/end()
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))
2 changes: 2 additions & 0 deletions code/modules/events/meteor_wave.dm
Expand Up @@ -42,6 +42,8 @@
wave_type = GLOB.meteorsC
if("halloween")
wave_type = GLOB.meteorsSPOOKY
if("aurora")
wave_type = GLOB.meteorsAURORA
else
WARNING("Wave name of [wave_name] not recognised.")
kill()
Expand Down
Binary file modified icons/obj/meteor.dmi
Binary file not shown.
2 changes: 1 addition & 1 deletion yogstation.dme
Expand Up @@ -3439,4 +3439,4 @@
#include "yogstation\code\modules\xenoarch\loot\gigadrill.dm"
#include "yogstation\code\modules\xenoarch\loot\guns.dm"
#include "yogstation\interface\interface.dm"
// END_INCLUDE
// END_INCLUDE