mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
[BLB] Implement Starfall Invocation. (#12807)
This commit is contained in:
parent
c2f4e7ba08
commit
12f9ad8cdb
2 changed files with 87 additions and 0 deletions
86
Mage.Sets/src/mage/cards/s/StarfallInvocation.java
Normal file
86
Mage.Sets/src/mage/cards/s/StarfallInvocation.java
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
package mage.cards.s;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.condition.common.GiftWasPromisedCondition;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.keyword.GiftAbility;
|
||||||
|
import mage.cards.*;
|
||||||
|
import mage.constants.*;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.TargetCard;
|
||||||
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Grath
|
||||||
|
*/
|
||||||
|
public final class StarfallInvocation extends CardImpl {
|
||||||
|
|
||||||
|
public StarfallInvocation(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{W}");
|
||||||
|
|
||||||
|
|
||||||
|
// Gift a card
|
||||||
|
this.addAbility(new GiftAbility(this, GiftType.CARD));
|
||||||
|
|
||||||
|
// Destroy all creatures. If the gift was promised, return a creature card put into your graveyard this way to the battlefield under your control.
|
||||||
|
this.getSpellAbility().addEffect(new StarfallInvocationEffect());
|
||||||
|
}
|
||||||
|
|
||||||
|
private StarfallInvocation(final StarfallInvocation card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StarfallInvocation copy() {
|
||||||
|
return new StarfallInvocation(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class StarfallInvocationEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
StarfallInvocationEffect() {
|
||||||
|
super(Outcome.DestroyPermanent);
|
||||||
|
staticText = "destroy all creatures. If the gift was promised, return a creature card put into your " +
|
||||||
|
"graveyard this way to the battlefield under your control";
|
||||||
|
}
|
||||||
|
|
||||||
|
private StarfallInvocationEffect(final StarfallInvocationEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StarfallInvocationEffect copy() {
|
||||||
|
return new StarfallInvocationEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Cards yourCreatureCards = new CardsImpl();
|
||||||
|
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
|
||||||
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source, game)) {
|
||||||
|
if (permanent != null && permanent.destroy(source, game, false)) {
|
||||||
|
if (controller != null && permanent.isOwnedBy(controller.getId())) {
|
||||||
|
yourCreatureCards.add(permanent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (controller != null && GiftWasPromisedCondition.TRUE.apply(game, source)) {
|
||||||
|
TargetCard target = new TargetCardInYourGraveyard();
|
||||||
|
controller.choose(Outcome.PutCreatureInPlay, yourCreatureCards, target, source, game);
|
||||||
|
Card targetCard = game.getCard(target.getFirstTarget());
|
||||||
|
if (targetCard != null) {
|
||||||
|
controller.moveCards(targetCard, Zone.BATTLEFIELD, source, game);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -229,6 +229,7 @@ public final class Bloomburrow extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Splash Lasher", 73, Rarity.UNCOMMON, mage.cards.s.SplashLasher.class));
|
cards.add(new SetCardInfo("Splash Lasher", 73, Rarity.UNCOMMON, mage.cards.s.SplashLasher.class));
|
||||||
cards.add(new SetCardInfo("Splash Portal", 74, Rarity.UNCOMMON, mage.cards.s.SplashPortal.class));
|
cards.add(new SetCardInfo("Splash Portal", 74, Rarity.UNCOMMON, mage.cards.s.SplashPortal.class));
|
||||||
cards.add(new SetCardInfo("Star Charter", 33, Rarity.UNCOMMON, mage.cards.s.StarCharter.class));
|
cards.add(new SetCardInfo("Star Charter", 33, Rarity.UNCOMMON, mage.cards.s.StarCharter.class));
|
||||||
|
cards.add(new SetCardInfo("Starfall Invocation", 34, Rarity.RARE, mage.cards.s.StarfallInvocation.class));
|
||||||
cards.add(new SetCardInfo("Starforged Sword", 249, Rarity.UNCOMMON, mage.cards.s.StarforgedSword.class));
|
cards.add(new SetCardInfo("Starforged Sword", 249, Rarity.UNCOMMON, mage.cards.s.StarforgedSword.class));
|
||||||
cards.add(new SetCardInfo("Stargaze", 114, Rarity.UNCOMMON, mage.cards.s.Stargaze.class));
|
cards.add(new SetCardInfo("Stargaze", 114, Rarity.UNCOMMON, mage.cards.s.Stargaze.class));
|
||||||
cards.add(new SetCardInfo("Starlit Soothsayer", 115, Rarity.COMMON, mage.cards.s.StarlitSoothsayer.class));
|
cards.add(new SetCardInfo("Starlit Soothsayer", 115, Rarity.COMMON, mage.cards.s.StarlitSoothsayer.class));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue