1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-13 01:01:11 -09:00

BecomesCreatureTargetEffect - improved text generation

This commit is contained in:
Oleg Agafonov 2023-04-30 18:11:57 +04:00
parent 3df7f6940d
commit e848f85e81
20 changed files with 84 additions and 46 deletions

View file

@ -43,7 +43,7 @@ public final class AlloyAnimist extends CardImpl {
new CreatureToken(4, 4, "4/4 artifact creature") new CreatureToken(4, 4, "4/4 artifact creature")
.withType(CardType.ARTIFACT), .withType(CardType.ARTIFACT),
false, false, Duration.EndOfTurn false, false, Duration.EndOfTurn
), new ManaCostsImpl<>("{2}{G}")); ).withDurationRuleAtStart(true), new ManaCostsImpl<>("{2}{G}"));
ability.addTarget(new TargetPermanent(filter)); ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -1,7 +1,6 @@
package mage.cards.a; package mage.cards.a;
import java.util.UUID;
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -10,17 +9,21 @@ import mage.constants.Duration;
import mage.game.permanent.token.custom.CreatureToken; import mage.game.permanent.token.custom.CreatureToken;
import mage.target.common.TargetLandPermanent; import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/** /**
*
* @author LoneFox * @author LoneFox
*/ */
public final class AnimateLand extends CardImpl { public final class AnimateLand extends CardImpl {
public AnimateLand(UUID ownerId, CardSetInfo setInfo) { public AnimateLand(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
// Until end of turn, target land becomes a 3/3 creature that's still a land. // Until end of turn, target land becomes a 3/3 creature that's still a land.
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new CreatureToken(3, 3), false, true, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(
new CreatureToken(3, 3),
false, true, Duration.EndOfTurn
).withDurationRuleAtStart(true));
this.getSpellAbility().addTarget(new TargetLandPermanent()); this.getSpellAbility().addTarget(new TargetLandPermanent());
} }

View file

@ -32,7 +32,7 @@ public final class AnthousaSetessanHero extends CardImpl {
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// <i>Heroic</i> &mdash; Whenever you cast a spell that targets Anthousa, Setessan Hero, up to three target lands you control each become 2/2 Warrior creatures until end of turn. They're still lands. // <i>Heroic</i> &mdash; Whenever you cast a spell that targets Anthousa, Setessan Hero, up to three target lands you control each become 2/2 Warrior creatures until end of turn. They're still lands.
Ability ability = new HeroicAbility(new BecomesCreatureTargetEffect(new CreatureToken(2, 2, "2/2 Warrior creature", SubType.WARRIOR),false,true, Duration.EndOfTurn)); Ability ability = new HeroicAbility(new BecomesCreatureTargetEffect(new CreatureToken(2, 2, "2/2 Warrior creatures", SubType.WARRIOR),false,true, Duration.EndOfTurn));
ability.addTarget(new TargetControlledPermanent(0,3,new FilterControlledLandPermanent("lands"), false)); ability.addTarget(new TargetControlledPermanent(0,3,new FilterControlledLandPermanent("lands"), false));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -24,7 +24,9 @@ public final class DanceOfTheSkywise extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}");
// Until end of turn, target creature you control becomes a blue Dragon Illusion with base power and toughness 4/4, loses all abilities, and gains flying. // Until end of turn, target creature you control becomes a blue Dragon Illusion with base power and toughness 4/4, loses all abilities, and gains flying.
Effect effect = new BecomesCreatureTargetEffect(new DragonIllusionToken(), true, false, Duration.EndOfTurn); Effect effect = new BecomesCreatureTargetEffect(
new DragonIllusionToken(), true, false, Duration.EndOfTurn)
.withDurationRuleAtStart(true);
effect.setText("Until end of turn, target creature you control becomes a blue Dragon Illusion with base power and toughness 4/4, loses all abilities, and gains flying."); effect.setText("Until end of turn, target creature you control becomes a blue Dragon Illusion with base power and toughness 4/4, loses all abilities, and gains flying.");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());

View file

