[CMR] Implemented Eligeth, Crossroads Augur

This commit is contained in:
Evan Kranzler 2020-10-30 20:42:06 -04:00
parent 4c61745f8c
commit f234dd47e0
7 changed files with 103 additions and 8 deletions

View file

@ -0,0 +1,86 @@
package mage.cards.e;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.PartnerAbility;
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 java.util.UUID;
/**
* @author TheElk801
*/
public final class EligethCrossroadsAugur extends CardImpl {
public EligethCrossroadsAugur(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{U}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.SPHINX);
this.power = new MageInt(5);
this.toughness = new MageInt(6);
// Flying
this.addAbility(FlyingAbility.getInstance());
// If you would scry a number of cards, draw that many cards instead.
this.addAbility(new SimpleStaticAbility(new EligethCrossroadsAugurReplacementEffect()));
// Partner
this.addAbility(PartnerAbility.getInstance());
}
private EligethCrossroadsAugur(final EligethCrossroadsAugur card) {
super(card);
}
@Override
public EligethCrossroadsAugur copy() {
return new EligethCrossroadsAugur(this);
}
}
class EligethCrossroadsAugurReplacementEffect extends ReplacementEffectImpl {
EligethCrossroadsAugurReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "If you would scry a number of cards, draw that many cards instead.";
}
private EligethCrossroadsAugurReplacementEffect(final EligethCrossroadsAugurReplacementEffect effect) {
super(effect);
}
@Override
public EligethCrossroadsAugurReplacementEffect copy() {
return new EligethCrossroadsAugurReplacementEffect(this);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SURVEIL;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return source.isControlledBy(event.getPlayerId());
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
player.drawCards(event.getAmount(), event.getSourceId(), game);
return true;
}
}

View file

@ -62,7 +62,7 @@ class ScryTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.SCRY;
return event.getType() == EventType.SCRIED;
}
@Override

View file

@ -58,7 +58,7 @@ class ScryTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.SCRY;
return event.getType() == EventType.SCRIED;
}
@Override

View file

@ -54,6 +54,7 @@ public final class CommanderLegends extends ExpansionSet {
cards.add(new SetCardInfo("Demonic Lore", 118, Rarity.UNCOMMON, mage.cards.d.DemonicLore.class));
cards.add(new SetCardInfo("Doomed Traveler", 19, Rarity.COMMON, mage.cards.d.DoomedTraveler.class));
cards.add(new SetCardInfo("Dragon Mantle", 174, Rarity.COMMON, mage.cards.d.DragonMantle.class));
cards.add(new SetCardInfo("Eligeth, Crossroads Augur", 66, Rarity.RARE, mage.cards.e.EligethCrossroadsAugur.class));
cards.add(new SetCardInfo("Emberwilde Captain", 175, Rarity.RARE, mage.cards.e.EmberwildeCaptain.class));
cards.add(new SetCardInfo("Entourage of Trest", 224, Rarity.COMMON, mage.cards.e.EntourageOfTrest.class));
cards.add(new SetCardInfo("Exquisite Huntmaster", 122, Rarity.COMMON, mage.cards.e.ExquisiteHuntmaster.class));

View file

@ -76,7 +76,7 @@ public class FatesealEffect extends OneShotEffect {
}
// move cards to the top of the library
controller.putCardsOnTopOfLibrary(cards, game, source, true);
game.fireEvent(new GameEvent(GameEvent.EventType.FATESEAL, opponent.getId(), source.getSourceId(), source.getControllerId()));
game.fireEvent(new GameEvent(GameEvent.EventType.FATESEALED, opponent.getId(), source.getSourceId(), source.getControllerId()));
controller.setTopCardRevealed(revealed);
return true;
}

View file

@ -250,7 +250,10 @@ public class GameEvent implements Serializable {
SHUFFLE_LIBRARY, LIBRARY_SHUFFLED,
ENCHANT_PLAYER, ENCHANTED_PLAYER,
CAN_TAKE_MULLIGAN,
FLIP_COIN, COIN_FLIPPED, SCRY, SURVEIL, SURVEILED, FATESEAL,
SCRY, SCRIED,
SURVEIL, SURVEILED,
FATESEALED,
FLIP_COIN, COIN_FLIPPED,
ROLL_DICE, DICE_ROLLED,
ROLL_PLANAR_DIE, PLANAR_DIE_ROLLED,
PLANESWALK, PLANESWALKED,

View file

@ -4528,9 +4528,14 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public boolean scry(int value, Ability source, Game game) {
game.informPlayers(getLogName() + " scries " + value);
GameEvent event = new GameEvent(EventType.SCRY, getId(), source == null
? null : source.getSourceId(), getId(), value, true);
if (game.replaceEvent(event)) {
return false;
}
game.informPlayers(getLogName() + " scries " + event.getAmount());
Cards cards = new CardsImpl();
cards.addAll(getLibrary().getTopCards(game, value));
cards.addAll(getLibrary().getTopCards(game, event.getAmount()));
if (!cards.isEmpty()) {
TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY,
new FilterCard("card" + (cards.size() == 1 ? "" : "s")
@ -4540,8 +4545,8 @@ public abstract class PlayerImpl implements Player, Serializable {
cards.removeAll(target.getTargets());
putCardsOnTopOfLibrary(cards, game, source, true);
}
game.fireEvent(new GameEvent(GameEvent.EventType.SCRY, getId(), source == null
? null : source.getSourceId(), getId(), value, true));
game.fireEvent(new GameEvent(GameEvent.EventType.SCRIED, getId(), source == null
? null : source.getSourceId(), getId(), event.getAmount(), true));
return true;
}