Refactoring.

This commit is contained in:
marcins78
2014-07-23 13:13:27 +00:00
parent d824db22cc
commit f88630db4b
36 changed files with 196 additions and 77 deletions

View File

@@ -4,7 +4,12 @@ import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.DiscardCardFromDeckEffect;
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.Block;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -77,7 +82,7 @@ public class Card1_055 extends AbstractPermanent {
}
private String[] opponentsHavingAtLeast7Cards(LotroGame game, String currentPlayer) {
String[] opponents = GameUtils.getOpponents(game, currentPlayer);
String[] opponents = GameUtils.getShadowPlayers(game);
List<String> result = new LinkedList<String>();
for (String shadowPlayer : opponents)

View File

@@ -8,7 +8,7 @@ import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.PlayOrder;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseAndDiscardCardsFromHandEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
@@ -31,10 +31,7 @@ public class Card13_188 extends AbstractNewSite {
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
final PlayOrder playerOrder = game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(game.getGameState().getCurrentPlayerId(), false);
// Skipping FP player
playerOrder.getNextPlayer();
String firstShadow = playerOrder.getNextPlayer();
String firstShadow = GameUtils.getFirstShadowPlayer(game);
if (TriggerConditions.movesTo(game, effectResult, self)
&& playerId.equals(firstShadow)
&& PlayConditions.canDiscardFromHand(game, playerId, 2, Filters.any)) {

View File

@@ -9,7 +9,7 @@ import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.PlayOrder;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.RuleUtils;
@@ -43,10 +43,7 @@ public class Card15_038 extends AbstractCompanion {
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.winsSkirmish(game, effectResult, self)) {
final PlayOrder counterClockwisePlayOrder = game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(game.getGameState().getCurrentPlayerId(), false);
// FP player
counterClockwisePlayOrder.getNextPlayer();
String firstShadowPlayer = counterClockwisePlayOrder.getNextPlayer();
String firstShadowPlayer = GameUtils.getFirstShadowPlayer(game);
int selfStr = game.getModifiersQuerying().getStrength(game.getGameState(), self);
int oppStr = RuleUtils.getShadowSkirmishStrength(game);

View File

@@ -8,7 +8,7 @@ import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.PlayOrder;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.timing.EffectResult;
@@ -30,9 +30,7 @@ public class Card15_192 extends AbstractNewSite {
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
final PlayOrder playOrder = game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(game.getGameState().getCurrentPlayerId(), false);
playOrder.getNextPlayer();
final String firstShadowPlayer = playOrder.getNextPlayer();
final String firstShadowPlayer = GameUtils.getFirstShadowPlayer(game);
if (TriggerConditions.transferredCard(game, effectResult, CardType.FOLLOWER, null, Filters.character)
&& playerId.equals(firstShadowPlayer)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);

View File

@@ -31,7 +31,7 @@ public class Card18_037 extends AbstractEvent {
PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ReinforceTokenEffect(self, playerId, Token.GOLLUM));
for (String shadowPlayer : GameUtils.getOpponents(game, playerId)) {
for (String shadowPlayer : GameUtils.getShadowPlayers(game)) {
action.appendEffect(
new OptionalEffect(action, shadowPlayer,
new DrawCardsEffect(action, shadowPlayer, 1)));

View File

@@ -3,8 +3,19 @@ package com.gempukku.lotro.cards.set18.gondor;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.*;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.cards.effects.AddTokenEffect;
import com.gempukku.lotro.cards.effects.AddUntilStartOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RemoveTokenEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Token;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -68,7 +79,7 @@ public class Card18_050 extends AbstractPermanent {
public String getText(LotroGame game) {
return "Make " + GameUtils.getFullName(minion) + " not assignable to skirmish until the regroup phase";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -5,7 +5,12 @@ import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.ShuffleCardsFromHandIntoDeckEffect;
import com.gempukku.lotro.cards.modifiers.ArcheryTotalModifier;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -51,7 +56,7 @@ public class Card18_057 extends AbstractAttachableFPPossession {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new SelfDiscardEffect(self));
for (String opponentId : GameUtils.getOpponents(game, playerId)) {
for (String opponentId : GameUtils.getShadowPlayers(game)) {
action.appendEffect(
new ShuffleCardsFromHandIntoDeckEffect(self, opponentId, new HashSet<PhysicalCard>(game.getGameState().getHand(opponentId))));
action.appendEffect(

View File

@@ -5,7 +5,11 @@ import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -37,7 +41,7 @@ public class Card19_004 extends AbstractEvent {
PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, CardType.COMPANION, Keyword.FELLOWSHIP));
for (String opponentId : GameUtils.getOpponents(game, playerId)) {
for (String opponentId : GameUtils.getShadowPlayers(game)) {
action.appendEffect(
new ChooseAndDiscardCardsFromPlayEffect(action, opponentId, 1, 1, Filters.owner(opponentId), Side.SHADOW));
}

View File

@@ -43,7 +43,7 @@ public class Card2_013 extends AbstractOldEvent {
action.appendEffect(
new PreventableEffect(action,
new DrawCardsEffect(action, playerId, 3),
Arrays.asList(GameUtils.getOpponents(game, playerId)),
Arrays.asList(GameUtils.getShadowPlayers(game)),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -5,7 +5,11 @@ import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddUntilStartOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -56,7 +60,7 @@ public class Card2_028 extends AbstractOldEvent {
return "Make a companion Defender +1";
}
},
Arrays.asList(GameUtils.getOpponents(game, playerId)),
Arrays.asList(GameUtils.getShadowPlayers(game)),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -5,7 +5,11 @@ import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardsFromHandOnTopOfDrawDeckEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -53,7 +57,7 @@ public class Card20_097 extends AbstractAttachableFPPossession {
return "Make a minion skirmishing an unbound companion strength -3";
}
},
GameUtils.getOpponents(game, playerId),
GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -5,7 +5,11 @@ import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -54,7 +58,7 @@ public class Card20_481 extends AbstractMinion {
public String getText(LotroGame game) {
return "Wound a companion";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getFreePeoplePlayer(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -7,7 +7,11 @@ import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RemoveBurdenEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -54,7 +58,7 @@ public class Card20_482 extends AbstractMinion {
public String getText(LotroGame game) {
return "Wound a companion";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getFreePeoplePlayer(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -6,7 +6,12 @@ import com.gempukku.lotro.cards.effects.CancelSkirmishEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -46,7 +51,7 @@ public class Card20_471 extends AbstractAttachableFPPossession {
action.appendEffect(
new PreventableEffect(action,
new CancelSkirmishEffect(self.getAttachedTo()),
GameUtils.getOpponents(game, playerId),
GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -45,7 +45,7 @@ public class Card3_011 extends AbstractOldEvent {
@Override
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayEventAction action = new PlayEventAction(self);
String[] opponents = GameUtils.getOpponents(game, playerId);
String[] opponents = GameUtils.getShadowPlayers(game);
final AtomicInteger integer = new AtomicInteger(0);
for (String opponent : opponents) {
action.appendEffect(

View File

@@ -5,7 +5,11 @@ import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseActionProxyEffect;
import com.gempukku.lotro.cards.effects.PreventAllWoundsActionProxy;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -14,8 +18,6 @@ import com.gempukku.lotro.logic.actions.SubAction;
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Arrays;
/**
* Set: The Two Towers
* Side: Free
@@ -49,7 +51,7 @@ public class Card4_097 extends AbstractOldEvent {
return "Prevent all wounds to Gandalf";
}
},
Arrays.asList(GameUtils.getOpponents(game, playerId)),
GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String shadowPlayerId) {

View File

@@ -52,7 +52,7 @@ public class Card4_112 extends AbstractAttachableFPPossession {
action.appendEffect(
new PreventableEffect(action,
new CancelSkirmishEffect(Filters.hasAttached(self)),
GameUtils.getOpponents(game, playerId),
GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -7,7 +7,12 @@ import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.modifiers.VitalityModifier;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -61,7 +66,7 @@ public class Card4_300 extends AbstractAttachable {
action.appendEffect(
new PreventableEffect(action,
new CancelSkirmishEffect(Filters.hasAttached(self)),
GameUtils.getOpponents(game, playerId),
GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -48,7 +48,7 @@ public class Card4_310 extends AbstractCompanion {
action.appendEffect(
new PreventableEffect(action,
new SelfDiscardEffect(self),
GameUtils.getOpponents(game, playerId),
GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -46,7 +46,7 @@ public class Card4_314 extends AbstractCompanion {
action.appendEffect(
new PreventableEffect(action,
new SelfDiscardEffect(self),
GameUtils.getOpponents(game, playerId),
GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -6,7 +6,11 @@ import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -47,7 +51,7 @@ public class Card5_020 extends AbstractEvent {
public String getText(LotroGame game) {
return "Discard up to 2 shadow possessions";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -48,7 +48,7 @@ public class Card5_021 extends AbstractEvent {
public String getText(LotroGame game) {
return "Discard a minion";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -6,7 +6,12 @@ import com.gempukku.lotro.cards.effects.CancelSkirmishEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -48,7 +53,7 @@ public class Card5_089 extends AbstractAttachableFPPossession {
action.appendEffect(
new PreventableEffect(action,
new CancelSkirmishEffect(self.getAttachedTo()),
GameUtils.getOpponents(game, playerId),
GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -43,7 +43,7 @@ public class Card6_096 extends AbstractEvent {
action.appendEffect(
new AddUntilEndOfTurnModifierEffect(
new MoveLimitModifier(self, 2)));
for (final String opponentId : GameUtils.getOpponents(game, playerId)) {
for (final String opponentId : GameUtils.getShadowPlayers(game)) {
action.appendEffect(
new PlayoutDecisionEffect(opponentId,
new MultipleChoiceAwaitingDecision(1, "Do you want to draw 6 cards?", new String[]{"Yes", "No"}) {

View File

@@ -6,7 +6,11 @@ import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.PutCardFromHandOnTopOfDeckEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromHandEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Signet;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -69,7 +73,7 @@ public class Card7_037 extends AbstractCompanion {
public String getText(LotroGame game) {
return "Make " + GameUtils.getFullName(card) + " strength -3";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(final SubAction subAction, final String opponentId) {

View File

@@ -4,7 +4,12 @@ import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -67,7 +72,7 @@ public class Card7_039 extends AbstractAttachableFPPossession {
private boolean hasMoreCardsThanEachOpponent(String playerId, LotroGame game) {
int cardsInHand = game.getGameState().getHand(playerId).size();
for (String opponentId : GameUtils.getOpponents(game, playerId)) {
for (String opponentId : GameUtils.getShadowPlayers(game)) {
if (game.getGameState().getHand(opponentId).size() >= cardsInHand)
return false;
}

View File

@@ -8,7 +8,11 @@ import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -85,7 +89,7 @@ public class Card7_068 extends AbstractPermanent {
public String getText(LotroGame game) {
return "Discard a minion";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -8,7 +8,13 @@ import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Names;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -69,12 +75,13 @@ public class Card7_232 extends AbstractAttachableFPPossession {
public String getText(LotroGame game) {
return "Discard a condition";
}
}, GameUtils.getOpponents(game, playerId), new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {
return new RemoveTwilightEffect(1);
}
}
}, GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {
return new RemoveTwilightEffect(1);
}
}
));
return Collections.singletonList(action);
}

View File

@@ -46,7 +46,7 @@ public class Card7_243 extends AbstractEvent {
public String getText(LotroGame game) {
return "Make " + GameUtils.getFullName(rohanMan) + " strength +4";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -8,7 +8,13 @@ import com.gempukku.lotro.cards.effects.LiberateASiteEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Names;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -66,7 +72,7 @@ public class Card7_250 extends AbstractAttachableFPPossession {
action.appendEffect(
new PreventableEffect(action,
new LiberateASiteEffect(self, playerId, null),
GameUtils.getOpponents(game, playerId),
GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -7,7 +7,12 @@ import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardFromDiscardIntoHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.cards.modifiers.MoveLimitModifier;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -56,7 +61,7 @@ public class Card7_251 extends AbstractPermanent {
action.appendEffect(
new AddUntilEndOfTurnModifierEffect(
new MoveLimitModifier(self, 1)));
for (String opponentId : GameUtils.getOpponents(game, playerId)) {
for (String opponentId : GameUtils.getShadowPlayers(game)) {
action.appendEffect(
new ChooseAndPutCardFromDiscardIntoHandEffect(action, opponentId, 0, 4, Filters.any));
}
@@ -68,7 +73,7 @@ public class Card7_251 extends AbstractPermanent {
}
private boolean canDiscardCardsEqualToOpponentsHandSize(String playerId, LotroGame game) {
for (String opponentId : GameUtils.getOpponents(game, playerId)) {
for (String opponentId : GameUtils.getShadowPlayers(game)) {
if (PlayConditions.canDiscardFromHand(game, playerId, game.getGameState().getHand(opponentId).size(), Filters.any))
return true;
}

View File

@@ -7,7 +7,11 @@ import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -71,7 +75,7 @@ public class Card9_018 extends AbstractAttachableFPPossession {
public String getText(LotroGame game) {
return "Wound a minion Merry is skirmishing";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -7,7 +7,12 @@ import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -71,7 +76,7 @@ public class Card9_021 extends AbstractAttachableFPPossession {
public String getText(LotroGame game) {
return "Wound a minion an Elf is skirmishing";
}
}, GameUtils.getOpponents(game, playerId),
}, GameUtils.getShadowPlayers(game),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {

View File

@@ -51,7 +51,7 @@ public class Card9_026 extends AbstractCompanion {
if (TriggerConditions.moves(game, effectResult)
&& PlayConditions.isPhase(game, Phase.REGROUP)) {
List<RequiredTriggerAction> actions = new LinkedList<RequiredTriggerAction>();
for (final String opponent : GameUtils.getOpponents(game, self.getOwner())) {
for (final String opponent : GameUtils.getShadowPlayers(game)) {
if (PlayConditions.canDiscardFromHand(game, opponent, 2, Filters.any)) {
final RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendCost(

View File

@@ -11,7 +11,13 @@ import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
public class GameUtils {
public static boolean isSide(GameState gameState, Side side, String playerId) {
@@ -40,6 +46,25 @@ public class GameUtils {
return blueprint.getName();
}
public static String getFirstShadowPlayer(LotroGame game) {
final String fpPlayer = game.getGameState().getCurrentPlayerId();
final PlayOrder counterClockwisePlayOrder = game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(fpPlayer, false);
// Skip FP player
counterClockwisePlayOrder.getNextPlayer();
return counterClockwisePlayOrder.getNextPlayer();
}
public static String[] getShadowPlayers(LotroGame game) {
final String fpPlayer = game.getGameState().getCurrentPlayerId();
List<String> shadowPlayers = new LinkedList<String>(game.getGameState().getPlayerOrder().getAllPlayers());
shadowPlayers.remove(fpPlayer);
return shadowPlayers.toArray(new String[shadowPlayers.size()]);
}
public static String getFreePeoplePlayer(LotroGame game) {
return game.getGameState().getCurrentPlayerId();
}
public static String[] getOpponents(LotroGame game, String playerId) {
List<String> shadowPlayers = new LinkedList<String>(game.getGameState().getPlayerOrder().getAllPlayers());
shadowPlayers.remove(playerId);

View File

@@ -38,7 +38,7 @@ public class WinConditionRule {
}
} else if (game.getFormat().winOnControlling5Sites()
&& effectResults.getType() == EffectResult.Type.TAKE_CONTROL_OF_SITE) {
for (String opponent : GameUtils.getOpponents(game, game.getGameState().getCurrentPlayerId())) {
for (String opponent : GameUtils.getShadowPlayers(game)) {
if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(), CardType.SITE, Filters.siteControlled(opponent)) >= 5)
game.playerWon(opponent, "Controls 5 sites");
}