diff --git a/code/datums/atom_hud.dm b/code/datums/atom_hud.dm index 496bc837685..75e60e2fcdd 100644 --- a/code/datums/atom_hud.dm +++ b/code/datums/atom_hud.dm @@ -1,7 +1,6 @@ /* HUD DATUMS */ GLOBAL_LIST_EMPTY(all_huds) - //GLOBAL HUD LIST GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( DATA_HUD_BASIC = new /datum/atom_hud/simple, @@ -20,13 +19,10 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( DATA_HUD_SQUAD_SOM = new /datum/atom_hud/squad_som, DATA_HUD_XENO_DEBUFF = new /datum/atom_hud/xeno_debuff, DATA_HUD_XENO_HEART = new /datum/atom_hud/xeno_heart, - //RU TGMC EDIT DATA_HUD_HUNTER = new /datum/atom_hud/hunter_hud, DATA_HUD_HUNTER_CLAN = new /datum/atom_hud/hunter_clan - //RU TGMC EDIT )) - /datum/atom_hud var/list/atom/hudatoms = list() //list of all atoms which display this hud var/list/mob/hudusers = list() //list with all mobs who can see the hud @@ -35,11 +31,9 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( var/list/next_time_allowed = list() //mobs associated with the next time this hud can be added to them var/list/queued_to_see = list() //mobs that have triggered the cooldown and are queued to see the hud, but do not yet - /datum/atom_hud/New() GLOB.all_huds += src - /datum/atom_hud/Destroy() for(var/v in hudusers) remove_hud_from(v) @@ -49,7 +43,6 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( GLOB.all_huds -= src return ..() - /datum/atom_hud/proc/remove_hud_from(mob/M) if(!M || !hudusers[M]) return @@ -60,7 +53,6 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( for(var/atom/A AS in hudatoms) remove_from_single_hud(M, A) - /datum/atom_hud/proc/remove_from_hud(atom/A) SIGNAL_HANDLER if(!A) @@ -72,14 +64,12 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( hudatoms -= A return TRUE - /datum/atom_hud/proc/remove_from_single_hud(mob/M, atom/A) //unsafe, no sanity apart from client if(!M || !M.client || !A || !A.hud_list) return for(var/i in hud_icons) M.client.images -= A.hud_list[i] - /datum/atom_hud/proc/add_hud_to(mob/M) if(!M || hudusers[M]) return @@ -95,7 +85,6 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( for(var/atom/A in hudatoms) add_to_single_hud(M, A) - /datum/atom_hud/proc/show_hud_images_after_cooldown(M) if(queued_to_see[M]) queued_to_see -= M @@ -104,7 +93,6 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( var/atom/hud_atom = h add_to_single_hud(M, hud_atom) - /datum/atom_hud/proc/add_to_hud(atom/A) if(!A || (A in hudatoms)) return FALSE @@ -117,7 +105,6 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( add_to_single_hud(M, A) return TRUE - /datum/atom_hud/proc/add_to_single_hud(mob/M, atom/A) //unsafe, no sanity apart from client if(!M || !M.client || !A) return @@ -125,29 +112,23 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/atom_hud, list( if(A.hud_list[i]) M.client.images |= A.hud_list[i] - /datum/atom_hud/proc/clean_mob_refs(datum/source, force) SIGNAL_HANDLER - remove_hud_from(source) remove_from_hud(source) next_time_allowed -= source - /mob/proc/reload_huds() for(var/datum/atom_hud/hud in GLOB.all_huds) if(hud?.hudusers[src]) for(var/atom/A in hud.hudatoms) hud.add_to_single_hud(src, A) - /mob/new_player/reload_huds() return - /mob/proc/add_click_catcher() client.screen += client.void - /mob/new_player/add_click_catcher() return diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 28ce1f58987..893b1c008fc 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -6,11 +6,9 @@ */ /* DATA HUD DATUMS */ - /atom/proc/add_to_all_mob_huds() return - /mob/living/carbon/human/add_to_all_mob_huds() for(var/h in GLOB.huds) if(istype(h, /datum/atom_hud/xeno)) //this one is xeno only @@ -18,7 +16,6 @@ var/datum/atom_hud/hud = h hud.add_to_hud(src) - /mob/living/carbon/xenomorph/add_to_all_mob_huds() for(var/h in GLOB.huds) if(!istype(h, /datum/atom_hud/xeno)) @@ -26,11 +23,9 @@ var/datum/atom_hud/hud = h hud.add_to_hud(src) - /atom/proc/remove_from_all_mob_huds() return - /mob/living/carbon/human/remove_from_all_mob_huds() for(var/h in GLOB.huds) if(istype(h, /datum/atom_hud/xeno)) @@ -45,19 +40,15 @@ var/datum/atom_hud/hud = h hud.remove_from_hud(src) - /datum/atom_hud/simple //Naked-eye observable statuses. hud_icons = list(STATUS_HUD_SIMPLE) - /datum/atom_hud/medical hud_icons = list(HEALTH_HUD, STATUS_HUD) - //med hud used by silicons, only shows humans with a uniform with sensor mode activated. /datum/atom_hud/medical/basic - /datum/atom_hud/medical/basic/proc/check_sensors(mob/living/carbon/human/H) if(!istype(H)) return FALSE @@ -68,45 +59,36 @@ return FALSE return TRUE - /datum/atom_hud/medical/basic/add_to_single_hud(mob/user, mob/target) if(check_sensors(user)) return ..() - /datum/atom_hud/medical/basic/proc/update_suit_sensors(mob/living/carbon/human/H) if(check_sensors(H)) add_to_hud(H) else remove_from_hud(H) - /mob/living/carbon/human/proc/update_suit_sensors() var/datum/atom_hud/medical/basic/B = GLOB.huds[DATA_HUD_MEDICAL_BASIC] B.update_suit_sensors(src) - //med hud used by medical hud glasses /datum/atom_hud/medical/advanced - //HUD used by the synth, separate typepath so it's not accidentally removed. /datum/atom_hud/medical/advanced/synthetic - //medical hud used by ghosts /datum/atom_hud/medical/observer hud_icons = list(HEALTH_HUD, XENO_EMBRYO_HUD, XENO_REAGENT_HUD, XENO_DEBUFF_HUD, STATUS_HUD, MACHINE_HEALTH_HUD, MACHINE_AMMO_HUD, XENO_BANISHED_HUD, HUNTER_CLAN, HUNTER_HUD, HUNTER_HEALTH_HUD) - /datum/atom_hud/medical/pain hud_icons = list(PAIN_HUD) - /mob/proc/med_hud_set_health() return - /mob/living/carbon/xenomorph/med_hud_set_health() var/image/holder = hud_list[HEALTH_HUD_XENO] if(!holder) @@ -120,84 +102,21 @@ amount = -1 //don't want the 'zero health' icon when we are crit holder.icon_state = "xenohealth[amount]" - /mob/living/carbon/human/med_hud_set_health(hud_holder = HEALTH_HUD) var/image/holder = hud_list[HEALTH_HUD] if(stat == DEAD) - holder.icon_state = "hudhealth-100" + holder.icon_state = "hudhealth98" return - - var/percentage = round(health * 100 / maxHealth) - switch(percentage) - if(100 to INFINITY) - holder.icon_state = "hudhealth100" - if(90 to 99) - holder.icon_state = "hudhealth90" - if(80 to 89) - holder.icon_state = "hudhealth80" - if(70 to 79) - holder.icon_state = "hudhealth70" - if(60 to 69) - holder.icon_state = "hudhealth60" - if(50 to 59) - holder.icon_state = "hudhealth50" - if(45 to 49) - holder.icon_state = "hudhealth45" - if(40 to 44) - holder.icon_state = "hudhealth40" - if(35 to 39) - holder.icon_state = "hudhealth35" - if(30 to 34) - holder.icon_state = "hudhealth30" - if(25 to 29) - holder.icon_state = "hudhealth25" - if(20 to 24) - holder.icon_state = "hudhealth20" - if(15 to 19) - holder.icon_state = "hudhealth15" - if(10 to 14) - holder.icon_state = "hudhealth10" - if(5 to 9) - holder.icon_state = "hudhealth5" - if(0 to 4) - holder.icon_state = "hudhealth0" - if(-4 to -1) - holder.icon_state = "hudhealth-5" - if(-9 to -5) - holder.icon_state = "hudhealth-10" - if(-19 to -10) - holder.icon_state = "hudhealth-20" - if(-29 to -20) - holder.icon_state = "hudhealth-30" - if(-39 to -30) - holder.icon_state = "hudhealth-40" - if(-49 to -40) - holder.icon_state = "hudhealth-50" - if(-59 to -50) - holder.icon_state = "hudhealth-60" - if(-69 to -60) - holder.icon_state = "hudhealth-70" - if(-79 to -70) - holder.icon_state = "hudhealth-80" - if(-89 to -80) - holder.icon_state = "hudhealth-90" - if(-94 to -90) - holder.icon_state = "hudhealth-95" - if(-99 to -95) - holder.icon_state = "hudhealth-99" - else - holder.icon_state = "hudhealth-100" - + var/percentage = round(health * 100 / maxHealth, 7) // rounding to 7 because there are 14 pixel lines in the health hud + holder.icon_state = "hudhealth[percentage]" /mob/proc/med_hud_set_status() //called when mob stat changes, or get a virus/xeno host, etc return - /mob/living/carbon/xenomorph/med_hud_set_status() hud_set_plasma() hud_set_pheromone() - /mob/living/carbon/human/med_hud_set_status() var/image/status_hud = hud_list[STATUS_HUD] //Status for med-hud. var/image/infection_hud = hud_list[XENO_EMBRYO_HUD] //State of the xeno embryo. @@ -421,11 +340,9 @@ #define PAIN_RATIO_PAIN_HUD 0.25 #define STAMINA_RATIO_PAIN_HUD 0.25 - /mob/proc/med_pain_set_perceived_health() return - /mob/living/carbon/human/med_pain_set_perceived_health() if(species?.species_flags & IS_SYNTHETIC) return FALSE @@ -433,7 +350,7 @@ return FALSE var/image/holder = hud_list[PAIN_HUD] if(stat == DEAD) - holder.icon_state = "hudhealth-100" + holder.icon_state = "hudhealth98" return TRUE var/perceived_health = round(health * 100 / maxHealth) @@ -442,68 +359,9 @@ if(!(species.species_flags & NO_STAMINA) && staminaloss > 0) perceived_health -= STAMINA_RATIO_PAIN_HUD * staminaloss - switch(perceived_health) - if(100 to INFINITY) - holder.icon_state = "hudhealth100" - if(90 to 99) - holder.icon_state = "hudhealth90" - if(80 to 89) - holder.icon_state = "hudhealth80" - if(70 to 79) - holder.icon_state = "hudhealth70" - if(60 to 69) - holder.icon_state = "hudhealth60" - if(50 to 59) - holder.icon_state = "hudhealth50" - if(45 to 49) - holder.icon_state = "hudhealth45" - if(40 to 44) - holder.icon_state = "hudhealth40" - if(35 to 39) - holder.icon_state = "hudhealth35" - if(30 to 34) - holder.icon_state = "hudhealth30" - if(25 to 29) - holder.icon_state = "hudhealth25" - if(20 to 24) - holder.icon_state = "hudhealth20" - if(15 to 19) - holder.icon_state = "hudhealth15" - if(10 to 14) - holder.icon_state = "hudhealth10" - if(5 to 9) - holder.icon_state = "hudhealth5" - if(0 to 4) - holder.icon_state = "hudhealth0" - if(-4 to -1) - holder.icon_state = "hudhealth-5" - if(-9 to -5) - holder.icon_state = "hudhealth-10" - if(-19 to -10) - holder.icon_state = "hudhealth-20" - if(-29 to -20) - holder.icon_state = "hudhealth-30" - if(-39 to -30) - holder.icon_state = "hudhealth-40" - if(-49 to -40) - holder.icon_state = "hudhealth-50" - if(-59 to -50) - holder.icon_state = "hudhealth-60" - if(-69 to -60) - holder.icon_state = "hudhealth-70" - if(-79 to -70) - holder.icon_state = "hudhealth-80" - if(-89 to -80) - holder.icon_state = "hudhealth-90" - if(-94 to -90) - holder.icon_state = "hudhealth-95" - if(-99 to -95) - holder.icon_state = "hudhealth-99" - + holder.icon_state = "hudhealth[clamp(round(perceived_health, 7), -98, 98)]" // rounding to 7 because there are 14 pixel lines in the health hud return TRUE - - //infection status that appears on humans and monkeys, viewed by xenos only. /datum/atom_hud/xeno_infection hud_icons = list(XENO_EMBRYO_HUD) @@ -566,7 +424,6 @@ if(16 to INFINITY) holder.icon_state = "firestack4" - /mob/living/carbon/xenomorph/proc/hud_set_plasma() if(!xeno_caste) // usually happens because hud ticks before New() finishes. return @@ -581,7 +438,6 @@ var/wrath_amount = xeno_caste.wrath_max? round(wrath_stored * 100 / xeno_caste.wrath_max, 10) : 0 holder.overlays += "wrath[wrath_amount]" - /mob/living/carbon/xenomorph/proc/hud_set_pheromone() var/image/holder = hud_list[PHEROMONE_HUD] if(!holder) @@ -659,7 +515,6 @@ /datum/atom_hud/security hud_icons = list(WANTED_HUD) - /mob/living/carbon/human/proc/sec_hud_set_security_status() var/image/holder = hud_list[WANTED_HUD] holder.icon_state = "hudblank" @@ -681,7 +536,6 @@ holder.icon_state = "hudreleased" break - /datum/atom_hud/squad hud_icons = list(SQUAD_HUD_TERRAGOV, MACHINE_HEALTH_HUD, MACHINE_AMMO_HUD) @@ -691,7 +545,6 @@ /mob/proc/hud_set_job(faction = FACTION_TERRAGOV) return - /mob/living/carbon/human/hud_set_job(faction = FACTION_TERRAGOV) var/hud_type switch(faction) @@ -726,11 +579,9 @@ hud_list[hud_type] = holder - /datum/atom_hud/order hud_icons = list(ORDER_HUD) - /mob/living/carbon/human/proc/hud_set_order() var/image/holder = hud_list[ORDER_HUD] holder.icon_state = "hudblank" @@ -745,7 +596,6 @@ if(tempname) holder.icon_state = "hud[tempname]" - hud_list[ORDER_HUD] = holder //Only called when an aura is added or removed @@ -842,7 +692,6 @@ /datum/atom_hud/hunter_clan hud_icons = list(HUNTER_CLAN) - /datum/atom_hud/hunter_hud hud_icons = list(HUNTER_HUD, HUNTER_HEALTH_HUD) diff --git a/icons/mob/hud.dmi b/icons/mob/hud.dmi index ba57f910f6b..6918f8de8d3 100644 Binary files a/icons/mob/hud.dmi and b/icons/mob/hud.dmi differ