mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
Adding lookAtAllLibraries to Player/PlayerImpl and using that method during JAOT's -8 resolution
This commit is contained in:
parent
02d9287cfa
commit
c5cedc2aba
3 changed files with 23 additions and 0 deletions
|
|
@ -350,6 +350,15 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
*/
|
||||
boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId, boolean triggerEvents);
|
||||
|
||||
/**
|
||||
* Reveals all players' libraries. Useful for abilities like Jace, Architect of Thought's -8
|
||||
* that have effects that require information from all libraries.
|
||||
* @param source
|
||||
* @param game
|
||||
* @return
|
||||
*/
|
||||
boolean lookAtAllLibraries(Ability source, Game game);
|
||||
|
||||
boolean canPlayLand();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2477,6 +2477,18 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean lookAtAllLibraries(Ability source, Game game) {
|
||||
for(UUID playerId : game.getState().getPlayersInRange(this.getId(), game)){
|
||||
Player player = game.getPlayer(playerId);
|
||||
String playerName = this.getName().equals(player.getName()) ? "Your " : player.getName() + "'s ";
|
||||
playerName += "library";
|
||||
Cards cardsInLibrary = new CardsImpl(player.getLibrary().getTopCards(game, player.getLibrary().size()));
|
||||
lookAtCards(playerName, cardsInLibrary, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean handleLibraryCastableCards(Library library, Game game, UUID targetPlayerId) {
|
||||
// for handling Panglacial Wurm
|
||||
boolean alreadyChosenUse = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue