Virology Patch (#19081)

* Fixes

* Change

* Please linter I'll behave :(
This commit is contained in:
Guti
2026-01-23 13:00:45 -08:00
committed by GitHub
parent 51157d43aa
commit 76cf9eee20
10 changed files with 68 additions and 13 deletions
+1
View File
@@ -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"
+1
View File
@@ -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
+52 -8
View File
@@ -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
@@ -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)
@@ -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)
@@ -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
@@ -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
+1 -1
View File
@@ -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
@@ -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 (
<Section title="Statistics">
<LabeledList>
<Tooltip content="Decides the slot where it is placed.">
<LabeledList.Item color={getColor(severity)} label="Severity">
{severity}
</LabeledList.Item>
</Tooltip>
<Tooltip content="Decides the cure complexity.">
<LabeledList.Item color={getColor(resistance)} label="Resistance">
{resistance}
@@ -39,6 +39,7 @@ type Virus = {
description: string;
spread: string;
cure: string;
severity: number;
};
type Symptom = {