Refactoring: replace custom creature tokens with basic class (9 cards)

This commit is contained in:
Oleg Agafonov 2018-05-11 21:58:45 +04:00
parent 25b10c4d67
commit 321f82a381
10 changed files with 116 additions and 232 deletions

View file

@ -28,6 +28,7 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.CreatureEntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
@ -39,9 +40,9 @@ import mage.constants.Duration;
import mage.constants.SubType;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/**
*
* @author Loki
*/
public class AngelsTomb extends CardImpl {
@ -50,7 +51,12 @@ public class AngelsTomb extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Whenever a creature enters the battlefield under your control, you may have Angel's Tomb become a 3/3 white Angel artifact creature with flying until end of turn.
this.addAbility(new CreatureEntersBattlefieldTriggeredAbility(new BecomesCreatureSourceEffect(new AngelTombToken(), "", Duration.EndOfTurn), true));
this.addAbility(new CreatureEntersBattlefieldTriggeredAbility(new BecomesCreatureSourceEffect(
new CreatureToken(3, 3, "3/3 white Angel artifact creature with flying")
.withColor("W")
.withSubType(SubType.ANGEL)
.withAbility(FlyingAbility.getInstance()),
"", Duration.EndOfTurn), true));
}
public AngelsTomb(final AngelsTomb card) {
@ -62,25 +68,3 @@ public class AngelsTomb extends CardImpl {
return new AngelsTomb(this);
}
}
class AngelTombToken extends TokenImpl {
public AngelTombToken() {
super("", "3/3 white Angel artifact creature with flying");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
color.setWhite(true);
subtype.add(SubType.ANGEL);
power = new MageInt(3);
toughness = new MageInt(3);
addAbility(FlyingAbility.getInstance());
}
public AngelTombToken(final AngelTombToken token) {
super(token);
}
public AngelTombToken copy() {
return new AngelTombToken(this);
}
}

View file

