forked from External/mage
Implemented Teferi's Ageless Insight
This commit is contained in:
parent
9ff4412a4a
commit
36c3db4da1
3 changed files with 103 additions and 20 deletions
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
|
|
@ -13,14 +11,15 @@ import mage.game.events.GameEvent;
|
|||
import mage.players.Player;
|
||||
import mage.watchers.common.CardsDrawnDuringDrawStepWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class AlhammarretsArchive extends CardImpl {
|
||||
|
||||
public AlhammarretsArchive(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
|
||||
// If you would gain life, you gain twice that much life instead.
|
||||
|
|
@ -30,7 +29,7 @@ public final class AlhammarretsArchive extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AlhammarretsArchiveReplacementEffect()), new CardsDrawnDuringDrawStepWatcher());
|
||||
}
|
||||
|
||||
public AlhammarretsArchive(final AlhammarretsArchive card) {
|
||||
private AlhammarretsArchive(final AlhammarretsArchive card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
@ -42,12 +41,12 @@ public final class AlhammarretsArchive extends CardImpl {
|
|||
|
||||
class AlhammarretsArchiveEffect extends ReplacementEffectImpl {
|
||||
|
||||
public AlhammarretsArchiveEffect() {
|
||||
AlhammarretsArchiveEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "If you would gain life, you gain twice that much life instead";
|
||||
}
|
||||
|
||||
public AlhammarretsArchiveEffect(final AlhammarretsArchiveEffect effect) {
|
||||
private AlhammarretsArchiveEffect(final AlhammarretsArchiveEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -75,12 +74,12 @@ class AlhammarretsArchiveEffect extends ReplacementEffectImpl {
|
|||
|
||||
class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl {
|
||||
|
||||
public AlhammarretsArchiveReplacementEffect() {
|
||||
AlhammarretsArchiveReplacementEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Neutral);
|
||||
staticText = "If you draw a card except the first one you draw in each of your draw steps, draw two cards instead";
|
||||
}
|
||||
|
||||
public AlhammarretsArchiveReplacementEffect(final AlhammarretsArchiveReplacementEffect effect) {
|
||||
private AlhammarretsArchiveReplacementEffect(final AlhammarretsArchiveReplacementEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -110,17 +109,14 @@ class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getPlayerId().equals(source.getControllerId())) {
|
||||
if (game.isActivePlayer(event.getPlayerId())
|
||||
&& game.getPhase().getStep().getType() == PhaseStep.DRAW) {
|
||||
CardsDrawnDuringDrawStepWatcher watcher = game.getState().getWatcher(CardsDrawnDuringDrawStepWatcher.class);
|
||||
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
if (!event.getPlayerId().equals(source.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
if (!game.isActivePlayer(event.getPlayerId())
|
||||
|| game.getPhase().getStep().getType() != PhaseStep.DRAW) {
|
||||
return true;
|
||||
}
|
||||
CardsDrawnDuringDrawStepWatcher watcher = game.getState().getWatcher(CardsDrawnDuringDrawStepWatcher.class);
|
||||
return watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
86
Mage.Sets/src/mage/cards/t/TeferisAgelessInsight.java
Normal file
86
Mage.Sets/src/mage/cards/t/TeferisAgelessInsight.java
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.watchers.common.CardsDrawnDuringDrawStepWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TeferisAgelessInsight extends CardImpl {
|
||||
|
||||
public TeferisAgelessInsight(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}");
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
|
||||
// If you would draw a card except the first one you draw in each of your draw steps, draw two cards instead.
|
||||
this.addAbility(new SimpleStaticAbility(new TeferisAgelessInsightEffect()), new CardsDrawnDuringDrawStepWatcher());
|
||||
}
|
||||
|
||||
private TeferisAgelessInsight(final TeferisAgelessInsight card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TeferisAgelessInsight copy() {
|
||||
return new TeferisAgelessInsight(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TeferisAgelessInsightEffect extends ReplacementEffectImpl {
|
||||
|
||||
TeferisAgelessInsightEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Neutral);
|
||||
staticText = "If you draw a card except the first one you draw in each of your draw steps, draw two cards instead";
|
||||
}
|
||||
|
||||
private TeferisAgelessInsightEffect(final TeferisAgelessInsightEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TeferisAgelessInsightEffect copy() {
|
||||
return new TeferisAgelessInsightEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.drawCards(2, event.getSourceId(), game, event.getAppliedEffects());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DRAW_CARD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (!event.getPlayerId().equals(source.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
if (!game.isActivePlayer(event.getPlayerId())
|
||||
|| game.getPhase().getStep().getType() != PhaseStep.DRAW) {
|
||||
return true;
|
||||
}
|
||||
CardsDrawnDuringDrawStepWatcher watcher = game.getState().getWatcher(CardsDrawnDuringDrawStepWatcher.class);
|
||||
return watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -68,6 +68,7 @@ public final class CoreSet2021 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Sparkhunter Masticore", 240, Rarity.RARE, mage.cards.s.SparkhunterMasticore.class));
|
||||
cards.add(new SetCardInfo("Spirit of Malevolence", 331, Rarity.COMMON, mage.cards.s.SpiritOfMalevolence.class));
|
||||
cards.add(new SetCardInfo("Storm Caller", 335, Rarity.COMMON, mage.cards.s.StormCaller.class));
|
||||
cards.add(new SetCardInfo("Teferi's Ageless Insight", 76, Rarity.RARE, mage.cards.t.TeferisAgelessInsight.class));
|
||||
cards.add(new SetCardInfo("Teferi's Protege", 77, Rarity.COMMON, mage.cards.t.TeferisProtege.class));
|
||||
cards.add(new SetCardInfo("Teferi's Wavecaster", 327, Rarity.RARE, mage.cards.t.TeferisWavecaster.class));
|
||||
cards.add(new SetCardInfo("Teferi, Master of Time", 75, Rarity.MYTHIC, mage.cards.t.TeferiMasterOfTime.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue