mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[TLA] Implement Foggy Swamp Visions
This commit is contained in:
parent
edbb5b0209
commit
1f21d6e716
2 changed files with 96 additions and 0 deletions
94
Mage.Sets/src/mage/cards/f/FoggySwampVisions.java
Normal file
94
Mage.Sets/src/mage/cards/f/FoggySwampVisions.java
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.common.WaterbendCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
import mage.target.targetadjustment.XManaValueTargetAdjuster;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class FoggySwampVisions extends CardImpl {
|
||||
|
||||
public FoggySwampVisions(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}");
|
||||
|
||||
// As an additional cost to cast this spell, waterbend {X}.
|
||||
this.getSpellAbility().addCost(new WaterbendCost("{X}"));
|
||||
|
||||
// Exile X target creature cards from graveyards. For each creature card exiled this way, create a token that's a copy of it. At the beginning of your next end step, sacrifice those tokens.
|
||||
this.getSpellAbility().addEffect(new FoggySwampVisionsEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURES));
|
||||
this.getSpellAbility().setTargetAdjuster(new XManaValueTargetAdjuster());
|
||||
}
|
||||
|
||||
private FoggySwampVisions(final FoggySwampVisions card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FoggySwampVisions copy() {
|
||||
return new FoggySwampVisions(this);
|
||||
}
|
||||
}
|
||||
|
||||
class FoggySwampVisionsEffect extends OneShotEffect {
|
||||
|
||||
FoggySwampVisionsEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "exile X target creature cards from graveyards. For each creature card exiled this way, " +
|
||||
"create a token that's a copy of it. At the beginning of your next end step, sacrifice those tokens.";
|
||||
}
|
||||
|
||||
private FoggySwampVisionsEffect(final FoggySwampVisionsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FoggySwampVisionsEffect copy() {
|
||||
return new FoggySwampVisionsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Cards cards = new CardsImpl(getTargetPointer().getTargets(game, source));
|
||||
if (player == null || cards.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
player.moveCards(cards, Zone.EXILED, source, game);
|
||||
cards.retainZone(Zone.EXILED, game);
|
||||
Set<Permanent> permanents = new HashSet<>();
|
||||
for (Card card : cards.getCards(game)) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card, game));
|
||||
effect.apply(game, source);
|
||||
permanents.addAll(effect.getAddedPermanents());
|
||||
}
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
|
||||
new SacrificeTargetEffect("sacrifice those tokens")
|
||||
.setTargetPointer(new FixedTargets(permanents, game)),
|
||||
TargetController.YOU
|
||||
), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -190,6 +190,8 @@ public final class AvatarTheLastAirbender extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Foggy Swamp Hunters", 101, Rarity.COMMON, mage.cards.f.FoggySwampHunters.class));
|
||||
cards.add(new SetCardInfo("Foggy Swamp Spirit Keeper", 222, Rarity.UNCOMMON, mage.cards.f.FoggySwampSpiritKeeper.class));
|
||||
cards.add(new SetCardInfo("Foggy Swamp Vinebender", 180, Rarity.COMMON, mage.cards.f.FoggySwampVinebender.class));
|
||||
cards.add(new SetCardInfo("Foggy Swamp Visions", 102, Rarity.RARE, mage.cards.f.FoggySwampVisions.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Foggy Swamp Visions", 339, Rarity.RARE, mage.cards.f.FoggySwampVisions.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Forecasting Fortune Teller", 51, Rarity.COMMON, mage.cards.f.ForecastingFortuneTeller.class));
|
||||
cards.add(new SetCardInfo("Forest", 286, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Forest", 291, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue