fixes
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
var/mob/living/L = usr
|
||||
to_chat(L, "<span class='notice'>You have <b>[L.getStaminaLoss()]</b> stamina loss.<br>\
|
||||
Your stamina buffer is currently [L.stamina_buffer]/[L.stamina_buffer_max], and recharges at [L.stamina_buffer_regen] and [L.stamina_buffer_regen_combat] (combat mode on) per second.<br>\
|
||||
Your stamina buffer will have its capacity reduced by up to [STAMINA_BUFFER_STAMCRIT_CAPACITY_PERCENT_PENALTY * 100] from stamina damage, up until stamcrit, and similarly will be impacted in regeneration by\
|
||||
[STAMINA_BUFFER_STAMCRIT_REGEN_PERCENT_PENALTY]% from said damage.\
|
||||
Your stamina buffer will have its capacity reduced by up to [STAMINA_BUFFER_STAMCRIT_CAPACITY_PERCENT_PENALTY * 100]% from stamina damage, up until stamcrit, and similarly will be impacted in regeneration by \
|
||||
[STAMINA_BUFFER_STAMCRIT_REGEN_PERCENT_PENALTY * 100]% from said damage.\
|
||||
<br>Your stamina buffer is <b>[round((L.stamina_buffer / L.stamina_buffer_max) * 100, 0.1)]%</b> full.</span>")
|
||||
|
||||
/obj/screen/staminas/update_icon_state()
|
||||
@@ -28,6 +28,18 @@
|
||||
else
|
||||
icon_state = "stamina[clamp(FLOOR(user.getStaminaLoss() /20, 1), 0, 6)]"
|
||||
|
||||
/obj/screen/staminas/update_overlays()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!user)
|
||||
return
|
||||
var/percent = user.getStaminaLoss() / STAMINA_CRIT
|
||||
if((user.stat == DEAD) || (user.combat_flags & COMBAT_FLAG_HARD_STAMCRIT) || (user.hal_screwyhud in 1 to 2))
|
||||
. += list("stamina_alert3")
|
||||
else if(percent >= 0.85)
|
||||
. += list("stamina_alert2")
|
||||
else if(percent >= 0.7)
|
||||
. += list("stamina_alert1")
|
||||
|
||||
//stam buffer
|
||||
/obj/screen/staminabuffer
|
||||
icon = 'modular_citadel/icons/ui/screen_gen.dmi'
|
||||
@@ -37,26 +49,32 @@
|
||||
layer = ABOVE_HUD_LAYER + 0.1
|
||||
mouse_opacity = 0
|
||||
|
||||
/obj/screen/staminabuffer/update_icon_state()
|
||||
/obj/screen/staminabuffer/proc/mark_dirty()
|
||||
if(update_to_mob())
|
||||
START_PROCESSING(SShuds, src)
|
||||
|
||||
/obj/screen/staminabuffer/process()
|
||||
if(!update_to_mob())
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/screen/staminabuffer/Destroy()
|
||||
STOP_PROCESSING(SShuds, src)
|
||||
return ..()
|
||||
|
||||
/obj/screen/staminabuffer/proc/update_to_mob()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!user)
|
||||
return
|
||||
user.UpdateStaminaBuffer(FALSE)
|
||||
if(!user?.client)
|
||||
return FALSE
|
||||
if(user.stat == DEAD || (user.combat_flags & COMBAT_FLAG_HARD_STAMCRIT) || (user.hal_screwyhud in 1 to 2))
|
||||
icon_state = "stambuffer0"
|
||||
return FALSE
|
||||
else if(user.hal_screwyhud == 5)
|
||||
icon_state = "stambuffer29"
|
||||
return FALSE
|
||||
else if(user.stamina_buffer >= user.stamina_buffer_max)
|
||||
icon_state = "staminabuffer29"
|
||||
return FALSE
|
||||
else
|
||||
icon_state = "stambuffer[FLOOR((user.stamina_buffer / user.stamina_buffer_max) * 29, 1)]"
|
||||
|
||||
/obj/screen/staminabuffer/update_overlays()
|
||||
. = ..()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!user)
|
||||
return
|
||||
var/level = FLOOR((user.stamina_buffer / user.stamina_buffer_max) * 29, 1)
|
||||
if((user.stat == DEAD) || (user.combat_flags & COMBAT_FLAG_HARD_STAMCRIT) || (user.hal_screwyhud in 1 to 2) || (level <= 5))
|
||||
. += list("stamina_alert3")
|
||||
else if(level <= 8)
|
||||
. += list("stamina_alert2")
|
||||
else if(level <= 12)
|
||||
. += list("stamina_alert1")
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user