mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Ports TG Fake virus event (#20573)
* Ports TG Fake virus event * weight and comments * GDN review * Splitting into four different fake viruses * Apply suggestions from code review Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * Update code/__DEFINES/status_effects.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * Sirryan review * Apply suggestions from code review Co-authored-by: Farie82 <farie82@users.noreply.github.com> * create_log for the fake virus * using lists inside of lists * Apply suggestions from code review Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Farie82 <farie82@users.noreply.github.com> * farie review * Checking fake_emote length --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: Farie82 <farie82@users.noreply.github.com>
This commit is contained in:
@@ -140,6 +140,7 @@ GLOBAL_LIST_EMPTY(event_last_fired)
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Sentience", /datum/event/sentience, 50),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 0, list(ASSIGNMENT_ENGINEER = 30, ASSIGNMENT_GARDENER = 50)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Koi School", /datum/event/carp_migration/koi, 80),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Fake Virus", /datum/event/fake_virus, 50),
|
||||
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Disease Outbreak", /datum/event/disease_outbreak, 50, list(ASSIGNMENT_MEDICAL = 25), TRUE)
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/datum/event/fake_virus/start()
|
||||
var/list/fake_virus_victims = list()
|
||||
for(var/mob/living/carbon/human/victim in shuffle(GLOB.player_list))
|
||||
if(victim.stat == DEAD || victim.InCritical() || victim.mind?.assigned_role == victim.mind?.special_role || victim.mind?.offstation_role)
|
||||
continue
|
||||
fake_virus_victims += 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, "<span class='warning'>[pick("Your head hurts.", "Your head pounds.")]</span>"), 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
|
||||
Reference in New Issue
Block a user