public async Task CardTrack(int revealedSpaces, int expectedCardPlayCount)
 {
     var fixture = new ConfigurableTestFixture {
         Spirit = new LightningsSwiftStrike()
     };
     await fixture.VerifyCardTrack(revealedSpaces, expectedCardPlayCount, "");
 }
Exemple #2
0
    public async Task Repeat_BadlandsWorksOnBothTargets()
    {
        var fix    = new ConfigurableTestFixture();
        var space1 = fix.Board[3];
        var space2 = fix.Board[8];

        // Given: 2 sun, 3 fire, 3 earth
        fix.InitElements("2 sun,3 fire,3 earth");

        //  And: target land #1 has 1 presence, 3 explorers and 1 town
        fix.InitPresence(space1, 1);
        fix.InitTokens(space1, "3E@1,1T@2");

        //  And: target land #2 has the same (1 presence, 3 explorers and 1 town)
        fix.InitPresence(space2, 1);
        fix.InitTokens(space2, "3E@1,1T@2");

        // When: play card
        var task = PowerCard.For <ForestsOfLivingObsidian>().ActivateAsync(fix.SelfCtx);

        //  And: targeting space 1
        fix.Choose(space1);
        fix.Choose("T@1");         // Damage (1 remaining)

        //  And: targeting space 2
        fix.Choose(space2);
        fix.Choose("T@1");           // Damage (1 remaining)

        task.IsCompletedSuccessfully.ShouldBeTrue();
    }
Exemple #3
0
 public async Task CardTrack(int revealedSpaces, int expectedCardPlayCount, string elements)
 {
     var fixture = new ConfigurableTestFixture {
         Spirit = new Bringer()
     };
     await fixture.VerifyCardTrack(revealedSpaces, expectedCardPlayCount, elements);
 }
    public void Level2_2DamagePush3TownOrExplorers()       // 2-Sun, 3-Water
    {
        var fixture     = new ConfigurableTestFixture();
        var space       = fixture.Board[5];
        var tokens      = fixture.GameState.Tokens[space];
        var destination = space.Adjacent.Last();

        // Given: spirit has a sacred site adjacent to the target space (range-1)
        fixture.Spirit.Presence.Adjust(space.Adjacent.First(), 2);
        //   And: Spirit has enough elements to trigger Level-2 of Massive Flooding
        fixture.InitElements("3 water,2 sun");
        //   And: target has 1 city, 4 towns, 5 explorers - !!! collapse this to 1 line
        fixture.InitTokens(space, "1C@3,4T@2,5E@1");

        //  When: activate innate
        _ = InnatePower.For <MassiveFlooding>().ActivateAsync(fixture.SelfCtx);
        fixture.Choose(space);                            // target space
        fixture.Choose(Tokens.Town);                      // 1st damage
        fixture.Choose(Tokens.Town1);                     // 2nd damage

        fixture.ChoosePush(Tokens.Town, destination);     // push 1
        fixture.ChoosePush(Tokens.Town, destination);     // push 2
        fixture.ChoosePush(Tokens.Explorer, destination); // push 3

        // Then: target has remaining invaders
        tokens.Summary.ShouldBe("1C@3,4E@1,1T@2");

        //  And: destination had pushed invaders
        fixture.GameState.Tokens[destination].Summary.ShouldBe("1E@1,2T@2");
    }
