From f62fe429737290e32cf4c857d6a6460830e6d2b1 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sun, 6 Mar 2011 20:31:15 +0300 Subject: [PATCH] [MBS] 3 cards --- .../sets/mirrodinbesieged/DivineOffering.java | 112 ++++++++++++++++++ .../sets/mirrodinbesieged/MirranCrusader.java | 78 ++++++++++++ .../sets/mirrodinbesieged/PriestsofNorn.java | 65 ++++++++++ Utils/gen-card.pl | 2 + 4 files changed, 257 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/MirranCrusader.java create mode 100644 Mage.Sets/src/mage/sets/mirrodinbesieged/PriestsofNorn.java diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java new file mode 100644 index 0000000000..9ae25d811c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java @@ -0,0 +1,112 @@ +/* + * 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.mirrodinbesieged; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.Filter; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; + +/** + * + * @author ayratn + */ +public class DivineOffering extends CardImpl { + + private static FilterPermanent filter = new FilterPermanent("artifact"); + + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } + + public DivineOffering (UUID ownerId) { + super(ownerId, 5, "Divine Offering", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "MBS"; + this.color.setWhite(true); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new DivineOfferingEffect()); + } + + public DivineOffering (final DivineOffering card) { + super(card); + } + + @Override + public DivineOffering copy() { + return new DivineOffering(this); + } + + private class DivineOfferingEffect extends OneShotEffect { + + public DivineOfferingEffect() { + super(Constants.Outcome.DestroyPermanent); + } + + public DivineOfferingEffect(DivineOfferingEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getLastKnownInformation(source.getFirstTarget(), Constants.Zone.BATTLEFIELD); + if (card != null) { + int cost = card.getManaCost().get(0).convertedManaCost(); + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.gainLife(cost, game); + } + } + return true; + } + + @Override + public DivineOfferingEffect copy() { + return new DivineOfferingEffect(this); + } + + @Override + public String getText(Ability source) { + return "You gain life equal to its converted mana cost"; + } + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranCrusader.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranCrusader.java new file mode 100644 index 0000000000..0d77efdca3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranCrusader.java @@ -0,0 +1,78 @@ +/* + * 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.mirrodinbesieged; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.filter.FilterCard; + +/** + * + * @author ayratn + */ +public class MirranCrusader extends CardImpl { + private static FilterCard filter = new FilterCard("Black"); + private static FilterCard filter2 = new FilterCard("Green"); + + static { + filter.setUseColor(true); + filter.getColor().setBlack(true); + + filter2.setUseColor(true); + filter2.getColor().setGreen(true); + } + + public MirranCrusader (UUID ownerId) { + super(ownerId, 14, "Mirran Crusader", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + this.addAbility(DoubleStrikeAbility.getInstance()); + this.addAbility(new ProtectionAbility(filter)); + this.addAbility(new ProtectionAbility(filter2)); + } + + public MirranCrusader (final MirranCrusader card) { + super(card); + } + + @Override + public MirranCrusader copy() { + return new MirranCrusader(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PriestsofNorn.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PriestsofNorn.java new file mode 100644 index 0000000000..b32ad547fc --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PriestsofNorn.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.sets.mirrodinbesieged; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.keyword.InfectAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; + +/** + * + * @author ayratn + */ +public class PriestsofNorn extends CardImpl { + + public PriestsofNorn (UUID ownerId) { + super(ownerId, 16, "Priests of Norn", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "MBS"; + this.subtype.add("Cleric"); + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + this.addAbility(VigilanceAbility.getInstance()); + this.addAbility(InfectAbility.getInstance()); + } + + public PriestsofNorn (final PriestsofNorn card) { + super(card); + } + + @Override + public PriestsofNorn copy() { + return new PriestsofNorn(this); + } + +} diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index 1ffc7fa511..133a8bbef5 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -76,6 +76,7 @@ $fulltoshort{'Magic 2010'} = 'M10'; $fulltoshort{'Magic 2011'} = 'M11'; $fulltoshort{'Masters Edition II'} = 'ME2'; $fulltoshort{'Masters Edition III'} = 'ME3'; +$fulltoshort{'Masters Edition IV'} = 'ME4'; $fulltoshort{'Masters Edition'} = 'MED'; $fulltoshort{'Mirage'} = 'MIR'; $fulltoshort{'Mercadian Masques'} = 'MMQ'; @@ -156,6 +157,7 @@ $wizardstous{'EVG'} = 'EVG'; $wizardstous{'BR'} = 'BRB'; $wizardstous{'ME2'} = 'ME2'; $wizardstous{'ME3'} = 'ME3'; +$wizardstous{'ME4'} = 'ME4'; $wizardstous{'HOP'} = 'HOP'; $wizardstous{'PO'} = 'POR'; $wizardstous{'P2'} = 'PO2';