Early stage viruses no longer show on medical HUD (#16307)

This commit is contained in:
dearmochi
2021-07-09 11:39:37 +01:00
committed by GitHub
parent 908c4f0dd1
commit 52e86bd0ed
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -50,6 +50,10 @@ GLOBAL_LIST_INIT(diseases, subtypesof(/datum/disease))
var/stage = 1
var/max_stages = 0
var/stage_prob = 4
/// The fraction of stages the virus must at least be at to show up on medical HUDs. Rounded up.
var/discovery_threshold = 0.5
/// If TRUE, this virus will show up on medical HUDs. Automatically set when it reaches mid-stage.
var/discovered = FALSE
//Other
var/list/viable_mobtypes = list() //typepaths of viable mobs
@@ -82,6 +86,9 @@ GLOBAL_LIST_INIT(diseases, subtypesof(/datum/disease))
if(!cure)
if(prob(stage_prob))
stage = min(stage + 1,max_stages)
if(!discovered && stage >= CEILING(max_stages * discovery_threshold, 1)) // Once we reach a late enough stage, medical HUDs can pick us up even if we regress
discovered = TRUE
affected_mob.med_hud_set_status()
else
if(prob(cure_chance))
stage = max(stage - 1, 1)