ID:179118
 
Ok i made a new battle system. and i have it divided into differnt proc. for it to work. These are the proc. that give me problems.

proc/Battle2()
var/damage = usr.attack-M.defence //assign a random # to a new variable
var/colour = "red"
if(damage>=1)
s_damage(damage,colour,M)
M.HP -= damage //take away the damage from M
M:DeathCheck() //check for death with a proc
Battle3()
if(damage<=0)
usr << "You are to week to hurt [M]."
Battle3()

proc/Battle3()
var/Mdamage = M.attack - usr.defence
var/colour = "red"
if(Mdamage>=1)
s_damage(Mdamage,colour,usr)
usr.HP -= Mdamage //take away the damage from M
usr:MonsterKill() //check for death with a proc
Battle2()
if(Mdamage<=0)
usr << "[M]'s hit bounces off harmlessly."
Battle2()

The errors are

NewBattleSystem.dm:24:error:M.defence:bad var
NewBattleSystem.dm:27:error:M:bad var
NewBattleSystem.dm:28:error:M.HP:bad var
NewBattleSystem.dm:29:error:M/:/DeathCheck:bad var
NewBattleSystem.dm:32:error:M:bad var
NewBattleSystem.dm:36:error:M.attack:bad var
NewBattleSystem.dm:44:error:M:bad var

I have a verb that starts it all, and thats where you start battle with M. im not sure what i need to do to make it so the M that starts the battle is the same M in those proc.

Thanks!

~~dbz73~~
NOT a dbz game maker.

EDIT: i just realized i should probly put the starting verb in too.
mob
verb
Battle(mob/M as mob in oview(1))
if(M.client==null)
if(usr.InBattle==0)
if(M.InBattle==0)
usr.CanMove = 0
usr.InBattle = 1
M.CanMove = 0
M.InBattle = 1
Battle2()
else
usr << "[M] is currently battling."
else
usr << "You is currently battling."
else
usr << "We currently dont allow Player Fighting Outside the Arena"
Even if you define M in the verb you STILL have to define it in the procs.
In response to Nadrew
ok well how couldnt that make it so a differnt monster/person/thing could become M instead of what you started battle with?
In response to dbz73
OK i got it to compile and stuff. I added made the proc's be

Battle2(mob/M as mob in oview(1))
and
Battle3(mob/M as mob in oview(1))

And now it compiles, i walk up and use the verb, and it makes it so we cant move, and then it doesnt do anything else. what did i do wrong?