Implemented Precognitive Perception

This commit is contained in:
Evan Kranzler 2019-01-03 13:24:32 -05:00
parent 369c2b4e19
commit 9dbfab364e
2 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,68 @@
package mage.cards.p;
import mage.abilities.Ability;
import mage.abilities.condition.common.MyMainPhaseCondition;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class PrecognitivePerception extends CardImpl {
public PrecognitivePerception(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}");
// Draw three cards.
// Addendum If you cast this spell during your main phase, instead scry 3, then draw three cards.
this.getSpellAbility().addEffect(new PrecognitivePerceptionEffect());
}
private PrecognitivePerception(final PrecognitivePerception card) {
super(card);
}
@Override
public PrecognitivePerception copy() {
return new PrecognitivePerception(this);
}
}
class PrecognitivePerceptionEffect extends OneShotEffect {
PrecognitivePerceptionEffect() {
super(Outcome.Benefit);
staticText = "Draw three cards.<br><i>Addendum</i> &mdash; " +
"If you cast this spell during your main phase, " +
"instead scry 3, then draw three cards.";
}
private PrecognitivePerceptionEffect(final PrecognitivePerceptionEffect effect) {
super(effect);
}
@Override
public PrecognitivePerceptionEffect copy() {
return new PrecognitivePerceptionEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
if (MyMainPhaseCondition.instance.apply(game, source)) {
controller.scry(3, source, game);
}
controller.drawCards(3, game);
return true;
}
}

View file

@ -66,6 +66,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Orzhov Guildgate", 252, Rarity.COMMON, mage.cards.o.OrzhovGuildgate.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Orzhov Guildgate", 253, Rarity.COMMON, mage.cards.o.OrzhovGuildgate.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Orzhov Locket", 236, Rarity.COMMON, mage.cards.o.OrzhovLocket.class));
cards.add(new SetCardInfo("Precognitive Perception", 45, Rarity.RARE, mage.cards.p.PrecognitivePerception.class));
cards.add(new SetCardInfo("Rafter Demon", 196, Rarity.COMMON, mage.cards.r.RafterDemon.class));
cards.add(new SetCardInfo("Rakdos Firewheeler", 197, Rarity.UNCOMMON, mage.cards.r.RakdosFirewheeler.class));
cards.add(new SetCardInfo("Rakdos Guildgate", 255, Rarity.COMMON, mage.cards.r.RakdosGuildgate.class, NON_FULL_USE_VARIOUS));