Exemple #5
0
    public void ReturningKeeperPresence_PushesDahan()
    {
        var fix = new ConfigurableTestFixture {
            Spirit = new Keeper()
        };
        var space            = fix.Board[5];
        var dahanDestination = space.Adjacent.First();

        // Given: Keeper has a destroyed presence
        fix.Spirit.Presence.Destroyed = 1;

        //   And: a presence on target space.
        fix.Spirit.Presence.Adjust(space, 1);

        //   And: Dahan on space
        fix.InitTokens(space, "1D@2");

        //  When: play the card
        var task = PowerCard.For <SkiesHeraldTheSeasonOfReturn>().ActivateAsync(fix.SelfCtx);

        // target space
        fix.Choose(space);

        // Then: Should Push Dahan (per keeper's Sacred Site)
        fix.Choose("D@2");
        fix.Choose(dahanDestination);
        //  And: May Gather up to 2 dahan (per the card)
        fix.Choose("D@2 on " + dahanDestination.Text);         // "Gather up to 2 Dahan"
        //  And: May push 1 blight
        // no blight to push

        task.IsCompletedSuccessfully.ShouldBeTrue();
    }
    public void Level1_Pushes1TownOrExplorer()       // 1-Sun, 2-Water
    {
        var fixture     = new ConfigurableTestFixture();
        var space       = fixture.Board[5];
        var tokens      = fixture.GameState.Tokens[space];
        var destination = space.Adjacent.Last();

        // Given: spirit has a sacred site adjacent to the target space (range-1)
        fixture.Spirit.Presence.Adjust(space.Adjacent.First(), 2);
        //   And: Spirit has enough elements to trigger Level-1 of Massive Flooding
        fixture.InitElements("1 sun,2 water");
        //   And: target has 1 city, 4 towns, 5 explorers
        fixture.InitTokens(space, "1C@3,5E@1,4T@2");

        //  When: activate innate
        _ = InnatePower.For <MassiveFlooding>().ActivateAsync(fixture.SelfCtx);
        fixture.Choose(space);                        // target space

        fixture.ChoosePush(Tokens.Town, destination); // push 1

        // Then: target has remaining invaders
        tokens.Summary.ShouldBe("1C@3,5E@1,3T@2");

        //  And: destination had pushed invaders
        fixture.GameState.Tokens[destination].Summary.ShouldBe("1T@2");
    }
 public async Task EnergyTrack(int revealedSpaces, int expectedEnergyGrowth)
 {
     var fixture = new ConfigurableTestFixture {
         Spirit = new LightningsSwiftStrike()
     };
     await fixture.VerifyEnergyTrack(revealedSpaces, expectedEnergyGrowth, "");
 }
    public async Task CardTrack(int revealedSpaces, int expectedCardPlayCount, int reclaimCount)
    {
        var fix = new ConfigurableTestFixture {
            Spirit = new SharpFangs()
        };
        await fix.VerifyCardTrack(revealedSpaces, expectedCardPlayCount, "");

        fix.VerifyReclaim1Count(reclaimCount);

        //// cards:	2 2 3 reclaim-1 4 5&reclaim-1
        //spirit.Presence.CardPlays.SetRevealedCount( revealedSpaces );
        //Assert_PresenceTracksAre( 1, expectedCardPlayCount );
        //Given_HalfOfPowercardsPlayed();

        //// Test the reclaim bit
        //Given_HasPresence( board[3] ); // added extra presence, need to

        //gameState.Phase = Phase.Growth;
        //When_SharpFangsGrow();

        //User_GrowthC_DrawCard_GainEnergy();
        //User_GrowthD_GainEnergy();

        //while(reclaimCount-- > 0)
        //	User.Reclaims1CardIfAny();
    }
Exemple #9
0
 public async Task CardTrack(int revealedSpaces, int expectedCardPlayCount)
 {
     var fixture = new ConfigurableTestFixture {
         Spirit = new ASpreadOfRampantGreen()
     };
     await fixture.VerifyCardTrack(revealedSpaces, expectedCardPlayCount, "");
 }
Exemple #10
0
 public async Task EnergyTrack(int revealedSpaces, int expectedEnergyGrowth)
 {
     var fix = new ConfigurableTestFixture {
         Spirit = new RiverSurges()
     };
     await fix.VerifyEnergyTrack(revealedSpaces, expectedEnergyGrowth, "");
 }
 public async Task EnergyTrack(int revealedSpaces, int expectedEnergyGrowth, string elements)
 {
     var fix = new ConfigurableTestFixture {
         Spirit = new SharpFangs()
     };
     await fix.VerifyEnergyTrack(revealedSpaces, expectedEnergyGrowth, elements);
 }
Exemple #12
0
 public async Task EnergyTrack(int revealedSpaces, int expectedEnergyGrowth, string elements)
 {
     var fixture = new ConfigurableTestFixture {
         Spirit = new ASpreadOfRampantGreen()
     };
     await fixture.VerifyEnergyTrack(revealedSpaces, expectedEnergyGrowth, elements);
 }
Exemple #13
0
    public async Task Repeat_BadlandsWorksOnSameTargetTwice()
    {
        var fix    = new ConfigurableTestFixture();
        var space1 = fix.Board[3];

        // Given: 2 sun, 3 fire, 3 earth
        fix.InitElements("2 sun,3 fire,3 earth");

        //  And: target land has 1 presence, 2 Cities
        fix.Spirit.Presence.Adjust(space1, 1);
        fix.InitTokens(space1, "3C@3");

        // When: play card
        var task = PowerCard.For <ForestsOfLivingObsidian>().ActivateAsync(fix.SelfCtx);

        //  And: targeting space 1
        fix.Choose(space1);
        fix.Choose("C@2");           // 3C@2 - Damage 1 of them (1 of 1)
        fix.GameState.Tokens[space1].Summary.ShouldBe("1C@1,2C@2,1M");

        //  And: targeting space 1 a 2nd time
        fix.Choose(space1);          // Should Kill the 1C@1, and reduce the 2C@2 to 2C@1
        fix.Choose("C@1");           // Kill 1st City
        fix.Choose("C@1");           // Kill 2nd City
        fix.GameState.Tokens[space1].Summary.ShouldBe("2M");

        task.IsCompletedSuccessfully.ShouldBeTrue();
    }
        public Task CardTrack(int revealedSpaces, int expectedCardPlayCount)
        {
            var fix = new ConfigurableTestFixture {
                Spirit = new VitalStrength()
            };

            return(fix.VerifyCardTrack(revealedSpaces, expectedCardPlayCount, ""));
        }
        public Task EnergyTrack(int revealedSpaces, int expectedEnergyGrowth)
        {
            var fix = new ConfigurableTestFixture {
                Spirit = new VitalStrength()
            };

            return(fix.VerifyEnergyTrack(revealedSpaces, expectedEnergyGrowth, ""));
        }
