Implemented Light Up the Stage

This commit is contained in:
Evan Kranzler 2018-12-18 21:23:35 -05:00
parent abf859b754
commit c7bc799f86
3 changed files with 132 additions and 3 deletions

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
@ -15,6 +13,9 @@ import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
import java.util.Set;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -78,7 +79,7 @@ class CommuneWithLavaEffect extends OneShotEffect {
class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl {
int castOnTurn = 0;
private int castOnTurn = 0;
public CommuneWithLavaMayPlayEffect() {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit);

View file

@ -0,0 +1,127 @@
package mage.cards.l;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.SpectacleAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
import java.util.Set;
import java.util.UUID;
/**
* @author TheElk801 and jeffwadsworth
*/
public final class LightUpTheStage extends CardImpl {
public LightUpTheStage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
// Spectacle {R}
this.addAbility(new SpectacleAbility(this, new ManaCostsImpl("{R}")));
// Exile the top two cards of your library. Until the end of your next turn, you may play those cards.
this.getSpellAbility().addEffect(new LightUpTheStageEffect());
}
public LightUpTheStage(final LightUpTheStage card) {
super(card);
}
@Override
public LightUpTheStage copy() {
return new LightUpTheStage(this);
}
}
class LightUpTheStageEffect extends OneShotEffect {
public LightUpTheStageEffect() {
super(Outcome.PlayForFree);
this.staticText = "Exile the top two cards of your library. Until the end of your next turn, you may play those cards";
}
public LightUpTheStageEffect(final LightUpTheStageEffect effect) {
super(effect);
}
@Override
public LightUpTheStageEffect copy() {
return new LightUpTheStageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Card sourceCard = game.getCard(source.getSourceId());
if (controller != null) {
Set<Card> cards = controller.getLibrary().getTopCards(game, 2);
controller.moveCardsToExile(cards, source, game, true, CardUtil.getCardExileZoneId(game, source), sourceCard.getIdName());
for (Card card : cards) {
ContinuousEffect effect = new LightUpTheStageMayPlayEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);
}
return true;
}
return false;
}
}
class LightUpTheStageMayPlayEffect extends AsThoughEffectImpl {
private int castOnTurn = 0;
public LightUpTheStageMayPlayEffect() {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit);
this.staticText = "Until the end of your next turn, you may play that card.";
}
public LightUpTheStageMayPlayEffect(final LightUpTheStageMayPlayEffect effect) {
super(effect);
castOnTurn = effect.castOnTurn;
}
@Override
public LightUpTheStageMayPlayEffect copy() {
return new LightUpTheStageMayPlayEffect(this);
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
castOnTurn = game.getTurnNum();
}
@Override
public boolean isInactive(Ability source, Game game) {
if (castOnTurn != game.getTurnNum() && game.getPhase().getStep().getType() == PhaseStep.END_TURN) {
if (game.isActivePlayer(source.getControllerId())) {
return true;
}
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
return source.isControlledBy(affectedControllerId)
&& getTargetPointer().getTargets(game, source).contains(sourceId);
}
}

View file

@ -35,6 +35,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Gate Colossus", 232, Rarity.UNCOMMON, mage.cards.g.GateColossus.class));
cards.add(new SetCardInfo("Growth Spiral", 178, Rarity.COMMON, mage.cards.g.GrowthSpiral.class));
cards.add(new SetCardInfo("Imperious Oligarch", 184, Rarity.COMMON, mage.cards.i.ImperiousOligarch.class));
cards.add(new SetCardInfo("Light Up the Stage", 107, Rarity.UNCOMMON, mage.cards.l.LightUpTheStage.class));
cards.add(new SetCardInfo("Mortify", 192, Rarity.UNCOMMON, mage.cards.m.Mortify.class));
cards.add(new SetCardInfo("Rafter Demon", 196, Rarity.COMMON, mage.cards.r.RafterDemon.class));
cards.add(new SetCardInfo("Rix Maadi Reveler", 109, Rarity.RARE, mage.cards.r.RixMaadiReveler.class));