From 786a62befa08e21f2a44c8f757d3e63281d9cdaa Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 12 Sep 2017 10:10:18 -0400 Subject: [PATCH] updated various activated abilities --- .../src/mage/cards/c/CabalInquisitor.java | 16 +----- .../src/mage/cards/c/ChronatogTotem.java | 17 ++---- Mage.Sets/src/mage/cards/e/EvolvingWilds.java | 36 ++++--------- .../src/mage/cards/g/GargoyleCastle.java | 36 ++++--------- .../src/mage/cards/g/GroundlingPouncer.java | 12 +---- Mage.Sets/src/mage/cards/k/KyrenToy.java | 4 +- .../src/mage/cards/m/MulDayaChannelers.java | 52 +------------------ .../src/mage/cards/t/TerramorphicExpanse.java | 36 ++++--------- .../src/mage/cards/w/WellOfKnowledge.java | 3 -- 9 files changed, 40 insertions(+), 172 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CabalInquisitor.java b/Mage.Sets/src/mage/cards/c/CabalInquisitor.java index ded5d90a14..43f4de72c2 100644 --- a/Mage.Sets/src/mage/cards/c/CabalInquisitor.java +++ b/Mage.Sets/src/mage/cards/c/CabalInquisitor.java @@ -52,11 +52,10 @@ import mage.target.common.TargetCardInYourGraveyard; * * @author cbt33 */ - public class CabalInquisitor extends CardImpl { public CabalInquisitor(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.MINION); @@ -82,11 +81,8 @@ public class CabalInquisitor extends CardImpl { } } - class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl { - private Condition condition; - private static final Effects emptyEffects = new Effects(); public ActivateAsSorceryConditionalActivatedAbility(Zone zone, Effect effect, ManaCosts cost, Condition condition) { @@ -95,10 +91,8 @@ class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl timing = TimingRule.SORCERY; } - public ActivateAsSorceryConditionalActivatedAbility(final ActivateAsSorceryConditionalActivatedAbility ability) { super(ability); - this.condition = ability.condition; } @Override @@ -109,14 +103,6 @@ class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl return super.getEffects(game, effectType); } - @Override - public boolean canActivate(UUID playerId, Game game) { - if (!condition.apply(game, this)) { - return false; - } - return super.canActivate(playerId, game); - } - @Override public ActivateAsSorceryConditionalActivatedAbility copy() { return new ActivateAsSorceryConditionalActivatedAbility(this); diff --git a/Mage.Sets/src/mage/cards/c/ChronatogTotem.java b/Mage.Sets/src/mage/cards/c/ChronatogTotem.java index 3633454e29..2cb60a672e 100644 --- a/Mage.Sets/src/mage/cards/c/ChronatogTotem.java +++ b/Mage.Sets/src/mage/cards/c/ChronatogTotem.java @@ -59,14 +59,14 @@ import mage.game.permanent.token.Token; public class ChronatogTotem extends CardImpl { public ChronatogTotem(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // {tap}: Add {U} to your mana pool. this.addAbility(new BlueManaAbility()); - + // {1}{U}: Chronatog Totem becomes a 1/2 blue Atog artifact creature until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new ChronatogTotemToken(), "", Duration.EndOfTurn), new ManaCostsImpl<>("{1}{U}"))); - + // {0}: Chronatog Totem gets +3/+3 until end of turn. You skip your next turn. Activate this ability only once each turn and only if Chronatog Totem is a creature. Ability ability = new ChronatogTotemAbility( Zone.BATTLEFIELD, @@ -91,8 +91,6 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility { private static final Effects emptyEffects = new Effects(); - private final Condition condition; - public ChronatogTotemAbility(Zone zone, Effect effect, Cost cost, Condition condition) { super(zone, effect, cost); this.condition = condition; @@ -100,7 +98,6 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility { public ChronatogTotemAbility(ChronatogTotemAbility ability) { super(ability); - this.condition = ability.condition; } @Override @@ -111,14 +108,6 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility { return super.getEffects(game, effectType); } - @Override - public boolean canActivate(UUID playerId, Game game) { - if (!condition.apply(game, this)) { - return false; - } - return super.canActivate(playerId, game); - } - @Override public ChronatogTotemAbility copy() { return new ChronatogTotemAbility(this); diff --git a/Mage.Sets/src/mage/cards/e/EvolvingWilds.java b/Mage.Sets/src/mage/cards/e/EvolvingWilds.java index 69211f6845..13c09f8abd 100644 --- a/Mage.Sets/src/mage/cards/e/EvolvingWilds.java +++ b/Mage.Sets/src/mage/cards/e/EvolvingWilds.java @@ -27,19 +27,19 @@ */ package mage.cards.e; -import mage.abilities.ActivatedAbilityImpl; -import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.StaticFilters; import mage.target.common.TargetCardInLibrary; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; /** * @@ -48,10 +48,15 @@ import java.util.UUID; public class EvolvingWilds extends CardImpl { public EvolvingWilds(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},null); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, null); // {T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library. - this.addAbility(new EvolvingWildsAbility()); + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD), true), + new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); } public EvolvingWilds(final EvolvingWilds card) { @@ -64,24 +69,3 @@ public class EvolvingWilds extends CardImpl { } } - -class EvolvingWildsAbility extends ActivatedAbilityImpl { - - public EvolvingWildsAbility() { - super(Zone.BATTLEFIELD, null); - addCost(new TapSourceCost()); - addCost(new SacrificeSourceCost()); - TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD); - addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); - } - - public EvolvingWildsAbility(final EvolvingWildsAbility ability) { - super(ability); - } - - @Override - public EvolvingWildsAbility copy() { - return new EvolvingWildsAbility(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/g/GargoyleCastle.java b/Mage.Sets/src/mage/cards/g/GargoyleCastle.java index 69ab8a9efa..56ec46d63c 100644 --- a/Mage.Sets/src/mage/cards/g/GargoyleCastle.java +++ b/Mage.Sets/src/mage/cards/g/GargoyleCastle.java @@ -28,10 +28,11 @@ package mage.cards.g; import java.util.UUID; -import mage.abilities.ActivatedAbilityImpl; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; @@ -52,7 +53,13 @@ public class GargoyleCastle extends CardImpl { this.addAbility(new ColorlessManaAbility()); // {T}, {5}, Sacrifice Gargoyle Castle: Put a 3/4 colorless Gargoyle artifact creature token with flying onto the battlefield. - this.addAbility(new GargoyleCastleAbility()); + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new CreateTokenEffect(new GargoyleToken()), + new ManaCostsImpl("{5}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); } public GargoyleCastle(final GargoyleCastle card) { @@ -64,25 +71,4 @@ public class GargoyleCastle extends CardImpl { return new GargoyleCastle(this); } -} - -class GargoyleCastleAbility extends ActivatedAbilityImpl { - - public GargoyleCastleAbility() { - super(Zone.BATTLEFIELD, null); - addCost(new TapSourceCost()); - addCost(new GenericManaCost(5)); - addCost(new SacrificeSourceCost()); - addEffect(new CreateTokenEffect(new GargoyleToken())); - } - - public GargoyleCastleAbility(final GargoyleCastleAbility ability) { - super(ability); - } - - @Override - public GargoyleCastleAbility copy() { - return new GargoyleCastleAbility(this); - } - -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/g/GroundlingPouncer.java b/Mage.Sets/src/mage/cards/g/GroundlingPouncer.java index 41b3e883e1..c03cd462e1 100644 --- a/Mage.Sets/src/mage/cards/g/GroundlingPouncer.java +++ b/Mage.Sets/src/mage/cards/g/GroundlingPouncer.java @@ -65,7 +65,7 @@ public class GroundlingPouncer extends CardImpl { } public GroundlingPouncer(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G/U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G/U}"); this.subtype.add(SubType.FAERIE); this.power = new MageInt(2); @@ -97,7 +97,6 @@ class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility { private static final Effects emptyEffects = new Effects(); - private final Condition condition; private final String ruleText; public GroundlingPouncerAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) { @@ -108,7 +107,6 @@ class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility { public GroundlingPouncerAbility(GroundlingPouncerAbility ability) { super(ability); - this.condition = ability.condition; this.ruleText = ability.ruleText; } @@ -120,14 +118,6 @@ class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility { return super.getEffects(game, effectType); } - @Override - public boolean canActivate(UUID playerId, Game game) { - if (!condition.apply(game, this)) { - return false; - } - return super.canActivate(playerId, game); - } - @Override public GroundlingPouncerAbility copy() { return new GroundlingPouncerAbility(this); diff --git a/Mage.Sets/src/mage/cards/k/KyrenToy.java b/Mage.Sets/src/mage/cards/k/KyrenToy.java index dd757a25c0..0dc4decc0c 100644 --- a/Mage.Sets/src/mage/cards/k/KyrenToy.java +++ b/Mage.Sets/src/mage/cards/k/KyrenToy.java @@ -53,7 +53,7 @@ import mage.players.Player; public class KyrenToy extends CardImpl { public KyrenToy(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // {1}, {T}: Put a charge counter on Kyren Toy. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance(1)), new GenericManaCost(1)); @@ -95,7 +95,7 @@ public class KyrenToy extends CardImpl { KyrenToyManaEffect() { super(); - staticText = "Add X mana of {C} to your mana pool, and then add {C} to your mana pool"; + staticText = "Add an amount of {C} to your mana pool equal to X plus one"; } KyrenToyManaEffect(final KyrenToyManaEffect effect) { diff --git a/Mage.Sets/src/mage/cards/m/MulDayaChannelers.java b/Mage.Sets/src/mage/cards/m/MulDayaChannelers.java index 5b84f8caa4..b03c18ee68 100644 --- a/Mage.Sets/src/mage/cards/m/MulDayaChannelers.java +++ b/Mage.Sets/src/mage/cards/m/MulDayaChannelers.java @@ -30,17 +30,13 @@ package mage.cards.m; import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; import mage.abilities.condition.common.TopLibraryCardTypeCondition; -import mage.abilities.costs.Cost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.common.AddManaOfAnyColorEffect; -import mage.abilities.effects.common.ManaEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect; -import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -48,7 +44,6 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Zone; -import mage.game.Game; /** * @@ -59,7 +54,7 @@ public class MulDayaChannelers extends CardImpl { private static final String rule1 = "As long as the top card of your library is a creature card, {this} gets +3/+3"; public MulDayaChannelers(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); this.subtype.add(SubType.ELF); this.subtype.add(SubType.DRUID); this.subtype.add(SubType.SHAMAN); @@ -81,7 +76,7 @@ public class MulDayaChannelers extends CardImpl { new TopLibraryCardTypeCondition(CardType.LAND), "As long as the top card of your library is a land card, Mul Daya Channelers has \"{T}: Add two mana of any one color to your mana pool.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - + } public MulDayaChannelers(final MulDayaChannelers card) { @@ -93,46 +88,3 @@ public class MulDayaChannelers extends CardImpl { return new MulDayaChannelers(this); } } - - -class MulDayaChannelersActivateIfConditionManaAbility extends ActivatedManaAbilityImpl { - - private Condition condition; - - public MulDayaChannelersActivateIfConditionManaAbility(Zone zone, ManaEffect effect, Cost cost, Condition condition) { - super(zone, effect, cost); - this.condition = condition; - } - - public MulDayaChannelersActivateIfConditionManaAbility(MulDayaChannelersActivateIfConditionManaAbility ability) { - super(ability); - this.condition = ability.condition; - } - - @Override - public boolean canActivate(UUID playerId, Game game) { - if (condition.apply(game, this)) { - return super.canActivate(playerId, game); - } - return false; - } - - @Override - public boolean activate(Game game, boolean noMana) { - if (canActivate(this.controllerId, game)) { - return super.activate(game, noMana); - } - return false; - } - - @Override - public String getRule() { - return "As long as the top card of your library is a land card, {this} has \"{T}: Add two mana of any one color to your mana pool."; - } - - @Override - public MulDayaChannelersActivateIfConditionManaAbility copy() { - return new MulDayaChannelersActivateIfConditionManaAbility(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/t/TerramorphicExpanse.java b/Mage.Sets/src/mage/cards/t/TerramorphicExpanse.java index 1038660daf..5a4239c092 100644 --- a/Mage.Sets/src/mage/cards/t/TerramorphicExpanse.java +++ b/Mage.Sets/src/mage/cards/t/TerramorphicExpanse.java @@ -25,22 +25,21 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.t; -import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.StaticFilters; import mage.target.common.TargetCardInLibrary; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; /** * @@ -49,8 +48,14 @@ import java.util.UUID; public class TerramorphicExpanse extends CardImpl { public TerramorphicExpanse(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},null); - this.addAbility(new TerramorphicExpanseAbility()); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, null); + + Ability ability = new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD), true), + new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); } public TerramorphicExpanse(final TerramorphicExpanse card) { @@ -63,24 +68,3 @@ public class TerramorphicExpanse extends CardImpl { } } - -class TerramorphicExpanseAbility extends ActivatedAbilityImpl { - - public TerramorphicExpanseAbility() { - super(Zone.BATTLEFIELD, null); - addCost(new TapSourceCost()); - addCost(new SacrificeSourceCost()); - TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD); - addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); - } - - public TerramorphicExpanseAbility(final TerramorphicExpanseAbility ability) { - super(ability); - } - - @Override - public TerramorphicExpanseAbility copy() { - return new TerramorphicExpanseAbility(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/w/WellOfKnowledge.java b/Mage.Sets/src/mage/cards/w/WellOfKnowledge.java index 22afc30cae..d735337165 100644 --- a/Mage.Sets/src/mage/cards/w/WellOfKnowledge.java +++ b/Mage.Sets/src/mage/cards/w/WellOfKnowledge.java @@ -30,7 +30,6 @@ package mage.cards.w; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.ActivatedAbilityImpl; -import mage.abilities.condition.Condition; import mage.abilities.condition.common.IsStepCondition; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.Effects; @@ -71,8 +70,6 @@ public class WellOfKnowledge extends CardImpl { class WellOfKnowledgeConditionalActivatedAbility extends ActivatedAbilityImpl { - private final Condition condition; - public WellOfKnowledgeConditionalActivatedAbility() { super(Zone.BATTLEFIELD, new WellOfKnowledgeEffect(), new GenericManaCost(2)); condition = new IsStepCondition(PhaseStep.DRAW, false);