From 126b40b506396dbb1bc4766bfd99db9414b603a2 Mon Sep 17 00:00:00 2001 From: Guti <32563288+TheCaramelion@users.noreply.github.com> Date: Tue, 1 Jul 2025 01:14:45 +0200 Subject: [PATCH] medruntime (#17940) --- code/_helpers/global_lists_vr.dm | 2 ++ code/datums/diseases/_disease.dm | 20 +++++++++++++++++++ code/game/machinery/computer/medical.dm | 5 +---- .../objects/items/devices/extrapolator.dm | 3 +++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/code/_helpers/global_lists_vr.dm b/code/_helpers/global_lists_vr.dm index 7286506a4bb..2c67f669c9b 100644 --- a/code/_helpers/global_lists_vr.dm +++ b/code/_helpers/global_lists_vr.dm @@ -1233,3 +1233,5 @@ GLOBAL_LIST_INIT(material_synth_list, list( WIRE_SYNTH = /datum/matter_synth/wire, CLOTH_SYNTH = /datum/matter_synth/cloth )) + +GLOBAL_LIST_EMPTY(virusDB) // Stores discovered viruses diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index 7b2922155e4..7fd55f626ac 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -223,3 +223,23 @@ GLOBAL_LIST_INIT(diseases, subtypesof(/datum/disease)) // Called when the mob dies /datum/disease/proc/OnDeath() return + +// Adds a virus to the virus DB +// Currently it won't show on the Medical Computers because OLD interface, which needs to be updated +/datum/disease/proc/addToDB() + if(GetDiseaseID() in GLOB.virusDB) + return FALSE + + var/datum/data/record/v = new() + + v.fields["id"] = GetDiseaseID() + v.fields["name"] = name + v.fields["description"] = desc + v.fields["form"] = form + v.fields["agent"] = agent + v.fields["cure"] = cure_text + v.fields["spread"] = spread_text + + GLOB.virusDB["[GetDiseaseID()]"] = v + + return TRUE diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index e6cb5dc9003..ec1fe895737 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -172,10 +172,7 @@ medical["empty"] = 1 if(MED_DATA_V_DATA) data["virus"] = list() - for(var/datum/disease/D in GLOB.active_diseases) - if(!global_flag_check(D.virus_modifiers, DISCOVERED)) - continue - var/datum/data/record/v = GLOB.active_diseases[D] + for(var/datum/data/record/v in GLOB.virusDB) data["virus"] += list(list("name" = v.fields["name"], "D" = "\ref[v]")) if(MED_DATA_MEDBOT) data["medbots"] = list() diff --git a/code/game/objects/items/devices/extrapolator.dm b/code/game/objects/items/devices/extrapolator.dm index 7d73fac8e80..fb559604968 100644 --- a/code/game/objects/items/devices/extrapolator.dm +++ b/code/game/objects/items/devices/extrapolator.dm @@ -172,6 +172,9 @@ message += "[symptom.name]" else message += span_info("[disease.name], stage [disease.stage]/[disease.max_stages].") + + disease.addToDB() + to_chat(user, examine_block(jointext(message, "\n")), avoid_highlighting = TRUE, trailing_newline = FALSE, type = MESSAGE_TYPE_INFO) /obj/item/extrapolator/proc/extrapolate(mob/living/user, atom/target, isolate = FALSE)