This commit is contained in:
marcins78@gmail.com
2011-08-30 14:00:36 +00:00
parent fa10ace6d1
commit a335b3e39f
11 changed files with 90 additions and 23 deletions

View File

@@ -22,8 +22,13 @@ public class PlayConditions {
} }
public static boolean canPlayShadowCardDuringPhase(GameState gameState, ModifiersQuerying modifiersQuerying, Phase phase, PhysicalCard self) { public static boolean canPlayShadowCardDuringPhase(GameState gameState, ModifiersQuerying modifiersQuerying, Phase phase, PhysicalCard self) {
return gameState.getCurrentPhase() == phase && (self.getZone() == Zone.HAND || self.getZone() == Zone.DECK) return (phase == null || gameState.getCurrentPhase() == phase) && (self.getZone() == Zone.HAND || self.getZone() == Zone.DECK)
&& (phase == null || modifiersQuerying.getTwilightCost(gameState, self) <= gameState.getTwilightPool()); && modifiersQuerying.getTwilightCost(gameState, self) <= gameState.getTwilightPool();
}
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();
} }
public static boolean canPlayCompanionDuringSetup(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) { public static boolean canPlayCompanionDuringSetup(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) {

View File

@@ -11,7 +11,7 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.CostToEffectAction; import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.WoundEffect; import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import com.gempukku.lotro.logic.modifiers.CompositeModifier; import com.gempukku.lotro.logic.modifiers.CompositeModifier;
import com.gempukku.lotro.logic.modifiers.KeywordModifier; import com.gempukku.lotro.logic.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.modifiers.Modifier; import com.gempukku.lotro.logic.modifiers.Modifier;
@@ -67,7 +67,7 @@ public class Card1_014 extends AbstractAttachableFPPossession {
new ChooseActiveCardEffect(playerId, "Choose an Orc to wound", Filters.keyword(Keyword.ORC)) { new ChooseActiveCardEffect(playerId, "Choose an Orc to wound", Filters.keyword(Keyword.ORC)) {
@Override @Override
protected void cardSelected(LotroGame game, PhysicalCard orc) { protected void cardSelected(LotroGame game, PhysicalCard orc) {
action.addEffect(new WoundEffect(orc)); action.addEffect(new WoundCharacterEffect(orc));
} }
} }
); );

View File

@@ -9,7 +9,7 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.ChooseActiveCardsEffect; import com.gempukku.lotro.logic.effects.ChooseActiveCardsEffect;
import com.gempukku.lotro.logic.effects.WoundEffect; import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import com.gempukku.lotro.logic.timing.Action; import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections; import java.util.Collections;
@@ -52,11 +52,11 @@ public class Card1_019 extends AbstractLotroCardBlueprint {
@Override @Override
protected void cardsSelected(List<PhysicalCard> cards) { protected void cardsSelected(List<PhysicalCard> cards) {
if (cards.size() == 2) { if (cards.size() == 2) {
action.addEffect(new WoundEffect(cards.get(0))); action.addEffect(new WoundCharacterEffect(cards.get(0)));
action.addEffect(new WoundEffect(cards.get(1))); action.addEffect(new WoundCharacterEffect(cards.get(1)));
} else { } else {
action.addEffect(new WoundEffect(cards.get(0))); action.addEffect(new WoundCharacterEffect(cards.get(0)));
action.addEffect(new WoundEffect(cards.get(0))); action.addEffect(new WoundCharacterEffect(cards.get(0)));
} }
} }
} }

View File

@@ -12,7 +12,7 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.CostToEffectAction; import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.WoundEffect; import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import com.gempukku.lotro.logic.modifiers.Modifier; import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.timing.Action; import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.EffectResult; import com.gempukku.lotro.logic.timing.EffectResult;
@@ -61,7 +61,7 @@ public class Card1_033 extends AbstractAttachableFPPossession {
new ChooseActiveCardEffect(playerId, "Choose a minion", Filters.type(CardType.MINION)) { new ChooseActiveCardEffect(playerId, "Choose a minion", Filters.type(CardType.MINION)) {
@Override @Override
protected void cardSelected(LotroGame game, PhysicalCard minion) { protected void cardSelected(LotroGame game, PhysicalCard minion) {
action.addEffect(new WoundEffect(minion)); action.addEffect(new WoundCharacterEffect(minion));
} }
} }
); );

View File

@@ -11,7 +11,7 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.CostToEffectAction; import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.WoundEffect; import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import com.gempukku.lotro.logic.timing.Action; import com.gempukku.lotro.logic.timing.Action;
import java.util.LinkedList; import java.util.LinkedList;
@@ -56,7 +56,7 @@ public class Card1_050 extends AbstractCompanion {
new ChooseActiveCardEffect(playerId, "Choose a minion", Filters.type(CardType.MINION)) { new ChooseActiveCardEffect(playerId, "Choose a minion", Filters.type(CardType.MINION)) {
@Override @Override
protected void cardSelected(LotroGame game, PhysicalCard minion) { protected void cardSelected(LotroGame game, PhysicalCard minion) {
action.addEffect(new WoundEffect(minion)); action.addEffect(new WoundCharacterEffect(minion));
} }
}); });

View File

@@ -12,7 +12,7 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.CostToEffectAction; import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.WoundEffect; import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import com.gempukku.lotro.logic.timing.Action; import com.gempukku.lotro.logic.timing.Action;
import java.util.LinkedList; import java.util.LinkedList;
@@ -52,7 +52,7 @@ public class Card1_056 extends AbstractAlly {
new ChooseActiveCardEffect(playerId, "Choose an Uruk-hai", Filters.keyword(Keyword.URUK_HAI)) { new ChooseActiveCardEffect(playerId, "Choose an Uruk-hai", Filters.keyword(Keyword.URUK_HAI)) {
@Override @Override
protected void cardSelected(LotroGame game, PhysicalCard urukHai) { protected void cardSelected(LotroGame game, PhysicalCard urukHai) {
action.addEffect(new WoundEffect(urukHai)); action.addEffect(new WoundCharacterEffect(urukHai));
} }
}); });
} }

View File

@@ -12,7 +12,7 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.CostToEffectAction; import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.WoundEffect; import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import com.gempukku.lotro.logic.timing.Action; import com.gempukku.lotro.logic.timing.Action;
import java.util.LinkedList; import java.util.LinkedList;
@@ -52,7 +52,7 @@ public class Card1_057 extends AbstractAlly {
new ChooseActiveCardEffect(playerId, "Choose an Orc", Filters.keyword(Keyword.ORC)) { new ChooseActiveCardEffect(playerId, "Choose an Orc", Filters.keyword(Keyword.ORC)) {
@Override @Override
protected void cardSelected(LotroGame game, PhysicalCard urukHai) { protected void cardSelected(LotroGame game, PhysicalCard urukHai) {
action.addEffect(new WoundEffect(urukHai)); action.addEffect(new WoundCharacterEffect(urukHai));
} }
}); });
} }

View File

@@ -58,8 +58,7 @@ public class Card1_120 extends AbstractLotroCardBlueprint {
return Collections.singletonList(action); return Collections.singletonList(action);
} }
if (gameState.getCurrentPhase() == Phase.SHADOW if (PlayConditions.canUseShadowCardDuringPhase(gameState, Phase.SHADOW, self, 3)) {
&& gameState.getTwilightPool() >= 3) {
final CostToEffectAction action = new CostToEffectAction(self, "Remove (3) and spot X burdens to make the Free Peoples player reveal X cards at random from hand. You may discard 1 revealed card."); final CostToEffectAction action = new CostToEffectAction(self, "Remove (3) and spot X burdens to make the Free Peoples player reveal X cards at random from hand. You may discard 1 revealed card.");
action.addCost(new RemoveTwilightEffect(3)); action.addCost(new RemoveTwilightEffect(3));
final String fpPlayer = gameState.getCurrentPlayerId(); final String fpPlayer = gameState.getCurrentPlayerId();

View File

@@ -0,0 +1,63 @@
package com.gempukku.lotro.cards.set1.isengard;
import com.gempukku.lotro.cards.AbstractLotroCardBlueprint;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Side: Shadow
* Culture: Isengard
* Twilight Cost: 1
* Type: Condition
* Game Text: To play, spot an Uruk-hai. Plays to your support area. Maneuver: Spot 6 companions and remove (2) to
* wound a companion (except the Ring-bearer).
*/
public class Card1_125 extends AbstractLotroCardBlueprint {
public Card1_125() {
super(Side.SHADOW, CardType.CONDITION, Culture.ISENGARD, "Greed", "1_125");
}
@Override
public int getTwilightCost() {
return 1;
}
@Override
public List<? extends Action> getPlayablePhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canPlayShadowCardDuringPhase(game.getGameState(), game.getModifiersQuerying(), Phase.SHADOW, self)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.URUK_HAI))) {
PlayPermanentAction action = new PlayPermanentAction(self, Zone.SHADOW_SUPPORT);
return Collections.singletonList(action);
}
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.MANEUVER, self, 2)
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 6) {
final CostToEffectAction action = new CostToEffectAction(self, "Spot 6 companions and remove (2) to wound a companion (except the Ring-bearer).");
action.addCost(new RemoveTwilightEffect(2));
action.addEffect(
new ChooseActiveCardEffect(playerId, "Choose non Ring-bearer companion", Filters.type(CardType.COMPANION), Filters.not(Filters.keyword(Keyword.RING_BEARER))) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard companion) {
action.addEffect(new WoundCharacterEffect(companion));
}
}
);
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -1,12 +1,12 @@
package com.gempukku.lotro.logic.actions; package com.gempukku.lotro.logic.actions;
import com.gempukku.lotro.game.PhysicalCard; import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.logic.effects.WoundEffect; import com.gempukku.lotro.logic.effects.WoundCharacterEffect;
public class WoundAction extends CostToEffectAction { public class WoundAction extends CostToEffectAction {
public WoundAction(PhysicalCard card, int wounds) { public WoundAction(PhysicalCard card, int wounds) {
super(null, "Wound character"); super(null, "Wound character");
for (int i = 0; i < wounds; i++) for (int i = 0; i < wounds; i++)
addEffect(new WoundEffect(card)); addEffect(new WoundCharacterEffect(card));
} }
} }

View File

@@ -7,10 +7,10 @@ import com.gempukku.lotro.logic.timing.AbstractEffect;
import com.gempukku.lotro.logic.timing.EffectResult; import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.WoundResult; import com.gempukku.lotro.logic.timing.results.WoundResult;
public class WoundEffect extends AbstractEffect { public class WoundCharacterEffect extends AbstractEffect {
private PhysicalCard _woundTarget; private PhysicalCard _woundTarget;
public WoundEffect(PhysicalCard woundTarget) { public WoundCharacterEffect(PhysicalCard woundTarget) {
_woundTarget = woundTarget; _woundTarget = woundTarget;
} }