[MOM] Implement Sunfall

This commit is contained in:
theelk801 2023-04-04 10:08:03 -04:00
parent 980f5dc439
commit a88e230a44
2 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,70 @@
package mage.cards.s;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.keyword.IncubateEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class Sunfall extends CardImpl {
public Sunfall(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{W}");
// Exile all creatures. Incubate X, where X is the number of creatures exiled this way.
this.getSpellAbility().addEffect(new SunfallEffect());
}
private Sunfall(final Sunfall card) {
super(card);
}
@Override
public Sunfall copy() {
return new Sunfall(this);
}
}
class SunfallEffect extends OneShotEffect {
SunfallEffect() {
super(Outcome.Benefit);
staticText = "exile all creatures. Incubate X, where X is the number of creatures exiled this way";
}
private SunfallEffect(final SunfallEffect effect) {
super(effect);
}
@Override
public SunfallEffect copy() {
return new SunfallEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl(game.getBattlefield().getActivePermanents(
StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source, game
));
player.moveCards(cards, Zone.EXILED, source, game);
new IncubateEffect(cards.size()).apply(game, source);
return true;
}
}

View file

@ -106,6 +106,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Skyclave Invader", 78, Rarity.UNCOMMON, mage.cards.s.SkyclaveInvader.class));
cards.add(new SetCardInfo("Stoke the Flames", 166, Rarity.UNCOMMON, mage.cards.s.StokeTheFlames.class));
cards.add(new SetCardInfo("Storm the Seedcore", 206, Rarity.UNCOMMON, mage.cards.s.StormTheSeedcore.class));
cards.add(new SetCardInfo("Sunfall", 40, Rarity.RARE, mage.cards.s.Sunfall.class));
cards.add(new SetCardInfo("Swamp", 279, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Swiftwater Cliffs", 273, Rarity.COMMON, mage.cards.s.SwiftwaterCliffs.class));
cards.add(new SetCardInfo("Thornwood Falls", 274, Rarity.COMMON, mage.cards.t.ThornwoodFalls.class));