mirror of
https://github.com/correl/mage.git
synced 2024-12-29 03:00:15 +00:00
[MOC] Implement Dance with Calamity
This commit is contained in:
parent
9737526f17
commit
8d48429f5f
2 changed files with 91 additions and 0 deletions
90
Mage.Sets/src/mage/cards/d/DanceWithCalamity.java
Normal file
90
Mage.Sets/src/mage/cards/d/DanceWithCalamity.java
Normal file
|
@ -0,0 +1,90 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.*;
|
||||
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 mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class DanceWithCalamity extends CardImpl {
|
||||
|
||||
public DanceWithCalamity(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{7}{R}");
|
||||
|
||||
// Shuffle your library. As many times as you choose, you may exile the top card of your library. If the total mana value of the cards exiled this way is 13 or less, you may cast any number of spells from among those cards without paying their mana costs.
|
||||
this.getSpellAbility().addEffect(new DanceWithCalamityEffect());
|
||||
}
|
||||
|
||||
private DanceWithCalamity(final DanceWithCalamity card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DanceWithCalamity copy() {
|
||||
return new DanceWithCalamity(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DanceWithCalamityEffect extends OneShotEffect {
|
||||
|
||||
DanceWithCalamityEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "shuffle your library. As many times as you choose, you may exile the top card of your library. " +
|
||||
"If the total mana value of the cards exiled this way is 13 or less, you may cast any number " +
|
||||
"of spells from among those cards without paying their mana costs";
|
||||
}
|
||||
|
||||
private DanceWithCalamityEffect(final DanceWithCalamityEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DanceWithCalamityEffect copy() {
|
||||
return new DanceWithCalamityEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Cards cards = new CardsImpl();
|
||||
while (player.getLibrary().hasCards()) {
|
||||
int totalMV = cards
|
||||
.getCards(game)
|
||||
.stream()
|
||||
.mapToInt(MageObject::getManaValue)
|
||||
.sum();
|
||||
if (!player.chooseUse(
|
||||
outcome, "Exile the top card of your library?",
|
||||
"Current total mana value is " + totalMV,
|
||||
"Yes", "No", source, game
|
||||
)) {
|
||||
break;
|
||||
}
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
player.moveCards(card, Zone.EXILED, source, game);
|
||||
cards.add(card);
|
||||
}
|
||||
if (cards
|
||||
.getCards(game)
|
||||
.stream()
|
||||
.mapToInt(MageObject::getManaValue)
|
||||
.sum() <= 13) {
|
||||
CardUtil.castMultipleWithAttributeForFree(player, source, game, cards, StaticFilters.FILTER_CARD);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -79,6 +79,7 @@ public final class MarchOfTheMachineCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Cultivate", 295, Rarity.COMMON, mage.cards.c.Cultivate.class));
|
||||
cards.add(new SetCardInfo("Cultivator's Caravan", 354, Rarity.RARE, mage.cards.c.CultivatorsCaravan.class));
|
||||
cards.add(new SetCardInfo("Curse of Opulence", 274, Rarity.UNCOMMON, mage.cards.c.CurseOfOpulence.class));
|
||||
cards.add(new SetCardInfo("Dance with Calamity", 29, Rarity.RARE, mage.cards.d.DanceWithCalamity.class));
|
||||
cards.add(new SetCardInfo("Death-Greeter's Champion", 30, Rarity.RARE, mage.cards.d.DeathGreetersChampion.class));
|
||||
cards.add(new SetCardInfo("Deluxe Dragster", 21, Rarity.RARE, mage.cards.d.DeluxeDragster.class));
|
||||
cards.add(new SetCardInfo("Despark", 322, Rarity.UNCOMMON, mage.cards.d.Despark.class));
|
||||
|
|
Loading…
Reference in a new issue