ID:149474
 
i haven't posted in the forums before, but I am in need.
I have a rare item in my game called the Evaporation Spray. It evaporates things (obviously). i do this by having a var under atom called evaporates, which is false by default, and a proc in atom called evaporate that flicks the animation and deletes the src.

I've now decided that I want the evaporation to do damage to mobs and only evaporate them if they don't have any HP left, so I gave mobs their own evaporate() proc. I tried this but they just keep vaporizing despite HP.

any ideas?

This seems simple and I'd normally consider myself a pretty good programmer, but I just can't work it out.
mob/var/health = 20
proc/evaporate(var/atom/A)
if(ismob(A))
var/mob/M = A
M.health -= rand(3,5)
if(M.health <= 0)
flick(evaporate,M)
del M
else
flick(evaporate,A)
del A

That help you any?

-Lord of Water
In response to Lord of Water
Why didn't I think of that?