Fixes to errors reported in-game
This commit is contained in:
@@ -384,7 +384,7 @@
|
||||
},
|
||||
"effect": {
|
||||
"type": "heal",
|
||||
"filter": "choose(not(self),hobbit,ally,site(fellowship,1))"
|
||||
"filter": "choose(not(self),hobbit,ally,allySite(fellowship,1))"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -413,7 +413,7 @@
|
||||
"subtitle": "Friend to Frodo",
|
||||
"unique": true,
|
||||
"side": "free people",
|
||||
"cost": 0,
|
||||
"cost": 1,
|
||||
"type": "companion",
|
||||
"race": "hobbit",
|
||||
"strength": 3,
|
||||
|
||||
@@ -86,12 +86,12 @@ public class FilterFactory {
|
||||
final FilterableSource filterableSource = filterFactory.generateFilter(parameter);
|
||||
return (playerId, game, source, effectResult, effect) -> Filters.not(filterableSource.getFilterable(playerId, game, source, effectResult, effect));
|
||||
});
|
||||
parameterFilters.put("site",
|
||||
(parameter, filterFactory) -> (playerId, game, source, effectResult, effect) -> {
|
||||
parameterFilters.put("allySite",
|
||||
(parameter, filterFactory) -> {
|
||||
final String[] parameterSplit = parameter.split(",");
|
||||
final SitesBlock sitesBlock = Enum.valueOf(SitesBlock.class, parameterSplit[0].toUpperCase().replace('_', ' '));
|
||||
int number = Integer.parseInt(parameterSplit[1]);
|
||||
return Filters.and(Filters.siteBlock(sitesBlock), Filters.siteNumber(number));
|
||||
return (playerId, game, source, effectResult, effect) -> Filters.isAllyHome(number, sitesBlock);
|
||||
});
|
||||
parameterFilters.put("siteBlock",
|
||||
(parameter, filterFactory) -> {
|
||||
|
||||
@@ -133,7 +133,7 @@ public abstract class AbstractAtTest {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void addPlayerDeck(String player, Map<String, LotroDeck> decks, Map<String, Collection<String>> additionalCardsInDeck) {
|
||||
protected void addPlayerDeck(String player, Map<String, LotroDeck> decks, Map<String, Collection<String>> additionalCardsInDeck) {
|
||||
LotroDeck deck = createSimplestDeck();
|
||||
if (additionalCardsInDeck != null) {
|
||||
Collection<String> extraCards = additionalCardsInDeck.get(player);
|
||||
|
||||
@@ -12,10 +12,7 @@ import com.gempukku.lotro.logic.timing.DefaultLotroGame;
|
||||
import com.gempukku.lotro.logic.vo.LotroDeck;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
@@ -1169,4 +1166,58 @@ public class IndividualCardAtTest extends AbstractAtTest {
|
||||
|
||||
assertEquals(AwaitingDecisionType.MULTIPLE_CHOICE, _userFeedback.getAwaitingDecision(P1).getDecisionType());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hobbitPartyGuest() throws CardNotFoundException, DecisionResultInvalidException {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCardImpl hobbitPartyGuest = new PhysicalCardImpl(100, "1_297", P1, _library.getLotroCardBlueprint("1_297"));
|
||||
PhysicalCardImpl rosie = new PhysicalCardImpl(100, "1_309", P1, _library.getLotroCardBlueprint("1_309"));
|
||||
|
||||
_game.getGameState().addCardToZone(_game, hobbitPartyGuest, Zone.SUPPORT);
|
||||
_game.getGameState().addCardToZone(_game, rosie, Zone.SUPPORT);
|
||||
_game.getGameState().addTokens(rosie, Token.WOUND, 1);
|
||||
|
||||
skipMulligans();
|
||||
|
||||
playerDecided(P1, "0");
|
||||
assertEquals(0, _game.getGameState().getTokenCount(rosie, Token.WOUND));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void playStartingFellowship() throws CardNotFoundException, DecisionResultInvalidException {
|
||||
|
||||
Map<String, Collection<String>> additionalCardsInDeck = new HashMap<>();
|
||||
List<String> additionalCards = new LinkedList<>();
|
||||
additionalCards.add("2_121");
|
||||
additionalCards.add("3_121");
|
||||
additionalCards.add("1_306");
|
||||
additionalCardsInDeck.put(P1, additionalCards);
|
||||
|
||||
Map<String, LotroDeck> decks = new HashMap<String, LotroDeck>();
|
||||
addPlayerDeck(P1, decks, additionalCardsInDeck);
|
||||
addPlayerDeck(P2, decks, additionalCardsInDeck);
|
||||
|
||||
_userFeedback = new DefaultUserFeedback();
|
||||
|
||||
LotroFormatLibrary formatLibrary = new LotroFormatLibrary(new DefaultAdventureLibrary(), _library);
|
||||
LotroFormat format = formatLibrary.getFormat("movie");
|
||||
|
||||
_game = new DefaultLotroGame(format, decks, _userFeedback, _library);
|
||||
_userFeedback.setGame(_game);
|
||||
_game.startGame();
|
||||
|
||||
// Bidding
|
||||
playerDecided(P1, "1");
|
||||
playerDecided(P2, "0");
|
||||
|
||||
// Seating choice
|
||||
playerDecided(P1, "0");
|
||||
|
||||
// Play starting fellowship
|
||||
playerDecided(P1, "temp0");
|
||||
playerDecided(P1, "temp0");
|
||||
|
||||
assertNull(_userFeedback.getAwaitingDecision(P1));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user