Fixing couple of bugs
This commit is contained in:
@@ -232,6 +232,10 @@
|
||||
"type": "startOfPhase",
|
||||
"phase": "fellowship"
|
||||
},
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "self,attachedTo(any)"
|
||||
},
|
||||
"effect": [
|
||||
{
|
||||
"type": "wound",
|
||||
|
||||
@@ -79,6 +79,10 @@
|
||||
"type": "startOfPhase",
|
||||
"phase": "fellowship"
|
||||
},
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "self,attachedTo(any)"
|
||||
},
|
||||
"effect": [
|
||||
{
|
||||
"type": "wound",
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ExtraPossessionClassEffectProcessor implements EffectProcessor {
|
||||
(game, self, attachedTo) -> {
|
||||
DefaultActionContext actionContext = new DefaultActionContext(self.getOwner(), game, self, null, null);
|
||||
final Filterable attachedFilterable = attachedFilterableSource.getFilterable(actionContext);
|
||||
return Filters.and(attachedFilterable).accepts(game, self);
|
||||
return Filters.and(attachedFilterable).accepts(game, attachedTo);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class RemoveTokens implements EffectAppenderProducer {
|
||||
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter", "self");
|
||||
final String memory = FieldUtils.getString(effectObject.get("memorize"), "memorize", "_temp");
|
||||
|
||||
final Token token = Token.findTokenForCulture(culture);
|
||||
final Token token = (culture != null) ? Token.findTokenForCulture(culture) : null;
|
||||
|
||||
MultiEffectAppender result = new MultiEffectAppender();
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.gempukku.lotro.at;
|
||||
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class AttachAtTest extends AbstractAtTest {
|
||||
@Test
|
||||
public void extraPossessionClassAttachedTo() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCardImpl aragorn = createCard(P1, "1_89");
|
||||
PhysicalCardImpl rangersSword = createCard(P1, "1_112");
|
||||
PhysicalCardImpl knifeOfTheGaladhrim = createCard(P1, "9_17");
|
||||
|
||||
_game.getGameState().addCardToZone(_game, aragorn, Zone.FREE_CHARACTERS);
|
||||
_game.getGameState().attachCard(_game, rangersSword, aragorn);
|
||||
_game.getGameState().addCardToZone(_game, knifeOfTheGaladhrim, Zone.HAND);
|
||||
|
||||
skipMulligans();
|
||||
|
||||
playerDecided(P1, getCardActionId(P1, "Play Knife"));
|
||||
assertEquals(Zone.ATTACHED, knifeOfTheGaladhrim.getZone());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.gempukku.lotro.at;
|
||||
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
public class CultureTokenAtTest extends AbstractAtTest {
|
||||
@Test
|
||||
public void removeCultureTokenWithoutOne() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCardImpl sauronsMight = createCard(P2, "19_27");
|
||||
|
||||
_game.getGameState().addCardToZone(_game, sauronsMight, Zone.HAND);
|
||||
|
||||
skipMulligans();
|
||||
|
||||
playerDecided(P1, "");
|
||||
assertNull(getCardActionId(P2, "Play Sauron's Might"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user