[DSK] Implement Get Out

This commit is contained in:
theelk801 2024-09-12 09:51:51 -04:00
parent 66ef9491bd
commit b896c97251
2 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,59 @@
package mage.cards.g;
import mage.MageObject;
import mage.abilities.Mode;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.Predicates;
import mage.target.TargetPermanent;
import mage.target.TargetSpell;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GetOut extends CardImpl {
private static final FilterSpell filter = new FilterSpell("creature or enchantment spell");
private static final FilterPermanent filter2 = new FilterPermanent("creatures and/or enchantments you own to your hand");
private static final Predicate<MageObject> predicate = Predicates.or(
CardType.CREATURE.getPredicate(),
CardType.ENCHANTMENT.getPredicate()
);
static {
filter.add(predicate);
filter2.add(predicate);
filter2.add(TargetController.YOU.getOwnerPredicate());
}
public GetOut(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{U}");
// Choose one --
// * Counter target creature or enchantment spell.
this.getSpellAbility().addEffect(new CounterTargetEffect());
this.getSpellAbility().addTarget(new TargetSpell(filter));
// * Return one or two target creatures and/or enchantments you own to your hand.
this.getSpellAbility().addMode(new Mode(new ReturnToHandTargetEffect())
.addTarget(new TargetPermanent(1, 2, filter2)));
}
private GetOut(final GetOut card) {
super(card);
}
@Override
public GetOut copy() {
return new GetOut(this);
}
}

View file

@ -91,6 +91,7 @@ public final class DuskmournHouseOfHorror extends ExpansionSet {
cards.add(new SetCardInfo("Frantic Strength", 179, Rarity.COMMON, mage.cards.f.FranticStrength.class));
cards.add(new SetCardInfo("Friendly Ghost", 12, Rarity.COMMON, mage.cards.f.FriendlyGhost.class));
cards.add(new SetCardInfo("Friendly Teddy", 247, Rarity.COMMON, mage.cards.f.FriendlyTeddy.class));
cards.add(new SetCardInfo("Get Out", 60, Rarity.UNCOMMON, mage.cards.g.GetOut.class));
cards.add(new SetCardInfo("Give In to Violence", 101, Rarity.COMMON, mage.cards.g.GiveInToViolence.class));
cards.add(new SetCardInfo("Glimmer Seeker", 14, Rarity.UNCOMMON, mage.cards.g.GlimmerSeeker.class));
cards.add(new SetCardInfo("Glimmerlight", 249, Rarity.COMMON, mage.cards.g.Glimmerlight.class));