[OTJ] Implement Trick Shot

This commit is contained in:
Susucre 2024-04-02 12:42:09 +02:00
parent 339c08b58d
commit f41f3feb89
3 changed files with 55 additions and 1 deletions

View file

@ -0,0 +1,49 @@
package mage.cards.t;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.other.AnotherTargetPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.SecondTargetPointer;
import java.util.UUID;
/**
* @author Susucr
*/
public final class TrickShot extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other target creature token");
static {
filter.add(new AnotherTargetPredicate(2));
filter.add(TokenPredicate.TRUE);
}
public TrickShot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}");
// Trick Shot deals 6 damage to target creature and 2 damage to up to one other target creature token.
this.getSpellAbility().addTarget(new TargetCreaturePermanent().setTargetTag(1));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, filter, false).setTargetTag(2));
this.getSpellAbility().addEffect(new DamageTargetEffect(6, true, "", true));
this.getSpellAbility().addEffect(
new DamageTargetEffect(2, true, "", true)
.setTargetPointer(new SecondTargetPointer())
.setText("and 2 damage to up to one other target creature token")
);
}
private TrickShot(final TrickShot card) {
super(card);
}
@Override
public TrickShot copy() {
return new TrickShot(this);
}
}

View file

@ -254,6 +254,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet {
cards.add(new SetCardInfo("Trained Arynx", 36, Rarity.COMMON, mage.cards.t.TrainedArynx.class));
cards.add(new SetCardInfo("Trash the Town", 186, Rarity.UNCOMMON, mage.cards.t.TrashTheTown.class));
cards.add(new SetCardInfo("Treasure Dredger", 110, Rarity.UNCOMMON, mage.cards.t.TreasureDredger.class));
cards.add(new SetCardInfo("Trick Shot", 151, Rarity.COMMON, mage.cards.t.TrickShot.class));
cards.add(new SetCardInfo("Tumbleweed Rising", 187, Rarity.COMMON, mage.cards.t.TumbleweedRising.class));
cards.add(new SetCardInfo("Unfortunate Accident", 111, Rarity.UNCOMMON, mage.cards.u.UnfortunateAccident.class));
cards.add(new SetCardInfo("Unscrupulous Contractor", 112, Rarity.UNCOMMON, mage.cards.u.UnscrupulousContractor.class));

View file

@ -24,7 +24,7 @@ public class DamageTargetEffect extends OneShotEffect {
protected DynamicValue amount;
protected boolean preventable;
protected String targetDescription;
protected boolean useOnlyTargetPointer;
protected boolean useOnlyTargetPointer; // why do we ignore targetPointer by default??
protected String sourceName = "{this}";
public DamageTargetEffect(int amount) {
@ -44,6 +44,10 @@ public class DamageTargetEffect extends OneShotEffect {
this(StaticValue.get(amount), preventable, targetDescription);
}
public DamageTargetEffect(int amount, boolean preventable, String targetDescription, boolean useOnlyTargetPointer) {
this(StaticValue.get(amount), preventable, targetDescription, useOnlyTargetPointer);
}
public DamageTargetEffect(int amount, boolean preventable, String targetDescription, String whoDealDamageName) {
this(StaticValue.get(amount), preventable, targetDescription);
this.sourceName = whoDealDamageName;