Merge pull request #10728 from kevinz000/hugbox_meteor_time

Meteor waves are now directional (and tell you the direction on the ""1 minute""+ warning)
This commit is contained in:
Ghom
2020-01-29 03:46:32 +01:00
committed by GitHub
2 changed files with 19 additions and 6 deletions

View File

@@ -21,16 +21,16 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
//Meteor spawning global procs
///////////////////////////////
/proc/spawn_meteors(number = 10, list/meteortypes)
/proc/spawn_meteors(number = 10, list/meteortypes, dir)
for(var/i = 0; i < number; i++)
spawn_meteor(meteortypes)
spawn_meteor(meteortypes, dir)
/proc/spawn_meteor(list/meteortypes)
/proc/spawn_meteor(list/meteortypes, dir)
var/turf/pickedstart
var/turf/pickedgoal
var/max_i = 10//number of tries to spawn meteor.
while(!isspaceturf(pickedstart))
var/startSide = pick(GLOB.cardinals)
var/startSide = dir || pick(GLOB.cardinals)
var/startZ = pick(SSmapping.levels_by_trait(ZTRAIT_STATION))
pickedstart = spaceDebrisStartLoc(startSide, startZ)
pickedgoal = spaceDebrisFinishLoc(startSide, startZ)

View File

@@ -18,6 +18,7 @@
announceWhen = 1
var/list/wave_type
var/wave_name = "normal"
var/direction
/datum/round_event/meteor_wave/setup()
announceWhen = 1
@@ -37,6 +38,8 @@
"normal" = 50,
"threatening" = 40,
"catastrophic" = 10))
if(!direction)
direction = pick(GLOB.cardinals)
switch(wave_name)
if("normal")
wave_type = GLOB.meteors_normal
@@ -58,11 +61,21 @@
kill()
/datum/round_event/meteor_wave/announce(fake)
priority_announce("Meteors have been detected on collision course with the station. Estimated time until impact: [round((startWhen * SSevents.wait) / 10, 0.1)] seconds.[GLOB.singularity_counter ? " Warning: Anomalous gravity pulse detected, Syndicate technology interference likely." : ""]", "Meteor Alert", "meteors")
var/directionstring
switch(direction)
if(NORTH)
directionstring = " towards the fore"
if(SOUTH)
directionstring = " towards the aft"
if(EAST)
directionstring = " towards starboard"
if(WEST)
directionstring = " towards port"
priority_announce("Meteors have been detected on collision course with the station[directionstring]. Estimated time until impact: [round((startWhen * SSevents.wait) / 10, 0.1)] seconds.[GLOB.singularity_counter ? " Warning: Anomalous gravity pulse detected, Syndicate technology interference likely." : ""]", "Meteor Alert", "meteors")
/datum/round_event/meteor_wave/tick()
if(ISMULTIPLE(activeFor, 3))
spawn_meteors(5, wave_type) //meteor list types defined in gamemode/meteor/meteors.dm
spawn_meteors(5, wave_type, direction) //meteor list types defined in gamemode/meteor/meteors.dm
/datum/round_event_control/meteor_wave/threatening
name = "Meteor Wave: Threatening"