mirror of
https://github.com/magefree/mage.git
synced 2026-01-22 19:29:59 -08:00
* Rollback - Fixed that UI is locked after a accepted rollback request (fixes #1158).
This commit is contained in:
parent
eccc367920
commit
efb5e06e57
159 changed files with 231 additions and 204 deletions
|
|
@ -108,7 +108,7 @@ class DefilerOfSoulsEffect extends OneShotEffect {
|
|||
//had, if thats the case this ability should fizzle.
|
||||
if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) {
|
||||
boolean abilityApplied = false;
|
||||
while (player.isInGame() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class SagesOfTheAnimaReplacementEffect extends ReplacementEffectImpl {
|
|||
}
|
||||
}
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard());
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
while (player.isInGame() && player.chooseUse(Outcome.Benefit, "Attach an Aura from the battlefield?", source, game)) {
|
||||
while (player.canRespond() && player.chooseUse(Outcome.Benefit, "Attach an Aura from the battlefield?", source, game)) {
|
||||
Target targetAura = new TargetPermanent(filterAura);
|
||||
if (player.choose(Outcome.Benefit, targetAura, source.getSourceId(), game)) {
|
||||
Permanent aura = game.getPermanent(targetAura.getFirstTarget());
|
||||
|
|
@ -137,7 +137,7 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
int count = player.getHand().count(filterAuraCard, game);
|
||||
while (player.isInGame() && count > 0 && player.chooseUse(Outcome.Benefit, "Attach an Aura from your hand?", source, game)) {
|
||||
while (player.canRespond() && count > 0 && player.chooseUse(Outcome.Benefit, "Attach an Aura from your hand?", source, game)) {
|
||||
TargetCard targetAura = new TargetCard(Zone.PICK, filterAuraCard);
|
||||
if (player.choose(Outcome.Benefit, player.getHand(), targetAura, game)) {
|
||||
Card aura = game.getCard(targetAura.getFirstTarget());
|
||||
|
|
@ -151,7 +151,7 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
count = player.getGraveyard().count(filterAuraCard, game);
|
||||
while (player.isInGame() && count > 0 && player.chooseUse(Outcome.Benefit, "Attach an Aura from your graveyard?", source, game)) {
|
||||
while (player.canRespond() && count > 0 && player.chooseUse(Outcome.Benefit, "Attach an Aura from your graveyard?", source, game)) {
|
||||
TargetCard targetAura = new TargetCard(Zone.PICK, filterAuraCard);
|
||||
if (player.choose(Outcome.Benefit, player.getGraveyard(), targetAura, game)) {
|
||||
Card aura = game.getCard(targetAura.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class CavernOfSoulsEffect extends OneShotEffect {
|
|||
typeChoice.setMessage("Choose creature type");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.Benefit, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class DescentIntoMadnessEffect extends OneShotEffect {
|
|||
do {
|
||||
selectCards(currentPlayer, selectedObjects, count, source, game);
|
||||
currentPlayer = playerList.getNextInRange(controller, game);
|
||||
} while (!currentPlayer.equals(controller) && controller.isInGame());
|
||||
} while (!currentPlayer.equals(controller) && controller.canRespond());
|
||||
|
||||
// move permanents and hand cards to exile
|
||||
for (UUID objectId : selectedObjects) {
|
||||
|
|
@ -159,7 +159,7 @@ class DescentIntoMadnessEffect extends OneShotEffect {
|
|||
int amount = Math.min(count, player.getHand().size() + game.getBattlefield().getAllActivePermanents(player.getId()).size());
|
||||
int cardsFromHand = 0;
|
||||
|
||||
while (player.isInGame() && amount > 0) {
|
||||
while (player.canRespond() && amount > 0) {
|
||||
|
||||
Target target;
|
||||
do {
|
||||
|
|
@ -185,7 +185,7 @@ class DescentIntoMadnessEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
} while (amount > 0 && !target.getTargets().isEmpty() && player.isInGame());
|
||||
} while (amount > 0 && !target.getTargets().isEmpty() && player.canRespond());
|
||||
if (amount > 0) {
|
||||
TargetCard targetInHand;
|
||||
do {
|
||||
|
|
@ -207,7 +207,7 @@ class DescentIntoMadnessEffect extends OneShotEffect {
|
|||
cardsFromHand++;
|
||||
}
|
||||
}
|
||||
} while (amount > 0 && !targetInHand.getTargets().isEmpty() && player.isInGame());
|
||||
} while (amount > 0 && !targetInHand.getTargets().isEmpty() && player.canRespond());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class LairDelveEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class PrimalSurgeEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
} while (player.isInGame() && repeat);
|
||||
} while (player.canRespond() && repeat);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class RidersOfGavonyEffect extends OneShotEffect {
|
|||
typeChoice.setMessage("Choose creature type");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class RiteOfRuinEffect extends OneShotEffect {
|
|||
LinkedList<CardType> order = new LinkedList<>();
|
||||
ChoiceImpl choice = new ChoiceImpl(true);
|
||||
choice.setChoices(choices);
|
||||
while (controller.isInGame() && controller.choose(Outcome.Sacrifice, choice, game) && choices.size() > 1) {
|
||||
while (controller.canRespond() && controller.choose(Outcome.Sacrifice, choice, game) && choices.size() > 1) {
|
||||
order.add(getCardType(choice.getChoice()));
|
||||
choices.remove(choice.getChoice());
|
||||
choice.clearChoice();
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class OracleOfBonesCastEffect extends OneShotEffect {
|
|||
controller.chooseUse(outcome, "Cast an instant or sorcery card from your hand without paying its mana cost?", source, game)) {
|
||||
Card cardToCast = null;
|
||||
boolean cancel = false;
|
||||
while (controller.isInGame() && !cancel) {
|
||||
while (controller.canRespond() && !cancel) {
|
||||
if (controller.chooseTarget(outcome, target, source, game)) {
|
||||
cardToCast = game.getCard(target.getFirstTarget());
|
||||
if (cardToCast != null && cardToCast.getSpellAbility().canChooseTarget(game)) {
|
||||
|
|
|
|||
|
|
@ -101,14 +101,14 @@ class WhimsOfTheFateEffect extends OneShotEffect {
|
|||
Map<UUID, Map<Integer, Set<UUID>>> playerPermanents = new LinkedHashMap<>();
|
||||
|
||||
PlayerList playerList = game.getState().getPlayerList().copy();
|
||||
while (!playerList.get().equals(source.getControllerId()) && controller.isInGame()) {
|
||||
while (!playerList.get().equals(source.getControllerId()) && controller.canRespond()) {
|
||||
playerList.getNext();
|
||||
}
|
||||
Player currentPlayer = game.getPlayer(playerList.get());
|
||||
Player nextPlayer;
|
||||
UUID firstNextPlayer = null;
|
||||
|
||||
while (!getNextPlayerInDirection(true, playerList, game).equals(firstNextPlayer) && controller.isInGame()) {
|
||||
while (!getNextPlayerInDirection(true, playerList, game).equals(firstNextPlayer) && controller.canRespond()) {
|
||||
nextPlayer = game.getPlayer(playerList.get());
|
||||
if (nextPlayer == null) {
|
||||
return false;
|
||||
|
|
@ -116,7 +116,7 @@ class WhimsOfTheFateEffect extends OneShotEffect {
|
|||
if (firstNextPlayer == null) {
|
||||
firstNextPlayer = nextPlayer.getId();
|
||||
}
|
||||
if (!nextPlayer.isInGame()) {
|
||||
if (!nextPlayer.canRespond()) {
|
||||
continue;
|
||||
}
|
||||
// if player is in range of controller he chooses 3 piles with all its permanents
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class CranialExtractionEffect extends OneShotEffect {
|
|||
cardChoice.clearChoice();
|
||||
|
||||
while (!controller.choose(Outcome.Exile, cardChoice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,13 +106,13 @@ class MindblazeEffect extends OneShotEffect {
|
|||
numberChoice.setChoices(numbers);
|
||||
|
||||
while (!playerControls.choose(Outcome.Neutral, cardChoice, game)) {
|
||||
if (!playerControls.isInGame()) {
|
||||
if (!playerControls.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
while (!playerControls.choose(Outcome.Neutral, numberChoice, game)) {
|
||||
if (!playerControls.isInGame()) {
|
||||
if (!playerControls.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class ReturnToHandEffect extends OneShotEffect {
|
|||
|
||||
Target target = new TargetControlledPermanent(1, 1, new FilterControlledPermanent(), true);
|
||||
if (target.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.ReturnToHand, target, source, game);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class AllianceOfArmsEffect extends OneShotEffect {
|
|||
protected static int playerPaysXGenericMana(Player player, Ability source, Game game) {
|
||||
int xValue = 0;
|
||||
boolean payed = false;
|
||||
while (player.isInGame() && !payed) {
|
||||
while (player.canRespond() && !payed) {
|
||||
xValue = player.announceXMana(0, Integer.MAX_VALUE, "How much mana will you pay?", game, source);
|
||||
if (xValue > 0) {
|
||||
Cost cost = new GenericManaCost(xValue);
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class CollectiveVoyageEffect extends OneShotEffect {
|
|||
protected static int playerPaysXGenericMana(Player player, Ability source, Game game) {
|
||||
int xValue = 0;
|
||||
boolean payed = false;
|
||||
while (player.isInGame() && !payed) {
|
||||
while (player.canRespond() && !payed) {
|
||||
xValue = player.announceXMana(0, Integer.MAX_VALUE, "How much mana will you pay?", game, source);
|
||||
if (xValue > 0) {
|
||||
Cost cost = new GenericManaCost(xValue);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class ManaChargedDragonEffect extends OneShotEffect {
|
|||
protected static int playerPaysXGenericMana(Player player, Ability source, Game game) {
|
||||
int xValue = 0;
|
||||
boolean payed = false;
|
||||
while (player.isInGame() && !payed) {
|
||||
while (player.canRespond() && !payed) {
|
||||
xValue = player.announceXMana(0, Integer.MAX_VALUE, "How much mana will you pay?", game, source);
|
||||
if (xValue > 0) {
|
||||
Cost cost = new GenericManaCost(xValue);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class MindsAglowEffect extends OneShotEffect {
|
|||
protected static int playerPaysXGenericMana(Player player, Ability source, Game game) {
|
||||
int xValue = 0;
|
||||
boolean payed = false;
|
||||
while (player.isInGame() && !payed) {
|
||||
while (player.canRespond() && !payed) {
|
||||
xValue = player.announceXMana(0, Integer.MAX_VALUE, "How much mana will you pay?", game, source);
|
||||
if (xValue > 0) {
|
||||
Cost cost = new GenericManaCost(xValue);
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class SharedTraumaEffect extends OneShotEffect {
|
|||
protected static int playerPaysXGenericMana(Player player, Ability source, Game game) {
|
||||
int xValue = 0;
|
||||
boolean payed = false;
|
||||
while (player.isInGame() && !payed) {
|
||||
while (player.canRespond() && !payed) {
|
||||
xValue = player.announceXMana(0, Integer.MAX_VALUE, "How much mana will you pay?", game, source);
|
||||
if (xValue > 0) {
|
||||
Cost cost = new GenericManaCost(xValue);
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class LimDulsVaultEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard(doAgain ? textBottom : textTop));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class MysticBarrierChooseEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
DIRECTION_CHOICE.clearChoice();
|
||||
while (!DIRECTION_CHOICE.isChosen() && controller.isInGame()) {
|
||||
while (!DIRECTION_CHOICE.isChosen() && controller.canRespond()) {
|
||||
controller.choose(outcome, DIRECTION_CHOICE, game);
|
||||
}
|
||||
if (!DIRECTION_CHOICE.getChoice().isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -100,14 +100,14 @@ class OrderOfSuccessionEffect extends OneShotEffect {
|
|||
boolean left = source.getChoices().get(0).getChoice().equals("Left");
|
||||
PlayerList playerList = game.getState().getPlayerList().copy();
|
||||
// set playerlist to controller
|
||||
while (!playerList.get().equals(source.getControllerId()) && controller.isInGame()) {
|
||||
while (!playerList.get().equals(source.getControllerId()) && controller.canRespond()) {
|
||||
playerList.getNext();
|
||||
}
|
||||
Player currentPlayer = game.getPlayer(playerList.get());
|
||||
Player nextPlayer;
|
||||
UUID firstNextPlayer = null;
|
||||
|
||||
while (!getNextPlayerInDirection(left, playerList, game).equals(firstNextPlayer) && controller.isInGame()){
|
||||
while (!getNextPlayerInDirection(left, playerList, game).equals(firstNextPlayer) && controller.canRespond()){
|
||||
nextPlayer = game.getPlayer(playerList.get());
|
||||
if (nextPlayer == null) {
|
||||
return false;
|
||||
|
|
@ -116,7 +116,7 @@ class OrderOfSuccessionEffect extends OneShotEffect {
|
|||
if (firstNextPlayer == null) {
|
||||
firstNextPlayer = nextPlayer.getId();
|
||||
}
|
||||
if (!nextPlayer.isInGame()) {
|
||||
if (!nextPlayer.canRespond()) {
|
||||
continue;
|
||||
}
|
||||
// if player is in range he chooses a creature to control
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class MaelstromArchangelCastEffect extends OneShotEffect {
|
|||
controller.chooseUse(outcome, "Cast a nonland card from your hand without paying its mana cost?", source, game)) {
|
||||
Card cardToCast = null;
|
||||
boolean cancel = false;
|
||||
while (controller.isInGame() && !cancel) {
|
||||
while (controller.canRespond() && !cancel) {
|
||||
if (controller.chooseTarget(outcome, target, source, game)) {
|
||||
cardToCast = game.getCard(target.getFirstTarget());
|
||||
if (cardToCast != null && cardToCast.getSpellAbility().canChooseTarget(game)) {
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class CallToTheKindredEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class FaithsShieldEffect extends OneShotEffect {
|
|||
ChoiceColor choice = new ChoiceColor();
|
||||
while (!choice.isChosen()) {
|
||||
controller.choose(Outcome.Protect, choice, game);
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class ReleaseSacrificeEffect extends OneShotEffect {
|
|||
Target target5 = new TargetControlledPermanent(1, 1, new FilterControlledPlaneswalkerPermanent(), true);
|
||||
|
||||
if (target1.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target1.isChosen() && target1.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target1.isChosen() && target1.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target1, source, game);
|
||||
}
|
||||
Permanent artifact = game.getPermanent(target1.getFirstTarget());
|
||||
|
|
@ -130,7 +130,7 @@ class ReleaseSacrificeEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (target2.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target2.isChosen() && target2.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target2.isChosen() && target2.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target2, source, game);
|
||||
}
|
||||
Permanent creature = game.getPermanent(target2.getFirstTarget());
|
||||
|
|
@ -141,7 +141,7 @@ class ReleaseSacrificeEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (target3.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target3.isChosen() && target3.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target3.isChosen() && target3.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target3, source, game);
|
||||
}
|
||||
Permanent enchantment = game.getPermanent(target3.getFirstTarget());
|
||||
|
|
@ -152,7 +152,7 @@ class ReleaseSacrificeEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (target4.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target4.isChosen() && target4.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target4.isChosen() && target4.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target4, source, game);
|
||||
}
|
||||
Permanent land = game.getPermanent(target4.getFirstTarget());
|
||||
|
|
@ -163,7 +163,7 @@ class ReleaseSacrificeEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (target5.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target5.isChosen() && target5.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target5.isChosen() && target5.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target5, source, game);
|
||||
}
|
||||
Permanent planeswalker = game.getPermanent(target5.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class PlasmCaptureManaEffect extends ManaEffect {
|
|||
for(int i = 0; i < amountOfMana; i++){
|
||||
ChoiceColor choiceColor = new ChoiceColor();
|
||||
while (!player.choose(Outcome.Benefit, choiceColor, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class RevealingWindEffect extends OneShotEffect {
|
|||
if (controller != null && sourceObject != null) {
|
||||
while (game.getBattlefield().count(filter, source.getOriginalId(), source.getControllerId(), game) > 0 &&
|
||||
controller.chooseUse(outcome, "Look at a face-down attacking creature?", source, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
Target target = new TargetCreaturePermanent(filter);
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class ShorecrasherElementalBoostEffect extends OneShotEffect {
|
|||
choice.getChoices().add(CHOICE_1);
|
||||
choice.getChoices().add(CHOICE_2);
|
||||
while (!choice.isChosen()) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
controller.choose(outcome, choice, game);
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class EvershrikeEffect extends OneShotEffect {
|
|||
filterAuraCard.add(new AuraCardCanAttachToPermanentId(evershrikePermanent.getId()));
|
||||
filterAuraCard.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, xAmount));
|
||||
int count = controller.getHand().count(filterAuraCard, game);
|
||||
while (controller.isInGame() && count > 0 && controller.chooseUse(Outcome.Benefit, "Do you wish to put an Aura card from your hand onto Evershrike", source, game)) {
|
||||
while (controller.canRespond() && count > 0 && controller.chooseUse(Outcome.Benefit, "Do you wish to put an Aura card from your hand onto Evershrike", source, game)) {
|
||||
TargetCard targetAura = new TargetCard(Zone.PICK, filterAuraCard);
|
||||
if (controller.choose(Outcome.Benefit, controller.getHand(), targetAura, game)) {
|
||||
Card aura = game.getCard(targetAura.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class CataclysmEffect extends OneShotEffect {
|
|||
Target target4 = new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent(), true);
|
||||
|
||||
if (target1.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target1.isChosen() && target1.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target1.isChosen() && target1.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target1, source, game);
|
||||
}
|
||||
Permanent artifact = game.getPermanent(target1.getFirstTarget());
|
||||
|
|
@ -106,7 +106,7 @@ class CataclysmEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (target2.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target2.isChosen() && target2.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target2.isChosen() && target2.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target2, source, game);
|
||||
}
|
||||
Permanent creature = game.getPermanent(target2.getFirstTarget());
|
||||
|
|
@ -117,7 +117,7 @@ class CataclysmEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (target3.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target3.isChosen() && target3.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target3.isChosen() && target3.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target3, source, game);
|
||||
}
|
||||
Permanent enchantment = game.getPermanent(target3.getFirstTarget());
|
||||
|
|
@ -128,7 +128,7 @@ class CataclysmEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (target4.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target4.isChosen() && target4.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target4.isChosen() && target4.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target4, source, game);
|
||||
}
|
||||
Permanent land = game.getPermanent(target4.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class DawnsReflectionManaEffect extends ManaEffect {
|
|||
Mana mana = new Mana();
|
||||
for(int i = 0; i < x; i++){
|
||||
ChoiceColor choiceColor = new ChoiceColor();
|
||||
while (controller.isInGame() && !controller.choose(Outcome.Benefit, choiceColor, game)) {
|
||||
while (controller.canRespond() && !controller.choose(Outcome.Benefit, choiceColor, game)) {
|
||||
}
|
||||
|
||||
if (choiceColor.getColor().isBlack()) {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl {
|
|||
if (controller != null) {
|
||||
while (!choice.isChosen()) {
|
||||
controller.choose(Outcome.Neutral, choice, game);
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class SylvanLibraryEffect extends OneShotEffect {
|
|||
int numberOfCardsToPutBack = cardsPutBack.size();
|
||||
if (numberOfCardsToPutBack > 1) {
|
||||
TargetCard target2 = new TargetCard(Zone.PICK, new FilterCard("card to put on the top of your library (last chosen will be on top)"));
|
||||
while (controller.isInGame() && cardsPutBack.size() > 1) {
|
||||
while (controller.canRespond() && cardsPutBack.size() > 1) {
|
||||
controller.choose(Outcome.Benefit, cardsPutBack, target2, game);
|
||||
Card card = cardsPutBack.get(target2.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class ManaClashEffect extends OneShotEffect {
|
|||
if (controller != null && targetOpponent != null) {
|
||||
boolean bothHeads = false;
|
||||
while (!bothHeads) {
|
||||
if (!targetOpponent.isInGame() || !controller.isInGame()) {
|
||||
if (!targetOpponent.canRespond() || !controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
boolean controllerFlip = controller.flipCoin(game);
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class CoalitionRelicEffect extends OneShotEffect {
|
|||
ChoiceColor choice = new ChoiceColor();
|
||||
for (int i = 0; i < chargeCounters; i++) {
|
||||
while (!choice.isChosen()) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
player.choose(outcome, choice, game);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class DevourFleshSacrificeEffect extends OneShotEffect {
|
|||
int realCount = game.getBattlefield().countAll(filter, player.getId(), game);
|
||||
if (realCount > 0) {
|
||||
Target target = new TargetControlledPermanent(1, 1, filter, true);
|
||||
while (player.isInGame() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Sacrifice, target, source, game);
|
||||
}
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class OrcishLumberjackManaEffect extends ManaEffect {
|
|||
Mana mana = new Mana();
|
||||
for(int i = 0; i < 3; i++){
|
||||
while (!player.choose(Outcome.Benefit, manaChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class DemonicConsultationEffect extends OneShotEffect {
|
|||
Choice choice = new ChoiceImpl();
|
||||
choice.setChoices(CardRepository.instance.getNames());
|
||||
while (!player.choose(Outcome.Benefit, choice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class OrcishLibrarianEffect extends OneShotEffect {
|
|||
}
|
||||
player.lookAtCards("OrcishLibrarian", cards, game);
|
||||
TargetCard target = new TargetCard (Zone.PICK, new FilterCard("card to put on the top of target player's library"));
|
||||
while (player.isInGame() && cards.size() > 0) {
|
||||
while (player.canRespond() && cards.size() > 0) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class CreepingRenaissanceEffect extends OneShotEffect {
|
|||
typeChoice.getChoices().add(CardType.LAND.toString());
|
||||
typeChoice.getChoices().add(CardType.PLANESWALKER.toString());
|
||||
|
||||
while (controller.isInGame() && !controller.choose(Outcome.ReturnToHand, typeChoice, game)) {
|
||||
while (controller.canRespond() && !controller.choose(Outcome.ReturnToHand, typeChoice, game)) {
|
||||
}
|
||||
|
||||
String typeName = typeChoice.getChoice();
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class DivineReckoningEffect extends OneShotEffect {
|
|||
|
||||
Target target = new TargetControlledPermanent(1, 1, new FilterControlledCreaturePermanent(), true);
|
||||
if (target.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.Benefit, target, source, game);
|
||||
}
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ class GarrukTheVeilCursedEffect extends OneShotEffect {
|
|||
Target target = new TargetControlledPermanent(1, 1, filterCreature, false);
|
||||
boolean sacrificed = false;
|
||||
if (target.canChoose(controller.getId(), game)) {
|
||||
while (controller.isInGame() && !target.isChosen() && target.canChoose(controller.getId(), game)) {
|
||||
while (controller.canRespond() && !target.isChosen() && target.canChoose(controller.getId(), game)) {
|
||||
controller.chooseTarget(Outcome.Sacrifice, target, source, game);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class NevermoreEffect1 extends OneShotEffect {
|
|||
cardChoice.setChoices(CardRepository.instance.getNonLandNames());
|
||||
cardChoice.clearChoice();
|
||||
while (!controller.choose(Outcome.Detriment, cardChoice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class HallOfTriumphEffect extends OneShotEffect {
|
|||
ChoiceColor colorChoice = new ChoiceColor();
|
||||
colorChoice.setMessage("Choose color");
|
||||
while (!player.choose(Outcome.BoostCreature, colorChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class MarketFestivalManaEffect extends ManaEffect {
|
|||
choiceColor.setMessage("Second mana color for " + sourceObject.getLogName());
|
||||
}
|
||||
while (!controller.choose(Outcome.Benefit, choiceColor, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class CabalTherapyEffect extends OneShotEffect {
|
|||
cardChoice.clearChoice();
|
||||
|
||||
while (!controller.choose(Outcome.Discard, cardChoice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class FlashOfInsightEffect extends OneShotEffect {
|
|||
.append(" card").append(cards.size() > 1 ? "s":"")
|
||||
.append(" on the bottom of his or her library").toString());
|
||||
}
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class ButcherOfTheHordeEffect extends OneShotEffect {
|
|||
abilityChoice.setChoices(abilities);
|
||||
while (!abilityChoice.isChosen()) {
|
||||
controller.choose(Outcome.AddAbility, abilityChoice, game);
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public class MistformSliver extends CardImpl {
|
|||
typeChoice.setMessage("Choose creature type");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.Detriment, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class NaturalSelectionEffect extends OneShotEffect {
|
|||
you.lookAtCards("Natural Selection", cards, game);
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the top of target player's library"));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
you.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class HoardersGreedEffect extends OneShotEffect {
|
|||
do {
|
||||
controller.loseLife(2, game);
|
||||
controller.drawCards(2, game);
|
||||
} while (controller.isInGame() && ClashEffect.getInstance().apply(game, source));
|
||||
} while (controller.canRespond() && ClashEffect.getInstance().apply(game, source));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class MirrorOfFateEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on top of your library"));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class SphinxAmbassadorEffect extends OneShotEffect {
|
|||
cardChoice.setChoices(choices);
|
||||
cardChoice.clearChoice();
|
||||
while (!targetPlayer.choose(Outcome.Benefit, cardChoice, game)) {
|
||||
if (!targetPlayer.isInGame()) {
|
||||
if (!targetPlayer.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ class ConundrumSphinxEffect extends OneShotEffect {
|
|||
for (Player player: game.getPlayers().values()) {
|
||||
if(player.getLibrary().size() > 0){
|
||||
cardChoice.clearChoice();
|
||||
while (!player.choose(Outcome.DrawCard, cardChoice, game) && player.isInGame()) {
|
||||
if (!player.isInGame()) {
|
||||
while (!player.choose(Outcome.DrawCard, cardChoice, game) && player.canRespond()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class DevoutInvocationEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
int tappedAmount = 0;
|
||||
TargetPermanent target = new TargetPermanent(0,1,filter, false);
|
||||
while (true && controller.isInGame()) {
|
||||
while (true && controller.canRespond()) {
|
||||
target.clearChosen();
|
||||
if (target.canChoose(source.getControllerId(), game)) {
|
||||
Map<String, Serializable> options = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class ChooseCreatureTypeEffect extends OneShotEffect {
|
|||
typeChoice.setMessage("Choose creature type");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class AEtherspoutsEffect extends OneShotEffect {
|
|||
}
|
||||
TargetCard target = new TargetCard(Zone.BATTLEFIELD, new FilterCard("order to put on the top of library (last choosen will be the top most)"));
|
||||
while (cards.size() > 1) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
|
|
@ -174,7 +174,7 @@ class AEtherspoutsEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
target = new TargetCard(Zone.BATTLEFIELD, new FilterCard("order to put on bottom of library (last choosen will be bottommost card)"));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
|
|
@ -199,7 +199,7 @@ class AEtherspoutsEffect extends OneShotEffect {
|
|||
player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, false, false);
|
||||
}
|
||||
player = playerList.getNext(game);
|
||||
} while (player != null && !player.getId().equals(game.getActivePlayerId()) && activePlayer.isInGame());
|
||||
} while (player != null && !player.getId().equals(game.getActivePlayerId()) && activePlayer.canRespond());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class ObeliskOfUrdEnterBattlefieldEffect extends OneShotEffect {
|
|||
typeChoice.setMessage("Choose a creature type:");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class StainTheMindEffect extends SearchTargetGraveyardHandLibraryForCardNameAndE
|
|||
cardChoice.setMessage("Name a nonland card");
|
||||
|
||||
while (!controller.choose(Outcome.Exile, cardChoice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class InfiniteObliterationEffect extends SearchTargetGraveyardHandLibraryForCard
|
|||
cardChoice.setMessage("Name a creature card");
|
||||
|
||||
while (!controller.choose(Outcome.Exile, cardChoice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class SphinxsTutelageEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
targetPlayer.moveCards(cards, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
} while (colorShared && targetPlayer.isInGame());
|
||||
} while (colorShared && targetPlayer.canRespond());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class TalentOfTheTelepathEffect extends OneShotEffect {
|
|||
cardsToCast.remove(card);
|
||||
allCards.remove(card);
|
||||
}
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
target.clearChosen();
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class ProteusStaffEffect extends OneShotEffect {
|
|||
controller.revealCards("Proteus Staff", cards, game);
|
||||
|
||||
// and the rest on the bottom of his or her library in any order.
|
||||
while (cards.size() > 0 && controller.isInGame()) {
|
||||
while (cards.size() > 0 && controller.canRespond()) {
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class MitoticManipulationEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class PhyrexianRevokerEffect1 extends OneShotEffect {
|
|||
cardChoice.setChoices(CardRepository.instance.getNonLandNames());
|
||||
cardChoice.clearChoice();
|
||||
while (!controller.choose(Outcome.Detriment, cardChoice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class DistantMelodyEffect extends OneShotEffect {
|
|||
typeChoice.setMessage("Choose a creature type:");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class LuminescentRainEffect extends OneShotEffect {
|
|||
typeChoice.setMessage("Choose a creature type:");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class RoarOfTheCrowdEffect extends OneShotEffect {
|
|||
typeChoice.setMessage("Choose a creature type:");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.LoseLife, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class ApostlesBlessingEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
ChoiceColorOrArtifact choice = new ChoiceColorOrArtifact();
|
||||
while (!choice.isChosen()) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
controller.choose(outcome, choice, game);
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class PsychicSurgeryEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on top of his library"));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class ShrineOfPiercingVisionEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class XenograftEffect extends OneShotEffect {
|
|||
typeChoice.setMessage("Choose creature type");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect {
|
|||
Player player = game.getPlayer(game.getActivePlayerId());
|
||||
if (player != null) {
|
||||
while (!player.choose(outcome, choiceImpl, game)) {
|
||||
if (player.isInGame()) {
|
||||
if (player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class TeferisPuzzleBoxEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class TaintedPactEffect extends OneShotEffect{
|
|||
return false;
|
||||
}
|
||||
Set<String> names = new HashSet<>();
|
||||
while (player.isInGame() && player.getLibrary().size() > 0) {
|
||||
while (player.canRespond() && player.getLibrary().size() > 0) {
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class AkromasBlessingChooseColorEffect extends OneShotEffect {
|
|||
ChoiceColor choice = new ChoiceColor();
|
||||
while (!choice.isChosen()) {
|
||||
controller.choose(outcome, choice, game);
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class PatriarchsBiddingEffect extends OneShotEffect {
|
|||
typeChoice.setMessage("Choose a creature type");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.PutCreatureInPlay, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class PeerPressureEffect extends OneShotEffect {
|
|||
choice.setMessage("Choose creature type");
|
||||
choice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!controller.choose(Outcome.GainControl, choice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class RiptideShapeshifterEffect extends OneShotEffect {
|
|||
choice.setMessage("Choose a creature type:");
|
||||
choice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!player.choose(Outcome.BoostCreature, choice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class StandardizeEffect extends OneShotEffect {
|
|||
types.remove("Wall");
|
||||
typeChoice.setChoices(types);
|
||||
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class WordsOfWindEffect extends ReplacementEffectImpl {
|
|||
List<Permanent> liste = game.getBattlefield().getActivePermanents(new FilterControlledPermanent(), playerId, game);
|
||||
if(!liste.isEmpty()){
|
||||
while (!player.choose(Outcome.ReturnToHand, target, source.getSourceId(), game)){
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class DarigaazTheIgniterEffect extends OneShotEffect {
|
|||
ChoiceColor choice = new ChoiceColor(true);
|
||||
while (!choice.isChosen()) {
|
||||
controller.choose(outcome, choice, game);
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class VoidstoneGargoyleChooseCardEffect extends OneShotEffect {
|
|||
cardChoice.setChoices(CardRepository.instance.getNonLandNames());
|
||||
cardChoice.clearChoice();
|
||||
while (!controller.choose(Outcome.Detriment, cardChoice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class VedalkenEngineerEffect extends ManaEffect {
|
|||
Mana mana = new Mana();
|
||||
ChoiceColor choiceColor = new ChoiceColor(true);
|
||||
while (!controller.choose(Outcome.Benefit, choiceColor, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl {
|
|||
if (controller != null) {
|
||||
while (!choice.isChosen()) {
|
||||
controller.choose(Outcome.Neutral, choice, game);
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class ReturnToHandEffect extends OneShotEffect {
|
|||
|
||||
Target target = new TargetControlledPermanent(1, 1, new FilterControlledCreaturePermanent(), true);
|
||||
if (target.canChoose(player.getId(), game)) {
|
||||
while (player.isInGame() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
while (player.canRespond() && !target.isChosen() && target.canChoose(player.getId(), game)) {
|
||||
player.chooseTarget(Outcome.ReturnToHand, target, source, game);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class BurningOfXinyeEffect extends OneShotEffect{
|
|||
|
||||
Target target = new TargetControlledPermanent(amount, amount, filter, true);
|
||||
if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) {
|
||||
while (!target.isChosen() && target.canChoose(player.getId(), game) && player.isInGame()) {
|
||||
while (!target.isChosen() && target.canChoose(player.getId(), game) && player.canRespond()) {
|
||||
player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class CongregationAtDawnEffect extends OneShotEffect {
|
|||
|
||||
TargetCard targetToLib = new TargetCard(Zone.PICK, new FilterCard(textTop));
|
||||
|
||||
while (revealed.size() > 1 && controller.isInGame()) {
|
||||
while (revealed.size() > 1 && controller.canRespond()) {
|
||||
controller.choose(Outcome.Neutral, revealed, targetToLib, game);
|
||||
Card card = revealed.get(targetToLib.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class MindmoilEffect extends OneShotEffect {
|
|||
cards.add(card.getId());
|
||||
}
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
while (you.isInGame() && cards.size() > 1) {
|
||||
while (you.canRespond() && cards.size() > 1) {
|
||||
you.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class DestroyTheEvidenceEffect extends OneShotEffect {
|
|||
boolean landFound = false;
|
||||
Cards cards = new CardsImpl();
|
||||
while (player.getLibrary().size() > 0 && !landFound) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ class JaceArchitectOfThoughtEffect2 extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard targetCard = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
while (player.isInGame() && cardsToLibrary.size() > 1) {
|
||||
while (player.canRespond() && cardsToLibrary.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cardsToLibrary, targetCard, game);
|
||||
Card card = cardsToLibrary.get(targetCard.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class SlaughterGamesEffect extends SearchTargetGraveyardHandLibraryForCardNameAn
|
|||
cardChoice.setMessage("Name a nonland card");
|
||||
|
||||
while (!controller.choose(Outcome.Exile, cardChoice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class TabletOfTheGuildsEntersBattlefieldEffect extends OneShotEffect {
|
|||
ChoiceColor colorChoice = new ChoiceColor();
|
||||
colorChoice.setMessage("Choose the first color");
|
||||
while (!player.choose(Outcome.GainLife, colorChoice, game)) {
|
||||
if (!player.isInGame()) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ class TabletOfTheGuildsEntersBattlefieldEffect extends OneShotEffect {
|
|||
|
||||
colorChoice.getChoices().remove(colorChoice.getChoice());
|
||||
colorChoice.setMessage("Choose the second color");
|
||||
while (!player.choose(Outcome.GainLife, colorChoice, game) && player.isInGame()) {
|
||||
while (!player.choose(Outcome.GainLife, colorChoice, game) && player.canRespond()) {
|
||||
game.debugMessage("player canceled choosing type. retrying.");
|
||||
}
|
||||
game.getState().setValue(permanent.getId() + "_color2", colorChoice.getColor().toString());
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class HellcarverDemonEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
while (player != null && player.isInGame() && player.chooseUse(Outcome.PlayForFree, "Cast another nonland card exiled with Hellcarver Demon without paying that card's mana cost?", source, game)) {
|
||||
while (player != null && player.canRespond() && player.chooseUse(Outcome.PlayForFree, "Cast another nonland card exiled with Hellcarver Demon without paying that card's mana cost?", source, game)) {
|
||||
TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId());
|
||||
while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(source.getSourceId()), target, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ class SasayasEssenceManaEffectEffect extends ManaEffect {
|
|||
} else {
|
||||
while(!choice.isChosen()) {
|
||||
controller.choose(outcome, choice, game);
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class UndyingFlamesEffect extends OneShotEffect {
|
|||
Player you = game.getPlayer(source.getControllerId());
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
while (you != null && sourceCard != null
|
||||
&& you.getLibrary().size() > 0 && you.isInGame()) {
|
||||
&& you.getLibrary().size() > 0 && you.canRespond()) {
|
||||
Card card = you.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
you.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class CloneShellEffect extends OneShotEffect {
|
|||
|
||||
if (cards.size() > 0) {
|
||||
TargetCard target2 = new TargetCard(Zone.PICK, filter2);
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
while (player.canRespond() && cards.size() > 1) {
|
||||
player.choose(Outcome.Benefit, cards, target2, game);
|
||||
Card card = cards.get(target2.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class MemoricideEffect extends OneShotEffect {
|
|||
cardChoice.clearChoice();
|
||||
|
||||
while (!controller.choose(Outcome.Exile, cardChoice, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class MyrBattlesphereEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
int tappedAmount = 0;
|
||||
TargetPermanent target = new TargetPermanent(0,1,filter, false);
|
||||
while (true && controller.isInGame()) {
|
||||
while (true && controller.canRespond()) {
|
||||
target.clearChosen();
|
||||
if (target.canChoose(source.getControllerId(), game)) {
|
||||
Map<String, Serializable> options = new HashMap<>();
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue