Here is my code
mob
verb
attack(mob/M as mob in oview (1))
set category="Actions"
if(usr.action)
usr.action=1
usr<<"You can't do that!"
return
usr << "You attack [M]"
flick('Male.dmi',usr)
flick("Strike",usr)
oview() << "[usr] attacks [M]"
var/damage = usr.strength + 4
usr << "[damage] damage"
M:HP -= damage
M:Finish()
mob
proc
Finish()
if (HP <=0)
world << "[src] Dies"
del src
mob
var
action
strength
HP
What I want to do is make it. when the verb "Attack" is pressed the character will continue to strike untill the Mobs HP has reached "0". I wasn't sure how to loop the effect...
I know
mob
verb
attack(mob/M as mob in oview (1))
set category="Actions"
if(usr.action)
usr.action=1
usr<<"You can't do that!"
return
usr << "You attack [M]"
flick('Male.dmi',usr)
flick("Strike",usr) // This part has to be looped to show the user is constantly swinging his sword.
oview() << "[usr] attacks [M]"
var/damage = usr.strength + 4 // and the effect has to be looped to show everytime he swiped, he takes damage.
usr << "[damage] damage"
M:HP -= damage
M:Finish()
mob
proc
Finish()
if (HP <=0)
world << "[src] Dies"
del src
mob
var
action
strength
HP
Thanks for your help.