Generic living HUD (#47685)

This commit is contained in:
Arkatos1
2019-11-24 05:15:54 +01:00
committed by skoglol
parent 8f2ba4c48f
commit 0cfde60db2
15 changed files with 109 additions and 6 deletions
+6 -2
View File
@@ -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
+19
View File
@@ -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
+10 -1
View File
@@ -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
+16
View File
@@ -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
+9
View File
@@ -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
+7 -3
View File
@@ -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
+8
View File
@@ -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
+31
View File
@@ -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)
@@ -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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

+1
View File
@@ -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"