@ -36,7 +36,8 @@ public final class Dragonshift extends CardImpl {
.withSubType(SubType.DRAGON) .withSubType(SubType.DRAGON)
.withColor("UR") .withColor("UR")
.withAbility(FlyingAbility.getInstance()), .withAbility(FlyingAbility.getInstance()),
true, false, Duration.EndOfTurn); true, false, Duration.EndOfTurn)
.withDurationRuleAtStart(true);
effect.setText("Until end of turn, target creature you control becomes a blue and red Dragon with base power and toughness 4/4, loses all abilities, and gains flying."); effect.setText("Until end of turn, target creature you control becomes a blue and red Dragon with base power and toughness 4/4, loses all abilities, and gains flying.");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());

View file

@ -78,7 +78,10 @@ class ElvishBranchbenderEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int xValue = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this); int xValue = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this);
ContinuousEffect effect = new BecomesCreatureTargetEffect(new ElvishBranchbenderToken(xValue), false, false, Duration.EndOfTurn); // fix ContinuousEffect effect = new BecomesCreatureTargetEffect(
new ElvishBranchbenderToken(xValue),
false, false, Duration.EndOfTurn)
.withDurationRuleAtStart(true);
effect.setTargetPointer(targetPointer); effect.setTargetPointer(targetPointer);
game.addEffect(effect, source); game.addEffect(effect, source);
return false; return false;

View file

@ -21,7 +21,10 @@ public final class GiftOfTusks extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}");
// Until end of turn, target creature loses all abilities and becomes a green Elephant with base power and toughness 3/3. // Until end of turn, target creature loses all abilities and becomes a green Elephant with base power and toughness 3/3.
Effect effect = new BecomesCreatureTargetEffect(new ElephantToken(), true, false, Duration.EndOfTurn); Effect effect = new BecomesCreatureTargetEffect(
new ElephantToken(),
true, false, Duration.EndOfTurn)
.withDurationRuleAtStart(true);
effect.setText("Until end of turn, target creature loses all abilities and becomes a green Elephant with base power and toughness 3/3"); effect.setText("Until end of turn, target creature loses all abilities and becomes a green Elephant with base power and toughness 3/3");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -43,14 +43,14 @@ public final class KamahlHeartOfKrosa extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// {1}{G}: Until end of turn, target land you control becomes a 1/1 Elemental creature with vigilance, indestructible, and haste. It's still a land. // {1}{G}: Until end of turn, target land you control becomes a 1/1 Elemental creature with vigilance, indestructible, and haste. It's still a land.
ability = new SimpleActivatedAbility(new BecomesCreatureTargetEffect(new CreatureToken( ability = new SimpleActivatedAbility(new BecomesCreatureTargetEffect(
1, 1, "1/1 Elemental creature with vigilance, indestructible, and haste" new CreatureToken(1, 1, "1/1 Elemental creature with vigilance, indestructible, and haste")
).withSubType(SubType.ELEMENTAL) .withSubType(SubType.ELEMENTAL)
.withAbility(VigilanceAbility.getInstance()) .withAbility(VigilanceAbility.getInstance())
.withAbility(IndestructibleAbility.getInstance()) .withAbility(IndestructibleAbility.getInstance())
.withAbility(HasteAbility.getInstance()), .withAbility(HasteAbility.getInstance()),
false, true, Duration.EndOfTurn false, true, Duration.EndOfTurn
), new ManaCostsImpl<>("{1}{G}")); ).withDurationRuleAtStart(true), new ManaCostsImpl<>("{1}{G}"));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND)); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND));
this.addAbility(ability); this.addAbility(ability);

View file

