[TDM] Implement Herd Heirloom

This commit is contained in:
theelk801 2025-04-09 13:29:54 -04:00
parent 56a05a7843
commit 162365269d
2 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,72 @@
package mage.cards.h;
import mage.ConditionalMana;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.mana.ConditionalAnyColorManaAbility;
import mage.abilities.mana.builder.ConditionalManaBuilder;
import mage.abilities.mana.conditional.CreatureCastConditionalMana;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class HerdHeirloom extends CardImpl {
private static final FilterPermanent filter
= new FilterControlledCreaturePermanent("creature you control with power 4 or greater");
static {
filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 3));
}
public HerdHeirloom(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{G}");
// {T}: Add one mana of any color. Spend this mana only to cast a creature spell.
this.addAbility(new ConditionalAnyColorManaAbility(1, new HerdHeirloomManaBuilder()));
// {T}: Until end of turn, target creature you control with power 4 or greater gains trample and "Whenever this creature deals combat damage to a player, draw a card."
Ability ability = new SimpleActivatedAbility(new GainAbilityTargetEffect(TrampleAbility.getInstance())
.setText("until end of turn, target creature you control with power 4 or greater gains trample"), new TapSourceCost());
ability.addEffect(new GainAbilityTargetEffect(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1)))
.setText("and \"Whenever this creature deals combat damage to a player, draw a card.\""));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
private HerdHeirloom(final HerdHeirloom card) {
super(card);
}
@Override
public HerdHeirloom copy() {
return new HerdHeirloom(this);
}
}
class HerdHeirloomManaBuilder extends ConditionalManaBuilder {
@Override
public ConditionalMana build(Object... options) {
return new CreatureCastConditionalMana(this.mana);
}
@Override
public String getRule() {
return "Spend this mana only to cast a creature spell";
}
}

View file

@ -120,6 +120,7 @@ public final class TarkirDragonstorm extends ExpansionSet {
cards.add(new SetCardInfo("Gurmag Nightwatch", 190, Rarity.COMMON, mage.cards.g.GurmagNightwatch.class));
cards.add(new SetCardInfo("Gurmag Rakshasa", 81, Rarity.UNCOMMON, mage.cards.g.GurmagRakshasa.class));
cards.add(new SetCardInfo("Hardened Tactician", 191, Rarity.UNCOMMON, mage.cards.h.HardenedTactician.class));
cards.add(new SetCardInfo("Herd Heirloom", 144, Rarity.RARE, mage.cards.h.HerdHeirloom.class));
cards.add(new SetCardInfo("Heritage Reclamation", 145, Rarity.COMMON, mage.cards.h.HeritageReclamation.class));
cards.add(new SetCardInfo("Highspire Bell-Ringer", 47, Rarity.COMMON, mage.cards.h.HighspireBellRinger.class));
cards.add(new SetCardInfo("Humbling Elder", 48, Rarity.COMMON, mage.cards.h.HumblingElder.class));