@verb #9578:"fight" none none none rdo #4002 @program #9578:"fight" none none none stats = this.scores[player in this.players] player:tell("You start searching around for something to battle...") if (stats[9] == 0) player:tell("You need to heal before you can fight anything.") else suspend(2) player:tell({"A monster approaches you, ready to fight!", "A monster comes up from behind, growling.", "You spot a monster nearby."}[random($)]) this.battling = {@this.battling, player} MonsterMaxLife = random(stats[6]) MonsterLife = MonsterMaxLife MonsterAttack = random(stats[2]) MonsterDefense = random(stats[3]) MonsterExp = (MonsterLife + MonsterAttack + MonsterDefense) / 2 MonsterGold = random(stats[8]) suspend(2) player:tell("You use your scanning ability to find out about this monster...") suspend(2) player:tell("Life: ", MonsterLife) player:tell("Attack: ", MonsterAttack) player:tell("Defense: ", MonsterDefense) suspend(3) while (stats[9] > 0) if (!(player in this.battling)) this.scores[player in this.players] = stats break endif YourDamage = stats[2] / MonsterDefense * 2 + random(stats[8] / 2) if (YourDamage <= 0) MonsterLife = MonsterLife player:tell("You hit the monster for no damage. That was pathetic.") player:tell("Monster: ", MonsterLife, "/", MonsterMaxLife, " You: ", stats[9], "/", stats[6]) else MonsterLife = MonsterLife - YourDamage player:tell({"You bash the monster on the head!", "You kick the monster hard in the stomach.", "You throw the monster to the ground."}[random($)]) player:tell("Monster: ", MonsterLife, "/", MonsterMaxLife, " You: ", stats[9], "/", stats[6]) endif if (MonsterLife <= 0) this.battling = setremove(this.battling, player) stats[5] = stats[5] - MonsterExp stats[4] = stats[4] + MonsterGold if (stats[5] <= 0) player:tell("You have beaten this monster! You get ", MonsterExp, " EXP and ", MonsterGold, " gold.") suspend(1) stats[6] = stats[6] + stats[8] stats[9] = stats[6] stats[2] = stats[2] + stats[8] / 2 stats[3] = stats[3] + stats[8] / 2 stats[7] = (stats[9] + stats[2] + stats[3]) * 2 stats[5] = stats[7] stats[8] = stats[8] + 1 this.scores[player in this.players] = stats player:tell("You have gained a level! You are now level ", stats[8], ". Type 'score' to see your new stats.") break else this.scores[player in this.players] = stats player:tell("You have beaten this monster! You get ", MonsterExp, " EXP and ", MonsterGold, " gold. You have ", stats[5], " more EXP to go until the next level.") break endif endif suspend(3) MonsterDamage = MonsterAttack / stats[3] * 2 + random(stats[8] / 2) if (MonsterDamage <= 0) stats[9] = stats[9] player:tell("The monster growls, striking back at you for no damage.") player:tell("Monster: ", MonsterLife, "/", MonsterMaxLife, " You: ", stats[9], "/", stats[6]) else stats[9] = stats[9] - MonsterDamage player:tell({"The monster slices you with its claws.", "The monster bites you on the arm, hard.", "The monster shoots a ball of fire at you."}[random($)]) player:tell("Monster: ", MonsterLife, "/", MonsterMaxLife, " You: ", stats[9], "/", stats[6]) suspend(3) if (stats[9] <= 0) this.battling = setremove(this.battling, player) stats[5] = stats[7] this.scores[player in this.players] = stats player:tell("You have been beaten! You lose all your EXP for this level and need to heal before you can fight again.") break suspend(3) endif endif endwhile endif "Last modified by Kiti (#4002) on Tue Jul 12 10:47:14 2005 MDT." .