So im making a game and it has states for attacking and walking and all that. I was wondering how would i code it.
mob/attack(mob/M as mob in oview(1))
if(M.HP <= 0)
usr << "[M] is already dead!"
else
usr << "You attack [M]!"
icon = 'XXX'
icon_state = "attack"
sleep(10)
icon = 'XXX'
icon_state = "Norm"
thats the way I think it would be done but im not sure.
Some of the code may be incorect because its been a while since iv coded icons but yea its an rough draft.