battle log:
You got into a battle
You attack Slimer but Slimer moves at the right moment.
Slimer attacks you but you move.
You get attacked by Slimer for 2 damage!
You attack Slimer but Slimer moves at the right moment.
Slimer attacks you but you move.
Slimer attacks you but you move.
You get attacked by Slimer for 1 damage!
You attack Slimer but Slimer moves at the right moment.
Slimer attacks you but you move.
You attack Slimer for 8 damage!
Code:
mob
var/tmp
isturn=0
choice
attacking=0
running=0
skill=0
magic=0
damage
inbattle=0
oz
ox
oy
mob
proc
startbattle(mob/M1)
var/turf/battleloc/T
if (prob(50))
for(T in world)
if(!T.inuse)
T.inuse = 1
src.ox = src.x
src.oy = src.y
src.oz = src.z
M1.loc=locate(src.x,src.y+5,src.z)
src<<"You got into a battle"
src.gofirst(M1)
return
gofirst(mob/M1)
if(src.endurence==M1.endurence)
if(src.agility>=M1.agility)
src.isturn=1
src.battle(M1)
return
if(src.agility<=M1.agility)
M1.isturn=1
M1.MAttack(src)
return
if(src.endurence>=M1.endurence)
src.isturn=1
src.battle(M1)
return
if(src.endurence<=M1.endurence)
M1.isturn=1
M1.MAttack(src)
return
battle(mob/M1)
start:
if(src.isturn==1)
src.choice=input("What would you like to do?","BATTLE")in list("Attack","Run","Wait")
if(src.choice=="Attack")
src.Attack(M1)
return
if(src.choice=="Run")
src.Run(M1)
return
if(src.choice=="Wait")
src.Wait(M1)
return
sleep(10)
goto start
Attack(mob/M1)
if(prob(50))
src.damage=src.strength-M1.defence
if(src.damage<=0)
src.damage=0
M1.hp-=src.damage
src<<"You attack [M1] for [damage] damage!"
src.isturn=0
M1.MDcheck(src)
else
src<<"You attack [M1] but [M1] moves at the right moment."
src.isturn=0
M1.MAttack(src)
MAttack(mob/M1)
if(prob(50))
src.damage=rand(11,15)
src.damage-=M1.defence
if(src.damage<=0)
src.damage=0
M1.hp-=src.damage
src<<"You attack [M1] for [damage] damage!"
M1<<"You get attacked by [src] for [damage] damage!"
M1.isturn=0
M1.Dcheck(src)
else
M1<<"[src] attacks you but you move."
src.isturn=0
M1.MAttack(src)
Run(mob/M1)
if(prob(50))
src<<"You quickly side-step [M1] and make a run for it."
src.inbattle=0
del(M1)
else
src<<"You try to side-step [M1] but [M1] was faster than you."
src.isturn=0
M1.MAttack(src)
Wait(mob/M1)
src<<"You wait for [M1] to come after you."
src.isturn=0
M1.MAttack(src)
Dcheck(mob/M1)
if(src.hp<=0)
src.isturn=0
src.icon_state="Dead"
sleep(10)
src.hp=src.mhp
src.loc=locate(1,1,1)
src<<"You died... how sad..."
return
else
src.isturn=1
src.battle(M1)
return
MDcheck(mob/M1)
if(src.hp<=0)
src.isturn=0
src.icon_state="Dead"
sleep(10)
del(src)
return
else
src.isturn=1
src.MAttack(M1)
return
turf
battle_grass
icon='battlegrass.dmi'
Entered()
var/M1
if(prob(40))
M1=new/mob/monster/Slimer
usr.startbattle(M1)
return
else
return
battleloc
var/inuse=0
Problem description:
the monster gets extra turns without me giving them to it, check out the coding and see if your a better coder than i by trying to spot the problem (note: even if you dont see the problem your still probably a better coder than i)