mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +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) {
|
if (controller == null || sourcePermanent == null) {
|
||||||
return false;
|
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<>();
|
List<UUID> playerList = new ArrayList<>();
|
||||||
playerList.addAll(game.getState().getPlayersInRange(controller.getId(), game));
|
playerList.addAll(game.getState().getPlayersInRange(controller.getId(), game));
|
||||||
Set<UUID> checkList = new HashSet<>();
|
Set<UUID> checkList = new HashSet<>();
|
||||||
|
|
|
@ -2309,8 +2309,12 @@ public class TestPlayer implements Player {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return computerPlayer.flipCoin(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -597,6 +597,9 @@ public class PlayerStub implements Player {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void lookAtAllLibraries(Ability source, Game game) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayLand() {
|
public boolean canPlayLand() {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -349,6 +349,15 @@ public interface Player extends MageItem, Copyable<Player> {
|
||||||
*/
|
*/
|
||||||
boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId, boolean triggerEvents);
|
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();
|
boolean canPlayLand();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2488,6 +2488,17 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
return false;
|
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) {
|
private boolean handleLibraryCastableCards(Library library, Game game, UUID targetPlayerId) {
|
||||||
// for handling Panglacial Wurm
|
// for handling Panglacial Wurm
|
||||||
boolean alreadyChosenUse = false;
|
boolean alreadyChosenUse = false;
|
||||||
|
|
Loading…
Reference in a new issue