manny405 / sapai

Super auto pets engine built with reinforment learning training in mind
MIT License
67 stars 21 forks source link

Poodle end of turn should favor left-most pet in ties #73

Closed jimkaal closed 2 years ago

jimkaal commented 2 years ago

When pets are of the same tier, it will always favor the left-most pet, this is not a random draw.

Below unittest sometimes fails, because get_target DifferentTierAnimals has a random choice build-in.

    def test_poodle_same_tier(self):
        player = Player(team=["poodle", "shark"])
        player.end_turn()
        # Poodle should be unchanged, Shark should have received a buff
        self.assertEqual(player.team[0].attack, 2)
        self.assertEqual(player.team[0].health, 2)
        self.assertEqual(player.team[1].attack, 5)
        self.assertEqual(player.team[1].health, 5)
jolpica commented 2 years ago

This can be closed as Poodle now distributes randomly when there are 2 of the same unit.