Exemple #16
0
        public Task EnergyTrack(int revealedSpaces, int expectedEnergyGrowth, string elements)
        {
            var fix = new ConfigurableTestFixture {
                Spirit = new Thunderspeaker()
            };

            return(fix.VerifyEnergyTrack(revealedSpaces, expectedEnergyGrowth, elements));
        }
Exemple #17
0
        public async Task CardTrack(int revealedSpaces, int expectedCardPlayCount, bool canReclaim1)
        {
            var fix = new ConfigurableTestFixture {
                Spirit = new RiverSurges()
            };
            await fix.VerifyCardTrack(revealedSpaces, expectedCardPlayCount, "");

            fix.VerifyReclaim1Count(canReclaim1? 1 : 0);
        }
Exemple #18
0
        public async Task CardTrack(int revealedSpaces, int expectedCardPlayCount, int reclaimCount)
        {
            var fix = new ConfigurableTestFixture {
                Spirit = new Thunderspeaker()
            };
            await fix.VerifyCardTrack(revealedSpaces, expectedCardPlayCount, "");

            fix.VerifyReclaim1Count(reclaimCount);
        }
    public void InsufficientElements()
    {
        var fixture     = new ConfigurableTestFixture();
        var innatePower = InnatePower.For <MassiveFlooding>();

        // Given: spirit does not have enough elements to trigger anything
        //   And: should not be activatable
        innatePower.CouldActivateDuring(Phase.Slow, fixture.Spirit).ShouldBeFalse();

        //  When: but if we try anyway
        var task = innatePower.ActivateAsync(fixture.SelfCtx);

        //  Then: it is complete and nothing happens.
        task.IsCompleted.ShouldBeTrue();
    }
    public void RemovesBlight()
    {
        var setup  = new ConfigurableTestFixture();
        var space  = setup.Board[3];
        var tokens = setup.GameState.Tokens[space];

        // Given: 1 blight on board where presence is
        setup.Spirit.Presence.Adjust(space, 2);
        tokens.Init(TokenType.Blight, 1);
        tokens.Blight.Count.ShouldBe(1);

        //  When: Card played
        _ = GrowthThroughSacrifice.ActAsync(setup.TargetSelf);
        setup.Choose(space);           // select presence to destroy
        setup.Choose(space);           // select location to add presence / remove blight
        setup.Choose("blight");

        //  Then: Spirit gains element
        tokens.Blight.Count.ShouldBe(0);
    }
    public void Level3_2DamageToEachInvader()       // 3 sun, 4 water, 1 earth
    {
        var fixture = new ConfigurableTestFixture();
        var space   = fixture.Board[5];
        var tokens  = fixture.GameState.Tokens[space];

        // Given: spirit has a sacred site adjacent to the target space (range-1)
        fixture.Spirit.Presence.Adjust(space.Adjacent.First(), 2);
        //   And: Spirit has enough elements to trigger Level-3 of Massive Flooding
        fixture.InitElements("3 sun,4 water,1 earth");
        //   And: target has 1 city, 4 towns, 5 explorers - !!! collapse this to 1 line
        fixture.InitTokens(space, "1C@3,4T@2,5E@1");

        //  When: activate innate
        _ = InnatePower.For <MassiveFlooding>().ActivateAsync(fixture.SelfCtx);
        fixture.Choose(space);           // target space

        // Then: target has remaining invaders
        tokens.Summary.ShouldBe("1C@1");
    }
    public void RevealedTokens_GainElements()
    {
        var fixture      = new ConfigurableTestFixture();
        var elementTrack = Track.AirEnergy;
        var space        = fixture.Board[3];

        // Given: Spirit's next cardplay has an element on it
        fixture.CardPlayTrack = new PresenceTrack(Track.Card1, elementTrack);
        //   And: has no air elements
        fixture.Spirit.Elements[elementTrack.Elements[0]].ShouldBe(0);
        //   And: 2 presence on board
        fixture.Spirit.Presence.Adjust(space, 2);

        //  When: Card played
        _ = GrowthThroughSacrifice.ActAsync(fixture.TargetSelf);
        fixture.Choose(space);           // select presence to destroy
        fixture.Choose(space);           // select location to add presence / remove blight
        fixture.Choose("add 1 presence");
        fixture.Choose(elementTrack);    // take presence from cardplay track

        //  Then: Spirit gains element
        fixture.Spirit.Elements[elementTrack.Elements[0]].ShouldBe(1);
    }