* Fixed that lose all abilities dd not lose the colors of the target.

This commit is contained in:
LevelX2 2014-11-18 23:42:51 +01:00
parent ab06a356a5
commit 04648eb0eb
20 changed files with 73 additions and 52 deletions

View file

@ -58,7 +58,7 @@ public class Soilshaper extends CardImpl {
this.toughness = new MageInt(1);
// Whenever you cast a Spirit or Arcane spell, target land becomes a 3/3 creature until end of turn. It's still a land.
Ability ability = new SpellCastControllerTriggeredAbility(new BecomesCreatureTargetEffect(new SoilshaperToken(), "land", Duration.EndOfTurn), filter, false);
Ability ability = new SpellCastControllerTriggeredAbility(new BecomesCreatureTargetEffect(new SoilshaperToken(), false, true, Duration.EndOfTurn), filter, false);
ability.addTarget(new TargetLandPermanent());
this.addAbility(ability);
}

View file

@ -68,10 +68,7 @@ public class Dragonshift extends CardImpl {
this.color.setBlue(true);
// 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 LoseAllAbilitiesTargetEffect(Duration.EndOfTurn);
effect.setText("");
this.getSpellAbility().addEffect(effect);
effect = new BecomesCreatureTargetEffect(new DragonToken(), null, Duration.EndOfTurn);
Effect effect = new BecomesCreatureTargetEffect(new DragonToken(), 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.");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());

View file

@ -58,11 +58,8 @@ public class TurnBurn extends SplitCard {
// Turn
// Until end of turn, target creature loses all abilities and becomes a red Weird with base power and toughness 0/1.
getLeftHalfCard().getColor().setBlue(true);
Effect effect = new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn);
effect.setText("Until end of turn, target creature loses all abilities");
getLeftHalfCard().getSpellAbility().addEffect(effect);
effect = new BecomesCreatureTargetEffect(new WeirdToken(), null, Duration.EndOfTurn);
effect.setText("and becomes a red Weird with base power and toughness 0/1");
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");
getLeftHalfCard().getSpellAbility().addEffect(effect);
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -53,13 +53,9 @@ public class Snakeform extends CardImpl {
this.color.setBlue(true);
this.color.setGreen(true);
// Until end of turn, target creature loses all abilities
Effect effect = new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn);
effect.setText("Until end of turn, target creature loses all abilities");
this.getSpellAbility().addEffect(effect);
// and becomes a green Snake with base power and toughness 1/1.
effect = new BecomesCreatureTargetEffect(new SnakeToken(), null, Duration.EndOfTurn);
effect.setText("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.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().addTarget(new TargetCreaturePermanent());

View file

@ -53,7 +53,7 @@ public class Hydroform extends CardImpl {
this.color.setGreen(true);
// Target land becomes a 3/3 Elemental creature with flying until end of turn. It's still a land.
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new HydroformToken(), "land", Duration.EndOfTurn));
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new HydroformToken(), false, true, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetLandPermanent());
}

View file

@ -75,7 +75,7 @@ public class SkarrgGuildmage extends CardImpl {
Zone.BATTLEFIELD, new GainAbilityAllEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent(), "Creatures you control gain trample until end of turn"),
new ManaCostsImpl("{R}{G}")));
// {1}{R}{G}: Target land you control becomes a 4/4 Elemental creature until end of turn. It's still a land.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureTargetEffect(new SkarrgGuildmageToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{1}{R}{G}") );
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureTargetEffect(new SkarrgGuildmageToken(), false, true, Duration.EndOfTurn), new ManaCostsImpl("{1}{R}{G}") );
ability.addTarget(new TargetLandPermanent(filter));
this.addAbility(ability);

View file

@ -62,7 +62,7 @@ public class SiegeOfTowers extends CardImpl {
// Replicate {1}{R}
this.addAbility(new ReplicateAbility(this, "{1}{R}"));
// Target Mountain becomes a 3/1 creature. It's still a land.
Effect effect = new BecomesCreatureTargetEffect(new SiegeOfTowersToken(), "land", Duration.EndOfGame);
Effect effect = new BecomesCreatureTargetEffect(new SiegeOfTowersToken(), false, true, Duration.EndOfGame);
effect.setText("Target Mountain becomes a 3/1 creature. It's still a land");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetPermanent(filter));

View file

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

View file