@ -38,14 +38,14 @@ public final class KamahlsWill extends CardImpl {
// Until end of turn, any number of target lands you control become 1/1 Elemental creatures with vigilance, indestructible, and haste. They're still lands. // Until end of turn, any number of target lands you control become 1/1 Elemental creatures with vigilance, indestructible, and haste. They're still lands.
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect( this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(
new CreatureToken(1, 1, "") new CreatureToken(1, 1, "1/1 Elemental creatures with vigilance, indestructible, and haste")
.withSubType(SubType.ELEMENTAL) .withSubType(SubType.ELEMENTAL)
.withAbility(VigilanceAbility.getInstance()) .withAbility(VigilanceAbility.getInstance())
.withAbility(IndestructibleAbility.getInstance()) .withAbility(IndestructibleAbility.getInstance())
.withAbility(HasteAbility.getInstance()), .withAbility(HasteAbility.getInstance()),
false, true, Duration.EndOfTurn false, true, Duration.EndOfTurn
).setText("until end of turn, any number of target lands you control become 1/1 Elemental creatures " + ).withDurationRuleAtStart(true)/*.setText("until end of turn, any number of target lands you control become 1/1 Elemental creatures " +
"with vigilance, indestructible, and haste. They're still lands")); "with vigilance, indestructible, and haste. They're still lands")*/);
this.getSpellAbility().addTarget(new TargetPermanent( this.getSpellAbility().addTarget(new TargetPermanent(
0, Integer.MAX_VALUE, StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS, false 0, Integer.MAX_VALUE, StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS, false
)); ));

View file

@ -1,7 +1,6 @@
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.SacrificeSourceCost;
@ -18,17 +17,22 @@ import mage.constants.Zone;
import mage.game.permanent.token.custom.CreatureToken; import mage.game.permanent.token.custom.CreatureToken;
import mage.target.common.TargetLandPermanent; import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/** /**
*
* @author Loki * @author Loki
*/ */
public final class LifesparkSpellbomb extends CardImpl { public final class LifesparkSpellbomb extends CardImpl {
public LifesparkSpellbomb(UUID ownerId, CardSetInfo setInfo) { public LifesparkSpellbomb(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
// {G}, Sacrifice Lifespark Spellbomb: Until end of turn, target land becomes a 3/3 creature that's still a land. // {G}, Sacrifice Lifespark Spellbomb: Until end of turn, target land becomes a 3/3 creature that's still a land.
Ability firstAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureTargetEffect(new CreatureToken(3, 3), false, true, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.G)); Ability firstAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BecomesCreatureTargetEffect(
new CreatureToken(3, 3),
false, true, Duration.EndOfTurn)
.withDurationRuleAtStart(true), new ColoredManaCost(ColoredManaSymbol.G));
firstAbility.addCost(new SacrificeSourceCost()); firstAbility.addCost(new SacrificeSourceCost());
firstAbility.addTarget(new TargetLandPermanent()); firstAbility.addTarget(new TargetLandPermanent());
this.addAbility(firstAbility); this.addAbility(firstAbility);

View file

@ -77,7 +77,7 @@ class MercurialTransformationEffect extends OneShotEffect {
} }
game.addEffect(new BecomesCreatureTargetEffect( game.addEffect(new BecomesCreatureTargetEffect(
token, true, false, Duration.EndOfTurn token, true, false, Duration.EndOfTurn
), source); ).withDurationRuleAtStart(true), source);
return true; return true;
} }
} }

View file

@ -44,7 +44,7 @@ public final class NissaVitalForce extends CardImpl {
LoyaltyAbility ability = new LoyaltyAbility(new UntapTargetEffect(), 1); LoyaltyAbility ability = new LoyaltyAbility(new UntapTargetEffect(), 1);
ability.addEffect(new BecomesCreatureTargetEffect( ability.addEffect(new BecomesCreatureTargetEffect(
new NissaVitalForceToken(), false, true, Duration.UntilYourNextTurn new NissaVitalForceToken(), false, true, Duration.UntilYourNextTurn
).setText("Until your next turn, it becomes a 5/5 Elemental creature with haste. It's still a land")); ).withDurationRuleAtStart(true).setText("Until your next turn, it becomes a 5/5 Elemental creature with haste. It's still a land"));
ability.addTarget(new TargetLandPermanent(filter)); ability.addTarget(new TargetLandPermanent(filter));
this.addAbility(ability); this.addAbility(ability);

View file

@ -25,7 +25,7 @@ public final class PhantasmalForm extends CardImpl {
// Until end of turn, up to two target creatures each have base power and toughness 3/3, gain flying, and become blue Illusions in addition to their other colors and types. // Until end of turn, up to two target creatures each have base power and toughness 3/3, gain flying, and become blue Illusions in addition to their other colors and types.
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect( this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(
new PhantasmalFormToken(), false, false, Duration.EndOfTurn new PhantasmalFormToken(), false, false, Duration.EndOfTurn
).setText("Until end of turn, up to two target creatures each have base power and toughness 3/3, " + ).withDurationRuleAtStart(true).setText("Until end of turn, up to two target creatures each have base power and toughness 3/3, " +
"gain flying, and become blue Illusions in addition to their other colors and types.") "gain flying, and become blue Illusions in addition to their other colors and types.")
); );
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2));

