Implemented Acolyte of Affliction

This commit is contained in:
Evan Kranzler 2020-01-11 12:00:18 -05:00
parent 425ea1e74a
commit b2e929e03a
2 changed files with 88 additions and 0 deletions

View file

@ -0,0 +1,87 @@
package mage.cards.a;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterPermanentCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AcolyteOfAffliction extends CardImpl {
public AcolyteOfAffliction(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{G}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// When Acolyte of Affliction enters the battlefield, put the top two cards of your library into your graveyard, then you may return a permanent card from your graveyard to your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(new AcolyteOfAfflictionEffect()));
}
private AcolyteOfAffliction(final AcolyteOfAffliction card) {
super(card);
}
@Override
public AcolyteOfAffliction copy() {
return new AcolyteOfAffliction(this);
}
}
class AcolyteOfAfflictionEffect extends OneShotEffect {
private static final FilterCard filter = new FilterPermanentCard("permanent card from your graveyard");
AcolyteOfAfflictionEffect() {
super(Outcome.Benefit);
staticText = "put the top two cards of your library into your graveyard, " +
"then you may return a permanent card from your graveyard to your hand.";
}
private AcolyteOfAfflictionEffect(final AcolyteOfAfflictionEffect effect) {
super(effect);
}
@Override
public AcolyteOfAfflictionEffect copy() {
return new AcolyteOfAfflictionEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
player.moveCards(player.getLibrary().getTopCards(game, 2), Zone.GRAVEYARD, source, game);
TargetCard target = new TargetCardInYourGraveyard(0, 1, filter, true);
if (!player.choose(Outcome.ReturnToHand, target, source.getSourceId(), game)) {
return true;
}
Card card = game.getCard(target.getFirstTarget());
if (card == null) {
return true;
}
player.moveCards(card, Zone.HAND, source, game);
return true;
}
}

View file

@ -26,6 +26,7 @@ public final class TherosBeyondDeath extends ExpansionSet {
this.ratioBoosterMythic = 8;
this.maxCardNumberInBooster = 254;
cards.add(new SetCardInfo("Acolyte of Affliction", 206, Rarity.UNCOMMON, mage.cards.a.AcolyteOfAffliction.class));
cards.add(new SetCardInfo("Allure of the Unknown", 207, Rarity.RARE, mage.cards.a.AllureOfTheUnknown.class));
cards.add(new SetCardInfo("Alseid of Life's Bounty", 1, Rarity.UNCOMMON, mage.cards.a.AlseidOfLifesBounty.class));
cards.add(new SetCardInfo("Altar of the Pantheon", 231, Rarity.COMMON, mage.cards.a.AltarOfThePantheon.class));