From db74576397fae9c4562daac3f7c85a180b1d4766 Mon Sep 17 00:00:00 2001 From: Mark Langen Date: Tue, 11 Apr 2017 17:27:42 -0600 Subject: [PATCH] Added 4 cards from AHK * Added Cartouche of Strength * Added Nest of Scarabs (More correct implementation than existing one) * Added Soul-Scar Mage * Added Battlefield Scavenger --- .../mage/cards/b/BattlefieldScavenger.java | 109 ++++++++++++++ .../mage/cards/c/CartoucheOfKnowledge.java | 2 +- .../src/mage/cards/c/CartoucheOfStrength.java | 142 ++++++++++++++++++ Mage.Sets/src/mage/cards/n/NestOfScarabs.java | 61 ++------ Mage.Sets/src/mage/cards/s/SoulScarMage.java | 121 +++++++++++++++ Mage.Sets/src/mage/sets/Amonkhet.java | 3 + .../dynamicvalue/common/EffectKeyValue.java | 45 ++++++ .../effects/common/RummageEffect.java | 12 ++ .../mage/abilities/keyword/ExertAbility.java | 17 ++- 9 files changed, 459 insertions(+), 53 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/b/BattlefieldScavenger.java create mode 100644 Mage.Sets/src/mage/cards/c/CartoucheOfStrength.java create mode 100644 Mage.Sets/src/mage/cards/s/SoulScarMage.java create mode 100644 Mage/src/main/java/mage/abilities/dynamicvalue/common/EffectKeyValue.java create mode 100644 Mage/src/main/java/mage/abilities/effects/common/RummageEffect.java diff --git a/Mage.Sets/src/mage/cards/b/BattlefieldScavenger.java b/Mage.Sets/src/mage/cards/b/BattlefieldScavenger.java new file mode 100644 index 00000000000..a6184a253a2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BattlefieldScavenger.java @@ -0,0 +1,109 @@ +/* + * 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.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.AbilityImpl; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.RummageEffect; +import mage.abilities.keyword.ExertAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +/** + * + * @author anonymous + */ +public class BattlefieldScavenger extends CardImpl { + + public BattlefieldScavenger(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add("Jackal"); + this.subtype.add("Rogue"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // You may exert Battlefield Scavenger as it attacks. + this.addAbility(new ExertAbility(null, false)); + + // Whenever you exert a creature, you may discard a card. If you do, draw a card. + this.addAbility(new WheneverYouExertCreatureTriggeredAbility(new RummageEffect())); + } + + public BattlefieldScavenger(final BattlefieldScavenger card) { + super(card); + } + + @Override + public BattlefieldScavenger copy() { + return new BattlefieldScavenger(this); + } +} + + +class WheneverYouExertCreatureTriggeredAbility extends TriggeredAbilityImpl { + + WheneverYouExertCreatureTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + WheneverYouExertCreatureTriggeredAbility(final WheneverYouExertCreatureTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.BECOMES_EXERTED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + boolean weAreExerting = getControllerId().equals(event.getPlayerId()); + Permanent exerted = game.getPermanent(event.getTargetId()); + boolean exertedIsCreature = (exerted != null) && exerted.isCreature(); + return weAreExerting && exertedIsCreature; + } + + @Override + public WheneverYouExertCreatureTriggeredAbility copy() { + return new WheneverYouExertCreatureTriggeredAbility(this); + } + + @Override + public String getRule() { + return "Whenever you exert a creature, " + super.getRule(); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CartoucheOfKnowledge.java b/Mage.Sets/src/mage/cards/c/CartoucheOfKnowledge.java index f304bffecc7..7634b9852ea 100644 --- a/Mage.Sets/src/mage/cards/c/CartoucheOfKnowledge.java +++ b/Mage.Sets/src/mage/cards/c/CartoucheOfKnowledge.java @@ -71,7 +71,7 @@ public class CartoucheOfKnowledge extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); // Enchanted creature gets +1/+1 and has flying. - ability =new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)); Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); effect.setText("and has flying"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/c/CartoucheOfStrength.java b/Mage.Sets/src/mage/cards/c/CartoucheOfStrength.java new file mode 100644 index 00000000000..14197bb87b8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CartoucheOfStrength.java @@ -0,0 +1,142 @@ +/* + * 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.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetOpponentsCreaturePermanent; + +/** + * + * @author stravant + */ +public class CartoucheOfStrength extends CardImpl { + + public CartoucheOfStrength(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + + this.subtype.add("Aura"); + this.subtype.add("Cartouche"); + + // Enchant creature you control + TargetPermanent auraTarget = new TargetControlledCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Cartouche of Strength enters the battlefield, you may have enchanted creature fight target creature an opponent controls. + ability = new EntersBattlefieldTriggeredAbility(new FightEnchantedTargetEffect(), /* optional = */true); + ability.addTarget(new TargetOpponentsCreaturePermanent()); + this.addAbility(ability); + + // Enchanted creature gets +1/+1 and has trample. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)); + Effect effect = new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has trample"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public CartoucheOfStrength(final CartoucheOfStrength card) { + super(card); + } + + @Override + public CartoucheOfStrength copy() { + return new CartoucheOfStrength(this); + } +} + +/** + * + * @author stravant + */ +class FightEnchantedTargetEffect extends OneShotEffect { + public FightEnchantedTargetEffect() { + super(Outcome.Damage); + } + + public FightEnchantedTargetEffect(final FightEnchantedTargetEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent != null) { + Permanent originalCreature = game.getPermanentOrLKIBattlefield(sourcePermanent.getAttachedTo()); + if (originalCreature != null) { + Permanent enchantedCreature = game.getPermanent(sourcePermanent.getAttachedTo()); + // only if target is legal the effect will be applied + if (source.getTargets().get(0).isLegal(source, game)) { + Permanent creature1 = game.getPermanent(source.getTargets().get(0).getFirstTarget()); + // 20110930 - 701.10 + if (creature1 != null && enchantedCreature != null) { + if (creature1.isCreature() && enchantedCreature.isCreature()) { + return enchantedCreature.fight(creature1, source, game); + } + } + } + if (!game.isSimulation()) + game.informPlayers(originalCreature.getLogName() + ": Fighting effect has been fizzled."); + } + } + return false; + } + + @Override + public FightEnchantedTargetEffect copy() { + return new FightEnchantedTargetEffect(this); + } + + @Override + public String getText(Mode mode) { + return "you may have enchanted creature fight target creature an opponent controls."; + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/n/NestOfScarabs.java b/Mage.Sets/src/mage/cards/n/NestOfScarabs.java index 7ef0c72c90e..b844353245c 100644 --- a/Mage.Sets/src/mage/cards/n/NestOfScarabs.java +++ b/Mage.Sets/src/mage/cards/n/NestOfScarabs.java @@ -28,16 +28,14 @@ package mage.cards.n; import java.util.UUID; + import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.EffectKeyValue; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; @@ -47,7 +45,7 @@ import mage.game.permanent.token.Token; /** * - * @author Styxo + * @author stravant */ public class NestOfScarabs extends CardImpl { @@ -55,7 +53,8 @@ public class NestOfScarabs extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); // Whenever you put one or more -1/-1 counters on a creature, create that many 1/1 black Insect tokens. - this.addAbility(new NestOfScarabsTriggeredAbility(new NestOfScarabsEffect(), false)); + this.addAbility(new NestOfScarabsTriggeredAbility()); + } public NestOfScarabs(final NestOfScarabs card) { @@ -70,11 +69,11 @@ public class NestOfScarabs extends CardImpl { class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl { - public NestOfScarabsTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); + NestOfScarabsTriggeredAbility() { + super(Zone.BATTLEFIELD, new CreateTokenEffect(new BlackInsectToken(), new EffectKeyValue("countersAdded"))); } - public NestOfScarabsTriggeredAbility(NestOfScarabsTriggeredAbility ability) { + NestOfScarabsTriggeredAbility(final NestOfScarabsTriggeredAbility ability) { super(ability); } @@ -85,20 +84,19 @@ class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getData().equals(CounterType.M1M1.getName())) { + boolean weAreDoingIt = getControllerId().equals(game.getControllerId(event.getSourceId())); + boolean isM1M1Counters = event.getData().equals(CounterType.M1M1.getName()); + if (weAreDoingIt && isM1M1Counters) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); if (permanent == null) { permanent = game.getPermanentEntering(event.getTargetId()); } - if (permanent != null && permanent.isCreature()) { - this.getEffects().forEach((effect) -> { - effect.setValue("countersAdded", event.getAmount()); - }); + if (permanent.isCreature()) { + getEffects().forEach(effect -> effect.setValue("countersAdded", event.getAmount())); return true; } } return false; - } @Override @@ -108,40 +106,13 @@ class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Whenever you put one or more -1/-1 counters on a creature, " + super.getRule(); - } -} - -class NestOfScarabsEffect extends OneShotEffect { - - public NestOfScarabsEffect() { - super(Outcome.Benefit); - this.staticText = "create that many 1/1 black Insect tokens"; - } - - public NestOfScarabsEffect(final NestOfScarabsEffect effect) { - super(effect); - } - - @Override - public NestOfScarabsEffect copy() { - return new NestOfScarabsEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - int countersAdded = (Integer) this.getValue("countersAdded"); - if (countersAdded > 0) { - return new CreateTokenEffect(new BlackInsectToken(), countersAdded).apply(game, source); - } - return false; + return "Whenever you put one or more -1/-1 counters on a creature, create that many 1/1 black Insect tokens."; } } class BlackInsectToken extends Token { - - public BlackInsectToken() { - super("Insect", "1/1 black Insect creature token"); + BlackInsectToken() { + super("Insect", "1/1 black Insect token"); cardType.add(CardType.CREATURE); color.setBlack(true); subtype.add("Insect"); diff --git a/Mage.Sets/src/mage/cards/s/SoulScarMage.java b/Mage.Sets/src/mage/cards/s/SoulScarMage.java new file mode 100644 index 00000000000..4f12aa3ba96 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SoulScarMage.java @@ -0,0 +1,121 @@ +/* + * 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.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.ProwessAbility; +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.counters.CounterType; +import mage.game.Game; +import mage.game.events.DamageCreatureEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author stravant + */ +public class SoulScarMage extends CardImpl { + + public SoulScarMage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}"); + + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Prowess + this.addAbility(new ProwessAbility()); + + // If a source you control would deal noncombat damage to a creature an opponent controls, put that many -1/-1 counters on that creature instead. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SoulScarMageDamageReplacementEffect())); + } + + public SoulScarMage(final SoulScarMage card) { + super(card); + } + + @Override + public SoulScarMage copy() { + return new SoulScarMage(this); + } +} + +class SoulScarMageDamageReplacementEffect extends ReplacementEffectImpl { + + public SoulScarMageDamageReplacementEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "If a source you control would deal noncombat damage to a creature an opponent controls, put that many -1/-1 counters on that creature instead."; + } + + public SoulScarMageDamageReplacementEffect(final SoulScarMageDamageReplacementEffect effect) { + super(effect); + } + + @Override + public SoulScarMageDamageReplacementEffect copy() { + return new SoulScarMageDamageReplacementEffect(this); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent toGetCounters = game.getPermanent(event.getTargetId()); + if (toGetCounters != null) { + AddCountersTargetEffect addCounters = new AddCountersTargetEffect(CounterType.M1M1.createInstance(), new StaticValue(event.getAmount())); + addCounters.setTargetPointer(new FixedTarget(toGetCounters.getId())); + addCounters.apply(game, source); + return true; + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGE_CREATURE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + boolean weControlSource = game.getControllerId(event.getSourceId()).equals(source.getControllerId()); + boolean isNoncombatDamage = !((DamageCreatureEvent)event).isCombatDamage(); + return weControlSource && isNoncombatDamage; + } +} diff --git a/Mage.Sets/src/mage/sets/Amonkhet.java b/Mage.Sets/src/mage/sets/Amonkhet.java index cec12836493..60c7d438bea 100644 --- a/Mage.Sets/src/mage/sets/Amonkhet.java +++ b/Mage.Sets/src/mage/sets/Amonkhet.java @@ -74,11 +74,13 @@ public class Amonkhet extends ExpansionSet { cards.add(new SetCardInfo("Archfiend of Ifnir", 78, Rarity.RARE, mage.cards.a.ArchfiendOfIfnir.class)); cards.add(new SetCardInfo("As Foretold", 42, Rarity.MYTHIC, mage.cards.a.AsForetold.class)); cards.add(new SetCardInfo("Aven Mindcensor", 5, Rarity.RARE, mage.cards.a.AvenMindcensor.class)); + cards.add(new SetCardInfo("Battlefield Scavenger", 118, Rarity.UNCOMMON, mage.cards.b.BattlefieldScavenger.class)); cards.add(new SetCardInfo("Bontu's Monument", 225, Rarity.UNCOMMON, mage.cards.b.BontusMonument.class)); cards.add(new SetCardInfo("Canyon Slough", 239, Rarity.RARE, mage.cards.c.CanyonSlough.class)); cards.add(new SetCardInfo("Cartouche of Ambition", 83, Rarity.COMMON, mage.cards.c.CartoucheOfAmbition.class)); cards.add(new SetCardInfo("Cartouche of Knowledge", 45, Rarity.COMMON, mage.cards.c.CartoucheOfKnowledge.class)); cards.add(new SetCardInfo("Cartouche of Solidarity", 7, Rarity.COMMON, mage.cards.c.CartoucheOfSolidarity.class)); + cards.add(new SetCardInfo("Cartouche of Strength", 158, Rarity.COMMON, mage.cards.c.CartoucheOfStrength.class)); cards.add(new SetCardInfo("Cartouche of Zeal", 124, Rarity.COMMON, mage.cards.c.CartoucheOfZeal.class)); cards.add(new SetCardInfo("Cast Out", 8, Rarity.UNCOMMON, mage.cards.c.CastOut.class)); cards.add(new SetCardInfo("Censor", 46, Rarity.UNCOMMON, mage.cards.c.Censor.class)); @@ -184,6 +186,7 @@ public class Amonkhet extends ExpansionSet { cards.add(new SetCardInfo("Scribe of the Mindful", 68, Rarity.COMMON, mage.cards.s.ScribeOfTheMindful.class)); cards.add(new SetCardInfo("Sheltered Thicket", 248, Rarity.RARE, mage.cards.s.ShelteredThicket.class)); cards.add(new SetCardInfo("Sixth Sense", 187, Rarity.UNCOMMON, mage.cards.s.SixthSense.class)); + cards.add(new SetCardInfo("Soul-Scar Mage", 149, Rarity.RARE, mage.cards.s.SoulScarMage.class)); cards.add(new SetCardInfo("Spidery Grasp", 188, Rarity.COMMON, mage.cards.s.SpideryGrasp.class)); cards.add(new SetCardInfo("Splendid Agony", 109, Rarity.COMMON, mage.cards.s.SplendidAgony.class)); cards.add(new SetCardInfo("Supply Caravan", 30, Rarity.COMMON, mage.cards.s.SupplyCaravan.class)); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/EffectKeyValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/EffectKeyValue.java new file mode 100644 index 00000000000..1b6e03eb648 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/EffectKeyValue.java @@ -0,0 +1,45 @@ +package mage.abilities.dynamicvalue.common; + + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; + +/** + * @author stravant + */ +public class EffectKeyValue implements DynamicValue { + private String key; + private String description; + + public EffectKeyValue(String key) { + this.key = key; + this.description = key; + } + + public EffectKeyValue(String key, String description) { + this(key); + this.description = description; + } + + @Override + public int calculate(Game game, Ability source, Effect effect) { + return (Integer)effect.getValue(key); + } + + @Override + public EffectKeyValue copy(){ + return new EffectKeyValue(this.key, this.description); + } + + @Override + public String toString() { + return "equal to"; + } + + @Override + public String getMessage() { + return description; + } +} \ No newline at end of file diff --git a/Mage/src/main/java/mage/abilities/effects/common/RummageEffect.java b/Mage/src/main/java/mage/abilities/effects/common/RummageEffect.java new file mode 100644 index 00000000000..6df19ab2ddb --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/RummageEffect.java @@ -0,0 +1,12 @@ +package mage.abilities.effects.common; + +import mage.abilities.costs.common.DiscardCardCost; + +/** + * @author stravant + */ +public class RummageEffect extends DoIfCostPaid { + public RummageEffect() { + super(new DrawCardSourceControllerEffect(1), new DiscardCardCost()); + } +} \ No newline at end of file diff --git a/Mage/src/main/java/mage/abilities/keyword/ExertAbility.java b/Mage/src/main/java/mage/abilities/keyword/ExertAbility.java index 323118d132c..dde33b839d1 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ExertAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ExertAbility.java @@ -55,7 +55,7 @@ import mage.watchers.Watcher; */ public class ExertAbility extends SimpleStaticAbility { - final private String ruleText; + private String ruleText; public ExertAbility(BecomesExertSourceTriggeredAbility ability) { this(ability, false); @@ -63,14 +63,17 @@ public class ExertAbility extends SimpleStaticAbility { public ExertAbility(BecomesExertSourceTriggeredAbility ability, boolean exertOnlyOncePerTurn) { super(Zone.BATTLEFIELD, new ExertReplacementEffect(exertOnlyOncePerTurn)); - this.addSubAbility(ability); ruleText = (exertOnlyOncePerTurn ? "If {this} hasn't been exerted this turn, you may exert it" - : "You may exert {this}") - + " as it attacks. When you do, " - + ability.getEffects().get(0).getText(ability.getModes().getMode()) - + ". (An exterted creature can't untap during your next untap step)"; - ability.setRuleVisible(false); + : "You may exert {this}") + " as it attacks. "; + if (ability != null) { + this.addSubAbility(ability); + ruleText += ("When you do, " + + ability.getEffects().get(0).getText(ability.getModes().getMode()) + + ". "); + ability.setRuleVisible(false); + } + ruleText += "(An exterted creature can't untap during your next untap step)"; if (exertOnlyOncePerTurn) { getWatchers().add(new ExertedThisTurnWatcher()); }