예제 #1
0
    public async Task Level2(FearCtx ctx)
    {
        var gs = ctx.GameState;

        foreach (var spiritCtx in ctx.Spirits)
        {
            var options = gs.Island.AllSpaces
                          .Where(s => gs.Tokens[s].HasAny(Invader.Town, Invader.City))
                          .ToArray();
            if (options.Length == 0)
            {
                break;
            }
            var dest = await spiritCtx.Decision(new Select.Space("Select space to gather town to city OR explorer to town", options, Present.Always));

            var destCtx          = spiritCtx.Target(dest);
            var grp              = destCtx.Tokens;
            var invadersToGather = new List <TokenClass>();
            if (grp.Has(Invader.City))
            {
                invadersToGather.Add(Invader.Town);
            }
            if (grp.Has(Invader.Town))
            {
                invadersToGather.Add(Invader.Explorer);
            }
            TokenClass[] invadersToGatherArray = invadersToGather.ToArray();

            await destCtx.GatherUpTo(1, invadersToGatherArray);
        }
    }
예제 #2
0
    public async Task Level3(FearCtx ctx)
    {
        var gs = ctx.GameState;

        foreach (SelfCtx spirit in ctx.Spirits)
        {
            var options = gs.Island.AllSpaces
                          .Where(s => { var counts = gs.Tokens[s]; return(counts.HasInvaders() && !counts.Has(Invader.City)); })
                          .ToArray();
            if (options.Length == 0)
            {
                return;
            }
            var target = await spirit.Decision(new Select.Space("Select space to remove 3 health of invaders", options, Present.Always));

            var sCtx = spirit.Target(target);

            if (sCtx.Tokens.Has(Invader.City))
            {
                await sCtx.RemoveInvader(Invader.City);
            }
            else
            {
                await sCtx.RemoveInvader(Invader.Explorer);
            }
            await sCtx.RemoveInvader(Invader.Explorer);

            await sCtx.RemoveInvader(Invader.Explorer);
        }
    }
예제 #3
0
 public async Task Level1(FearCtx ctx)
 {
     foreach (SelfCtx spiritCtx in ctx.Spirits)
     {
         await Remove1ExplorerOrTownFromLandWithSacredSite(spiritCtx);
     }
 }
예제 #4
0
    public Task Level1(FearCtx ctx)
    {
        // Explore does not affect costal lands.
        ExploreDoesNotAffectCoastalLands(ctx);

        return(Task.CompletedTask);
    }
예제 #5
0
 public Task Level3(FearCtx ctx)
 {
     // Skip the next normal build.
     SkipNextNormalBuild(ctx);
     // The build card shifts left as usual
     return(Task.CompletedTask);
 }
예제 #6
0
 public static async Task StrifedInvadersTakeDamagePerStrife(FearCtx ctx)
 {
     foreach (var space in ctx.GameState.Island.AllSpaces)
     {
         await EachInvaderTakesDamageByStrifeCount(ctx.GameState.Tokens[space]);
     }
 }
    public Task Level1(FearCtx ctx)
    {
        var gs = ctx.GameState;

        DefendCostal(gs, 3);
        return(Task.CompletedTask);
    }
예제 #8
0
    public async Task Level3(FearCtx ctx)
    {
        Space[] sacredSites = ctx.Spirits.SelectMany(spirit => spirit.Self.Presence.SacredSites).Distinct().ToArray();
        Space[] presences   = ctx.Spirits.SelectMany(spirit => spirit.Self.Presence.Spaces).Distinct().ToArray();

        foreach (SelfCtx spiritCtx in ctx.Spirits)
        {
            Space[] cityOptions         = sacredSites.Where(s => spiritCtx.Target(s).Tokens.Has(Invader.City)).ToArray();
            Space[] townExplorerOptions = presences.Where(s => spiritCtx.Target(s).Tokens.HasAny(Invader.Town, Invader.Explorer)).ToArray();

            await spiritCtx.SelectActionOption(
                "Select invader to remove",

                new SelfAction(
                    "remove 1 explorer/town from land with presence",
                    ctx => ctx.RemoveTokenFromOneSpace(townExplorerOptions, 1, Invader.Town, Invader.Explorer)
                    ).FilterOption(townExplorerOptions.Length > 0),

                new SelfAction(
                    "remove 1 city from land with sacred site",
                    ctx => ctx.RemoveTokenFromOneSpace(cityOptions, 1, Invader.City)
                    ).FilterOption(cityOptions.Length > 0)
                );
        }
    }
