From e5aec13610dfbbb02533ee83ffebb730b699dfbd Mon Sep 17 00:00:00 2001 From: emerald000 Date: Wed, 9 Jul 2014 17:30:16 -0400 Subject: [PATCH] [M15] Added 3 black cards + some text fixes. --- .../src/mage/sets/magic2015/BloodHost.java | 36 +------ .../mage/sets/magic2015/CovenantOfBlood.java | 14 ++- .../src/mage/sets/magic2015/CruelSadist.java | 5 +- .../mage/sets/magic2015/EndlessObedience.java | 67 +++++++++++++ .../mage/sets/magic2015/EternalThirst.java | 99 +++++++++++++++++++ .../mage/sets/magic2015/FeastOnTheFallen.java | 99 +++++++++++++++++++ 6 files changed, 280 insertions(+), 40 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/magic2015/EndlessObedience.java create mode 100644 Mage.Sets/src/mage/sets/magic2015/EternalThirst.java create mode 100644 Mage.Sets/src/mage/sets/magic2015/FeastOnTheFallen.java diff --git a/Mage.Sets/src/mage/sets/magic2015/BloodHost.java b/Mage.Sets/src/mage/sets/magic2015/BloodHost.java index 8acf4f91d27..9a53ff481ec 100644 --- a/Mage.Sets/src/mage/sets/magic2015/BloodHost.java +++ b/Mage.Sets/src/mage/sets/magic2015/BloodHost.java @@ -32,23 +32,18 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; -import mage.abilities.costs.mana.ColoredManaCost; -import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.ColoredManaSymbol; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.permanent.AnotherPredicate; -import mage.game.Game; import mage.target.common.TargetControlledPermanent; /** @@ -74,13 +69,12 @@ public class BloodHost extends CardImpl { // {1}{B}, Sacrifice another creature: Put a +1/+1 counter on Blood Host Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance()); effect.setText("Put a +1/+1 counter on {this}"); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new SacrificeTargetCost(new TargetControlledPermanent(filter))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); // and you gain 2 life. effect = new GainLifeEffect(2); effect.setText("and you gain 2 life"); ability.addEffect(effect); - ability.addCost(new GenericManaCost(1)); - ability.addCost(new ColoredManaCost(ColoredManaSymbol.B)); this.addAbility(ability); } @@ -92,26 +86,4 @@ public class BloodHost extends CardImpl { public BloodHost copy() { return new BloodHost(this); } -} - -class BloodHostEffect extends OneShotEffect { - - BloodHostEffect() { - super(Outcome.Benefit); - this.staticText = "Put a +1/+1 counter on {this} and you gain 2 life."; - } - - BloodHostEffect(final BloodHostEffect effect) { - super(effect); - } - - @Override - public BloodHostEffect copy() { - return new BloodHostEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2015/CovenantOfBlood.java b/Mage.Sets/src/mage/sets/magic2015/CovenantOfBlood.java index 511bade6ff7..7acb94039e2 100644 --- a/Mage.Sets/src/mage/sets/magic2015/CovenantOfBlood.java +++ b/Mage.Sets/src/mage/sets/magic2015/CovenantOfBlood.java @@ -28,6 +28,7 @@ package mage.sets.magic2015; import java.util.UUID; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.ConvokeAbility; @@ -51,12 +52,15 @@ public class CovenantOfBlood extends CardImpl { // Convoke this.addAbility(new ConvokeAbility()); - // Covenant of Blood deals 4 damage - this.getSpellAbility().addEffect(new DamageTargetEffect(4)); - // to target creature or player - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + // Covenant of Blood deals 4 damage to target creature or player + Effect effect = new DamageTargetEffect(4); + effect.setText("{this} deals 4 damage to target creature or player"); + this.getSpellAbility().addEffect(effect); // and you gain 4 life. - this.getSpellAbility().addEffect(new GainLifeEffect(4)); + effect = new GainLifeEffect(4); + effect.setText("and you gain 4 life"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); } public CovenantOfBlood(final CovenantOfBlood card) { diff --git a/Mage.Sets/src/mage/sets/magic2015/CruelSadist.java b/Mage.Sets/src/mage/sets/magic2015/CruelSadist.java index ce8492feb17..5dab19cd0c0 100644 --- a/Mage.Sets/src/mage/sets/magic2015/CruelSadist.java +++ b/Mage.Sets/src/mage/sets/magic2015/CruelSadist.java @@ -35,7 +35,7 @@ import mage.abilities.costs.common.PayLifeCost; import mage.abilities.costs.common.RemoveVariableCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ColoredManaCost; -import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; @@ -73,8 +73,7 @@ public class CruelSadist extends CardImpl { // {2}{B}, {T}, Remove X +1/+1 counters from Cruel Sadist: Cruel Sadist deals X damage to target creature. Effect effect = new DamageTargetEffect(new RemovedCountersForCostValue()); effect.setText("{this} deals X damage to target creature"); - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); - ability.addCost(new ColoredManaCost(ColoredManaSymbol.B)); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{B}")); ability.addCost(new TapSourceCost()); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.P1P1.createInstance())); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/magic2015/EndlessObedience.java b/Mage.Sets/src/mage/sets/magic2015/EndlessObedience.java new file mode 100644 index 00000000000..10584e13b33 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2015/EndlessObedience.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.magic2015; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author emerald000 + */ +public class EndlessObedience extends CardImpl { + + public EndlessObedience(UUID ownerId) { + super(ownerId, 94, "Endless Obedience", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{B}{B}"); + this.expansionSetCode = "M15"; + + this.color.setBlack(true); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // Put target creature card from a graveyard onto the battlefield under your control. + this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); + this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); + } + + public EndlessObedience(final EndlessObedience card) { + super(card); + } + + @Override + public EndlessObedience copy() { + return new EndlessObedience(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2015/EternalThirst.java b/Mage.Sets/src/mage/sets/magic2015/EternalThirst.java new file mode 100644 index 00000000000..4a4c91d585f --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2015/EternalThirst.java @@ -0,0 +1,99 @@ +/* + * 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.magic2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author emerald000 + */ +public class EternalThirst extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature an opponent controls"); + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public EternalThirst(UUID ownerId) { + super(ownerId, 95, "Eternal Thirst", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "M15"; + this.subtype.add("Aura"); + + this.color.setBlack(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature has lifelink + Effect effect = new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), AttachmentType.AURA); + effect.setText("Enchanted creature has lifelink"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); + // and "Whenever a creature an opponent controls dies, put a +1/+1 counter on this creature." + effect = new GainAbilityAttachedEffect(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true, filter), AttachmentType.AURA); + ability.addEffect(effect); + effect.setText("and \"Whenever a creature an opponent controls dies, put a +1/+1 counter on this creature.\""); + this.addAbility(ability); + + + } + + public EternalThirst(final EternalThirst card) { + super(card); + } + + @Override + public EternalThirst copy() { + return new EternalThirst(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2015/FeastOnTheFallen.java b/Mage.Sets/src/mage/sets/magic2015/FeastOnTheFallen.java new file mode 100644 index 00000000000..2e4440326a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2015/FeastOnTheFallen.java @@ -0,0 +1,99 @@ +/* + * 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.magic2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.watchers.common.PlayerLostLifeWatcher; + +/** + * + * @author emerald000 + */ +public class FeastOnTheFallen extends CardImpl { + + public FeastOnTheFallen(UUID ownerId) { + super(ownerId, 96, "Feast on the Fallen", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "M15"; + + this.color.setBlack(true); + + // At the beginning of each upkeep, if an opponent lost life last turn, put a +1/+1 counter on target creature you control. + Ability ability = new ConditionalTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new AddCountersTargetEffect(CounterType.P1P1.createInstance()), + TargetController.ANY, false), + FeastOnTheFallenCondition.getInstance(), + "At the beginning of each upkeep, if an opponent lost life last turn, put a +1/+1 counter on target creature you control."); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public FeastOnTheFallen(final FeastOnTheFallen card) { + super(card); + } + + @Override + public FeastOnTheFallen copy() { + return new FeastOnTheFallen(this); + } +} + +class FeastOnTheFallenCondition implements Condition { + + private static final FeastOnTheFallenCondition fInstance = new FeastOnTheFallenCondition(); + + public static FeastOnTheFallenCondition getInstance() { + return fInstance; + } + + @Override + public boolean apply(Game game, Ability source) { + PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher"); + if (watcher != null) { + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + if (watcher.getLiveLostLastTurn(opponentId) > 0) { + return true; + } + } + } + return false; + } +}