mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
commit
2a704784cb
2 changed files with 90 additions and 0 deletions
89
Mage.Sets/src/mage/cards/p/Prophecy.java
Normal file
89
Mage.Sets/src/mage/cards/p/Prophecy.java
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
package mage.cards.p;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mage.MageObject;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||||
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
|
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;
|
||||||
|
import mage.target.common.TargetOpponent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author noahg
|
||||||
|
*/
|
||||||
|
public final class Prophecy extends CardImpl {
|
||||||
|
|
||||||
|
public Prophecy(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}");
|
||||||
|
|
||||||
|
|
||||||
|
// Reveal the top card of target opponent's library. If it's a land, you gain 1 life. Then that player shuffles their library.
|
||||||
|
this.getSpellAbility().addEffect(new ProphecyEffect());
|
||||||
|
this.getSpellAbility().addTarget(new TargetOpponent());
|
||||||
|
|
||||||
|
// Draw a card at the beginning of the next turn's upkeep.
|
||||||
|
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Prophecy(final Prophecy card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Prophecy copy() {
|
||||||
|
return new Prophecy(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ProphecyEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
public ProphecyEffect() {
|
||||||
|
super(Outcome.GainLife);
|
||||||
|
this.staticText = "Reveal the top card of target opponent's library. If it's a land, you gain 1 life. Then that player shuffles their library";
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProphecyEffect(final ProphecyEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProphecyEffect copy() {
|
||||||
|
return new ProphecyEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
|
if (sourceObject == null || targetPlayer == null || controller == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (targetPlayer.getLibrary().hasCards()) {
|
||||||
|
CardsImpl cards = new CardsImpl();
|
||||||
|
Card card = targetPlayer.getLibrary().getFromTop(game);
|
||||||
|
if (card == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
cards.add(card);
|
||||||
|
targetPlayer.revealCards(sourceObject.getIdName(), cards, game);
|
||||||
|
if (card.isLand()) {
|
||||||
|
controller.gainLife(1, game, source.getSourceId());
|
||||||
|
}
|
||||||
|
targetPlayer.shuffleLibrary(source, game);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -132,6 +132,7 @@ public final class Homelands extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Mystic Decree", 34, Rarity.RARE, mage.cards.m.MysticDecree.class));
|
cards.add(new SetCardInfo("Mystic Decree", 34, Rarity.RARE, mage.cards.m.MysticDecree.class));
|
||||||
cards.add(new SetCardInfo("Narwhal", 35, Rarity.RARE, mage.cards.n.Narwhal.class));
|
cards.add(new SetCardInfo("Narwhal", 35, Rarity.RARE, mage.cards.n.Narwhal.class));
|
||||||
cards.add(new SetCardInfo("Primal Order", 92, Rarity.RARE, mage.cards.p.PrimalOrder.class));
|
cards.add(new SetCardInfo("Primal Order", 92, Rarity.RARE, mage.cards.p.PrimalOrder.class));
|
||||||
|
cards.add(new SetCardInfo("Prophecy", 11, Rarity.COMMON, mage.cards.p.Prophecy.class));
|
||||||
cards.add(new SetCardInfo("Rashka the Slayer", 12, Rarity.RARE, mage.cards.r.RashkaTheSlayer.class));
|
cards.add(new SetCardInfo("Rashka the Slayer", 12, Rarity.RARE, mage.cards.r.RashkaTheSlayer.class));
|
||||||
cards.add(new SetCardInfo("Reef Pirates", "36a", Rarity.COMMON, ReefPirates.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Reef Pirates", "36a", Rarity.COMMON, ReefPirates.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Reef Pirates", "36b", Rarity.COMMON, ReefPirates.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Reef Pirates", "36b", Rarity.COMMON, ReefPirates.class, NON_FULL_USE_VARIOUS));
|
||||||
|
|
Loading…
Reference in a new issue