diff --git a/Mage.Sets/src/mage/cards/g/GhostLitDrifter.java b/Mage.Sets/src/mage/cards/g/GhostLitDrifter.java new file mode 100644 index 00000000000..cd740e80522 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GhostLitDrifter.java @@ -0,0 +1,81 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.ChannelAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AnotherPredicate; +import mage.game.Game; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetadjustment.TargetAdjuster; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GhostLitDrifter extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("another creature"); + + static { + filter.add(AnotherPredicate.instance); + } + + public GhostLitDrifter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); + + this.subtype.add(SubType.SPIRIT); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {2}{U}: Another target creature gains flying until end of turn. + Ability ability = new SimpleActivatedAbility(new GainAbilityTargetEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn, + "another target creature gains flying until end of turn" + ), new ManaCostsImpl<>("{2}{U}")); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + + // Channel — {X}{U}, Discard Ghost-Lit Drifter: X target creatures gain flying until end of turn. + ability = new ChannelAbility("{X}{U}", new GainAbilityTargetEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn, + "X target creatures gain flying until end of turn" + )); + ability.setTargetAdjuster(GhostLitDrifterAdjuster.instance); + this.addAbility(ability); + } + + private GhostLitDrifter(final GhostLitDrifter card) { + super(card); + } + + @Override + public GhostLitDrifter copy() { + return new GhostLitDrifter(this); + } +} + +enum GhostLitDrifterAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + ability.getTargets().clear(); + ability.addTarget(new TargetCreaturePermanent(ability.getManaCostsToPay().getX())); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons2.java b/Mage.Sets/src/mage/sets/ModernHorizons2.java index 98a2ba92cce..132a013571b 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons2.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons2.java @@ -78,6 +78,7 @@ public final class ModernHorizons2 extends ExpansionSet { cards.add(new SetCardInfo("Forest", 489, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Fractured Sanity", 44, Rarity.RARE, mage.cards.f.FracturedSanity.class)); cards.add(new SetCardInfo("Gaea's Will", 162, Rarity.RARE, mage.cards.g.GaeasWill.class)); + cards.add(new SetCardInfo("Ghost-Lit Drifter", 45, Rarity.UNCOMMON, mage.cards.g.GhostLitDrifter.class)); cards.add(new SetCardInfo("Glinting Creeper", 164, Rarity.UNCOMMON, mage.cards.g.GlintingCreeper.class)); cards.add(new SetCardInfo("Glorious Enforcer", 14, Rarity.UNCOMMON, mage.cards.g.GloriousEnforcer.class)); cards.add(new SetCardInfo("Goblin Bombardment", 279, Rarity.RARE, mage.cards.g.GoblinBombardment.class));