diff --git a/Mage.Client/release/sample-decks/Commander/Commander 2014/Forged in Stone.dck b/Mage.Client/release/sample-decks/Commander/Commander 2014/Forged in Stone.dck new file mode 100644 index 00000000000..27c8989c910 --- /dev/null +++ b/Mage.Client/release/sample-decks/Commander/Commander 2014/Forged in Stone.dck @@ -0,0 +1,73 @@ +NAME:Forged in Stone +1 [C14:56] Loreseeker's Stone +1 [C14:54] Commander's Sphere +1 [C14:53] Assault Suit +1 [C14:97] Wing Shards +1 [C14:96] Whitemane Lion +1 [C14:95] White Sun's Zenith +1 [C14:94] Twilight Shepherd +1 [C14:93] True Conviction +1 [C14:229] Bonehoard +1 [C14:228] Argentum Armor +1 [C14:59] Arcane Lighthouse +1 [C14:57] Masterwork of Ingenuity +1 [C14:303] Karoo +1 [C14:268] Skullclamp +1 [C14:260] Pearl Medallion +1 [C14:67] Cathars' Crusade +1 [C14:66] Brave the Elements +1 [C14:65] Armistice +1 [C14:64] Afterlife +1 [C14:63] Adarkar Valkyrie +8 [C14:319] Plains +8 [C14:318] Plains +1 [C14:69] Condemn +1 [C14:68] Celestial Crusader +1 [C14:314] Temple of the False God +1 [C14:310] Secluded Steppe +1 [C14:276] Sword of Vengeance +1 [C14:275] Swiftfoot Boots +1 [C14:274] Strata Scythe +1 [C14:70] Decree of Justice +1 [C14:270] Sol Ring +1 [C14:78] Martial Coup +1 [C14:77] Marshal's Anthem +1 [C14:76] Kor Sanctifiers +1 [C14:75] Kemba, Kha Regent +1 [C14:74] Grand Abolisher +1 [C14:73] Gift of Estates +1 [C14:72] Geist-Honored Monk +1 [C14:71] Flickerwisp +1 [C14:9] Jazal Goldmane +1 [C14:8] Hallowed Spiritkeeper +1 [C14:249] Mask of Memory +1 [C14:7] Fell the Mighty +1 [C14:79] Mentor of the Meek +1 [C14:248] Marble Diamond +1 [C14:6] Deploy to the Front +1 [C14:5] Containment Priest +1 [C14:247] Loxodon Warhammer +1 [C14:4] Comeuppance +1 [C14:3] Benevolent Offering +1 [C14:2] Angelic Field Marshal +8 [C14:321] Plains +1 [C14:1] Angel of the Dire Hour +8 [C14:320] Plains +1 [C14:81] Mobilization +1 [C14:80] Midnight Haunting +1 [C14:89] Skyhunter Skirmisher +1 [C14:88] Silverblade Paladin +1 [C14:87] Serra Avatar +1 [C14:86] Sacred Mesa +1 [C14:85] Return to Dust +1 [C14:84] Requiem Angel +1 [C14:83] Oblation +1 [C14:82] Nomads' Assembly +1 [C14:298] Ghost Quarter +1 [C14:251] Moonsilver Spear +1 [C14:92] Sunblast Angel +1 [C14:91] Sun Titan +1 [C14:293] Emeria, the Sky Ruin +1 [C14:90] Spectral Procession +1 [C14:292] Drifting Meadow +SB: 1 [C14:10] Nahiri, the Lithomancer diff --git a/Mage.Client/serverlist.txt b/Mage.Client/serverlist.txt index 51d64c0dfc3..f88f98b2c53 100644 --- a/Mage.Client/serverlist.txt +++ b/Mage.Client/serverlist.txt @@ -1,5 +1,5 @@ woogerworks (Version 1.3.0 dev 2014-10-08V1) :xmage.woogerworks.com:17171 -XMage.info 1 (Version 1.3.0 dev 2014-11-08v1) :176.31.186.181:17171 -XMage.info 2 (Version 1.3.0 dev 2014-11-08V1) :176.31.186.181:17000 +XMage.info 1 (Version 1.3.0 dev 2014-11-29v1) :176.31.186.181:17171 +XMage.info 2 (Version 1.3.0 dev 2014-11-29V1) :176.31.186.181:17000 Seedds Server (Version 1.3.0 dev 2014-11-08v1) :115.29.203.80:17171 localhost -> connect to your local server (must be started):localhost:17171 diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java index 59bcc9b7ed9..4b443351f06 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java @@ -221,11 +221,11 @@ public class ComputerPlayer7 extends ComputerPlayer6 { logger.debug("Sim Calculate post combat actions ----------------------------------------------------------------------------------------"); addActionsTimed(); - if (root.children.size() > 0) { + if (root != null && root.children.size() > 0) { root = root.children.get(0); int bestScore = root.getScore(); if (bestScore > currentScore || allowBadMoves) { - actions = new LinkedList(root.abilities); + actions = new LinkedList<>(root.abilities); combat = root.combat; } else { logger.debug("[" + game.getPlayer(playerId).getName() + "] no better score current: " + currentScore + " bestScore: " + bestScore ); diff --git a/Mage.Sets/src/mage/sets/bornofthegods/AcolytesReward.java b/Mage.Sets/src/mage/sets/bornofthegods/AcolytesReward.java index 689f255f293..baec1ad1db9 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/AcolytesReward.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/AcolytesReward.java @@ -77,7 +77,7 @@ class AcolytesRewardEffect extends PreventionEffectImpl { public AcolytesRewardEffect() { super(Duration.EndOfTurn); - staticText = "Prevent the next X damage that would be dealt to target creature this turn, where X is your devotion to white. If damage is prevented this way, {this} deals that much damage to target creature or player."; + staticText = "Prevent the next X damage that would be dealt to target creature this turn, where X is your devotion to white. If damage is prevented this way, {this} deals that much damage to target creature or player"; } public AcolytesRewardEffect(final AcolytesRewardEffect effect) { diff --git a/Mage.Sets/src/mage/sets/commander2014/AngelOfTheDireHour.java b/Mage.Sets/src/mage/sets/commander2014/AngelOfTheDireHour.java new file mode 100644 index 00000000000..e28c8532144 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/AngelOfTheDireHour.java @@ -0,0 +1,80 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.CastFromHandCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.ExileAllEffect; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.watchers.common.CastFromHandWatcher; + +/** + * + * @author LevelX2 + */ +public class AngelOfTheDireHour extends CardImpl { + + public AngelOfTheDireHour(UUID ownerId) { + super(ownerId, 1, "Angel of the Dire Hour", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{W}{W}"); + this.expansionSetCode = "C14"; + this.subtype.add("Angel"); + + this.color.setWhite(true); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Angel of the Dire Hour enters the battlefield, if you cast it from your hand, exile all attacking creatures. + Ability ability = new EntersBattlefieldTriggeredAbility( + new ConditionalOneShotEffect(new ExileAllEffect(new FilterAttackingCreature("attacking creatures")), new CastFromHandCondition(), + " if you cast it from your hand, exile all attacking creatures")); + this.addAbility(ability); + this.addWatcher(new CastFromHandWatcher()); + } + + public AngelOfTheDireHour(final AngelOfTheDireHour card) { + super(card); + } + + @Override + public AngelOfTheDireHour copy() { + return new AngelOfTheDireHour(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/Armistice.java b/Mage.Sets/src/mage/sets/commander2014/Armistice.java new file mode 100644 index 00000000000..13b033ae041 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/Armistice.java @@ -0,0 +1,75 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class Armistice extends CardImpl { + + public Armistice(UUID ownerId) { + super(ownerId, 65, "Armistice", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + this.expansionSetCode = "C14"; + + this.color.setWhite(true); + + // {3}{W}{W}: You draw a card and target opponent gains 3 life. + Effect effect = new DrawCardSourceControllerEffect(1); + effect.setText("You draw a card"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}{W}{W}")); + effect = new GainLifeTargetEffect(3); + effect.setText("and target opponent gains 3 life"); + ability.addEffect(effect); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + + } + + public Armistice(final Armistice card) { + super(card); + } + + @Override + public Armistice copy() { + return new Armistice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/BenevolentOffering.java b/Mage.Sets/src/mage/sets/commander2014/BenevolentOffering.java new file mode 100644 index 00000000000..3bb03f7f4ac --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/BenevolentOffering.java @@ -0,0 +1,145 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.CreateTokenTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.token.SpiritWhiteToken; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class BenevolentOffering extends CardImpl { + + public BenevolentOffering(UUID ownerId) { + super(ownerId, 3, "Benevolent Offering", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{W}"); + this.expansionSetCode = "C14"; + + this.color.setWhite(true); + + // Choose an opponent. You and that player each put three 1/1 white Spirit creature tokens with flying onto the battlefield. + this.getSpellAbility().addEffect(new BenevolentOfferingEffect1()); + + // Choose an opponent. You gain 2 life for each creature you control and that player gains 2 life for each creature he or she controls. + this.getSpellAbility().addEffect(new BenevolentOfferingEffect2()); + } + + public BenevolentOffering(final BenevolentOffering card) { + super(card); + } + + @Override + public BenevolentOffering copy() { + return new BenevolentOffering(this); + } +} + +class BenevolentOfferingEffect1 extends OneShotEffect { + + BenevolentOfferingEffect1() { + super(Outcome.Sacrifice); + this.staticText = "Choose an opponent. You and that player each put three 1/1 white Spirit creature tokens with flying onto the battlefield"; + } + + BenevolentOfferingEffect1(final BenevolentOfferingEffect1 effect) { + super(effect); + } + + @Override + public BenevolentOfferingEffect1 copy() { + return new BenevolentOfferingEffect1(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Target target = new TargetOpponent(true); + target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), game); + Player opponent = game.getPlayer(target.getFirstTarget()); + if (opponent != null) { + Effect effect = new CreateTokenTargetEffect(new SpiritWhiteToken("C14"), 3); + effect.setTargetPointer(new FixedTarget(opponent.getId())); + effect.apply(game, source); + new CreateTokenEffect(new SpiritWhiteToken("C14"), 3).apply(game, source); + return true; + } + } + return false; + } +} + +class BenevolentOfferingEffect2 extends OneShotEffect { + + BenevolentOfferingEffect2() { + super(Outcome.Sacrifice); + this.staticText = "Choose an opponent. You gain 2 life for each creature you control and that player gains 2 life for each creature he or she controls"; + } + + BenevolentOfferingEffect2(final BenevolentOfferingEffect2 effect) { + super(effect); + } + + @Override + public BenevolentOfferingEffect2 copy() { + return new BenevolentOfferingEffect2(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Target target = new TargetOpponent(true); + target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), game); + Player opponent = game.getPlayer(target.getFirstTarget()); + if (opponent != null) { + int count = game.getBattlefield().countAll(new FilterCreaturePermanent(), controller.getId(), game); + controller.gainLife(count, game); + count = game.getBattlefield().countAll(new FilterCreaturePermanent(), opponent.getId(), game); + opponent.gainLife(count, game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/BreachingLeviathan.java b/Mage.Sets/src/mage/sets/commander2014/BreachingLeviathan.java index e8f6804e6db..7953503c796 100644 --- a/Mage.Sets/src/mage/sets/commander2014/BreachingLeviathan.java +++ b/Mage.Sets/src/mage/sets/commander2014/BreachingLeviathan.java @@ -37,7 +37,6 @@ import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SkipNextUntapTargetEffect; -import mage.abilities.effects.common.SkipUntapAllEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; diff --git a/Mage.Sets/src/mage/sets/commander2014/Comeuppance.java b/Mage.Sets/src/mage/sets/commander2014/Comeuppance.java new file mode 100644 index 00000000000..8d959b5815e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/Comeuppance.java @@ -0,0 +1,152 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.PreventionEffectData; +import mage.abilities.effects.PreventionEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import mage.players.Player; +import org.apache.log4j.Logger; + +/** + * + * @author LevelX2 + */ +public class Comeuppance extends CardImpl { + + public Comeuppance(UUID ownerId) { + super(ownerId, 4, "Comeuppance", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{W}"); + this.expansionSetCode = "C14"; + + this.color.setWhite(true); + + // Prevent all damage that would be dealt to you and planeswalkers you control this turn by sources you don't control. If damage from a creature source is prevented this way, Comeuppance deals that much damage to that creature. If damage from a noncreature source is prevented this way, Comeuppance deals that much damage to the source's controller. + this.getSpellAbility().addEffect(new ComeuppanceEffect()); + + } + + public Comeuppance(final Comeuppance card) { + super(card); + } + + @Override + public Comeuppance copy() { + return new Comeuppance(this); + } +} +class ComeuppanceEffect extends PreventionEffectImpl { + + public ComeuppanceEffect() { + super(Duration.EndOfTurn, Integer.MAX_VALUE, false, false); + staticText = "Prevent all damage that would be dealt to you and planeswalkers you control this turn by sources you don't control. If damage from a creature source is prevented this way, {this} deals that much damage to that creature. If damage from a noncreature source is prevented this way, {this} deals that much damage to the source's controller"; + } + + public ComeuppanceEffect(final ComeuppanceEffect effect) { + super(effect); + } + + @Override + public ComeuppanceEffect copy() { + return new ComeuppanceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + PreventionEffectData preventionData = preventDamageAction(event, source, game); + if (preventionData.getPreventedDamage() > 0) { + MageObject damageDealingObject = game.getObject(event.getSourceId()); + UUID objectControllerId = null; + if (damageDealingObject instanceof Permanent) { + if (((Permanent) damageDealingObject).getCardType().contains(CardType.CREATURE)) { + ((Permanent) damageDealingObject).damage(preventionData.getPreventedDamage(), source.getSourceId(), game, false, true); + } else { + objectControllerId = ((Permanent) damageDealingObject).getControllerId(); + } + } else if (damageDealingObject instanceof Ability) { + objectControllerId = ((Ability) damageDealingObject).getControllerId(); + } else if (damageDealingObject instanceof Spell) { + objectControllerId = ((Spell) damageDealingObject).getControllerId(); + } + if (objectControllerId != null) { + Player objectController = game.getPlayer(objectControllerId); + if (objectController != null) { + objectController.damage(preventionData.getPreventedDamage(), source.getSourceId(), game, false, true); + } + } + } + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (!super.applies(event, source, game)) { + return false; + } + boolean catched = false; + if (event.getTargetId().equals(source.getControllerId())) { + catched = true; + } else { + Permanent targetPermanent = game.getPermanent(event.getTargetId()); + if (targetPermanent != null && + targetPermanent.getControllerId().equals(source.getControllerId()) && + targetPermanent.getCardType().contains(CardType.PLANESWALKER)) { + catched = true; + } + } + if (catched) { + MageObject damageSource = game.getObject(event.getSourceId()); + if (damageSource instanceof StackObject) { + return !((StackObject) damageSource).getControllerId().equals(source.getControllerId()); + } else if (damageSource instanceof Permanent) { + return !((Permanent) damageSource).getControllerId().equals(source.getControllerId()); + } else if (damageSource instanceof Card) { + return !((Card) damageSource).getOwnerId().equals(source.getControllerId()); + } + Logger.getLogger(Comeuppance.class).error("Comeuppance: could not define source objects controller - " + (damageSource != null ? damageSource.getName(): "null")); + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/commander2014/ContainmentPriest.java b/Mage.Sets/src/mage/sets/commander2014/ContainmentPriest.java new file mode 100644 index 00000000000..f94d5bc97c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/ContainmentPriest.java @@ -0,0 +1,193 @@ +/* + * 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.sets.commander2014; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.FlashAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.WatcherScope; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.watchers.Watcher; + +/** + * + * @author LevelX2 + */ +public class ContainmentPriest extends CardImpl { + + public ContainmentPriest(UUID ownerId) { + super(ownerId, 5, "Containment Priest", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "C14"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // If a nontoken creature would enter the battlefield and it wasn't cast, exile it instead. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ContainmentPriestReplacementEffect())); + this.addWatcher(new CreatureCastWatcher()); + } + + public ContainmentPriest(final ContainmentPriest card) { + super(card); + } + + @Override + public ContainmentPriest copy() { + return new ContainmentPriest(this); + } +} + +class ContainmentPriestReplacementEffect extends ReplacementEffectImpl { + + private static final FilterCreatureCard filter = new FilterCreatureCard(); + + static { + filter.add(Predicates.not(new TokenPredicate())); + } + + public ContainmentPriestReplacementEffect() { + super(Duration.WhileOnBattlefield, Outcome.GainControl); + staticText = "If a nontoken creature would enter the battlefield and it wasn't cast, exile it instead"; + } + + public ContainmentPriestReplacementEffect(final ContainmentPriestReplacementEffect effect) { + super(effect); + } + + @Override + public ContainmentPriestReplacementEffect copy() { + return new ContainmentPriestReplacementEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (controller != null) { + Card card = game.getCard(event.getTargetId()); + if (card != null) { + controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, zEvent.getFromZone()); + } + return true; + + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE + && ((ZoneChangeEvent) event).getToZone() == Zone.BATTLEFIELD) { + Card card = game.getCard(event.getTargetId()); + if (card.getCardType().contains(CardType.CREATURE)) { // TODO: Bestow Card cast as Enchantment probably not handled correctly + CreatureCastWatcher watcher = (CreatureCastWatcher) game.getState().getWatchers().get("CreatureWasCast"); + if (watcher != null && !watcher.wasCreatureCastThisTurn(event.getTargetId())) { + return true; + } + } + } + return false; + } +} + +class CreatureCastWatcher extends Watcher { + + private final Set creaturesCasted = new HashSet<>(); + + public CreatureCastWatcher() { + super("CreatureWasCast", WatcherScope.GAME); + } + + public CreatureCastWatcher(final CreatureCastWatcher watcher) { + super(watcher); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST) { + Spell spell = (Spell) game.getObject(event.getTargetId()); + if (spell != null) { + Card card = game.getCard(spell.getSourceId()); + if (card != null && card.getCardType().contains(CardType.CREATURE)) { + creaturesCasted.add(card.getId()); + } + } + } + if (event.getType() == GameEvent.EventType.ZONE_CHANGE + && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { + Card card = game.getCard(event.getTargetId()); + if (card != null && card.getCardType().contains(CardType.CREATURE)) { + creaturesCasted.remove(card.getId()); + } + } + } + + public boolean wasCreatureCastThisTurn(UUID creatureSourceId) { + return creaturesCasted.contains(creatureSourceId); + } + + @Override + public void reset() { + super.reset(); + creaturesCasted.clear(); + } + + @Override + public CreatureCastWatcher copy() { + return new CreatureCastWatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/DeployToTheFront.java b/Mage.Sets/src/mage/sets/commander2014/DeployToTheFront.java new file mode 100644 index 00000000000..1c03d160129 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/DeployToTheFront.java @@ -0,0 +1,66 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.permanent.token.SoldierToken; + +/** + * + * @author LevelX2 + */ +public class DeployToTheFront extends CardImpl { + + public DeployToTheFront(UUID ownerId) { + super(ownerId, 6, "Deploy to the Front", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{W}{W}"); + this.expansionSetCode = "C14"; + + this.color.setWhite(true); + + // Put X 1/1 white Soldier creature tokens onto the battlefield, where X is the number of creatures on the battlefield. + Effect effect = new CreateTokenEffect(new SoldierToken("C14"), new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("the number of creatures on the battlefield"))); + effect.setText("Put X 1/1 white Soldier creature tokens onto the battlefield, where X is the number of creatures on the battlefield"); + this.getSpellAbility().addEffect(effect); + } + + public DeployToTheFront(final DeployToTheFront card) { + super(card); + } + + @Override + public DeployToTheFront copy() { + return new DeployToTheFront(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/FellTheMighty.java b/Mage.Sets/src/mage/sets/commander2014/FellTheMighty.java new file mode 100644 index 00000000000..dba76a6db55 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/FellTheMighty.java @@ -0,0 +1,101 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class FellTheMighty extends CardImpl { + + public FellTheMighty(UUID ownerId) { + super(ownerId, 7, "Fell the Mighty", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}"); + this.expansionSetCode = "C14"; + + this.color.setWhite(true); + + // Destroy all creatures with power greater than target creature's power. + this.getSpellAbility().addEffect(new FellTheMightyEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + } + + public FellTheMighty(final FellTheMighty card) { + super(card); + } + + @Override + public FellTheMighty copy() { + return new FellTheMighty(this); + } +} + +class FellTheMightyEffect extends OneShotEffect { + + public FellTheMightyEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Destroy all creatures with power greater than target creature's power"; + } + + public FellTheMightyEffect(final FellTheMightyEffect effect) { + super(effect); + } + + @Override + public FellTheMightyEffect copy() { + return new FellTheMightyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent targetCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); + if (controller != null && targetCreature != null) { + for(Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { + if (permanent.getPower().getValue() > targetCreature.getPower().getValue()) { + permanent.destroy(source.getSourceId(), game, false); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/GiftOfEstates.java b/Mage.Sets/src/mage/sets/commander2014/GiftOfEstates.java new file mode 100644 index 00000000000..1ff5d729196 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/GiftOfEstates.java @@ -0,0 +1,67 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.abilities.condition.common.OpponentControllsMoreCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterBasicLandCard; +import mage.filter.common.FilterLandPermanent; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ +public class GiftOfEstates extends CardImpl { + + public GiftOfEstates(UUID ownerId) { + super(ownerId, 73, "Gift of Estates", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}"); + this.expansionSetCode = "C14"; + + this.color.setWhite(true); + + // If an opponent controls more lands than you, search your library for up to three Plains cards, reveal them, and put them into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true), + new OpponentControllsMoreCondition(new FilterLandPermanent("lands")))); + } + + public GiftOfEstates(final GiftOfEstates card) { + super(card); + } + + @Override + public GiftOfEstates copy() { + return new GiftOfEstates(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/JazalGoldmane.java b/Mage.Sets/src/mage/sets/commander2014/JazalGoldmane.java new file mode 100644 index 00000000000..3bd95330d2d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/JazalGoldmane.java @@ -0,0 +1,80 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.AttackingCreatureCount; +import mage.abilities.effects.common.continious.BoostControlledEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterAttackingCreature; + +/** + * + * @author LevelX2 + */ +public class JazalGoldmane extends CardImpl { + + public JazalGoldmane(UUID ownerId) { + super(ownerId, 9, "Jazal Goldmane", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "C14"; + this.supertype.add("Legendary"); + this.subtype.add("Cat"); + this.subtype.add("Warrior"); + + this.color.setWhite(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {3}{W}{W}: Attacking creatures you control get +X/+X until end of turn, where X is the number of attacking creatures. + DynamicValue xValue = new AttackingCreatureCount("the number of attacking creatures"); + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new BoostControlledEffect(xValue, xValue , Duration.WhileOnBattlefield, new FilterAttackingCreature("Attacking creatures"), false), + new ManaCostsImpl("{3}{W}{W}"))); + } + + public JazalGoldmane(final JazalGoldmane card) { + super(card); + } + + @Override + public JazalGoldmane copy() { + return new JazalGoldmane(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/MasterworkOfIngenuity.java b/Mage.Sets/src/mage/sets/commander2014/MasterworkOfIngenuity.java new file mode 100644 index 00000000000..7485d6c1534 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/MasterworkOfIngenuity.java @@ -0,0 +1,77 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.common.CopyPermanentEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LevelX2 + */ +public class MasterworkOfIngenuity extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("artifact"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new SubtypePredicate("Equipment")); + } + + public MasterworkOfIngenuity(UUID ownerId) { + super(ownerId, 57, "Masterwork of Ingenuity", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "C14"; + this.subtype.add("Equipment"); + + // You may have Masterwork of Ingenuity enter the battlefield as a copy of any Equipment on the battlefield. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( + new CopyPermanentEffect(filter), + "You may have {this} enter the battlefield as a copy of any Equipment on the battlefield", + true)); + this.addAbility(ability); + + } + + public MasterworkOfIngenuity(final MasterworkOfIngenuity card) { + super(card); + } + + @Override + public MasterworkOfIngenuity copy() { + return new MasterworkOfIngenuity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/WhitemaneLion.java b/Mage.Sets/src/mage/sets/commander2014/WhitemaneLion.java new file mode 100644 index 00000000000..b9793dba96a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2014/WhitemaneLion.java @@ -0,0 +1,70 @@ +/* + * 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.sets.commander2014; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class WhitemaneLion extends CardImpl { + + public WhitemaneLion(UUID ownerId) { + super(ownerId, 96, "Whitemane Lion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "C14"; + this.subtype.add("Cat"); + + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // When Whitemane Lion enters the battlefield, return a creature you control to its owner's hand. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandChosenControlledPermanentEffect(new FilterControlledCreaturePermanent()))); + + } + + public WhitemaneLion(final WhitemaneLion card) { + super(card); + } + + @Override + public WhitemaneLion copy() { + return new WhitemaneLion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java b/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java index a35dc3d66fa..81a1e9f13fa 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java +++ b/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java @@ -29,6 +29,7 @@ package mage.sets.magic2011; import java.util.UUID; +import mage.abilities.Ability; import mage.constants.AttachmentType; import mage.constants.CardType; @@ -37,6 +38,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; @@ -57,12 +59,26 @@ public class SwordOfVengeance extends CardImpl { super(ownerId, 216, "Sword of Vengeance", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "M11"; this.subtype.add("Equipment"); + + + // Equipped creature gets +2/+0 and has first strike, vigilance, trample, and haste. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0)); + Effect effect = new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT); + effect.setText("and has first strike"); + ability.addEffect(effect); + effect = new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT); + effect.setText(", vigilance"); + ability.addEffect(effect); + effect = new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT); + effect.setText(", trample"); + ability.addEffect(effect); + effect = new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT); + effect.setText(", and haste"); + ability.addEffect(effect); + this.addAbility(ability); + + // Equip 3 this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); } protected SwordOfVengeance(SwordOfVengeance me) { diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/Armistice.java b/Mage.Sets/src/mage/sets/mercadianmasques/Armistice.java new file mode 100644 index 00000000000..aaf8332c5c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/Armistice.java @@ -0,0 +1,52 @@ +/* + * 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.sets.mercadianmasques; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Armistice extends mage.sets.commander2014.Armistice { + + public Armistice(UUID ownerId) { + super(ownerId); + this.cardNumber = 3; + this.expansionSetCode = "MMQ"; + } + + public Armistice(final Armistice card) { + super(card); + } + + @Override + public Armistice copy() { + return new Armistice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/GiftOfEstates.java b/Mage.Sets/src/mage/sets/ninthedition/GiftOfEstates.java new file mode 100644 index 00000000000..08c18274381 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/GiftOfEstates.java @@ -0,0 +1,52 @@ +/* + * 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.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GiftOfEstates extends mage.sets.commander2014.GiftOfEstates { + + public GiftOfEstates(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "9ED"; + } + + public GiftOfEstates(final GiftOfEstates card) { + super(card); + } + + @Override + public GiftOfEstates copy() { + return new GiftOfEstates(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/WhitemaneLion.java b/Mage.Sets/src/mage/sets/planarchaos/WhitemaneLion.java new file mode 100644 index 00000000000..760715c6946 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/WhitemaneLion.java @@ -0,0 +1,52 @@ +/* + * 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.sets.planarchaos; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class WhitemaneLion extends mage.sets.commander2014.WhitemaneLion { + + public WhitemaneLion(UUID ownerId) { + super(ownerId); + this.cardNumber = 22; + this.expansionSetCode = "PLC"; + } + + public WhitemaneLion(final WhitemaneLion card) { + super(card); + } + + @Override + public WhitemaneLion copy() { + return new WhitemaneLion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/GiftOfEstates.java b/Mage.Sets/src/mage/sets/portal/GiftOfEstates.java new file mode 100644 index 00000000000..89929b19a49 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/GiftOfEstates.java @@ -0,0 +1,54 @@ +/* + * 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.sets.portal; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class GiftOfEstates extends mage.sets.commander2014.GiftOfEstates { + + public GiftOfEstates(UUID ownerId) { + super(ownerId); + this.cardNumber = 179; + this.expansionSetCode = "POR"; + this.rarity = Rarity.RARE; + } + + public GiftOfEstates(final GiftOfEstates card) { + super(card); + } + + @Override + public GiftOfEstates copy() { + return new GiftOfEstates(this); + } +} diff --git a/Mage.Sets/src/mage/sets/venservskoth/WhitemaneLion.java b/Mage.Sets/src/mage/sets/venservskoth/WhitemaneLion.java new file mode 100644 index 00000000000..31eab7b2fd3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/venservskoth/WhitemaneLion.java @@ -0,0 +1,52 @@ +/* + * 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.sets.venservskoth; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class WhitemaneLion extends mage.sets.commander2014.WhitemaneLion { + + public WhitemaneLion(UUID ownerId) { + super(ownerId); + this.cardNumber = 2; + this.expansionSetCode = "DDI"; + } + + public WhitemaneLion(final WhitemaneLion card) { + super(card); + } + + @Override + public WhitemaneLion copy() { + return new WhitemaneLion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/worldwake/ChainReaction.java b/Mage.Sets/src/mage/sets/worldwake/ChainReaction.java index b91548242e5..00f3e83aebb 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ChainReaction.java +++ b/Mage.Sets/src/mage/sets/worldwake/ChainReaction.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; @@ -48,7 +49,9 @@ public class ChainReaction extends CardImpl { this.color.setRed(true); // Chain Reaction deals X damage to each creature, where X is the number of creatures on the battlefield. - this.getSpellAbility().addEffect(new DamageAllEffect(new PermanentsOnBattlefieldCount(new FilterCreaturePermanent()), new FilterCreaturePermanent())); + Effect effect = new DamageAllEffect(new PermanentsOnBattlefieldCount(new FilterCreaturePermanent()), new FilterCreaturePermanent()); + effect.setText("{this} deals X damage to each creature, where X is the number of creatures on the battlefield"); + this.getSpellAbility().addEffect(effect); } public ChainReaction(final ChainReaction card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/RestForTheWeary.java b/Mage.Sets/src/mage/sets/worldwake/RestForTheWeary.java index 3bc9a48a1c4..de447844887 100644 --- a/Mage.Sets/src/mage/sets/worldwake/RestForTheWeary.java +++ b/Mage.Sets/src/mage/sets/worldwake/RestForTheWeary.java @@ -52,7 +52,7 @@ public class RestForTheWeary extends CardImpl { // Target player gains 4 life. // Landfall - If you had a land enter the battlefield under your control this turn, that player gains 8 life instead. this.addWatcher(new LandfallWatcher()); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new GainLifeTargetEffect(8), new GainLifeTargetEffect(4), LandfallCondition.getInstance(), "Target player gains 4 life. Landfall - If you had a land enter the battlefield under your control this turn, that player gains 8 life instead")); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new GainLifeTargetEffect(8), new GainLifeTargetEffect(4), LandfallCondition.getInstance(), "Target player gains 4 life.
Landfall - If you had a land enter the battlefield under your control this turn, that player gains 8 life instead")); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java b/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java index e727295c17f..5e250f06c67 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java +++ b/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java @@ -29,6 +29,7 @@ package mage.abilities.decorator; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.condition.Condition; import mage.abilities.effects.OneShotEffect; import mage.game.Game; @@ -44,6 +45,10 @@ public class ConditionalOneShotEffect extends OneShotEffect { private OneShotEffect otherwiseEffect; private Condition condition; + public ConditionalOneShotEffect(OneShotEffect effect, Condition condition) { + this(effect, null, condition, null); + } + public ConditionalOneShotEffect(OneShotEffect effect, Condition condition, String text) { this(effect, null, condition, text); } @@ -82,4 +87,15 @@ public class ConditionalOneShotEffect extends OneShotEffect { return new ConditionalOneShotEffect(this); } + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + if (otherwiseEffect == null) { + return "If " + condition.toString() + ", " + effect.getText(mode); + } + return effect.getText(mode) + ". If " + condition.toString() + ", " + otherwiseEffect.getText(mode); + } + } diff --git a/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java b/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java index fe0bdd3ba69..9c0e72eef9e 100644 --- a/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java @@ -64,12 +64,7 @@ public class CreateTokenTargetEffect extends OneShotEffect { if (value < 1) { return true; } - if(token.putOntoBattlefield(value, game, source.getSourceId(), targetPointer.getFirst(game, source), tapped, attacking)) { - game.informPlayers(new StringBuilder(controller.getName()) - .append(" puts ").append(CardUtil.numberToText(value,"a")).append(" ").append(token.getName()) - .append(value == 1?" token":" tokens").append(" onto the Battlefield").toString()); - return true; - } + return token.putOntoBattlefield(value, game, source.getSourceId(), targetPointer.getFirst(game, source), tapped, attacking); } return false; } diff --git a/Mage/src/mage/game/permanent/token/AngelToken.java b/Mage/src/mage/game/permanent/token/AngelToken.java index 1649bddfd02..c21fd10160c 100644 --- a/Mage/src/mage/game/permanent/token/AngelToken.java +++ b/Mage/src/mage/game/permanent/token/AngelToken.java @@ -10,9 +10,9 @@ public class AngelToken extends Token { this("M14"); } - public AngelToken(String tokenImageSetCode) { + public AngelToken(String setCode) { super("Angel", "4/4 white Angel creature token with flying"); - this.setOriginalExpansionSetCode(tokenImageSetCode); + this.setOriginalExpansionSetCode(setCode); cardType.add(CardType.CREATURE); color.setWhite(true); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 74365b6ec20..f52579c3efa 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -22719,7 +22719,7 @@ Toxic Deluge|Commander 2013 Edition|96|R|{2}{B}|Sorcery|||As an additional cost Vampire Nighthawk|Commander 2013 Edition|97|U|{1}{B}{B}|Creature - Vampire Shaman|2|3|Flying$Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$Lifelink (Damage dealt by this creature also causes you to gain that much life.)| Vile Requiem|Commander 2013 Edition|98|U|{2}{B}{B}|Enchantment|||At the beginning of your upkeep, you may put a verse counter on Vile Requiem.${1}{B}, Sacrifice Vile Requiem: Destroy up to X target nonblack creatures, where X is the number of verse counters on Vile Requiem. They can't be regenerated.| Viscera Seer|Commander 2013 Edition|99|C|{B}|Creature - Vampire Wizard|1|1|Sacrifice a creature: Scry 1. (Look at the top card of your library. You may put that card on the bottom of your library.)| -Angel of the Dire Hour|Commander 2014|1|R|{5}{W}{W}|Creature - Angel|5|4|Flash$Flying$When Angel of the Dire Hour enters the battlefield, if you cast it from your hand, exile all attacking creatures.| +Angel of the Dire Hour|Commander 2014 Edition|1|R|{5}{W}{W}|Creature - Angel|5|4|Flash$Flying$When Angel of the Dire Hour enters the battlefield, if you cast it from your hand, exile all attacking creatures.| Nahiri, the Lithomancer|Commander 2014 Edition|10|M|{3}{W}{W}|Planeswalker - Nahiri|||+2: Put a 1/1 white Kor Soldier creature token onto the battlefield. You may attach an Equipment you control to it.$?2: You may put an Equipment card from your hand or graveyard onto the battlefield.$?10: Put a colorless Equipment artifact token named Stoneforged Blade onto the battlefield. It has indestructible, "Equipped creature gets +5/+5 and has double strike," and equip {0}.$Nahiri, the Lithomancer can be your commander.| Cackling Counterpart|Commander 2014 Edition|100|R|{1}{U}{U}|Instant|||Put a token onto the battlefield that's a copy of target creature you control.$Flashback {5}{U}{U} (You may cast this card from your graveyard for its flashback cost. Then exile it.)| Call to Mind|Commander 2014 Edition|101|U|{2}{U}|Sorcery|||Return target instant or sorcery card from your graveyard to your hand.|