mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
another batch of text gen improvements (#11247)
* describe targets: UntapTargetEffect * describe targets: SetBasePowerToughnessTargetEffect * cleanup text * describe targets: RegenerateTargetEffect * describe targets: PhaseOutTargetEffect * adjust text * remove superfluous param * describe targets: TapAllTargetPlayerControlsEffect * describe targets: TurnFaceUpTargetEffect * describe targets: TransformTargetEffect * describe targets: RemoveFromCombatTargetEffect * describe targets: DetainTargetEffect * cleanup DiscardHandTargetEffect * describe targets: DrawCardTargetEffect * describe targets: GainLifeTargetEffect * describe targets: LoseLifeTargetEffect * describe targets: ExchangeLifeTargetEffect * describe targets: DamageTargetControllerEffect
This commit is contained in:
parent
4273d3b5ba
commit
d9ca387fad
30 changed files with 95 additions and 319 deletions
|
|
@ -1,17 +1,14 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.common.CardsInHandCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardHandTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -26,10 +23,10 @@ public final class BrinkOfMadness extends CardImpl {
|
|||
|
||||
// At the beginning of your upkeep, if you have no cards in hand, sacrifice Brink of Madness and target opponent discards their hand.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), TargetController.YOU, false);
|
||||
ability.addEffect(new BrinkOfMadnessEffect());
|
||||
ability.addEffect(new DiscardHandTargetEffect());
|
||||
ability.addTarget(new TargetOpponent());
|
||||
CardsInHandCondition contition = new CardsInHandCondition(ComparisonType.EQUAL_TO, 0);
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, contition, "At the beginning of your upkeep, if you have no cards in hand, sacrifice {this} and target opponent discards their hand."));
|
||||
CardsInHandCondition condition = new CardsInHandCondition(ComparisonType.EQUAL_TO, 0);
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, condition, "At the beginning of your upkeep, if you have no cards in hand, sacrifice {this} and target opponent discards their hand."));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -42,26 +39,4 @@ public final class BrinkOfMadness extends CardImpl {
|
|||
return new BrinkOfMadness(this);
|
||||
}
|
||||
|
||||
static class BrinkOfMadnessEffect extends OneShotEffect {
|
||||
|
||||
private BrinkOfMadnessEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Target player discards their hand";
|
||||
}
|
||||
|
||||
private BrinkOfMadnessEffect(final BrinkOfMadnessEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrinkOfMadnessEffect copy() {
|
||||
return new BrinkOfMadnessEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
return player != null && !player.discard(player.getHand(), false, source, game).isEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ import mage.abilities.keyword.ConvokeAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -15,6 +17,11 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class CleverConcealment extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent("nonland permanents you control");
|
||||
static {
|
||||
filter.add(Predicates.not(CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public CleverConcealment(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}{W}");
|
||||
|
||||
|
|
@ -22,8 +29,8 @@ public final class CleverConcealment extends CardImpl {
|
|||
this.addAbility(new ConvokeAbility());
|
||||
|
||||
// Any number of target nonland permanents you control phase out.
|
||||
this.getSpellAbility().addEffect(new PhaseOutTargetEffect("any number of target nonland permanents you control"));
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_CONTROLLED_PERMANENT_NON_LAND));
|
||||
this.getSpellAbility().addEffect(new PhaseOutTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(0, Integer.MAX_VALUE, filter));
|
||||
}
|
||||
|
||||
private CleverConcealment(final CleverConcealment card) {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public final class CurseOfObsession extends CardImpl {
|
|||
|
||||
// At the beginning of enchanted player's end step, that player discards their hand.
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
new DiscardHandTargetEffect("that player"),
|
||||
new DiscardHandTargetEffect(),
|
||||
TargetController.ENCHANTED, false
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import mage.abilities.keyword.VigilanceAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -20,6 +20,8 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
|||
*/
|
||||
public final class GuardianOfFaith extends CardImpl {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other target creatures you control");
|
||||
|
||||
public GuardianOfFaith(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}");
|
||||
|
||||
|
|
@ -35,10 +37,8 @@ public final class GuardianOfFaith extends CardImpl {
|
|||
this.addAbility(VigilanceAbility.getInstance());
|
||||
|
||||
// When Guardian of Faith enters the battlefield, any number of other target creatures you control phase out.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new PhaseOutTargetEffect(
|
||||
"any number of other target creatures you control"
|
||||
));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_OTHER_CONTROLLED_CREATURES, false));
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new PhaseOutTargetEffect());
|
||||
ability.addTarget(new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, filter, false));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public final class HuntersFeast extends CardImpl {
|
|||
|
||||
// Any number of target players each gain 6 life.
|
||||
this.getSpellAbility().addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false));
|
||||
this.getSpellAbility().addEffect(new GainLifeTargetEffect(6));
|
||||
this.getSpellAbility().addEffect(new GainLifeTargetEffect(6).setText("any number of target players each gain 6 life"));
|
||||
}
|
||||
|
||||
private HuntersFeast(final HuntersFeast card) {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public final class KingOfTheOathbreakers extends CardImpl {
|
|||
|
||||
// Whenever King of the Oathbreakers or another Spirit you control becomes the target of a spell, it phases out.
|
||||
this.addAbility(new BecomesTargetAnyTriggeredAbility(
|
||||
new PhaseOutTargetEffect("it"),
|
||||
new PhaseOutTargetEffect(),
|
||||
filter, StaticFilters.FILTER_SPELL_A
|
||||
));
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public final class NicolBolas extends CardImpl {
|
|||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl<>("{U}{B}{R}")), TargetController.YOU, false));
|
||||
|
||||
// Whenever Nicol Bolas deals damage to an opponent, that player discards their hand.
|
||||
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardHandTargetEffect("that player"), false, false, true));
|
||||
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardHandTargetEffect(), false, false, true));
|
||||
}
|
||||
|
||||
private NicolBolas(final NicolBolas card) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.n;
|
||||
|
||||
import mage.MageInt;
|
||||
|
|
@ -32,7 +31,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class NissaWorldwaker extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filterForest = new FilterPermanent(SubType.FOREST, "Forest");
|
||||
private static final FilterPermanent filterForest = new FilterPermanent(SubType.FOREST, "Forests");
|
||||
|
||||
public NissaWorldwaker(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{3}{G}{G}");
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public final class SlipOutTheBack extends CardImpl {
|
|||
|
||||
// Put a +1/+1 counter on target creature. It phases out.
|
||||
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
|
||||
this.getSpellAbility().addEffect(new PhaseOutTargetEffect("it"));
|
||||
this.getSpellAbility().addEffect(new PhaseOutTargetEffect().setText("It phases out"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.PutCards;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.command.emblems.TeferiTemporalArchmageEmblem;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ public final class TeferiTemporalArchmage extends CardImpl {
|
|||
|
||||
// -1: Untap up to four target permanents.
|
||||
LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new UntapTargetEffect(), -1);
|
||||
loyaltyAbility.addTarget(new TargetPermanent(0, 4, new FilterPermanent(), false));
|
||||
loyaltyAbility.addTarget(new TargetPermanent(0, 4, StaticFilters.FILTER_PERMANENTS, false));
|
||||
this.addAbility(loyaltyAbility);
|
||||
|
||||
// -10: You get an emblem with "You may activate loyalty abilities of planeswalkers you control on any player's turn any time you could cast an instant."
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -21,7 +20,7 @@ public final class TeferisVeil extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
|
||||
|
||||
// Whenever a creature you control attacks, it phases out at end of combat.
|
||||
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new PhaseOutTargetEffect("it")));
|
||||
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new PhaseOutTargetEffect()));
|
||||
effect.setText("it phases out at end of combat");
|
||||
this.addAbility(new AttacksCreatureYouControlTriggeredAbility(effect, false, true));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import java.util.UUID;
|
|||
public final class TheBearsOfLittjara extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledCreaturePermanent(
|
||||
SubType.SHAPESHIFTER, "any number of target Shapeshifter creatures you control"
|
||||
SubType.SHAPESHIFTER, "Shapeshifter creatures you control"
|
||||
);
|
||||
|
||||
public TheBearsOfLittjara(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import mage.abilities.effects.common.PhaseOutTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterNonlandPermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
|
|
@ -30,7 +29,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class ThePhasingOfZhalfir extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterNonlandPermanent("another nonland permanent");
|
||||
private static final FilterNonlandPermanent filter = new FilterNonlandPermanent("another target nonland permanent");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
|
|
@ -48,7 +47,7 @@ public final class ThePhasingOfZhalfir extends CardImpl {
|
|||
sagaAbility.addChapterEffect(
|
||||
this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_II,
|
||||
new Effects(
|
||||
new PhaseOutTargetEffect("another target nonland permanent"),
|
||||
new PhaseOutTargetEffect(),
|
||||
new ThePhasingOfZhalfirPhaseEffect()
|
||||
), new TargetPermanent(filter)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
package mage.cards.w;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardHandTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -21,7 +17,7 @@ public final class WitsEnd extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{B}{B}");
|
||||
|
||||
// Target player discards their hand.
|
||||
this.getSpellAbility().addEffect(new WitsEndEffect());
|
||||
this.getSpellAbility().addEffect(new DiscardHandTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
|
|
@ -34,30 +30,3 @@ public final class WitsEnd extends CardImpl {
|
|||
return new WitsEnd(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WitsEndEffect extends OneShotEffect {
|
||||
|
||||
WitsEndEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Target player discards their hand";
|
||||
}
|
||||
|
||||
private WitsEndEffect(final WitsEndEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WitsEndEffect copy() {
|
||||
return new WitsEndEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
player.discard(player.getHand(), false, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,11 +65,9 @@ public class DamageTargetControllerEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
String text = "{this} deals " + amount.getMessage() + " damage to target "
|
||||
+ mode.getTargets().get(0).getTargetName() + "'s controller";
|
||||
if (!preventable) {
|
||||
text += ". The damage can't be prevented";
|
||||
}
|
||||
return text;
|
||||
return "{this} deals " + amount.getMessage() + " damage to "
|
||||
+ getTargetPointer().describeTargets(mode.getTargets(), "that creature")
|
||||
+ "'s controller"
|
||||
+ (preventable ? "" : ". The damage can't be prevented");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ import mage.constants.PhaseStep;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.turn.Step;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -32,11 +30,6 @@ public class DetainTargetEffect extends OneShotEffect {
|
|||
super(Outcome.LoseAbility);
|
||||
}
|
||||
|
||||
public DetainTargetEffect(String ruleText) {
|
||||
super(Outcome.LoseAbility);
|
||||
staticText = ruleText;
|
||||
}
|
||||
|
||||
protected DetainTargetEffect(final DetainTargetEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
|
@ -56,8 +49,7 @@ public class DetainTargetEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
DetainRestrictionEffect effect = new DetainRestrictionEffect();
|
||||
game.addEffect(effect, source);
|
||||
game.addEffect(new DetainRestrictionEffect(), source);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -66,40 +58,24 @@ public class DetainTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Target target = mode.getTargets().get(0);
|
||||
|
||||
if (target.getMaxNumberOfTargets() == target.getNumberOfTargets()) {
|
||||
if (target.getMaxNumberOfTargets() == 1) {
|
||||
sb.append("detain target ").append(target.getTargetName());
|
||||
} else {
|
||||
sb.append("detain ").append(target.getMaxNumberOfTargets()).append(" target ").append(target.getTargetName());
|
||||
}
|
||||
} else {
|
||||
sb.append("detain up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName());
|
||||
}
|
||||
sb.append(". <i>(Until your next turn, ");
|
||||
boolean plural = target.getMaxNumberOfTargets() > 1;
|
||||
sb.append(plural ? "those " : "that ");
|
||||
sb.append(target.getTargetName().contains("creature") ? "creature" : "permanent");
|
||||
if (plural) {
|
||||
sb.append('s');
|
||||
}
|
||||
sb.append(" can't attack or block and ");
|
||||
sb.append(plural ? "their" : "its");
|
||||
sb.append(" activated abilities can't be activated.)</i>");
|
||||
return sb.toString();
|
||||
String description = getTargetPointer().describeTargets(mode.getTargets(), "that creature");
|
||||
boolean plural = getTargetPointer().isPlural(mode.getTargets());
|
||||
String reminder = ". <i>(Until your next turn, " + (plural ? "those " : "that ")
|
||||
+ (description.contains("creature") ? "creature" : "permanent") + (plural ? "s" : "")
|
||||
+ " can't attack or block and " + (plural ? "their" : "its")
|
||||
+ " activated abilities can't be activated.)</i>";
|
||||
return "detain " + description + reminder;
|
||||
}
|
||||
}
|
||||
|
||||
class DetainRestrictionEffect extends RestrictionEffect {
|
||||
|
||||
public DetainRestrictionEffect() {
|
||||
DetainRestrictionEffect() {
|
||||
super(Duration.Custom);
|
||||
staticText = "";
|
||||
}
|
||||
|
||||
protected DetainRestrictionEffect(final DetainRestrictionEffect effect) {
|
||||
private DetainRestrictionEffect(final DetainRestrictionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.targetpointer.SecondTargetPointer;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
|
|
@ -82,18 +80,7 @@ public class DrawCardTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (!mode.getTargets().isEmpty()) {
|
||||
Target target;
|
||||
if (targetPointer instanceof SecondTargetPointer && mode.getTargets().size() > 1) {
|
||||
target = mode.getTargets().get(1);
|
||||
} else {
|
||||
target = mode.getTargets().get(0);
|
||||
}
|
||||
sb.append("target ").append(target.getTargetName());
|
||||
} else {
|
||||
sb.append("that player");
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(getTargetPointer().describeTargets(mode.getTargets(), "that player"));
|
||||
if (optional) {
|
||||
sb.append(" may draw ");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -39,6 +38,6 @@ public class ExchangeLifeControllerTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return "Exchange life totals with target " + mode.getTargets().get(0).getTargetName();
|
||||
return "exchange life totals with " + getTargetPointer().describeTargets(mode.getTargets(), "that player");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import mage.players.Player;
|
|||
*/
|
||||
public class GainLifeTargetEffect extends OneShotEffect {
|
||||
|
||||
private DynamicValue life;
|
||||
private final DynamicValue life;
|
||||
|
||||
public GainLifeTargetEffect(int life) {
|
||||
this(StaticValue.get(life));
|
||||
|
|
@ -50,20 +50,13 @@ public class GainLifeTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (!staticText.isEmpty()) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder sb = new StringBuilder(getTargetPointer().describeTargets(mode.getTargets(), "that player"));
|
||||
sb.append(" gains ");
|
||||
String message = life.getMessage();
|
||||
|
||||
if (!mode.getTargets().isEmpty() && mode.getTargets().get(0).getMaxNumberOfTargets() == Integer.MAX_VALUE) {
|
||||
sb.append("any number of target players each gain ");
|
||||
} else if (!mode.getTargets().isEmpty()) {
|
||||
sb.append("target ").append(mode.getTargets().get(0).getTargetName()).append(" gains ");
|
||||
} else {
|
||||
sb.append("that player gains ");
|
||||
}
|
||||
if (message.isEmpty() || !message.equals("1")) {
|
||||
if (!message.equals("1")) {
|
||||
sb.append(life.toString()).append(' ');
|
||||
}
|
||||
sb.append("life");
|
||||
|
|
|
|||
|
|
@ -52,19 +52,13 @@ public class LoseLifeTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (!staticText.isEmpty()) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String message = amount.getMessage();
|
||||
|
||||
if (!mode.getTargets().isEmpty()) {
|
||||
sb.append("target ").append(mode.getTargets().get(0).getTargetName());
|
||||
} else {
|
||||
sb.append("that player");
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(getTargetPointer().describeTargets(mode.getTargets(), "that player"));
|
||||
sb.append(" loses ");
|
||||
if (message.isEmpty() || !message.equals("1")) {
|
||||
String message = amount.getMessage();
|
||||
if (!message.equals("1")) {
|
||||
sb.append(amount).append(' ');
|
||||
}
|
||||
sb.append("life");
|
||||
|
|
|
|||
|
|
@ -14,20 +14,12 @@ import java.util.UUID;
|
|||
*/
|
||||
public class PhaseOutTargetEffect extends OneShotEffect {
|
||||
|
||||
protected final String targetDescription;
|
||||
|
||||
public PhaseOutTargetEffect() {
|
||||
this((String) null);
|
||||
}
|
||||
|
||||
public PhaseOutTargetEffect(String targetDescription) {
|
||||
super(Outcome.Detriment);
|
||||
this.targetDescription = targetDescription;
|
||||
}
|
||||
|
||||
private PhaseOutTargetEffect(final PhaseOutTargetEffect effect) {
|
||||
super(effect);
|
||||
this.targetDescription = effect.targetDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -51,18 +43,7 @@ public class PhaseOutTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (targetDescription != null && !targetDescription.isEmpty()) {
|
||||
sb.append(targetDescription);
|
||||
} else {
|
||||
sb.append("target ").append(mode.getTargets().get(0).getTargetName());
|
||||
}
|
||||
sb.append(" phase");
|
||||
if (mode.getTargets().isEmpty()
|
||||
|| mode.getTargets().get(0).getMaxNumberOfTargets() <= 1) {
|
||||
sb.append('s');
|
||||
}
|
||||
sb.append(" out");
|
||||
return sb.toString();
|
||||
return getTargetPointer().describeTargets(mode.getTargets(), "it")
|
||||
+ (getTargetPointer().isPlural(mode.getTargets()) ? " phase out" : " phases out");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author maurer.it_at_gmail.com
|
||||
|
|
@ -40,7 +37,6 @@ public class RegenerateTargetEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
|
||||
RegenerateSourceEffect.initRegenerationShieldInfo(game, source, targetPointer.getFirst(game, source));
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +58,6 @@ public class RegenerateTargetEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
//20110204 - 701.11c - event.getAmount() is used to signal if regeneration is allowed
|
||||
|
||||
return event.getAmount() == 0 && event.getTargetId().equals(targetPointer.getFirst(game, source)) && !this.used;
|
||||
}
|
||||
|
||||
|
|
@ -71,15 +66,6 @@ public class RegenerateTargetEffect extends ReplacementEffectImpl {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("regenerate ");
|
||||
Target target = mode.getTargets().get(0);
|
||||
if (target != null) {
|
||||
if (!target.getTargetName().toLowerCase(Locale.ENGLISH).startsWith("another")) {
|
||||
sb.append("target ");
|
||||
}
|
||||
sb.append(target.getTargetName());
|
||||
}
|
||||
return sb.toString();
|
||||
return "regenerate " + getTargetPointer().describeTargets(mode.getTargets(), "that creature");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -44,7 +43,7 @@ public class RemoveFromCombatTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return "Remove target " + mode.getTargets().get(0).getTargetName() + " from combat";
|
||||
return "remove " + getTargetPointer().describeTargets(mode.getTargets(), "that creature") + " from combat";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,9 +51,8 @@ public class TapAllTargetPlayerControlsEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
|
||||
return "tap all " + filter.toString() + " target " +
|
||||
(mode.getTargets().isEmpty() ? "player" : mode.getTargets().get(0).getTargetName()) +
|
||||
" controls";
|
||||
return "tap all " + filter.getMessage() + ' '
|
||||
+ getTargetPointer().describeTargets(mode.getTargets(), "that player")
|
||||
+ " controls";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -32,7 +30,7 @@ public class TransformTargetEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
permanent.transform(source, game);
|
||||
}
|
||||
|
|
@ -45,24 +43,6 @@ public class TransformTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder("transform ");
|
||||
Target target = mode.getTargets().get(0);
|
||||
if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE
|
||||
&& target.getMinNumberOfTargets() == 0) {
|
||||
sb.append("any number of ");
|
||||
} else if (target.getMaxNumberOfTargets() != target.getNumberOfTargets()) {
|
||||
sb.append("up to ");
|
||||
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets()));
|
||||
sb.append(' ');
|
||||
} else if (target.getMaxNumberOfTargets() > 1) {
|
||||
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets()));
|
||||
sb.append(' ');
|
||||
}
|
||||
String targetName = mode.getTargets().get(0).getTargetName();
|
||||
if (!targetName.contains("target ")) {
|
||||
sb.append("target ");
|
||||
}
|
||||
sb.append(targetName);
|
||||
return sb.toString();
|
||||
return "transform " + getTargetPointer().describeTargets(mode.getTargets(), "that creature");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ public class TurnFaceUpTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return "turn target " + mode.getTargets().get(0).getTargetName() + " face up";
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
return "turn " + getTargetPointer().describeTargets(mode.getTargets(), "it") + " face up";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -52,31 +50,6 @@ public class UntapTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
|
||||
if (mode.getTargets().isEmpty()) {
|
||||
return "untap target permanent"; // TODO: add exeption about missing targets setup?
|
||||
}
|
||||
|
||||
Target target = mode.getTargets().get(0);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("untap ");
|
||||
if (target.getNumberOfTargets() == 0) {
|
||||
sb.append("up to ");
|
||||
}
|
||||
|
||||
boolean haveTargetWord = target.getTargetName().contains("target");
|
||||
if (target.getMaxNumberOfTargets() > 1 || target.getNumberOfTargets() == 0) {
|
||||
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets()));
|
||||
sb.append(haveTargetWord ? " " : " target ");
|
||||
sb.append(target.getTargetName());
|
||||
if (target.getMaxNumberOfTargets() > 1 && !target.getTargetName().endsWith("s")) {
|
||||
sb.append('s');
|
||||
}
|
||||
} else {
|
||||
sb.append(haveTargetWord ? "" : "target ");
|
||||
sb.append(target.getTargetName());
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
return "untap " + getTargetPointer().describeTargets(mode.getTargets(), "that permanent");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.SubLayer;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -21,8 +19,8 @@ import java.util.UUID;
|
|||
*/
|
||||
public class SetBasePowerToughnessTargetEffect extends ContinuousEffectImpl {
|
||||
|
||||
private DynamicValue power;
|
||||
private DynamicValue toughness;
|
||||
private final DynamicValue power;
|
||||
private final DynamicValue toughness;
|
||||
|
||||
public SetBasePowerToughnessTargetEffect(DynamicValue power, DynamicValue toughness, Duration duration) {
|
||||
super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature);
|
||||
|
|
@ -69,28 +67,9 @@ public class SetBasePowerToughnessTargetEffect extends ContinuousEffectImpl {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (mode.getTargets().get(0).getMinNumberOfTargets() == 0) {
|
||||
if (!mode.getTargets().get(0).getTargetName().startsWith("any")) {
|
||||
sb.append("up to ");
|
||||
sb.append(CardUtil.numberToText(mode.getTargets().get(0).getMaxNumberOfTargets()));
|
||||
sb.append(' ');
|
||||
}
|
||||
}
|
||||
if (!mode.getTargets().get(0).getTargetName().contains("target")) {
|
||||
sb.append("target ");
|
||||
}
|
||||
sb.append(mode.getTargets().get(0).getTargetName());
|
||||
if (mode.getTargets().stream().mapToInt(Target::getMaxNumberOfTargets).max().orElse(0) > 1) {
|
||||
sb.append(" have");
|
||||
} else {
|
||||
sb.append(" has");
|
||||
}
|
||||
sb.append(" base power and toughness ");
|
||||
sb.append(power).append('/').append(toughness);
|
||||
if (!duration.toString().isEmpty()) {
|
||||
sb.append(' ').append(duration.toString());
|
||||
}
|
||||
return sb.toString();
|
||||
return getTargetPointer().describeTargets(mode.getTargets(), "that creature")
|
||||
+ (getTargetPointer().isPlural(mode.getTargets()) ? " have" : " has")
|
||||
+ " base power and toughness " + power + '/' + toughness
|
||||
+ (duration.toString().isEmpty() ? "" : ' ' + duration.toString());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.abilities.effects.common.discard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -17,20 +15,12 @@ import mage.players.Player;
|
|||
|
||||
public class DiscardHandTargetEffect extends OneShotEffect {
|
||||
|
||||
protected String targetDescription;
|
||||
|
||||
public DiscardHandTargetEffect() {
|
||||
this("");
|
||||
}
|
||||
|
||||
public DiscardHandTargetEffect(String targetDescription) {
|
||||
super(Outcome.Discard);
|
||||
this.targetDescription = targetDescription;
|
||||
}
|
||||
|
||||
protected DiscardHandTargetEffect(final DiscardHandTargetEffect effect) {
|
||||
super(effect);
|
||||
this.targetDescription = effect.targetDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -40,17 +30,13 @@ public class DiscardHandTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId : getTargetPointer().getTargets(game, source)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.discard(player.getHand().size(), false, false, source, game);
|
||||
}
|
||||
for (UUID playerId : getTargetPointer().getTargets(game, source)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.discard(player.getHand().size(), false, false, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -58,13 +44,7 @@ public class DiscardHandTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (!targetDescription.isEmpty()) {
|
||||
sb.append(targetDescription);
|
||||
} else {
|
||||
sb.append("target ").append(mode.getTargets().get(0).getTargetName());
|
||||
}
|
||||
sb.append(" discards their hand");
|
||||
return sb.toString();
|
||||
return getTargetPointer().describeTargets(mode.getTargets(), "that player")
|
||||
+ " discards their hand";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,20 +10,21 @@ import mage.target.TargetPermanent;
|
|||
public class TargetArtifactPermanent extends TargetPermanent {
|
||||
|
||||
public TargetArtifactPermanent() {
|
||||
this(1, 1, StaticFilters.FILTER_PERMANENT_ARTIFACT, false);
|
||||
}
|
||||
|
||||
|
||||
public TargetArtifactPermanent(FilterArtifactPermanent filter) {
|
||||
this(1, 1, filter, false);
|
||||
this(1);
|
||||
}
|
||||
|
||||
public TargetArtifactPermanent(int numTargets) {
|
||||
this(numTargets, numTargets, StaticFilters.FILTER_PERMANENT_ARTIFACT, false);
|
||||
this(numTargets, numTargets);
|
||||
}
|
||||
|
||||
public TargetArtifactPermanent(int minNumTargets, int maxNumTargets) {
|
||||
this(minNumTargets, maxNumTargets, StaticFilters.FILTER_PERMANENT_ARTIFACT, false);
|
||||
this(minNumTargets, maxNumTargets,
|
||||
(maxNumTargets > 1 ? StaticFilters.FILTER_PERMANENT_ARTIFACTS : StaticFilters.FILTER_PERMANENT_ARTIFACT),
|
||||
false);
|
||||
}
|
||||
|
||||
public TargetArtifactPermanent(FilterArtifactPermanent filter) {
|
||||
this(1, 1, filter, false);
|
||||
}
|
||||
|
||||
public TargetArtifactPermanent(int minNumTargets, int maxNumTargets, FilterArtifactPermanent filter, boolean notTarget) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue