[AFC] Implemented Klauth's Will

This commit is contained in:
Evan Kranzler 2021-08-21 09:12:19 -04:00
parent b9550a7387
commit 898f8ca287
2 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,78 @@
package mage.cards.k;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.condition.common.ControlACommanderCondition;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.DamageAllEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game;
import mage.target.TargetPermanent;
import mage.target.targetadjustment.TargetAdjuster;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class KlauthsWill extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature without flying");
static {
filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
}
public KlauthsWill(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{R}{R}{G}");
// Choose one. If you control a commander as you cast this spell, you may choose both.
this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control a commander as you cast this spell, you may choose both."
);
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance);
// Breathe Flame Klauth's Will deals X damage to each creature without flying.
this.getSpellAbility().addEffect(new DamageAllEffect(ManacostVariableValue.REGULAR, filter));
this.getSpellAbility().withFirstModeFlavorWord("Breathe Flame");
// Smash Relics Destroy up to X target artifacts and/or enchantments.
this.getSpellAbility().addMode(new Mode(
new DestroyTargetEffect().setText("destroy up to X target artifacts and/or enchantments")
).withFlavorWord("Smash Relics"));
this.getSpellAbility().setTargetAdjuster(KlauthsWillAdjuster.instance);
}
private KlauthsWill(final KlauthsWill card) {
super(card);
}
@Override
public KlauthsWill copy() {
return new KlauthsWill(this);
}
}
enum KlauthsWillAdjuster implements TargetAdjuster {
instance;
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getEffects().stream().anyMatch(DestroyTargetEffect.class::isInstance)) {
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(
0, ability.getManaCostsToPay().getX(),
StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT
));
}
}
}

View file

@ -139,6 +139,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet {
cards.add(new SetCardInfo("Karmic Guide", 68, Rarity.RARE, mage.cards.k.KarmicGuide.class));
cards.add(new SetCardInfo("Kenrith's Transformation", 162, Rarity.UNCOMMON, mage.cards.k.KenrithsTransformation.class));
cards.add(new SetCardInfo("Kindred Summons", 163, Rarity.RARE, mage.cards.k.KindredSummons.class));
cards.add(new SetCardInfo("Klauth's Will", 51, Rarity.RARE, mage.cards.k.KlauthsWill.class));
cards.add(new SetCardInfo("Klauth, Unrivaled Ancient", 50, Rarity.MYTHIC, mage.cards.k.KlauthUnrivaledAncient.class));
cards.add(new SetCardInfo("Knight of Autumn", 187, Rarity.RARE, mage.cards.k.KnightOfAutumn.class));
cards.add(new SetCardInfo("Light Up the Stage", 131, Rarity.UNCOMMON, mage.cards.l.LightUpTheStage.class));