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

@ -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;
}