[refactoring] Added AsEnteresBattlefieldAbility

This commit is contained in:
North 2012-07-18 01:47:39 +03:00
parent 3eac7cbd42
commit 8ef941abf0
24 changed files with 120 additions and 80 deletions

View file

@ -34,7 +34,7 @@ import mage.Constants.Rarity;
import mage.MageObject;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
@ -63,14 +63,14 @@ import java.util.UUID;
*/
public class CavernOfSouls extends CardImpl<CavernOfSouls> {
private static final String ruleText = "As Cavern of Souls enters the battlefield, choose a creature type";
private static final String ruleText = "choose a creature type";
public CavernOfSouls(UUID ownerId) {
super(ownerId, 226, "Cavern of Souls", Rarity.RARE, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "AVR";
// As Cavern of Souls enters the battlefield, choose a creature type.
this.addAbility(new EntersBattlefieldAbility(new CavernOfSoulsEffect(), ruleText));
this.addAbility(new AsEntersBattlefieldAbility(new CavernOfSoulsEffect(), ruleText));
// {tap}: Add {1} to your mana pool.
this.addAbility(new ColorlessManaAbility());

View file

@ -32,7 +32,7 @@ import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
@ -69,7 +69,7 @@ public class RidersOfGavony extends CardImpl<RidersOfGavony> {
this.addAbility(VigilanceAbility.getInstance());
// As Riders of Gavony enters the battlefield, choose a creature type.
this.addAbility(new EntersBattlefieldAbility(new RidersOfGavonyEffect()));
this.addAbility(new AsEntersBattlefieldAbility(new RidersOfGavonyEffect()));
// Human creatures you control have protection from creatures of the chosen type.
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new RidersOfGavonyGainAbilityControlledEffect()));
@ -89,7 +89,7 @@ class RidersOfGavonyEffect extends OneShotEffect<RidersOfGavonyEffect> {
public RidersOfGavonyEffect() {
super(Constants.Outcome.BoostCreature);
staticText = "As {this} enters the battlefield, choose a creature type";
staticText = "choose a creature type";
}
public RidersOfGavonyEffect(final RidersOfGavonyEffect effect) {

View file

@ -31,7 +31,7 @@ package mage.sets.dissension;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.BlackManaAbility;
@ -51,7 +51,7 @@ public class BloodCrypt extends CardImpl<BloodCrypt> {
this.subtype.add("Mountain");
this.addAbility(new BlackManaAbility());
this.addAbility(new RedManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As {this} enters the battlefield, you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
}
public BloodCrypt (final BloodCrypt card) {

View file

@ -31,7 +31,7 @@ package mage.sets.dissension;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.BlueManaAbility;
@ -51,7 +51,7 @@ public class BreedingPool extends CardImpl<BreedingPool> {
this.subtype.add("Island");
this.addAbility(new GreenManaAbility());
this.addAbility(new BlueManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As Breeding Pool enters the battlefield, you may pay 2 life. If you don't, Breeding Pool enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, Breeding Pool enters the battlefield tapped"));
}
public BreedingPool (final BreedingPool card) {

View file

@ -31,7 +31,7 @@ package mage.sets.dissension;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.BlueManaAbility;
@ -51,7 +51,7 @@ public class HallowedFountain extends CardImpl<HallowedFountain> {
this.subtype.add("Island");
this.addAbility(new WhiteManaAbility());
this.addAbility(new BlueManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As Hallowed Fountain enters the battlefield, you may pay 2 life. If you don't, Hallowed Fountain enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, Hallowed Fountain enters the battlefield tapped"));
}
public HallowedFountain (final HallowedFountain card) {

View file

@ -31,7 +31,7 @@ package mage.sets.guildpact;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.BlackManaAbility;
@ -51,7 +51,7 @@ public class GodlessShrine extends CardImpl<GodlessShrine> {
this.subtype.add("Swamp");
this.addAbility(new WhiteManaAbility());
this.addAbility(new BlackManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As Godless Shrine enters the battlefield, you may pay 2 life. If you don't, Godless Shrine enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, Godless Shrine enters the battlefield tapped"));
}
public GodlessShrine (final GodlessShrine card) {

View file

@ -31,7 +31,7 @@ package mage.sets.guildpact;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.BlueManaAbility;
@ -51,7 +51,7 @@ public class SteamVents extends CardImpl<SteamVents> {
this.subtype.add("Mountain");
this.addAbility(new BlueManaAbility());
this.addAbility(new RedManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As Steam Vents enters the battlefield, you may pay 2 life. If you don't, Steam Vents enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, Steam Vents enters the battlefield tapped"));
}
public SteamVents (final SteamVents card) {

View file

@ -31,7 +31,7 @@ package mage.sets.guildpact;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.GreenManaAbility;
@ -51,7 +51,7 @@ public class StompingGround extends CardImpl<StompingGround> {
this.subtype.add("Forest");
this.addAbility(new RedManaAbility());
this.addAbility(new GreenManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As Stomping Ground enters the battlefield, you may pay 2 life. If you don't, Stomping Ground enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, Stomping Ground enters the battlefield tapped"));
}
public StompingGround (final StompingGround card) {

View file

@ -35,7 +35,7 @@ import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
@ -60,7 +60,7 @@ public class Nevermore extends CardImpl<Nevermore> {
this.color.setWhite(true);
//As Nevermore enters the battlefield, name a nonland card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new NevermoreEffect1()));
this.addAbility(new AsEntersBattlefieldAbility(new NevermoreEffect1()));
//The named card can't be cast.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NevermoreEffect2()));

View file

@ -37,7 +37,7 @@ import mage.Constants.Rarity;
import mage.Constants.SubLayer;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
@ -74,7 +74,7 @@ public class ConvincingMirage extends CardImpl<ConvincingMirage> {
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
// As Convincing Mirage enters the battlefield, choose a basic land type.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ConvincingMirageEffect(), false));
this.addAbility(new AsEntersBattlefieldAbility(new ConvincingMirageEffect()));
// Enchanted land is the chosen type.
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);

View file

@ -36,7 +36,7 @@ import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.StateTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
@ -64,7 +64,7 @@ public class PhylacteryLich extends CardImpl<PhylacteryLich> {
this.power = new MageInt(5);
this.toughness = new MageInt(5);
this.addAbility(new EntersBattlefieldAbility(new PhylacteryLichEffect(), "put a phylactery counter on an artifact you control"));
this.addAbility(new AsEntersBattlefieldAbility(new PhylacteryLichEffect(), "put a phylactery counter on an artifact you control"));
this.addAbility(IndestructibleAbility.getInstance());
this.addAbility(new PhylacteryLichAbility());
}

View file

@ -33,7 +33,7 @@ import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
@ -62,7 +62,7 @@ public class AdaptiveAutomaton extends CardImpl<AdaptiveAutomaton> {
this.toughness = new MageInt(2);
// As Adaptive Automaton enters the battlefield, choose a creature type.
this.addAbility(new EntersBattlefieldAbility(new AdaptiveAutomatonEffect()));
this.addAbility(new AsEntersBattlefieldAbility(new AdaptiveAutomatonEffect()));
// Adaptive Automaton is the chosen type in addition to its other types.
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new AdaptiveAutomatonAddSubtypeEffect()));
// Other creatures you control of the chosen type get +1/+1.
@ -83,7 +83,7 @@ class AdaptiveAutomatonEffect extends OneShotEffect<AdaptiveAutomatonEffect> {
public AdaptiveAutomatonEffect() {
super(Constants.Outcome.BoostCreature);
staticText = "As {this} enters the battlefield, choose a creature type";
staticText = "choose a creature type";
}
public AdaptiveAutomatonEffect(final AdaptiveAutomatonEffect effect) {

View file

@ -32,7 +32,7 @@ import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.OneShotEffect;
@ -68,7 +68,7 @@ public class SuturedGhoul extends CardImpl<SuturedGhoul> {
this.addAbility(TrampleAbility.getInstance());
// As Sutured Ghoul enters the battlefield, exile any number of creature cards from your graveyard.
this.addAbility(new EntersBattlefieldAbility(new SuturedGhoulEffect(), staticText));
this.addAbility(new AsEntersBattlefieldAbility(new SuturedGhoulEffect(), staticText));
// Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness.
BoostSourceEffect effect = new BoostSourceEffect(new SuturedGhoulPowerCount(), new SuturedGhoulToughnessCount(), Constants.Duration.WhileOnBattlefield);

View file

@ -37,7 +37,7 @@ import mage.Constants.Zone;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
@ -64,7 +64,7 @@ public class PhyrexianRevoker extends CardImpl<PhyrexianRevoker> {
this.toughness = new MageInt(1);
// As Phyrexian Revoker enters the battlefield, name a nonland card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new PhyrexianRevokerEffect1()));
this.addAbility(new AsEntersBattlefieldAbility(new PhyrexianRevokerEffect1()));
// Activated abilities of sources with the chosen name can't be activated.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianRevokerEffect2()));

View file

@ -36,6 +36,7 @@ import mage.Constants.Zone;
import mage.Mana;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
@ -61,7 +62,7 @@ public class CagedSun extends CardImpl<CagedSun> {
this.expansionSetCode = "NPH";
// As Caged Sun enters the battlefield, choose a color.
this.addAbility(new EntersBattlefieldAbility(new CagedSunEffect1()));
this.addAbility(new AsEntersBattlefieldAbility(new CagedSunEffect1()));
// Creatures you control of the chosen color get +1/+1.
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new CagedSunEffect2()));
@ -84,7 +85,7 @@ class CagedSunEffect1 extends OneShotEffect<CagedSunEffect1> {
public CagedSunEffect1() {
super(Constants.Outcome.BoostCreature);
staticText = "As {this} enters the battlefield, choose a color";
staticText = "choose a color";
}
public CagedSunEffect1(final CagedSunEffect1 effect) {

View file

@ -37,7 +37,7 @@ import mage.Constants.Rarity;
import mage.Constants.SubLayer;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
@ -63,7 +63,7 @@ public class Xenograft extends CardImpl<Xenograft> {
this.color.setBlue(true);
// As Xenograft enters the battlefield, choose a creature type.
this.addAbility(new EntersBattlefieldAbility(new XenograftEffect()));
this.addAbility(new AsEntersBattlefieldAbility(new XenograftEffect()));
// Each creature you control is the chosen type in addition to its other types.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new XenograftAddSubtypeEffect()));
}
@ -82,7 +82,7 @@ class XenograftEffect extends OneShotEffect<XenograftEffect> {
public XenograftEffect() {
super(Outcome.DrawCard);
staticText = "As {this} enters the battlefield, choose a creature type";
staticText = "choose a creature type";
}
public XenograftEffect(final XenograftEffect effect) {

View file

@ -31,7 +31,7 @@ package mage.sets.ravnika;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.BlackManaAbility;
@ -51,7 +51,7 @@ public class OvergrownTomb extends CardImpl<OvergrownTomb> {
this.subtype.add("Forest");
this.addAbility(new BlackManaAbility());
this.addAbility(new GreenManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As {this} enters the battlefield, you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
}
public OvergrownTomb (final OvergrownTomb card) {

View file

@ -31,7 +31,7 @@ package mage.sets.ravnika;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.RedManaAbility;
@ -51,7 +51,7 @@ public class SacredFoundry extends CardImpl<SacredFoundry> {
this.subtype.add("Plains");
this.addAbility(new RedManaAbility());
this.addAbility(new WhiteManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As {this} enters the battlefield, you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
}
public SacredFoundry (final SacredFoundry card) {

View file

@ -31,7 +31,7 @@ package mage.sets.ravnika;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.GreenManaAbility;
@ -51,7 +51,7 @@ public class TempleGarden extends CardImpl<TempleGarden> {
this.subtype.add("Plains");
this.addAbility(new GreenManaAbility());
this.addAbility(new WhiteManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As {this} enters the battlefield, you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
}
public TempleGarden (final TempleGarden card) {

View file

@ -31,7 +31,7 @@ package mage.sets.ravnika;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.mana.BlackManaAbility;
@ -51,7 +51,7 @@ public class WateryGrave extends CardImpl<WateryGrave> {
this.subtype.add("Swamp");
this.addAbility(new BlueManaAbility());
this.addAbility(new BlackManaAbility());
this.addAbility(new EntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "As {this} enters the battlefield, you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, {this} enters the battlefield tapped"));
}
public WateryGrave(final WateryGrave card) {

View file

@ -33,17 +33,17 @@ import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.choices.ChoiceColor;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
@ -59,7 +59,7 @@ public class CurseOfWizardry extends CardImpl<CurseOfWizardry> {
this.color.setBlack(true);
// As Curse of Wizardry enters the battlefield, choose a color.
this.addAbility(new EntersBattlefieldAbility(new CurseOfWizardryChooseColorEffect()));
this.addAbility(new AsEntersBattlefieldAbility(new CurseOfWizardryChooseColorEffect()));
// Whenever a player casts a spell of the chosen color, that player loses 1 life.
this.addAbility(new CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility());
@ -80,7 +80,7 @@ class CurseOfWizardryChooseColorEffect extends OneShotEffect<CurseOfWizardryChoo
public CurseOfWizardryChooseColorEffect() {
super(Constants.Outcome.Detriment);
staticText = "As {this} enters the battlefield, choose a color";
staticText = "choose a color";
}
public CurseOfWizardryChooseColorEffect(final CurseOfWizardryChooseColorEffect effect) {

View file

@ -33,7 +33,7 @@ import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
@ -47,7 +47,7 @@ import mage.sets.Sets;
/**
*
* @author noxx and jeffwadsworth
* @author jeffwadsworth, nox
*/
public class PithingNeedle extends CardImpl<PithingNeedle> {
@ -56,7 +56,7 @@ public class PithingNeedle extends CardImpl<PithingNeedle> {
this.expansionSetCode = "SOK";
// As Pithing Needle enters the battlefield, name a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new NameCard()));
this.addAbility(new AsEntersBattlefieldAbility(new NameCard()));
// Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PithingNeedleEffect()));
@ -148,4 +148,3 @@ class PithingNeedleEffect extends ReplacementEffectImpl<PithingNeedleEffect> {
return false;
}
}

View file

@ -34,8 +34,7 @@ import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.StateTriggeredAbility;
import mage.abilities.common.ZoneChangeTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.Card;
@ -64,7 +63,7 @@ public class LureboundScarecrow extends CardImpl<LureboundScarecrow> {
this.toughness = new MageInt(4);
// As Lurebound Scarecrow enters the battlefield, choose a color.
this.addAbility(new AsEntersBattlefieldTriggeredAbility(new LureboundScarecrowChooseColorEffect()));
this.addAbility(new AsEntersBattlefieldAbility(new LureboundScarecrowChooseColorEffect()));
// When you control no permanents of the chosen color, sacrifice Lurebound Scarecrow.
this.addAbility(new LureboundScarecrowTriggeredAbility());
@ -80,27 +79,6 @@ public class LureboundScarecrow extends CardImpl<LureboundScarecrow> {
}
}
class AsEntersBattlefieldTriggeredAbility extends ZoneChangeTriggeredAbility<AsEntersBattlefieldTriggeredAbility> {
public AsEntersBattlefieldTriggeredAbility(Effect effect) {
this(effect, false);
}
public AsEntersBattlefieldTriggeredAbility(Effect effect, boolean optional) {
super(Constants.Zone.STACK, effect, "As this enters the battlefield, ", optional);
}
public AsEntersBattlefieldTriggeredAbility(AsEntersBattlefieldTriggeredAbility ability) {
super(ability);
}
@Override
public AsEntersBattlefieldTriggeredAbility copy() {
return new AsEntersBattlefieldTriggeredAbility(this);
}
}
class LureboundScarecrowChooseColorEffect extends OneShotEffect<LureboundScarecrowChooseColorEffect> {
public LureboundScarecrowChooseColorEffect() {

View file

@ -0,0 +1,62 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.common;
import mage.Constants;
import mage.abilities.StaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.EntersBattlefieldEffect;
/**
*
* @author North
*/
public class AsEntersBattlefieldAbility extends StaticAbility<AsEntersBattlefieldAbility> {
public AsEntersBattlefieldAbility(Effect effect) {
super(Constants.Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect));
}
public AsEntersBattlefieldAbility(Effect effect, String text) {
super(Constants.Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, text));
}
public AsEntersBattlefieldAbility(AsEntersBattlefieldAbility ability) {
super(ability);
}
@Override
public AsEntersBattlefieldAbility copy() {
return new AsEntersBattlefieldAbility(this);
}
@Override
public String getRule() {
return "As {this} enters the battlefield, " + super.getRule();
}
}