mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 19:59:54 -08:00
Merge origin/master
This commit is contained in:
commit
91004d12b0
478 changed files with 9842 additions and 4352 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) {
|
||||
|
|
|
|||
|
|
@ -28,19 +28,14 @@
|
|||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.LookLibraryControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
|
|
@ -49,6 +44,11 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -66,12 +66,10 @@ public class CallousDeceiver extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
// {1}: Look at the top card of your library.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1)));
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1)));
|
||||
|
||||
// {2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn.
|
||||
Ability ability = new CallousDeceiverAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0,Duration.EndOfTurn), new ManaCostsImpl("{2}"));
|
||||
ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(),Duration.EndOfTurn));
|
||||
this.addAbility(ability);
|
||||
// {2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn.
|
||||
this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new CallousDeceiverEffect(), new ManaCostsImpl("{2}")));
|
||||
}
|
||||
|
||||
public CallousDeceiver(final CallousDeceiver card) {
|
||||
|
|
@ -85,38 +83,39 @@ public class CallousDeceiver extends CardImpl {
|
|||
|
||||
}
|
||||
|
||||
class CallousDeceiverAbility extends LimitedTimesPerTurnActivatedAbility {
|
||||
class CallousDeceiverEffect extends OneShotEffect {
|
||||
|
||||
public CallousDeceiverAbility(Zone zone, Effect effect, Cost cost) {
|
||||
super(zone, effect, cost);
|
||||
public CallousDeceiverEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn";
|
||||
}
|
||||
|
||||
public CallousDeceiverAbility(CallousDeceiverAbility ability) {
|
||||
super(ability);
|
||||
public CallousDeceiverEffect(final CallousDeceiverEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CallousDeceiverAbility copy() {
|
||||
return new CallousDeceiverAbility(this);
|
||||
}
|
||||
@Override
|
||||
public CallousDeceiverEffect copy() {
|
||||
return new CallousDeceiverEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkIfClause(Game game) {
|
||||
Player player = game.getPlayer(this.getControllerId());
|
||||
if (player != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
cards.add(card);
|
||||
player.revealCards("Callous Deceiver", cards, game);
|
||||
if (card != null && card.getCardType().contains(CardType.LAND)) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source);
|
||||
game.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), source);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -56,9 +55,9 @@ public class GiftsUngiven extends CardImpl {
|
|||
super(ownerId, 62, "Gifts Ungiven", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{U}");
|
||||
this.expansionSetCode = "CHK";
|
||||
|
||||
|
||||
// Search your library for up to four cards with different names and reveal them. Target opponent chooses two of those cards. Put the chosen cards into your graveyard and the rest into your hand. Then shuffle your library.
|
||||
this.getSpellAbility().addEffect(new GiftsUngivenEffect());
|
||||
this.getSpellAbility().addTarget(new TargetOpponent());
|
||||
}
|
||||
|
||||
public GiftsUngiven(final GiftsUngiven card) {
|
||||
|
|
@ -94,7 +93,10 @@ class GiftsUngivenEffect extends OneShotEffect {
|
|||
if (player == null || sourceCard == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (opponent == null) {
|
||||
return false;
|
||||
}
|
||||
GiftsUngivenTarget target = new GiftsUngivenTarget();
|
||||
if (player.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
|
|
@ -105,34 +107,20 @@ class GiftsUngivenEffect extends OneShotEffect {
|
|||
cards.add(card);
|
||||
}
|
||||
}
|
||||
player.revealCards(sourceCard.getName(), cards, game);
|
||||
player.revealCards(sourceCard.getIdName(), cards, game);
|
||||
|
||||
CardsImpl cardsToKeep = new CardsImpl();
|
||||
if (cards.size() > 2) {
|
||||
cardsToKeep.addAll(cards);
|
||||
|
||||
Player opponent;
|
||||
if (game.getOpponents(player.getId()).size() > 1) {
|
||||
TargetOpponent targetOpponent = new TargetOpponent();
|
||||
player.chooseTarget(outcome, targetOpponent, source, game);
|
||||
opponent = game.getPlayer(target.getFirstTarget());
|
||||
} else {
|
||||
opponent = game.getPlayer(game.getOpponents(player.getId()).iterator().next());
|
||||
}
|
||||
TargetCard targetDiscard = new TargetCard(2, Zone.LIBRARY, new FilterCard("cards to put in graveyard"));
|
||||
if (opponent != null && opponent.choose(Outcome.Discard, cards, targetDiscard, game)) {
|
||||
if (opponent.choose(Outcome.Discard, cards, targetDiscard, game)) {
|
||||
cardsToKeep.removeAll(targetDiscard.getTargets());
|
||||
cards.removeAll(cardsToKeep);
|
||||
}
|
||||
}
|
||||
|
||||
player.moveCards(cards, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
for (UUID cardId : cardsToKeep) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
|
||||
}
|
||||
}
|
||||
player.moveCards(cardsToKeep, Zone.LIBRARY, Zone.HAND, source, game);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -58,12 +58,12 @@ public class SpitefulShadows extends CardImpl {
|
|||
this.expansionSetCode = "DKA";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature));
|
||||
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
|
||||
|
||||
// Whenever enchanted creature is dealt damage, it deals that much damage to its controller.
|
||||
this.addAbility(new SpitefulShadowsTriggeredAbility());
|
||||
}
|
||||
|
|
@ -135,16 +135,16 @@ class SpitefulShadowsEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Integer damageAmount = (Integer) this.getValue("damageAmount");
|
||||
UUID targetId = this.targetPointer.getFirst(game, source);
|
||||
if (damageAmount != null && targetId != null) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (damageAmount != null) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (permanent == null) {
|
||||
permanent = (Permanent) game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
|
||||
FixedTarget fixedTarget = (FixedTarget) getTargetPointer();
|
||||
permanent = (Permanent) game.getLastKnownInformation(fixedTarget.getTarget(), Zone.BATTLEFIELD, fixedTarget.getZoneChangeCounter());
|
||||
}
|
||||
if (permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
player.damage(damageAmount, targetId, game, false, true);
|
||||
player.damage(damageAmount, permanent.getId(), game, false, true);
|
||||
return 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class Necroskitter extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Wither
|
||||
// Wither (This deals damage to creatures in the form of -1/-1 counters.)
|
||||
this.addAbility(WitherAbility.getInstance());
|
||||
|
||||
// Whenever a creature an opponent controls with a -1/-1 counter on it dies, you may return that card to the battlefield under your control.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
65
Mage.Sets/src/mage/sets/fifthedition/FerozsBan.java
Normal file
65
Mage.Sets/src/mage/sets/fifthedition/FerozsBan.java
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.fifthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
|
||||
*/
|
||||
public class FerozsBan extends CardImpl {
|
||||
|
||||
public FerozsBan(UUID ownerId) {
|
||||
super(ownerId, 370, "Feroz's Ban", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}");
|
||||
this.expansionSetCode = "5ED";
|
||||
|
||||
// Creature spells cost {2} more to cast.
|
||||
Effect effect = new SpellsCostIncreasementAllEffect(new FilterCreatureCard(), 2);
|
||||
effect.setText("Creature spells cost {2} more to cast.");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
}
|
||||
|
||||
public FerozsBan(final FerozsBan card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FerozsBan copy() {
|
||||
return new FerozsBan(this);
|
||||
}
|
||||
}
|
||||
55
Mage.Sets/src/mage/sets/fifthedition/ShieldWall.java
Normal file
55
Mage.Sets/src/mage/sets/fifthedition/ShieldWall.java
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.fifthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
|
||||
*/
|
||||
public class ShieldWall extends mage.sets.legends.ShieldWall {
|
||||
|
||||
public ShieldWall(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 339;
|
||||
this.expansionSetCode = "5ED";
|
||||
this.rarity = Rarity.COMMON;
|
||||
}
|
||||
|
||||
public ShieldWall(final ShieldWall card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShieldWall copy() {
|
||||
return new ShieldWall(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
74
Mage.Sets/src/mage/sets/fourthedition/Immolation.java
Normal file
74
Mage.Sets/src/mage/sets/fourthedition/Immolation.java
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.fourthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ilcartographer
|
||||
*/
|
||||
public class Immolation extends CardImpl {
|
||||
|
||||
public Immolation(UUID ownerId) {
|
||||
super(ownerId, 222, "Immolation", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{R}");
|
||||
this.expansionSetCode = "4ED";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Enchanted creature gets +2/-2.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, -2)));
|
||||
}
|
||||
|
||||
public Immolation(final Immolation card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Immolation copy() {
|
||||
return new Immolation(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -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.");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.sets.gameday;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
|
|
@ -60,9 +59,9 @@ public class ScaleguardSentinels extends CardImpl {
|
|||
static {
|
||||
filter.add(new SubtypePredicate("Dragon"));
|
||||
}
|
||||
|
||||
|
||||
public ScaleguardSentinels(UUID ownerId) {
|
||||
super(ownerId, 43, "Scaleguard Sentinels", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{G}");
|
||||
super(ownerId, 44, "Scaleguard Sentinels", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{G}");
|
||||
this.expansionSetCode = "MGDC";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Soldier");
|
||||
|
|
@ -71,27 +70,27 @@ public class ScaleguardSentinels extends CardImpl {
|
|||
|
||||
// As an additional cost to cast Scaleguard Sentinels, you may reveal a Dragon card from your hand.
|
||||
this.getSpellAbility().addEffect(new InfoEffect("As an additional cost to cast {this}, you may reveal a Dragon card from your hand"));
|
||||
|
||||
|
||||
// Scaleguard Sentinels enters the battlefield with a +1/+1 counter on it if you revealed a Dragon card or controlled a Dragon as you cast Scaleguard Sentinels.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), true),
|
||||
ScaleguardSentinelsCondition.getInstance(), true,
|
||||
"{this} enters the battlefield with a +1/+1 counter on it if you revealed a Dragon card or controlled a Dragon as you cast {this}", ""),
|
||||
new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
if (ability.getAbilityType().equals(AbilityType.SPELL)) {
|
||||
Player controller = game.getPlayer(ability.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.getHand().count(filter, game) > 0) {
|
||||
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0,1, filter)));
|
||||
ability.addCost(new RevealTargetFromHandCost(new TargetCardInHand(0, 1, filter)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ScaleguardSentinels(final ScaleguardSentinels card) {
|
||||
super(card);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public class ThunderbreakRegent extends CardImpl {
|
||||
|
||||
public ThunderbreakRegent(UUID ownerId) {
|
||||
super(ownerId, 44, "Thunderbreak Regent", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
|
||||
super(ownerId, 43, "Thunderbreak Regent", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
|
||||
this.expansionSetCode = "MGDC";
|
||||
this.subtype.add("Dragon");
|
||||
this.power = new MageInt(4);
|
||||
|
|
@ -106,7 +106,7 @@ class ThunderbreakRegentTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
|
||||
Permanent creature = game.getPermanent(event.getTargetId());
|
||||
if (creature != null && filter.match(creature, getSourceId(), getControllerId(), game)) {
|
||||
for (Effect effect: this.getEffects()) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import mage.abilities.common.EntersBattlefieldAbility;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.CountersCount;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsTargetOpponentControlsCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
|
||||
|
|
@ -45,7 +46,6 @@ import mage.cards.CardImpl;
|
|||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
|
@ -68,7 +68,7 @@ public class GideonChampionOfJustice extends CardImpl {
|
|||
|
||||
// +1: Put a loyalty counter on Gideon, Champion of Justice for each creature target opponent controls.
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(
|
||||
new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(0), new PermanentsTargetOpponentControlsCount(), true), 1);
|
||||
new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(0), new PermanentsTargetOpponentControlsCount(new FilterCreaturePermanent()), true), 1);
|
||||
ability1.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability1);
|
||||
|
||||
|
|
@ -92,39 +92,6 @@ public class GideonChampionOfJustice extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class PermanentsTargetOpponentControlsCount implements DynamicValue {
|
||||
|
||||
public PermanentsTargetOpponentControlsCount() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
if (sourceAbility.getFirstTarget() != null) {
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
filter.add(new ControllerIdPredicate(sourceAbility.getFirstTarget()));
|
||||
int value = game.getBattlefield().count(filter, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game);
|
||||
return value;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return new PermanentsTargetOpponentControlsCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "creature target opponent controls";
|
||||
}
|
||||
}
|
||||
|
||||
class GideonExileAllOtherPermanentsEffect extends OneShotEffect {
|
||||
|
||||
public GideonExileAllOtherPermanentsEffect() {
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
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