Merge pull request #9416 from Ghommie/Ghommie-cit215
The niche singularity beacon now also moderately buffs meteor waves.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
GLOBAL_VAR_INIT(singularity_counter, 0)
|
||||
|
||||
#define METEOR_DISASTER_MODIFIER 0.5
|
||||
|
||||
////////////////////////////////////////
|
||||
//Singularity beacon
|
||||
////////////////////////////////////////
|
||||
@@ -13,39 +17,57 @@
|
||||
stat = 0
|
||||
verb_say = "states"
|
||||
var/cooldown = 0
|
||||
|
||||
var/active = 0
|
||||
var/active = FALSE
|
||||
var/meteor_buff = FALSE
|
||||
var/icontype = "beacon"
|
||||
|
||||
|
||||
/obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null)
|
||||
if(active)
|
||||
return FALSE
|
||||
if(surplus() < 1500)
|
||||
if(user)
|
||||
to_chat(user, "<span class='notice'>The connected wire doesn't have enough current.</span>")
|
||||
return
|
||||
return FALSE
|
||||
if(is_station_level(z))
|
||||
increment_meteor_waves()
|
||||
for(var/obj/singularity/singulo in GLOB.singularities)
|
||||
if(singulo.z == z)
|
||||
singulo.target = src
|
||||
icon_state = "[icontype]1"
|
||||
active = 1
|
||||
active = TRUE
|
||||
if(user)
|
||||
to_chat(user, "<span class='notice'>You activate the beacon.</span>")
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null)
|
||||
/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user)
|
||||
if(!active)
|
||||
return FALSE
|
||||
for(var/obj/singularity/singulo in GLOB.singularities)
|
||||
if(singulo.target == src)
|
||||
singulo.target = null
|
||||
icon_state = "[icontype]0"
|
||||
active = 0
|
||||
active = FALSE
|
||||
if(user)
|
||||
to_chat(user, "<span class='notice'>You deactivate the beacon.</span>")
|
||||
if(meteor_buff)
|
||||
decrement_meteor_waves()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/singularity_beacon/proc/increment_meteor_waves()
|
||||
meteor_buff = TRUE
|
||||
GLOB.singularity_counter++
|
||||
for(var/datum/round_event_control/meteor_wave/W in SSevents.control)
|
||||
W.weight += round(initial(W.weight) * METEOR_DISASTER_MODIFIER)
|
||||
|
||||
/obj/machinery/power/singularity_beacon/proc/decrement_meteor_waves()
|
||||
meteor_buff = FALSE
|
||||
GLOB.singularity_counter--
|
||||
for(var/datum/round_event_control/meteor_wave/W in SSevents.control)
|
||||
W.weight -= round(initial(W.weight) * METEOR_DISASTER_MODIFIER)
|
||||
|
||||
/obj/machinery/power/singularity_beacon/attack_ai(mob/user)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/singularity_beacon/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
@@ -86,6 +108,12 @@
|
||||
if(!active)
|
||||
return
|
||||
|
||||
var/is_on_station = is_station_level(z)
|
||||
if(meteor_buff && !is_on_station)
|
||||
decrement_meteor_waves()
|
||||
else if(!meteor_buff && is_on_station)
|
||||
increment_meteor_waves()
|
||||
|
||||
if(surplus() >= 1500)
|
||||
add_load(1500)
|
||||
if(cooldown <= world.time)
|
||||
@@ -133,3 +161,5 @@
|
||||
/obj/item/sbeacondrop/clownbomb
|
||||
desc = "A label on it reads: <i>Warning: Activating this device will send a silly explosive to your location</i>."
|
||||
droptype = /obj/machinery/syndicatebomb/badmin/clown
|
||||
|
||||
#undef METEOR_DISASTER_MODIFIER
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
// Normal strength
|
||||
|
||||
#define SINGULO_BEACON_DISTURBANCE 0.2 //singularity beacon also improve the odds of meteor waves and speed them up a little.
|
||||
#define SINGULO_BEACON_MAX_DISTURBANCE 0.6 //maximum cap due to how meteor waves can be potentially round ending.
|
||||
|
||||
/datum/round_event_control/meteor_wave
|
||||
name = "Meteor Wave: Normal"
|
||||
typepath = /datum/round_event/meteor_wave
|
||||
@@ -18,6 +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_counter)
|
||||
startWhen *= 1 - min(GLOB.singularity_counter * SINGULO_BEACON_DISTURBANCE, SINGULO_BEACON_MAX_DISTURBANCE)
|
||||
endWhen = startWhen + 60
|
||||
|
||||
|
||||
@@ -52,7 +57,7 @@
|
||||
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/60)] minutes.", "Meteor Alert", 'sound/ai/meteors.ogg')
|
||||
priority_announce("Meteors have been detected on collision course with the station. Estimated time until impact: [round(startWhen/60)] minutes.[GLOB.singularity_counter ? " Warning: Anomalous gravity pulse detected, Syndicate technology interference likely." : ""]", "Meteor Alert", 'sound/ai/meteors.ogg')
|
||||
|
||||
/datum/round_event/meteor_wave/tick()
|
||||
if(ISMULTIPLE(activeFor, 3))
|
||||
@@ -79,3 +84,6 @@
|
||||
|
||||
/datum/round_event/meteor_wave/catastrophic
|
||||
wave_name = "catastrophic"
|
||||
|
||||
#undef SINGULO_BEACON_DISTURBANCE
|
||||
#undef SINGULO_BEACON_MAX_DISTURBANCE
|
||||
|
||||
@@ -1490,9 +1490,10 @@ datum/uplink_item/stealthy_weapons/taeclowndo_shoes
|
||||
/datum/uplink_item/device_tools/singularity_beacon
|
||||
name = "Power Beacon"
|
||||
desc = "When screwed to wiring attached to an electric grid and activated, this large device pulls any \
|
||||
active gravitational singularities or tesla balls towards it. This will not work when the engine is still \
|
||||
in containment. Because of its size, it cannot be carried. Ordering this \
|
||||
sends you a small beacon that will teleport the larger beacon to your location upon activation."
|
||||
active gravitational singularities or tesla balls towards it (provided they are not safely \
|
||||
contained), as well as increasing the odds of incoming meteor waves. \
|
||||
Because of its size, it cannot be carried. Ordering this sends you a small beacon \
|
||||
that will teleport the larger beacon to your location upon activation."
|
||||
item = /obj/item/sbeacondrop
|
||||
cost = 14
|
||||
|
||||
|
||||
Reference in New Issue
Block a user