client
New()
..()
new/obj/health1(src)
new/obj/health2(src)
new/obj/health3(src)
new/obj/health4(src)
new/obj/health5(src)
new/obj/health6(src)
obj
health1
icon='health bar base.dmi'
icon_state="1"
layer=5
New(client/C)
screen_loc="1,11"
C.screen+=src
health2
icon='health bar base.dmi'
icon_state="2"
layer=5
New(client/C)
screen_loc="2,11"
C.screen+=src
health3
icon='health bar base.dmi'
icon_state="3"
layer=5
New(client/C)
screen_loc="3,11"
C.screen+=src
health4
icon='health bar 1.dmi'
icon_state="13"
layer=5
New(client/C)
screen_loc="1,11"
C.screen+=src
health5
icon='health bar 2.dmi'
icon_state="6"
layer=5
New(client/C)
screen_loc="2,11"
C.screen+=src
health6
icon='health bar 3.dmi'
icon_state="1"
layer=5
New(client/C)
screen_loc="3,11"
C.screen+=src
mob
proc
check_hp()
if(usr.hp < (usr.maxhp * 1.00))
for(var/obj/health6/H in usr.client.screen)
H.icon_state="1"
for(var/obj/health5/H in usr.client.screen)
H.icon_state="full"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (src.maxhp * 0.95))
for(var/obj/health6/H in usr.client.screen)
H.icon_state="2"
for(var/obj/health5/H in usr.client.screen)
H.icon_state="full"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.90))
for(var/obj/health6/H in usr.client.screen)
H.icon_state="3"
for(var/obj/health5/H in usr.client.screen)
H.icon_state="full"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.85))
for(var/obj/health6/H in usr.client.screen)
H.icon_state="4"
for(var/obj/health5/H in usr.client.screen)
H.icon_state="full"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.80))
for(var/obj/health6/H in usr.client.screen)
H.icon_state="5"
for(var/obj/health5/H in usr.client.screen)
H.icon_state="full"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.75))
for(var/obj/health6/H in usr.client.screen)
H.icon_state="6"
for(var/obj/health5/H in usr.client.screen)
H.icon_state="6"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.60))
for(var/obj/health6/H in usr.client.screen)
H.icon_state="7"
for(var/obj/health5/H in usr.client.screen)
H.icon_state="7"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.55))
for(var/obj/health6/H in usr.client.screen)
H.icon_state="8"
for(var/obj/health5/H in usr.client.screen)
H.icon_state="8"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.50))//problem starts about here
for(var/obj/health5/H in usr.client.screen)
H.icon_state="9"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.45))
for(var/obj/health5/H in usr.client.screen)
H.icon_state="10"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.40))
for(var/obj/health5/H in usr.client.screen)
H.icon_state="11"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.35))
for(var/obj/health5/H in usr.client.screen)
H.icon_state="12"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="full"
if(usr.hp < (usr.maxhp * 0.30))
for(var/obj/health5/H in usr.client.screen)
H.icon_state="13"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="13"
if(usr.hp < (usr.maxhp * 0.25))
for(var/obj/health5/H in usr.client.screen)
H.icon_state="14"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="14"
if(usr.hp < (usr.maxhp * 0.20))
for(var/obj/health4/H in usr.client.screen)
H.icon_state="15"
for(var/obj/health4/H in usr.client.screen)
H.icon_state="15"
if(usr.hp < (usr.maxhp * 0.15))
for(var/obj/health4/H in usr.client.screen)
H.icon_state="16"
if(usr.hp < (usr.maxhp * 0.10))
for(var/obj/health4/H in usr.client.screen)
H.icon_state="17"
if(usr.hp < (usr.maxhp * 0.5))
for(var/obj/health4/H in usr.client.screen)
H.icon_state="18"
Problem description:
hp bar works until it hp reaches 50% and then part of bar disappears and doesn't appear until you die. i cant find what is wrong here