diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index ea3690f8bed..1e9a9173022 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -107,6 +107,10 @@ #define ui_internal "EAST-1:28,CENTER:17" #define ui_mood "EAST-1:28,CENTER-3:10" +//living +#define ui_living_pull "EAST-1:28,CENTER-2:15" +#define ui_living_health "EAST-1:28,CENTER:15" + //borgs #define ui_borg_health "EAST-1:28,CENTER-1:15" //borgs have the health display where humans have the pressure damage indicator. @@ -117,10 +121,10 @@ //constructs #define ui_construct_pull "EAST,CENTER-2:15" -#define ui_construct_health "EAST,CENTER:15" //same as borgs and humans +#define ui_construct_health "EAST,CENTER:15" //same as humans and slimes //slimes -#define ui_slime_health "EAST,CENTER:15" //same as borgs, constructs and humans +#define ui_slime_health "EAST,CENTER:15" //same as humans and constructs // AI diff --git a/code/_onclick/hud/guardian.dm b/code/_onclick/hud/guardian.dm index 2a1858bae53..9f41f7cfcdc 100644 --- a/code/_onclick/hud/guardian.dm +++ b/code/_onclick/hud/guardian.dm @@ -1,8 +1,17 @@ +/datum/hud/guardian + ui_style = 'icons/mob/guardian.dmi' /datum/hud/guardian/New(mob/living/simple_animal/hostile/guardian/owner) ..() var/obj/screen/using + pull_icon = new /obj/screen/pull() + pull_icon.icon = ui_style + pull_icon.update_icon() + pull_icon.screen_loc = ui_living_pull + pull_icon.hud = src + static_inventory += pull_icon + healths = new /obj/screen/healths/guardian() healths.hud = src infodisplay += healths @@ -32,6 +41,9 @@ using.hud = src static_inventory += using +/datum/hud/dextrous/guardian + ui_style = 'icons/mob/guardian.dmi' + /datum/hud/dextrous/guardian/New(mob/living/simple_animal/hostile/guardian/owner) //for a dextrous guardian ..() var/obj/screen/using @@ -59,6 +71,13 @@ using.hud = src static_inventory += using + pull_icon = new /obj/screen/pull() + pull_icon.icon = ui_style + pull_icon.update_icon() + pull_icon.screen_loc = ui_living_pull + pull_icon.hud = src + static_inventory += pull_icon + healths = new /obj/screen/healths/guardian() healths.hud = src infodisplay += healths diff --git a/code/_onclick/hud/lavaland_elite.dm b/code/_onclick/hud/lavaland_elite.dm index 480e0e398e0..277ea8b898a 100644 --- a/code/_onclick/hud/lavaland_elite.dm +++ b/code/_onclick/hud/lavaland_elite.dm @@ -1,7 +1,16 @@ /datum/hud/lavaland_elite - ui_style = 'icons/mob/screen_slime.dmi' + ui_style = 'icons/mob/screen_elite.dmi' /datum/hud/lavaland_elite/New(mob/living/simple_animal/hostile/asteroid/elite) ..() + + pull_icon = new /obj/screen/pull() + pull_icon.icon = ui_style + pull_icon.update_icon() + pull_icon.screen_loc = ui_living_pull + pull_icon.hud = src + static_inventory += pull_icon + healths = new /obj/screen/healths/lavaland_elite() + healths.hud = src infodisplay += healths diff --git a/code/_onclick/hud/living.dm b/code/_onclick/hud/living.dm new file mode 100644 index 00000000000..7f9e1ffc493 --- /dev/null +++ b/code/_onclick/hud/living.dm @@ -0,0 +1,16 @@ +/datum/hud/living + ui_style = 'icons/mob/screen_gen.dmi' + +/datum/hud/living/New(mob/living/owner) + ..() + + pull_icon = new /obj/screen/pull() + pull_icon.icon = ui_style + pull_icon.update_icon() + pull_icon.screen_loc = ui_living_pull + pull_icon.hud = src + static_inventory += pull_icon + + healths = new /obj/screen/healths/living() + healths.hud = src + infodisplay += healths diff --git a/code/_onclick/hud/revenanthud.dm b/code/_onclick/hud/revenanthud.dm index 93693139411..eca0c45b0be 100644 --- a/code/_onclick/hud/revenanthud.dm +++ b/code/_onclick/hud/revenanthud.dm @@ -1,7 +1,16 @@ +/datum/hud/revenant + ui_style = 'icons/mob/screen_gen.dmi' /datum/hud/revenant/New(mob/owner) ..() + pull_icon = new /obj/screen/pull() + pull_icon.icon = ui_style + pull_icon.update_icon() + pull_icon.screen_loc = ui_living_pull + pull_icon.hud = src + static_inventory += pull_icon + healths = new /obj/screen/healths/revenant() healths.hud = src infodisplay += healths diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index b51b8150f07..b70d0ac3e96 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -588,6 +588,10 @@ icon_state = "health0" screen_loc = ui_health +/obj/screen/healths/living + screen_loc = ui_living_health + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + /obj/screen/healths/alien icon = 'icons/mob/screen_alien.dmi' screen_loc = ui_alien_health @@ -616,14 +620,14 @@ name = "summoner health" icon = 'icons/mob/guardian.dmi' icon_state = "base" - screen_loc = ui_health + screen_loc = ui_living_health mouse_opacity = MOUSE_OPACITY_TRANSPARENT /obj/screen/healths/revenant name = "essence" icon = 'icons/mob/actions/backgrounds.dmi' icon_state = "bg_revenant" - screen_loc = ui_health + screen_loc = ui_living_health mouse_opacity = MOUSE_OPACITY_TRANSPARENT /obj/screen/healths/construct @@ -641,7 +645,7 @@ /obj/screen/healths/lavaland_elite icon = 'icons/mob/screen_elite.dmi' icon_state = "elite_health0" - screen_loc = ui_health + screen_loc = ui_living_health mouse_opacity = MOUSE_OPACITY_TRANSPARENT /obj/screen/healthdoll diff --git a/code/_onclick/hud/slime.dm b/code/_onclick/hud/slime.dm index 44845e0b70a..46df28799bf 100644 --- a/code/_onclick/hud/slime.dm +++ b/code/_onclick/hud/slime.dm @@ -3,6 +3,14 @@ /datum/hud/slime/New(mob/living/simple_animal/slime/owner) ..() + + pull_icon = new /obj/screen/pull() + pull_icon.icon = ui_style + pull_icon.update_icon() + pull_icon.screen_loc = ui_living_pull + pull_icon.hud = src + static_inventory += pull_icon + healths = new /obj/screen/healths/slime() healths.hud = src infodisplay += healths diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 694f063d651..45ee4dab0ae 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -493,6 +493,37 @@ update_stat() med_hud_set_health() med_hud_set_status() + update_health_hud() + +/mob/living/update_health_hud() + if(hud_used?.healths) + var/severity = 0 + var/healthpercent = (health/maxHealth) * 100 + switch(healthpercent) + if(100 to INFINITY) + hud_used.healths.icon_state = "health0" + if(80 to 100) + hud_used.healths.icon_state = "health1" + severity = 1 + if(60 to 80) + hud_used.healths.icon_state = "health2" + severity = 2 + if(40 to 60) + hud_used.healths.icon_state = "health3" + severity = 3 + if(20 to 40) + hud_used.healths.icon_state = "health4" + severity = 4 + if(1 to 20) + hud_used.healths.icon_state = "health5" + severity = 5 + else + hud_used.healths.icon_state = "health7" + severity = 6 + if(severity > 0) + overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity) + else + clear_fullscreen("brute") //Proc used to resuscitate a mob, for full_heal see fully_heal() /mob/living/proc/revive(full_heal = FALSE, admin_revive = FALSE) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 79e63245df1..4e290255416 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -5,6 +5,8 @@ hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD) pressure_resistance = 10 + hud_type = /datum/hud/living + var/resize = 1 //Badminnery resize var/lastattacker = null var/lastattackerckey = null diff --git a/icons/mob/guardian.dmi b/icons/mob/guardian.dmi index 984beee8671..3737e47f6ee 100644 Binary files a/icons/mob/guardian.dmi and b/icons/mob/guardian.dmi differ diff --git a/icons/mob/screen_construct.dmi b/icons/mob/screen_construct.dmi index 82dbe19cf65..55f4f097702 100644 Binary files a/icons/mob/screen_construct.dmi and b/icons/mob/screen_construct.dmi differ diff --git a/icons/mob/screen_elite.dmi b/icons/mob/screen_elite.dmi index 19d38911c70..f407fb79e41 100644 Binary files a/icons/mob/screen_elite.dmi and b/icons/mob/screen_elite.dmi differ diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index f2ca992eb56..bc1dba8ec86 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ diff --git a/icons/mob/screen_slime.dmi b/icons/mob/screen_slime.dmi index a93efdc7a28..b9bc909c7ac 100644 Binary files a/icons/mob/screen_slime.dmi and b/icons/mob/screen_slime.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 5098ebc63fa..f1735795b14 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -207,6 +207,7 @@ #include "code\_onclick\hud\hud.dm" #include "code\_onclick\hud\human.dm" #include "code\_onclick\hud\lavaland_elite.dm" +#include "code\_onclick\hud\living.dm" #include "code\_onclick\hud\monkey.dm" #include "code\_onclick\hud\movable_screen_objects.dm" #include "code\_onclick\hud\pai.dm"