Implementing The Prismatic Piper (Ready for review) (#8164)

* [CMR] Implemented The Prismatic Piper

* updated commander validation to handle The Prismatic Piper

* created abstract base class for commander variants

* added ability to prismatic piper

* added game init handling

* small revert

* small reorganization of tests

* added some validation tests for piper

* added more tests for piper

* add another test

* added decklist comments to tests

* added some more piper tests

* added another test

* added mana option tests

* added a companion test

* fix conflict

* updated abstract commander to work with Friends forever

* merge fix

* Deck: added details for illegal validation of companion card;

Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
Evan Kranzler 2022-03-17 18:02:29 -04:00 committed by GitHub
parent 966cb7ccb7
commit 02017b9a88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 1753 additions and 1272 deletions

View file

@ -1129,12 +1129,13 @@ public abstract class GameImpl implements Game {
Map<Player, Card> playerCompanionMap = new HashMap<>();
for (Player player : state.getPlayers().values()) {
// Make a list of legal companions present in the sideboard
Set<Card> cards = new HashSet<>(player.getLibrary().getCards(this));
Set<Card> potentialCompanions = new HashSet<>();
for (Card card : player.getSideboard().getUniqueCards(this)) {
for (Ability ability : card.getAbilities(this)) {
if (ability instanceof CompanionAbility) {
CompanionAbility companionAbility = (CompanionAbility) ability;
if (companionAbility.isLegal(new HashSet<>(player.getLibrary().getCards(this)), startingHandSize)) {
if (companionAbility.isLegal(cards, startingHandSize)) {
potentialCompanions.add(card);
break;
}