ID:149578
 
Im making the attack verb for migzors dragon warrior party game, and ive got it pretty much complete, but when i test it after it calls the battle() proc it doesnt do anything, can anyone help?

mob/verb/challenge(mob/M in oview(1))
if(M.client)
if(usr.challenge==0)
if(M.challenge==0)
switch(alert(M,"You have been challenged by [usr], Will you accept?",,"Yes","No"))
if("Yes")
Lock(usr)
Lock(M)
usr.challenge = 1
M.challenge = 1
alert("Your challenge has been accepted.")
alert(M,"You have accepted [usr]'s challenge.")
M.turn = 1
battle()
if("No")
alert("Your challenge has been declined.")
alert(M,"You have declined [usr]'s challenge.")
else
alert("[M] is already in a fight.")
else
alert("You are already in a fight.")
else
alert("You cannot challenge an npc.")

mob/proc/battle()
if(usr.turn == 1)
switch(alert("It is your turn. What would you like to do?",,"Attack","Run"))
if("Attack")
var/damage = src.str-src.defense
src.HP-=damage
alert("You have Attacked [src] for [damage]HP.")
alert(src,"You have been attacked for [damage]HP")
characterdeath()
src.turn= 1
src.turn = 0
battle()
if("Run")
alert("You run from battle.")
alert(src,"[src] runs from battle.")
Unlock(src)
Unlock(src)
src.challenge = 0
src.challenge = 0
else
alert("It is [src]'s turn.")
Yes, any help would be highly appreciated.
I just hope Jot doesnt overstrain himself with this battle system.
In response to Migzor
i wish i could help out but im a noobie coder, but hopefully you will get the help. peace
I didn't get a proc error for battle() so?
In response to Justin Sun
i tried testing it and I too got like 4 errors, this is very hard to acomplish