diff --git a/Mage.Sets/src/mage/cards/f/FungalSprouting.java b/Mage.Sets/src/mage/cards/f/FungalSprouting.java index 1af33b76e7..20341ff267 100644 --- a/Mage.Sets/src/mage/cards/f/FungalSprouting.java +++ b/Mage.Sets/src/mage/cards/f/FungalSprouting.java @@ -30,20 +30,11 @@ package mage.cards.f; import java.util.UUID; import mage.constants.CardType; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.GreatestPowerAmongControlledCreaturesValue; +import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.Outcome; -import mage.constants.TargetController; -import mage.filter.FilterPermanent; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.SaprolingToken; -import mage.players.Player; /** * @@ -52,11 +43,10 @@ import mage.players.Player; public class FungalSprouting extends CardImpl { public FungalSprouting(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); // create X 1/1 green Saproling creature tokens, where X is the greatest power among creatures you control. - this.getSpellAbility().addEffect(new FungalSproutingEffect()); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new GreatestPowerAmongControlledCreaturesValue())); } public FungalSprouting(final FungalSprouting card) { @@ -68,43 +58,3 @@ public class FungalSprouting extends CardImpl { return new FungalSprouting(this); } } - -class FungalSproutingEffect extends OneShotEffect { - - private static final FilterPermanent filter = new FilterPermanent(); - - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.add(new ControllerPredicate(TargetController.YOU)); - } - - public FungalSproutingEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "create X 1/1 green Saproling creature tokens, where X is the greatest power among creatures you control"; - } - - public FungalSproutingEffect(final FungalSproutingEffect effect) { - super(effect); - } - - @Override - public FungalSproutingEffect copy() { - return new FungalSproutingEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - int amount = 0; - for (Permanent p : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), source.getControllerId(), game)) { - if (p.getPower().getValue() > amount) - amount = p.getPower().getValue(); - } - SaprolingToken token = new SaprolingToken(); - token.putOntoBattlefield(amount, game, source.getSourceId(), source.getControllerId()); - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/cards/i/ImplementOfMaliace.java b/Mage.Sets/src/mage/cards/i/ImplementOfMalice.java similarity index 92% rename from Mage.Sets/src/mage/cards/i/ImplementOfMaliace.java rename to Mage.Sets/src/mage/cards/i/ImplementOfMalice.java index b104a2ea06..9835e94f03 100644 --- a/Mage.Sets/src/mage/cards/i/ImplementOfMaliace.java +++ b/Mage.Sets/src/mage/cards/i/ImplementOfMalice.java @@ -45,9 +45,9 @@ import mage.target.TargetPlayer; * * @author fireshoes */ -public class ImplementOfMaliace extends CardImpl { +public class ImplementOfMalice extends CardImpl { - public ImplementOfMaliace(UUID ownerId, CardSetInfo setInfo) { + public ImplementOfMalice(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); // {B}, Sacrifice Implement of Malice: Target player discards a card. Activate this ability only any time you could cast a sorcery. @@ -60,12 +60,12 @@ public class ImplementOfMaliace extends CardImpl { this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DrawCardSourceControllerEffect(1))); } - public ImplementOfMaliace(final ImplementOfMaliace card) { + public ImplementOfMalice(final ImplementOfMalice card) { super(card); } @Override - public ImplementOfMaliace copy() { - return new ImplementOfMaliace(this); + public ImplementOfMalice copy() { + return new ImplementOfMalice(this); } } diff --git a/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java b/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java index 77eb9c92b9..46d03121a9 100644 --- a/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java +++ b/Mage.Sets/src/mage/cards/l/LifecraftAwakening.java @@ -40,7 +40,10 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.TargetController; import mage.counters.CounterType; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; @@ -53,13 +56,19 @@ import mage.target.targetpointer.FixedTarget; */ public class LifecraftAwakening extends CardImpl { + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + } + public LifecraftAwakening(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{G}"); // Put X +1/+1 counters on target artifact you control. If it isn't a creature or Vehicle, it becomes a 0/0 Construct artifact creature. ManacostVariableValue manaX = new ManacostVariableValue(); getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(), manaX)); - getSpellAbility().addTarget(new TargetArtifactPermanent()); + getSpellAbility().addTarget(new TargetArtifactPermanent(filter)); getSpellAbility().addEffect(new LifecraftAwakeningEffect()); } @@ -91,13 +100,13 @@ class LifecraftAwakeningEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = (Permanent) game.getPermanent(source.getTargets().get(1).getFirstTarget()); - if (!permanent.getCardType().contains(CardType.CREATURE) && !permanent.getSubtype(game).contains("Vehicle")) { - ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new LifecraftAwakeningToken(), false, true, Duration.Custom); - continuousEffect.setTargetPointer(new FixedTarget(permanent, game)); - game.addEffect(continuousEffect, source); - return true; - } + Permanent permanent = (Permanent) game.getPermanent(source.getTargets().getFirstTarget()); + if (!permanent.getCardType().contains(CardType.CREATURE) && !permanent.getSubtype(game).contains("Vehicle")) { + ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new LifecraftAwakeningToken(), false, true, Duration.Custom); + continuousEffect.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(continuousEffect, source); + return true; + } return false; } } @@ -113,4 +122,4 @@ class LifecraftAwakeningToken extends Token { this.power = new MageInt(0); this.toughness = new MageInt(0); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/l/LifecraftCavalry.java b/Mage.Sets/src/mage/cards/l/LifecraftCavalry.java index 82fe2aeadd..abd8b5d982 100644 --- a/Mage.Sets/src/mage/cards/l/LifecraftCavalry.java +++ b/Mage.Sets/src/mage/cards/l/LifecraftCavalry.java @@ -29,6 +29,7 @@ package mage.cards.l; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.RevoltCondition; import mage.abilities.decorator.ConditionalOneShotEffect; @@ -38,6 +39,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.counters.CounterType; +import mage.watchers.common.RevoltWatcher; /** * @@ -57,9 +59,14 @@ public class LifecraftCavalry extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // <i>Revolt</i> — Lifecraft Cavalry enters the battlefield with two +1/+1 counters on it if a permanent you controlled left the battlefield this turn. - this.addAbility(new EntersBattlefieldAbility( - new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), RevoltCondition.getInstance(), ""), - "with two +1/+1 counters on it if a permanent you controlled left the battlefield this turn")); + this.addAbility( + new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), + false, + RevoltCondition.getInstance(), + "<i>Revolt</i> — {this} enters the battlefield with two +1/+1 counter on it if a permanent you controlled left the battlefield this turn", null), + new RevoltWatcher() + ); } public LifecraftCavalry(final LifecraftCavalry card) { diff --git a/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java b/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java new file mode 100644 index 0000000000..71c1332ec0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MonstrousOnslaught.java @@ -0,0 +1,65 @@ +/* + * 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.cards.m; + +import java.util.UUID; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.GreatestPowerAmongControlledCreaturesValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreaturePermanentAmount; + +/** + * + * @author Styxo + */ +public class MonstrousOnslaught extends CardImpl { + + public MonstrousOnslaught(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); + + // Monstrous Onslaught deals X damage divided as you choose among any number of target creatures, where X is the greater power among creatures you control as you cast Monstrous Onslaught. + DynamicValue xValue = new GreatestPowerAmongControlledCreaturesValue(); + Effect effect = new DamageMultiEffect(xValue); + effect.setText("{this} deals X damage divided as you choose among any number of target creatures, where X is the greatest amount of damage dealt by a source to a permanent or player this turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue)); + } + + public MonstrousOnslaught(final MonstrousOnslaught card) { + super(card); + } + + @Override + public MonstrousOnslaught copy() { + return new MonstrousOnslaught(this); + } +} diff --git a/Mage.Sets/src/mage/cards/n/NarnamRenegade.java b/Mage.Sets/src/mage/cards/n/NarnamRenegade.java index 95b2e51ae7..208546fdc8 100644 --- a/Mage.Sets/src/mage/cards/n/NarnamRenegade.java +++ b/Mage.Sets/src/mage/cards/n/NarnamRenegade.java @@ -31,13 +31,13 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.RevoltCondition; -import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.counters.CounterType; +import mage.watchers.common.RevoltWatcher; /** * @@ -57,9 +57,14 @@ public class NarnamRenegade extends CardImpl { this.addAbility(DeathtouchAbility.getInstance()); // <i>Revolt</i> — Narnam Renegade enters the battlefield with a +1/+1 counter on it if a permanent you controlled left this battlefield this turn. - this.addAbility(new EntersBattlefieldAbility( - new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), RevoltCondition.getInstance(), ""), - "with a +1/+1 counter on it if a permanent you controlled left the battlefield this turn")); + this.addAbility( + new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), + false, + RevoltCondition.getInstance(), + "<i>Revolt</i> — {this} enters the battlefield with a +1/+1 counter on it if a permanent you controlled left the battlefield this turn", null), + new RevoltWatcher() + ); } public NarnamRenegade(final NarnamRenegade card) { diff --git a/Mage.Sets/src/mage/cards/n/NaturalObsolesence.java b/Mage.Sets/src/mage/cards/n/NaturalObsolescence.java similarity index 89% rename from Mage.Sets/src/mage/cards/n/NaturalObsolesence.java rename to Mage.Sets/src/mage/cards/n/NaturalObsolescence.java index 30c61a34ca..7c00b11949 100644 --- a/Mage.Sets/src/mage/cards/n/NaturalObsolesence.java +++ b/Mage.Sets/src/mage/cards/n/NaturalObsolescence.java @@ -38,9 +38,9 @@ import mage.target.common.TargetArtifactPermanent; * * @author fireshoes */ -public class NaturalObsolesence extends CardImpl { +public class NaturalObsolescence extends CardImpl { - public NaturalObsolesence(UUID ownerId, CardSetInfo setInfo) { + public NaturalObsolescence(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}"); // Put target artifact on the bottom of its owner's library. @@ -48,12 +48,12 @@ public class NaturalObsolesence extends CardImpl { this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(false)); } - public NaturalObsolesence(final NaturalObsolesence card) { + public NaturalObsolescence(final NaturalObsolescence card) { super(card); } @Override - public NaturalObsolesence copy() { - return new NaturalObsolesence(this); + public NaturalObsolescence copy() { + return new NaturalObsolescence(this); } } diff --git a/Mage.Sets/src/mage/cards/p/PeemaAetherSeer.java b/Mage.Sets/src/mage/cards/p/PeemaAetherSeer.java index 0f06696325..14e4df70a4 100644 --- a/Mage.Sets/src/mage/cards/p/PeemaAetherSeer.java +++ b/Mage.Sets/src/mage/cards/p/PeemaAetherSeer.java @@ -33,19 +33,15 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.PayEnergyCost; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.GreatestPowerAmongControlledCreaturesValue; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.combat.BlocksIfAbleTargetEffect; import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetCreaturePermanent; /** @@ -63,7 +59,9 @@ public class PeemaAetherSeer extends CardImpl { this.toughness = new MageInt(2); // When Peema Aether-Seer enters the battlefield, you get an amount of {E} equal to the greatest power among creatures you control. - this.addAbility(new EntersBattlefieldTriggeredAbility(new PeemaAetherSeerEffect())); + Effect effect = new GetEnergyCountersControllerEffect(new GreatestPowerAmongControlledCreaturesValue()); + effect.setText("you get an amount of {E} equal to the greatest power among creatures you control"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); // Pay {E}{E}{E}: Target creature blocks this turn if able. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BlocksIfAbleTargetEffect(Duration.EndOfTurn), new PayEnergyCost(3)); @@ -80,37 +78,3 @@ public class PeemaAetherSeer extends CardImpl { return new PeemaAetherSeer(this); } } - -class PeemaAetherSeerEffect extends OneShotEffect { - - PeemaAetherSeerEffect() { - super(Outcome.DrawCard); - staticText = "you get an amount of {E} equal to the greatest power among creatures you control"; - } - - PeemaAetherSeerEffect(final PeemaAetherSeerEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - int amount = 0; - for (Permanent p : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), source.getControllerId(), game)) { - if (p.getPower().getValue() > amount) { - amount = p.getPower().getValue(); - } - } - new GetEnergyCountersControllerEffect(amount).apply(game, source); - return true; - } - return false; - } - - @Override - public PeemaAetherSeerEffect copy() { - return new PeemaAetherSeerEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/r/RishkarsExpertise.java b/Mage.Sets/src/mage/cards/r/RishkarsExpertise.java index d9812470b3..2205169087 100644 --- a/Mage.Sets/src/mage/cards/r/RishkarsExpertise.java +++ b/Mage.Sets/src/mage/cards/r/RishkarsExpertise.java @@ -25,22 +25,17 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.r; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.cost.CastWithoutPayingManaCostEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import java.util.UUID; +import mage.abilities.dynamicvalue.common.GreatestPowerAmongControlledCreaturesValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; /** * @author fireshoes @@ -50,9 +45,10 @@ public class RishkarsExpertise extends CardImpl { public RishkarsExpertise(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}"); - // Draw cards equal to the greatest power among creatures you control. - this.getSpellAbility().addEffect(new RishkarsExpertiseDrawEffect()); + Effect effect = new DrawCardSourceControllerEffect(new GreatestPowerAmongControlledCreaturesValue()); + effect.setText("Draw cards equal to the greatest power among creatures you control"); + this.getSpellAbility().addEffect(effect); // You may cast a card with converted mana cost 5 or less from your hand without paying its mana cost. this.getSpellAbility().addEffect(new CastWithoutPayingManaCostEffect(5)); @@ -67,37 +63,3 @@ public class RishkarsExpertise extends CardImpl { return new RishkarsExpertise(this); } } - -class RishkarsExpertiseDrawEffect extends OneShotEffect { - - RishkarsExpertiseDrawEffect() { - super(Outcome.DrawCard); - staticText = "Draw cards equal to the greatest power among creatures you control"; - } - - RishkarsExpertiseDrawEffect(final RishkarsExpertiseDrawEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - int amount = 0; - for (Permanent p : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), source.getControllerId(), game)) { - if (p.getPower().getValue() > amount) { - amount = p.getPower().getValue(); - } - } - player.drawCards(amount, game); - return true; - } - return false; - } - - @Override - public RishkarsExpertiseDrawEffect copy() { - return new RishkarsExpertiseDrawEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/s/ScroungingBandar.java b/Mage.Sets/src/mage/cards/s/ScroungingBandar.java new file mode 100644 index 0000000000..df0619ee13 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/ScroungingBandar.java @@ -0,0 +1,127 @@ +/* + * 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.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Styxo + */ +public class ScroungingBandar extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature"); + + static { + filter.add(new AnotherPredicate()); + } + + public ScroungingBandar(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add("Cat"); + this.subtype.add("Monkey"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Scrounging Bandar enters the battlefield with two +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it")); + + // At the beginning of you upkeep, you may move any number of +1/+1 counters from Scrounging Bandar onto another target creature. + Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new ScroungingBandarEffect(), TargetController.YOU, true); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public ScroungingBandar(final ScroungingBandar card) { + super(card); + } + + @Override + public ScroungingBandar copy() { + return new ScroungingBandar(this); + } +} + +class ScroungingBandarEffect extends OneShotEffect { + + public ScroungingBandarEffect() { + super(Outcome.Detriment); + this.staticText = "move any number of +1/+1 counters from Scrounging Bandar onto another target creature"; + } + + public ScroungingBandarEffect(final ScroungingBandarEffect effect) { + super(effect); + } + + @Override + public ScroungingBandarEffect copy() { + return new ScroungingBandarEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Permanent fromPermanent = game.getPermanent(source.getSourceId()); + Permanent toPermanent = game.getPermanent(source.getTargets().getFirstTarget()); + + if (fromPermanent != null && toPermanent != null) { + int amountCounters = fromPermanent.getCounters(game).getCount(CounterType.P1P1); + if (amountCounters > 0) { + int amountToMove = controller.getAmount(0, amountCounters, "How many counters do you want to move?", game); + if (amountToMove > 0) { + fromPermanent.removeCounters(CounterType.P1P1.createInstance(amountToMove), game); + toPermanent.addCounters(CounterType.P1P1.createInstance(amountToMove), source, game); + } + } + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/s/StasisSnare.java b/Mage.Sets/src/mage/cards/s/StasisSnare.java index c1c975bf59..7e7bd31f7f 100644 --- a/Mage.Sets/src/mage/cards/s/StasisSnare.java +++ b/Mage.Sets/src/mage/cards/s/StasisSnare.java @@ -81,32 +81,4 @@ public class StasisSnare extends CardImpl { public StasisSnare copy() { return new StasisSnare(this); } -} - -class StasisSnareExileEffect extends OneShotEffect { - - public StasisSnareExileEffect() { - super(Outcome.Benefit); - this.staticText = "exile target creature an opponent controls until {this} leaves the battlefield"; - } - - public StasisSnareExileEffect(final StasisSnareExileEffect effect) { - super(effect); - } - - @Override - public StasisSnareExileEffect copy() { - return new StasisSnareExileEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - // If Stasis Snare leaves the battlefield before its triggered ability resolves, - // the target won't be exiled. - if (permanent != null) { - return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); - } - return false; - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/AetherRevolt.java b/Mage.Sets/src/mage/sets/AetherRevolt.java index 99883d35c5..d0fac46473 100644 --- a/Mage.Sets/src/mage/sets/AetherRevolt.java +++ b/Mage.Sets/src/mage/sets/AetherRevolt.java @@ -132,7 +132,7 @@ public class AetherRevolt extends ExpansionSet { cards.add(new SetCardInfo("Implement of Examination", 156, Rarity.COMMON, mage.cards.i.ImplementOfExamination.class)); cards.add(new SetCardInfo("Implement of Ferocity", 157, Rarity.COMMON, mage.cards.i.ImplementOfFerocity.class)); cards.add(new SetCardInfo("Implement of Improvement", 158, Rarity.COMMON, mage.cards.i.ImplementOfImprovement.class)); - cards.add(new SetCardInfo("Implement of Maliace", 159, Rarity.COMMON, mage.cards.i.ImplementOfMaliace.class)); + cards.add(new SetCardInfo("Implement of Malice", 159, Rarity.COMMON, mage.cards.i.ImplementOfMalice.class)); cards.add(new SetCardInfo("Inspiring Roar", 186, Rarity.COMMON, mage.cards.i.InspiringRoar.class)); cards.add(new SetCardInfo("Inspiring Statuary", 160, Rarity.RARE, mage.cards.i.InspiringStatuary.class)); cards.add(new SetCardInfo("Ironclad Revolutionary", 65, Rarity.UNCOMMON, mage.cards.i.IroncladRevolutionary.class)); @@ -148,8 +148,9 @@ public class AetherRevolt extends ExpansionSet { cards.add(new SetCardInfo("Maverick Thopterist", 130, Rarity.UNCOMMON, mage.cards.m.MaverickThopterist.class)); cards.add(new SetCardInfo("Metallic Rebuke", 39, Rarity.COMMON, mage.cards.m.MetallicRebuke.class)); cards.add(new SetCardInfo("Midnight Entourage", 66, Rarity.RARE, mage.cards.m.MidnightEntourage.class)); + cards.add(new SetCardInfo("Monstrous Onslaught", 116, Rarity.UNCOMMON, mage.cards.m.MonstrousOnslaught.class)); cards.add(new SetCardInfo("Narnam Renegade", 117, Rarity.UNCOMMON, mage.cards.n.NarnamRenegade.class)); - cards.add(new SetCardInfo("Natural Obsolesence", 118, Rarity.COMMON, mage.cards.n.NaturalObsolesence.class)); + cards.add(new SetCardInfo("Natural Obsolescence", 118, Rarity.COMMON, mage.cards.n.NaturalObsolescence.class)); cards.add(new SetCardInfo("Negate", 40, Rarity.COMMON, mage.cards.n.Negate.class)); cards.add(new SetCardInfo("Night Market Aeronaut", 67, Rarity.COMMON, mage.cards.n.NightMarketAeronaut.class)); cards.add(new SetCardInfo("Oath of Ajani", 131, Rarity.RARE, mage.cards.o.OathOfAjani.class)); @@ -182,6 +183,7 @@ public class AetherRevolt extends ExpansionSet { cards.add(new SetCardInfo("Rishkar, Peema Renegade", 122, Rarity.RARE, mage.cards.r.RishkarPeemaRenegade.class)); cards.add(new SetCardInfo("Rogue Refiner", 135, Rarity.UNCOMMON, mage.cards.r.RogueRefiner.class)); cards.add(new SetCardInfo("Scrap Trawler", 175, Rarity.RARE, mage.cards.s.ScrapTrawler.class)); + cards.add(new SetCardInfo("Scrounging Bandar", 124, Rarity.COMMON, mage.cards.s.ScroungingBandar.class)); cards.add(new SetCardInfo("Secret Salvage", 71, Rarity.RARE, mage.cards.s.SecretSalvage.class)); cards.add(new SetCardInfo("Shipwreck Moray", 45, Rarity.COMMON, mage.cards.s.ShipwreckMoray.class)); cards.add(new SetCardInfo("Shock", 98, Rarity.COMMON, mage.cards.s.Shock.class)); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/GreatestPowerAmongControlledCreaturesValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/GreatestPowerAmongControlledCreaturesValue.java new file mode 100644 index 0000000000..613bab5902 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/GreatestPowerAmongControlledCreaturesValue.java @@ -0,0 +1,74 @@ +/* + * 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.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author Styxo + */ +public class GreatestPowerAmongControlledCreaturesValue implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player player = game.getPlayer(sourceAbility.getControllerId()); + if (player != null) { + int amount = 0; + for (Permanent p : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), sourceAbility.getControllerId(), game)) { + if (p.getPower().getValue() > amount) { + amount = p.getPower().getValue(); + } + } + return amount; + } + return 0; + } + + @Override + public GreatestPowerAmongControlledCreaturesValue copy() { + return new GreatestPowerAmongControlledCreaturesValue(); + } + + @Override + public String getMessage() { + return "the greatest power among creatures you control"; + } + + @Override + public String toString() { + return "X"; + } + +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index a91285f93f..08b78bd29b 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -30468,7 +30468,7 @@ Lifecrafter's Gift|Aether Revolt|114|U|{3}{G}|Instant|||Put a +1/+1 counter on t Maulfist Revolutionary|Aether Revolt|115|U|{1}{G}{G}|Creature - Human Warrior|3|3|Trample$When Maulfist Revolutionary enters the battlefield or dies, for each kind of counter on target permanent or players, give that permanent or player another counter of that kind.| Monstrous Onslaught|Aether Revolt|116|U|{3}{G}{G}|Sorcery|||Monstrous Onslaught deals X damage divided as you choose among any number of target creatures, where X is the greater power among creatures you control as you cast Monstrous Onslaught.| Narnam Renegade|Aether Revolt|117|U|{G}|Creature - Elf Warrior|1|2|Deathtouch$<i>Revolt</i> — Narnam Renegade enters the battlefield with a +1/+1 counter on it if a permanent you controlled left this battlefield this turn.| -Natural Obsolesence|Aether Revolt|118|C|{1}{G}|Instant|||Put target artifact on the bottom of its owner's library.| +Natural Obsolescence|Aether Revolt|118|C|{1}{G}|Instant|||Put target artifact on the bottom of its owner's library.| Peema Aether-Seer|Aether Revolt|119|U|{3}{G}|Creature - Elf Druid|3|2|When Peema Aether-Seer enters the battlefield, you get an amount of {E} <i>(energy counters)</i> equal to the greatest power among creatures you control.$Pay {E}{E}{E}: Target creature blocks this turn if able.| Prey Upon|Aether Revolt|120|C|{G}|Sorcery|||Target creature you control fights target creature you don't control. <i>(Each deals damage equal to its power to the other.)</i>| Ridgescale Tusker|Aether Revolt|121|U|{3}{G}{G}|Creature - Beast|5|5|When Ridgescale Tusker enters the battlefield, put a +1/+1 counter on each other creature you control.| @@ -30509,7 +30509,7 @@ Implement of Combustion|Aether Revolt|155|C|{1}|Artifact|||{R}, Sacrifice Implem Implement of Examination|Aether Revolt|156|C|{3}|Artifact|||{U}, Sacrifice Implement of Examination: Draw a card.$When Implement of Examination is put into a graveard from the battleifeld, draw a card.| Implement of Ferocity|Aether Revolt|157|C|{1}|Artifact|||{G}, Sacrifice Implement of Ferocity: Put a +1/+1 counter on target creature. Activate this ability only any time you could cast a sorcery.$When Implement of Ferocity is put into a graveyard from the battlefield, draw a card.| Implement of Improvement|Aether Revolt|158|C|{1}|Artifact|||{W}, Sacrifice Implement of Improvement: You gain 2 life.$When Implement of Improvement is put into a graveyard from the battlefield, draw a card.| -Implement of Maliace|Aether Revolt|159|C|{2}|Artifact|||{B}, Sacrifice Implement of Malice: Target player discards a card. Activate this ability only any time you could cast a sorcery.$When Implement of Malice is put into a graveyard from the battlefield, draw a card.| +Implement of Malice|Aether Revolt|159|C|{2}|Artifact|||{B}, Sacrifice Implement of Malice: Target player discards a card. Activate this ability only any time you could cast a sorcery.$When Implement of Malice is put into a graveyard from the battlefield, draw a card.| Inspiring Statuary|Aether Revolt|160|R|{3}|Artifact|||Nonartifact spells you cast have improvise. <i>(Your artifacts can help cast those spells. Each artifact you tap after you're done activating mana abilities pays for {1}.)</i>| Irontread Crusher|Aether Revolt|161|C|{4}|Artifact - Vehicle|6|6|Crew 3 <i>(Tap any number of creatures you control with total power 3 or more: This Vehicle becomes an artifact creature until end of turn.)</i>| Lifecrafter's Bestiary|Aether Revolt|162|R|{3}|Artifact|||At the beginning of your upkeep, scry 1.$Whenever you cast a creature spell, you may pay {G}. If you do, draw a card.| @@ -30544,4 +30544,4 @@ Tezzeret, Master of Metal|Aether Revolt|190|M|{4}{U}{B}|Planeswalker - Tezzeret| Tezzeret's Betrayal|Aether Revolt|191|R|{3}{U}{B}|Sorcery|||Destroy target creature. You may search your library and/or graveyard for a card named Tezzeret, Master of Metal, reveal it, and put it into your hand. If you search your library this way, shuffle it.| Pendulum of Patterns|Aether Revolt|192|C|{2}|Artifact|||When Pendulum of Patterns enters the battlefield, you gain 3 life.${5}, {T}, Sacrifice Pendulum of Patterns: Draw a card.| Tezzeret's Simulacrum|Aether Revolt|193|U|{3}|Artifact Creature - Golem|2|3|{T}: Target opponent loses 1 life. If you control a Tezzeret planeswalker, that player loses 3 life instead.| -Submerged Boneyard|Aether Revolt|194|C||Land|||Submerged Boneyard enters the battlefield tapped.${T}: Add {U} or {B} to your mana pool.| \ No newline at end of file +Submerged Boneyard|Aether Revolt|194|C||Land|||Submerged Boneyard enters the battlefield tapped.${T}: Add {U} or {B} to your mana pool.|