mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Merge pull request #9524 from Heroman3003/shadehud2
Consolidates and updates shadekin energy/darkness HUD
This commit is contained in:
committed by
Chompstation Bot
parent
c4e352dad2
commit
e8bebaf761
@@ -1,3 +1,2 @@
|
||||
#define ui_shadekin_dark_display "EAST-1:28,CENTER-3:15"
|
||||
#define ui_shadekin_energy_display "EAST-1:28,CENTER-4:15"
|
||||
#define ui_shadekin_display "EAST-1:28,CENTER-3:15"
|
||||
#define ui_xenochimera_danger_display "EAST-1:28,CENTER-3:15"
|
||||
@@ -14,7 +14,7 @@
|
||||
var/other = list()
|
||||
var/hotkeybuttons = list()
|
||||
var/slot_info = list()
|
||||
|
||||
|
||||
HUD.adding = adding
|
||||
HUD.other = other
|
||||
HUD.hotkeybuttons = hotkeybuttons //These can be disabled for hotkey users
|
||||
@@ -258,15 +258,10 @@
|
||||
hud_elements |= healths
|
||||
|
||||
//VOREStation Addition begin
|
||||
shadekin_dark_display = new /obj/screen/shadekin/darkness()
|
||||
shadekin_dark_display.screen_loc = ui_shadekin_dark_display
|
||||
shadekin_dark_display.icon_state = "dark"
|
||||
hud_elements |= shadekin_dark_display
|
||||
|
||||
shadekin_energy_display = new /obj/screen/shadekin/energy()
|
||||
shadekin_energy_display.screen_loc = ui_shadekin_energy_display
|
||||
shadekin_energy_display.icon_state = "energy0"
|
||||
hud_elements |= shadekin_energy_display
|
||||
shadekin_display = new /obj/screen/shadekin()
|
||||
shadekin_display.screen_loc = ui_shadekin_display
|
||||
shadekin_display.icon_state = "shadekin"
|
||||
hud_elements |= shadekin_display
|
||||
|
||||
xenochimera_danger_display = new /obj/screen/xenochimera/danger_level()
|
||||
xenochimera_danger_display.screen_loc = ui_xenochimera_danger_display
|
||||
|
||||
@@ -223,34 +223,37 @@
|
||||
|
||||
/datum/species/shadekin/proc/update_shadekin_hud(var/mob/living/carbon/human/H)
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T)
|
||||
return
|
||||
if(H.shadekin_energy_display)
|
||||
H.shadekin_energy_display.invisibility = 0
|
||||
if(H.shadekin_display)
|
||||
var/l_icon = 0
|
||||
var/e_icon = 0
|
||||
|
||||
H.shadekin_display.invisibility = 0
|
||||
if(T)
|
||||
var/brightness = T.get_lumcount() //Brightness in 0.0 to 1.0
|
||||
var/darkness = 1-brightness //Invert
|
||||
switch(darkness)
|
||||
if(0.80 to 1.00)
|
||||
l_icon = 0
|
||||
if(0.60 to 0.80)
|
||||
l_icon = 1
|
||||
if(0.40 to 0.60)
|
||||
l_icon = 2
|
||||
if(0.20 to 0.40)
|
||||
l_icon = 3
|
||||
if(0.00 to 0.20)
|
||||
l_icon = 4
|
||||
|
||||
switch(get_energy(H))
|
||||
if(0 to 24)
|
||||
e_icon = 0
|
||||
if(25 to 49)
|
||||
e_icon = 1
|
||||
if(50 to 74)
|
||||
e_icon = 2
|
||||
if(75 to 99)
|
||||
e_icon = 3
|
||||
if(100 to INFINITY)
|
||||
H.shadekin_energy_display.icon_state = "energy0"
|
||||
if(75 to 100)
|
||||
H.shadekin_energy_display.icon_state = "energy1"
|
||||
if(50 to 75)
|
||||
H.shadekin_energy_display.icon_state = "energy2"
|
||||
if(25 to 50)
|
||||
H.shadekin_energy_display.icon_state = "energy3"
|
||||
if(0 to 25)
|
||||
H.shadekin_energy_display.icon_state = "energy4"
|
||||
if(H.shadekin_dark_display)
|
||||
H.shadekin_dark_display.invisibility = 0
|
||||
var/brightness = T.get_lumcount() //Brightness in 0.0 to 1.0
|
||||
var/darkness = 1-brightness //Invert
|
||||
switch(darkness)
|
||||
if(0.80 to 1.00)
|
||||
H.shadekin_dark_display.icon_state = "dark2"
|
||||
if(0.60 to 0.80)
|
||||
H.shadekin_dark_display.icon_state = "dark1"
|
||||
if(0.40 to 0.60)
|
||||
H.shadekin_dark_display.icon_state = "dark"
|
||||
if(0.20 to 0.40)
|
||||
H.shadekin_dark_display.icon_state = "dark-1"
|
||||
if(0.00 to 0.20)
|
||||
H.shadekin_dark_display.icon_state = "dark-2"
|
||||
e_icon = 4
|
||||
|
||||
H.shadekin_display.icon_state = "shadekin-[l_icon]-[e_icon]"
|
||||
return
|
||||
@@ -1,17 +1,8 @@
|
||||
/obj/screen/shadekin
|
||||
name = "shadekin status"
|
||||
icon = 'icons/mob/shadekin_hud.dmi'
|
||||
invisibility = 101
|
||||
|
||||
/obj/screen/shadekin/darkness
|
||||
name = "darkness"
|
||||
icon_state = "dark"
|
||||
alpha = 150
|
||||
|
||||
/obj/screen/shadekin/energy
|
||||
name = "energy"
|
||||
icon_state = "energy0"
|
||||
alpha = 150
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
var/disconnect_time = null //Time of client loss, set by Logout(), for timekeeping
|
||||
|
||||
var/obj/screen/shadekin/darkness/shadekin_dark_display = null
|
||||
var/obj/screen/shadekin/energy/shadekin_energy_display = null
|
||||
var/obj/screen/shadekin/shadekin_display = null
|
||||
var/obj/screen/xenochimera/danger_level/xenochimera_danger_display = null
|
||||
|
||||
/mob/drop_location()
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 127 KiB |
Reference in New Issue
Block a user