Files
Yogstation/code/modules/events/disease_outbreak.dm
swissloaf 51fbb4059c Adds station traits: Small modifiers that can randomly be chosen each round (#11134)
* Station Traits

* Update positive_traits.dm

* Test

* Revert "Test"

This reverts commit c99e3e9db5.

* Update sound.dm

* Update code/datums/station_traits/positive_traits.dm

Co-authored-by: Redmoogle <dakotamew@gmail.com>

* Update code/__HELPERS/priority_announce.dm

Co-authored-by: Redmoogle <dakotamew@gmail.com>

* Update ai_laws.dm

* Update traits.dm

* Update neutral_traits.dm

* Update negative_traits.dm

* Negative bot trait

* Update negative_traits.dm

* Adds an admin log hpoefully

* Update station.dm

* Update station.dm

* Update station.dm

* Update station.dm

* Update station.dm

* Update station.dm

* Update station.dm

* Removes custom alert message for now

* Update station.dm

* Update game_mode.dm

* Update extended.dm

* Update game_mode.dm

* Update dynamic.dm

* Update dynamic.dm

* Update extended.dm

* Update game_mode.dm

* Update dynamic.dm

* Update game_mode.dm

* Update dynamic.dm

* Update extended.dm

* Revert "Update extended.dm"

This reverts commit 2235319bb3.

* Revert "Update dynamic.dm"

This reverts commit 6af1fbaf60.

* Revert "Update game_mode.dm"

This reverts commit dd84d504dc.

* Try again

* Update game_mode.dm

* Let's test making them more common

* Medbot update

* Update negative_traits.dm

* Update negative_traits.dm

* tHNE great f

* Update traits.dm

* Update job.dm

* Update negative_traits.dm

Co-authored-by: Redmoogle <dakotamew@gmail.com>
2021-04-10 12:17:08 +01:00

76 lines
2.6 KiB
Plaintext

/datum/round_event_control/disease_outbreak
name = "Disease Outbreak"
typepath = /datum/round_event/disease_outbreak
max_occurrences = 1
min_players = 10
weight = 5
/datum/round_event/disease_outbreak
announceWhen = 15
var/virus_type
var/max_severity = 3
/datum/round_event/disease_outbreak/announce(fake)
priority_announce("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", ANNOUNCER_OUTBREAK7)
/datum/round_event/disease_outbreak/setup()
announceWhen = rand(15, 30)
/datum/round_event/disease_outbreak/start()
var/advanced_virus = FALSE
max_severity = 3 + max(FLOOR((world.time - control.earliest_start)/6000, 1),0) //3 symptoms at 20 minutes, plus 1 per 10 minutes
if(prob(20 + (10 * max_severity)))
advanced_virus = TRUE
if(!virus_type && !advanced_virus)
virus_type = pick(/datum/disease/dnaspread, /datum/disease/advance/flu, /datum/disease/advance/cold, /datum/disease/sleepy, /datum/disease/brainrot, /datum/disease/magnitis, /datum/disease/jitters)
for(var/mob/living/carbon/human/H in shuffle(GLOB.alive_mob_list))
var/turf/T = get_turf(H)
if(!T)
continue
if(!is_station_level(T.z))
continue
if(!H.client)
continue
if(H.stat == DEAD)
continue
if(HAS_TRAIT(H, TRAIT_VIRUSIMMUNE)) //Don't pick someone who's virus immune, only for it to not do anything.
continue
var/foundAlready = FALSE // don't infect someone that already has a disease
for(var/thing in H.diseases)
foundAlready = TRUE
break
if(foundAlready)
continue
var/datum/disease/D
if(!advanced_virus)
if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work.
if(!H.dna || (HAS_TRAIT(H, TRAIT_BLIND))) //A blindness disease would be the worst.
continue
D = new virus_type()
var/datum/disease/dnaspread/DS = D
DS.strain_data["name"] = H.real_name
DS.strain_data["UI"] = H.dna.uni_identity
DS.strain_data["SE"] = H.dna.mutation_index
else
D = new virus_type()
else
D = new /datum/disease/advance/random(max_severity, max_severity)
D.carrier = TRUE
H.ForceContractDisease(D, FALSE, TRUE)
if(advanced_virus)
var/datum/disease/advance/A = D
var/list/name_symptoms = list() //for feedback
for(var/datum/symptom/S in A.symptoms)
name_symptoms += S.name
message_admins("An event has triggered a random advanced virus outbreak on [ADMIN_LOOKUPFLW(H)]! It has these symptoms: [english_list(name_symptoms)]")
log_game("An event has triggered a random advanced virus outbreak on [key_name(H)]! It has these symptoms: [english_list(name_symptoms)]")
break