Merge pull request #4862 from phil235/VirusFix

Fix virus detectability for medbot and medical HUD
This commit is contained in:
Cheridan
2014-09-19 14:54:30 -05:00
36 changed files with 64 additions and 19 deletions
+2
View File
@@ -52,6 +52,8 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
var/requires = 0
var/list/required_limb = list()
var/const/non_threat = "Non-Threat"
/datum/disease/proc/stage_act()
var/cure_present = has_cure()
+3 -3
View File
@@ -182,7 +182,7 @@ var/list/advance_cures = list(
CRASH("We did not have any symptoms before generating properties.")
return
var/list/properties = list("resistance" = 1, "stealth" = 1, "stage_rate" = 1, "transmittable" = 1, "severity" = 1)
var/list/properties = list("resistance" = 1, "stealth" = 1, "stage_rate" = 1, "transmittable" = 1, "severity" = 0)
for(var/datum/symptom/S in symptoms)
@@ -190,7 +190,7 @@ var/list/advance_cures = list(
properties["stealth"] += S.stealth
properties["stage_rate"] += S.stage_speed
properties["transmittable"] += S.transmittable
properties["severity"] = max(properties["severity"], S.level) // severity is based on the highest level symptom
properties["severity"] = max(properties["severity"], S.severity) // severity is based on the highest severity symptom
return properties
@@ -234,7 +234,7 @@ var/list/advance_cures = list(
switch(level_sev)
if(-INFINITY to 0)
severity = "Non-Threat"
severity = non_threat
if(1)
severity = "Minor"
if(2)
@@ -22,6 +22,7 @@ BONUS
stage_speed = -3
transmittable = -1
level = 4
severity = 1
/datum/symptom/beard/Activate(var/datum/disease/advance/A)
..()
@@ -23,6 +23,7 @@ Bonus
stage_speed = -2
transmittable = -4
level = 3
severity = 3
/datum/symptom/choking/Activate(var/datum/disease/advance/A)
..()
@@ -23,6 +23,7 @@ Bonus
stage_speed = -3
transmittable = 0
level = 4
severity = 2
/datum/symptom/confusion/Activate(var/datum/disease/advance/A)
@@ -23,6 +23,7 @@ BONUS
stage_speed = 1
transmittable = 2
level = 1
severity = 1
/datum/symptom/cough/Activate(var/datum/disease/advance/A)
..()
@@ -23,6 +23,7 @@ Bonus
stage_speed = -1
transmittable = -3
level = 4
severity = 3
/datum/symptom/deafness/Activate(var/datum/disease/advance/A)
..()
@@ -23,6 +23,7 @@ Bonus
stage_speed = -3
transmittable = -1
level = 4
severity = 2
/datum/symptom/dizzy/Activate(var/datum/disease/advance/A)
..()
@@ -23,6 +23,7 @@ Bonus
stage_speed = 3
transmittable = 2
level = 2
severity = 2
/datum/symptom/fever/Activate(var/datum/disease/advance/A)
..()
@@ -23,6 +23,7 @@ Bonus
stage_speed = 0
transmittable = -4
level = 6
severity = 5
/datum/symptom/flesh_eating/Activate(var/datum/disease/advance/A)
..()
@@ -23,6 +23,7 @@ Bonus
stage_speed = 0
transmittable = -3
level = 6
severity = 3
var/good_mutations = 0
var/archived_dna = null
@@ -78,4 +79,5 @@ Bonus
stage_speed = -7
transmittable = -7
level = 6
good_mutations = 1
good_mutations = 1
severity = 0
@@ -23,6 +23,7 @@ Bonus
stage_speed = -3
transmittable = -1
level = 5
severity = 3
/datum/symptom/hallucigen/Activate(var/datum/disease/advance/A)
..()
@@ -24,6 +24,7 @@ BONUS
stage_speed = 2
transmittable = 0
level = 1
severity = 1
/datum/symptom/headache/Activate(var/datum/disease/advance/A)
..()
@@ -24,6 +24,7 @@ BONUS
stage_speed = 3
transmittable = 1
level = 1
severity = 1
/datum/symptom/itching/Activate(var/datum/disease/advance/A)
..()
@@ -22,6 +22,7 @@ BONUS
stage_speed = -1
transmittable = 2
level = 4
severity = 1
/datum/symptom/shedding/Activate(var/datum/disease/advance/A)
..()
@@ -23,6 +23,7 @@ Bonus
stage_speed = 2
transmittable = 2
level = 2
severity = 2
/datum/symptom/shivering/Activate(var/datum/disease/advance/A)
..()
@@ -24,6 +24,7 @@ Bonus
stage_speed = 0
transmittable = 4
level = 1
severity = 1
/datum/symptom/sneeze/Activate(var/datum/disease/advance/A)
..()
@@ -12,8 +12,10 @@ var/global/const/SYMPTOM_ACTIVATION_PROB = 3
var/resistance = 0
var/stage_speed = 0
var/transmittable = 0
// The type level of the symptom. Higher is more lethal and harder to generate.
// The type level of the symptom. Higher is harder to generate.
var/level = 0
// The severity level of the symptom. Higher is more dangerous.
var/severity = 0
// The hash tag for our diseases, we will add it up with our other symptoms to get a unique id! ID MUST BE UNIQUE!!!
var/id = ""
@@ -23,6 +23,7 @@ Bonus
stage_speed = -4
transmittable = -3
level = 5
severity = 4
/datum/symptom/visionloss/Activate(var/datum/disease/advance/A)
..()
@@ -22,6 +22,7 @@ BONUS
stage_speed = -1
transmittable = -2
level = 5
severity = 1
/datum/symptom/vitiligo/Activate(var/datum/disease/advance/A)
..()
@@ -23,6 +23,7 @@ Bonus
stage_speed = -3
transmittable = -1
level = 6
severity = 2
/datum/symptom/voice_change/Activate(var/datum/disease/advance/A)
..()
@@ -27,6 +27,7 @@ Bonus
stage_speed = 0
transmittable = 1
level = 3
severity = 4
/datum/symptom/vomit/Activate(var/datum/disease/advance/A)
..()
@@ -78,6 +79,7 @@ Bonus
stage_speed = -1
transmittable = 1
level = 4
severity = 5
/datum/symptom/vomit/blood/Vomit(var/mob/living/M)
@@ -23,6 +23,7 @@ Bonus
stage_speed = -2
transmittable = -2
level = 4
severity = 1
/datum/symptom/weight_gain/Activate(var/datum/disease/advance/A)
..()
@@ -64,6 +65,7 @@ Bonus
stage_speed = -2
transmittable = -2
level = 3
severity = 1
/datum/symptom/weight_loss/Activate(var/datum/disease/advance/A)
..()
+3 -2
View File
@@ -9,7 +9,7 @@
permeability_mod = 1
contagious_period = 9001 //slightly hacky, but hey! whatever works, right?
desc = "If left untreated the subject will become very weak, and may vomit often."
severity = "Medium"
severity = "Dangerous!"
longevity = 1000
hidden = list(0, 1)
requires = 1
@@ -35,7 +35,8 @@
if(prob(1))
if (affected_mob.nutrition > 100)
affected_mob.Stun(rand(4,6))
affected_mob.show_message("<span class='warning'>[affected_mob] throws up!</span>")
affected_mob.visible_message("<span class='danger'>[affected_mob] throws up!</span>", \
"<span class='userdanger'>[affected_mob] throws up!</span>")
playsound(affected_mob.loc, 'sound/effects/splat.ogg', 50, 1)
var/turf/location = affected_mob.loc
if(istype(location, /turf/simulated))
+1 -1
View File
@@ -10,7 +10,7 @@
curable = 0
cure_chance = 15//higher chance to cure, since two reagents are required
desc = "This disease destroys the braincells, causing brain fever, brain necrosis and general intoxication."
severity = "Major"
severity = "Dangerous!"
requires = 1
required_limb = list(/obj/item/organ/limb/head)
+1 -1
View File
@@ -8,7 +8,7 @@
agent = "ICE9-rhinovirus"
affected_species = list("Human")
desc = "If left untreated the subject will slow, as if partly frozen."
severity = "Moderate"
severity = "Medium"
/datum/disease/cold9/stage_act()
..()
+1 -1
View File
@@ -8,7 +8,7 @@
agent = "Gravitokinetic Bipotential SADS-"
affected_species = list("Human", "Monkey")
desc = "If left untreated death will occur."
severity = "Major"
severity = "BIOHAZARD THREAT!"
/datum/disease/fake_gbs/stage_act()
..()
+1 -1
View File
@@ -9,7 +9,7 @@
affected_species = list("Human")
permeability_mod = 0.75
desc = "If left untreated the subject will burn to death for being a heretic."
severity = "Serious"
severity = "Dangerous!"
/datum/disease/inquisition/stage_act()
..()
+1
View File
@@ -10,6 +10,7 @@
affected_species = list("Human")
curable = 0
permeability_mod = 1
severity = "BIOHAZARD THREAT!"
/datum/disease/gbs/stage_act()
..()
+2 -1
View File
@@ -2,4 +2,5 @@
name = "Plasmatoid"
max_stages = 4
cure = "None"
affected_species = list("Monkey", "Human")
affected_species = list("Monkey", "Human")
severity = "Unknown"
+1 -1
View File
@@ -8,7 +8,7 @@
agent = ""
affected_species = list("Human")
desc = "A DNA-altering retrovirus that scrambles the structural and unique enzymes of a host constantly."
severity = "Severe"
severity = "Dangerous!"
permeability_mod = 0.4
stage_prob = 2
var/SE
+1
View File
@@ -8,6 +8,7 @@
agent = "Unknown"
affected_species = list("Human")
permeability_mod = 1
severity = "BIOHAZARD THREAT!"
/datum/disease/rhumba_beat/stage_act()
..()
+8 -2
View File
@@ -7,7 +7,7 @@
cure = "A coder's love (theoretical)."
agent = "Shenanigans"
affected_species = list("Human", "Monkey", "Alien")
severity = "Major"
severity = "Harmful"
stage_prob = 10
hidden = list(1, 1)
var/list/stage1 = list("You feel unremarkable.")
@@ -78,7 +78,7 @@
curable = 0
longevity = 30
desc = "Monkeys with this disease will bite humans, causing humans to mutate into a monkey."
severity = "Major"
severity = "BIOHAZARD THREAT!"
hidden = list(0, 0)//Not hidden, with the exception of the starting ape.
stage_prob = 4
agent = "Kongey Vibrion M-909"
@@ -123,6 +123,7 @@
cure_chance = 5
agent = "R2D2 Nanomachines"
desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg."
severity = "Dangerous!"
hidden = list(0, 0)
stage1 = null
stage2 = list("Your joints feel stiff.", "<span class='danger'>Beep...boop..</span>")
@@ -131,6 +132,7 @@
stage5 = list("<span class='danger'>Your skin feels as if it's about to burst off!</span>")
new_form = /mob/living/silicon/robot
/datum/disease/transformation/robot/stage_act()
..()
switch(stage)
@@ -152,6 +154,8 @@
cure_id = list("spaceacillin", "glycerol")
cure_chance = 5
agent = "Rip-LEY Alien Microbes"
desc = "This disease changes the victim into a xenomorph."
severity = "BIOHAZARD THREAT!"
hidden = list(0, 0)
stage1 = null
stage2 = list("Your throat feels scratchy.", "<span class='danger'>Kill...</span>")
@@ -179,6 +183,7 @@
cure_chance = 80
agent = "Advanced Mutation Toxin"
desc = "This highly concentrated extract converts anything into more of itself."
severity = "BIOHAZARD THREAT!"
hidden = list(0, 0)
stage1 = list("You don't feel very well.")
stage2 = list("You are turning a little green.")
@@ -204,6 +209,7 @@
name = "The Barkening"
cure = "Death"
agent = "Fell Doge Majicks"
desc = "This disease transforms the victim into a corgi."
hidden = list(0, 0)
stage1 = list("BARK.")
stage2 = list("You feel the need to wear silly hats.")
+1 -1
View File
@@ -10,7 +10,7 @@
curable = 1
permeability_mod = 0.75
desc = "Some speculate, that this virus is the cause of Wizard Federation existance. Subjects affected show the signs of mental retardation, yelling obscure sentences or total gibberish. On late stages subjects sometime express the feelings of inner power, and, cite, 'the ability to control the forces of cosmos themselves!' A gulp of strong, manly spirits usually reverts them to normal, humanlike, condition."
severity = "Major"
severity = "Harmful"
requires = 1
required_limb = list(/obj/item/organ/limb/head)
+2 -1
View File
@@ -100,7 +100,8 @@ proc/med_hud_suit_sensors(var/mob/living/carbon/human/patient)
proc/med_hud_find_virus(var/mob/living/carbon/human/patient)
for(var/datum/disease/D in patient.viruses)
if(!D.hidden[SCANNER])
return 1
if(D.severity != D.non_threat)
return 1
proc/med_hud_get_health(var/mob/living/carbon/human/patient)
var/image/holder = patient.hud_list[HEALTH_HUD]
+9 -2
View File
@@ -365,7 +365,11 @@
for(var/datum/disease/D in C.viruses)
if((D.stage > 1) || (D.spread_type == AIRBORNE))
if((D.hidden[SCANNER]) || (D.hidden[PANDEMIC])) //the medibot can't detect viruses that are undetectable to Health Analyzers or Pandemic machines.
return 0
if(D.severity == D.non_threat) // medibot doesn't try to heal truly harmless viruses
return 0
if((D.stage > 1) || (D.spread_type == AIRBORNE)) // medibot can't detect a virus in its initial stage unless it spreads airborne.
if (!C.reagents.has_reagent(src.treatment_virus))
return 1 //STOP DISEASE FOREVER
@@ -400,7 +404,10 @@
else
var/virus = 0
for(var/datum/disease/D in C.viruses)
virus = 1
if((!D.hidden[SCANNER]) && (!D.hidden[PANDEMIC])) //detectable virus
if(D.severity != D.non_threat) //virus is harmful
if((D.stage > 1) || (D.spread_type == AIRBORNE))
virus = 1
if (!reagent_id && (virus))
if(!C.reagents.has_reagent(src.treatment_virus))