Revert "Removes some unnecessary global variables (#16353)" (#17170)

This commit is contained in:
dearmochi
2021-11-28 09:18:27 +00:00
committed by GitHub
parent 5397d28c4f
commit ca87534d46
31 changed files with 219 additions and 51 deletions
+15 -11
View File
@@ -8,6 +8,14 @@
*/
GLOBAL_LIST_EMPTY(archive_diseases)
// The order goes from easy to cure to hard to cure.
GLOBAL_LIST_INIT(advance_cures, list(
"sodiumchloride", "sugar", "orangejuice",
"spaceacillin", "salglu_solution", "ethanol",
"teporone", "diphenhydramine", "lipolicide",
"silver", "gold"
))
/*
PROPERTIES
@@ -15,6 +23,7 @@ GLOBAL_LIST_EMPTY(archive_diseases)
*/
/datum/disease/advance
name = "Unknown" // We will always let our Virologist name our disease.
desc = "An engineered disease which can contain a multitude of symptoms."
form = "Advance Disease" // Will let med-scanners know that this disease was engineered.
@@ -29,14 +38,6 @@ GLOBAL_LIST_EMPTY(archive_diseases)
var/id = ""
var/processing = 0
// The order goes from easy to cure to hard to cure.
var/static/list/advance_cures = list(
"sodiumchloride", "sugar", "orangejuice",
"spaceacillin", "salglu_solution", "ethanol",
"teporone", "diphenhydramine", "lipolicide",
"silver", "gold"
)
/*
OLD PROCS
@@ -244,15 +245,18 @@ GLOBAL_LIST_EMPTY(archive_diseases)
// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
/datum/disease/advance/proc/GenerateCure(list/properties = list())
if(length(properties))
var/res = clamp(properties["resistance"] - (length(symptoms) / 2), 1, length(advance_cures))
if(properties && properties.len)
var/res = clamp(properties["resistance"] - (symptoms.len / 2), 1, GLOB.advance_cures.len)
// to_chat(world, "Res = [res]")
cures = list(advance_cures[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
return
// Randomly generate a symptom, has a chance to lose or gain a symptom.
/datum/disease/advance/proc/Evolve(min_level, max_level)
var/s = safepick(GenerateSymptoms(min_level, max_level, 1))