[ODY] fixed Skyshooter not sacrificing itself to activate (fixes #7738)

This commit is contained in:
Evan Kranzler 2021-04-11 18:25:42 -04:00
parent edec5b32fb
commit 62008ea6b7

View file

@ -1,10 +1,9 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
@ -13,25 +12,27 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone; import mage.filter.FilterPermanent;
import mage.filter.common.FilterAttackingOrBlockingCreature; import mage.filter.common.FilterAttackingOrBlockingCreature;
import mage.filter.predicate.mageobject.AbilityPredicate; import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.target.common.TargetAttackingOrBlockingCreature; import mage.target.TargetPermanent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class Skyshooter extends CardImpl { public final class Skyshooter extends CardImpl {
private static final FilterAttackingOrBlockingCreature filter = new FilterAttackingOrBlockingCreature("attacking or blocking creature with flying"); private static final FilterPermanent filter
= new FilterAttackingOrBlockingCreature("attacking or blocking creature with flying");
static { static {
filter.add(new AbilityPredicate(FlyingAbility.class)); filter.add(new AbilityPredicate(FlyingAbility.class));
} }
public Skyshooter(UUID ownerId, CardSetInfo setInfo) { public Skyshooter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add(SubType.CENTAUR); this.subtype.add(SubType.CENTAUR);
this.subtype.add(SubType.ARCHER); this.subtype.add(SubType.ARCHER);
@ -40,11 +41,12 @@ public final class Skyshooter extends CardImpl {
// Reach // Reach
this.addAbility(ReachAbility.getInstance()); this.addAbility(ReachAbility.getInstance());
// {tap}, Sacrifice Skyshooter: Destroy target attacking or blocking creature with flying.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost());
ability.addTarget(new TargetAttackingOrBlockingCreature(1,1, filter, false));
this.addAbility(ability);
// {tap}, Sacrifice Skyshooter: Destroy target attacking or blocking creature with flying.
Ability ability = new SimpleActivatedAbility(new DestroyTargetEffect(), new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
} }
private Skyshooter(final Skyshooter card) { private Skyshooter(final Skyshooter card) {