[MAT] Implement Animist's Might

This commit is contained in:
theelk801 2023-05-08 09:00:14 -04:00
parent 7209e037e5
commit 907d07d175
3 changed files with 73 additions and 2 deletions

View file

@ -0,0 +1,61 @@
package mage.cards.a;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.SourceTargetsPermanentCondition;
import mage.abilities.effects.common.DamageWithPowerFromOneToAnotherTargetEffect;
import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AnimistsMight extends CardImpl {
private static final FilterPermanent filter
= new FilterControlledCreaturePermanent("a legendary creature you control");
private static final FilterPermanent filter2
= new FilterCreatureOrPlaneswalkerPermanent("creature or planeswalker you don't control");
static {
filter.add(SuperType.LEGENDARY.getPredicate());
filter2.add(TargetController.NOT_YOU.getControllerPredicate());
}
private static final Condition condition = new SourceTargetsPermanentCondition(filter);
public AnimistsMight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
// This spell costs {2} less to cast if it targets a legendary creature you control.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SpellCostReductionSourceEffect(2, condition).setCanWorksOnStackOnly(true)
).setRuleAtTheTop(true));
// Target creature you control deals damage equal to twice its power to target creature or planeswalker you don't control.
this.getSpellAbility().addEffect(new DamageWithPowerFromOneToAnotherTargetEffect("", 2));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
}
private AnimistsMight(final AnimistsMight card) {
super(card);
}
@Override
public AnimistsMight copy() {
return new AnimistsMight(this);
}
}

View file

@ -21,6 +21,7 @@ public final class MarchOfTheMachineTheAftermath extends ExpansionSet {
this.hasBasicLands = false; this.hasBasicLands = false;
this.hasBoosters = false; // temporary this.hasBoosters = false; // temporary
cards.add(new SetCardInfo("Animist's Might", 20, Rarity.UNCOMMON, mage.cards.a.AnimistsMight.class));
cards.add(new SetCardInfo("Arni Metalbrow", 16, Rarity.RARE, mage.cards.a.ArniMetalbrow.class)); cards.add(new SetCardInfo("Arni Metalbrow", 16, Rarity.RARE, mage.cards.a.ArniMetalbrow.class));
cards.add(new SetCardInfo("Ayara's Oathsworn", 11, Rarity.RARE, mage.cards.a.AyarasOathsworn.class)); cards.add(new SetCardInfo("Ayara's Oathsworn", 11, Rarity.RARE, mage.cards.a.AyarasOathsworn.class));
cards.add(new SetCardInfo("Blot Out", 12, Rarity.UNCOMMON, mage.cards.b.BlotOut.class)); cards.add(new SetCardInfo("Blot Out", 12, Rarity.UNCOMMON, mage.cards.b.BlotOut.class));

View file

@ -13,20 +13,27 @@ import mage.players.Player;
*/ */
public class DamageWithPowerFromOneToAnotherTargetEffect extends OneShotEffect { public class DamageWithPowerFromOneToAnotherTargetEffect extends OneShotEffect {
String firstTargetName; private final String firstTargetName;
private final int multiplier;
public DamageWithPowerFromOneToAnotherTargetEffect() { public DamageWithPowerFromOneToAnotherTargetEffect() {
this(""); this("");
} }
public DamageWithPowerFromOneToAnotherTargetEffect(String firstTargetName) { public DamageWithPowerFromOneToAnotherTargetEffect(String firstTargetName) {
this(firstTargetName, 1);
}
public DamageWithPowerFromOneToAnotherTargetEffect(String firstTargetName, int multiplier) {
super(Outcome.Damage); super(Outcome.Damage);
this.firstTargetName = firstTargetName; this.firstTargetName = firstTargetName;
this.multiplier = multiplier;
} }
public DamageWithPowerFromOneToAnotherTargetEffect(final DamageWithPowerFromOneToAnotherTargetEffect effect) { public DamageWithPowerFromOneToAnotherTargetEffect(final DamageWithPowerFromOneToAnotherTargetEffect effect) {
super(effect); super(effect);
this.firstTargetName = effect.firstTargetName; this.firstTargetName = effect.firstTargetName;
this.multiplier = effect.multiplier;
} }
@Override @Override
@ -64,6 +71,8 @@ public class DamageWithPowerFromOneToAnotherTargetEffect extends OneShotEffect {
throw new IllegalStateException("It must have two targets, but found " + mode.getTargets().size()); throw new IllegalStateException("It must have two targets, but found " + mode.getTargets().size());
} }
return (firstTargetName.isEmpty() ? mode.getTargets().get(0).getDescription() : firstTargetName) + " deals damage equal to its power to " + mode.getTargets().get(1).getDescription(); return (firstTargetName.isEmpty() ? mode.getTargets().get(0).getDescription() : firstTargetName) +
" deals damage equal to" + (multiplier == 2 ? " twice" : "") +
" its power to " + mode.getTargets().get(1).getDescription();
} }
} }