@ -28,6 +28,7 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -43,9 +44,9 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/**
*
* @author fireshoes
*/
public class AtarkaMonument extends CardImpl {
@ -58,8 +59,13 @@ public class AtarkaMonument extends CardImpl {
this.addAbility(new GreenManaAbility());
// {4}{R}{G}: Atarka Monument becomes a 4/4 red and green Dragon artifact creature with flying until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect
(new AtarkaMonumentToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{4}{R}{G}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new CreatureToken(4, 4, "4/4 red and green Dragon artifact creature with flying")
.withColor("RG")
.withSubType(SubType.DRAGON)
.withType(CardType.ARTIFACT)
.withAbility(FlyingAbility.getInstance()),
"", Duration.EndOfTurn), new ManaCostsImpl("{4}{R}{G}")));
}
public AtarkaMonument(final AtarkaMonument card) {
@ -70,25 +76,4 @@ public class AtarkaMonument extends CardImpl {
public AtarkaMonument copy() {
return new AtarkaMonument(this);
}
private static class AtarkaMonumentToken extends TokenImpl {
AtarkaMonumentToken() {
super("", "4/4 red and green Dragon artifact creature with flying");
this.cardType.add(CardType.ARTIFACT);
this.cardType.add(CardType.CREATURE);
this.color.setRed(true);
this.color.setGreen(true);
this.subtype.add(SubType.DRAGON);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.addAbility(FlyingAbility.getInstance());
}
public AtarkaMonumentToken(final AtarkaMonumentToken token) {
super(token);
}
public AtarkaMonumentToken copy() {
return new AtarkaMonumentToken(this);
}
}
}

View file

@ -28,6 +28,7 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -43,6 +44,7 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/**
* @author LevelX2
@ -57,7 +59,13 @@ public class AzoriusKeyrune extends CardImpl {
this.addAbility(new BlueManaAbility());
// {W}{U}: Azorius Keyrune becomes a 2/2 white and blue Bird artifact creature with flying until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new AzoriusKeyruneToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{W}{U}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new CreatureToken(2, 2, "2/2 white and blue Bird artifact creature with flying")
.withColor("WU")
.withSubType(SubType.BIRD)
.withType(CardType.ARTIFACT)
.withAbility(FlyingAbility.getInstance()),
"", Duration.EndOfTurn), new ManaCostsImpl("{W}{U}")));
}
public AzoriusKeyrune(final AzoriusKeyrune card) {
@ -68,25 +76,4 @@ public class AzoriusKeyrune extends CardImpl {
public AzoriusKeyrune copy() {
return new AzoriusKeyrune(this);
}
private static class AzoriusKeyruneToken extends TokenImpl {
AzoriusKeyruneToken() {
super("", "2/2 white and blue Bird artifact creature with flying");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
color.setWhite(true);
color.setBlue(true);
this.subtype.add(SubType.BIRD);
power = new MageInt(2);
toughness = new MageInt(2);
this.addAbility(FlyingAbility.getInstance());
}
public AzoriusKeyruneToken(final AzoriusKeyruneToken token) {
super(token);
}
public AzoriusKeyruneToken copy() {
return new AzoriusKeyruneToken(this);
}
}
}

View file

@ -29,6 +29,7 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -48,6 +49,7 @@ import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
import mage.target.TargetPermanent;
/**
@ -68,7 +70,12 @@ public class BlinkmothNexus extends CardImpl {
this.addAbility(new ColorlessManaAbility());
// {1}: Blinkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying until end of turn. It's still a land.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new BlinkmothNexusToken(), "land", Duration.EndOfTurn), new GenericManaCost(1)));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new CreatureToken(1, 1, "1/1 Blinkmoth artifact creature with flying")
.withSubType(SubType.BLINKMOTH)
.withType(CardType.ARTIFACT)
.withAbility(FlyingAbility.getInstance()),
"land", Duration.EndOfTurn), new GenericManaCost(1)));
// {1}, {T}: Target Blinkmoth creature gets +1/+1 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn), new GenericManaCost(1));
@ -88,22 +95,3 @@ public class BlinkmothNexus extends CardImpl {
}
}
class BlinkmothNexusToken extends TokenImpl {
public BlinkmothNexusToken() {
super("Blinkmoth", "1/1 Blinkmoth artifact creature with flying");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
this.subtype.add(SubType.BLINKMOTH);
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance());
}
public BlinkmothNexusToken(final BlinkmothNexusToken token) {
super(token);
}
public BlinkmothNexusToken copy() {
return new BlinkmothNexusToken(this);
}
}

View file

@ -28,6 +28,7 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -43,9 +44,9 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/**
*
* @author LevelX2
*/
public class BorosKeyrune extends CardImpl {
@ -58,7 +59,13 @@ public class BorosKeyrune extends CardImpl {
this.addAbility(new WhiteManaAbility());
// {R}{W}: Boros Keyrune becomes a 1/1 red and white Soldier artifact creature with double strike until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new BorosKeyruneToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{R}{W}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new CreatureToken(1, 1, "1/1 red and white Soldier artifact creature with double strike")
.withColor("RW")
.withSubType(SubType.SOLDIER)
.withType(CardType.ARTIFACT)
.withAbility(DoubleStrikeAbility.getInstance()),
"", Duration.EndOfTurn), new ManaCostsImpl("{R}{W}")));
}
public BorosKeyrune(final BorosKeyrune card) {
@ -69,25 +76,4 @@ public class BorosKeyrune extends CardImpl {
public BorosKeyrune copy() {
return new BorosKeyrune(this);
}
private static class BorosKeyruneToken extends TokenImpl {
BorosKeyruneToken() {
super("Soldier", "1/1 red and white Soldier artifact creature with double strike");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
color.setRed(true);
color.setWhite(true);
subtype.add(SubType.SOLDIER);
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(DoubleStrikeAbility.getInstance());
}
public BorosKeyruneToken(final BorosKeyruneToken token) {
super(token);
}
public BorosKeyruneToken copy() {
return new BorosKeyruneToken(this);
}
}
}

View file

@ -28,6 +28,7 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.SimpleActivatedAbility;
@ -45,20 +46,31 @@ import mage.constants.Duration;
import mage.constants.Zone;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CelestialColonnade extends CardImpl {
public CelestialColonnade(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, null);
// Celestial Colonnade enters the battlefield tapped.
this.addAbility(new EntersBattlefieldTappedAbility());
// {T}: Add {W} or {U]
this.addAbility(new BlueManaAbility());
this.addAbility(new WhiteManaAbility());
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new CelestialColonnadeToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{3}{W}{U}")));
// {3}{W}{U}: Until end of turn, Celestial Colonnade becomes a 4/4 white and blue Elemental creature with flying and vigilance. Its still a land.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new CreatureToken(4, 4, "4/4 white and blue Elemental creature with flying and vigilance")
.withColor("WU")
.withSubType(SubType.ELEMENTAL)
.withAbility(FlyingAbility.getInstance())
.withAbility(VigilanceAbility.getInstance()),
"land", Duration.EndOfTurn), new ManaCostsImpl("{3}{W}{U}")));
}
public CelestialColonnade(final CelestialColonnade card) {
@ -71,26 +83,3 @@ public class CelestialColonnade extends CardImpl {
}
}
class CelestialColonnadeToken extends TokenImpl {
public CelestialColonnadeToken() {
super("", "4/4 white and blue Elemental creature with flying and vigilance");
cardType.add(CardType.CREATURE);
subtype.add(SubType.ELEMENTAL);
color.setBlue(true);
color.setWhite(true);
power = new MageInt(4);
toughness = new MageInt(4);
addAbility(FlyingAbility.getInstance());
addAbility(VigilanceAbility.getInstance());
}
public CelestialColonnadeToken(final CelestialColonnadeToken token) {
super(token);
}
public CelestialColonnadeToken copy() {
return new CelestialColonnadeToken(this);
}
}

