diff --git a/code/__defines/diseases.dm b/code/__defines/diseases.dm index 3543cd2e9a9..6a00e8faf14 100644 --- a/code/__defines/diseases.dm +++ b/code/__defines/diseases.dm @@ -42,6 +42,7 @@ #define DISCOVERED 0x80 /// If applied, this virus will show up on medical HUDs. Automatically set when it reaches mid-stage. #define DORMANT 0x100 /// If applied, the virus is dormant and will not act or spread. #define FALTERED 0x200 /// If applied, the virus is faltered and will only spread by intentional injection. +#define IMMUTABLE 0x400 /// If applied, the virus will not mutate in any kind of way. #define EXTRAPOLATOR_RESULT_DISEASES "extrapolator_result_disease" #define EXTRAPOLATOR_RESULT_ACT_PRIORITY "extrapolator_result_action_priority" diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index 5e55da014bb..34ac0c09292 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -35,6 +35,7 @@ GLOBAL_LIST_INIT(diseases, subtypesof(/datum/disease)) var/danger = DISEASE_MINOR var/list/required_organs = list() var/list/strain_data = list() + var/initial = TRUE /datum/disease/Destroy() affected_mob = null diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index b2fd25b14f7..5e3e506c984 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -31,6 +31,11 @@ GLOBAL_LIST_INIT(advance_cures, list( var/transmission var/severity var/speed + + var/mutability = 1 + var/keepid = FALSE + var/archivecure + var/list/symptoms = list() var/s_processing = FALSE @@ -99,6 +104,8 @@ GLOBAL_LIST_INIT(advance_cures, list( A.transmission = transmission A.severity = severity A.speed = speed + A.mutability = mutability + A.keepid = keepid A.id = id A.Refresh() return A @@ -164,7 +171,13 @@ GLOBAL_LIST_INIT(advance_cures, list( /datum/disease/advance/proc/Refresh(new_name = FALSE, archive = FALSE) GenerateProperties() AssignProperties() - id = null + if(s_processing && length(symptoms)) + for(var/datum/symptom/S in symptoms) + S.Start(src) + S.OnStageChange(src) + + if(!keepid) + id = null if(!GLOB.archive_diseases[GetDiseaseID()]) if(new_name) @@ -273,13 +286,24 @@ GLOBAL_LIST_INIT(advance_cures, list( danger = "Unknown" /datum/disease/advance/proc/GenerateCure() - var/res = clamp(resistance - (length(symptoms) / 2), 1, length(GLOB.advance_cures)) - cures = list(pick(GLOB.advance_cures[res])) - cure_text = cures[1] + if(GLOB.archive_diseases[id]) + var/datum/disease/advance/archived = GLOB.archive_diseases[id] + cures = archived.cures + cure_text = archived.cure_text + else + var/res = clamp(resistance - (length(symptoms) / 2), 1, length(GLOB.advance_cures)) + cures = list(pick(GLOB.advance_cures[res])) + var/datum/reagent/cure_reag = SSchemistry.chemical_reagents[cures[1]] + if(!cure_reag) // Something went terribly wrong, return to sippy + cure_reag = /datum/reagent/water + cure_text = cure_reag.name + archivecure = res return // Randomly generate a symptom, has a chance to lose or gain a symptom. -/datum/disease/advance/proc/Evolve(min_level, max_level) +/datum/disease/advance/proc/Evolve(min_level, max_level, ignore_mutable = FALSE) + if(!global_flag_check(virus_modifiers, IMMUTABLE) && !ignore_mutable) + return var/s = safepick(GenerateSymptoms(min_level, max_level, 1)) if(s) AddSymptom(s) @@ -287,7 +311,9 @@ GLOBAL_LIST_INIT(advance_cures, list( return // Randomly generates a symptom from a given list, has a chance to lose or gain a symptom. -/datum/disease/advance/proc/PickyEvolve(var/list/datum/symptom/D) +/datum/disease/advance/proc/PickyEvolve(var/list/datum/symptom/D, ignore_mutable) + if(!global_flag_check(virus_modifiers, IMMUTABLE) && !ignore_mutable) + return var/s = safepick(D) if(s) AddSymptom(new s) @@ -295,7 +321,9 @@ GLOBAL_LIST_INIT(advance_cures, list( return // Randomly remove a symptom. -/datum/disease/advance/proc/Devolve() +/datum/disease/advance/proc/Devolve(ignore_mutable = FALSE) + if(!global_flag_check(virus_modifiers, IMMUTABLE) && !ignore_mutable) + return if(length(symptoms) > 1) var/s = safepick(symptoms) if(s) @@ -304,7 +332,9 @@ GLOBAL_LIST_INIT(advance_cures, list( return // Randomly neuter a symptom. -/datum/disease/advance/proc/Neuter() +/datum/disease/advance/proc/Neuter(ignore_mutable = FALSE) + if(!global_flag_check(virus_modifiers, IMMUTABLE) && !ignore_mutable) + return if(symptoms.len) var/s = safepick(symptoms) if(s) @@ -412,6 +442,8 @@ GLOBAL_LIST_INIT(advance_cures, list( var/list/diseases = list() for(var/datum/disease/advance/A in D_list) + if(!global_flag_check(A.virus_modifiers, IMMUTABLE)) + return diseases += A.Copy() if(!length(diseases)) @@ -507,6 +539,18 @@ GLOBAL_LIST_INIT(advance_cures, list( /datum/disease/advance/infect(var/mob/living/infectee, make_copy = TRUE) var/datum/disease/advance/A = make_copy ? Copy() : src + if(!initial && global_flag_check(A.virus_modifiers, IMMUTABLE) && (spread_flags & DISEASE_SPREAD_FLUIDS)) + var/minimum = 1 + if(prob(clamp(35-(A.resistance + A.stealth - A.speed), 0, 50) * (A.mutability))) + if(infectee.job == JOB_CLOWN || infectee.job == JOB_MIME || prob(1)) + minimum = 0 + else + minimum = clamp(A.severity - 1, 1, 7) + A.Evolve(minimum, clamp(A.severity + 4, minimum, 9)) + A.id = GetDiseaseID() + A.keepid = TRUE + else + A.initial = FALSE infectee.addDisease(A) A.affected_mob = infectee GLOB.active_diseases += A diff --git a/code/datums/diseases/advance/disease_preset.dm b/code/datums/diseases/advance/disease_preset.dm index 84f1e851158..386dfd3d465 100644 --- a/code/datums/diseases/advance/disease_preset.dm +++ b/code/datums/diseases/advance/disease_preset.dm @@ -6,7 +6,7 @@ /datum/disease/advance/random/minor max_symptoms_override = 4 -/datum/disease/advance/random/New(max_symptoms, max_level = 6, min_level = 1, list/guaranteed_symptoms = setsymptom, var/atom/infected) +/datum/disease/advance/random/New(max_symptoms, max_level = 6, min_level = 1, list/guaranteed_symptoms = setsymptom, var/atom/infected, mute = TRUE) if(!max_symptoms) max_symptoms = (2 + rand(1, (VIRUS_SYMPTOM_LIMIT - 2))) if(max_symptoms_override) @@ -33,6 +33,8 @@ symptoms += new chosen_symptom for(var/guaranteed_symptom in guaranteed_symptoms) symptoms += new guaranteed_symptom + if(!mute) + virus_modifiers |= IMMUTABLE Finalize() if(randomname) diff --git a/code/datums/diseases/advance/symptoms/mlem.dm b/code/datums/diseases/advance/symptoms/mlem.dm index ef38119cd48..39e511e04f5 100644 --- a/code/datums/diseases/advance/symptoms/mlem.dm +++ b/code/datums/diseases/advance/symptoms/mlem.dm @@ -61,7 +61,7 @@ BONUS M.emote("mlem") if(power >= 1.5) M.emote("mlem") - if(power >= 2) + if(resistance >= 5) M.emote("mlem") addtimer(CALLBACK(M, TYPE_PROC_REF(/mob, emote), "mlem"), 2 SECONDS) addtimer(CALLBACK(M, TYPE_PROC_REF(/mob, emote), "mlem"), 5 SECONDS) diff --git a/code/datums/diseases/advance/symptoms/narcolepsy.dm b/code/datums/diseases/advance/symptoms/narcolepsy.dm index 6bb3c458b3d..0488feeb3e1 100644 --- a/code/datums/diseases/advance/symptoms/narcolepsy.dm +++ b/code/datums/diseases/advance/symptoms/narcolepsy.dm @@ -15,6 +15,7 @@ Bonus /datum/symptom/narcolepsy name = "Narcolepsy" + desc = "The virus causes a hormone imbalance, making the host sleepy and narcoleptic." stealth = 1 resistance = -1 stage_speed = -2 diff --git a/code/datums/diseases/advance/symptoms/robot.dm b/code/datums/diseases/advance/symptoms/robot.dm index 182026401a8..fa244535325 100644 --- a/code/datums/diseases/advance/symptoms/robot.dm +++ b/code/datums/diseases/advance/symptoms/robot.dm @@ -124,7 +124,7 @@ return FALSE if(O) O.robotize() - H.visible_message(span_danger("[H]'s \the [O] shifts, and becomes metal before your very eyes."), span_userdanger("Your \the [O] feels numb, and cold.")) + H.visible_message(span_danger("[H]'s [O] shifts, and becomes metal before your very eyes."), span_userdanger("Your [O] feels numb, and cold.")) return TRUE return FALSE diff --git a/code/game/machinery/pandemic.dm b/code/game/machinery/pandemic.dm index 7b37a5d7296..4b4e20d023c 100644 --- a/code/game/machinery/pandemic.dm +++ b/code/game/machinery/pandemic.dm @@ -236,7 +236,7 @@ traits["stealth"] = adv_disease.stealth traits["stage_speed"] = adv_disease.stage_rate traits["transmission"] = adv_disease.transmission - traits["symptom_severity"] = adv_disease.severity + traits["severity"] = adv_disease.severity traits["index"] = index++ traits["agent"] = disease.agent diff --git a/tgui/packages/tgui/interfaces/Pandemic/Virus.tsx b/tgui/packages/tgui/interfaces/Pandemic/Virus.tsx index f722d4a0104..fe7590f3c9d 100644 --- a/tgui/packages/tgui/interfaces/Pandemic/Virus.tsx +++ b/tgui/packages/tgui/interfaces/Pandemic/Virus.tsx @@ -68,12 +68,17 @@ const Info = (props) => { const Traits = (props) => { const { - virus: { resistance, stage_speed, stealth, transmission }, + virus: { resistance, stage_speed, stealth, transmission, severity }, } = props; return (
+ + + {severity} + + {resistance} diff --git a/tgui/packages/tgui/interfaces/Pandemic/types.ts b/tgui/packages/tgui/interfaces/Pandemic/types.ts index e289a376e2e..7ff1d3d531a 100644 --- a/tgui/packages/tgui/interfaces/Pandemic/types.ts +++ b/tgui/packages/tgui/interfaces/Pandemic/types.ts @@ -39,6 +39,7 @@ type Virus = { description: string; spread: string; cure: string; + severity: number; }; type Symptom = {