mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Merge pull request #5364 from mooretc2/JaceArchitectOfThoughtFix
Fixing Jace, Architect of Thought with concurrent search library (for issue #5357)
This commit is contained in:
commit
09b64b2025
5 changed files with 33 additions and 2 deletions
|
@ -245,6 +245,10 @@ class JaceArchitectOfThoughtEffect3 extends OneShotEffect {
|
|||
if (controller == null || sourcePermanent == null) {
|
||||
return false;
|
||||
}
|
||||
if (controller.chooseUse(Outcome.Benefit, "Look at all players' libraries before card select?", null, game)) {
|
||||
game.informPlayers(controller.getLogName() + " is looking at all players' libraries.");
|
||||
controller.lookAtAllLibraries(source, game);
|
||||
}
|
||||
List<UUID> playerList = new ArrayList<>();
|
||||
playerList.addAll(game.getState().getPlayersInRange(controller.getId(), game));
|
||||
Set<UUID> checkList = new HashSet<>();
|
||||
|
|
|
@ -2309,8 +2309,12 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean flipCoin(Game game
|
||||
) {
|
||||
public void lookAtAllLibraries(Ability source, Game game) {
|
||||
computerPlayer.lookAtAllLibraries(source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean flipCoin(Game game) {
|
||||
return computerPlayer.flipCoin(game);
|
||||
}
|
||||
|
||||
|
|
|
@ -597,6 +597,9 @@ public class PlayerStub implements Player {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lookAtAllLibraries(Ability source, Game game) {}
|
||||
|
||||
@Override
|
||||
public boolean canPlayLand() {
|
||||
return false;
|
||||
|
|
|
@ -349,6 +349,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
|
||||
*/
|
||||
void lookAtAllLibraries(Ability source, Game game);
|
||||
|
||||
boolean canPlayLand();
|
||||
|
||||
/**
|
||||
|
|
|
@ -2488,6 +2488,17 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void 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);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean handleLibraryCastableCards(Library library, Game game, UUID targetPlayerId) {
|
||||
// for handling Panglacial Wurm
|
||||
boolean alreadyChosenUse = false;
|
||||
|
|
Loading…
Reference in a new issue