implement [MH3] Flare of Duplication

This commit is contained in:
Susucre 2024-05-22 20:17:37 +02:00
parent be81fadf3a
commit 75d685cb5b
2 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,50 @@
package mage.cards.f;
import mage.ObjectColor;
import mage.abilities.costs.AlternativeCostSourceAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.CopyTargetStackObjectEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.target.TargetSpell;
import java.util.UUID;
/**
* @author Susucr
*/
public final class FlareOfDuplication extends CardImpl {
private static final FilterPermanent filter = new FilterControlledCreaturePermanent("nontoken red creature");
static {
filter.add(TokenPredicate.FALSE);
filter.add(new ColorPredicate(ObjectColor.RED));
}
public FlareOfDuplication(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}{R}");
// You may sacrifice a nontoken red creature rather than pay this spell's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(filter)).setRuleAtTheTop(true));
// Copy target instant or sorcery spell. You may choose new targets for the copy.
this.getSpellAbility().addEffect(new CopyTargetStackObjectEffect());
this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY));
}
private FlareOfDuplication(final FlareOfDuplication card) {
super(card);
}
@Override
public FlareOfDuplication copy() {
return new FlareOfDuplication(this);
}
}

View file

@ -37,6 +37,7 @@ public final class ModernHorizons3 extends ExpansionSet {
cards.add(new SetCardInfo("Evolution Witness", 151, Rarity.COMMON, mage.cards.e.EvolutionWitness.class));
cards.add(new SetCardInfo("Flare of Cultivation", 154, Rarity.RARE, mage.cards.f.FlareOfCultivation.class));
cards.add(new SetCardInfo("Flare of Denial", 62, Rarity.RARE, mage.cards.f.FlareOfDenial.class));
cards.add(new SetCardInfo("Flare of Duplication", 119, Rarity.RARE, mage.cards.f.FlareOfDuplication.class));
cards.add(new SetCardInfo("Flare of Fortitude", 26, Rarity.RARE, mage.cards.f.FlareOfFortitude.class));
cards.add(new SetCardInfo("Flooded Strand", 220, Rarity.RARE, mage.cards.f.FloodedStrand.class));
cards.add(new SetCardInfo("Flusterstorm", 496, Rarity.RARE, mage.cards.f.Flusterstorm.class));