mob
proc/Update()
for(var/obj/HP/O in src.client.screen)//For the on screen object
O.num = round((src.health/src.maxhealth)*O.width)
if(O.num >= O.rangemax)//if number exceedes icon states
O.icon_state = "30"//make the icon state 5
if(O.num <= O.rangemin)//if the number is below zero
O.icon_state = "0"//make the icon state 0
if(O.num < O.rangemax && O.num > O.rangemin)//if there is an icon state for that number
var/newnum = O.num - O.rangemin
O.icon_state = "[newnum]"// change the icon state
obj
var/num = 0
var/rangemax//How many icon states
var/rangemin//How few icon states
HP
layer = MOB_LAYER+11//The layer of the meter so it appears above things on the screen
var/width = 30
meter
icon = 'meter.dmi'
icon_state = "0"
rangemax = 30//vars fall into place here that i pointed up above
rangemin = 0//vars fall into place here that i pointed up above
mob/Login()
src.overlays += new/obj/HP/meter//Adds the meter to the screen
I think this is right since there 30 icon states to the meter.
It hardly needs 10, in my opinion.
It's a 32 by 32 pixel square, and people aren't going to see a one pixel change in their healthbar and/or care.