"Caverns of Isengard"
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.gempukku.lotro.cards.set5.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.modifiers.SpecialFlagModifier;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifierFlag;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Battle of Helm's Deep
|
||||
* Twilight Cost: 9
|
||||
* Type: Site
|
||||
* Site: 9T
|
||||
* Game Text: Underground. The Free Peoples player wins the game only if the Ring-bearer survives until Shadow players
|
||||
* reconcile.
|
||||
*/
|
||||
public class Card5_120 extends AbstractSite {
|
||||
public Card5_120() {
|
||||
super("Caverns of Isengard", Block.TWO_TOWERS, 9, 9, Direction.LEFT);
|
||||
addKeyword(Keyword.UNDERGROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
|
||||
return Collections.singletonList(
|
||||
new SpecialFlagModifier(self, ModifierFlag.WIN_CHECK_AFTER_SHADOW_RECONCILE));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package com.gempukku.lotro.logic.modifiers;
|
||||
|
||||
public enum ModifierFlag {
|
||||
HAS_TO_MOVE_IF_POSSIBLE, RING_TEXT_INACTIVE, SARUMAN_FIRST_SENTENCE_INACTIVE
|
||||
HAS_TO_MOVE_IF_POSSIBLE, RING_TEXT_INACTIVE, SARUMAN_FIRST_SENTENCE_INACTIVE, WIN_CHECK_AFTER_SHADOW_RECONCILE
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.gempukku.lotro.logic.timing.processes.turn;
|
||||
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifierFlag;
|
||||
import com.gempukku.lotro.logic.timing.processes.GameProcess;
|
||||
import com.gempukku.lotro.logic.timing.processes.turn.general.PlayersPlayPhaseActionsInOrderGameProcess;
|
||||
import com.gempukku.lotro.logic.timing.processes.turn.general.StartOfPhaseGameProcess;
|
||||
@@ -24,7 +25,29 @@ public class RegroupGameProcess implements GameProcess {
|
||||
public GameProcess getNextProcess() {
|
||||
return new StartOfPhaseGameProcess(_game, Phase.REGROUP,
|
||||
new PlayersPlayPhaseActionsInOrderGameProcess(_game, _game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(_game.getGameState().getCurrentPlayerId(), true), 0,
|
||||
new ShadowPlayersReconcileGameProcess(_game,
|
||||
new FellowshipPlayerChoosesToMoveOrStayGameProcess(_game))));
|
||||
new CheckForSpecialWinConditionGameProcess(
|
||||
new ShadowPlayersReconcileGameProcess(_game,
|
||||
new FellowshipPlayerChoosesToMoveOrStayGameProcess(_game)))));
|
||||
}
|
||||
|
||||
private class CheckForSpecialWinConditionGameProcess implements GameProcess {
|
||||
private GameProcess _followingProcess;
|
||||
|
||||
private CheckForSpecialWinConditionGameProcess(GameProcess followingProcess) {
|
||||
_followingProcess = followingProcess;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
if (_game.getGameState().getCurrentSiteNumber() == 9
|
||||
&& _game.getModifiersQuerying().hasFlagActive(ModifierFlag.WIN_CHECK_AFTER_SHADOW_RECONCILE)) {
|
||||
_game.playerWon(_game.getGameState().getCurrentPlayerId(), "Surviving to Regroup phase on site 9");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProcess getNextProcess() {
|
||||
return _followingProcess;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.game.AbstractActionProxy;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.game.state.actions.DefaultActionsEnvironment;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifierFlag;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
@@ -24,7 +25,8 @@ public class WinConditionRule {
|
||||
public List<? extends Action> getRequiredBeforeTriggers(LotroGame lotroGame, Effect effect) {
|
||||
if (effect.getType() == EffectResult.Type.START_OF_PHASE
|
||||
&& lotroGame.getGameState().getCurrentPhase() == Phase.REGROUP
|
||||
&& lotroGame.getGameState().getCurrentSiteNumber() == 9)
|
||||
&& lotroGame.getGameState().getCurrentSiteNumber() == 9
|
||||
&& !lotroGame.getModifiersQuerying().hasFlagActive(ModifierFlag.WIN_CHECK_AFTER_SHADOW_RECONCILE))
|
||||
lotroGame.playerWon(lotroGame.getGameState().getCurrentPlayerId(), "Surviving to Regroup phase on site 9");
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user