03403a56 by Barry

Added bug fix for experience when secondary defeats primary.

1 parent 226fb773
No preview for this file type
......@@ -237,7 +237,7 @@ Monsters = {
'family': 'acrolith',
'zone': ['abyssea - uleguerand'],
'hp': 20,
'weapon_base_damage': 14
'weapon_base_damage': 18
},
'Floating Eye': {
'family': 'ahriman',
......@@ -648,9 +648,9 @@ class Monster:
pDif_rand = float(random.randint(int(pDif_min*100000), int(pDif_max*100000))) / 100000.0
fstr = ((self.get_strength() - enemy_vit)+4) / 4
print("Str: {} Vit: {} fstr: {}".format(self.get_strength(), enemy_vit, fstr))
log("Str: {} Vit: {} fstr: {}".format(self.get_strength(), enemy_vit, fstr))
bd = bd + fstr
final_damage = (bd * (pDif_rand * cRatio))
final_damage = int((bd * (pDif_rand * cRatio)))
return final_damage
def attack(self, monster):
......@@ -723,7 +723,9 @@ class Arena:
self.battle_type = battle_type
def heal_monsters(self):
pass
self.monster1.hp = self.monster1.get_hp()
self.monster2.hp = self.monster2.get_hp()
def start(self):
self.heal_monsters()
......@@ -761,7 +763,13 @@ class Arena:
primary.apply_damage(result2[0])
actions.append(AttackAction(secondary, primary, result2[0], result2[1]))
if primary.hp <= 0:
xp = 200 + (20 * (primary.level - secondary.level))
level_difference = primary.level - secondary.level
if level_difference in exp_table:
xp = exp_table[level_difference]
elif level_difference > 15:
xp = exp_table[15]
else:
xp = 0
actions.append(DefeatAction(secondary, primary, 'was defeated', xp))
return actions
else:
......