View file

@ -78,7 +78,7 @@ class RampagingGrowthEffect extends OneShotEffect {
new CreatureToken(4, 3, "", SubType.INSECT new CreatureToken(4, 3, "", SubType.INSECT
).withAbility(ReachAbility.getInstance()).withAbility(HasteAbility.getInstance()), ).withAbility(ReachAbility.getInstance()).withAbility(HasteAbility.getInstance()),
false, true, Duration.EndOfTurn false, true, Duration.EndOfTurn
).setTargetPointer(new FixedTarget(permanent, game)), source); ).withDurationRuleAtStart(true).setTargetPointer(new FixedTarget(permanent, game)), source);
} }
player.shuffleLibrary(source, game); player.shuffleLibrary(source, game);
return true; return true;

View file

@ -32,8 +32,7 @@ public final class ScaleUp extends CardImpl {
new CreatureToken(6, 4, "green Wurm with base power and toughness 6/4") new CreatureToken(6, 4, "green Wurm with base power and toughness 6/4")
.withColor("G").withSubType(SubType.WURM), .withColor("G").withSubType(SubType.WURM),
true, false, Duration.EndOfTurn, false, true true, false, Duration.EndOfTurn, false, true
).setText("Until end of turn, target creature you control " + ).withDurationRuleAtStart(true));
"becomes a green Wurm with base power and toughness 6/4."));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
// Overload {4}{G}{G} // Overload {4}{G}{G}

View file

