Ports some hud and update_icon code updates.
This commit is contained in:
@@ -18,10 +18,11 @@
|
||||
var/mob/living/carbon/C = usr
|
||||
C.toggle_combat_mode()
|
||||
|
||||
/obj/screen/combattoggle/proc/rebasetointerbay(mob/living/carbon/C)
|
||||
if(!C)
|
||||
/obj/screen/combattoggle/update_icon_state()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!istype(user))
|
||||
return
|
||||
if(C.combatmode)
|
||||
if(user.combatmode)
|
||||
icon_state = "combat"
|
||||
else
|
||||
icon_state = "combat_off"
|
||||
@@ -36,10 +37,11 @@
|
||||
var/mob/living/carbon/C = usr
|
||||
C.toggle_vore_mode()
|
||||
|
||||
/obj/screen/voretoggle/proc/rebaseintomygut(mob/living/carbon/C)
|
||||
if(!C)
|
||||
/obj/screen/voretoggle/update_icon_state()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!istype(user))
|
||||
return
|
||||
if(C.voremode && !C.combatmode)
|
||||
if(user.voremode && !user.combatmode)
|
||||
icon_state = "nom"
|
||||
else
|
||||
icon_state = "nom_off"
|
||||
|
||||
@@ -12,10 +12,11 @@
|
||||
var/mob/living/carbon/human/H = usr
|
||||
H.togglesprint()
|
||||
|
||||
/obj/screen/sprintbutton/proc/insert_witty_toggle_joke_here(mob/living/carbon/human/H)
|
||||
if(!H)
|
||||
/obj/screen/sprintbutton/update_icon_state()
|
||||
var/mob/living/user = hud?.mymob
|
||||
if(istype(user))
|
||||
return
|
||||
if(H.sprinting)
|
||||
if(user.sprinting)
|
||||
icon_state = "act_sprint_on"
|
||||
else
|
||||
icon_state = "act_sprint"
|
||||
|
||||
@@ -13,31 +13,16 @@
|
||||
var/mob/living/L = usr
|
||||
to_chat(L, "<span class='notice'>You have <b>[L.getStaminaLoss()]</b> stamina loss.<br>Your stamina buffer can take <b>[L.stambuffer]</b> stamina loss, and will use <b>50%</b> of that stamina loss when recharging.<br>Your stamina buffer is <b>[(L.stambuffer*(100/L.stambuffer))-(L.bufferedstam*(100/L.stambuffer))]%</b> full.</span>")
|
||||
|
||||
/mob/living/carbon/human/proc/staminahudamount()
|
||||
if(stat == DEAD || recoveringstam)
|
||||
return "staminacrit"
|
||||
/obj/screen/staminas/update_icon_state()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!user)
|
||||
return
|
||||
if(user.stat == DEAD || user.recoveringstam || (user.hal_screwyhud in 1 to 2))
|
||||
icon_state = "staminacrit"
|
||||
else if(user.hal_screwyhud == 5)
|
||||
icon_state = "stamina0"
|
||||
else
|
||||
switch(hal_screwyhud)
|
||||
if(1 to 2)
|
||||
return "staminacrit"
|
||||
if(5)
|
||||
return "stamina0"
|
||||
else
|
||||
switch(100 - getStaminaLoss())
|
||||
if(100 to INFINITY)
|
||||
return "stamina0"
|
||||
if(80 to 100)
|
||||
return "stamina1"
|
||||
if(60 to 80)
|
||||
return "stamina2"
|
||||
if(40 to 60)
|
||||
return "stamina3"
|
||||
if(20 to 40)
|
||||
return "stamina4"
|
||||
if(0 to 20)
|
||||
return "stamina5"
|
||||
else
|
||||
return "stamina6"
|
||||
icon_state = "stamina[max(FLOOR(user.getStaminaLoss() /20, 1), 0, 6)]"
|
||||
|
||||
//stam buffer
|
||||
/obj/screen/staminabuffer
|
||||
@@ -48,31 +33,29 @@
|
||||
layer = ABOVE_HUD_LAYER + 0.1
|
||||
mouse_opacity = 0
|
||||
|
||||
/mob/living/carbon/human/proc/staminabufferhudamount()
|
||||
if(stat == DEAD || recoveringstam)
|
||||
return "stambuffer7"
|
||||
/obj/screen/staminabuffer/update_icon_state()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!user)
|
||||
return
|
||||
if(user.stat == DEAD || user.recoveringstam || (user.hal_screwyhud in 1 to 2))
|
||||
icon_state = "stambuffer7"
|
||||
else if(user.hal_screwyhud == 5)
|
||||
icon_state = "stambuffer0"
|
||||
else
|
||||
switch(hal_screwyhud)
|
||||
if(1 to 2)
|
||||
return "stambuffer7"
|
||||
if(5)
|
||||
return "stambuffer0"
|
||||
switch(user.bufferedstam / user.stambuffer)
|
||||
if(0.95 to INFINITY)
|
||||
icon_state = "stambuffer7"
|
||||
if(0.9 to 0.95)
|
||||
icon_state = "stambuffer6"
|
||||
if(0.8 to 0.9)
|
||||
icon_state = "stambuffer5"
|
||||
if(0.6 to 0.8)
|
||||
icon_state = "stambuffer4"
|
||||
if(0.4 to 0.6)
|
||||
icon_state = "stambuffer3"
|
||||
if(0.2 to 0.4)
|
||||
icon_state = "stambuffer2"
|
||||
if(0.05 to 0.2)
|
||||
icon_state = "stambuffer1"
|
||||
else
|
||||
var/percentmult = 100/stambuffer
|
||||
switch(stambuffer*percentmult - bufferedstam*percentmult)
|
||||
if(95 to INFINITY)
|
||||
return "stambuffer0"
|
||||
if(90 to 95)
|
||||
return "stambuffer1"
|
||||
if(80 to 90)
|
||||
return "stambuffer2"
|
||||
if(60 to 80)
|
||||
return "stambuffer3"
|
||||
if(40 to 60)
|
||||
return "stambuffer4"
|
||||
if(20 to 40)
|
||||
return "stambuffer5"
|
||||
if(5 to 20)
|
||||
return "stambuffer6"
|
||||
else
|
||||
return "stambuffer7"
|
||||
icon_state = "stambuffer0"
|
||||
|
||||
Reference in New Issue
Block a user