From 9ab117a1a3bb19f5e45c6a081dc4325eeebc027c Mon Sep 17 00:00:00 2001 From: DGamerL <108773801+DGamerL@users.noreply.github.com> Date: Sat, 23 Nov 2024 14:51:53 +0100 Subject: [PATCH] Recounts `rise_number` and related variables every once in a while (#27393) * Recounts cultists every once in a while * Update code/modules/antagonists/cult/team_cult.dm Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * Remove old check --------- Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> --- code/modules/antagonists/cult/team_cult.dm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/modules/antagonists/cult/team_cult.dm b/code/modules/antagonists/cult/team_cult.dm index 8bf7e68cb7b..7301d9abb9a 100644 --- a/code/modules/antagonists/cult/team_cult.dm +++ b/code/modules/antagonists/cult/team_cult.dm @@ -31,14 +31,23 @@ RESTRICT_TYPE(/datum/team/cult) /// Boolean that prevents all_members_timer from being called multiple times var/is_in_transition = FALSE + /// Timer until we do a recount of cultist members + var/recount_timer + +/datum/team/cult/New(list/starting_members) + . = ..() + recount_timer = addtimer(CALLBACK(src, PROC_REF(cult_threshold_check)), 5 MINUTES, TIMER_STOPPABLE|TIMER_DELETE_ME|TIMER_LOOP) + +/datum/team/cult/Destroy(force, ...) + deltimer(recount_timer) + return ..() + /datum/team/cult/create_team(list/starting_members) cult_threshold_check() // Set this ALWAYS before any check_cult_size check, or . = ..() objective_holder.add_objective(/datum/objective/servecult) - addtimer(CALLBACK(src, PROC_REF(cult_threshold_check)), 2 MINUTES) // Check again in 2 minutes for latejoiners - cult_status = NARSIE_DEMANDS_SACRIFICE create_next_sacrifice()