manny405 / sapai

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

Fly's ability counter should not increment if there is no room to summon #70

Open jimkaal opened 2 years ago

jimkaal commented 2 years ago

If Fly can't summon a zombie fly, the ability counter should not increment. Below example with a priority cricket that summons its zombie cricket first, leaving no room for the fly.

    def test_ability_counter_unchanged(self):
        cricket = Pet("cricket")
        cricket._attack = 10
        player = Player(shop=["sleeping-pill"], team=[cricket, "fish", "fish", "tiger", "fly"])
        player.buy_food(0, 0)

        self.assertEqual(player.team[0].pet.name, "pet-zombie-cricket")
        ### no zombie fly spawned, ability counter should remain 0
        self.assertEqual(player.team[4].pet.ability_counter, 0)