From 8713e576c145e2919664a4afd18839c7debfec21 Mon Sep 17 00:00:00 2001 From: morrowwolf Date: Tue, 3 Oct 2023 21:33:55 -0400 Subject: [PATCH] Pylon tweaks (#4571) # About the pull request Comms relays now have a cooldown for how often they can get pylon'd. Once it gets destroyed you have to wait five minutes to turn a cluster into a pylon again. (Which then takes five minutes to get a benefit at all) Pylon bonus cap now accounts for stored larva. # Explain why it's good for the game Constantly spamming pylons was pretty frustrating and the pylon bonus cap just had an oversight with not counting stored larva. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: Morrow balance: Comms relays now have a five minute cooldown to be re-pylon'd after a pylon was destroyed fix: Pylons now account for stored larva /:cl: --- code/__DEFINES/xeno.dm | 4 ++++ code/game/machinery/telecomms/presets.dm | 14 ++++++++++++++ .../cm_aliens/structures/special/pylon_core.dm | 6 ++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/xeno.dm b/code/__DEFINES/xeno.dm index b178f0692dd6..a0a4c927d3d9 100644 --- a/code/__DEFINES/xeno.dm +++ b/code/__DEFINES/xeno.dm @@ -174,6 +174,10 @@ /// The time it takes for a pylon to give one larva while activated #define XENO_PYLON_ACTIVATION_COOLDOWN (5 MINUTES) +/// The time until you can re-corrupt a comms relay after the last pylon was destroyed +#define XENO_PYLON_DESTRUCTION_DELAY (5 MINUTES) + + /// The time against away_timer when an AFK xeno larva can be replaced #define XENO_LEAVE_TIMER_LARVA 80 //80 seconds /// The time against away_timer when an AFK xeno (not larva) can be replaced diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index b327bd6fdf26..5f26e9d5ed25 100644 --- a/code/game/machinery/telecomms/presets.dm +++ b/code/game/machinery/telecomms/presets.dm @@ -218,12 +218,20 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) /// Held image for the current overlay on the tower from xeno corruption var/image/corruption_image + /// Holds the delay for when a cluster can recorrupt the comms tower after a pylon has been destroyed + COOLDOWN_DECLARE(corruption_delay) + /obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/Initialize() . = ..() RegisterSignal(src, COMSIG_ATOM_TURF_CHANGE, PROC_REF(register_with_turf)) register_with_turf() +/obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/get_examine_text(mob/user) + . = ..() + if(isxeno(user) && !COOLDOWN_FINISHED(src, corruption_delay)) + . += SPAN_XENO("Corruption cooldown: [(COOLDOWN_TIMELEFT(src, corruption_delay) / (1 SECONDS))] seconds.") + /obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/attack_hand(mob/user) if(user.action_busy) return @@ -323,6 +331,10 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) addtimer(CALLBACK(src, PROC_REF(handle_xeno_acquisition), weeded_turf), (XENO_COMM_ACQUISITION_TIME - ROUND_TIME)) return + if(!COOLDOWN_FINISHED(src, corruption_delay)) + addtimer(CALLBACK(src, PROC_REF(handle_xeno_acquisition), weeded_turf), (COOLDOWN_TIMELEFT(src, corruption_delay))) + return + var/obj/effect/alien/weeds/node/pylon/cluster/parent_node = weeded_turf.weeds.parent var/obj/effect/alien/resin/special/cluster/cluster_parent = parent_node.resin_parent @@ -362,6 +374,8 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) overlays -= corruption_image + COOLDOWN_START(src, corruption_delay, XENO_PYLON_DESTRUCTION_DELAY) + /// Handles moving the overlay from growing to idle /obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/proc/switch_to_idle_corruption() if(!corrupted) diff --git a/code/modules/cm_aliens/structures/special/pylon_core.dm b/code/modules/cm_aliens/structures/special/pylon_core.dm index 4eff0240939d..96ded23c8ac7 100644 --- a/code/modules/cm_aliens/structures/special/pylon_core.dm +++ b/code/modules/cm_aliens/structures/special/pylon_core.dm @@ -196,10 +196,12 @@ if(!xeno.counts_for_slots) hive_xenos -= xeno - if(length(hive_xenos) > (length(GLOB.alive_human_list) * ENDGAME_LARVA_CAP_MULTIPLIER)) + var/real_total_xeno_count = length(hive_xenos) + linked_hive.stored_larva + + if(real_total_xeno_count > (length(GLOB.alive_human_list) * ENDGAME_LARVA_CAP_MULTIPLIER)) return - linked_hive.partial_larva += length(hive_xenos) * LARVA_ADDITION_MULTIPLIER + linked_hive.partial_larva += real_total_xeno_count * LARVA_ADDITION_MULTIPLIER linked_hive.convert_partial_larva_to_full_larva() linked_hive.hive_ui.update_burrowed_larva()