예제 #9
0
 public Task Level1(FearCtx ctx)
 {
     return(Cmd.InEachLand(
                Cmd.Defend(3)
                , t => t.Badlands.Any || t.Beasts.Any || t.Disease.Any || t.Wilds.Any || t.HasStrife // !! make HasStrife a Porperty, not an extension method
                ).Execute(ctx.GameState));
 }
예제 #10
0
 public async Task Level1(FearCtx ctx)
 {
     // Each player adds 1 strife in a land with or adjacent to beast
     foreach (var spiritCtx in ctx.Spirits)
     {
         await spiritCtx.AddStrifeToOne(ctx.LandsWithOrAdjacentToBeasts());
     }
 }
예제 #11
0
 public async Task Level3(FearCtx ctx)
 {
     // Each player removes 2 explorers and 2 towns from a land with beast or 1 explorer/town from a land adjacent to beast
     foreach (var spirit in ctx.Spirits)
     {
         await RemoveTokenChoice(spirit, 2, Invader.Explorer, Invader.Town);
     }
 }
예제 #12
0
    public async Task Level3(FearCtx ctx)
    {
        // Each player adds 1 Strife in a land with Presence
        await EachPlayerAddsStrifeInALandWithPresence.Execute(ctx.GameState);

        // Each Invader with Strife deals Damage to other Invaders in its land.
        await Cmd.InEachLand(StrifedRavage.Cmd, tokens => tokens.HasStrife).Execute(ctx.GameState);
    }
    public Task Level3(FearCtx ctx)
    {
        var gs = ctx.GameState;

        DefendCostal(gs, 9);
        SkipCostalBuild(gs);
        return(Task.CompletedTask);
    }
 public Task Level2(FearCtx ctx)
 {
     // On Each Board, Remove 2 Explorer / Town from a land with Badlands / Wilds / Dahan.
     return(Cmd.RemoveExplorersOrTowns(2)
            .FromLandOnBoard(FindBadlandsWildsOrDahanSpaces, "a land with Badlands / Wilds / Dahan")
            .OnEachBoard()
            .Execute(ctx.GameState));
 }
 public Task Level1(FearCtx ctx)
 {
     // On Each Board, Push 1 Explorer / Town from a land with Badlands / Wilds / Dahan.
     return(Cmd.PushExplorersOrTowns(1)
            .FromLandOnBoard(FindBadlandsWildsOrDahanSpaces, "a land with Badlands / Wilds / Dahan.")
            .OnEachBoard()
            .Execute(ctx.GameState));
 }
예제 #16
0
 public async Task Level1(FearCtx ctx)
 {
     // each player adds 1 strife in a land with dahan
     foreach (SelfCtx spirit in ctx.Spirits)
     {
         await spirit.AddStrifeToOne(ctx.Lands(ctx.WithDahan));
     }
 }
예제 #17
0
 public async Task Level1(FearCtx ctx)
 {
     // Each player may gather 1 town into a costal land.
     await Cmd.EachSpirit(
         Cmd.GatherUpToNInvaders( 1, Invader.Town )
         .To(staceCtx => staceCtx.IsCoastal, "coastal land")
         ).Execute(ctx.GameState);
 }
