Implemented Enhanced Surveillance

This commit is contained in:
Evan Kranzler 2018-09-14 15:30:23 -04:00
parent f92b36dc75
commit c532fe632a
10 changed files with 129 additions and 11 deletions

View file

@ -73,7 +73,7 @@ class BloodOperativeTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SURVEIL;
return event.getType() == GameEvent.EventType.SURVEILED;
}
@Override

View file

@ -106,7 +106,7 @@ class DarkbladeAgentWatcher extends Watcher {
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SURVEIL) {
if (event.getType() == GameEvent.EventType.SURVEILED) {
this.surveiledThisTurn.add(event.getPlayerId());
}
}

View file

@ -65,7 +65,7 @@ class DisinformationCampaignTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SURVEIL;
return event.getType() == GameEvent.EventType.SURVEILED;
}
@Override

View file

@ -0,0 +1,113 @@
package mage.cards.e;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.ExileSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
/**
*
* @author TheElk801
*/
public final class EnhancedSurveillance extends CardImpl {
public EnhancedSurveillance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
// You may look at an additional two cards each time you surveil.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD, new EnhancedSurveillanceReplacementEffect()
));
// Exile Enhanced Surveillance: Shuffle your graveyard into your library.
this.addAbility(new SimpleActivatedAbility(
new EnhancedSurveillanceShuffleEffect(), new ExileSourceCost()
));
}
public EnhancedSurveillance(final EnhancedSurveillance card) {
super(card);
}
@Override
public EnhancedSurveillance copy() {
return new EnhancedSurveillance(this);
}
}
class EnhancedSurveillanceReplacementEffect extends ReplacementEffectImpl {
public EnhancedSurveillanceReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "You may look at an additional "
+ "two cards each time you surveil.";
}
public EnhancedSurveillanceReplacementEffect(final EnhancedSurveillanceReplacementEffect effect) {
super(effect);
}
@Override
public EnhancedSurveillanceReplacementEffect copy() {
return new EnhancedSurveillanceReplacementEffect(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 true;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
event.setAmount(event.getAmount() + 2);
return false;
}
}
class EnhancedSurveillanceShuffleEffect extends OneShotEffect {
public EnhancedSurveillanceShuffleEffect() {
super(Outcome.Neutral);
this.staticText = "Shuffle your graveyard into your library";
}
public EnhancedSurveillanceShuffleEffect(final EnhancedSurveillanceShuffleEffect effect) {
super(effect);
}
@Override
public EnhancedSurveillanceShuffleEffect copy() {
return new EnhancedSurveillanceShuffleEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (Card card : controller.getGraveyard().getCards(game)) {
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
}
controller.shuffleLibrary(source, game);
return true;
}
return false;
}
}

View file

@ -45,7 +45,7 @@ class FeldonsCaneEffect extends OneShotEffect {
FeldonsCaneEffect() {
super(Outcome.Neutral);
this.staticText = "Shuffles your graveyard into your library";
this.staticText = "Shuffle your graveyard into your library";
}
FeldonsCaneEffect(final FeldonsCaneEffect effect) {

View file

@ -81,7 +81,7 @@ class ThoughtboundPhantasmTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SURVEIL;
return event.getType() == GameEvent.EventType.SURVEILED;
}
@Override

View file

@ -60,7 +60,7 @@ class WhisperingSnitchTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SURVEIL;
return event.getType() == GameEvent.EventType.SURVEILED;
}
@Override
@ -100,7 +100,7 @@ class WhisperingSnitchWatcher extends Watcher {
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SURVEIL) {
if (event.getType() == GameEvent.EventType.SURVEILED) {
timesSurveiled.put(event.getPlayerId(), getTimesSurveiled(event.getPlayerId()) + 1);
}
}

View file

@ -63,6 +63,7 @@ public final class GuildsOfRavnica extends ExpansionSet {
cards.add(new SetCardInfo("Doom Whisperer", 69, Rarity.MYTHIC, mage.cards.d.DoomWhisperer.class));
cards.add(new SetCardInfo("Dream Eater", 38, Rarity.MYTHIC, mage.cards.d.DreamEater.class));
cards.add(new SetCardInfo("Emmara, Soul of the Accord", 168, Rarity.RARE, mage.cards.e.EmmaraSoulOfTheAccord.class));
cards.add(new SetCardInfo("Enhanced Surveillance", 40, Rarity.UNCOMMON, mage.cards.e.EnhancedSurveillance.class));
cards.add(new SetCardInfo("Erratic Cyclops", 98, Rarity.RARE, mage.cards.e.ErraticCyclops.class));
cards.add(new SetCardInfo("Expansion // Explosion", 224, Rarity.RARE, mage.cards.e.ExpansionExplosion.class));
cards.add(new SetCardInfo("Find // Finality", 225, Rarity.RARE, mage.cards.f.FindFinality.class));

View file

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

View file

@ -3914,9 +3914,13 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public boolean surveil(int value, Ability source, Game game) {
game.informPlayers(getLogName() + " surveils " + value);
GameEvent event = new GameEvent(GameEvent.EventType.SURVEIL, getId(), source == null ? null : source.getSourceId(), getId(), value, true);
if (game.replaceEvent(event)) {
return false;
}
game.informPlayers(getLogName() + " surveils " + event.getAmount());
Cards cards = new CardsImpl();
cards.addAll(getLibrary().getTopCards(game, value));
cards.addAll(getLibrary().getTopCards(game, event.getAmount()));
if (!cards.isEmpty()) {
String text;
if (cards.size() == 1) {
@ -3930,7 +3934,7 @@ public abstract class PlayerImpl implements Player, Serializable {
cards.removeAll(target.getTargets());
putCardsOnTopOfLibrary(cards, game, source, true);
}
game.fireEvent(new GameEvent(GameEvent.EventType.SURVEIL, getId(), source == null ? null : source.getSourceId(), getId(), value, true));
game.fireEvent(new GameEvent(GameEvent.EventType.SURVEILED, getId(), source == null ? null : source.getSourceId(), getId(), event.getAmount(), true));
return true;
}