Skip to content

Advanced Disease Rework #28451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 184 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
f4093a9
Reworks cures, adds strains, adds treatment chems to symptoms
Migratingcocofruit Aug 10, 2024
5ca803b
Enables coexistence of different samples of the same strain at differ…
Migratingcocofruit Aug 17, 2024
464458f
Merge branch 'ParadiseSS13:master' into DiseaseUpdate
Migratingcocofruit Aug 17, 2024
014815e
Adds symptom guessing. Correct guesses reduce analysis time and wrong…
Migratingcocofruit Aug 18, 2024
124dd48
Adds a chance for a virus to evolve into a new strain. changing the c…
Migratingcocofruit Aug 18, 2024
b695189
Revert "Adds a chance for a virus to evolve into a new strain. changi…
Migratingcocofruit Aug 18, 2024
754cb52
Adds spontaneous virus mutations, strain tracking. Removes antibody m…
Migratingcocofruit Aug 18, 2024
d9b228b
change the amount of time added/reduced by each factor
Migratingcocofruit Aug 20, 2024
a4e90c1
Merge branch 'ParadiseSS13:master' into DiseaseUpdate
Migratingcocofruit Aug 25, 2024
02b328a
Creates a disease outbreak event that allows admins to cause an outbr…
Migratingcocofruit Aug 26, 2024
6be267f
The normal base property values are now the defaults for disease crea…
Migratingcocofruit Aug 26, 2024
7833b44
Merge remote-tracking branch 'upstream/master' into DiseaseUpdate
Migratingcocofruit Sep 24, 2024
bfcc500
Rebuild TGUI
Migratingcocofruit Sep 24, 2024
4be5d40
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Oct 4, 2024
03a3850
Rebuild TGUI
Migratingcocofruit Oct 4, 2024
4fc2780
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Oct 16, 2024
f81c398
Rebuild TGUI
Migratingcocofruit Oct 16, 2024
4ea4a00
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Dec 3, 2024
e2641e9
Update tgui.bundle.js
Migratingcocofruit Dec 3, 2024
0da1100
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Feb 14, 2025
2a215cc
remove redundant lines
Migratingcocofruit Feb 14, 2025
b0f8b0d
improves ui some and moves to using world time for analysis time
Migratingcocofruit Feb 14, 2025
613c9b0
fixes a bug with the analysis time and updates the initial known adva…
Migratingcocofruit Feb 14, 2025
f07e9c6
Buffs the disease outbreak event and adds a base stat row to the PAND…
Migratingcocofruit Feb 14, 2025
c7e74df
Update tgui.bundle.js
Migratingcocofruit Feb 14, 2025
2a41654
Implements calibration
Migratingcocofruit Feb 15, 2025
48374fa
Adds a remove from database button
Migratingcocofruit Feb 16, 2025
71f26eb
Moves the known disease global list to work per z level
Migratingcocofruit Feb 16, 2025
69ce73b
Removes treatments from most chems and makes each instance of a sympt…
Migratingcocofruit Feb 17, 2025
49908d6
Update symptoms.dm
Migratingcocofruit Feb 17, 2025
f598767
Adds stage to unknown diseases
Migratingcocofruit Feb 17, 2025
8388c68
Moves accumulated error to work per z level and change the location o…
Migratingcocofruit Feb 18, 2025
cab02e7
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Feb 19, 2025
03c733b
Adds confirmation to the delete data button and moves the disease tex…
Migratingcocofruit Feb 19, 2025
f11cdb0
fix indentation
Migratingcocofruit Feb 19, 2025
da85616
Replaces pent with hydrocodone in the advanced cure list
Migratingcocofruit Feb 21, 2025
d371d79
gives more buffs to event disease based on severity. removes longevit…
Migratingcocofruit Feb 23, 2025
24036cb
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Mar 18, 2025
39abbb0
Update tgui.bundle.js
Migratingcocofruit Mar 18, 2025
4b5a119
Update pandemic.dm
Migratingcocofruit Mar 19, 2025
ec924f9
Update pandemic.dm
Migratingcocofruit Mar 19, 2025
e4f6a6e
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Mar 23, 2025
f313ed1
Update tgui.bundle.js
Migratingcocofruit Mar 23, 2025
6a7d16e
review changes
Migratingcocofruit Mar 23, 2025
ce6ee79
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Mar 25, 2025
c9ab27b
Update tgui.bundle.js
Migratingcocofruit Mar 25, 2025
dfbf653
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Mar 26, 2025
b3c9ca7
Update tgui.bundle.js
Migratingcocofruit Mar 26, 2025
7843831
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Mar 29, 2025
4fd4917
Update tgui.bundle.js
Migratingcocofruit Mar 29, 2025
327d754
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Apr 5, 2025
f90826d
Update tgui.bundle.js
Migratingcocofruit Apr 5, 2025
0d29d73
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Apr 6, 2025
cc07316
Update tgui.bundle.js
Migratingcocofruit Apr 6, 2025
b8d0256
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Apr 8, 2025
9a947cd
Update tgui.bundle.js
Migratingcocofruit Apr 8, 2025
6a610e1
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Apr 17, 2025
65f3693
Update tgui.bundle.js
Migratingcocofruit Apr 17, 2025
258fa67
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Apr 20, 2025
ce2e3de
Update tgui.bundle.js
Migratingcocofruit Apr 20, 2025
1bb0feb
review changes
Migratingcocofruit Apr 20, 2025
c8f4fb2
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Apr 20, 2025
bc049c5
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Apr 20, 2025
a3b7bc1
Update tgui.bundle.js
Migratingcocofruit Apr 20, 2025
fadd3ef
Makes vaccines only add resistances and no longer cure
Migratingcocofruit Apr 21, 2025
79b4ef8
improves pandemic ui and fixes calibration button not being properly …
Migratingcocofruit Apr 21, 2025
01af2c5
Update tgui.bundle.js
Migratingcocofruit Apr 21, 2025
b1b2410
Add the new agars to the virologist's fridge
Migratingcocofruit Apr 21, 2025
7751ba1
lowered evolution chance of viruses a bit
Migratingcocofruit Apr 22, 2025
44eb44a
further lowers evolution chance
Migratingcocofruit Apr 22, 2025
f5ddd2e
Update advance.dm
Migratingcocofruit Apr 22, 2025
5def792
Changes the scaling of analysis time and fixes stage speed presentati…
Migratingcocofruit Apr 23, 2025
8bc997a
Scanners can now see virus strains that have been inserted in the pan…
Migratingcocofruit Apr 23, 2025
45afa9e
Allows a mob to be infected by both an event and non event disease
Migratingcocofruit Apr 23, 2025
b3d57b2
Fixes the +1 syringe of translocation stabbing your feet
Migratingcocofruit Apr 23, 2025
b1e2219
Merge remote-tracking branch 'upstream/master' into DiseaseUpdate
Migratingcocofruit Apr 24, 2025
9be6d42
Update tgui.bundle.js
Migratingcocofruit Apr 24, 2025
083948f
Changes spontanous mutation to be per spread and makes disease events…
Migratingcocofruit Apr 24, 2025
ad15e6a
Diseases less common, mutations happen only on spread now, symptom li…
Migratingcocofruit Apr 24, 2025
712aa62
Merge remote-tracking branch 'upstream/master' into DiseaseUpdate
Migratingcocofruit Apr 24, 2025
58cbb1b
Update tgui.bundle.js
Migratingcocofruit Apr 24, 2025
7317293
changes virus alerts
Migratingcocofruit Apr 24, 2025
0aa6b32
Removes numbers from the virus alert text and fixes a bug that caused…
Migratingcocofruit Apr 24, 2025
c2aeee8
Merge remote-tracking branch 'upstream/master' into DiseaseUpdate
Migratingcocofruit Apr 24, 2025
1b21161
Update tgui.bundle.js
Migratingcocofruit Apr 24, 2025
2b58dfc
refactor disease spread
Migratingcocofruit Apr 25, 2025
3a048cd
Changes disease spread logic to give players options to protect thems…
Migratingcocofruit Apr 25, 2025
5e684b8
Blackbox things
Migratingcocofruit Apr 25, 2025
0b46feb
Increases announcement timer and fixes the infection talley
Migratingcocofruit Apr 26, 2025
08bdf10
Update disease_outbreak.dm
Migratingcocofruit Apr 26, 2025
4a55ffa
Adds an incubation period to advanced viruses. bumps sneeze back to 5…
Migratingcocofruit Apr 26, 2025
73045c6
Adds failsafe to disease outbreaks that will infect a random crew mem…
Migratingcocofruit Apr 26, 2025
d637fa7
Only record advanced disease infections
Migratingcocofruit Apr 26, 2025
02fa819
Properly handle recording of disease infection events
Migratingcocofruit Apr 26, 2025
3ded973
Changed resistance effect on cure
Migratingcocofruit Apr 26, 2025
a8e4534
another adjustment to res effect on cure
Migratingcocofruit Apr 26, 2025
55fb877
Small resist buff, spontanous combustion buff and some calculation fixes
Migratingcocofruit Apr 26, 2025
b95f21e
changes spontanous combustion stat bonuses and maluses
Migratingcocofruit Apr 26, 2025
da9c561
Update flesh_eating.dm
Migratingcocofruit Apr 26, 2025
cff677d
Update flesh_eating.dm
Migratingcocofruit Apr 26, 2025
97245a4
Update flesh_eating.dm
Migratingcocofruit Apr 26, 2025
1760d44
Big trait changes and rebalance
Migratingcocofruit Apr 26, 2025
2624f63
adds treatments to fire and necro
Migratingcocofruit Apr 26, 2025
6d9b0eb
Introduces viral contamination of food and reagent containers, as wel…
Migratingcocofruit Apr 26, 2025
78aadd6
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit Apr 26, 2025
e51b21f
Fix runtime in reagent transfers
Migratingcocofruit Apr 26, 2025
b35fdf3
Revert the prefs and config changes
Migratingcocofruit Apr 26, 2025
9f48cdf
Slowed down diseases and made symptoms more gradual, improved disease…
Migratingcocofruit Apr 28, 2025
c292ee8
Sterilizine now sterilizes things contaminated with viruses. Heat rea…
Migratingcocofruit Apr 28, 2025
966c537
Adds option to order sterile masks, goggles and biosuits in packs of …
Migratingcocofruit Apr 29, 2025
f3dda1d
adds logging to pandemic
Migratingcocofruit Apr 29, 2025
4287efa
Changes symptom stats and increased disease varaiety
Migratingcocofruit Apr 29, 2025
846e3ac
Fixes some disease bugs
Migratingcocofruit Apr 30, 2025
55f079f
Fixes some bugs and makes it behave better
Migratingcocofruit Apr 30, 2025
e6e2434
Adds shiver emote to shiver symptom
Migratingcocofruit Apr 30, 2025
b023cde
Adds admin message/log to contracting an event disease and fixes copy…
Migratingcocofruit May 1, 2025
7a5ca90
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit May 1, 2025
0278abe
Prefix spread defines
Migratingcocofruit May 1, 2025
689a4ea
Change the rest of the macros
Migratingcocofruit May 1, 2025
8cc5b85
correct the disinfection temp macro
Migratingcocofruit May 1, 2025
5fd4c83
Moves disease signals to their own file
Migratingcocofruit May 1, 2025
69ea600
move disnifection temp back
Migratingcocofruit May 1, 2025
a6173b5
fix a type
Migratingcocofruit May 1, 2025
88389ff
viral contaminations component review changes
Migratingcocofruit May 1, 2025
0939484
var name changes
Migratingcocofruit May 1, 2025
6a0530c
more style fixes
Migratingcocofruit May 1, 2025
a4af27d
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit May 2, 2025
ad862cf
Update tgui.bundle.js
Migratingcocofruit May 2, 2025
dc4b06f
fixes pandemic
Migratingcocofruit May 2, 2025
737f761
Fixes disease outbreak having two carriers sometimes and changes the …
Migratingcocofruit May 2, 2025
4811318
Update disease_defines.dm
Migratingcocofruit May 2, 2025
fe66e55
fixes samples not passing stages on properly
Migratingcocofruit May 2, 2025
1316b86
actually fixes the bug
Migratingcocofruit May 2, 2025
353c021
Fixes stabilization being lost on cloning
Migratingcocofruit May 3, 2025
5694362
Finally completely and absolutely fixes the sample stages bug(please)
Migratingcocofruit May 3, 2025
9ad2977
Makes the pandemic a machine
Migratingcocofruit May 3, 2025
3a62e32
Update pandemic.dm
Migratingcocofruit May 3, 2025
638a95f
removed drinks from cure requirements
Migratingcocofruit May 3, 2025
7bed57c
lowers chance of major viral outbreak
Migratingcocofruit May 3, 2025
2f7bc57
fixes pandemic not processing properly
Migratingcocofruit May 3, 2025
ff0f93e
Changes the cure system to have more options
Migratingcocofruit May 3, 2025
c97fc48
Makes mixing event viruses more random
Migratingcocofruit May 4, 2025
a877034
Fixes hardsuits having a 1% chance to be infected
Migratingcocofruit May 4, 2025
eafcd70
Increases virus protection of most clothing. medical scrubs and surgi…
Migratingcocofruit May 4, 2025
396b10e
Slow down progress of diseases
Migratingcocofruit May 4, 2025
2975cd4
makes spread less likely
Migratingcocofruit May 4, 2025
564ae2f
envirosuit is now slightly more protective from viruses, while the me…
Migratingcocofruit May 4, 2025
a21b2ef
Adds further protection to helmets
Migratingcocofruit May 4, 2025
32da3c2
Increases the number of possible cures and the scaling of required cures
Migratingcocofruit May 4, 2025
4f03541
Merge remote-tracking branch 'upstream/master' into DiseaseUpdate
Migratingcocofruit May 4, 2025
54da024
Pandemic ui improvements
Migratingcocofruit May 4, 2025
c6c8891
Update _disease.dm
Migratingcocofruit May 4, 2025
2362f98
fix a bug with spread target in the disease outbreak event
Migratingcocofruit May 5, 2025
701ad63
changes some clothing permeability
Migratingcocofruit May 5, 2025
3ca2837
Adds the ability to make viral DNA extracts by injecting a sample int…
Migratingcocofruit May 5, 2025
21ebddb
Merge remote-tracking branch 'upstream/master' into DiseaseUpdate
Migratingcocofruit May 5, 2025
a5a0693
Adds age to health analyzer, makes viral evolution toggle minor disab…
Migratingcocofruit May 5, 2025
1294623
Update pandemic.dm
Migratingcocofruit May 6, 2025
c2a5bfc
replace lazarus with acetic acid in the cures
Migratingcocofruit May 6, 2025
f79dacc
Changes the relation of the amount of cure options to required cures …
Migratingcocofruit May 6, 2025
2201e17
Fixes virus renaming
Migratingcocofruit May 6, 2025
5cdd961
changes description and permeability of some medical jumpsuits
Migratingcocofruit May 6, 2025
f2bfbca
Adds a list of all diseases infecting client mobs to the disease outb…
Migratingcocofruit May 7, 2025
2277416
uses event UID instead of ref in the disease
Migratingcocofruit May 7, 2025
14b2040
Adds advanced disease carriers to admin antag menu
Migratingcocofruit May 7, 2025
750432e
Adds viral eraser which removes tracking and stabilizing. Admin spawn…
Migratingcocofruit May 7, 2025
109bb9c
Merge remote-tracking branch 'upstream/master' into DiseaseUpdate
Migratingcocofruit May 7, 2025
225f97c
Merge remote-tracking branch 'upstream/master' into DiseaseUpdate
Migratingcocofruit May 7, 2025
beadebd
Update tgui.bundle.js
Migratingcocofruit May 7, 2025
c742e3c
Adds the ability to create viral genetic material using radiation. it…
Migratingcocofruit May 8, 2025
1499dbe
changes alert logic, disease generation logic, adds treatments to wea…
Migratingcocofruit May 9, 2025
fd1b0dc
makes disease advance a bit faster
Migratingcocofruit May 9, 2025
f991576
reduce time to announcement to 6 minutes after 3 people are infected
Migratingcocofruit May 9, 2025
0238ec1
Changes medibot disease detection to be the same as analyzers. Treatm…
Migratingcocofruit May 10, 2025
2c1b5ff
Make sure the disease outbreak event only selects crew
Migratingcocofruit May 10, 2025
dc45f94
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit May 10, 2025
4117c1c
Merge branch 'master' into DiseaseUpdate
Migratingcocofruit May 10, 2025
cf57967
Fix abductor virus gland virus generation
Migratingcocofruit May 11, 2025
bce2ced
Adds sterilizine to viro locker
Migratingcocofruit May 11, 2025
39c0ee6
Fixes null viruses appearing when merging virusless blood
Migratingcocofruit May 12, 2025
8841285
Adds oculine to hyphema treatments
Migratingcocofruit May 13, 2025
b7ea2ca
Merge remote-tracking branch 'upstream/master' into DiseaseUpdate
Migratingcocofruit May 16, 2025
287a952
Rebalances weight loss and flesh eating
Migratingcocofruit May 17, 2025
899e043
Improvements to advanced disease carrier tab on the TGUI antag menu
Migratingcocofruit May 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,27 @@

