mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
Remove unnecessary set of required status with setRequired method
This commit is contained in:
parent
0a0983d7e9
commit
f9fc2246e8
370 changed files with 0 additions and 415 deletions
|
|
@ -78,7 +78,6 @@ public class DiscardXTargetCost extends VariableCostImpl {
|
|||
@Override
|
||||
public Cost getFixedCostsFromAnnouncedValue(int xValue) {
|
||||
TargetCardInHand target = new TargetCardInHand(xValue, filter);
|
||||
target.setRequired(true);
|
||||
return new DiscardTargetCost(target);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ public class ExileXFromYourGraveCost extends VariableCostImpl {
|
|||
@Override
|
||||
public Cost getFixedCostsFromAnnouncedValue(int xValue) {
|
||||
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(xValue, filter);
|
||||
target.setRequired(true);
|
||||
return new ExileFromGraveCost(target);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ public class SacrificeXTargetCost extends VariableCostImpl {
|
|||
@Override
|
||||
public Cost getFixedCostsFromAnnouncedValue(int xValue) {
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(xValue, xValue, filter, true);
|
||||
target.setRequired(true);
|
||||
return new SacrificeTargetCost(target);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -553,7 +553,6 @@ public class ContinuousEffects implements Serializable {
|
|||
}
|
||||
filter.add(Predicates.or(idPredicates));
|
||||
TargetCardInHand target = new TargetCardInHand(filter);
|
||||
target.setRequired(true);
|
||||
controller.chooseTarget(Outcome.Benefit, target, abilityToModify, game);
|
||||
UUID cardId = target.getFirstTarget();
|
||||
if (cardId != null) {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ public class CopyPermanentEffect extends OneShotEffect {
|
|||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && sourcePermanent != null) {
|
||||
Target target = new TargetPermanent(filter);
|
||||
target.setRequired(true);
|
||||
if (target.canChoose(source.getControllerId(), game)) {
|
||||
player.choose(Outcome.Copy, target, source.getSourceId(), game);
|
||||
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ public class ExileCardFromOwnGraveyardControllerEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if(player != null){
|
||||
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(amount, player.getGraveyard().size()), new FilterCard());
|
||||
target.setRequired(true);
|
||||
if (player.chooseTarget(outcome, target, source, game)) {
|
||||
for (UUID targetId: target.getTargets()) {
|
||||
Card card = player.getGraveyard().get(targetId, game);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ public class ExileCardYouChooseTargetOpponentEffect extends OneShotEffect {
|
|||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you != null) {
|
||||
TargetCard target = new TargetCard(Zone.PICK, filter);
|
||||
target.setRequired(true);
|
||||
if (you.choose(Outcome.Benefit, player.getHand(), target, game)) {
|
||||
Card card = player.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -164,7 +164,6 @@ public class LookLibraryControllerEffect extends OneShotEffect {
|
|||
switch(targetZoneLookedCards) {
|
||||
case LIBRARY:
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard(this.getPutBackText()));
|
||||
target.setRequired(true);
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@ public class PopulateEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
Target target = new TargetPermanent(filter);
|
||||
target.setRequired(true);
|
||||
if (target.canChoose(source.getControllerId(), game)) {
|
||||
player.choose(Outcome.Copy, target, source.getSourceId(), game);
|
||||
Permanent tokenToCopy = game.getPermanent(target.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ public class ReturnToHandChosenControlledPermanentEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(number, number, filter, true);
|
||||
target.setRequired(true);
|
||||
if (player.choose(this.outcome, target, source.getSourceId(), game)) {
|
||||
for (UUID targetCreatureId : (List<UUID>)target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetCreatureId);
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ public class RevealLibraryPutIntoHandEffect extends OneShotEffect {
|
|||
Card card;
|
||||
if (anyOrder) {
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
target.setRequired(true);
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
card = cards.get(target.getFirstTarget(), game);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@ public class SacrificeEffect extends OneShotEffect{
|
|||
amount = Math.min(amount, realCount);
|
||||
|
||||
Target target = new TargetControlledPermanent(amount, amount, filter, true);
|
||||
target.setRequired(true);
|
||||
|
||||
//A spell or ability could have removed the only legal target this player
|
||||
//had, if thats the case this ability should fizzle.
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ public class ScryEffect extends OneShotEffect {
|
|||
// move cards to the top of the library
|
||||
if (cards.size() > 1) {
|
||||
TargetCard target2 = new TargetCard(Zone.LIBRARY, filter2);
|
||||
target2.setRequired(true);
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
player.choose(Outcome.Benefit, cards, target2, game);
|
||||
Card card = cards.get(target2.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ public class SweepEffect extends OneShotEffect {
|
|||
FilterPermanent filter = new FilterControlledLandPermanent(new StringBuilder("any number of ").append(sweepSubtype).append("s you control").toString());
|
||||
filter.add(new SubtypePredicate(sweepSubtype));
|
||||
Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
|
||||
target.setRequired(true);
|
||||
if (controller.chooseTarget(outcome, target, source, game)) {
|
||||
game.getState().setValue(CardUtil.getCardZoneString("sweep", source.getSourceId(), game), target.getTargets().size());
|
||||
for (UUID uuid : target.getTargets()) {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,6 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect {
|
|||
numberToReveal = Math.min(player.getHand().size(), numberToReveal);
|
||||
if (player.getHand().size() > numberToReveal) {
|
||||
TargetCardInHand chosenCards = new TargetCardInHand(numberToReveal, numberToReveal, new FilterCard("card in target player's hand"));
|
||||
chosenCards.setRequired(true);
|
||||
chosenCards.setNotTarget(true);
|
||||
if (chosenCards.canChoose(player.getId(), game) && player.choose(Outcome.Discard, player.getHand(), chosenCards, game)) {
|
||||
if (!chosenCards.getTargets().isEmpty()) {
|
||||
|
|
@ -159,7 +158,6 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect {
|
|||
int numberToDiscard = Math.min(this.numberCardsToDiscard.calculate(game, source), filteredCardsCount);
|
||||
if (numberToDiscard > 0) {
|
||||
TargetCard target = new TargetCard(numberToDiscard, Zone.HAND, filter);
|
||||
target.setRequired(true);
|
||||
if (controller.choose(Outcome.Benefit, revealedCards, target, game)) {
|
||||
for (Object targetId : target.getTargets()) {
|
||||
Card card = revealedCards.get((UUID) targetId, game);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ public class DiscardEachPlayerEffect extends OneShotEffect {
|
|||
}
|
||||
} else {
|
||||
Target target = new TargetDiscard(numberOfCardsToDiscard, numberOfCardsToDiscard, new FilterCard(), playerId);
|
||||
target.setRequired(true);
|
||||
player.chooseTarget(outcome, target, source, game);
|
||||
cards.addAll(target.getTargets());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,9 +194,6 @@ class FlashbackEffect extends OneShotEffect {
|
|||
}
|
||||
spellAbility.getManaCostsToPay().setX(amount);
|
||||
}
|
||||
for (Target target : spellAbility.getTargets()) {
|
||||
target.setRequired(true);
|
||||
}
|
||||
game.informPlayers(new StringBuilder(controller.getName()).append(" flashbacks ").append(card.getName()).toString());
|
||||
spellAbility.setCostModificationActive(false); // prevents to apply cost modification twice for flashbacked spells
|
||||
return controller.cast(spellAbility, game, true);
|
||||
|
|
|
|||
|
|
@ -140,7 +140,6 @@ class HideawayExileEffect extends OneShotEffect {
|
|||
|
||||
if (cards.size() > 0) {
|
||||
TargetCard target2 = new TargetCard(Zone.PICK, filter2);
|
||||
target2.setRequired(true);
|
||||
while (player.isInGame() && cards.size() > 1) {
|
||||
player.choose(Outcome.Benefit, cards, target2, game);
|
||||
Card card = cards.get(target2.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ public class ModularAbility extends DiesTriggeredAbility {
|
|||
public ModularAbility(Card card, int amount, boolean sunburst) {
|
||||
super(new ModularDistributeCounterEffect(), true);
|
||||
Target target = new TargetArtifactPermanent(filter);
|
||||
target.setRequired(true);
|
||||
this.addTarget(target);
|
||||
this.amount = amount;
|
||||
this.sunburst = sunburst;
|
||||
|
|
|
|||
|
|
@ -95,9 +95,6 @@ class RetraceEffect extends OneShotEffect {
|
|||
card.getSpellAbility().clear();
|
||||
int amount = source.getManaCostsToPay().getX();
|
||||
card.getSpellAbility().getManaCostsToPay().setX(amount);
|
||||
for (Target target : card.getSpellAbility().getTargets()) {
|
||||
target.setRequired(true);
|
||||
}
|
||||
return controller.cast(card.getSpellAbility(), game, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -714,7 +714,6 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
|
||||
//20091005 - 103.2
|
||||
TargetPlayer targetPlayer = new TargetPlayer();
|
||||
targetPlayer.setRequired(true);
|
||||
targetPlayer.setTargetName("starting player");
|
||||
Player choosingPlayer = null;
|
||||
if (choosingPlayerId != null) {
|
||||
|
|
@ -1521,7 +1520,6 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
if (controller != null) {
|
||||
Target targetPlaneswalkerToKeep = new TargetPermanent(filterPlaneswalker);
|
||||
targetPlaneswalkerToKeep.setTargetName(new StringBuilder(planeswalker.getName()).append(" to keep?").toString());
|
||||
targetPlaneswalkerToKeep.setRequired(true);
|
||||
controller.chooseTarget(Outcome.Benefit, targetPlaneswalkerToKeep, null, this);
|
||||
for (Permanent dupPlaneswalker: this.getBattlefield().getActivePermanents(filterPlaneswalker, planeswalker.getControllerId(), this)) {
|
||||
if (!targetPlaneswalkerToKeep.getTargets().contains(dupPlaneswalker.getId())) {
|
||||
|
|
@ -1550,7 +1548,6 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
if (controller != null) {
|
||||
Target targetLegendaryToKeep = new TargetPermanent(filterLegendName);
|
||||
targetLegendaryToKeep.setTargetName(new StringBuilder(legend.getName()).append(" to keep (Legendary Rule)?").toString());
|
||||
targetLegendaryToKeep.setRequired(true);
|
||||
controller.chooseTarget(Outcome.Benefit, targetLegendaryToKeep, null, this);
|
||||
for (Permanent dupLegend: getBattlefield().getActivePermanents(filterLegendName, legend.getControllerId(), this)) {
|
||||
if (!targetLegendaryToKeep.getTargets().contains(dupLegend.getId())) {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ public abstract class TargetAmount extends TargetImpl {
|
|||
this.amount = amount;
|
||||
//this.remainingAmount = amount;
|
||||
amountWasSet = false;
|
||||
this.required = true;
|
||||
}
|
||||
|
||||
public TargetAmount(final TargetAmount target) {
|
||||
|
|
|
|||
|
|
@ -44,9 +44,6 @@ public class TargetCreatureOrPlaneswalker extends TargetPermanent {
|
|||
public TargetCreatureOrPlaneswalker(int minNumTargets, int maxNumTargets, FilterCreatureOrPlaneswalkerPermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
if (minNumTargets > 0) {
|
||||
this.setRequired(true);
|
||||
}
|
||||
}
|
||||
|
||||
public TargetCreatureOrPlaneswalker(final TargetCreatureOrPlaneswalker target) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ public class TargetDiscard extends TargetCard {
|
|||
super(minNumTargets, maxNumTargets, Zone.HAND, filter);
|
||||
this.filter.add(new OwnerIdPredicate(playerId));
|
||||
this.playerId = playerId;
|
||||
this.required = true;
|
||||
this.targetName = "card to discard";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ public class TargetNonBasicLandPermanent extends TargetLandPermanent {
|
|||
filter.add(Predicates.not(new NamePredicate("Swamp")));
|
||||
filter.add(Predicates.not(new NamePredicate("Plains")));
|
||||
this.targetName = "nonbasic land";
|
||||
this.setRequired(true);
|
||||
}
|
||||
|
||||
public TargetNonBasicLandPermanent(final TargetNonBasicLandPermanent target) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue