mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 19:59:54 -08:00
Please test! Some changes to the display of user choices, showing also a longer text in tooltip window.
This commit is contained in:
parent
cac04616f3
commit
df3e6db569
352 changed files with 2277 additions and 2034 deletions
|
|
@ -99,7 +99,7 @@ class ArsenalThresherEffect extends OneShotEffect {
|
|||
Permanent arsenalThresher = game.getPermanent(source.getSourceId());
|
||||
FilterArtifactCard filter = new FilterArtifactCard();
|
||||
filter.add(new AnotherCardPredicate());
|
||||
if (you.chooseUse(Outcome.Benefit, "Do you want to reveal other artifacts in your hand?", game)) {
|
||||
if (you.chooseUse(Outcome.Benefit, "Do you want to reveal other artifacts in your hand?", source, game)) {
|
||||
Cards cards = new CardsImpl();
|
||||
if (you.getHand().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) {
|
||||
TargetCardInHand target = new TargetCardInHand(0, Integer.MAX_VALUE, filter);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class EtherwroughtPageEffect extends OneShotEffect {
|
|||
CardsImpl cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
controller.lookAtCards("Etherwrought Page", cards, game);
|
||||
if (controller.chooseUse(Outcome.Neutral, "Do you wish to put the card into your graveyard?", game)) {
|
||||
if (controller.chooseUse(Outcome.Neutral, "Do you wish to put the card into your graveyard?", source, game)) {
|
||||
return controller.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ class SovereignsOfLostAlaraEffect extends OneShotEffect {
|
|||
FilterCard filter = new FilterCard("aura that could enchant the lone attacking creature");
|
||||
filter.add(new SubtypePredicate("Aura"));
|
||||
filter.add(new AuraCardCanAttachToPermanentId(attackingCreature.getId()));
|
||||
if (you.chooseUse(Outcome.Benefit, "Do you want to search your library?", game)) {
|
||||
if (you.chooseUse(Outcome.Benefit, "Do you want to search your library?", source, game)) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
target.setNotTarget(true);
|
||||
if (you.searchLibrary(target, game)) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class VectisDominatorEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
cost.clearPaid();
|
||||
final StringBuilder sb = new StringBuilder("Pay 2 life? (Otherwise ").append(targetCreature.getName()).append(" will be tapped)");
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), source, game)) {
|
||||
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true);
|
||||
}
|
||||
if (!cost.isPaid()) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class PutLandOnBattlefieldEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || !player.chooseUse(Outcome.PutLandInPlay, choiceText, game)) {
|
||||
if (player == null || !player.chooseUse(Outcome.PutLandInPlay, choiceText, source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
while (player.isInGame() && player.chooseUse(Outcome.Benefit, "Attach an Aura from the battlefield?", game)) {
|
||||
while (player.isInGame() && 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?", game)) {
|
||||
while (player.isInGame() && 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?", game)) {
|
||||
while (player.isInGame() && 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());
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class DescendantsPathEffect extends OneShotEffect {
|
|||
}
|
||||
if (found) {
|
||||
game.informPlayers(sourceObject.getLogName() + ": Found a creature that shares a creature type with the revealed card.");
|
||||
if (controller.chooseUse(Outcome.Benefit, "Cast the card?", game)) {
|
||||
if (controller.chooseUse(Outcome.Benefit, "Cast the card?", source, game)) {
|
||||
controller.cast(card.getSpellAbility(), game, true);
|
||||
} else {
|
||||
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " canceled casting the card.");
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class FettergeistUnlessPaysEffect extends OneShotEffect {
|
|||
if (count == 0) {
|
||||
return true;
|
||||
}
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay " + count + "?", game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay " + count + "?", source, game)) {
|
||||
GenericManaCost cost = new GenericManaCost(count);
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class KillingWaveEffect extends OneShotEffect {
|
|||
int playerLife = player.getLife();
|
||||
for (Permanent creature : creatures) {
|
||||
String message = "Pay " + amount + " life? If you don't, " + creature.getName() + " will be sacrificed.";
|
||||
if (playerLife - amount - lifePaid >= 0 && player != null && player.chooseUse(Outcome.Neutral, message, game)) {
|
||||
if (playerLife - amount - lifePaid >= 0 && player != null && player.chooseUse(Outcome.Neutral, message, source, game)) {
|
||||
game.informPlayers(player.getLogName() + " pays " + amount + " life. He will not sacrifice " + creature.getName());
|
||||
lifePaid += amount;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class PrimalSurgeEffect extends OneShotEffect {
|
|||
if ((cardType.contains(CardType.ARTIFACT) || cardType.contains(CardType.CREATURE)
|
||||
|| cardType.contains(CardType.ENCHANTMENT) || cardType.contains(CardType.LAND)
|
||||
|| cardType.contains(CardType.PLANESWALKER))
|
||||
&& player.chooseUse(Outcome.PutCardInPlay, "Put " + card.getName() + " onto the battlefield?", game)) {
|
||||
&& player.chooseUse(Outcome.PutCardInPlay, "Put " + card.getName() + " onto the battlefield?", source, game)) {
|
||||
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
||||
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class VexingDevilEffect extends OneShotEffect {
|
|||
if (controller != null && permanent != null) {
|
||||
for (UUID opponentUuid : game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(opponentUuid);
|
||||
if (opponent != null && opponent.chooseUse(Outcome.LoseLife, "Make " + permanent.getLogName() + " deal 4 damage to you?", game)) {
|
||||
if (opponent != null && opponent.chooseUse(Outcome.LoseLife, "Make " + permanent.getLogName() + " deal 4 damage to you?", source, game)) {
|
||||
game.informPlayers(opponent.getLogName() + " has chosen to receive 4 damage from " + permanent.getLogName());
|
||||
opponent.damage(4, permanent.getId(), game, false, true);
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class IwamoriOfTheOpenFistEffect extends OneShotEffect {
|
|||
Player opponent = game.getPlayer(playerId);
|
||||
Target target = new TargetCardInHand(filter);
|
||||
if (opponent != null && target.canChoose(source.getSourceId(), opponent.getId(), game)) {
|
||||
if (opponent.chooseUse(Outcome.PutCreatureInPlay, "Put a legendary creature card from your hand onto the battlefield?", game)) {
|
||||
if (opponent.chooseUse(Outcome.PutCreatureInPlay, "Put a legendary creature card from your hand onto the battlefield?", source, game)) {
|
||||
if (target.chooseTarget(Outcome.PutCreatureInPlay, opponent.getId(), source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class OgreMarauderEffect extends OneShotEffect {
|
|||
if (defender != null && sourceObject != null) {
|
||||
Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent());
|
||||
if (cost.canPay(source, source.getSourceId(), defendingPlayerId, game) &&
|
||||
defender.chooseUse(Outcome.LoseAbility, "Sacrifice a creature to prevent that " + sourceObject.getLogName() + " can't be blocked?", game)) {
|
||||
defender.chooseUse(Outcome.LoseAbility, "Sacrifice a creature to prevent that " + sourceObject.getLogName() + " can't be blocked?", source, game)) {
|
||||
if (!cost.pay(source, game, source.getSourceId(), defendingPlayerId, false)) {
|
||||
// cost was not payed - so source can't be blocked
|
||||
ContinuousEffect effect = new CantBeBlockedSourceEffect(Duration.EndOfTurn);
|
||||
|
|
|
|||
|
|
@ -90,9 +90,9 @@ public class ToilsOfNightAndDay extends CardImpl {
|
|||
for (UUID targetId : source.getTargets().get(0).getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append("?").toString(), game)) {
|
||||
if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append("?").toString(), source, game)) {
|
||||
permanent.tap(game);
|
||||
} else if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append("?").toString(), game)) {
|
||||
} else if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append("?").toString(), source, game)) {
|
||||
permanent.untap(game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class ArbiterOfTheIdealEffect extends OneShotEffect {
|
|||
player.revealCards("Arbiter of the Ideal", cards, game);
|
||||
|
||||
if (card != null) {
|
||||
if (filter.match(card, game) && player.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append("onto battlefield?").toString(), game)) {
|
||||
if (filter.match(card, game) && player.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append("onto battlefield?").toString(), source, game)) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class FloodtideSerpentReplacementEffect extends ReplacementEffectImpl {
|
|||
if ( player != null ) {
|
||||
ReturnToHandTargetPermanentCost attackCost = new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter));
|
||||
if ( attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Neutral, "Return an enchantment you control to hand to attack?", game) )
|
||||
player.chooseUse(Outcome.Neutral, "Return an enchantment you control to hand to attack?", source, game) )
|
||||
{
|
||||
if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), true) ) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class HeroOfLeinaTowerEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
ManaCosts cost = new ManaCostsImpl("{X}");
|
||||
if (you != null && you.chooseUse(Outcome.BoostCreature, "Do you want to to pay {X}?", game)) {
|
||||
if (you != null && you.chooseUse(Outcome.BoostCreature, "Do you want to to pay {X}?", source, game)) {
|
||||
int costX = you.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
|
||||
cost.add(new GenericManaCost(costX));
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ class HeroesPodiumEffect extends OneShotEffect {
|
|||
player.lookAtCards("Heroes' Podium", cards, game);
|
||||
|
||||
// You may reveal a legendary creature card from among them and put it into your hand.
|
||||
if (!cards.isEmpty() && legendaryIncluded && player.chooseUse(outcome, "Put a legendary creature card into your hand?", game)) {
|
||||
if (!cards.isEmpty() && legendaryIncluded && player.chooseUse(outcome, "Put a legendary creature card into your hand?", source, game)) {
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.getRandom(game);
|
||||
cards.remove(card);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class DoUnlessTargetPaysCost extends OneShotEffect {
|
|||
}
|
||||
message = CardUtil.replaceSourceName(message, mageObject.getLogName());
|
||||
cost.clearPaid();
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game) && player.chooseUse(executingEffect.getOutcome(), message, game)) {
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game) && player.chooseUse(executingEffect.getOutcome(), message, source, game)) {
|
||||
cost.pay(source, game, source.getSourceId(), player.getId(), false);
|
||||
}
|
||||
if (!cost.isPaid()) {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class OracleOfBonesCastEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Target target = new TargetCardInHand(filter);
|
||||
if (target.canChoose(source.getSourceId(), controller.getId(), game) &&
|
||||
controller.chooseUse(outcome, "Cast an instant or sorcery card from your hand without paying its mana cost?", game)) {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class SatyrWayfinderEffect extends OneShotEffect {
|
|||
controller.revealCards(sourceObject.getName(), cards, game);
|
||||
TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand);
|
||||
if (properCardFound &&
|
||||
controller.chooseUse(outcome, "Put a land card into your hand?", game) &&
|
||||
controller.chooseUse(outcome, "Put a land card into your hand?", source, game) &&
|
||||
controller.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class CutTheTethersEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(creature.getControllerId());
|
||||
if (player != null) {
|
||||
boolean paid = false;
|
||||
if (player.chooseUse(outcome, new StringBuilder("Pay {3} to keep ").append(creature.getName()).append(" on the battlefield?").toString(), game)) {
|
||||
if (player.chooseUse(outcome, new StringBuilder("Pay {3} to keep ").append(creature.getName()).append(" on the battlefield?").toString(), source, game)) {
|
||||
Cost cost = new GenericManaCost(3);
|
||||
if (!cost.pay(source, game, source.getSourceId(), creature.getControllerId(), false)) {
|
||||
paid = true;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class GhostlyPrisonReplacementEffect extends ReplacementEffectImpl {
|
|||
if ( player != null && event.getTargetId().equals(source.getControllerId())) {
|
||||
ManaCostsImpl attackTax = new ManaCostsImpl("{2}");
|
||||
if (attackTax.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Benefit, "Pay {2} to attack player?", game) ) {
|
||||
player.chooseUse(Outcome.Benefit, "Pay {2} to attack player?", source, game) ) {
|
||||
if (attackTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class HinderReplacementEffect extends ReplacementEffectImpl {
|
|||
Card card = (Card) targetObject;
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
boolean top = player.chooseUse(Outcome.Neutral, "Put " + card.getName() + " on top of the library? Otherwise it will be put on the bottom.", game);
|
||||
boolean top = player.chooseUse(Outcome.Neutral, "Put " + card.getName() + " on top of the library? Otherwise it will be put on the bottom.", source, game);
|
||||
if (card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, top, event.getAppliedEffects())) {
|
||||
game.informPlayers(player.getLogName() + " has put " + card.getName() + " on " + (top ? "top" : "the bottom") + " of the library.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class InameLifeAspectEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller != null && sourceObject != null) {
|
||||
if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return Spirit cards?", game)) {
|
||||
if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return Spirit cards?", source, game)) {
|
||||
new ExileSourceEffect().apply(game, source);
|
||||
return new ReturnToHandTargetEffect().apply(game, source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class ThroughTheBreachEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, game)) {
|
||||
if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) {
|
||||
TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard());
|
||||
if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class ArcumDagssonEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(artifactCreature.getControllerId());
|
||||
if (player != null) {
|
||||
artifactCreature.sacrifice(source.getSourceId(), game);
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a noncreature artifact card?", game)) {
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a noncreature artifact card?", source, game)) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
if (player.searchLibrary(target, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class ScryingSheetsEffect extends OneShotEffect {
|
|||
cards.add(card);
|
||||
player.lookAtCards("Scrying Sheets", cards, game);
|
||||
if (card.getSupertype().contains("Snow")) {
|
||||
if (player.chooseUse(outcome, new StringBuilder("Reveal ").append(card.getName()).append(" and put it into your hand?").toString(), game)) {
|
||||
if (player.chooseUse(outcome, new StringBuilder("Reveal ").append(card.getName()).append(" and put it into your hand?").toString(), source, game)) {
|
||||
card = player.getLibrary().removeFromTop(game);
|
||||
player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
|
||||
player.revealCards("Scrying Sheets", cards, game);
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl {
|
|||
int xCost = 0;
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you != null) {
|
||||
if (you.chooseUse(Outcome.Benefit, "Do you wish to pay the additonal cost to add +1/+1 counters to the creature you cast?", game)) {
|
||||
if (you.chooseUse(Outcome.Benefit, "Do you wish to pay the additonal cost to add +1/+1 counters to the creature you cast?", source, game)) {
|
||||
xCost += playerPaysXGenericMana(you, source, game);
|
||||
// save the x value to be available for ETB replacement effect
|
||||
Object object = game.getState().getValue("spellX" + source.getSourceId());
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ class KaaliaOfTheVastEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, "Put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking?", game)) {
|
||||
if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, "Put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking?", source, game)) {
|
||||
return false;
|
||||
}
|
||||
TargetCardInHand target = new TargetCardInHand(filter);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class TheMimeoplasmEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (controller != null && permanent != null) {
|
||||
if (new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source, this) >= 2) {
|
||||
if (controller.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", game)) {
|
||||
if (controller.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", source, game)) {
|
||||
TargetCardInGraveyard targetCopy = new TargetCardInGraveyard(new FilterCreatureCard("creature card to become a copy of"));
|
||||
TargetCardInGraveyard targetCounters = new TargetCardInGraveyard(new FilterCreatureCard("creature card to determine amount of additional +1/+1 counters"));
|
||||
if (controller.choose(Outcome.Copy, targetCopy, source.getSourceId(), game)) {
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class VeteranExplorerEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
private void chooseAndSearchLibrary(List<Player> usingPlayers, Player player, Ability source, Game game) {
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for up to two basic land cards and put them onto the battlefield?", game)) {
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for up to two basic land cards and put them onto the battlefield?", source, game)) {
|
||||
usingPlayers.add(player);
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard());
|
||||
if (player.searchLibrary(target, game)) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class WhirlpoolWhelmEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
boolean topOfLibrary = false;
|
||||
if (ClashEffect.getInstance().apply(game, source)) {
|
||||
topOfLibrary = controller.chooseUse(outcome, "Put " + creature.getLogName() + " to top of libraray instead?" , game);
|
||||
topOfLibrary = controller.chooseUse(outcome, "Put " + creature.getLogName() + " to top of libraray instead?" , source, game);
|
||||
}
|
||||
if (topOfLibrary) {
|
||||
controller.moveCardToHandWithInfo(creature, source.getSourceId(), game, Zone.BATTLEFIELD);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class WildRicochetEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Spell spell = game.getStack().getSpell(source.getFirstTarget());
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (spell != null && you != null && you.chooseUse(Outcome.Benefit, "Do you wish to choose new targets for " + spell.getName() + "?", game)) {
|
||||
if (spell != null && you != null && you.chooseUse(Outcome.Benefit, "Do you wish to choose new targets for " + spell.getName() + "?", source, game)) {
|
||||
spell.chooseNewTargets(game, you.getId());
|
||||
}
|
||||
if (spell != null) {
|
||||
|
|
@ -100,7 +100,7 @@ class WildRicochetEffect extends OneShotEffect {
|
|||
copy.setControllerId(source.getControllerId());
|
||||
copy.setCopiedSpell(true);
|
||||
game.getStack().push(copy);
|
||||
if (you != null && you.chooseUse(Outcome.Benefit, "Do you wish to choose new targets for the copied " + spell.getName() + "?", game)) {
|
||||
if (you != null && you.chooseUse(Outcome.Benefit, "Do you wish to choose new targets for the copied " + spell.getName() + "?", source, game)) {
|
||||
return copy.chooseNewTargets(game, you.getId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class CurseOfChaosEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (attacker != null) {
|
||||
if (attacker.getHand().size() > 0 && attacker.chooseUse(outcome, "Discard a card and draw a card?", game)){
|
||||
if (attacker.getHand().size() > 0 && attacker.chooseUse(outcome, "Discard a card and draw a card?", source, game)){
|
||||
attacker.discard(1, false, source, game);
|
||||
attacker.drawCards(1, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,11 +141,11 @@ class CurseOfInertiaTapOrUntapTargetEffect extends OneShotEffect {
|
|||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (targetPermanent != null) {
|
||||
if (targetPermanent.isTapped()) {
|
||||
if (player.chooseUse(Outcome.Untap, "Untap that permanent?", game)) {
|
||||
if (player.chooseUse(Outcome.Untap, "Untap that permanent?", source, game)) {
|
||||
targetPermanent.untap(game);
|
||||
}
|
||||
} else {
|
||||
if (player.chooseUse(Outcome.Tap, "Tap that permanent?", game)) {
|
||||
if (player.chooseUse(Outcome.Tap, "Tap that permanent?", source, game)) {
|
||||
targetPermanent.tap(game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class JelevaNephaliasCastEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.chooseUse(outcome, "Cast an instant or sorcery from exile?", game)) {
|
||||
if (controller.chooseUse(outcome, "Cast an instant or sorcery from exile?", source, game)) {
|
||||
TargetCardInExile target = new TargetCardInExile(new FilterInstantOrSorceryCard(), CardUtil.getCardExileZoneId(game, source));
|
||||
if (controller.choose(Outcome.PlayForFree, game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)), target, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class LimDulsVaultEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
player.lookAtCards("Lim-Dul's Vault", cards, game);
|
||||
doAgain = player.chooseUse(outcome, "Pay 1 lfe and look at the next 5 cards?", game);
|
||||
doAgain = player.chooseUse(outcome, "Pay 1 lfe and look at the next 5 cards?", source, game);
|
||||
if (doAgain) {
|
||||
player.loseLife(1, game);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class PlagueBoilerEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (controller != null && sourcePermanent != null) {
|
||||
if (!sourcePermanent.getCounters().containsKey(CounterType.PLAGUE) || controller.chooseUse(outcome, "Put a plague counter on? (No removes one)", game)) {
|
||||
if (!sourcePermanent.getCounters().containsKey(CounterType.PLAGUE) || controller.chooseUse(outcome, "Put a plague counter on? (No removes one)", source, game)) {
|
||||
return new AddCountersSourceEffect(CounterType.PLAGUE.createInstance(), true).apply(game, source);
|
||||
} else {
|
||||
return new RemoveCounterSourceEffect(CounterType.PLAGUE.createInstance()).apply(game, source);
|
||||
|
|
|
|||
|
|
@ -123,11 +123,11 @@ class MayTapOrUntapAttachedEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (equipedCreature != null && player != null) {
|
||||
if (equipedCreature.isTapped()) {
|
||||
if (player.chooseUse(Outcome.Untap, "Untap equipped creature?", game)) {
|
||||
if (player.chooseUse(Outcome.Untap, "Untap equipped creature?", source, game)) {
|
||||
equipedCreature.untap(game);
|
||||
}
|
||||
} else {
|
||||
if (player.chooseUse(Outcome.Tap, "Tap equipped creature?", game)) {
|
||||
if (player.chooseUse(Outcome.Tap, "Tap equipped creature?", source, game)) {
|
||||
equipedCreature.tap(game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class TemptWithDiscoveryEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getOpponents(controller.getId())) {
|
||||
Player opponent = game.getPlayer(playerId);
|
||||
if (opponent != null) {
|
||||
if (opponent.chooseUse(outcome, "Search your library for a land card and put it onto the battlefield?", game)) {
|
||||
if (opponent.chooseUse(outcome, "Search your library for a land card and put it onto the battlefield?", source, game)) {
|
||||
target.clearChosen();
|
||||
opponentsUsedSearch++;
|
||||
if (opponent.searchLibrary(target, game)) {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class TemptWithGloryEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getOpponents(controller.getId())) {
|
||||
Player opponent = game.getPlayer(playerId);
|
||||
if (opponent != null) {
|
||||
if (opponent.chooseUse(outcome, "Put a +1/+1 counter on each creature you control?", game)) {
|
||||
if (opponent.chooseUse(outcome, "Put a +1/+1 counter on each creature you control?", source, game)) {
|
||||
opponentsAddedCounters++;
|
||||
addCounterToEachCreature(playerId, counter, game);
|
||||
game.informPlayers(opponent.getLogName() + " added a +1/+1 counter on each of its creatures");
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class TemptWithImmortalityEffect extends OneShotEffect {
|
|||
Target targetOpponent = new TargetCardInGraveyard(filter);
|
||||
|
||||
if (targetOpponent.canChoose(source.getSourceId(), opponent.getId(), game)) {
|
||||
if (opponent.chooseUse(outcome, new StringBuilder("Return a creature card from your graveyard to the battlefield?").toString(), game)) {
|
||||
if (opponent.chooseUse(outcome, new StringBuilder("Return a creature card from your graveyard to the battlefield?").toString(), source, game)) {
|
||||
if (opponent.chooseTarget(outcome, targetOpponent, source, game)) {
|
||||
Card card = game.getCard(targetOpponent.getFirstTarget());
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class TemptWithReflectionsEffect extends OneShotEffect {
|
|||
do {
|
||||
if (game.getOpponents(source.getControllerId()).contains(player.getId())) {
|
||||
String decision;
|
||||
if (player.chooseUse(outcome, "Put a copy of target creature onto the battlefield for you?", game)) {
|
||||
if (player.chooseUse(outcome, "Put a copy of target creature onto the battlefield for you?", source, game)) {
|
||||
playersSaidYes.add(player.getId());
|
||||
decision = " chooses to copy ";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class TemptWithVengeanceEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getOpponents(controller.getId())) {
|
||||
Player opponent = game.getPlayer(playerId);
|
||||
if (opponent != null) {
|
||||
if (opponent.chooseUse(outcome, "Put " + xValue + " Elemental Tokens onto the battlefield?", game)) {
|
||||
if (opponent.chooseUse(outcome, "Put " + xValue + " Elemental Tokens onto the battlefield?", source, game)) {
|
||||
opponentsAddedTokens += xValue;
|
||||
tokenCopy.putOntoBattlefield(xValue, game, source.getSourceId(), playerId, false, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class WarCadenceReplacementEffect extends ReplacementEffectImpl {
|
|||
String mana = new StringBuilder("{").append(amount).append("}").toString();
|
||||
ManaCostsImpl cost = new ManaCostsImpl(mana);
|
||||
if ( cost.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Benefit, new StringBuilder("Pay ").append(mana).append(" to declare blocker?").toString(), game) ) {
|
||||
player.chooseUse(Outcome.Benefit, new StringBuilder("Pay ").append(mana).append(" to declare blocker?").toString(), source, game) ) {
|
||||
if (cost.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class AssaultSuitGainControlEffect extends OneShotEffect {
|
|||
if (equipment.getAttachedTo() != null) {
|
||||
Permanent equippedCreature = game.getPermanent(equipment.getAttachedTo());
|
||||
if (equippedCreature != null && controller.chooseUse(outcome,
|
||||
"Let have " + activePlayer.getLogName() + " gain control of " + equippedCreature.getLogName() + "?", game)) {
|
||||
"Let have " + activePlayer.getLogName() + " gain control of " + equippedCreature.getLogName() + "?", source, game)) {
|
||||
equippedCreature.untap(game);
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, activePlayer.getId());
|
||||
effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo()));
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect {
|
|||
//TODO: Make sure the Equipment can legally enchant the token, preferably on targetting.
|
||||
Target target = new TargetControlledPermanent(0, 1, filter, true);
|
||||
if (target.canChoose(source.getSourceId(), controller.getId(), game) &&
|
||||
controller.chooseUse(outcome, "Attach an Equipment you control to the created Token?", game)) {
|
||||
controller.chooseUse(outcome, "Attach an Equipment you control to the created Token?", source, game)) {
|
||||
if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) {
|
||||
Permanent equipmentPermanent = game.getPermanent(target.getFirstTarget());
|
||||
if (equipmentPermanent != null) {
|
||||
|
|
@ -199,7 +199,7 @@ class NahiriTheLithomancerSecondAbilityEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.chooseUse(Outcome.PutCardInPlay, "Put an Equipment from hand? (No = from graveyard)", game)) {
|
||||
if (controller.chooseUse(Outcome.PutCardInPlay, "Put an Equipment from hand? (No = from graveyard)", source, game)) {
|
||||
Target target = new TargetCardInHand(0, 1, filter);
|
||||
controller.choose(outcome, target, source.getSourceId(), game);
|
||||
Card card = controller.getHand().get(target.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class ShaperParasiteEffect extends ContinuousEffectImpl {
|
|||
super.init(source, game);
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
String message = "Should the target creature get -2/+2 instead of +2/-2?";
|
||||
if (player != null && player.chooseUse(Outcome.Neutral, message, game)) {
|
||||
if (player != null && player.chooseUse(Outcome.Neutral, message, source, game)) {
|
||||
this.power *= -1;
|
||||
this.toughness *= -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class WaveOfVitriolEffect extends OneShotEffect {
|
|||
}
|
||||
game.getState().handleSimultaneousEvent(game);
|
||||
for(Map.Entry<Player, Integer> entry: sacrificedLands.entrySet()) {
|
||||
if (entry.getKey().chooseUse(Outcome.PutLandInPlay, "Search your library for up to " + entry.getValue() + " basic lands?", game)) {
|
||||
if (entry.getKey().chooseUse(Outcome.PutLandInPlay, "Search your library for up to " + entry.getValue() + " basic lands?", source, game)) {
|
||||
Target target = new TargetCardInLibrary(0, entry.getValue(), new FilterBasicLandCard());
|
||||
entry.getKey().chooseTarget(outcome, target, source, game);
|
||||
for(UUID targetId: target.getTargets()) {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class MaelstromArchangelCastEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Target target = new TargetCardInHand(filter);
|
||||
if (target.canChoose(source.getSourceId(), controller.getId(), game) &&
|
||||
controller.chooseUse(outcome, "Cast a nonland card from your hand without paying its mana cost?", game)) {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class MasterTransmuterEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Target target = new TargetCardInHand(new FilterArtifactCard("an artifact card from your hand"));
|
||||
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
|
||||
&& controller.chooseUse(outcome, "Put an artifact from your hand to battlefield?", game)
|
||||
&& controller.chooseUse(outcome, "Put an artifact from your hand to battlefield?", source, game)
|
||||
&& controller.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class PathToExileEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
// if the zone change to exile gets replaced does not prevent the target controller to be able to search
|
||||
controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a basic land card?", game)) {
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a basic land card?", source, game)) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
|
||||
if (player.searchLibrary(target, game)) {
|
||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class CoercivePortalEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.chooseUse(Outcome.DestroyPermanent, "Choose carnage?", game)) {
|
||||
if (player.chooseUse(Outcome.DestroyPermanent, "Choose carnage?", source, game)) {
|
||||
carnageCount++;
|
||||
game.informPlayers(player.getLogName() + " has chosen: carnage");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class TyrantsChoiceEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.chooseUse(Outcome.Sacrifice, "Choose death?", game)) {
|
||||
if (player.chooseUse(Outcome.Sacrifice, "Choose death?", source, game)) {
|
||||
deathCount++;
|
||||
game.informPlayers(player.getLogName() + " has chosen: death");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class CallToTheKindredEffect extends OneShotEffect {
|
|||
sb.delete(sb.length() - 2, sb.length());
|
||||
filter.setMessage(sb.toString());
|
||||
|
||||
if (cards.count(filter, game) > 0 && player.chooseUse(Outcome.DrawCard, "Do you wish to put a creature card onto the battlefield?", game)) {
|
||||
if (cards.count(filter, game) > 0 && player.chooseUse(Outcome.DrawCard, "Do you wish to put a creature card onto the battlefield?", source, game)) {
|
||||
TargetCard target = new TargetCard(Zone.PICK, filter);
|
||||
|
||||
if (player.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class CounterlashEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (stackObject != null && player != null) {
|
||||
game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Cast a nonland card in your hand that shares a card type with that spell without paying its mana cost?", game)) {
|
||||
if (player.chooseUse(Outcome.PutCardInPlay, "Cast a nonland card in your hand that shares a card type with that spell without paying its mana cost?", source, game)) {
|
||||
FilterCard filter = new FilterCard();
|
||||
ArrayList<Predicate<MageObject>> types = new ArrayList<Predicate<MageObject>>();
|
||||
for (CardType type: stackObject.getCardType()) {
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class CurseOfEchoesEffect extends OneShotEffect {
|
|||
for (UUID playerId: game.getPlayerList()) {
|
||||
if (!playerId.equals(spell.getControllerId())) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player.chooseUse(Outcome.Copy, chooseMessage, game)) {
|
||||
if (player.chooseUse(Outcome.Copy, chooseMessage, source, game)) {
|
||||
Spell copy = spell.copySpell();
|
||||
copy.setControllerId(playerId);
|
||||
copy.setCopiedSpell(true);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class AEtherVialEffect extends OneShotEffect {
|
|||
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || player.getHand().count(filter, game) == 0
|
||||
|| !player.chooseUse(this.outcome, choiceText, game)) {
|
||||
|| !player.chooseUse(this.outcome, choiceText, source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class PanopticMirrorExileEffect extends OneShotEffect {
|
|||
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || player.getHand().count(filter, game) == 0
|
||||
|| !player.chooseUse(this.outcome, choiceText, game)) {
|
||||
|| !player.chooseUse(this.outcome, choiceText, source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ class PanopticMirrorCastEffect extends OneShotEffect {
|
|||
}
|
||||
if(cardToCopy != null){
|
||||
Card copy = game.copyCard(cardToCopy, source, source.getControllerId());
|
||||
if (controller.chooseUse(outcome, "Cast the copied card without paying mana cost?", game)) {
|
||||
if (controller.chooseUse(outcome, "Cast the copied card without paying mana cost?", source, game)) {
|
||||
return controller.cast(copy.getSpellAbility(), game, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class SerumPowderReplaceEffect extends ReplacementEffectImpl {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
if (controller != null && sourceCard != null) {
|
||||
if (!controller.chooseUse(outcome, "Exile all cards from hand and draw that many cards?", game)) {
|
||||
if (!controller.chooseUse(outcome, "Exile all cards from hand and draw that many cards?", source, game)) {
|
||||
return false;
|
||||
}
|
||||
int cardsHand = controller.getHand().size();
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ class SwordOfLightAndShadowReturnToHandTargetEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
if (!source.getTargets().isEmpty() && targetPointer.getFirst(game, source) != null) {
|
||||
if (controller.chooseUse(outcome, "Return creature card from graveyard to hand?", game)) {
|
||||
if (controller.chooseUse(outcome, "Return creature card from graveyard to hand?", source, game)) {
|
||||
for (UUID targetId : targetPointer.getTargets(game, source)) {
|
||||
switch (game.getState().getZone(targetId)) {
|
||||
case GRAVEYARD:
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class ResearchEffect extends OneShotEffect {
|
|||
StringBuilder textToAsk = new StringBuilder(choiceText);
|
||||
textToAsk.append(" (0)");
|
||||
int count = 0;
|
||||
while (player.chooseUse(Outcome.Benefit, textToAsk.toString(), game)) {
|
||||
while (player.chooseUse(Outcome.Benefit, textToAsk.toString(), source, game)) {
|
||||
Cards cards = player.getSideboard();
|
||||
if(cards.isEmpty()) {
|
||||
game.informPlayer(player, "You have no cards outside the game.");
|
||||
|
|
@ -172,7 +172,7 @@ class DevelopmentEffect extends OneShotEffect {
|
|||
for (UUID opponentUuid : opponents) {
|
||||
Player opponent = game.getPlayer(opponentUuid);
|
||||
if (opponent != null && opponent.chooseUse(Outcome.Detriment,
|
||||
"Allow " + player.getLogName() + " to draw a card instead? (" + Integer.toString(i+1) + ")", game)) {
|
||||
"Allow " + player.getLogName() + " to draw a card instead? (" + Integer.toString(i+1) + ")", source, game)) {
|
||||
game.informPlayers(opponent.getLogName() + " had chosen to let " + player.getLogName() + " draw a card.");
|
||||
player.drawCards(1, game);
|
||||
putToken = false;
|
||||
|
|
|
|||
|
|
@ -99,11 +99,11 @@ class HiddenStringsEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
if (permanent.isTapped()) {
|
||||
if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append("?").toString(), game)) {
|
||||
if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append("?").toString(), source, game)) {
|
||||
permanent.untap(game);
|
||||
}
|
||||
} else {
|
||||
if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append("?").toString(), game)) {
|
||||
if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append("?").toString(), source, game)) {
|
||||
permanent.tap(game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class PossibilityStormEffect extends OneShotEffect {
|
|||
if (card != null && sharesType(card, spell.getCardType()) &&
|
||||
!card.getCardType().contains(CardType.LAND) &&
|
||||
card.getSpellAbility().getTargets().canChoose(spellController.getId(), game)) {
|
||||
if (spellController.chooseUse(Outcome.PlayForFree, "Cast " + card.getLogName() + " without paying cost?", game)) {
|
||||
if (spellController.chooseUse(Outcome.PlayForFree, "Cast " + card.getLogName() + " without paying cost?", source, game)) {
|
||||
spellController.cast(card.getSpellAbility(), game, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class ArashinSovereignEffect extends OneShotEffect {
|
|||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
if (controller != null && sourceCard != null) {
|
||||
if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
|
||||
boolean onTop = controller.chooseUse(outcome, "Put " + sourceCard.getName() + " on top of it's owners library (otherwise on bottom)?", game);
|
||||
boolean onTop = controller.chooseUse(outcome, "Put " + sourceCard.getName() + " on top of it's owners library (otherwise on bottom)?", source, game);
|
||||
controller.moveCardToLibraryWithInfo(sourceCard, source.getSourceId(), game, Zone.GRAVEYARD, onTop, true);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class DeathmistRaptorEffect extends OneShotEffect {
|
|||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
||||
if (controller != null && (sourceObject instanceof Card)) {
|
||||
controller.putOntoBattlefieldWithInfo((Card) sourceObject, game, Zone.GRAVEYARD, source.getSourceId(), false,
|
||||
controller.chooseUse(Outcome.Detriment, "Return " + sourceObject.getLogName() + " face down to battlefield (otherwise face up)?", game));
|
||||
controller.chooseUse(Outcome.Detriment, "Return " + sourceObject.getLogName() + " face down to battlefield (otherwise face up)?", source, game));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class MysticMeditationEffect extends OneShotEffect {
|
|||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
if (controller != null
|
||||
&& controller.getHand().count(filter, game) > 0
|
||||
&& controller.chooseUse(Outcome.Discard, "Do you want to discard a creature card? If you don't, you must discard 2 cards", game)) {
|
||||
&& controller.chooseUse(Outcome.Discard, "Do you want to discard a creature card? If you don't, you must discard 2 cards", source, game)) {
|
||||
Cost cost = new DiscardTargetCost(new TargetCardInHand(filter));
|
||||
if (cost.canPay(source, source.getSourceId(), controller.getId(), game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), controller.getId(), false)) {
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class NarsetTranscendentEffect1 extends OneShotEffect {
|
|||
cards.add(card);
|
||||
controller.lookAtCards(sourceObject.getName(), cards, game);
|
||||
if (!card.getCardType().contains(CardType.CREATURE) && !card.getCardType().contains(CardType.LAND)) {
|
||||
if (controller.chooseUse(outcome, "Reveal " + card.getName() + " and put it into your hand?", game)) {
|
||||
if (controller.chooseUse(outcome, "Reveal " + card.getName() + " and put it into your hand?", source, game)) {
|
||||
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
|
||||
controller.revealCards(sourceObject.getName(), cards, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class QalSismaBehemothEffect extends ReplacementEffectImpl {
|
|||
}
|
||||
ManaCostsImpl attackBlockTax = new ManaCostsImpl("{2}");
|
||||
if (attackBlockTax.canPay(source, source.getSourceId(), event.getPlayerId(), game)
|
||||
&& player.chooseUse(Outcome.Neutral, chooseText, game)) {
|
||||
&& player.chooseUse(Outcome.Neutral, chooseText, source, game)) {
|
||||
if (attackBlockTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class RevealingWindEffect extends OneShotEffect {
|
|||
MageObject sourceObject = source.getSourceObject(game);
|
||||
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?", game)) {
|
||||
controller.chooseUse(outcome, "Look at a face-down attacking creature?", source, game)) {
|
||||
if (!controller.isInGame()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class SilumgarsScornCounterEffect extends OneShotEffect {
|
|||
if (condition) {
|
||||
return game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
if (!(player.chooseUse(Outcome.Benefit, "Would you like to pay {1} to prevent counter effect?", game) &&
|
||||
if (!(player.chooseUse(Outcome.Benefit, "Would you like to pay {1} to prevent counter effect?", source, game) &&
|
||||
new GenericManaCost(1).pay(source, game, spell.getSourceId(), spell.getControllerId(), false))) {
|
||||
return game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class SwiftWarkiteEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.chooseUse(Outcome.PutCardInPlay, "Put a creature card from your hand? (No = from your graveyard)", game)) {
|
||||
if (controller.chooseUse(Outcome.PutCardInPlay, "Put a creature card from your hand? (No = from your graveyard)", source, game)) {
|
||||
Target target = new TargetCardInHand(0, 1, filter);
|
||||
controller.choose(outcome, target, source.getSourceId(), game);
|
||||
Card card = controller.getHand().get(target.getFirstTarget(), 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", 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)) {
|
||||
TargetCard targetAura = new TargetCard(Zone.PICK, filterAuraCard);
|
||||
if (controller.choose(Outcome.Benefit, controller.getHand(), targetAura, game)) {
|
||||
Card aura = game.getCard(targetAura.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class MindwrackLiegeEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, choiceText, game)) {
|
||||
if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class RiseOfTheHobgoblinsEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
ManaCosts<ManaCost> cost = new ManaCostsImpl<>("{X}");
|
||||
if (you != null && you.chooseUse(Outcome.Neutral, "Do you want to to pay {X}?", game)) {
|
||||
if (you != null && you.chooseUse(Outcome.Neutral, "Do you want to to pay {X}?", source, game)) {
|
||||
int costX = you.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
|
||||
cost.add(new GenericManaCost(costX));
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class ErraticPortalEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(targetCreature.getControllerId());
|
||||
if (player != null) {
|
||||
cost.clearPaid();
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay {1}? (Otherwise " + targetCreature.getLogName() +" will be returned to its owner's hand)", game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay {1}? (Otherwise " + targetCreature.getLogName() +" will be returned to its owner's hand)", source, game)) {
|
||||
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), false);
|
||||
}
|
||||
if (!cost.isPaid()) {
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class ExaltedDragonReplacementEffect extends ReplacementEffectImpl {
|
|||
if ( player != null ) {
|
||||
SacrificeTargetCost attackCost = new SacrificeTargetCost(new TargetControlledPermanent(filter));
|
||||
if ( attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Neutral, "Sacrifice a land?", game) )
|
||||
player.chooseUse(Outcome.Neutral, "Sacrifice a land?", source, game) )
|
||||
{
|
||||
if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), false) ) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class TemurSabertoothEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Target target = new TargetPermanent(1,1, filter, true);
|
||||
if (target.canChoose(source.getSourceId(), controller.getId(), game)) {
|
||||
if (controller.chooseUse(outcome, "Return another creature to hand?", game) &&
|
||||
if (controller.chooseUse(outcome, "Return another creature to hand?", source, game) &&
|
||||
controller.chooseTarget(outcome, target, source, game)) {
|
||||
Permanent toHand = game.getPermanent(target.getFirstTarget());
|
||||
if (toHand != null) {
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class WriteIntoBeingEffect extends OneShotEffect {
|
|||
if (controller.getLibrary().size() > 0) {
|
||||
Card cardToPutBack = controller.getLibrary().getFromTop(game);
|
||||
String position = "on top";
|
||||
if (controller.chooseUse(Outcome.Detriment, "Put " + cardToPutBack.getName() + " on bottom of library?", game)) {
|
||||
if (controller.chooseUse(Outcome.Detriment, "Put " + cardToPutBack.getName() + " on bottom of library?", source, game)) {
|
||||
cardToPutBack.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
position = "on bottom";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class DisruptionAuraEffect extends OneShotEffect {
|
|||
|
||||
String message = CardUtil.replaceSourceName("Pay {this} mana cost ?", permanent.getLogName());
|
||||
Cost cost = permanent.getManaCost().copy();
|
||||
if (player.chooseUse(Outcome.Benefit, message, game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, message, source, game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class FoldIntoAEtherEffect extends OneShotEffect {
|
|||
if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) {
|
||||
TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard());
|
||||
if (player != null
|
||||
&& player.chooseUse(Outcome.Neutral, "Put a creature card from your hand in play?", game)
|
||||
&& player.chooseUse(Outcome.Neutral, "Put a creature card from your hand in play?", source, game)
|
||||
&& player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class ReversalOfFortuneEffect extends OneShotEffect {
|
|||
//If you do, you may cast the copy without paying its mana cost
|
||||
if(card != null){
|
||||
Card copiedCard = game.copyCard(card, source, source.getControllerId());
|
||||
if (controller.chooseUse(outcome, "Cast the copied card without paying mana cost?", game)) {
|
||||
if (controller.chooseUse(outcome, "Cast the copied card without paying mana cost?", source, game)) {
|
||||
controller.cast(copiedCard.getSpellAbility(), game, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ public class SylvanLibrary extends CardImpl {
|
|||
super(ownerId, 191, "Sylvan Library", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
|
||||
this.expansionSetCode = "5ED";
|
||||
|
||||
|
||||
// At the beginning of your draw step, you may draw two additional cards. If you do, choose two cards in your hand drawn this turn. For each of those cards, pay 4 life or put the card on top of your library.
|
||||
this.addAbility(new BeginningOfDrawTriggeredAbility(new SylvanLibraryEffect(), TargetController.YOU, true), new CardsDrawnThisTurnWatcher());
|
||||
|
||||
|
|
@ -81,7 +80,7 @@ class SylvanLibraryEffect extends OneShotEffect {
|
|||
|
||||
public SylvanLibraryEffect() {
|
||||
super(Outcome.LoseLife);
|
||||
this.staticText = "draw two additional cards. If you do, choose two cards in your hand drawn this turn. For each of those cards, pay 4 life or put the card on top of your library";
|
||||
this.staticText = "you may draw two additional cards. If you do, choose two cards in your hand drawn this turn. For each of those cards, pay 4 life or put the card on top of your library";
|
||||
}
|
||||
|
||||
public SylvanLibraryEffect(final SylvanLibraryEffect effect) {
|
||||
|
|
@ -111,18 +110,18 @@ class SylvanLibraryEffect extends OneShotEffect {
|
|||
}
|
||||
int numberOfTargets = Math.min(2, cards.size());
|
||||
if (numberOfTargets > 0) {
|
||||
TargetCardInHand target = new TargetCardInHand(numberOfTargets, new FilterCard(new StringBuilder(numberOfTargets).append(" cards of cards drawn this turn").toString()));
|
||||
TargetCardInHand target = new TargetCardInHand(numberOfTargets, new FilterCard(numberOfTargets + " cards of cards drawn this turn"));
|
||||
controller.chooseTarget(outcome, cards, target, source, game);
|
||||
|
||||
Cards cardsPutBack = new CardsImpl();
|
||||
for (UUID cardId :target.getTargets()) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = cards.get(cardId, game);
|
||||
if (card != null) {
|
||||
if (controller.canPayLifeCost()
|
||||
&& controller.getLife() >= 4
|
||||
&& controller.chooseUse(outcome, new StringBuilder("Pay 4 life for ").append(card.getName()).append("? (Otherwise it's put on top of your library)").toString(), game)) {
|
||||
&& controller.chooseUse(outcome, "Pay 4 life for " + card.getLogName() + "? (Otherwise it's put on top of your library)", source, game)) {
|
||||
controller.loseLife(4, game);
|
||||
game.informPlayers(new StringBuilder(controller.getLogName()).append(" pays 4 life to keep a card on hand").toString());
|
||||
game.informPlayers(controller.getLogName() + " pays 4 life to keep a card on hand");
|
||||
} else {
|
||||
cardsPutBack.add(card);
|
||||
}
|
||||
|
|
@ -146,7 +145,7 @@ class SylvanLibraryEffect extends OneShotEffect {
|
|||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
if (numberOfCardsToPutBack > 0) {
|
||||
game.informPlayers(new StringBuilder(controller.getLogName()).append(" puts ").append(numberOfCardsToPutBack).append(" card(s) back to library").toString());
|
||||
game.informPlayers(controller.getLogName() + " puts " + numberOfCardsToPutBack + " card(s) back to library");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -160,7 +159,6 @@ class CardsDrawnThisTurnWatcher extends Watcher {
|
|||
|
||||
private final Set<UUID> cardsDrawnThisTurn = new HashSet<UUID>();
|
||||
|
||||
|
||||
public CardsDrawnThisTurnWatcher() {
|
||||
super("CardsDrawnThisTurnWatcher", WatcherScope.PLAYER);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class ForceOfNatureEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Cost cost = new ManaCostsImpl("{G}{G}{G}{G}");
|
||||
String message = "Would you like to pay {G}{G}{G}{G} to prevent taking 8 damage from {this}?";
|
||||
if (!(controller.chooseUse(Outcome.Benefit, message, game)
|
||||
if (!(controller.chooseUse(Outcome.Benefit, message, source, game)
|
||||
&& cost.pay(source, game, source.getSourceId(), controller.getId(), false))) {
|
||||
controller.damage(8, source.getSourceId(), game, false, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class GlitteringWishEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
while (player.chooseUse(Outcome.Benefit, choiceText, game)) {
|
||||
while (player.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
||||
Cards cards = player.getSideboard();
|
||||
if(cards.isEmpty()) {
|
||||
game.informPlayer(player, "You have no cards outside the game.");
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class DiluvianPrimordialEffect extends OneShotEffect {
|
|||
if (target instanceof TargetCardInOpponentsGraveyard) {
|
||||
Card targetCard = game.getCard(target.getFirstTarget());
|
||||
if (targetCard != null) {
|
||||
if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() +"?", game)) {
|
||||
if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() +"?", source, game)) {
|
||||
// TODO: Handle the case if the cast is not possible, so the replacement effect shouldn't be active
|
||||
ContinuousEffect effect = new DiluvianPrimordialReplacementEffect();
|
||||
effect.setTargetPointer(new FixedTarget(targetCard.getId()));
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class DomriRadeEffect1 extends OneShotEffect {
|
|||
cards.add(card);
|
||||
controller.lookAtCards(sourceObject.getName(), cards, game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (controller.chooseUse(outcome, "Reveal " + card.getName() + " and put it into your hand?", game)) {
|
||||
if (controller.chooseUse(outcome, "Reveal " + card.getName() + " and put it into your hand?", source, game)) {
|
||||
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
|
||||
controller.revealCards(sourceObject.getName(), cards, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class CopyActivatedAbilityEffect extends OneShotEffect {
|
|||
newAbility.newId();
|
||||
game.getStack().push(new StackAbility(newAbility, source.getControllerId()));
|
||||
if (newAbility.getTargets().size() > 0) {
|
||||
if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", game)) {
|
||||
if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) {
|
||||
newAbility.getTargets().clearChosen();
|
||||
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class SpellRuptureCounterUnlessPaysEffect extends OneShotEffect {
|
|||
int amount = new greatestPowerCountCreatureYouControl().calculate(game, source, this);
|
||||
GenericManaCost cost = new GenericManaCost(amount);
|
||||
StringBuilder sb = new StringBuilder("Pay {").append(amount).append("}? (otherwise ").append(spell.getName()).append(" will be countered)");
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), source, game)) {
|
||||
cost.pay(source, game, source.getSourceId(), player.getId(), false);
|
||||
}
|
||||
if (!cost.isPaid()) {
|
||||
|
|
|
|||
|
|
@ -119,12 +119,12 @@ class UnexpectedResultEffect extends OneShotEffect {
|
|||
controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
String message = "Put " + card.getName() + " onto the battlefield?";
|
||||
if (controller.chooseUse(Outcome.PutLandInPlay, message, game)) {
|
||||
if (controller.chooseUse(Outcome.PutLandInPlay, message, source, game)) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
|
||||
return sourceCard.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
}
|
||||
} else {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Cast ").append(card.getName()).append(" without paying its mana cost?").toString(), game)) {
|
||||
if (controller.chooseUse(outcome, new StringBuilder("Cast ").append(card.getName()).append(" without paying its mana cost?").toString(), source, game)) {
|
||||
return controller.cast(card.getSpellAbility(), game, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,8 +145,8 @@ class MysticRemoraTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (controller != null && opponent != null && sourceObject != null) {
|
||||
Cost cost = new GenericManaCost(4);
|
||||
String message = "Would you like to pay {4} to prevent the opponent to draw a card?";
|
||||
if (!(opponent.chooseUse(Outcome.Benefit, message, game) && cost.pay(source, game, source.getSourceId(), opponent.getId(), false))) {
|
||||
if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() +")", game)) {
|
||||
if (!(opponent.chooseUse(Outcome.Benefit, message, source, game) && cost.pay(source, game, source.getSourceId(), opponent.getId(), false))) {
|
||||
if(controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() +")", source, game)) {
|
||||
controller.drawCards(1, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class SibilantSpiritEffect extends OneShotEffect {
|
|||
UUID defenderId = game.getCombat().getDefenderId(source.getSourceId());
|
||||
Player defender = game.getPlayer(defenderId);
|
||||
if (defender != null) {
|
||||
if (defender.chooseUse(outcome, "Draw a card?", game)) {
|
||||
if (defender.chooseUse(outcome, "Draw a card?", source, game)) {
|
||||
defender.drawCards(1, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class ZursWeirdingReplacementEffect extends ReplacementEffectImpl {
|
|||
while (!currentPlayer.getId().equals(player.getId())) {
|
||||
if (currentPlayer.canPayLifeCost() &&
|
||||
currentPlayer.getLife() >= 2 &&
|
||||
currentPlayer.chooseUse(Outcome.Benefit, message, game)) {
|
||||
currentPlayer.chooseUse(Outcome.Benefit, message, source, game)) {
|
||||
currentPlayer.loseLife(2, game);
|
||||
player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
// game.getState().getRevealed().reset();
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class CaravanVigilEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
if (MorbidCondition.getInstance().apply(game, source)
|
||||
&& controller.chooseUse(Outcome.PutLandInPlay, "Do you wish to put the card onto the battlefield instead?", game)) {
|
||||
&& controller.chooseUse(Outcome.PutLandInPlay, "Do you wish to put the card onto the battlefield instead?", source, game)) {
|
||||
controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
|
||||
} else {
|
||||
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class DelverOfSecretsEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
player.lookAtCards(sourcePermanent.getName(), cards, game);
|
||||
if (player.chooseUse(Outcome.DrawCard, "Do you wish to reveal the card at the top of the library?", game)) {
|
||||
if (player.chooseUse(Outcome.DrawCard, "Do you wish to reveal the card at the top of the library?", source, game)) {
|
||||
player.revealCards(sourcePermanent.getName(), cards, game);
|
||||
if (filter.match(card, game)) {
|
||||
return new TransformSourceEffect(true, true).apply(game, source);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class GhostQuarterEffect extends OneShotEffect {
|
|||
Permanent permanent = (Permanent) game.getPermanentOrLKIBattlefield(source.getFirstTarget()); // if indestructible effect should work also
|
||||
if (permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player.chooseUse(Outcome.PutLandInPlay, "Do you wish to search for a basic land, put it onto the battlefield and then shuffle your library?", game)) {
|
||||
if (player.chooseUse(Outcome.PutLandInPlay, "Do you wish to search for a basic land, put it onto the battlefield and then shuffle your library?", source, game)) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
|
||||
if (player.searchLibrary(target, game)) {
|
||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -25,13 +25,14 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.innistrad;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -50,6 +51,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
|
|||
public class MentorOfTheMeek extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledCreaturePermanent("another creature with power 2 or less");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3));
|
||||
|
|
@ -65,8 +67,10 @@ public class MentorOfTheMeek extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
//Whenever another creature with power 2 or less enters the battlefield under your control, you may pay 1. If you do, draw a card.
|
||||
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
|
||||
Zone.BATTLEFIELD, new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{1}")),filter, true));
|
||||
Effect effect = new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{1}"));
|
||||
Ability ability = new EntersBattlefieldControlledTriggeredAbility(
|
||||
Zone.BATTLEFIELD, effect, filter, false);
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class MurderOfCrowsEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null && player.chooseUse(Outcome.DrawCard, "Do you wish to draw a card? If you do, discard a card.", game)) {
|
||||
if (player != null && player.chooseUse(Outcome.DrawCard, "Do you wish to draw a card? If you do, discard a card.", source, game)) {
|
||||
if (player.drawCards(1, game) > 0) {
|
||||
player.discard(1, source, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class RooftopStormCostReductionEffect extends CostModificationEffectImpl {
|
|||
if (sourceCard != null && sourceCard.hasSubtype("Zombie")) {
|
||||
Player player = game.getPlayer(spell.getControllerId());
|
||||
if (player != null &&
|
||||
(CardUtil.isCheckPlayableMode(spell) || player.chooseUse(Outcome.Benefit, "Pay {0} rather than pay the mana cost for Zombie creature", game))) {
|
||||
(CardUtil.isCheckPlayableMode(spell) || player.chooseUse(Outcome.Benefit, "Pay {0} rather than pay the mana cost for Zombie creature", source, game))) {
|
||||
spell.getManaCostsToPay().clear();
|
||||
spell.getManaCostsToPay().addAll(new ManaCostsImpl<>("{0}"));
|
||||
return true;
|
||||
|
|
|
|||
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