[MID] Implemented Heirloom Mirror / Inherited Fiend

This commit is contained in:
Evan Kranzler 2021-09-09 21:00:14 -04:00
parent 03dfa50f23
commit a305511b13
4 changed files with 143 additions and 0 deletions

View file

@ -0,0 +1,88 @@
package mage.cards.h;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class HeirloomMirror extends CardImpl {
public HeirloomMirror(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{B}");
this.transformable = true;
this.secondSideCardClazz = mage.cards.i.InheritedFiend.class;
// {1}, {T}, Pay 1 life, Discard a card: Draw a card, mill a card, then put a ritual counter on Heirloom Mirror. Then if it has 3 or more ritual counters on it, remove them and transform it. Activate only as a sorcery.
this.addAbility(new TransformAbility());
Ability ability = new ActivateAsSorceryActivatedAbility(new HeirloomMirrorEffect(), new GenericManaCost(1));
ability.addCost(new TapSourceCost());
ability.addCost(new PayLifeCost(1));
ability.addCost(new DiscardCardCost());
this.addAbility(ability);
}
private HeirloomMirror(final HeirloomMirror card) {
super(card);
}
@Override
public HeirloomMirror copy() {
return new HeirloomMirror(this);
}
}
class HeirloomMirrorEffect extends OneShotEffect {
HeirloomMirrorEffect() {
super(Outcome.Benefit);
staticText = "draw a card, mill a card, then put a ritual counter on {this}. " +
"Then if it has 3 or more ritual counters on it, remove them and transform it";
}
private HeirloomMirrorEffect(final HeirloomMirrorEffect effect) {
super(effect);
}
@Override
public HeirloomMirrorEffect copy() {
return new HeirloomMirrorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (player == null || permanent == null) {
return false;
}
player.drawCards(1, source, game);
player.millCards(1, source, game);
permanent.addCounters(CounterType.RITUAL.createInstance(), source.getControllerId(), source, game);
int counters = permanent.getCounters(game).getCount(CounterType.RITUAL);
if (counters < 3) {
return true;
}
permanent.removeCounters(CounterType.RITUAL.createInstance(counters), source, game);
new TransformSourceEffect(true).apply(game, source);
return true;
}
}

View file

@ -0,0 +1,52 @@
package mage.cards.i;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.target.common.TargetCardInGraveyard;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class InheritedFiend extends CardImpl {
public InheritedFiend(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "");
this.subtype.add(SubType.DEMON);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.color.setBlack(true);
this.transformable = true;
this.nightCard = true;
// Flying
this.addAbility(FlyingAbility.getInstance());
// {2}{B}: Exile target creature card from a graveyard. Put a +1/+1 counter on Inherited Fiend.
Ability ability = new SimpleActivatedAbility(new ExileTargetEffect(), new ManaCostsImpl<>("{2}{B}"));
ability.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance()).concatBy("."));
ability.addTarget(new TargetCardInGraveyard());
this.addAbility(ability);
}
private InheritedFiend(final InheritedFiend card) {
super(card);
}
@Override
public InheritedFiend copy() {
return new InheritedFiend(this);
}
}

View file

@ -87,12 +87,14 @@ public final class InnistradMidnightHunt extends ExpansionSet {
cards.add(new SetCardInfo("Graveyard Trespasser", 104, Rarity.RARE, mage.cards.g.GraveyardTrespasser.class));
cards.add(new SetCardInfo("Haunted Ridge", 263, Rarity.RARE, mage.cards.h.HauntedRidge.class));
cards.add(new SetCardInfo("Hedgewitch's Mask", 23, Rarity.COMMON, mage.cards.h.HedgewitchsMask.class));
cards.add(new SetCardInfo("Heirloom Mirror", 105, Rarity.UNCOMMON, mage.cards.h.HeirloomMirror.class));
cards.add(new SetCardInfo("Hobbling Zombie", 106, Rarity.COMMON, mage.cards.h.HobblingZombie.class));
cards.add(new SetCardInfo("Hound Tamer", 187, Rarity.UNCOMMON, mage.cards.h.HoundTamer.class));
cards.add(new SetCardInfo("Howl of the Hunt", 188, Rarity.COMMON, mage.cards.h.HowlOfTheHunt.class));
cards.add(new SetCardInfo("Hungry for More", 228, Rarity.UNCOMMON, mage.cards.h.HungryForMore.class));
cards.add(new SetCardInfo("Immolation", 144, Rarity.COMMON, mage.cards.i.Immolation.class));
cards.add(new SetCardInfo("Infernal Grasp", 107, Rarity.UNCOMMON, mage.cards.i.InfernalGrasp.class));
cards.add(new SetCardInfo("Inherited Fiend", 105, Rarity.UNCOMMON, mage.cards.i.InheritedFiend.class));
cards.add(new SetCardInfo("Insectile Aberration", 47, Rarity.UNCOMMON, mage.cards.i.InsectileAberration.class));
cards.add(new SetCardInfo("Island", 270, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Jack-o'-Lantern", 254, Rarity.COMMON, mage.cards.j.JackOLantern.class));

View file

@ -141,6 +141,7 @@ public enum CounterType {
PUPA("pupa"),
REACH("reach"),
REPAIR("repair"),
RITUAL("ritual"),
RUST("rust"),
QUEST("quest"),
SILVER("silver"),