@ -88,7 +88,7 @@ public class AwakenerDruid extends CardImpl {
class AwakenerDruidBecomesCreatureEffect extends BecomesCreatureTargetEffect {
public AwakenerDruidBecomesCreatureEffect() {
super(new AwakenerDruidToken(), "land", Duration.WhileOnBattlefield);
super(new AwakenerDruidToken(), false, true, Duration.WhileOnBattlefield);
}
public AwakenerDruidBecomesCreatureEffect(final AwakenerDruidBecomesCreatureEffect effect) {
@ -112,7 +112,7 @@ class AwakenerDruidBecomesCreatureEffect extends BecomesCreatureTargetEffect {
@Override
public String getText(Mode mode) {
return "target Forest becomes a 4/5 green Treefolk creature for as long as Awakener Druid remains on the battlefield. It's still a land";
return "target Forest becomes a 4/5 green Treefolk creature for as long as {this} remains on the battlefield. It's still a land";
}
}

View file

@ -51,11 +51,8 @@ public class TurnToFrog extends CardImpl {
this.color.setBlue(true);
// Until end of turn, target creature loses all abilities and becomes a blue Frog with base power and toughness 1/1.
Effect effect = new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn);
effect.setText("Until end of turn, target creature loses all abilities");
this.getSpellAbility().addEffect(effect);
effect = new BecomesCreatureTargetEffect(new FrogToken(), null, Duration.EndOfTurn);
effect.setText("and becomes a blue Frog with base power and toughness 1/1");
Effect effect = new BecomesCreatureTargetEffect(new FrogToken(), true, false, Duration.EndOfTurn);
effect.setText("Until end of turn, target creature loses all abilities and becomes a blue Frog with base power and toughness 1/1");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}

View file

@ -84,7 +84,7 @@ public class NissaWorldwaker extends CardImpl {
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
// +1: Target land you control becomes a 4/4 Elemental creature with trample. It's still a land.
LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureTargetEffect(new NissaWorldwakerToken(), "land", Duration.Custom), 1);
LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureTargetEffect(new NissaWorldwakerToken(), false, true, Duration.Custom), 1);
ability.addTarget(new TargetLandPermanent(filter));
this.addAbility(ability);
@ -136,7 +136,7 @@ class NissaWorldwakerSearchEffect extends OneShotEffect {
Card card = player.getLibrary().getCard(cardId, game);
if (card != null) {
if (player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId())) {
ContinuousEffect effect = new BecomesCreatureTargetEffect(new NissaWorldwakerToken(), "land", Duration.Custom);
ContinuousEffect effect = new BecomesCreatureTargetEffect(new NissaWorldwakerToken(), false, true, Duration.Custom);
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);
}

View file

@ -109,6 +109,11 @@ class PolymorphistsJestEffect extends ContinuousEffectImpl {
for(UUID uuid : objects){
Permanent permanent = game.getPermanent(uuid);
if (permanent != null){
permanent.getColor().setBlack(false);
permanent.getColor().setGreen(false);
permanent.getColor().setBlue(false);
permanent.getColor().setWhite(false);
permanent.getColor().setBlack(false);
permanent.getColor().setColor(ObjectColor.BLUE);
}
}

View file

@ -28,8 +28,6 @@
package mage.sets.mirrodin;
import java.util.UUID;
import mage.constants.*;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -39,6 +37,11 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continious.BecomesCreatureTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
import mage.target.common.TargetLandPermanent;
@ -51,10 +54,14 @@ public class LifesparkSpellbomb extends CardImpl {
public LifesparkSpellbomb(UUID ownerId) {
super(ownerId, 197, "Lifespark Spellbomb", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}");
this.expansionSetCode = "MRD";
Ability firstAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureTargetEffect(new LifesparkSpellbombToken(), "land", Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.G));
// {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 LifesparkSpellbombToken(), false, true, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.G));
firstAbility.addCost(new SacrificeSourceCost());
firstAbility.addTarget(new TargetLandPermanent());
this.addAbility(firstAbility);
// {1}, Sacrifice Lifespark Spellbomb: Draw a card.
Ability secondAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(1));
secondAbility.addCost(new SacrificeSourceCost());
this.addAbility(secondAbility);

View file

@ -63,7 +63,9 @@ public class FendeepSummoner extends CardImpl {
this.color.setBlack(true);
this.power = new MageInt(3);
this.toughness = new MageInt(5);
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureTargetEffect(new FendeepSummonerToken(), "land", Duration.EndOfTurn), new TapSourceCost());
// {T}: Up to two target Swamps each become 3/5 Treefolk Warrior creatures in addition to their other types until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureTargetEffect(new FendeepSummonerToken(), false, false, Duration.EndOfTurn), new TapSourceCost());
ability.addTarget(new TargetLandPermanent(0, 2, filter, false));
this.addAbility(ability);
}

View file

@ -62,7 +62,7 @@ public class KamahlFistOfKrosa extends CardImpl {
// {G}: Target land becomes a 1/1 creature until end of turn. It's still a land.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BecomesCreatureTargetEffect(new KamahlFistOfKrosaLandToken(), "land", Duration.EndOfTurn),
new BecomesCreatureTargetEffect(new KamahlFistOfKrosaLandToken(), false, true, Duration.EndOfTurn),
new ManaCostsImpl("{G}"));
ability.addTarget(new TargetLandPermanent());
this.addAbility(ability);

View file

@ -85,7 +85,7 @@ public class KothOfTheHammer extends CardImpl {
// +1: Untap target Mountain. It becomes a 4/4 red Elemental creature until end of turn. It's still a land.
Ability ability = new LoyaltyAbility(new UntapTargetEffect(), 1);
ability.addEffect(new BecomesCreatureTargetEffect(new KothOfTheHammerToken(), "land", Duration.EndOfTurn));
ability.addEffect(new BecomesCreatureTargetEffect(new KothOfTheHammerToken(), false, true, Duration.EndOfTurn));
ability.addTarget(new TargetLandPermanent(filter));
this.addAbility(ability);

View file

@ -58,7 +58,7 @@ public class AnthousaSetessanHero extends CardImpl {
this.toughness = new MageInt(5);
// <i>Heroic</i> - 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 AnthousaWarriorToken(), "lands", Duration.EndOfTurn));
Ability ability = new HeroicAbility(new BecomesCreatureTargetEffect(new AnthousaWarriorToken(), false, true, Duration.EndOfTurn));
ability.addTarget(new TargetControlledPermanent(0,3,new FilterLandPermanent("lands"), false));
this.addAbility(ability);
}

View file

@ -110,7 +110,7 @@ class VastwoodAnimistEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int amount = new PermanentsOnBattlefieldCount(filterAllies).calculate(game, source, this);
ContinuousEffect effect = new BecomesCreatureTargetEffect(new VastwoodAnimistElementalToken(amount), "land", Duration.EndOfTurn);
ContinuousEffect effect = new BecomesCreatureTargetEffect(new VastwoodAnimistElementalToken(amount), false, true, Duration.EndOfTurn);
effect.setTargetPointer(targetPointer);
game.addEffect(effect, source);
return false;

View file

@ -48,24 +48,28 @@ import mage.util.CardUtil;
public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
protected Token token;
protected String type;
protected boolean loseAllAbilities;
protected boolean addStillALandText;
/**
*
* @param token
* @param type
* @param loseAllAbilities loses all subtypes and colors
* @param stillALand add rule text, "it's still a land"
* @param duration
*/
public BecomesCreatureTargetEffect(Token token, String type, Duration duration) {
public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration) {
super(duration, Outcome.BecomeCreature);
this.token = token;
this.type = type;
this.loseAllAbilities = loseAllAbilities;
this.addStillALandText = stillALand;
}
public BecomesCreatureTargetEffect(final BecomesCreatureTargetEffect effect) {
super(effect);
token = effect.token.copy();
type = effect.type;
this.loseAllAbilities = effect.loseAllAbilities;
this.addStillALandText = effect.addStillALandText;
}
@Override
@ -82,10 +86,9 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
if (type == null) {
if (loseAllAbilities) {
permanent.getSubtype().clear();
permanent.getSubtype().addAll(token.getSubtype());
permanent.getCardType().clear();
} else {
if (token.getSubtype().size() > 0) {
for (String subtype :token.getSubtype()) {
@ -107,12 +110,22 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
break;
case ColorChangingEffects_5:
if (sublayer == SubLayer.NA) {
if (loseAllAbilities) {
permanent.getColor().setBlack(false);
permanent.getColor().setGreen(false);
permanent.getColor().setBlue(false);
permanent.getColor().setWhite(false);
permanent.getColor().setBlack(false);
}
if (token.getColor().hasColor()) {
permanent.getColor().setColor(token.getColor());
}
}
break;
case AbilityAddingRemovingEffects_6:
if (loseAllAbilities) {
permanent.removeAllAbilities(source.getSourceId(), game);
}
if (sublayer == SubLayer.NA) {
if (token.getAbilities().size() > 0) {
for (Ability ability : token.getAbilities()) {
@ -155,19 +168,27 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
Target target = mode.getTargets().get(0);
if(target.getMaxNumberOfTargets() > 1){
if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) {
sb.append("Up to ");
sb.append("up to ");
}
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()).append(" each become ");
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName());
if (loseAllAbilities) {
sb.append(" lose all their abilities and ");
}
sb.append(" each become ");
} else {
sb.append("Target ").append(target.getTargetName()).append(" becomes a ");
sb.append("target ").append(target.getTargetName());
if (loseAllAbilities) {
sb.append(" loses all abilities and ");
}
sb.append(" becomes a ");
}
sb.append(token.getDescription());
sb.append(" ").append(duration.toString());
if (type != null && type.length() > 0) {
if (addStillALandText) {
if (target.getMaxNumberOfTargets() > 1) {
sb.append(". They're still ").append(type);
sb.append(". They're still lands");
} else {
sb.append(". It's still a ").append(type);
sb.append(". It's still a land");
}
}
return sb.toString();

View file

@ -30,7 +30,6 @@ package mage.game.permanent.token;
import mage.constants.CardType;
import mage.MageInt;
import mage.ObjectColor;
/**
*