Skip to content

Commit 2f1b0e2

Browse files
authored
Cleanup Diseases, change to Pathogens (#1119)
* cleanup pt1 * cleanup2 * cleanup 3 * cleanup3 * cleanup4 * cleanup5 * cleanup6 * remove sentient disease * disease -> pathogen * redo mob hooks * on_add -> on_infect_mob * small blood.dm work * forgot * GetDiseaseID -> get_id * begin unfucking advance viruses * minor cleanup * FIX * properties macroing * clean up processing * disease -> pathogen pt 2 * disease_flags -> pathogen_flags * cleanup vars
1 parent cc4d4ba commit 2f1b0e2

File tree

125 files changed

+1703
-2816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1703
-2816
lines changed

code/__DEFINES/atom_hud.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define DIAG_PATH_HUD "16"
3737
/// Gland indicators for abductors
3838
#define GLAND_HUD "17"
39-
#define SENTIENT_DISEASE_HUD "18"
39+
#define SENTIENT_PATHOGEN_HUD "18"
4040
#define AI_DETECT_HUD "19"
4141
/// Displays launchpads' targeting reticle
4242
#define DIAG_LAUNCHPAD_HUD "22"

code/__DEFINES/diseases.dm

-36
This file was deleted.

code/__DEFINES/pathogen_defines.dm

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
#define PATHOGEN_LIMIT 1
3+
#define VIRUS_SYMPTOM_LIMIT 6
4+
5+
//Visibility Flags
6+
#define HIDDEN_SCANNER (1<<0)
7+
#define HIDDEN_PANDEMIC (1<<1)
8+
9+
//Disease Flags
10+
/// If present, the disease can be cured either randomly over time or reagents.
11+
#define PATHOGEN_CURABLE (1<<0)
12+
/// If present, when the disease is cured, it will be added to the mob's resistances.
13+
#define PATHOGEN_RESIST_ON_CURE (1<<2)
14+
/// If present, an affected mob will need every reagent in the cure list to be cured.
15+
#define PATHOGEN_NEED_ALL_CURES (1<<3)
16+
/// A disease will need to regress to stage 1 to cure itself
17+
#define PATHOGEN_REGRESS_TO_CURE (1<<4)
18+
19+
//Disease Spread Flags
20+
#define PATHOGEN_SPREAD_SPECIAL (1<<0)
21+
#define PATHOGEN_SPREAD_NON_CONTAGIOUS (1<<1)
22+
#define PATHOGEN_SPREAD_BLOOD (1<<2)
23+
#define PATHOGEN_SPREAD_CONTACT_FLUIDS (1<<3)
24+
#define PATHOGEN_SPREAD_CONTACT_SKIN (1<<4)
25+
#define PATHOGEN_SPREAD_AIRBORNE (1<<5)
26+
27+
//Disease properties
28+
#define PATHOGEN_PROP_RESISTANCE "resistance"
29+
#define PATHOGEN_PROP_STEALTH "stealth"
30+
#define PATHOGEN_PROP_STAGE_RATE "stage_rate"
31+
#define PATHOGEN_PROP_TRANSMITTABLE "transmittable"
32+
#define PATHOGEN_PROP_SEVERITY "severity"
33+
34+
//Severity Defines
35+
/// Diseases that buff, heal, or at least do nothing at all
36+
#define PATHOGEN_SEVERITY_POSITIVE "Positive"
37+
/// Diseases that may have annoying effects, but nothing disruptive (sneezing)
38+
#define PATHOGEN_SEVERITY_NONTHREAT "Harmless"
39+
/// Diseases that can annoy in concrete ways (dizziness)
40+
#define PATHOGEN_SEVERITY_MINOR "Minor"
41+
/// Diseases that can do minor harm, or severe annoyance (vomit)
42+
#define PATHOGEN_SEVERITY_MEDIUM "Medium"
43+
/// Diseases that can do significant harm, or severe disruption (brainrot)
44+
#define PATHOGEN_SEVERITY_HARMFUL "Harmful"
45+
/// Diseases that can kill or maim if left untreated (flesh eating, blindness)
46+
#define PATHOGEN_SEVERITY_DANGEROUS "Dangerous"
47+
/// Diseases that can quickly kill an unprepared victim (fungal tb, gbs)
48+
#define PATHOGEN_SEVERITY_BIOHAZARD "BIOHAZARD"

code/__DEFINES/traits.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
713713
#define FLIGHTPOTION_TRAIT "flightpotion"
714714
/// Trait inherited by experimental surgeries
715715
#define EXPERIMENTAL_SURGERY_TRAIT "experimental_surgery"
716-
#define DISEASE_TRAIT "disease"
716+
#define PATHOGEN_TRAIT "disease"
717717
#define SPECIES_TRAIT "species"
718718
#define ORGAN_TRAIT "organ"
719719
/// cannot be removed without admin intervention

code/__HELPERS/cmp.dm

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ GLOBAL_VAR_INIT(cmp_field, "name")
9595
else
9696
return A.layer - B.layer
9797

98-
/proc/cmp_advdisease_resistance_asc(datum/disease/advance/A, datum/disease/advance/B)
99-
return A.totalResistance() - B.totalResistance()
98+
/proc/cmp_advdisease_resistance_asc(datum/pathogen/advance/A, datum/pathogen/advance/B)
99+
return A.properties[PATHOGEN_PROP_RESISTANCE] - B.properties[PATHOGEN_PROP_RESISTANCE]
100100

101101
/proc/cmp_quirk_asc(datum/quirk/A, datum/quirk/B)
102102
var/a_sign = SIGN(initial(A.quirk_genre) * -1)

code/_globalvars/bitfields.dm

+5-4
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ DEFINE_BITFIELD(datum_flags, list(
101101
"DF_USE_TAG" = DF_USE_TAG,
102102
))
103103

104-
DEFINE_BITFIELD(disease_flags, list(
105-
"CAN_CARRY" = CAN_CARRY,
106-
"CAN_RESIST" = CAN_RESIST,
107-
"CURABLE" = CURABLE,
104+
DEFINE_BITFIELD(pathogen_flags, list(
105+
"PATHOGEN_RESIST_ON_CURE" = PATHOGEN_RESIST_ON_CURE,
106+
"PATHOGEN_CURABLE" = PATHOGEN_CURABLE,
107+
"PATHOGEN_NEED_ALL_CURES" = PATHOGEN_NEED_ALL_CURES,
108+
"PATHOGEN_REGRESS_TO_CURE" = PATHOGEN_REGRESS_TO_CURE
108109
))
109110

110111
DEFINE_BITFIELD(flags_1, list(

code/controllers/subsystem/disease.dm

-31
This file was deleted.
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
SUBSYSTEM_DEF(pathogens)
2+
name = "Pathogens"
3+
flags = SS_NO_FIRE
4+
5+
/// A list of every symptom type.
6+
var/list/symptom_types
7+
8+
/// A copy of every pathogen type by ID.
9+
var/list/archive_pathogens = list()
10+
11+
/// A list of every pathogen instance currently inhabiting a mob.
12+
var/list/active_pathogens = list()
13+
14+
/datum/controller/subsystem/pathogens/PreInit()
15+
symptom_types = subtypesof(/datum/symptom)
16+
17+
/datum/controller/subsystem/pathogens/Initialize(timeofday)
18+
var/list/all_common_pathogens = subtypesof(/datum/pathogen) - typesof(/datum/pathogen/advance)
19+
for(var/common_pathogen_type in all_common_pathogens)
20+
var/datum/pathogen/prototype = new common_pathogen_type()
21+
archive_pathogens[prototype.get_id()] = prototype
22+
return ..()
23+
24+
/datum/controller/subsystem/pathogens/stat_entry(msg)
25+
msg = "# Diseases:[length(active_pathogens)]"
26+
return ..()
27+
28+
/datum/controller/subsystem/pathogens/proc/get_disease_name(id)
29+
var/datum/pathogen/advance/A = archive_pathogens[id]
30+
if(A.name)
31+
return A.name
32+
else
33+
return "Unknown"

code/datums/components/infective.dm

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/datum/component/infective
2-
var/list/datum/disease/diseases //make sure these are the static, non-processing versions!
2+
var/list/datum/pathogen/diseases //make sure these are the static, non-processing versions!
33
var/expire_time
44
var/required_clean_types = CLEAN_TYPE_DISEASE
55

66

7-
/datum/component/infective/Initialize(list/datum/disease/_diseases, expire_in)
7+
/datum/component/infective/Initialize(list/datum/pathogen/_diseases, expire_in)
88
if(islist(_diseases))
99
diseases = _diseases
1010
else
@@ -41,14 +41,14 @@
4141
SIGNAL_HANDLER
4242

4343
for(var/V in diseases)
44-
eater.ForceContractDisease(V)
44+
eater.try_contract_pathogen(V)
4545
try_infect(feeder, BODY_ZONE_L_ARM)
4646

4747
/datum/component/infective/proc/try_infect_drink(datum/source, mob/living/drinker, mob/living/feeder)
4848
SIGNAL_HANDLER
4949

5050
for(var/disease in diseases)
51-
drinker.ForceContractDisease(disease)
51+
drinker.try_contract_pathogen(disease)
5252
var/appendage_zone = feeder.held_items.Find(source)
5353
appendage_zone = appendage_zone == 0 ? BODY_ZONE_CHEST : appendage_zone % 2 ? BODY_ZONE_R_ARM : BODY_ZONE_L_ARM
5454
try_infect(feeder, appendage_zone)
@@ -99,7 +99,7 @@
9999

100100
var/old_permeability
101101
if(isitem(parent))
102-
//if you are putting an infective item on, it obviously will not protect you, so set its permeability high enough that it will never block ContactContractDisease()
102+
//if you are putting an infective item on, it obviously will not protect you, so set its permeability high enough that it will never block try_contact_contract_pathogen()
103103
var/obj/item/I = parent
104104
old_permeability = I.permeability_coefficient
105105
I.permeability_coefficient = 1.01
@@ -125,4 +125,4 @@
125125

126126
/datum/component/infective/proc/try_infect(mob/living/L, target_zone)
127127
for(var/V in diseases)
128-
L.ContactContractDisease(V, target_zone)
128+
L.try_contact_contract_pathogen(V, target_zone)

code/datums/components/rot.dm

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@
149149
return
150150

151151
//We're running just under the "worst disease", since we don't want these to be too strong
152-
var/datum/disease/advance/random/rand_disease = new(rand(4 * strength * time_scaling), rand(strength * 5 * time_scaling))
152+
var/datum/pathogen/advance/random/rand_disease = new(rand(4 * strength * time_scaling), rand(strength * 5 * time_scaling))
153153
rand_disease.name = "Unknown"
154-
react_to.ContactContractDisease(rand_disease, target_zone)
154+
react_to.try_contact_contract_pathogen(rand_disease, target_zone)
155155

156156
#undef REAGENT_BLOCKER
157157
#undef TEMPERATURE_BLOCKER

0 commit comments

Comments
 (0)