Skip to content

Commit

Permalink
Pylon tweaks (#4571)
Browse files Browse the repository at this point in the history
# 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
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# 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:
  • Loading branch information
morrowwolf authored Oct 4, 2023
1 parent bc59287 commit 8713e57
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions code/game/machinery/telecomms/presets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/cm_aliens/structures/special/pylon_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 8713e57

Please sign in to comment.