mob/proc/Attackp(mob/M in oview(1))
var/hitting = rand(1,5)
if(hitting == 3)
var/damage = round(src.Strength*2)
if(src.Strength - M.Speed+M.Defense > 1)
usr<<"<font color = blue>You hit [M] for [damage]!"
M<<"[src] hit you for [damage]!"
M.Health -= src.Strength - M.Speed+M.Defense
src.Levelup()
M.DeathCheck()
else
M<<"[src] attacks you but you block the attack!"
src<<"You attack [M] but they block your attack!"
else
M<<"[src] tries to attack you but misses!"
src<<"You try to attack [M] but you miss!"
mob/proc/DeathCheck()
if(src.Health <= 0)
src.Health = src.MaxH
view()<<"[src] wins the battle!"
src.loc=locate(1,1,1)
mob/proc/Levelup()
if(src.EXP>=src.maxEXP)
src<<"<font color = red><b>You gain a level!"
usr.EXP=0
src<<"You have gained 3 statpoints."
src.SP+=3
mob/verb/Attack()
src.Attack()
this is the runtime errors it gives:runtime error: Maximum recursion level reached (perhaps there is an infinite loop)
To avoid this safety check, set world.loop_checks=0.
verb name: Attack (/mob/verb/Attack)
usr: Dragon_Fire6564 (/mob/character/Light)
src: Dragon_Fire6564 (/mob/character/Light)
call stack:
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
...
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
Dragon_Fire6564 (/mob/character/Light): Attack()
how do i fix this?
You forgot the p, I suggest you rename your procedures.