mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Implemented Genesis Storm
This commit is contained in:
parent
b22c94193f
commit
2086a43036
2 changed files with 91 additions and 0 deletions
90
Mage.Sets/src/mage/cards/g/GenesisStorm.java
Normal file
90
Mage.Sets/src/mage/cards/g/GenesisStorm.java
Normal file
|
@ -0,0 +1,90 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.CommanderStormAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class GenesisStorm extends CardImpl {
|
||||
|
||||
public GenesisStorm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}");
|
||||
|
||||
// When you cast this spell, copy it for each time you've cast your commander from the command zone this game.
|
||||
this.addAbility(new CommanderStormAbility());
|
||||
|
||||
// Reveal cards from the top of your library until you reveal a nonland permanent card. You may put that card onto the battlefield. Then put all cards revealed this way that weren't put onto the battlefield on the bottom of your library in a random order.
|
||||
this.getSpellAbility().addEffect(new GenesisStormEffect());
|
||||
}
|
||||
|
||||
public GenesisStorm(final GenesisStorm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenesisStorm copy() {
|
||||
return new GenesisStorm(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GenesisStormEffect extends OneShotEffect {
|
||||
|
||||
public GenesisStormEffect() {
|
||||
super(Outcome.PlayForFree);
|
||||
this.staticText = "reveal cards from the top of your library "
|
||||
+ "until you reveal a nonland permanent card. "
|
||||
+ "You may put that card onto the battlefield. "
|
||||
+ "Then put all cards revealed this way "
|
||||
+ "that weren't put onto the battlefield "
|
||||
+ "on the bottom of your library in a random order";
|
||||
}
|
||||
|
||||
public GenesisStormEffect(GenesisStormEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
CardsImpl toReveal = new CardsImpl();
|
||||
Card nonLandCard = null;
|
||||
for (Card card : controller.getLibrary().getCards(game)) {
|
||||
toReveal.add(card);
|
||||
if (card.isPermanent() && !card.isLand()) {
|
||||
nonLandCard = card;
|
||||
break;
|
||||
}
|
||||
}
|
||||
controller.revealCards(source, toReveal, game);
|
||||
if (nonLandCard != null && controller.chooseUse(
|
||||
outcome, "Put " + nonLandCard.getLogName()
|
||||
+ " onto the battlefield?", source, game
|
||||
)) {
|
||||
controller.moveCards(nonLandCard, Zone.BATTLEFIELD, source, game);
|
||||
toReveal.remove(nonLandCard);
|
||||
}
|
||||
controller.putCardsOnBottomOfLibrary(toReveal, game, source, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenesisStormEffect copy() {
|
||||
return new GenesisStormEffect(this);
|
||||
}
|
||||
}
|
|
@ -41,6 +41,7 @@ public final class Commander2018 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Finest Hour", 180, Rarity.RARE, mage.cards.f.FinestHour.class));
|
||||
cards.add(new SetCardInfo("Forge of Heroes", 58, Rarity.COMMON, mage.cards.f.ForgeOfHeroes.class));
|
||||
cards.add(new SetCardInfo("Fury Storm", 22, Rarity.RARE, mage.cards.f.FuryStorm.class));
|
||||
cards.add(new SetCardInfo("Genesis Storm", 30, Rarity.RARE, mage.cards.g.GenesisStorm.class));
|
||||
cards.add(new SetCardInfo("Herald of the Pantheon", 151, Rarity.RARE, mage.cards.h.HeraldOfThePantheon.class));
|
||||
cards.add(new SetCardInfo("Hydra Omnivore", 153, Rarity.MYTHIC, mage.cards.h.HydraOmnivore.class));
|
||||
cards.add(new SetCardInfo("Kestia, the Cultivator", 42, Rarity.MYTHIC, mage.cards.k.KestiaTheCultivator.class));
|
||||
|
|
Loading…
Reference in a new issue