we are only keeping track of the number of singu beacons, var more efficient.

This commit is contained in:
Ghommie
2019-10-05 05:29:57 +02:00
parent 35a6991300
commit 52fb4b03ac
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
GLOBAL_INIT_LIST(singularity_beacons)
GLOBAL_VAR_INIT(singularity_counter, 0)
#define METEOR_DISASTER_MODIFIER 0.5
@@ -29,7 +29,7 @@ GLOBAL_INIT_LIST(singularity_beacons)
if(user)
to_chat(user, "<span class='notice'>The connected wire doesn't have enough current.</span>")
return
GLOB.singularity_beacons += src
GLOB.singularity_counter++
for(var/datum/round_event_control/meteor_wave/W in SSevents.control)
W.weight += round(initial(W.weight) * METEOR_DISASTER_MODIFIER)
for(var/obj/singularity/singulo in GLOB.singularities)
@@ -49,7 +49,7 @@ GLOBAL_INIT_LIST(singularity_beacons)
active = 0
if(user)
to_chat(user, "<span class='notice'>You deactivate the beacon.</span>")
GLOB.singularity_beacons -= src
GLOB.singularity_counter--
for(var/datum/round_event_control/meteor_wave/W in SSevents.control)
W.weight -= round(initial(W.weight) * METEOR_DISASTER_MODIFIER)
+2 -2
View File
@@ -21,8 +21,8 @@
/datum/round_event/meteor_wave/setup()
announceWhen = 1
startWhen = rand(300, 600) //Yeah for SOME REASON this is measured in seconds and not deciseconds???
if(GLOB.singularity_beacons.len)
startWhen *= 1 - min(GLOB.singularity_beacons.len * SINGULO_BEACON_DISTURBANCE, SINGULO_BEACON_MAX_DISTURBANCE)
if(GLOB.singularity_counter)
startWhen *= 1 - min(GLOB.singularity_counter * SINGULO_BEACON_DISTURBANCE, SINGULO_BEACON_MAX_DISTURBANCE)
endWhen = startWhen + 60