Example #1
0
 def test_elemental_exp_gain(self):
     error = "Knocking out an elemental didn't grant exp to player's elementals"
     elemental = ElementalBuilder().with_level(5).build()
     team_a = CombatTeam([elemental], PlayerBuilder().build())
     team_b = make_combat_team()
     get_mocked_combat(team_a, team_b)
     # Nearly fatal damage
     damage = team_b.active_elemental.max_hp - 1
     team_b.active_elemental.receive_damage(damage, team_a.active_elemental)
     exp_before = elemental.current_exp
     team_a.make_move(Claw())
     team_b.make_move(Claw())
     exp_after = elemental.current_exp
     self.assertGreater(exp_after, exp_before, error)
Example #2
0
 def test_player_exp_gain(self):
     error = "Knocking out an elemental didn't grant exp to player"
     player = PlayerBuilder().build()
     team_a = CombatTeam([ElementalBuilder().build()], player)
     team_b = make_combat_team()
     get_mocked_combat(team_a, team_b)
     # Nearly fatal damage
     damage = team_b.active_elemental.max_hp - 1
     team_b.active_elemental.receive_damage(damage, team_a.elementals[0])
     exp_before = player.current_exp
     team_a.make_move(Claw())
     team_b.make_move(Claw())
     exp_after = player.current_exp
     self.assertGreater(exp_after, exp_before, error)