Merge origin/master

This commit is contained in:
LevelX2 2018-05-11 00:52:28 +02:00
commit fe32fc7cc3
15 changed files with 110 additions and 131 deletions

View file

@ -45,6 +45,7 @@ import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -69,9 +70,12 @@ public class AmbushCommander extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Forests you control are 1/1 green Elf creatures that are still lands. // Forests you control are 1/1 green Elf creatures that are still lands.
ContinuousEffect effect = new BecomesCreatureAllEffect(new AmbushCommanderToken(), "lands", filter2, Duration.WhileOnBattlefield); ContinuousEffect effect = new BecomesCreatureAllEffect(
new CreatureToken(1, 1, "1/1 green Elf creature").withColor("G").withSubType(SubType.ELF),
"lands", filter2, Duration.WhileOnBattlefield, true);
effect.getDependencyTypes().add(DependencyType.BecomeForest); effect.getDependencyTypes().add(DependencyType.BecomeForest);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
// {1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn. // {1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(3, 3, Duration.EndOfTurn), Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(3, 3, Duration.EndOfTurn),
new ManaCostsImpl("{1}{G}")); new ManaCostsImpl("{1}{G}"));
@ -89,23 +93,3 @@ public class AmbushCommander extends CardImpl {
return new AmbushCommander(this); return new AmbushCommander(this);
} }
} }
class AmbushCommanderToken extends TokenImpl {
public AmbushCommanderToken() {
super("Elf", "1/1 green Elf creatures");
subtype.add(SubType.ELF);
cardType.add(CardType.CREATURE);
power = new MageInt(1);
toughness = new MageInt(1);
color.setGreen(true);
}
public AmbushCommanderToken(final AmbushCommanderToken token) {
super(token);
}
public AmbushCommanderToken copy() {
return new AmbushCommanderToken(this);
}
}

View file