return "[output][and_text][input[index]]"

// Returns a map in plain english as a string
/proc/english_map(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
var/total = length(input)
if(!total)
return "[nothing_text]"
else if(total == 1)
return "[input[1]]"
else if(total == 2)
return "[input[1]][and_text][input[2]]"
else
var/output = ""
var/index = 1
while(index < total)
if(index == total - 1)
comma_text = final_comma_text

output += "[input[index]] : [input[input[index]]][comma_text]"
index++

return "[output][and_text][input[index]] : [input[input[index]]]"

//Returns list element or null. Should prevent "index out of bounds" error.
/proc/listgetindex(list/list, index)
if(istype(list) && length(list))
Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/lists/reagents_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GLOBAL_LIST_INIT(drinks, list("beer2","hot_coco","orangejuice","tomatojuice","li
"berryjuice","poisonberryjuice","watermelonjuice","lemonjuice","banana", "bungojuice",
"nothing","potato","milk","soymilk","cream","coffee","tea","icecoffee",
"icetea","cola","nuka_cola","spacemountainwind","thirteenloko","dr_gibb",
"space_up","lemon_lime","beer","whiskey","gin","rum","vodka","holywater",
"space_up","lemon_lime","triple_citrus","beer","whiskey","gin","rum","vodka","holywater",
"tequila","vermouth","wine","tonic","kahlua","cognac","ale","sodawater",
"ice","bilk","atomicbomb","threemileisland","goldschlager","patron","gintonic",
"cubalibre","whiskeycola","martini","vodkamartini","whiterussian","screwdrivercocktail",
Expand Down
3 changes: 2 additions & 1 deletion code/datums/diseases/_MobProcs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
return TRUE


/mob/proc/AddDisease(datum/disease/D, respect_carrier = FALSE)
/mob/proc/AddDisease(datum/disease/D, respect_carrier = FALSE, start_stage = 1)
var/datum/disease/DD = new D.type(1, D, 0)
DD.stage = start_stage
viruses += DD
DD.affected_mob = src
GLOB.active_diseases += DD //Add it to the active diseases list, now that it's actually in a mob and being processed.
Expand Down
198 changes: 137 additions & 61 deletions code/datums/diseases/advance/advance.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/// Evoltion chance each cycle in percents.
/// a value of 0.0057% corresponds to a 1 in 30 chance of new strain every 600 cycles or 20 minutes.
#define EVOLUTION_CHANCE 0.0057

/*

Advance Disease is a system for Virologist to Engineer their own disease with symptoms that have effects and properties
Expand All @@ -6,16 +10,30 @@
If you need help with creating new symptoms or expanding the advance disease, ask for Giacom on #coderbus.

*/
GLOBAL_VAR_INIT(next_unique_strain, 1)

GLOBAL_LIST_EMPTY(archive_diseases)

// The order goes from easy to cure to hard to cure.
GLOBAL_LIST_INIT(advance_cures, list(
GLOBAL_LIST_INIT(standard_cures, list(
"sodiumchloride", "sugar", "orangejuice",
"spaceacillin", "salglu_solution", "ethanol",
"teporone", "diphenhydramine", "lipolicide",
"silver", "gold"
))

GLOBAL_LIST_INIT(advanced_cures, list(
"atropine", "mitocholide", "lazarus_reagent",
"cryoxadone", "hydrocodone", "haloperidol",
"degreaser", "perfluorodecalin"
))

GLOBAL_LIST_INIT(plant_cures,list(
"bicaridine", "kelotane", "omnizine",
"synaptizine", "weak_omnizine", "morphine",
"cbd", "thc", "nicotine" , "psilocybin"
))

/*

PROPERTIES
Expand All @@ -34,31 +52,54 @@ GLOBAL_LIST_INIT(advance_cures, list(

// NEW VARS

var/list/symptoms = list() // The symptoms of the disease.
/// The base properties of the virus. retained between strains
var/list/base_properties = list("resistance" = 1, "stealth" = 0, "stage rate" = 1, "transmittable" = 1, "severity" = 0)
/// Can the virus spotaneously evolve?
var/evolution_chance = EVOLUTION_CHANCE
/// The symptoms of the disease.
var/list/symptoms = list()
/// A unique ID for the strain and symptoms.
var/id = ""
/// Saves an ID. If that ID is analyzed the virus will be automatically analyzed when inserted into the PANDEMIC
var/tracker = ""
var/processing = FALSE
/// A unique ID for the strain. Uses the unique_datum_id of the first virus datum that is of that strain.
var/strain = ""

/*

OLD PROCS

*/

/datum/disease/advance/New(process = 1, datum/disease/advance/D)
if(!istype(D))
D = null
/datum/disease/advance/New(process = 1, datum/disease/advance/to_copy)
if(!istype(to_copy))
to_copy = null
strain = "origin"
// whether to generate a new cure or not
var/new_cure = TRUE
// Generate symptoms if we weren't given any.

if(!symptoms || !length(symptoms))

if(!D || !D.symptoms || !length(D.symptoms))
if(!to_copy || !to_copy.symptoms || !length(to_copy.symptoms))
symptoms = GenerateSymptoms(0, 2)
else
for(var/datum/symptom/S in D.symptoms)
for(var/datum/symptom/S in to_copy.symptoms)
symptoms += new S.type

Refresh()
..(process, D)
// Copy cure, evolution ability and strain if we are copying an existing disease
if(to_copy)
base_properties = to_copy.base_properties.Copy()
stage = to_copy.stage
evolution_chance = to_copy.evolution_chance
tracker = to_copy.tracker
for(var/r in to_copy.cures)
cures += r
cure_text = to_copy.cure_text
strain = to_copy.strain
new_cure = FALSE

Refresh(FALSE, FALSE , new_cure, FALSE)

..(process, to_copy)
return

/datum/disease/advance/Destroy()
Expand All @@ -71,15 +112,34 @@ GLOBAL_LIST_INIT(advance_cures, list(
/datum/disease/advance/stage_act()
if(!..())
return FALSE
if(prob(evolution_chance))
var/min = rand(1,6)
var/max = rand(min,6)
var/lastStrain = strain
if(prob(95))
Evolve(min, max)
else
Devolve()
// Create a new strain even if we didn't gain or lose symptoms
if(lastStrain == strain)
Refresh()
if(symptoms && length(symptoms))

var/list/mob_reagents = list()
for(var/datum/reagent/chem in affected_mob.reagents.reagent_list)
mob_reagents += chem.id
if(!processing)
processing = TRUE
for(var/datum/symptom/S in symptoms)
S.Start(src)

var/treated = FALSE
for(var/datum/symptom/S in symptoms)
S.Activate(src)
treated = FALSE
for(var/treatment in S.treatments)
if(treatment in mob_reagents)
treated = TRUE
affected_mob.reagents.remove_reagent(treatment, S.purge_amount)
if(!treated)
S.Activate(src)
else
CRASH("We do not have any symptoms during stage_act()!")
return TRUE
Expand Down Expand Up @@ -177,9 +237,15 @@ GLOBAL_LIST_INIT(advance_cures, list(

return generated

/datum/disease/advance/proc/Refresh(new_name = FALSE, archive = FALSE)
/datum/disease/advance/proc/Refresh(new_name = FALSE, archive = FALSE, new_cure = TRUE, new_strain = TRUE)
if(new_strain)
strain = "adv_[num2text(GLOB.next_unique_strain++, 8)]"
evolution_chance = EVOLUTION_CHANCE

if(evolution_chance)
evolution_chance = EVOLUTION_CHANCE
var/list/properties = GenerateProperties()
AssignProperties(properties)
AssignProperties(properties, new_cure)
id = null

if(!GLOB.archive_diseases[GetDiseaseID()])
Expand All @@ -197,10 +263,11 @@ GLOBAL_LIST_INIT(advance_cures, list(
if(!symptoms || !length(symptoms))
CRASH("We did not have any symptoms before generating properties.")

var/list/properties = list("resistance" = 1, "stealth" = 0, "stage rate" = 1, "transmittable" = 1, "severity" = 0)
var/list/properties = base_properties.Copy()

for(var/datum/symptom/S in symptoms)

if(istype(S, /datum/symptom/viralevolution))
evolution_chance *= 1.5
properties["resistance"] += S.resistance
properties["stealth"] += S.stealth
properties["stage rate"] += S.stage_speed
Expand All @@ -210,22 +277,23 @@ GLOBAL_LIST_INIT(advance_cures, list(
return properties

// Assign the properties that are in the list.
/datum/disease/advance/proc/AssignProperties(list/properties = list())

/datum/disease/advance/proc/AssignProperties(list/properties = list(), new_cure = TRUE)
if(properties && length(properties))
switch(properties["stealth"])
if(2)
if(0 to 2)
visibility_flags = 0
if(2 to INFINITY)
visibility_flags = HIDDEN_SCANNER
if(3 to INFINITY)
visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC

// The more symptoms we have, the less transmittable it is but some symptoms can make up for it.
SetSpread(clamp(2 ** (properties["transmittable"] - length(symptoms)), BLOOD, AIRBORNE))
permeability_mod = max(CEILING(0.4 * properties["transmittable"], 1), 1)
cure_chance = 15 - clamp(properties["resistance"], -5, 5) // can be between 10 and 20
stage_prob = max(properties["stage rate"], 2)
SetSeverity(properties["severity"])
GenerateCure(properties)
evolution_chance *= (1 + sqrtor0(properties["stage rate"]) / 3)
if(new_cure)
GenerateCure(properties)
else
CRASH("Our properties were empty or null!")

Expand Down Expand Up @@ -264,18 +332,25 @@ GLOBAL_LIST_INIT(advance_cures, list(
severity = "Unknown"


/datum/disease/advance/proc/CurePick(list/curelist = list())
var/list/options = curelist - cures
return pick(options)

// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
/datum/disease/advance/proc/GenerateCure(list/properties = list())
if(properties && length(properties))
var/res = clamp(properties["resistance"] - (length(symptoms) / 2), 1, length(GLOB.advance_cures))
// to_chat(world, "Res = [res]")
cures = list(GLOB.advance_cures[res])

// Get the cure name from the cure_id
var/datum/reagent/D = GLOB.chemical_reagents_list[cures[1]]
cure_text = D.name


var/res = clamp((properties["resistance"] - length(symptoms) / 2) / 2 , 1 , length(GLOB.advanced_cures))
cures = list()
cure_text = ""
cures += pick(GLOB.standard_cures)
if(res > 1)
cures += prob(50) ? CurePick(GLOB.advanced_cures) : CurePick(GLOB.plant_cures)
if(res > 2)
cures += prob(50) ? CurePick(GLOB.plant_cures) : CurePick(GLOB.drinks)
for(var/cure in cures)
// Get the cure name from the cure_id
var/datum/reagent/D = GLOB.chemical_reagents_list[cure]
cure_text += cure_text == "" ? "[D.name]" : ", [D.name]"
return

// Randomly generate a symptom, has a chance to lose or gain a symptom.
Expand All @@ -296,8 +371,11 @@ GLOBAL_LIST_INIT(advance_cures, list(
return

// Name the disease.
/datum/disease/advance/proc/AssignName(name = "Unknown")
src.name = name
/datum/disease/advance/proc/AssignName(_name = "Unknown")
name = _name
if(GLOB.archive_diseases[GetDiseaseID()])
var/datum/disease/advance/virus = GLOB.archive_diseases[GetDiseaseID()]
virus.name = _name
return

// Return a unique ID of the disease.
Expand All @@ -306,7 +384,8 @@ GLOBAL_LIST_INIT(advance_cures, list(
var/list/L = list()
for(var/datum/symptom/S in symptoms)
L += S.id
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in and add the strain to the end
L += strain
var/result = jointext(L, ":")
id = result
return id
Expand Down Expand Up @@ -362,7 +441,9 @@ GLOBAL_LIST_INIT(advance_cures, list(
diseases -= D1

var/datum/disease/advance/D2 = pick(diseases)
D2.Mix(D1)
// So that we don't mix a virus with itself
if(D2.GetDiseaseID() != D1.GetDiseaseID())
D2.Mix(D1)

// Should be only 1 entry left, but if not let's only return a single entry
// to_chat(world, "END MIXING!!!!!")
Expand All @@ -385,10 +466,18 @@ GLOBAL_LIST_INIT(advance_cures, list(
if(!user)
return

var/datum/disease/advance/admin_disease = new(0, null)

var/base_props = list("resistance" = 1, "stealth" = 0, "stage rate" = 1, "transmittable" = 1, "severity" = 0)

for(var/prop in base_props)
var/current_prop = input(user, "Enter base [prop]", "Base Stats", null)
if(current_prop)
admin_disease.base_properties[prop] = text2num(current_prop)

var/i = VIRUS_SYMPTOM_LIMIT

var/datum/disease/advance/D = new(0, null)
D.symptoms = list()
admin_disease.symptoms = list()

var/list/symptoms = list()
symptoms += "Done"
Expand All @@ -402,34 +491,19 @@ GLOBAL_LIST_INIT(advance_cures, list(
i = 0
else if(ispath(symptom))
var/datum/symptom/S = new symptom
if(!D.HasSymptom(S))
D.symptoms += S
if(!admin_disease.HasSymptom(S))
admin_disease.symptoms += S
i -= 1
while(i > 0)

if(length(D.symptoms) > 0)
if(length(admin_disease.symptoms) > 0)

var/new_name = stripped_input(user, "Name your new disease.", "New Name")
if(!new_name)
return
D.AssignName(new_name)
D.Refresh()

for(var/datum/disease/advance/AD in GLOB.active_diseases)
AD.Refresh()

for(var/thing in shuffle(GLOB.human_list))
var/mob/living/carbon/human/H = thing
if(H.stat == DEAD || !is_station_level(H.z))
continue
if(!H.HasDisease(D))
H.ForceContractDisease(D)
break

var/list/name_symptoms = list()
for(var/datum/symptom/S in D.symptoms)
name_symptoms += S.name
message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]")
admin_disease.AssignName(new_name)
admin_disease.Refresh()
return admin_disease



Expand Down Expand Up @@ -460,3 +534,5 @@ GLOBAL_LIST_INIT(advance_cures, list(
var/datum/symptom/S = i
total_transmittable += S.transmittable
return total_transmittable

#undef EVOLUTION_CHANCE
1 change: 1 addition & 0 deletions code/datums/diseases/advance/symptoms/choking.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Bonus
transmittable = -4
level = 3
severity = 3
treatments = list("perfluorodecalin")

/datum/symptom/choking/Activate(datum/disease/advance/A)
..()
Expand Down
Loading