Mini Pokemon Battle (Improved)

Run some MiniScript code right in your browser!

rataks = ["TACKLE", "BITE", "SCRATCH"] HP = 39 EHP = 30 fim = 2 charAttack = function(attack, damage) print "CHARMANDER used " + attack.upper + "!" print "Enemy RATTATA was hit for " + damage + " damage points!" globals.EHP = EHP - damage end function ratAttack = function(eatack, edamag) print "RATTATA used " + eatack.upper + "!" print "Enemy CHARMANDER was hit for " + edamag + " damage points!" globals.HP = HP - edamag end function print "Wild RATTATA appeared!" print "You sent out CHARMANDER!" while fim > 1 print "Choose an attack." print "EMBER" print "DRAGON RAGE" print "SCRATCH" atak = input("SLASH") if atak.lower == "ember" or atak.upper == "EMBER" then charAttack atak, floor(rnd * 7 + 13) else if atak.lower == "dragon rage" or atak.upper == "DRAGON RAGE" then charAttack atak, 40 else if atak.lower == "scratch" or atak.upper == "SCRATCH" then charAttack atak, floor(rnd * 4 + 8) else if atak.lower == "slash" or atak.upper == "SLASH" then charAttack atak, floor(rnd * 3 + 10) end if if 1 > HP then break end if ratak = rataks[rnd * rataks.len] if ratak.lower == "tackle" or ratak.upper == "TACKLE" then ratAttack ratak, floor(rnd * 3 + 9) else if ratak.lower == "bite" or ratak.upper == "BITE" then ratAttack ratak, floor(rnd * 2 + 11) else if ratak.lower == "scratch" or ratak.upper == "SCRATCH" then ratAttack ratak, floor(rnd * 4 + 7) end if if 1 > EHP then break end if end while if 1 > HP then print "CHARMANDER fainted!" print "You lose!" else if 1 > EHP then print "Wild RATTATA fainted!" print "You win!" end if

Help & Information