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

EachFriend faint triggers activated by enemy faints as well #85

Closed
michaelgtuttle opened this issue Sep 17, 2022 · 2 comments
Closed

EachFriend faint triggers activated by enemy faints as well #85

michaelgtuttle opened this issue Sep 17, 2022 · 2 comments

Comments

@michaelgtuttle
Copy link

michaelgtuttle commented Sep 17, 2022

Enemy faints appear to be triggering the faint abilities of sharks and flies. Below test causes a zombie fly to spawn after enemy otter faints:

from sapai.pets import Pet
from sapai.teams import Team
from sapai.battle import Battle

team0 = Team(["fly"])
team1 = Team(["otter", "shark"])

battle = Battle(team0,team1)
winner = battle.battle()
for key, value in battle.battle_history.items():
    print(f'{key}')
    print(f'{value}')
print(winner)

This test causes an error as sharks try to apply feint triggers

from sapai.pets import Pet
from sapai.teams import Team
from sapai.battle import Battle

team0 = Team(["shark"])
team1 = Team(["shark"])

battle = Battle(team0,team1)
winner = battle.battle()
@michaelgtuttle
Copy link
Author

should be solvable by adding the check if self.team != trigger.team: in the pets faint trigger

@manny405
Copy link
Owner

This has been fixed in the the newest branch loop_effect_queue.

For fly case you can see tests for behavior here:

def test_badger_honey_fly_sob(self):

For shark case you can see tests for behavior here:

def test_badger_honey_fly_shark_sob(self):

I am still working on some final test cases for #83. If you are interested in contributing, the remaining test cases start here:

def test_crab(self):
.

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