From d706944e20a9027f818a2cd0d0c496ab4d73e9ea Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 5 Oct 2019 04:37:01 +0200
Subject: [PATCH 1/6] The niche singularity beacon now also moderately buffs
meteor waves.
---
code/game/machinery/syndicatebeacon.dm | 14 ++++++++++++++
code/modules/events/meteor_wave.dm | 8 ++++++++
code/modules/uplink/uplink_items.dm | 7 ++++---
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index a1ed7fb848..cacc109793 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -1,3 +1,7 @@
+GLOBAL_INIT_LIST(singularity_beacons)
+
+#define METEOR_DISASTER_MODIFIER 0.5
+
////////////////////////////////////////
//Singularity beacon
////////////////////////////////////////
@@ -18,11 +22,16 @@
var/icontype = "beacon"
+
+
/obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null)
if(surplus() < 1500)
if(user)
to_chat(user, "The connected wire doesn't have enough current.")
return
+ GLOB.singularity_beacons += src
+ 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)
if(singulo.z == z)
singulo.target = src
@@ -40,6 +49,9 @@
active = 0
if(user)
to_chat(user, "You deactivate the beacon.")
+ GLOB.singularity_beacons -= src
+ 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)
@@ -133,3 +145,5 @@
/obj/item/sbeacondrop/clownbomb
desc = "A label on it reads: Warning: Activating this device will send a silly explosive to your location."
droptype = /obj/machinery/syndicatebomb/badmin/clown
+
+#undef METEOR_DISASTER_MODIFIER
diff --git a/code/modules/events/meteor_wave.dm b/code/modules/events/meteor_wave.dm
index af22ae3b96..fc10b5ac90 100644
--- a/code/modules/events/meteor_wave.dm
+++ b/code/modules/events/meteor_wave.dm
@@ -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_beacons.len)
+ startWhen *= 1 - min(GLOB.singularity_beacons.len * SINGULO_BEACON_DISTURBANCE, SINGULO_BEACON_MAX_DISTURBANCE)
endWhen = startWhen + 60
@@ -79,3 +84,6 @@
/datum/round_event/meteor_wave/catastrophic
wave_name = "catastrophic"
+
+#undef SINGULO_BEACON_DISTURBANCE
+#undef SINGULO_BEACON_MAX_DISTURBANCE
diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm
index 09e955d2f9..c7cc7d59e8 100644
--- a/code/modules/uplink/uplink_items.dm
+++ b/code/modules/uplink/uplink_items.dm
@@ -1487,9 +1487,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
From 35a69913008073ecfe2c9919159deb46b817b4b6 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 5 Oct 2019 05:14:38 +0200
Subject: [PATCH 2/6] lone rogue parenthesis
---
code/game/machinery/syndicatebeacon.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index cacc109793..175a3f72ec 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -31,7 +31,7 @@ GLOBAL_INIT_LIST(singularity_beacons)
return
GLOB.singularity_beacons += src
for(var/datum/round_event_control/meteor_wave/W in SSevents.control)
- W.weight += round(initial(W.weight) * METEOR_DISASTER_MODIFIER))
+ W.weight += round(initial(W.weight) * METEOR_DISASTER_MODIFIER)
for(var/obj/singularity/singulo in GLOB.singularities)
if(singulo.z == z)
singulo.target = src
@@ -51,7 +51,7 @@ GLOBAL_INIT_LIST(singularity_beacons)
to_chat(user, "You deactivate the beacon.")
GLOB.singularity_beacons -= src
for(var/datum/round_event_control/meteor_wave/W in SSevents.control)
- W.weight -= round(initial(W.weight) * METEOR_DISASTER_MODIFIER))
+ W.weight -= round(initial(W.weight) * METEOR_DISASTER_MODIFIER)
/obj/machinery/power/singularity_beacon/attack_ai(mob/user)
From 52fb4b03ac30d80035c89c3788d0b93905ec9ef4 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 5 Oct 2019 05:29:57 +0200
Subject: [PATCH 3/6] we are only keeping track of the number of singu beacons,
var more efficient.
---
code/game/machinery/syndicatebeacon.dm | 6 +++---
code/modules/events/meteor_wave.dm | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 175a3f72ec..3fb78ad37f 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -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, "The connected wire doesn't have enough current.")
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, "You deactivate the beacon.")
- 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)
diff --git a/code/modules/events/meteor_wave.dm b/code/modules/events/meteor_wave.dm
index fc10b5ac90..6f01caa275 100644
--- a/code/modules/events/meteor_wave.dm
+++ b/code/modules/events/meteor_wave.dm
@@ -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
From 9ee1987dec41ef91ff44a4216a376e69fd4d990e Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Tue, 8 Oct 2019 20:04:08 +0200
Subject: [PATCH 4/6] Applying kevinz' ominous warning suggestion
---
code/game/machinery/syndicatebeacon.dm | 14 ++++++++++----
code/modules/events/meteor_wave.dm | 2 +-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 3fb78ad37f..67c9627423 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -25,10 +25,12 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
/obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null)
+ if(active)
+ return FALSE
if(surplus() < 1500)
if(user)
to_chat(user, "The connected wire doesn't have enough current.")
- return
+ return 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)
@@ -36,22 +38,26 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
if(singulo.z == z)
singulo.target = src
icon_state = "[icontype]1"
- active = 1
+ active = TRUE
if(user)
to_chat(user, "You activate the beacon.")
+ 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, "You deactivate the beacon.")
GLOB.singularity_counter--
for(var/datum/round_event_control/meteor_wave/W in SSevents.control)
W.weight -= round(initial(W.weight) * METEOR_DISASTER_MODIFIER)
+ return TRUE
/obj/machinery/power/singularity_beacon/attack_ai(mob/user)
diff --git a/code/modules/events/meteor_wave.dm b/code/modules/events/meteor_wave.dm
index 6f01caa275..4584d1c2e9 100644
--- a/code/modules/events/meteor_wave.dm
+++ b/code/modules/events/meteor_wave.dm
@@ -57,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))
From 7b65343f45bb67f722521814084d02bdca75617c Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sun, 13 Oct 2019 06:04:57 +0200
Subject: [PATCH 5/6] z-level checks.
---
code/game/machinery/syndicatebeacon.dm | 34 +++++++++++++++++---------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 67c9627423..8a33241d46 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -17,13 +17,10 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
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
@@ -31,9 +28,8 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
if(user)
to_chat(user, "The connected wire doesn't have enough current.")
return 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)
+ if(is_station_level(z))
+ increment_meteor_waves()
for(var/obj/singularity/singulo in GLOB.singularities)
if(singulo.z == z)
singulo.target = src
@@ -43,7 +39,6 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
to_chat(user, "You activate the beacon.")
return TRUE
-
/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user)
if(!active)
return FALSE
@@ -54,16 +49,25 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
active = FALSE
if(user)
to_chat(user, "You deactivate the beacon.")
+ 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)
- return TRUE
-
/obj/machinery/power/singularity_beacon/attack_ai(mob/user)
return
-
/obj/machinery/power/singularity_beacon/attack_hand(mob/user)
. = ..()
if(.)
@@ -104,6 +108,12 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
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)
From c78078bdd41cc4bf32a628cdb04a06eb61a30529 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sun, 13 Oct 2019 06:08:53 +0200
Subject: [PATCH 6/6] typo
---
code/modules/events/meteor_wave.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/events/meteor_wave.dm b/code/modules/events/meteor_wave.dm
index 4584d1c2e9..c575c97901 100644
--- a/code/modules/events/meteor_wave.dm
+++ b/code/modules/events/meteor_wave.dm
@@ -57,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.[GLOB.singularity_counter ? " Warning: Anomalous gravity pulse detected, Syndicate technology interference likely.", ""]", "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))