Implemented Pillar Tombs of Aku

This commit is contained in:
Evan Kranzler 2018-06-10 23:22:42 -04:00
parent f8d274d7cd
commit d634c4d134
2 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,82 @@
package mage.cards.p;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.constants.SuperType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author TheElk801
*/
public final class PillarTombsOfAku extends CardImpl {
public PillarTombsOfAku(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}");
this.addSuperType(SuperType.WORLD);
// At the beginning of each player's upkeep, that player may sacrifice a creature. If that player doesn't, he or she loses 5 life and you sacrifice Pillar Tombs of Aku.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new PillarTombsOfAkuEffect(),
TargetController.ANY,
false
));
}
public PillarTombsOfAku(final PillarTombsOfAku card) {
super(card);
}
@Override
public PillarTombsOfAku copy() {
return new PillarTombsOfAku(this);
}
}
class PillarTombsOfAkuEffect extends OneShotEffect {
public PillarTombsOfAkuEffect() {
super(Outcome.Benefit);
this.staticText = "that player may sacrifice a creature. If that "
+ "player doesnt, they lose 5 life and you sacrifice {this}";
}
public PillarTombsOfAkuEffect(final PillarTombsOfAkuEffect effect) {
super(effect);
}
@Override
public PillarTombsOfAkuEffect copy() {
return new PillarTombsOfAkuEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player activePlayer = game.getPlayer(game.getActivePlayerId());
if (activePlayer == null) {
return false;
}
if (activePlayer.chooseUse(Outcome.Sacrifice, "Sacrifice a creature?", source, game)) {
Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent());
if (cost.canPay(source, source.getSourceId(), activePlayer.getId(), game)
&& cost.pay(source, game, source.getSourceId(), activePlayer.getId(), true)) {
return true;
}
}
activePlayer.loseLife(5, game, false);
return new SacrificeSourceEffect().apply(game, source);
}
}

View file

@ -118,6 +118,7 @@ public final class Visions extends ExpansionSet {
cards.add(new SetCardInfo("Parapet", 14, Rarity.COMMON, mage.cards.p.Parapet.class));
cards.add(new SetCardInfo("Phyrexian Marauder", 151, Rarity.RARE, mage.cards.p.PhyrexianMarauder.class));
cards.add(new SetCardInfo("Phyrexian Walker", 152, Rarity.COMMON, mage.cards.p.PhyrexianWalker.class));
cards.add(new SetCardInfo("Pillar Tombs of Aku", 17, Rarity.RARE, mage.cards.p.PillarTombsOfAku.class));
cards.add(new SetCardInfo("Prosperity", 40, Rarity.UNCOMMON, mage.cards.p.Prosperity.class));
cards.add(new SetCardInfo("Python", 68, Rarity.COMMON, mage.cards.p.Python.class));
cards.add(new SetCardInfo("Quicksand", 166, Rarity.UNCOMMON, mage.cards.q.Quicksand.class));