From f0c5cb3eefa7ef48e0936938106c117264044edf Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Sat, 31 Mar 2012 00:20:22 -0500 Subject: [PATCH] - Added some ROE cards. --- .../sets/riseoftheeldrazi/AngelheartVial.java | 135 ++++++++++++++++ .../riseoftheeldrazi/ArrogantBloodlord.java | 147 ++++++++++++++++++ .../sets/riseoftheeldrazi/BanefulOmen.java | 142 +++++++++++++++++ nb-configuration.xml | 18 +++ 4 files changed, 442 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/ArrogantBloodlord.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java create mode 100644 nb-configuration.xml diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java new file mode 100644 index 0000000000..a6febaea1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java @@ -0,0 +1,135 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.Outcome; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.counters.CounterType; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +/** + * + * @author jeffwadsworth + */ +public class AngelheartVial extends CardImpl { + + public AngelheartVial(UUID ownerId) { + super(ownerId, 215, "Angelheart Vial", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "ROE"; + + // Whenever you're dealt damage, you may put that many charge counters on Angelheart Vial. + this.addAbility(new AngelheartVialTriggeredAbility()); + + // {2}, {tap}, Remove four charge counters from Angelheart Vial: You gain 2 life and draw a card. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainLifeEffect(2), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addCost(new RemoveCountersSourceCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(4)))); + ability.addEffect(new DrawCardControllerEffect(1)); + this.addAbility(ability); + } + + public AngelheartVial(final AngelheartVial card) { + super(card); + } + + @Override + public AngelheartVial copy() { + return new AngelheartVial(this); + } +} + +class AngelheartVialTriggeredAbility extends TriggeredAbilityImpl { + + public AngelheartVialTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new AngelheartVialAddCounterEffect(), true); + } + + public AngelheartVialTriggeredAbility(final AngelheartVialTriggeredAbility ability) { + super(ability); + } + + @Override + public AngelheartVialTriggeredAbility copy() { + return new AngelheartVialTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you are dealt damage, you may put that many charge counters on {this}"; + } +} + +class AngelheartVialAddCounterEffect extends OneShotEffect { + + public AngelheartVialAddCounterEffect() { + super(Outcome.Benefit); + } + + public AngelheartVialAddCounterEffect(final AngelheartVialAddCounterEffect effect) { + super(effect); + } + + @Override + public AngelheartVialAddCounterEffect copy() { + return new AngelheartVialAddCounterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.addCounters(CounterType.CHARGE.createInstance((Integer) this.getValue("damageAmount")), game); + } + return true; + } +} + diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ArrogantBloodlord.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ArrogantBloodlord.java new file mode 100644 index 0000000000..4e6ead0c11 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ArrogantBloodlord.java @@ -0,0 +1,147 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.Outcome; +import mage.Constants.Zone; +import mage.abilities.effects.OneShotEffect; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; +import mage.cards.CardImpl; + +/** + * + * @author jeffwadsworth + */ +public class ArrogantBloodlord extends CardImpl { + + public ArrogantBloodlord(UUID ownerId) { + super(ownerId, 94, "Arrogant Bloodlord", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Vampire"); + this.subtype.add("Knight"); + + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever Arrogant Bloodlord blocks or becomes blocked by a creature with power 1 or less, destroy Arrogant Bloodlord at end of combat. + this.addAbility(new ArrogantBloodlordTriggeredAbility()); + } + + public ArrogantBloodlord(final ArrogantBloodlord card) { + super(card); + } + + @Override + public ArrogantBloodlord copy() { + return new ArrogantBloodlord(this); + } +} + +class ArrogantBloodlordTriggeredAbility extends TriggeredAbilityImpl { + + ArrogantBloodlordTriggeredAbility() { + super(Zone.BATTLEFIELD, new ArrogantBloodlordEffect()); + } + + ArrogantBloodlordTriggeredAbility(final ArrogantBloodlordTriggeredAbility ability) { + super(ability); + } + + @Override + public ArrogantBloodlordTriggeredAbility copy() { + return new ArrogantBloodlordTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { + Permanent blocker = game.getPermanent(event.getTargetId()); + if (blocker != null && blocker.getPower().getValue() < 2) { + return true; + } + if (blocker == game.getPermanent(event.getSourceId())) { + if (blocker != null && game.getPermanent(event.getTargetId()).getPower().getValue() < 2) { + return true; + } + return false; + } + return false; + } + return false; + } + + @Override + public String getRule() { + return "Whenever Arrogant Bloodlord blocks or becomes blocked by a creature with power 1 or less, destroy Arrogant Bloodlord at end of combat."; + } +} + +class ArrogantBloodlordEffect extends OneShotEffect { + + ArrogantBloodlordEffect() { + super(Outcome.Detriment); + staticText = "Destroy Arrogant Bloodlord at the end of combat"; + } + + ArrogantBloodlordEffect(final ArrogantBloodlordEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(source.getSourceId())); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; + } + + @Override + public ArrogantBloodlordEffect copy() { + return new ArrogantBloodlordEffect(this); + } +} + + diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java new file mode 100644 index 0000000000..f2e774e0d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java @@ -0,0 +1,142 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.Zone; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.cards.CardImpl; +import mage.abilities.TriggeredAbilityImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.abilities.effects.OneShotEffect; +import mage.Constants.Outcome; +import mage.abilities.Ability; +import mage.cards.Card; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.players.Player; +import java.util.Set; + +/** + * + * @author jeffwadsworth + */ +public class BanefulOmen extends CardImpl { + + public BanefulOmen(UUID ownerId) { + super(ownerId, 96, "Baneful Omen", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}{B}"); + this.expansionSetCode = "ROE"; + + this.color.setBlack(true); + + // At the beginning of your end step, you may reveal the top card of your library. If you do, each opponent loses life equal to that card's converted mana cost. + this.addAbility(new BanefulOmenTriggeredAbility()); + } + + public BanefulOmen(final BanefulOmen card) { + super(card); + } + + @Override + public BanefulOmen copy() { + return new BanefulOmen(this); + } + + class BanefulOmenTriggeredAbility extends TriggeredAbilityImpl { + + public BanefulOmenTriggeredAbility() { + super(Zone.BATTLEFIELD, new BanefulOmenEffect(), true); + } + + public BanefulOmenTriggeredAbility(BanefulOmenTriggeredAbility ability) { + super(ability); + } + + @Override + public BanefulOmenTriggeredAbility copy() { + return new BanefulOmenTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.END_PHASE_PRE && event.getPlayerId().equals(this.controllerId)) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "At the beginning of your end step, you may reveal the top card of your library. If you do, each opponent loses life equal to that card's converted mana cost."; + } + } + + class BanefulOmenEffect extends OneShotEffect { + + public BanefulOmenEffect() { + super(Outcome.Benefit); + } + + public BanefulOmenEffect(final BanefulOmenEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + if (player.getLibrary().size() > 0) { + Card card = player.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.revealCards("Baneful Omen", cards, game); + + if (card != null) { + int loseLife = card.getManaCost().convertedManaCost(); + Set opponents = game.getOpponents(source.getControllerId()); + for (UUID opponentUuid : opponents) { + Player opponent = game.getPlayer(opponentUuid); + if (opponent != null) { + opponent.loseLife(loseLife, game); + } + } + } + } + return false; + } + + @Override + public BanefulOmenEffect copy() { + return new BanefulOmenEffect(this); + } + } +} diff --git a/nb-configuration.xml b/nb-configuration.xml new file mode 100644 index 0000000000..0a1a2eb73d --- /dev/null +++ b/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + all + +