[MID] Implemented Ghoulcaller's Harvest

This commit is contained in:
Evan Kranzler 2021-09-09 19:48:21 -04:00
parent d911891ab5
commit eef6160a4c
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,77 @@
package mage.cards.g;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TimingRule;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.token.ZombieDecayedToken;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GhoulcallersHarvest extends CardImpl {
private static final Hint hint = new ValueHint(
"Half the number of creature cards in your graveyard", GhoulcallersHarvestValue.instance
);
public GhoulcallersHarvest(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{G}");
// Create X 2/2 black Zombie creature tokens with decayed, where X is half the number of creature cards in your graveyard, rounded up.
this.getSpellAbility().addEffect(new CreateTokenEffect(
new ZombieDecayedToken(), GhoulcallersHarvestValue.instance
).setText("create X 2/2 black Zombie creature tokens with decayed, " +
"where X is half the number of creature cards in your graveyard, rounded up"));
this.getSpellAbility().addHint(hint);
// Flashback {3}{B}{G}
this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{B}{G}"), TimingRule.SORCERY));
}
private GhoulcallersHarvest(final GhoulcallersHarvest card) {
super(card);
}
@Override
public GhoulcallersHarvest copy() {
return new GhoulcallersHarvest(this);
}
}
enum GhoulcallersHarvestValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Player player = game.getPlayer(sourceAbility.getControllerId());
if (player == null) {
return 0;
}
int amount = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game);
return Math.floorDiv(amount, 2) + amount % 2;
}
@Override
public GhoulcallersHarvestValue copy() {
return this;
}
@Override
public String getMessage() {
return "";
}
}

View file

@ -80,6 +80,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Foul Play", 101, Rarity.UNCOMMON, mage.cards.f.FoulPlay.class));
cards.add(new SetCardInfo("Galvanic Iteration", 224, Rarity.RARE, mage.cards.g.GalvanicIteration.class));
cards.add(new SetCardInfo("Ghoulcaller's Harvest", 225, Rarity.RARE, mage.cards.g.GhoulcallersHarvest.class));
cards.add(new SetCardInfo("Grafted Identity", 57, Rarity.RARE, mage.cards.g.GraftedIdentity.class));
cards.add(new SetCardInfo("Graveyard Glutton", 104, Rarity.RARE, mage.cards.g.GraveyardGlutton.class));
cards.add(new SetCardInfo("Graveyard Trespasser", 104, Rarity.RARE, mage.cards.g.GraveyardTrespasser.class));