From 5196109a2be0af28440465a5b45afc0eb3b986b3 Mon Sep 17 00:00:00 2001 From: Samman166 <67894653+Samman166@users.noreply.github.com> Date: Sun, 4 Dec 2022 18:49:20 -0330 Subject: [PATCH] Admin's Check antagonist panel now displays how many people are infected by white terrors (#19806) * begining * Dead infected no longer display as infected * Apply suggestions from code review Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> * Update code/modules/admin/player_panel.dm Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> * People revived with eggs will now be re-added to the infected count Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> --- code/modules/admin/player_panel.dm | 4 +++- .../hostile/terror_spiders/terror_spiders.dm | 1 + .../hostile/terror_spiders/white.dm | 20 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 4b5e077d9ff..46ed68bf5b6 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -510,13 +510,15 @@ var/count_eggs = 0 var/count_spiderlings = 0 + var/count_infected = 0 for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in GLOB.ts_egg_list) if(is_station_level(E.z)) count_eggs += E.spiderling_number for(var/obj/structure/spider/spiderling/terror_spiderling/L in GLOB.ts_spiderling_list) if(!L.stillborn && is_station_level(L.z)) count_spiderlings += 1 - dat += "
Growing TS on-station: [count_eggs] egg[count_eggs != 1 ? "s" : ""], [count_spiderlings] spiderling[count_spiderlings != 1 ? "s" : ""].
" + count_infected = length(GLOB.ts_infected_list) + dat += "
Growing TS on-station: [count_eggs] egg\s, [count_spiderlings] spiderling\s, [count_infected] infected
" if(SSticker.mode.ert.len) dat += check_role_table("ERT", SSticker.mode.ert) diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm index a3342163d84..e2c4bdbf0fa 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_spiders.dm @@ -7,6 +7,7 @@ GLOBAL_VAR_INIT(ts_death_window, 9000) // 15 minutes GLOBAL_LIST_EMPTY(ts_spiderlist) GLOBAL_LIST_EMPTY(ts_egg_list) GLOBAL_LIST_EMPTY(ts_spiderling_list) +GLOBAL_LIST_EMPTY(ts_infected_list) // -------------------------------------------------------------------------------- // --------------------- TERROR SPIDERS: DEFAULTS --------------------------------- diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/white.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/white.dm index 5b2e45466d5..cf848d94928 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/white.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/white.dm @@ -53,6 +53,26 @@ return 1 return 0 +/obj/item/organ/internal/body_egg/terror_eggs/Initialize(mapload) + . = ..() + GLOB.ts_infected_list += src + +/obj/item/organ/internal/body_egg/terror_eggs/insert(mob/living/carbon/M, special) + . = ..() + RegisterSignal(owner, COMSIG_MOB_STATCHANGE, PROC_REF(readd_infected)) + +/obj/item/organ/internal/body_egg/terror_eggs/proc/readd_infected(mob/infected, new_stat, old_stat) + SIGNAL_HANDLER + if(new_stat != DEAD) + GLOB.ts_infected_list |= src + +/obj/item/organ/internal/body_egg/terror_eggs/Destroy() + GLOB.ts_infected_list -= src + return ..() + +/obj/item/organ/internal/body_egg/terror_eggs/on_owner_death() + GLOB.ts_infected_list -= src + return ..() /obj/structure/spider/terrorweb/white name = "infested web"