diff --git a/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java b/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java new file mode 100644 index 0000000000..e411f574a1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PyramidOfThePantheon.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.p; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.CostImpl; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.AddManaOfAnyColorEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.mana.AnyColorManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; + +/** + * + * @author spjspj + */ +public class PyramidOfThePantheon extends CardImpl { + + public PyramidOfThePantheon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); + + // {2}, {T}: Add one mana of any color to your mana pool. Put a brick counter on Pyramid of the Pantheon. + Ability ability = new AnyColorManaAbility(new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addEffect(new AddCountersSourceEffect(CounterType.BRICK.createInstance())); + this.addAbility(ability); + + // {T}: Add three mana of any one color to your mana pool. Activate this ability only of there are three or more brick counters on Pyramid of the Pantheon. + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new TapSourceCost()); + ability2.addCost(new SourceHasCountersCost(3, CounterType.BRICK)); + this.addAbility(ability2); + } + + public PyramidOfThePantheon(final PyramidOfThePantheon card) { + super(card); + } + + @Override + public PyramidOfThePantheon copy() { + return new PyramidOfThePantheon(this); + } +} + +class SourceHasCountersCost extends CostImpl { + + private final int counters; + private final CounterType counterType; + + public SourceHasCountersCost(int counters, CounterType counterType) { + this.counters = counters; + this.counterType = counterType; + this.text = "Activate this ability only if {this} has " + counters + " or more " + counterType.getName() + " counters on it"; + } + + public SourceHasCountersCost(final SourceHasCountersCost cost) { + super(cost); + this.counters = cost.counters; + this.counterType = cost.counterType; + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + return (game.getPermanent(sourceId).getCounters(game).getCount(counterType) >= counters); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { + this.paid = true; + return paid; + } + + @Override + public SourceHasCountersCost copy() { + return new SourceHasCountersCost(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Amonkhet.java b/Mage.Sets/src/mage/sets/Amonkhet.java index 58030e1113..595624d53f 100644 --- a/Mage.Sets/src/mage/sets/Amonkhet.java +++ b/Mage.Sets/src/mage/sets/Amonkhet.java @@ -250,6 +250,7 @@ public class Amonkhet extends ExpansionSet { cards.add(new SetCardInfo("Pathmaker Initiate", 146, Rarity.COMMON, mage.cards.p.PathmakerInitiate.class)); cards.add(new SetCardInfo("Pitiless Vizier", 103, Rarity.COMMON, mage.cards.p.PitilessVizier.class)); cards.add(new SetCardInfo("Plague Belcher", 104, Rarity.RARE, mage.cards.p.PlagueBelcher.class)); + cards.add(new SetCardInfo("Pyramid of the Pantheon", 235, Rarity.RARE, mage.cards.p.PyramidOfThePantheon.class)); cards.add(new SetCardInfo("Plains", 250, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(null, true))); cards.add(new SetCardInfo("Plains", 255, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(null, true))); cards.add(new SetCardInfo("Plains", 256, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(null, true)));