diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set21/set1-errata.json b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set21/set1-errata.json index b25316080..5572c4fa1 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set21/set1-errata.json +++ b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set21/set1-errata.json @@ -536,4 +536,74 @@ ] }, + + "21_20121": + { + "title": "*Gimli", + "subtitle": "Dwarf of the Mountain-race", + "culture": "dwarven", + "cost": 2, + "type": "companion", + "race": "dwarf", + "strength": 6, + "vitality": 3, + "resistance": 6, + "signet": "frodo", + "keyword": "damage+1", + "effects": [ + { + "type": "modifier", + + "modifier": { + "type": "addKeyword", + "filter": "self", + "keyword": "concealed", + "condition": { + "type": "location", + "filter": "underground" + } + }, + }, + { + "type": "trigger", + "optional": true, + "trigger": { + "type": "movesTo", + "filter": "underground", + + }, + "cost": { + "type": "exert", + "filter": "self" + }, + "effect": { + "type": "addKeyword", + "filter": "choose(another,companion)", + "keyword": "concealed", + "until": "start(regroup)" + } + }, + { + "type": "trigger", + "optional": true, + "trigger": { + "type": "movesFrom", + "filter": "underground", + + }, + "cost": { + "type": "exert", + "filter": "self" + }, + "effect": { + "type": "addKeyword", + "filter": "choose(another,companion)", + "keyword": "concealed", + "until": "start(regroup)" + } + } + ] + }, + + } \ No newline at end of file diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/set21.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/set21.js index d97a5b151..38ca1db74 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/set21.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/set21.js @@ -61,4 +61,5 @@ var set21 = { '21_2075': 'https://i.lotrtcgpc.net/errata/FOTR/22_75.jpg', '21_3042': 'https://i.lotrtcgpc.net/errata/FOTR/23_42.jpg', '21_3068': 'https://i.lotrtcgpc.net/errata/FOTR/23_68.jpg', + '21_20121': 'https://i.lotrtcgpc.net/errata/FOTR/22_121.jpg' } \ No newline at end of file diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTest.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTest.java index 345ddd853..eadbce5d6 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTest.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/GenericCardTest.java @@ -259,10 +259,9 @@ public class GenericCardTest extends AbstractAtTest { public int GetTwilight() { return _game.getGameState().getTwilightPool(); } public void SetTwilight(int amount) { _game.getGameState().setTwilight(amount); } - public PhysicalCardImpl GetRingBearer() - { - return (PhysicalCardImpl)_game.getGameState().getRingBearer(P1); - } + public PhysicalCardImpl GetRingBearer() { return (PhysicalCardImpl)_game.getGameState().getRingBearer(P1); } + + public PhysicalCardImpl GetCurrentSite() { return (PhysicalCardImpl)_game.getGameState().getCurrentSite(); } public void SkipToPhase(Phase target) throws DecisionResultInvalidException { for(int attempts = 1; attempts <= 20; attempts++) @@ -360,12 +359,10 @@ public class GenericCardTest extends AbstractAtTest { _game.getModifiersEnvironment().addUntilEndOfTurnModifier(mod); } - public void FreepsChooseToMove() throws DecisionResultInvalidException { - playerDecided(P1, "0"); - } + public void FreepsChooseToMove() throws DecisionResultInvalidException { playerDecided(P1, "0"); } + public void FreepsChooseToStay() throws DecisionResultInvalidException { playerDecided(P1, "1"); } - public void FreepsChooseToStay() throws DecisionResultInvalidException { - playerDecided(P1, "1"); - } + public void FreepsActivateOptionalTrigger() throws DecisionResultInvalidException { playerDecided(P1, "0"); } + public void ShadowActivateOptionalTrigger() throws DecisionResultInvalidException { playerDecided(P2, "0"); } } diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/Gimli_DotMrErrataTest.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/Gimli_DotMrErrataTest.java new file mode 100644 index 000000000..dec6d8bbd --- /dev/null +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/cards/unofficial/pc/errata/Gimli_DotMrErrataTest.java @@ -0,0 +1,94 @@ +package com.gempukku.lotro.cards.unofficial.pc.errata; + +import com.gempukku.lotro.cards.GenericCardTest; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.common.Phase; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.CardNotFoundException; +import com.gempukku.lotro.game.PhysicalCardImpl; +import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; +import com.gempukku.lotro.logic.modifiers.KeywordModifier; +import org.junit.Test; + +import java.util.HashMap; + +import static junit.framework.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class Gimli_DotMrErrataTest +{ + protected GenericCardTest GetScenario() throws CardNotFoundException, DecisionResultInvalidException { + return new GenericCardTest( + new HashMap() + {{ + put("gimli", "21_20121"); + }} + ); + } + + @Test + public void GimliHasDamage() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTest scn = GetScenario(); + + PhysicalCardImpl gimli = scn.GetFreepsCard("gimli"); + + assertTrue(scn.HasKeyword(gimli, Keyword.DAMAGE)); + } + + + @Test + public void GimliHasConcealedOnlyWhileUnderground() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTest scn = GetScenario(); + + PhysicalCardImpl gimli = scn.GetFreepsCard("gimli"); + scn.FreepsMoveCharToTable(gimli); + + scn.StartGame(); + + assertFalse(scn.HasKeyword(gimli, Keyword.CONCEALED)); + + scn.InsertAdHocModifier(new KeywordModifier(null, Filters.siteNumber(2), Keyword.UNDERGROUND)); + + scn.FreepsSkipCurrentPhaseAction(); + + assertTrue(scn.HasKeyword(gimli, Keyword.CONCEALED)); + } + + @Test + public void GimliAbilityTriggersMovingFromAndTo() throws DecisionResultInvalidException, CardNotFoundException { + //Pre-game setup + GenericCardTest scn = GetScenario(); + + PhysicalCardImpl frodo = scn.GetRingBearer(); + PhysicalCardImpl gimli = scn.GetFreepsCard("gimli"); + + scn.FreepsMoveCharToTable(gimli); + + scn.StartGame(); + + scn.InsertAdHocModifier(new KeywordModifier(null, Filters.siteNumber(2), Keyword.UNDERGROUND)); + + scn.FreepsSkipCurrentPhaseAction(); + + assertTrue(scn.FreepsActionAvailable("Optional")); + scn.FreepsActivateOptionalTrigger(); + assertEquals(1, scn.GetWoundsOn(gimli)); + assertTrue(scn.HasKeyword(frodo, Keyword.CONCEALED)); + + scn.SkipToPhase(Phase.REGROUP); + scn.SkipCurrentPhaseActions(); + scn.ShadowSkipCurrentPhaseAction(); + assertFalse(scn.HasKeyword(frodo, Keyword.CONCEALED)); + scn.FreepsChooseToMove(); + + assertTrue(scn.FreepsActionAvailable("Optional")); + scn.FreepsActivateOptionalTrigger(); + assertEquals(2, scn.GetWoundsOn(gimli)); + assertTrue(scn.HasKeyword(frodo, Keyword.CONCEALED)); + } + +}