forked from External/mage
refactor: improved target usage, replaced setNotTarget by withNotTarget
This commit is contained in:
parent
dbaa51f462
commit
4b3a19b4d5
385 changed files with 434 additions and 429 deletions
|
|
@ -65,7 +65,7 @@ public class CipherEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent();
|
||||
target.setNotTarget(true);
|
||||
target.withNotTarget(true);
|
||||
if (target.canChoose(source.getControllerId(), source, game)
|
||||
&& controller.chooseUse(outcome, "Cipher this spell to a creature?", source, game)) {
|
||||
controller.chooseTarget(outcome, target, source, game);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public class CopyPermanentEffect extends OneShotEffect {
|
|||
copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
} else {
|
||||
Target target = new TargetPermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
target.withNotTarget(true);
|
||||
if (target.canChoose(controller.getId(), source, game)) {
|
||||
controller.choose(Outcome.Copy, target, source, game);
|
||||
copyFromPermanent = game.getPermanent(target.getFirstTarget());
|
||||
|
|
@ -156,7 +156,7 @@ public class CopyPermanentEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
// select new target
|
||||
auraTarget.setNotTarget(true);
|
||||
auraTarget.withNotTarget(true);
|
||||
if (!controller.choose(auraOutcome, auraTarget, source, game)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class DrawDiscardOneOfThemEffect extends OneShotEffect {
|
|||
drawnCards.removeAll(initialHand);
|
||||
if (!drawnCards.isEmpty()) {
|
||||
TargetCard cardToDiscard = new TargetCard(Zone.HAND, new FilterCard("card to discard"));
|
||||
cardToDiscard.setNotTarget(true);
|
||||
cardToDiscard.withNotTarget(true);
|
||||
if (controller.choose(Outcome.Discard, drawnCards, cardToDiscard, source, game)) {
|
||||
Card card = controller.getHand().get(cardToDiscard.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class EntersBattlefieldUnderControlOfOpponentOfChoiceEffect extends OneSh
|
|||
return false;
|
||||
}
|
||||
Target target = new TargetOpponent();
|
||||
target.setNotTarget(true);
|
||||
target.withNotTarget(true);
|
||||
if (!controller.choose(Outcome.Benefit, target, source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class ExileCardFromOwnGraveyardControllerEffect extends OneShotEffect {
|
|||
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(
|
||||
amount, player.getGraveyard().size()
|
||||
), StaticFilters.FILTER_CARD);
|
||||
target.setNotTarget(true);
|
||||
target.withNotTarget(true);
|
||||
if (!player.chooseTarget(outcome, target, source, game)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class MeldEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
TargetPermanent target = new TargetPermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
target.withNotTarget(true);
|
||||
controller.choose(outcome, target, source, game);
|
||||
|
||||
Permanent meldWithPermanent = game.getPermanent(target.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class PopulateEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
Target target = new TargetPermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
target.withNotTarget(true);
|
||||
if (!target.canChoose(source.getControllerId(), source, game)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ public class WishEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.ALL, filter);
|
||||
target.setNotTarget(true);
|
||||
target.withNotTarget(true);
|
||||
if (controller.choose(Outcome.Benefit, filteredCards, target, source, game)) {
|
||||
Card card = controller.getSideboard().get(target.getFirstTarget(), game);
|
||||
if (card == null && alsoFromExile) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect {
|
|||
if (player.getHand().size() > numberToReveal) {
|
||||
TargetCard chosenCards = new TargetCard(numberToReveal, numberToReveal,
|
||||
Zone.HAND, new FilterCard("card in " + player.getName() + "'s hand"));
|
||||
chosenCards.setNotTarget(true);
|
||||
chosenCards.withNotTarget(true);
|
||||
if (chosenCards.canChoose(player.getId(), source, game)
|
||||
&& player.chooseTarget(Outcome.Discard, player.getHand(), chosenCards, source, game)) {
|
||||
if (!chosenCards.getTargets().isEmpty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue