Another bunch of fixes.

This commit is contained in:
marcins78@gmail.com
2011-08-30 21:29:48 +00:00
parent cb17625d92
commit 402cc0c9cb
3 changed files with 12 additions and 5 deletions

View File

@@ -26,6 +26,10 @@ public class PlayConditions {
&& modifiersQuerying.getTwilightCost(gameState, self) <= gameState.getTwilightPool();
}
public static boolean canUseFPCardDuringPhase(GameState gameState, Phase phase, PhysicalCard self) {
return (phase == null || gameState.getCurrentPhase() == phase) && (self.getZone() == Zone.FREE_SUPPORT || self.getZone() == Zone.FREE_CHARACTERS);
}
public static boolean canUseShadowCardDuringPhase(GameState gameState, Phase phase, PhysicalCard self, int twilightCost) {
return (phase == null || gameState.getCurrentPhase() == phase) && (self.getZone() == Zone.SHADOW_SUPPORT || self.getZone() == Zone.SHADOW_CHARACTERS)
&& twilightCost <= gameState.getTwilightPool();

View File

@@ -42,8 +42,7 @@ public class Card1_054 extends AbstractLotroCardBlueprint {
return Collections.singletonList(action);
}
if (self.getZone() == Zone.FREE_SUPPORT
&& Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.ELVEN)).size() > 0) {
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) {
final CostToEffectAction action = new CostToEffectAction(self, "Reveal an ELVEN card from hand and place it beneath your draw deck");
action.addCost(
new ChooseAnyCardEffect(playerId, "Choose ELVEN card", Filters.zone(Zone.HAND), Filters.owner(playerId), Filters.culture(Culture.ELVEN)) {

View File

@@ -49,10 +49,14 @@ public class TurnProcedure {
Effect effect = _actionStack.getNextEffect();
if (effect != null) {
EffectResult effectResult = effect.getRespondableResult();
if (effectResult != null)
if (effectResult != null) {
_actionStack.stackAction(new PlayOutRecognizableEffect(effect));
else
effect.playEffect(_game);
} else {
if (effect.canPlayEffect(_game))
effect.playEffect(_game);
else
effect.setFailed();
}
}
}
}