mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
[MH2] Implemented Prismatic Ending
This commit is contained in:
parent
28835395e5
commit
1d9ebb5a9b
2 changed files with 69 additions and 0 deletions
68
Mage.Sets/src/mage/cards/p/PrismaticEnding.java
Normal file
68
Mage.Sets/src/mage/cards/p/PrismaticEnding.java
Normal file
|
@ -0,0 +1,68 @@
|
|||
package mage.cards.p;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetNonlandPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class PrismaticEnding extends CardImpl {
|
||||
|
||||
public PrismaticEnding(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{W}");
|
||||
|
||||
// Converge — Exile target nonland permanent if its mana value is less than or equal to the number of colors of mana spent to cast this spell.
|
||||
this.getSpellAbility().addEffect(new PrismaticEndingEffect());
|
||||
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
|
||||
}
|
||||
|
||||
private PrismaticEnding(final PrismaticEnding card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrismaticEnding copy() {
|
||||
return new PrismaticEnding(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PrismaticEndingEffect extends OneShotEffect {
|
||||
|
||||
PrismaticEndingEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "<i>Converge</i> — Exile target nonland permanent if its mana value " +
|
||||
"is less than or equal to the number of colors of mana spent to cast this spell";
|
||||
}
|
||||
|
||||
private PrismaticEndingEffect(final PrismaticEndingEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrismaticEndingEffect copy() {
|
||||
return new PrismaticEndingEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
int colors = ColorsOfManaSpentToCastCount.getInstance().calculate(game, source, this);
|
||||
return player != null
|
||||
&& permanent != null
|
||||
&& permanent.getManaValue() <= colors
|
||||
&& player.moveCards(permanent, Zone.EXILED, source, game);
|
||||
}
|
||||
}
|
|
@ -44,6 +44,7 @@ public final class ModernHorizons2 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Misty Rainforest", 250, Rarity.RARE, mage.cards.m.MistyRainforest.class));
|
||||
cards.add(new SetCardInfo("Mountain", 487, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Plains", 481, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Prismatic Ending", 25, Rarity.UNCOMMON, mage.cards.p.PrismaticEnding.class));
|
||||
cards.add(new SetCardInfo("Profane Tutor", 97, Rarity.RARE, mage.cards.p.ProfaneTutor.class));
|
||||
cards.add(new SetCardInfo("Rishadan Dockhand", 59, Rarity.RARE, mage.cards.r.RishadanDockhand.class));
|
||||
cards.add(new SetCardInfo("Sanctum Prelate", 491, Rarity.MYTHIC, mage.cards.s.SanctumPrelate.class));
|
||||
|
|
Loading…
Reference in a new issue