From fac0b0046d55fad8545f06d8b25ed780963ac26c Mon Sep 17 00:00:00 2001 From: North Date: Wed, 29 Jun 2011 21:33:08 +0300 Subject: [PATCH] Fixed cards that used EntersBattlefieldAbility instead of EntersBattlefieldTriggeredAbility --- .../championsofkamigawa/AkkiRockspeaker.java | 45 ++++--------------- .../sets/riseoftheeldrazi/AffaGuardHound.java | 6 ++- .../scarsofmirrodin/BlackcleaveCliffs.java | 2 +- .../sets/scarsofmirrodin/KembasSkyguard.java | 2 - .../scarsofmirrodin/OxiddaScrapmelter.java | 20 ++++----- .../sets/scarsofmirrodin/SunblastAngel.java | 3 -- .../src/mage/sets/worldwake/PilgrimsEye.java | 13 +++--- .../SearchLibraryRevealPutInHandEffect.java | 9 +--- 8 files changed, 29 insertions(+), 71 deletions(-) diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiRockspeaker.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiRockspeaker.java index 2e643de675..d12db407ed 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiRockspeaker.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiRockspeaker.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.championsofkamigawa; import java.util.UUID; @@ -35,31 +34,30 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ManaEffect; import mage.cards.CardImpl; -import mage.game.Game; -import mage.players.Player; /** * - * @author Loki + * @author Loki, North */ public class AkkiRockspeaker extends CardImpl { - public AkkiRockspeaker (UUID ownerId) { + public AkkiRockspeaker(UUID ownerId) { super(ownerId, 154, "Akki Rockspeaker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.expansionSetCode = "CHK"; this.subtype.add("Goblin"); this.subtype.add("Shaman"); - this.color.setRed(true); + + this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - this.addAbility(new EntersBattlefieldAbility(new AkkiRockspeakerEffect(), "add {R} to your mana pool")); + + this.addAbility(new EntersBattlefieldTriggeredAbility(new ManaEffect(new Mana(Constants.ColoredManaSymbol.R)))); } - public AkkiRockspeaker (final AkkiRockspeaker card) { + public AkkiRockspeaker(final AkkiRockspeaker card) { super(card); } @@ -68,28 +66,3 @@ public class AkkiRockspeaker extends CardImpl { return new AkkiRockspeaker(this); } } - -class AkkiRockspeakerEffect extends OneShotEffect { - AkkiRockspeakerEffect() { - super(Constants.Outcome.PutManaInPool); - } - - AkkiRockspeakerEffect(final AkkiRockspeakerEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.getManaPool().changeMana(Mana.RedMana); - return true; - } - return false; - } - - @Override - public AkkiRockspeakerEffect copy() { - return new AkkiRockspeakerEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AffaGuardHound.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AffaGuardHound.java index a601a3806e..03782d4a2d 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AffaGuardHound.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AffaGuardHound.java @@ -34,7 +34,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.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.abilities.keyword.FlashAbility; import mage.cards.CardImpl; @@ -50,11 +50,13 @@ public class AffaGuardHound extends CardImpl { super(ownerId, 14, "Affa Guard Hound", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.expansionSetCode = "ROE"; this.subtype.add("Hound"); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); + this.addAbility(FlashAbility.getInstance()); - Ability ability = new EntersBattlefieldAbility(new BoostTargetEffect(0, 3, Duration.EndOfTurn), "target creature gets +0/+3 until end of turn"); + Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(0, 3, Duration.EndOfTurn)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java index 21061967d3..b14f6c6bb8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java @@ -49,7 +49,7 @@ import mage.filter.common.FilterLandPermanent; */ public class BlackcleaveCliffs extends CardImpl { - private static FilterLandPermanent filter = new FilterLandPermanent(); + private static final FilterLandPermanent filter = new FilterLandPermanent(); static { filter.setScopeSubtype(ComparisonScope.Any); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KembasSkyguard.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KembasSkyguard.java index 7cb73a62aa..dcd440bf22 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KembasSkyguard.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KembasSkyguard.java @@ -32,14 +32,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; -import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; /** - * TODO: Javadoc me * * @author maurer.it_at_gmail.com */ diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaScrapmelter.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaScrapmelter.java index 51424c6e4c..5b5d5c8847 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaScrapmelter.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaScrapmelter.java @@ -32,35 +32,31 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; -import mage.filter.FilterPermanent; import mage.target.TargetPermanent; import java.util.UUID; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.filter.common.FilterArtifactPermanent; /** * - * @author Loki + * @author Loki, North */ public class OxiddaScrapmelter extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact"); - - static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); - } + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact"); public OxiddaScrapmelter (UUID ownerId) { super(ownerId, 101, "Oxidda Scrapmelter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "SOM"; this.subtype.add("Beast"); - this.color.setRed(true); + + this.color.setRed(true); this.power = new MageInt(3); this.toughness = new MageInt(3); - Ability ability = new EntersBattlefieldAbility(new DestroyTargetEffect(), "destroy target artifact"); + + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SunblastAngel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SunblastAngel.java index c5b4c0a5e1..f305ec8f7c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SunblastAngel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SunblastAngel.java @@ -30,11 +30,8 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; import mage.Constants.CardType; -import mage.Constants.Duration; import mage.Constants.Rarity; -import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.keyword.FlyingAbility; diff --git a/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java b/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java index 6ef2587175..7654979c83 100644 --- a/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java +++ b/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java @@ -32,11 +32,10 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; import mage.target.common.TargetCardInLibrary; @@ -45,23 +44,23 @@ import mage.target.common.TargetCardInLibrary; * @author Loki */ public class PilgrimsEye extends CardImpl { - private static FilterCard filter = new FilterCard("basic land card"); + private static final FilterCard filter = new FilterCard("basic land card"); static { filter.getSupertype().add("Basic"); - filter.setScopeSupertype(Filter.ComparisonScope.Any); filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); } public PilgrimsEye (UUID ownerId) { super(ownerId, 128, "Pilgrim's Eye", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); this.expansionSetCode = "WWK"; this.subtype.add("Thopter"); + this.power = new MageInt(1); this.toughness = new MageInt(1); + this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter)), "you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library")); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter)))); } public PilgrimsEye (final PilgrimsEye card) { diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryRevealPutInHandEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryRevealPutInHandEffect.java index ff23465436..4edc6c71c0 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryRevealPutInHandEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryRevealPutInHandEffect.java @@ -90,15 +90,8 @@ public class SearchLibraryRevealPutInHandEffect extends SearchEffect