@ -48,6 +48,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
/** /**
@ -64,16 +65,25 @@ public class Dragonshift extends CardImpl {
public Dragonshift(UUID ownerId, CardSetInfo setInfo) { public Dragonshift(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}{R}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}{R}");
// 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. // 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 effect = new BecomesCreatureTargetEffect(new DragonToken(), true, false, Duration.EndOfTurn); Effect effect = new BecomesCreatureTargetEffect(
new CreatureToken(4, 4, "blue and red Dragon with base power and toughness 4/4")
.withSubType(SubType.DRAGON)
.withColor("UR")
.withAbility(FlyingAbility.getInstance()),
true, false, Duration.EndOfTurn);
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());
// Overload {3}{U}{U}{R}{R} // Overload {3}{U}{U}{R}{R}
Ability ability = new OverloadAbility(this, new LoseAllAbilitiesAllEffect(new FilterControlledCreaturePermanent(""), Duration.EndOfTurn), new ManaCostsImpl("{3}{U}{U}{R}{R}")); Ability ability = new OverloadAbility(this, new LoseAllAbilitiesAllEffect(new FilterControlledCreaturePermanent(""), Duration.EndOfTurn), new ManaCostsImpl("{3}{U}{U}{R}{R}"));
ability.addEffect(new BecomesCreatureAllEffect(new DragonToken(), null, filter, Duration.EndOfTurn)); ability.addEffect(new BecomesCreatureAllEffect(
new CreatureToken(4, 4, "blue and red Dragon with base power and toughness 4/4 and with flying")
.withColor("UR")
.withSubType(SubType.DRAGON)
.withAbility(FlyingAbility.getInstance()),
null, filter, Duration.EndOfTurn, true));
this.addAbility(ability); this.addAbility(ability);
} }
@ -85,26 +95,4 @@ public class Dragonshift extends CardImpl {
public Dragonshift copy() { public Dragonshift copy() {
return new Dragonshift(this); return new Dragonshift(this);
} }
private class DragonToken extends TokenImpl {
public DragonToken() {
super("Dragon", "blue and red Dragon with base power and toughness 4/4 and with flying");
cardType.add(CardType.CREATURE);
color.setBlue(true);
color.setRed(true);
subtype.add(SubType.DRAGON);
power = new MageInt(4);
toughness = new MageInt(4);
this.addAbility(FlyingAbility.getInstance());
}
public DragonToken(final DragonToken token) {
super(token);
}
public DragonToken copy() {
return new DragonToken(this);
}
}
} }

View file

@ -105,7 +105,7 @@ class JolraelEmpressOfBeastsEffect extends OneShotEffect {
if (targetPlayer != null) { if (targetPlayer != null) {
FilterPermanent filter = new FilterLandPermanent(); FilterPermanent filter = new FilterLandPermanent();
filter.add(new ControllerIdPredicate(targetPlayer.getId())); filter.add(new ControllerIdPredicate(targetPlayer.getId()));
game.addEffect(new BecomesCreatureAllEffect(new CreatureToken(3, 3), "lands", filter, Duration.EndOfTurn), source); game.addEffect(new BecomesCreatureAllEffect(new CreatureToken(3, 3), "lands", filter, Duration.EndOfTurn, false), source);
return true; return true;
} }
return false; return false;

View file

@ -38,6 +38,7 @@ import mage.constants.*;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/** /**
* *
@ -50,7 +51,9 @@ public class KormusBell extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
// All Swamps are 1/1 black creatures that are still lands. // All Swamps are 1/1 black creatures that are still lands.
ContinuousEffect effect = new BecomesCreatureAllEffect(new KormusBellToken(), "lands", new FilterPermanent(SubType.SWAMP, "Swamps"), Duration.WhileOnBattlefield); ContinuousEffect effect = new BecomesCreatureAllEffect(
new CreatureToken(1, 1, "1/1 black creature").withColor("B"),
"lands", new FilterPermanent(SubType.SWAMP, "Swamps"), Duration.WhileOnBattlefield, true);
effect.setDependedToType(DependencyType.BecomeSwamp); effect.setDependedToType(DependencyType.BecomeSwamp);
effect.addDependedToType(DependencyType.BecomeIsland); effect.addDependedToType(DependencyType.BecomeIsland);
effect.addDependedToType(DependencyType.BecomeMountain); effect.addDependedToType(DependencyType.BecomeMountain);
@ -66,21 +69,3 @@ public class KormusBell extends CardImpl {
return new KormusBell(this); return new KormusBell(this);
} }
} }
class KormusBellToken extends TokenImpl {
public KormusBellToken() {
super("", "1/1 black creatures");
cardType.add(CardType.CREATURE);
power = new MageInt(1);
toughness = new MageInt(1);
color.setBlack(true); // black creatures
}
public KormusBellToken(final KormusBellToken token) {
super(token);
}
public KormusBellToken copy() {
return new KormusBellToken(this);
}
}

View file

@ -61,8 +61,9 @@ public class LifeDeath extends SplitCard {
// Life // Life
// All lands you control become 1/1 creatures until end of turn. They're still lands. // All lands you control become 1/1 creatures until end of turn. They're still lands.
getLeftHalfCard().getSpellAbility().addEffect(new BecomesCreatureAllEffect(new CreatureToken(1, 1), "lands", getLeftHalfCard().getSpellAbility().addEffect(new BecomesCreatureAllEffect(
new FilterControlledLandPermanent("lands you control"), Duration.EndOfTurn)); new CreatureToken(1, 1),
"lands", new FilterControlledLandPermanent("lands you control"), Duration.EndOfTurn, false));
// Death // Death
// Return target creature card from your graveyard to the battlefield. You lose life equal to its converted mana cost. // Return target creature card from your graveyard to the battlefield. You lose life equal to its converted mana cost.

View file

@ -58,7 +58,9 @@ public class LivingLands extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}");
// All Forests are 1/1 creatures that are still lands. // All Forests are 1/1 creatures that are still lands.
ContinuousEffect effect = new BecomesCreatureAllEffect(new CreatureToken(1, 1), "lands", filter, Duration.WhileOnBattlefield); ContinuousEffect effect = new BecomesCreatureAllEffect(
new CreatureToken(1, 1),
"lands", filter, Duration.WhileOnBattlefield, false);
effect.getDependencyTypes().add(DependencyType.BecomeForest); effect.getDependencyTypes().add(DependencyType.BecomeForest);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
} }

View file

@ -53,7 +53,9 @@ public class LivingPlane extends CardImpl {
this.addSuperType(SuperType.WORLD); this.addSuperType(SuperType.WORLD);
// All lands are 1/1 creatures that are still lands. // All lands are 1/1 creatures that are still lands.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new CreatureToken(1, 1), "lands", StaticFilters.FILTER_LANDS, Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(
new CreatureToken(1, 1),
"lands", StaticFilters.FILTER_LANDS, Duration.WhileOnBattlefield, false)));
} }
public LivingPlane(final LivingPlane card) { public LivingPlane(final LivingPlane card) {

View file

@ -53,7 +53,9 @@ public class NaturalAffinity extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}");
// All lands become 2/2 creatures until end of turn. They're still lands. // All lands become 2/2 creatures until end of turn. They're still lands.
this.getSpellAbility().addEffect(new BecomesCreatureAllEffect(new CreatureToken(2, 2), "lands", StaticFilters.FILTER_LANDS, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new BecomesCreatureAllEffect(
new CreatureToken(2, 2),
"lands", StaticFilters.FILTER_LANDS, Duration.EndOfTurn, false));
} }
public NaturalAffinity(final NaturalAffinity card) { public NaturalAffinity(final NaturalAffinity card) {

View file

@ -47,6 +47,7 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/** /**
* *
@ -68,9 +69,11 @@ public class NaturalEmergence extends CardImpl {
Effect effect = new ReturnToHandChosenControlledPermanentEffect(filter); Effect effect = new ReturnToHandChosenControlledPermanentEffect(filter);
effect.setText("return a red or green enchantment you control to its owner's hand"); effect.setText("return a red or green enchantment you control to its owner's hand");
this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false));
// Lands you control are 2/2 creatures with first strike. They're still lands. // Lands you control are 2/2 creatures with first strike. They're still lands.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new NaturalEmergenceToken(), this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(
"lands", new FilterControlledLandPermanent("lands you control"), Duration.WhileOnBattlefield))); new CreatureToken(2, 2, "2/2 creatures with first strike").withAbility(FirstStrikeAbility.getInstance()),
"lands", new FilterControlledLandPermanent("lands you control"), Duration.WhileOnBattlefield, false)));
} }
public NaturalEmergence(final NaturalEmergence card) { public NaturalEmergence(final NaturalEmergence card) {
@ -82,21 +85,3 @@ public class NaturalEmergence extends CardImpl {
return new NaturalEmergence(this); return new NaturalEmergence(this);
} }
} }
class NaturalEmergenceToken extends TokenImpl {
public NaturalEmergenceToken() {
super("Land", "2/2 creatures with first strike");
cardType.add(CardType.CREATURE);
power = new MageInt(2);
toughness = new MageInt(2);
this.addAbility(FirstStrikeAbility.getInstance());
}
public NaturalEmergenceToken(final NaturalEmergenceToken token) {
super(token);
}
public NaturalEmergenceToken copy() {
return new NaturalEmergenceToken(this);
}
}

View file

@ -52,8 +52,9 @@ public class NaturesRevolt extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}");
// All lands are 2/2 creatures that are still lands. // All lands are 2/2 creatures that are still lands.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new CreatureToken(2, 2), this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(
"lands", new FilterLandPermanent(), Duration.WhileOnBattlefield))); new CreatureToken(2, 2),
"lands", new FilterLandPermanent(), Duration.WhileOnBattlefield, false)));
} }
public NaturesRevolt(final NaturesRevolt card) { public NaturesRevolt(final NaturesRevolt card) {

View file

@ -58,7 +58,9 @@ public class RudeAwakening extends CardImpl {
this.getSpellAbility().addEffect(new UntapAllLandsControllerEffect()); this.getSpellAbility().addEffect(new UntapAllLandsControllerEffect());
// or until end of turn, lands you control become 2/2 creatures that are still lands. // or until end of turn, lands you control become 2/2 creatures that are still lands.
Mode mode = new Mode(); Mode mode = new Mode();
mode.getEffects().add(new BecomesCreatureAllEffect(new CreatureToken(2, 2), "lands", new FilterControlledLandPermanent("lands you control"), Duration.EndOfTurn)); mode.getEffects().add(new BecomesCreatureAllEffect(
new CreatureToken(2, 2),
"lands", new FilterControlledLandPermanent("lands you control"), Duration.EndOfTurn, false));
this.getSpellAbility().getModes().addMode(mode); this.getSpellAbility().getModes().addMode(mode);
// Entwine {2}{G} // Entwine {2}{G}

View file

@ -40,6 +40,7 @@ import mage.constants.Duration;
import mage.constants.SubType; import mage.constants.SubType;
import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledLandPermanent;
import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.custom.CreatureToken;
/** /**
* *
@ -52,10 +53,15 @@ public class SylvanAwakening extends CardImpl {
// Until your next turn, all lands you control become 2/2 Elemental creatures with reach, indestructible, and haste. They're still lands. // Until your next turn, all lands you control become 2/2 Elemental creatures with reach, indestructible, and haste. They're still lands.
this.getSpellAbility().addEffect(new BecomesCreatureAllEffect( this.getSpellAbility().addEffect(new BecomesCreatureAllEffect(
new SylvanAwakeningToken(), new CreatureToken(2, 2, "2/2 Elemental creatures with reach, indestructible, and haste")
.withSubType(SubType.ELEMENTAL)
.withAbility(ReachAbility.getInstance())
.withAbility(IndestructibleAbility.getInstance())
.withAbility(HasteAbility.getInstance()),
"lands", "lands",
new FilterControlledLandPermanent("all lands you control"), new FilterControlledLandPermanent("all lands you control"),
Duration.UntilYourNextTurn) Duration.UntilYourNextTurn,
false)
); );
} }
@ -68,26 +74,3 @@ public class SylvanAwakening extends CardImpl {
return new SylvanAwakening(this); return new SylvanAwakening(this);
} }
} }
class SylvanAwakeningToken extends TokenImpl {
public SylvanAwakeningToken() {
super("", "2/2 Elemental creatures with reach, indestructible, and haste");
cardType.add(CardType.CREATURE);
this.subtype.add(SubType.ELEMENTAL);
power = new MageInt(2);
toughness = new MageInt(2);
this.addAbility(ReachAbility.getInstance());
this.addAbility(IndestructibleAbility.getInstance());
this.addAbility(HasteAbility.getInstance());
}
public SylvanAwakeningToken(final SylvanAwakeningToken token) {
super(token);
}
public SylvanAwakeningToken copy() {
return new SylvanAwakeningToken(this);
}
}

View file

@ -68,7 +68,9 @@ public class TheloniteDruid extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {1}{G}, {tap}, Sacrifice a creature: Forests you control become 2/3 creatures until end of turn. They're still lands. // {1}{G}, {tap}, Sacrifice a creature: Forests you control become 2/3 creatures until end of turn. They're still lands.
ContinuousEffect effect = new BecomesCreatureAllEffect(new CreatureToken(2, 3), "Forests", filter, Duration.EndOfTurn); ContinuousEffect effect = new BecomesCreatureAllEffect(
new CreatureToken(2, 3),
"Forests", filter, Duration.EndOfTurn, false);
effect.getDependencyTypes().add(DependencyType.BecomeForest); effect.getDependencyTypes().add(DependencyType.BecomeForest);
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
effect, effect,

View file

@ -52,21 +52,24 @@ import java.util.Set;
public class BecomesCreatureAllEffect extends ContinuousEffectImpl { public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
protected Token token; protected Token token;
protected String type; protected String theyAreStillType;
private final FilterPermanent filter; private final FilterPermanent filter;
private boolean loseColor = true;
public BecomesCreatureAllEffect(Token token, String type, FilterPermanent filter, Duration duration) { public BecomesCreatureAllEffect(Token token, String theyAreStillType, FilterPermanent filter, Duration duration, boolean loseColor) {
super(duration, Outcome.BecomeCreature); super(duration, Outcome.BecomeCreature);
this.token = token; this.token = token;
this.type = type; this.theyAreStillType = theyAreStillType;
this.filter = filter; this.filter = filter;
this.loseColor = loseColor;
} }
public BecomesCreatureAllEffect(final BecomesCreatureAllEffect effect) { public BecomesCreatureAllEffect(final BecomesCreatureAllEffect effect) {
super(effect); super(effect);
token = effect.token.copy(); this.token = effect.token.copy();
type = effect.type; this.theyAreStillType = effect.theyAreStillType;
this.filter = effect.filter.copy(); this.filter = effect.filter.copy();
this.loseColor = effect.loseColor;
} }
@Override @Override
@ -94,6 +97,7 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
} else { } else {
affectedPermanents = new HashSet<>(game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)); affectedPermanents = new HashSet<>(game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game));
} }
for(Permanent permanent : affectedPermanents) { for(Permanent permanent : affectedPermanents) {
if (permanent != null) { if (permanent != null) {
switch (layer) { switch (layer) {
@ -106,7 +110,7 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
} }
} }
} }
if (type == null) { if (theyAreStillType == null) {
permanent.getSubtype(game).clear(); permanent.getSubtype(game).clear();
} }
if (!token.getSubtype(game).isEmpty()) { if (!token.getSubtype(game).isEmpty()) {
@ -114,13 +118,22 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
} }
} }
break; break;
case ColorChangingEffects_5: case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) { if (sublayer == SubLayer.NA) {
if (this.loseColor) {
permanent.getColor(game).setBlack(false);
permanent.getColor(game).setGreen(false);
permanent.getColor(game).setBlue(false);
permanent.getColor(game).setWhite(false);
permanent.getColor(game).setRed(false);
}
if (token.getColor(game).hasColor()) { if (token.getColor(game).hasColor()) {
permanent.getColor(game).setColor(token.getColor(game)); permanent.getColor(game).addColor(token.getColor(game));
} }
} }
break; break;
case AbilityAddingRemovingEffects_6: case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) { if (sublayer == SubLayer.NA) {
if (!token.getAbilities().isEmpty()) { if (!token.getAbilities().isEmpty()) {
@ -130,6 +143,7 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
} }
} }
break; break;
case PTChangingEffects_7: case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) { if (sublayer == SubLayer.SetPT_7b) {
int power = token.getPower().getValue(); int power = token.getPower().getValue();
@ -139,6 +153,7 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
permanent.getToughness().setValue(toughness); permanent.getToughness().setValue(toughness);
} }
} }
break;
} }
} }
} }
@ -168,8 +183,8 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
sb.append(" become "); sb.append(" become ");
} }
sb.append(token.getDescription()); sb.append(token.getDescription());
if (type != null && !type.isEmpty()) { if (theyAreStillType != null && !theyAreStillType.isEmpty()) {
sb.append(". They're still ").append(type); sb.append(". They're still ").append(theyAreStillType);
} }
return sb.toString(); return sb.toString();
} }

View file

@ -1,6 +1,8 @@
package mage.game.permanent.token.custom; package mage.game.permanent.token.custom;
import mage.MageInt; import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.TokenImpl;
@ -39,6 +41,31 @@ public class CreatureToken extends TokenImpl {
} }
} }
public CreatureToken withAbility(Ability ability) {
this.addAbility(ability);
return this;
}
public CreatureToken withColor(String extraColors) {
ObjectColor extraColorsList = new ObjectColor(extraColors);
this.getColor(null).addColor(extraColorsList);
return this;
}
public CreatureToken withType(CardType extraType) {
if (!this.cardType.contains(extraType)) {
this.cardType.add(extraType);
}
return this;
}
public CreatureToken withSubType(SubType extraSubType) {
if (!this.subtype.contains(extraSubType)) {
this.subtype.add(extraSubType);
}
return this;
}
public CreatureToken(final CreatureToken token) { public CreatureToken(final CreatureToken token) {
super(token); super(token);
} }