예제 #18
0
 public async Task Level2(FearCtx ctx)
 {
     // Each player removes 1 explorer and 1 town from a land with beast or 1 explorer from a land adjacent to beast
     foreach (var spirit in ctx.Spirits)
     {
         await RemoveTokenChoice(spirit, 1, Invader.Explorer);
     }
 }
예제 #19
0
 public async Task Level1(FearCtx ctx)
 {
     // Each player adds 1 strife in a land with beast/disease/dahan.
     foreach (SelfCtx spirit in ctx.Spirits)
     {
         await spirit.AddStrifeToOne(ctx.LandsWithBeastDiseaseDahan());
     }
 }
예제 #20
0
 public async Task Level1(FearCtx ctx)
 {
     // Each player removes 1 eplorer from a land with dahan
     foreach (var spirit in ctx.Spirits)
     {
         await spirit.RemoveTokenFromOneSpace(ctx.Lands(ctx.WithDahanAndExplorers), 1, Invader.Explorer);
     }
 }
예제 #21
0
    public Task Level1(FearCtx ctx)
    {
        var gs = ctx.GameState;

        int defend(Space space) => gs.DahanOn(space).Count;

        return(DefendIt(gs, defend));
    }
예제 #22
0
 public async Task Level1(FearCtx ctx)
 {
     // Each player removes 1 explorer / town from a land with beast.
     foreach (var spiritCtx in ctx.Spirits)
     {
         await spiritCtx.RemoveTokenFromOneSpace(ctx.LandsWithBeasts(), 1, Invader.Explorer);
     }
 }
예제 #23
0
    static void DefendCostal(FearCtx ctx, int defense)
    {
        var coastal = ctx.GameState.Island.AllSpaces.Where(x => x.IsCoastal).ToArray();

        foreach (var land in coastal)
        {
            ctx.GameState.Tokens[land].Defend.Add(defense);
        }
    }
예제 #24
0
    public async Task Level1(FearCtx ctx)
    {
        var gs = ctx.GameState;

        foreach (var space in gs.Island.AllSpaces)
        {
            await Destroy_1ExplorerPerTown(gs.Invaders.On(space));
        }
    }
예제 #25
0
    public async Task Level3(FearCtx ctx)
    {
        await EachPlayerAddsStrifeToNonRavageLand(2).Execute(ctx.GameState);

        // 1 Fear per player.
        ctx.GameState.Fear.AddDirect(new FearArgs {
            count = ctx.GameState.Spirits.Length
        });
    }
예제 #26
0
    static void DefendLands(FearCtx ctx, int defense)
    {
        var lands = ctx.GameState.Island.AllSpaces.Where(s => !s.IsOcean);

        foreach (var land in lands)
        {
            ctx.GameState.Tokens[land].Defend.Add(defense);
        }
    }
 public Task Level3(FearCtx ctx)
 {
     return(SpiritsActOnDifferentCostalLands(ctx,
                                             async spaceCtx => {
         await spaceCtx.GatherUpToNDahan(1);
         await spaceCtx.DamageInvaders(spaceCtx.Dahan.Count * 2);
     }
                                             ));
 }
예제 #28
0
    static void Defend2WherePresence(FearCtx ctx)
    {
        GameState gs = ctx.GameState;

        foreach (var space in gs.Spirits.SelectMany(s => s.Presence.Spaces).Distinct())
        {
            gs.Tokens[space].Defend.Add(2);
        }
    }
예제 #29
0
    static void ExploreDoesNotAffectCoastalLands(FearCtx ctx)
    {
        var gs = ctx.GameState;

        foreach (var costal in gs.Island.AllSpaces.Where(x => x.IsCoastal))
        {
            gs.SkipExplore(costal);
        }
    }
예제 #30
0
 public Task Level2(FearCtx ctx)
 {
     Defend2WherePresence(ctx);
     foreach (var spirit in ctx.Spirits)
     {
         spirit.Self.Energy += spirit.Self.Presence.SacredSites.Count(s => spirit.Target(s).HasInvaders);
     }
     return(Task.CompletedTask);
 }