mob/proc/battle()
var/R = rand(1,2)
if(!src.dead)
src<<"You engage in combat!"
if(R == 1)
start
var/enemyhp = rand(50,100)
if(src.dead)
return 0
if(enemyhp<1)
src<<"You killed the bat & leveled up!"
src.level++
sleep(10)
var/edamage = rand(5,1)
src.hp-=edamage
src.death()
src<<"You lose [edamage] health from the bat!"
sleep(10)
var/damage = rand(5,20)
enemyhp-=damage
src.death()
src<<"You hit the bat for [damage] damage!"
goto start
else
start
if(src.dead)
return 0
var/enemyhp = rand(50,100)
sleep(10)
var/edamage = rand(5,20)
src.hp-=edamage
src.death()
src<<"You lose [edamage] health from the Dog!"
sleep(10)
var/damage = rand(5,20)
enemyhp-=damage
src.death()
src<<"You hit the bat for [damage] damage!"
if(enemyhp<1)
src<<"You killed the Dog & leveled up!"
src.level++
else
goto start
Is there anyway this can be shortened dramatically and get rid of the evil goto?
~>Jiskuha
Yes. while() and/or for()
[edit]
A real fast removel of goto... -.-'
-Ryan