@ -24,7 +24,8 @@ public final class Snakeform extends CardImpl {
// Until end of turn, target creature loses all abilities and becomes a green Snake with base power and toughness 1/1. // Until end of turn, target creature loses all abilities and becomes a green Snake with base power and toughness 1/1.
Effect effect = new BecomesCreatureTargetEffect(new SnakeToken(), true, false, Duration.EndOfTurn); Effect effect = new BecomesCreatureTargetEffect(new SnakeToken(), true, false, Duration.EndOfTurn)
.withDurationRuleAtStart(true);
effect.setText("Until end of turn, target creature loses all abilities and becomes a green Snake with base power and toughness 1/1"); effect.setText("Until end of turn, target creature loses all abilities and becomes a green Snake with base power and toughness 1/1");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -27,7 +27,7 @@ public final class StartlingDevelopment extends CardImpl {
4, 4, "blue Serpent with base power and toughness 4/4" 4, 4, "blue Serpent with base power and toughness 4/4"
).withColor("U").withSubType(SubType.SERPENT), ).withColor("U").withSubType(SubType.SERPENT),
false, false, Duration.EndOfTurn false, false, Duration.EndOfTurn
).setRemoveSubtypes(true)); ).withDurationRuleAtStart(true).setRemoveSubtypes(true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// Cycling {1} // Cycling {1}

View file

@ -27,8 +27,8 @@ public final class TurnBurn extends SplitCard {
// Turn // Turn
// Until end of turn, target creature loses all abilities and becomes a red Weird with base power and toughness 0/1. // Until end of turn, target creature loses all abilities and becomes a red Weird with base power and toughness 0/1.
Effect effect = new BecomesCreatureTargetEffect(new WeirdToken(), true, false, Duration.EndOfTurn); Effect effect = new BecomesCreatureTargetEffect(new WeirdToken(), true, false, Duration.EndOfTurn)
effect.setText("Until end of turn, target creature loses all abilities and becomes a red Weird with base power and toughness 0/1"); .withDurationRuleAtStart(true);
getLeftHalfCard().getSpellAbility().addEffect(effect); getLeftHalfCard().getSpellAbility().addEffect(effect);
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent().withChooseHint("becomes a Weird")); getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent().withChooseHint("becomes a Weird"));
@ -53,7 +53,7 @@ public final class TurnBurn extends SplitCard {
private static class WeirdToken extends TokenImpl { private static class WeirdToken extends TokenImpl {
private WeirdToken() { private WeirdToken() {
super("Weird", "a red Weird with base power and toughness 0/1"); super("Weird", "red Weird with base power and toughness 0/1");
cardType.add(CardType.CREATURE); cardType.add(CardType.CREATURE);
color.setRed(true); color.setRed(true);
subtype.add(SubType.WEIRD); subtype.add(SubType.WEIRD);

View file

@ -39,9 +39,8 @@ public final class WoodwraithCorrupter extends CardImpl {
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(6); this.toughness = new MageInt(6);
// {1}{B}{G}, {tap}: Target Forest becomes a 4/4 black and green Elemental Horror creature. It's still a land. // {1}{B}{G}, {T}: Target Forest becomes a 4/4 black and green Elemental Horror creature. It's still a land.
Effect effect = new BecomesCreatureTargetEffect(new WoodwraithCorrupterToken(), false, true, Duration.EndOfGame); Effect effect = new BecomesCreatureTargetEffect(new WoodwraithCorrupterToken(), false, true, Duration.Custom);
effect.setText("Target Forest becomes a 4/4 black and green Elemental Horror creature. It's still a land");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}{B}{G}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}{B}{G}"));
ability.addTarget(new TargetPermanent(filter)); ability.addTarget(new TargetPermanent(filter));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());

View file

@ -25,6 +25,8 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
protected boolean removeSubtypes = false; protected boolean removeSubtypes = false;
protected boolean loseOtherCardTypes; protected boolean loseOtherCardTypes;
protected boolean durationRuleAtStart = false; // put duration rule to the start of the rules instead end
public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration) { public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration) {
this(token, loseAllAbilities, stillALand, duration, false); this(token, loseAllAbilities, stillALand, duration, false);
} }
@ -68,6 +70,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
this.keepAbilities = effect.keepAbilities; this.keepAbilities = effect.keepAbilities;
this.loseOtherCardTypes = effect.loseOtherCardTypes; this.loseOtherCardTypes = effect.loseOtherCardTypes;
this.dependencyTypes.add(DependencyType.BecomeCreature); this.dependencyTypes.add(DependencyType.BecomeCreature);
this.durationRuleAtStart = effect.durationRuleAtStart;
} }
@Override @Override
@ -172,34 +175,54 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
|| layer == Layer.TextChangingEffects_3; || layer == Layer.TextChangingEffects_3;
} }
public BecomesCreatureTargetEffect withDurationRuleAtStart(boolean durationRuleAtStart) {
this.durationRuleAtStart = durationRuleAtStart;
return this;
}
@Override @Override
public String getText(Mode mode) { public String getText(Mode mode) {
if (staticText != null && !staticText.isEmpty()) { if (staticText != null && !staticText.isEmpty()) {
return staticText; return staticText;
} }
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (durationRuleAtStart && duration != Duration.Custom) {
sb.append(duration.toString());
sb.append(", ");
}
Target target = mode.getTargets().get(0); Target target = mode.getTargets().get(0);
if (target.getMaxNumberOfTargets() != Integer.MAX_VALUE) {
if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) { if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) {
sb.append("up to "); sb.append("up to ");
if (target.getMaxNumberOfTargets() == 1) { if (target.getMaxNumberOfTargets() == 1) {
sb.append("one "); sb.append("one ");
} }
} }
}
if (target.getMaxNumberOfTargets() > 1) { if (target.getMaxNumberOfTargets() > 1) {
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()); sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName());
if (loseAllAbilities) { if (loseAllAbilities) {
sb.append(" lose all their abilities and "); sb.append(" lose all their abilities and");
} }
sb.append(" each become "); if (target.getMaxNumberOfTargets() != Integer.MAX_VALUE) {
sb.append(" each");
}
sb.append(" become ");
} else { } else {
sb.append("target ").append(target.getTargetName()); sb.append("target ").append(target.getTargetName());
if (loseAllAbilities && !keepAbilities) { if (loseAllAbilities && !keepAbilities) {
sb.append(" loses all abilities and "); sb.append(" loses all abilities and");
} }
sb.append(" becomes a "); sb.append(" becomes a ");
} }
sb.append(token.getDescription()); sb.append(token.getDescription());
if (!durationRuleAtStart && duration != Duration.Custom) {
sb.append(' ').append(duration.toString()); sb.append(' ').append(duration.toString());
}
if (addStillALandText) { if (addStillALandText) {
if (!sb.toString().endsWith("\" ")) { if (!sb.toString().endsWith("\" ")) {
sb.append(". "); sb.append(". ");