mob/proc/staminacheck()
if(src.stamina>=100)
src.stamina=100
if(src.stamina<=0)
src.stamina=0
mob/proc/rest()
src.staminacheck()
if(src.canmove)
src<<"<font color=green><b>You begin resting!</font></b>"
src.canmove=0
if(src.stamina<100)
sleep(15)
src.stamina+=rand(1,5)
src.HP+=rand(1,5)
src.hpmpcheck()
src.Healthbars()
src.rest()
else
src<<"<font color=red><b>Your stamina is full!</b></font>"
src.staminacheck()
src.canmove=1
else
if(src.stamina<100)
sleep(15)
src.stamina+=rand(1,5)
src.HP+=rand(1,5)
src.hpmpcheck()
src.Healthbars()
src.rest()
else
src<<"<font color=red><b>Resting Complete!</font></b>"
src.staminacheck()
src.canmove=1
obj
hud
restbutton
icon='misc.dmi'
icon_state="rest"
name="Rest"
New(client/C)
screen_loc="4,1"
C.screen+=src
layer=MOB_LAYER+5
Click()
usr.rest()
Problem description:
The code as it is now works fine. But I want to the above code to stop resting if the user presses the restbutton(or verb) again during resting, but continue if the user's stamina is under 100 and does not press the restbutton(or verb) a second time during resting. I cant figure out how to do this.