Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ox ability behind pet with faint ability #69

Open
jfrain99 opened this issue Apr 4, 2022 · 1 comment
Open

Ox ability behind pet with faint ability #69

jfrain99 opened this issue Apr 4, 2022 · 1 comment

Comments

@jfrain99
Copy link

jfrain99 commented Apr 4, 2022

When the ox is placed behind an animal with faint abilities, such as an ant, only one of the faint abilities triggers.

def test_ox_after_ant(self):
    test_team = Team([Pet("ant")], battle=True)
    pet = Pet("ox", shop=Shop(), team=test_team.copy(), player=Player())
    friend_ahead = pet.team.get_ahead(pet)[0]
    te_idx = [0, pet.team.index(friend_ahead)]
    activated_bool, targets, possible = pet.faint_trigger(friend_ahead, te_idx)
    self.assertEqual(pet.team[1].attack, 5)
    self.assertEqual(pet.team[1].health, 5)
    self.assertEqual(pet.team[1].pet.status, "status-melon-armor")
@jimkaal
Copy link
Contributor

jimkaal commented Apr 5, 2022

faint_trigger won't activate other faint triggers, this happens in Battle.battle() or in Player.buy_food() since this affects a lot of other priorities like hurt triggers.

Here is an example that checks for the ox ability trigger, which still fails:

    def test_ox_after_ant(self):
        player = Player(shop=["sleeping-pill"], team=["ant", "ox"])
        player.buy_food(0, 0)
        print(player.team)
        self.assertEqual(player.team[1].attack, 5)
        self.assertEqual(player.team[1].health, 5)
        self.assertEqual(player.team[1].pet.status, "status-melon-armor")

Pets like Sheep are also an issue, since it spawns 2 pets, the ordering changes and that messes with the FriendAhead number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants