First set of cards updated to simplifed token creation and exile at end step

This commit is contained in:
drmDev 2017-03-20 21:30:48 -04:00
parent 696272b328
commit a8f42de901
5 changed files with 23 additions and 89 deletions

View file

@ -32,11 +32,10 @@ import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
@ -51,7 +50,6 @@ import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/** /**
* *
@ -73,7 +71,6 @@ public class ElementalMastery extends CardImpl {
// Enchanted creature has "{tap}: create X 1/1 red Elemental creature tokens with haste, where X is this creature's power. Exile them at the beginning of the next end step." // Enchanted creature has "{tap}: create X 1/1 red Elemental creature tokens with haste, where X is this creature's power. Exile them at the beginning of the next end step."
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ElementalMasteryEffect(), new TapSourceCost()); Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ElementalMasteryEffect(), new TapSourceCost());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability2, AttachmentType.AURA))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability2, AttachmentType.AURA)));
} }
public ElementalMastery(final ElementalMastery card) { public ElementalMastery(final ElementalMastery card) {
@ -108,18 +105,11 @@ class ElementalMasteryEffect extends OneShotEffect {
if (creatureAttached != null) { if (creatureAttached != null) {
int power = creatureAttached.getPower().getValue(); int power = creatureAttached.getPower().getValue();
if (power > 0) { if (power > 0) {
ElementalToken token = new ElementalToken(); CreateTokenEffect effect = new CreateTokenEffect(new ElementalToken(), power);
token.putOntoBattlefield(power, game, creatureAttached.getId(), creatureAttached.getControllerId()); effect.apply(game, source);
for (UUID tokenId : token.getLastAddedTokenIds()) { effect.exileTokensCreatedAtNextEndStep(game, source);
Permanent tokenPermanent = game.getPermanent(tokenId); return true;
if (tokenPermanent != null) {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
}
}
} }
return true;
} }
return false; return false;
} }

View file

@ -28,23 +28,16 @@
package mage.cards.f; package mage.cards.f;
import java.util.UUID; import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.token.ElementalToken;
import mage.game.permanent.token.Token;
import mage.players.Player; import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/** /**
* *
@ -90,33 +83,12 @@ class FeralLightningEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
CreateTokenEffect effect = new CreateTokenEffect(new FeralLightningElementalToken(), 3); CreateTokenEffect effect = new CreateTokenEffect(new ElementalToken("CON", 1, true), 3);
effect.apply(game, source); effect.apply(game, source);
for (UUID tokenId : effect.getLastAddedTokenIds()) { effect.exileTokensCreatedAtNextEndStep(game, source);
Permanent tokenPermanent = game.getPermanent(tokenId);
if (tokenPermanent != null) {
ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD);
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
}
}
return true; return true;
} }
return false; return false;
} }
} }
class FeralLightningElementalToken extends Token {
public FeralLightningElementalToken() {
super("Elemental", "3/1 red Elemental creature tokens with haste");
cardType.add(CardType.CREATURE);
color.setRed(true);
subtype.add("Elemental");
power = new MageInt(3);
toughness = new MageInt(1);
this.addAbility(HasteAbility.getInstance());
}
}

View file

@ -30,9 +30,8 @@ package mage.cards.g;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.ConspireAbility; import mage.abilities.keyword.ConspireAbility;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -40,9 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.targetpointer.FixedTarget;
/** /**
* *
@ -89,16 +86,10 @@ class GiantbaitingEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Token token = new GiantWarriorToken(); CreateTokenEffect effect = new CreateTokenEffect(new GiantWarriorToken());
if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { if(effect.apply(game, source))
for (UUID tokenId : token.getLastAddedTokenIds()) { {
Permanent tokenPermanent = game.getPermanent(tokenId); effect.exileTokensCreatedAtNextEndStep(game, source);
if (tokenPermanent != null) {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
}
}
return true; return true;
} }
return false; return false;

View file

@ -31,11 +31,10 @@ import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -45,10 +44,8 @@ import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/** /**
* *
@ -103,16 +100,10 @@ class RakdosGuildmageEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Token token = new RakdosGuildmageGoblinToken(); CreateTokenEffect effect = new CreateTokenEffect(new RakdosGuildmageGoblinToken());
if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { if (effect.apply(game, source))
for (UUID tokenId : token.getLastAddedTokenIds()) { {
Permanent tokenPermanent = game.getPermanent(tokenId); effect.exileTokensCreatedAtNextEndStep(game, source);
if (tokenPermanent != null) {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
}
}
return true; return true;
} }
return false; return false;

View file

@ -30,9 +30,8 @@ package mage.cards.t;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.DefenderAbility; import mage.abilities.keyword.DefenderAbility;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ReplicateAbility; import mage.abilities.keyword.ReplicateAbility;
@ -41,9 +40,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.target.targetpointer.FixedTarget;
/** /**
* *
@ -88,16 +85,9 @@ class ThunderheadsEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Token token = new WeirdToken(); CreateTokenEffect effect = new CreateTokenEffect(new WeirdToken());
if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { if (effect.apply(game, source)) {
for (UUID tokenId : token.getLastAddedTokenIds()) { effect.exileTokensCreatedAtNextEndStep(game, source);
Permanent tokenPermanent = game.getPermanent(tokenId);
if (tokenPermanent != null) {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
}
}
return true; return true;
} }
return false; return false;