Refactoring cards that mill (WIP, do not merge) (#6713)

* added mill method

* updated mill effects to use new method

* refactored individual cards

* small updated to Grindstone and Sphinx's Tutelage

* another updated to Grindstone

* fixed a test

* fixed Countermand null check

* more refactoring

* updated dredge ability to use mill
This commit is contained in:
Evan Kranzler 2020-06-24 07:50:00 -04:00 committed by GitHub
parent 8b5f4f28f0
commit 785be83484
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 738 additions and 957 deletions

View file

@ -4193,6 +4193,17 @@ public abstract class PlayerImpl implements Player, Serializable {
return result;
}
@Override
public Cards millCards(int toMill, Ability source, Game game) {
GameEvent event = GameEvent.getEvent(EventType.MILL_CARDS, getId(), source.getSourceId(), getId(), toMill);
if (game.replaceEvent(event)) {
return new CardsImpl();
}
Cards cards = new CardsImpl(this.getLibrary().getTopCards(game, event.getAmount()));
this.moveCards(cards, Zone.GRAVEYARD, source, game);
return cards;
}
@Override
public boolean hasOpponent(UUID playerToCheckId, Game game) {
return !this.getId().equals(playerToCheckId)