Added bug fix for experience when secondary defeats primary.
Showing
2 changed files
with
13 additions
and
5 deletions
No preview for this file type
... | @@ -237,7 +237,7 @@ Monsters = { | ... | @@ -237,7 +237,7 @@ Monsters = { |
237 | 'family': 'acrolith', | 237 | 'family': 'acrolith', |
238 | 'zone': ['abyssea - uleguerand'], | 238 | 'zone': ['abyssea - uleguerand'], |
239 | 'hp': 20, | 239 | 'hp': 20, |
240 | 'weapon_base_damage': 14 | 240 | 'weapon_base_damage': 18 |
241 | }, | 241 | }, |
242 | 'Floating Eye': { | 242 | 'Floating Eye': { |
243 | 'family': 'ahriman', | 243 | 'family': 'ahriman', |
... | @@ -648,9 +648,9 @@ class Monster: | ... | @@ -648,9 +648,9 @@ class Monster: |
648 | pDif_rand = float(random.randint(int(pDif_min*100000), int(pDif_max*100000))) / 100000.0 | 648 | pDif_rand = float(random.randint(int(pDif_min*100000), int(pDif_max*100000))) / 100000.0 |
649 | 649 | ||
650 | fstr = ((self.get_strength() - enemy_vit)+4) / 4 | 650 | fstr = ((self.get_strength() - enemy_vit)+4) / 4 |
651 | print("Str: {} Vit: {} fstr: {}".format(self.get_strength(), enemy_vit, fstr)) | 651 | log("Str: {} Vit: {} fstr: {}".format(self.get_strength(), enemy_vit, fstr)) |
652 | bd = bd + fstr | 652 | bd = bd + fstr |
653 | final_damage = (bd * (pDif_rand * cRatio)) | 653 | final_damage = int((bd * (pDif_rand * cRatio))) |
654 | return final_damage | 654 | return final_damage |
655 | 655 | ||
656 | def attack(self, monster): | 656 | def attack(self, monster): |
... | @@ -723,7 +723,9 @@ class Arena: | ... | @@ -723,7 +723,9 @@ class Arena: |
723 | self.battle_type = battle_type | 723 | self.battle_type = battle_type |
724 | 724 | ||
725 | def heal_monsters(self): | 725 | def heal_monsters(self): |
726 | pass | 726 | self.monster1.hp = self.monster1.get_hp() |
727 | self.monster2.hp = self.monster2.get_hp() | ||
728 | |||
727 | 729 | ||
728 | def start(self): | 730 | def start(self): |
729 | self.heal_monsters() | 731 | self.heal_monsters() |
... | @@ -761,7 +763,13 @@ class Arena: | ... | @@ -761,7 +763,13 @@ class Arena: |
761 | primary.apply_damage(result2[0]) | 763 | primary.apply_damage(result2[0]) |
762 | actions.append(AttackAction(secondary, primary, result2[0], result2[1])) | 764 | actions.append(AttackAction(secondary, primary, result2[0], result2[1])) |
763 | if primary.hp <= 0: | 765 | if primary.hp <= 0: |
764 | xp = 200 + (20 * (primary.level - secondary.level)) | 766 | level_difference = primary.level - secondary.level |
767 | if level_difference in exp_table: | ||
768 | xp = exp_table[level_difference] | ||
769 | elif level_difference > 15: | ||
770 | xp = exp_table[15] | ||
771 | else: | ||
772 | xp = 0 | ||
765 | actions.append(DefeatAction(secondary, primary, 'was defeated', xp)) | 773 | actions.append(DefeatAction(secondary, primary, 'was defeated', xp)) |
766 | return actions | 774 | return actions |
767 | else: | 775 | else: | ... | ... |
-
Please register or sign in to post a comment