@Override public void pass(Game game) { this.passed = true; resetStoredBookmark(game); }
protected void restoreState(int bookmark, String text, Game game) { game.restoreState(bookmark, text); if (storedBookmark >= bookmark) { resetStoredBookmark(game); } }
protected boolean playManaAbility(ActivatedManaAbilityImpl ability, Game game) { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, ability.getId(), ability.getSourceId(), playerId))) { int bookmark = game.bookmarkState(); if (ability.activate(game, false)) { if (ability.resolve(game)) { if (ability.isUndoPossible()) { if (storedBookmark == -1 || storedBookmark > bookmark) { // e.g. useful for undo Nykthos, Shrine to Nyx setStoredBookmark(bookmark); } } else { resetStoredBookmark(game); } return true; } } restoreState(bookmark, ability.getRule(), game); } return false; }
resetStoredBookmark(game); return true; ability.resolve(game); game.removeBookmark(bookmark); resetStoredBookmark(game); return true;
protected boolean specialAction(SpecialAction action, Game game) { //20091005 - 114 if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, action.getSourceId(), action.getId(), playerId))) { int bookmark = game.bookmarkState(); if (action.activate(game, false)) { game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATED_ABILITY, action.getSourceId(), action.getId(), playerId)); if (!game.isSimulation()) { game.informPlayers(getLogName() + action.getGameLogMessage(game)); } if (action.resolve(game)) { game.removeBookmark(bookmark); resetStoredBookmark(game); return true; } } restoreState(bookmark, action.getRule(), game); } return false; }
game.fireInformEvent(getLogName() + " plays " + card.getLogName()); resetStoredBookmark(game); // prevent undo after playing a land return true;
resetStoredBookmark(game); return true;