diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/Card1_001.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/Card1_001.java index f2e32e5ff..71a96df32 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/Card1_001.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/Card1_001.java @@ -1,6 +1,6 @@ package com.gempukku.lotro.cards.set1; -import com.gempukku.lotro.cards.AbstractLotroCardBlueprint; +import com.gempukku.lotro.cards.AbstractAttachable; import com.gempukku.lotro.cards.effects.*; import com.gempukku.lotro.cards.modifiers.StrengthModifier; import com.gempukku.lotro.cards.modifiers.VitalityModifier; @@ -8,6 +8,7 @@ import com.gempukku.lotro.common.CardType; import com.gempukku.lotro.common.Keyword; import com.gempukku.lotro.common.Phase; import com.gempukku.lotro.common.Side; +import com.gempukku.lotro.filters.Filter; import com.gempukku.lotro.filters.Filters; import com.gempukku.lotro.game.AbstractActionProxy; import com.gempukku.lotro.game.PhysicalCard; @@ -34,19 +35,14 @@ import java.util.List; * Game Text: Response: If bearer is about to take a wound, he wears The One Ring until the regroup phase. While wearing * The One Ring, each time the Ring-bearer is about to take a wound, add 2 burdens instead. */ -public class Card1_001 extends AbstractLotroCardBlueprint { +public class Card1_001 extends AbstractAttachable { public Card1_001() { - super(Side.RING, CardType.THE_ONE_RING, null, "The One Ring", true); + super(Side.RING, CardType.THE_ONE_RING, 0, null, null, "The One Ring", true); } @Override - public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { - return false; - } - - @Override - public Action getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { - return null; + protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { + return Filters.none(); } @Override @@ -109,9 +105,4 @@ public class Card1_001 extends AbstractLotroCardBlueprint { return null; } } - - @Override - public int getTwilightCost() { - throw new UnsupportedOperationException("This method should not be called on this card"); - } } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/Card1_002.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/Card1_002.java index 982b46c5f..05cc1d895 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/Card1_002.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/Card1_002.java @@ -1,12 +1,13 @@ package com.gempukku.lotro.cards.set1; -import com.gempukku.lotro.cards.AbstractLotroCardBlueprint; +import com.gempukku.lotro.cards.AbstractAttachable; import com.gempukku.lotro.cards.effects.*; import com.gempukku.lotro.cards.modifiers.StrengthModifier; import com.gempukku.lotro.common.CardType; import com.gempukku.lotro.common.Keyword; import com.gempukku.lotro.common.Phase; import com.gempukku.lotro.common.Side; +import com.gempukku.lotro.filters.Filter; import com.gempukku.lotro.filters.Filters; import com.gempukku.lotro.game.AbstractActionProxy; import com.gempukku.lotro.game.PhysicalCard; @@ -33,19 +34,14 @@ import java.util.List; * While wearing The One Ring, each time the Ring-bearer is about to take a wound during a skirmish, add a burden * instead. */ -public class Card1_002 extends AbstractLotroCardBlueprint { +public class Card1_002 extends AbstractAttachable { public Card1_002() { - super(Side.RING, CardType.THE_ONE_RING, null, "The One Ring", true); + super(Side.RING, CardType.THE_ONE_RING, 0, null, null, "The One Ring", true); } @Override - public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { - return false; - } - - @Override - public Action getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { - return null; + protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { + return Filters.none(); } @Override @@ -106,9 +102,4 @@ public class Card1_002 extends AbstractLotroCardBlueprint { return null; } } - - @Override - public int getTwilightCost() { - throw new UnsupportedOperationException("This method should not be called on this card"); - } } diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java index 0578e9d10..518cde918 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java @@ -308,6 +308,20 @@ public class GameState { return false; } + public boolean iterateActiveCards(String player, PhysicalCardVisitor physicalCardVisitor) { + for (int i = 1; i <= 9; i++) { + PhysicalCard site = getSite(i); + if (site != null) + physicalCardVisitor.visitPhysicalCard(site); + } + for (PhysicalCardImpl physicalCard : _inPlay.get(player)) { + if (isCardInPlayActive(physicalCard)) + if (physicalCardVisitor.visitPhysicalCard(physicalCard)) + return true; + } + return false; + } + private boolean iterateCards(List cards, PhysicalCardVisitor physicalCardVisitor) { for (PhysicalCard card : cards) if (physicalCardVisitor.visitPhysicalCard(card)) diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/actions/DefaultActionsEnvironment.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/actions/DefaultActionsEnvironment.java index bb816f3ca..7185db2b5 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/actions/DefaultActionsEnvironment.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/actions/DefaultActionsEnvironment.java @@ -93,7 +93,7 @@ public class DefaultActionsEnvironment implements ActionsEnvironment { for (String playerId : players) { GatherOptionalBeforeTriggers gatherActions = new GatherOptionalBeforeTriggers(playerId, effect, effectResult); - _lotroGame.getGameState().iterateActivableCards(playerId, gatherActions); + _lotroGame.getGameState().iterateActiveCards(playerId, gatherActions); List gatheredActions = gatherActions.getActions(); @@ -135,7 +135,7 @@ public class DefaultActionsEnvironment implements ActionsEnvironment { for (String playerId : players) { GatherOptionalAfterTriggers gatherActions = new GatherOptionalAfterTriggers(playerId, effectResult); - _lotroGame.getGameState().iterateActivableCards(playerId, gatherActions); + _lotroGame.getGameState().iterateActiveCards(playerId, gatherActions); List gatheredActions = gatherActions.getActions(); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/RoamingRule.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/RoamingRule.java index 78906a654..ed94f3229 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/RoamingRule.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/timing/rules/RoamingRule.java @@ -44,7 +44,7 @@ public class RoamingRule { @Override public int getTwilightCost(GameState gameState, ModifiersQuerying modifiersLogic, PhysicalCard physicalCard, int result) { - return result + Math.min(0, modifiersLogic.getRoamingPenalty(gameState, physicalCard)); + return result + Math.max(0, modifiersLogic.getRoamingPenalty(gameState, physicalCard)); } }); } diff --git a/gemp-lotr/todo.txt b/gemp-lotr/todo.txt index 0d0e63284..68fff1888 100644 --- a/gemp-lotr/todo.txt +++ b/gemp-lotr/todo.txt @@ -1,9 +1,20 @@ -1. Introduce AbstractPermanent into Blueprint hierarchy. -2. Migrate Race (Orc, Elf, etc) into separate enum from Keyword. +TO DO: 3. Refactor Effect to return EffectResult upon playEffect, which will contain information about what actually happened. Modify the Blueprints to have the "before" methods to take Effect parameter only and the "after" to take the EffectResult parameter only. Effects which modify cards should take filters as parameters, use overloaded constructor for single cards for backward compatibility, this constructor will call another constructor with Filters.sameCard(...) filter. 4. Modify the Blueprint hierarchy to return possible return objects (PlayEventAction), TriggeredAction, etc. Use -final methods were possible to avoid implementation errors on new cards added. \ No newline at end of file +final methods were possible to avoid implementation errors on new cards added. +5. Introduce move card operation in communication between the server and client to change the zone/params of the card. +6. Change how the assignments and skirmish are displayed in the user interface, to avoid using Dialogs. +7. Add chat. +8. Add checkbox option to auto-accept choices on the client, also allow to cancel selection to reset to none-selected +and go with different selection. +9. Add checkbox option to auto-pass if there is no actions to be played. +10. Add active/all cards switch to the user interface. +11. Merge Shadow and FP support area on the UI and extend the Shadow and FP characters window. + +DONE: +1. Introduce AbstractPermanent into Blueprint hierarchy. +2. Migrate Race (Orc, Elf, etc) into separate enum from Keyword.