From 931c36fcfbea54e61e49305cc2d0aba2a3ac8699 Mon Sep 17 00:00:00 2001
From: Henri215 <77684085+Henri215@users.noreply.github.com>
Date: Sun, 1 Oct 2023 07:43:08 -0300
Subject: [PATCH] Some fake virus tweaks (#22591)
* Some fake virus tweaks
* renaming some vars
---
code/datums/status_effects/debuffs.dm | 17 ++++++++--
code/modules/events/fake_virus.dm | 47 +++++++++++++++------------
2 files changed, 41 insertions(+), 23 deletions(-)
diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm
index 01dd5d8f3de..757095315be 100644
--- a/code/datums/status_effects/debuffs.dm
+++ b/code/datums/status_effects/debuffs.dm
@@ -848,6 +848,7 @@
#define FAKE_FOOD_POISONING 2
#define FAKE_RETRO_VIRUS 3
#define FAKE_TURBERCULOSIS 4
+#define FAKE_BRAINROT 5
/datum/status_effect/fake_virus
id = "fake_virus"
@@ -865,7 +866,7 @@
var/list/fake_emote
/datum/status_effect/fake_virus/on_creation()
- current_fake_disease = pick(FAKE_COLD, FAKE_FOOD_POISONING, FAKE_RETRO_VIRUS, FAKE_TURBERCULOSIS)
+ current_fake_disease = pick(FAKE_COLD, FAKE_FOOD_POISONING, FAKE_RETRO_VIRUS, FAKE_TURBERCULOSIS, FAKE_BRAINROT)
switch(current_fake_disease)
if(FAKE_COLD)
fake_msg = list(
@@ -900,7 +901,7 @@
list(),
list()
)
- else
+ if(FAKE_TURBERCULOSIS)
fake_msg = list(
list("Your chest hurts.", "Your stomach violently rumbles!", "You feel a cold sweat form."),
list("You feel a sharp pain from your lower chest!", "You feel air escape from your lungs painfully."),
@@ -911,6 +912,17 @@
list("gasp"),
list()
)
+ else // FAKE_BRAINROT
+ fake_msg = list(
+ list("You don't feel like yourself."),
+ list("Your try to remember something important...but can't."),
+ list("Strange buzzing fills your head, removing all thoughts.")
+ )
+ fake_emote = list(
+ list("blink", "yawn"),
+ list("stare", "drool"),
+ list("stare", "drool")
+ )
. = ..()
/datum/status_effect/fake_virus/tick()
@@ -946,6 +958,7 @@
#undef FAKE_FOOD_POISONING
#undef FAKE_RETRO_VIRUS
#undef FAKE_TURBERCULOSIS
+#undef FAKE_BRAINROT
/datum/status_effect/cryo_beam
id = "cryo beam"
diff --git a/code/modules/events/fake_virus.dm b/code/modules/events/fake_virus.dm
index 36061e293b0..d8f33867b4b 100644
--- a/code/modules/events/fake_virus.dm
+++ b/code/modules/events/fake_virus.dm
@@ -1,28 +1,33 @@
/datum/event/fake_virus/start()
- var/list/fake_virus_victims = list()
+ var/list/valid_targets = list()
for(var/mob/living/carbon/human/victim in shuffle(GLOB.player_list))
if(HAS_TRAIT(victim, TRAIT_VIRUSIMMUNE))
continue
if(victim.stat == DEAD || victim.InCritical() || victim.mind?.assigned_role == victim.mind?.special_role || victim.mind?.offstation_role)
continue
- fake_virus_victims += victim
+ valid_targets += victim
- //first we do hard status effect victims
- var/defacto_min = min(3, length(fake_virus_victims))
- if(defacto_min) // event will hit 1-3 people by default, but will do 1-2 or just 1 if only those many candidates are available
- for(var/i in 1 to rand(1, defacto_min))
- var/mob/living/carbon/human/hypochondriac = pick(fake_virus_victims)
- hypochondriac.apply_status_effect(STATUS_EFFECT_FAKE_VIRUS)
- hypochondriac.create_log(MISC_LOG, "[hypochondriac] has contracted a fake virus.")
- fake_virus_victims -= hypochondriac
- notify_ghosts("[hypochondriac] now has a fake virus!")
- //then we do light one-message victims who simply cough or whatever once (have to repeat the process since the last operation modified our candidates list)
- defacto_min = min(5, length(fake_virus_victims))
- if(defacto_min)
- for(var/i in 1 to rand(1, defacto_min))
- var/mob/living/carbon/human/onecoughman = pick(fake_virus_victims)
- if(prob(25)) //1/4 odds to get a spooky message instead of coughing out loud
- addtimer(CALLBACK(GLOBAL_PROC, PROC_REF(to_chat), onecoughman, "[pick("Your head hurts.", "Your head pounds.")]"), rand(30, 150))
- else
- addtimer(CALLBACK(onecoughman, TYPE_PROC_REF(/mob/, emote), pick("cough", "sniff", "sneeze")), rand(30, 150)) //deliver the message with a slightly randomized time interval so there arent multiple people coughing at the exact same time
- fake_virus_victims -= onecoughman
+ if(!length(valid_targets))
+ return
+
+ // First we do hard status effect victims
+ var/fake_virus_victims = max(1, 0.05 * length(valid_targets)) // Event will affect 5% of valid crewmembers
+ for(var/i in 1 to rand(1, fake_virus_victims))
+ var/mob/living/carbon/human/hypochondriac = pick(valid_targets)
+ hypochondriac.apply_status_effect(STATUS_EFFECT_FAKE_VIRUS)
+ hypochondriac.create_log(MISC_LOG, "[hypochondriac] has contracted a fake virus.")
+ valid_targets -= hypochondriac
+ notify_ghosts("[hypochondriac] now has a fake virus!")
+
+ if(!length(valid_targets)) // List has been modified, lets check again
+ return
+
+ // Then we do light one-message victims who simply cough or whatever once (have to repeat the process since the last operation modified our candidates list)
+ fake_virus_victims = max(1, 0.1 * length(valid_targets)) // 10% of the victims remaining
+ for(var/i in 1 to rand(1, fake_virus_victims))
+ var/mob/living/carbon/human/one_cough_man = pick(valid_targets)
+ if(prob(25)) // 1/4 odds to get a spooky message instead of coughing out loud
+ addtimer(CALLBACK(GLOBAL_PROC, PROC_REF(to_chat), one_cough_man, "[pick("Your head hurts.", "Your head pounds.")]"), rand(1, 120) SECONDS)
+ else
+ addtimer(CALLBACK(one_cough_man, TYPE_PROC_REF(/mob/, emote), pick("cough", "sniff", "sneeze", "yawn")), rand(1, 120) SECONDS) // Deliver the message with a randomized time interval so there arent multiple people coughing at the same time
+ valid_targets -= one_cough_man