Skip to content

Commit

Permalink
oh god it works properly
Browse files Browse the repository at this point in the history
  • Loading branch information
NithaIsTired committed Feb 9, 2024
1 parent a0816ac commit 243b44e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 14 deletions.
16 changes: 2 additions & 14 deletions code/game/data_huds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Medical HUD! Basic mode needs suit sensors on.
holder.icon_state = "huddead"
else
holder.icon_state = "hudhealthy"

/* Moved to zubbers
/mob/living/carbon/med_hud_set_status()
var/image/holder = hud_list?[STATUS_HUD]
if (isnull(holder))
Expand Down Expand Up @@ -230,19 +230,7 @@ Medical HUD! Basic mode needs suit sensors on.
if(DISEASE_SEVERITY_POSITIVE)
holder.icon_state = "hudbuff"
if(null)
holder.icon_state = "hudhealthy"
// Wound huds
var/highest_severity_found = FALSE
for (var/datum/wound/wound in all_wounds)
if (wound.severity == WOUND_SEVERITY_CRITICAL)
holder.icon_state = "hudcriticalwound"
highest_severity_found = TRUE
else if (wound.severity == WOUND_SEVERITY_SEVERE && !highest_severity_found)
holder.icon_state = "hudseverewound"
highest_severity_found = TRUE
else if (wound.severity == WOUND_SEVERITY_MODERATE && !highest_severity_found)
holder.icon_state = "hudmoderatewound"
highest_severity_found = TRUE
holder.icon_state = "hudhealthy" */

/***********************************************
FAN HUDs! For identifying other fans on-sight.
Expand Down
67 changes: 67 additions & 0 deletions modular_zubbers/code/game/data_huds.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/mob/living/carbon
var/flickering_wound_hud = FALSE
var/flickering_virus_hud = FALSE

/mob/living/carbon/med_hud_set_status()
var/image/holder = hud_list?[STATUS_HUD]
if (isnull(holder))
return

var/icon/I = icon(icon, icon_state, dir)
var/virus_threat = check_virus()
holder.pixel_y = I.Height() - world.icon_size
if(HAS_TRAIT(src, TRAIT_XENO_HOST))
holder.icon_state = "hudxeno"
else if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH)))
if(can_defib_client())
holder.icon_state = "huddefib"
else
holder.icon_state = "huddead"
else
if(!flickering_wound_hud)
switch(virus_threat)
if(DISEASE_SEVERITY_UNCURABLE)
holder.icon_state = "hudill6"
if(DISEASE_SEVERITY_BIOHAZARD)
holder.icon_state = "hudill5"
if(DISEASE_SEVERITY_DANGEROUS)
holder.icon_state = "hudill4"
if(DISEASE_SEVERITY_HARMFUL)
holder.icon_state = "hudill3"
if(DISEASE_SEVERITY_MEDIUM)
holder.icon_state = "hudill2"
if(DISEASE_SEVERITY_MINOR)
holder.icon_state = "hudill1"
if(DISEASE_SEVERITY_NONTHREAT)
holder.icon_state = "hudill0"
if(DISEASE_SEVERITY_POSITIVE)
holder.icon_state = "hudbuff"
if(null)
holder.icon_state = "hudhealthy"
// Wound huds
if(virus_threat && flickering_virus_hud)
return
var/highest_severity_found = FALSE
var/previous_virus_icon_state = holder.icon_state
for (var/datum/wound/wound in all_wounds)
if (wound.severity == WOUND_SEVERITY_CRITICAL)
holder.icon_state = "hudcriticalwound"
highest_severity_found = TRUE
else if (wound.severity == WOUND_SEVERITY_SEVERE && !highest_severity_found)
holder.icon_state = "hudseverewound"
highest_severity_found = TRUE
else if (wound.severity == WOUND_SEVERITY_MODERATE && !highest_severity_found)
holder.icon_state = "hudmoderatewound"
highest_severity_found = TRUE
if(highest_severity_found && !flickering_wound_hud && virus_threat)
addtimer(CALLBACK(src, PROC_REF(update_hud)), 1 SECONDS)
flickering_wound_hud = TRUE

/mob/living/carbon/proc/update_hud(post_cooldown)
flickering_wound_hud = FALSE
if(!post_cooldown)
flickering_virus_hud = TRUE
addtimer(CALLBACK(src, PROC_REF(update_hud), TRUE), 1 SECONDS)
return med_hud_set_status()
flickering_virus_hud = FALSE
return med_hud_set_status()
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -8088,6 +8088,7 @@
#include "modular_zubbers\code\datums\mood_events\miasma_events.dm"
#include "modular_zubbers\code\datums\shuttle\arena.dm"
#include "modular_zubbers\code\datums\shuttles\emergency.dm"
#include "modular_zubbers\code\game\data_huds.dm"
#include "modular_zubbers\code\game\area\areas\burgerstation.dm"
#include "modular_zubbers\code\game\area\areas\centcom.dm"
#include "modular_zubbers\code\game\area\areas\station.dm"
Expand Down

0 comments on commit 243b44e

Please sign in to comment.