public void NoDahan_NoDefend() { var fxt = new GameFixture() .WithSpirit(new StonesUnyieldingDefiance()) .Start(); // Given: a space to ravage on. var space = fxt.board[5]; var tokens = fxt.gameState.Tokens[space]; fxt.gameState.InvaderDeck.Ravage.Add(InvaderCardEx.For(space)); // And: no dahan tokens.InitDefault(TokenType.Dahan, 0); // And: enough explorers to cause blight tokens.InitDefault(Invader.Explorer, 2); // When: Card Played (grow,select card,play card) // And: Invader actions proceed Stone_Grows(fxt); BuysAndUses(fxt, StubbornSolidity.Name); // Then: Blight tokens.Blight.Count.ShouldBe(1); }
public async Task Strife_Stops_Ravage() { var gs = new GameState(new Thunderspeaker(), Board.BuildBoardC()); Space space = gs.Island.AllSpaces .First(s => !s.IsOcean && !gs.Tokens[s].HasInvaders() // 0 invaders ); // Given: 1 strifed city var counts = gs.Tokens[space]; counts.Init(Tokens.City.HavingStrife(1), 1); counts.InvaderSummary().ShouldBe("1C@3^", "strife should be used up"); // and: 1 dahan gs.DahanOn(space).Init(1); // When: we ravage there await InvaderEngine1.RavageCard(InvaderCardEx.For(space), gs); // Then: dahan survives gs.DahanOn(space).Count.ShouldBe(1, "dahan should survive due to strife on town"); // and so does city, but strife is gone counts.InvaderSummary().ShouldBe("1C@1", "strife should be used up"); }
public void LotsOfInvaders_DahanUnchanged() { var fxt = new GameFixture() .WithSpirit(new StonesUnyieldingDefiance()) .Start(); // Given: a space to ravage on. var space = fxt.board[5]; // a5 var tokens = fxt.gameState.Tokens[space]; fxt.gameState.InvaderDeck.Ravage.Add(InvaderCardEx.For(space)); // And: dahan in space const int startingDahanCount = 10; tokens.InitDefault(TokenType.Dahan, startingDahanCount); // And: will cause 9 points of damage tokens.InitDefault(Invader.Explorer, 19); // 19 = 10 defend from dahan + 9 points of damage // When: Card Played (grow,select card,play card) // And: Invader actions proceed Stone_Grows(fxt); BuysAndUses(fxt, StubbornSolidity.Name); // Then: all dahan still there tokens[Tokens.Dahan].ShouldBe(startingDahanCount); }
public async Task DeadDahanDoDamage() { gs.Phase = Phase.Fast; // Disable destroying presence // gs.AddBlightSideEffect = (gs,space) => new AddBlightEffect { Cascade=false,DestroyPresence=false }; gs.ModifyBlightAddedEffect.ForGame.Add(x => { x.Cascade = false; x.DestroyPresence = false; }); // Given: 2 dahan on a2 gs.DahanOn(a[2]).Init(2); // and: dahan on a4 so it doesn't auto-select the only target available gs.DahanOn(a[4]).Init(1); // and: 4 explorers + 1 city var counts = gs.Tokens[a[2]]; counts.AdjustDefault(Invader.Explorer, 4); counts.AdjustDefault(Invader.City, 1); // and activate card When_ActivateCard(WordsOfWarning.Name); User.TargetsLand(WordsOfWarning.Name, "(A2),A4"); // When: ravaging on A2 // await gs.InvaderEngine.RavageCard(new InvaderCard(a[2])); await InvaderEngine1.RavageCard(InvaderCardEx.For(a[2]), gs); // Then: 1 explorer left // Words of Warning defend 3 cancelling out City attack leaving only 4 damage from explorers // 2 Dahan attack simultaneously doing 4 points of damage, killing City and 1 explorer leaving 3 explorers gs.Assert_Invaders(a[2], "3E@1"); }
public async Task Disease_Stops_Build() { var gs = new GameState(new Thunderspeaker(), Board.BuildBoardC()); // Given: a space with ONLY 1 explorer Space space = gs.Island.AllSpaces.First(s => !s.IsOcean && !gs.Tokens[s].HasInvaders()); // 0 invaders gs.Tokens[space].AdjustDefault(Invader.Explorer, 1); // add explorer // And: 1 diseases there await gs.Tokens[space].Disease.Add(1); // When: we build there await InvaderCardEx.For(space).Build(gs); // Then: still no towns (just original explorer) gs.Assert_Invaders(space, "1E@1"); // "should be no town on "+space.Label // And: no disease here gs.Tokens[space].Disease.Any.ShouldBeFalse("disease should be used up"); }
public void Wilds_Stops_Explore() { var gs = new GameState(new Thunderspeaker(), Board.BuildBoardC()); // Given: a space with no invaders Space noInvaderSpace = gs.Island.AllSpaces.First(s => !s.IsOcean && !gs.Tokens[s].HasInvaders()); var tokens = gs.Tokens[noInvaderSpace]; // And: 1 neighboring town gs.Tokens[noInvaderSpace.Adjacent.First()].AdjustDefault(Invader.Town, 1); // And: 1 wilds there tokens.Wilds.Init(1); // When: we explore there _ = InvaderCardEx.For(noInvaderSpace).Explore(gs); // Then: still no invaders gs.Tokens[noInvaderSpace].HasInvaders().ShouldBeFalse("there should be no explorers in " + noInvaderSpace.Label); // And: no wilds here (tokens.Wilds > 0).ShouldBeFalse("wilds should be used up"); }
public async Task DahanDamage_Generates0() { // Disable destroying presence // ctx.GameState.AddBlightSideEffect = (gs,space) => new AddBlightEffect { Cascade=false,DestroyPresence=false }; ctx.GameState.ModifyBlightAddedEffect.ForGame.Add(x => { x.Cascade = false; x.DestroyPresence = false; }); // has 1 city and lots of dahan ctx.Tokens.AdjustDefault(Invader.City, 1); // don't use ctx.Invaders because it has a fake/dream invader count ctx.Dahan.Init(10); // Given: using Dread Apparitions await DreadApparitions.ActAsync(ctx); // When: dahan destroy the city // await ctx.GameState.InvaderEngine.RavageCard( ); await InvaderEngine1.RavageCard(InvaderCardEx.For(ctx.Space), ctx.GameState); // Then: 2 fear from city Assert_GeneratedFear(2); // normal // but no defend bonus Assert_DefenceIs(0); }