[OTC] Implement Back in Town

This commit is contained in:
theelk801 2024-04-05 09:16:31 -04:00
parent ba853ba51a
commit 662c8cd0fa
2 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,53 @@
package mage.cards.b;
import mage.abilities.Ability;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.OutlawPredicate;
import mage.game.Game;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetadjustment.TargetAdjuster;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BackInTown extends CardImpl {
public BackInTown(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{2}{B}");
// Return X target outlaw creature cards from your graveyard to the battlefield.
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()
.setText("return X target outlaw creature cards from your graveyard to the battlefield"));
this.getSpellAbility().setTargetAdjuster(BackInTownAdjuster.instance);
}
private BackInTown(final BackInTown card) {
super(card);
}
@Override
public BackInTown copy() {
return new BackInTown(this);
}
}
enum BackInTownAdjuster implements TargetAdjuster {
instance;
private static final FilterCard filter = new FilterCard("outlaw cards");
static {
filter.add(OutlawPredicate.instance);
}
@Override
public void adjustTargets(Ability ability, Game game) {
ability.getTargets().clear();
ability.addTarget(new TargetCardInYourGraveyard(ability.getManaCostsToPay().getX(), filter));
}
}

View file

@ -21,6 +21,7 @@ public final class OutlawsOfThunderJunctionCommander extends ExpansionSet {
cards.add(new SetCardInfo("Angel of Indemnity", 45, Rarity.RARE, mage.cards.a.AngelOfIndemnity.class));
cards.add(new SetCardInfo("Angelic Sell-Sword", 10, Rarity.RARE, mage.cards.a.AngelicSellSword.class));
cards.add(new SetCardInfo("Back in Town", 18, Rarity.RARE, mage.cards.b.BackInTown.class));
cards.add(new SetCardInfo("Charred Graverobber", 19, Rarity.RARE, mage.cards.c.CharredGraverobber.class));
cards.add(new SetCardInfo("Elemental Eruption", 27, Rarity.RARE, mage.cards.e.ElementalEruption.class));
cards.add(new SetCardInfo("Leyline Dowser", 39, Rarity.RARE, mage.cards.l.LeylineDowser.class));