Refactors virus spreading

This commit is contained in:
XDTM
2017-10-09 08:55:57 -05:00
committed by CitadelStationBot
parent 6f2b89ae88
commit 7a0ce217db
60 changed files with 1057 additions and 187 deletions
+27 -8
View File
@@ -61,16 +61,12 @@
//called when a carbon changes virus
/mob/living/carbon/proc/check_virus()
var/threat = 0
var/threat
for(var/thing in viruses)
var/datum/disease/D = thing
if(!(D.visibility_flags & HIDDEN_SCANNER))
if (D.severity != NONTHREAT) //a buffing virus gets an icon
threat = 2
return threat //harmful viruses have priority
else
threat = 1 //aka good virus
if(!threat || D.severity > threat) //a buffing virus gets an icon
threat = D.severity
return threat
//helper for getting the appropriate health status
@@ -162,21 +158,44 @@
/mob/living/carbon/med_hud_set_status()
var/image/holder = hud_list[STATUS_HUD]
var/icon/I = icon(icon, icon_state, dir)
<<<<<<< HEAD
var/virus_state = check_virus()
var/mob/living/simple_animal/borer/B = has_brain_worms()
=======
var/virus_threat = check_virus()
>>>>>>> db0c10e... Refactors virus spreading (#31066)
holder.pixel_y = I.Height() - world.icon_size
if(status_flags & XENO_HOST)
holder.icon_state = "hudxeno"
else if(stat == DEAD || (status_flags & FAKEDEATH))
holder.icon_state = "huddead"
<<<<<<< HEAD
else if(has_brain_worms() && B != null && B.controlling)
holder.icon_state = "hudbrainworm"
else if(virus_state == 2)
holder.icon_state = "hudill"
else if(virus_state == 1)
holder.icon_state = "hudbuff"
=======
>>>>>>> db0c10e... Refactors virus spreading (#31066)
else
holder.icon_state = "hudhealthy"
switch(virus_threat)
if(VIRUS_SEVERITY_BIOHAZARD)
holder.icon_state = "hudill5"
if(VIRUS_SEVERITY_DANGEROUS)
holder.icon_state = "hudill4"
if(VIRUS_SEVERITY_HARMFUL)
holder.icon_state = "hudill3"
if(VIRUS_SEVERITY_MEDIUM)
holder.icon_state = "hudill2"
if(VIRUS_SEVERITY_MINOR)
holder.icon_state = "hudill1"
if(VIRUS_SEVERITY_NONTHREAT)
holder.icon_state = "hudill0"
if(VIRUS_SEVERITY_POSITIVE)
holder.icon_state = "hudbuff"
if(null)
holder.icon_state = "hudhealthy"
/***********************************************