View file

@ -28,6 +28,7 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SpellCastOpponentTriggeredAbility;
@ -48,11 +49,10 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/**
*
* @author Pete Rossi
*/
public class ChimericEgg extends CardImpl {
@ -70,8 +70,12 @@ public class ChimericEgg extends CardImpl {
this.addAbility(new SpellCastOpponentTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), nonArtifactFilter, false));
// Remove three charge counters from Chimeric Egg: Chimeric Egg becomes a 6/6 Construct artifact creature with trample until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect
(new ChimericEggToken(), "", Duration.EndOfTurn), new RemoveCountersSourceCost(new Counter(CounterType.CHARGE.getName(), 3))));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new CreatureToken(6, 6, "6/6 Construct artifact creature with trample")
.withSubType(SubType.CONSTRUCT)
.withType(CardType.ARTIFACT)
.withAbility(TrampleAbility.getInstance()),
"", Duration.EndOfTurn), new RemoveCountersSourceCost(new Counter(CounterType.CHARGE.getName(), 3))));
}
public ChimericEgg(final ChimericEgg card) {
@ -82,23 +86,4 @@ public class ChimericEgg extends CardImpl {
public ChimericEgg copy() {
return new ChimericEgg(this);
}
private static class ChimericEggToken extends TokenImpl {
ChimericEggToken() {
super("", "6/6 Construct artifact creature with trample");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
this.subtype.add(SubType.CONSTRUCT);
power = new MageInt(6);
toughness = new MageInt(6);
this.addAbility(TrampleAbility.getInstance());
}
public ChimericEggToken(final ChimericEggToken token) {
super(token);
}
public ChimericEggToken copy() {
return new ChimericEggToken(this);
}
}
}

View file

@ -28,6 +28,7 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -43,9 +44,9 @@ import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/**
*
* @author LevelX2
*/
public class ChimericIdol extends CardImpl {
@ -55,7 +56,11 @@ public class ChimericIdol extends CardImpl {
// {0}: Tap all lands you control. Chimeric Idol becomes a 3/3 Turtle artifact creature until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapAllEffect(new FilterControlledLandPermanent("lands you control")), new ManaCostsImpl("{0}"));
ability.addEffect(new BecomesCreatureSourceEffect(new ChimericIdolToken(), "", Duration.EndOfTurn));
ability.addEffect(new BecomesCreatureSourceEffect(
new CreatureToken(3, 3, "3/3 Turtle artifact creature")
.withSubType(SubType.TURTLE)
.withType(CardType.ARTIFACT),
"", Duration.EndOfTurn));
this.addAbility(ability);
}
@ -69,22 +74,3 @@ public class ChimericIdol extends CardImpl {
return new ChimericIdol(this);
}
}
class ChimericIdolToken extends TokenImpl {
public ChimericIdolToken() {
super("Turtle", "3/3 Turtle artifact creature token");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
subtype.add(SubType.TURTLE);
power = new MageInt(3);
toughness = new MageInt(3);
}
public ChimericIdolToken(final ChimericIdolToken token) {
super(token);
}
public ChimericIdolToken copy() {
return new ChimericIdolToken(this);
}
}

View file

@ -28,6 +28,7 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
@ -46,6 +47,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/**
* @author BetaSteward_at_googlemail.com
@ -60,7 +62,12 @@ public class ChimericMass extends CardImpl {
// {1}: Until end of turn, Chimeric Mass becomes a Construct artifact creature with "This creature's power and toughness are each equal to the number of charge counters on it."
// set to character defining to prevent setting P/T again to 0 becuase already set by CDA of the token
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new ChimericMassToken(), "", Duration.EndOfTurn, false, true), new GenericManaCost(1)));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new CreatureToken(0, 0, "Construct artifact creature with \"This creature's power and toughness are each equal to the number of charge counters on it.\"")
.withType(CardType.ARTIFACT)
.withSubType(SubType.CONSTRUCT)
.withAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new CountersSourceCount(CounterType.CHARGE), Duration.WhileOnBattlefield))),
"", Duration.EndOfTurn, false, true), new GenericManaCost(1)));
}
public ChimericMass(final ChimericMass card) {
@ -73,22 +80,3 @@ public class ChimericMass extends CardImpl {
}
}
class ChimericMassToken extends TokenImpl {
public ChimericMassToken() {
super("", "Construct artifact creature with \"This creature's power and toughness are each equal to the number of charge counters on it.\"");
cardType.add(CardType.CREATURE);
subtype.add(SubType.CONSTRUCT);
power = new MageInt(0);
toughness = new MageInt(0);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new CountersSourceCount(CounterType.CHARGE), Duration.WhileOnBattlefield)));
}
public ChimericMassToken(final ChimericMassToken token) {
super(token);
}
public ChimericMassToken copy() {
return new ChimericMassToken(this);
}
}

View file

@ -42,24 +42,24 @@ import mage.game.permanent.token.Token;
public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements SourceEffect {
protected Token token;
protected String type;
protected String theyAreStillType;
protected boolean losePreviousTypes;
protected DynamicValue power = null;
protected DynamicValue toughness = null;
public BecomesCreatureSourceEffect(Token token, String type, Duration duration) {
this(token, type, duration, false, false);
public BecomesCreatureSourceEffect(Token token, String theyAreStillType, Duration duration) {
this(token, theyAreStillType, duration, false, false);
}
public BecomesCreatureSourceEffect(Token token, String type, Duration duration, boolean losePreviousTypes, boolean characterDefining) {
this(token, type, duration, losePreviousTypes, characterDefining, null, null);
public BecomesCreatureSourceEffect(Token token, String theyAreStillType, Duration duration, boolean losePreviousTypes, boolean characterDefining) {
this(token, theyAreStillType, duration, losePreviousTypes, characterDefining, null, null);
}
public BecomesCreatureSourceEffect(Token token, String type, Duration duration, boolean losePreviousTypes, boolean characterDefining, DynamicValue power, DynamicValue toughness) {
public BecomesCreatureSourceEffect(Token token, String theyAreStillType, Duration duration, boolean losePreviousTypes, boolean characterDefining, DynamicValue power, DynamicValue toughness) {
super(duration, Outcome.BecomeCreature);
this.characterDefining = characterDefining;
this.token = token;
this.type = type;
this.theyAreStillType = theyAreStillType;
this.losePreviousTypes = losePreviousTypes;
this.power = power;
this.toughness = toughness;
@ -69,7 +69,7 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
public BecomesCreatureSourceEffect(final BecomesCreatureSourceEffect effect) {
super(effect);
this.token = effect.token.copy();
this.type = effect.type;
this.theyAreStillType = effect.theyAreStillType;
this.losePreviousTypes = effect.losePreviousTypes;
if (effect.power != null) {
this.power = effect.power.copy();
@ -110,7 +110,7 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
for (CardType cardType : token.getCardType()) {
permanent.addCardType(cardType);
}
if (type != null && type.isEmpty() || type == null && permanent.isLand()) {
if (theyAreStillType != null && theyAreStillType.isEmpty() || theyAreStillType == null && permanent.isLand()) {
permanent.getSubtype(game).retainAll(SubType.getLandTypes(false));
}
if (!token.getSubtype(game).isEmpty()) {
@ -119,6 +119,7 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
permanent.setIsAllCreatureTypes(token.isAllCreatureTypes());
}
break;
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
if (token.getColor(game).hasColor()) {
@ -126,19 +127,20 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
}
}
break;
case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) {
for (Ability ability : token.getAbilities()) {
permanent.addAbility(ability, source.getSourceId(), game);
}
}
break;
case PTChangingEffects_7:
if ((sublayer == SubLayer.CharacteristicDefining_7a && isCharacterDefining())
|| (sublayer == SubLayer.SetPT_7b && !isCharacterDefining())) {
if (power != null) {
permanent.getPower().setValue(power.calculate(game, source, this));
permanent.getPower().setValue(power.calculate(game, source, this)); // check all other becomes to use calculate?
} else if (token.getPower() != null) {
permanent.getPower().setValue(token.getPower().getValue());
}
@ -148,11 +150,15 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
permanent.getToughness().setValue(token.getToughness().getValue());
}
}
break;
}
return true;
} else if (duration == Duration.Custom) {
this.discard();
}
return false;
}
@ -162,8 +168,8 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
}
private void setText() {
if (type != null && !type.isEmpty()) {
staticText = duration.toString() + " {this} becomes a " + token.getDescription() + " that's still a " + this.type;
if (theyAreStillType != null && !theyAreStillType.isEmpty()) {
staticText = duration.toString() + " {this} becomes a " + token.getDescription() + " that's still a " + this.theyAreStillType;
} else {
staticText = duration.toString() + " {this} becomes a " + token.getDescription();
}