コード例 #1
0
    public static async Task ActAsync(TargetSpaceCtx ctx)
    {
        // target land and a land adjacent to it become a single land for this turn.
        var other = (await ctx.SelectAdjacentLand($"Join {ctx.Space.Label} to.")).Space;

        MultiSpace multi = JoinSpaces(ctx, ctx.Space, other);

        // if you have 4 air:
        if (await ctx.YouHave("4 air"))
        {
            // isolate the joined land.
            var joinedCtx = ctx.Target(multi);
            joinedCtx.Isolate();
            // If it has invaders,
            if (joinedCtx.HasInvaders)
            {
                // 2 fear,
                joinedCtx.AddFear(2);
                // and Remove up to 2 invaders
                await joinedCtx.Invaders.Remove();

                await joinedCtx.Invaders.Remove();
            }
        }
    }
コード例 #2
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // 2 fear
        ctx.AddFear(2);

        // add 1 beast.
        var beasts = ctx.Beasts;
        await beasts.Add(1);

        // Gather up to 1 beast.
        await ctx.GatherUpTo(1, TokenType.Beast);

        // 1 damage per beast.
        await ctx.DamageInvaders(beasts.Count);

        // Push up to 2 beast
        await ctx.PushUpTo(2, TokenType.Beast);

        // if you have 2 sun 2 moon 3 animal
        if (await ctx.YouHave("2 sun,2 moon,3 animal"))
        {
            //   1 damage in adjacent land without blight,
            //   and +1 damage per beast there
            var noBlight = await ctx.SelectAdjacentLand("1 Damage in land w/o blight", ctx => !ctx.HasBlight);

            if (noBlight != null)
            {
                await noBlight.DamageInvaders(1 + noBlight.Beasts.Count);
            }
        }
    }
コード例 #3
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // 4 damage.
        await ctx.DamageInvaders(4);

        // If any invaders remain, add 1 disease
        if (ctx.Tokens.Invaders().Any())
        {
            await ctx.Disease.Add(1);
        }

        // if 3 air and 3 plant:
        if (await ctx.YouHave("3 air,3 plant"))
        {
            // 3 fear.
            ctx.AddFear(3);
            // Add 1 disease to 2 adjacent lands with invaders.
            for (int i = 0; i < 2; ++i)
            {
                var adjCtx = await ctx.SelectAdjacentLand($"Add disease to ({i+1} of 2)", x => x.Tokens.HasInvaders());

                await adjCtx.Disease.Add(1);
            }
        }
    }
コード例 #4
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        await DoPower(ctx);

        if (await ctx.YouHave("3 sun,2 water"))
        {
            await DoPower(await ctx.SelectAdjacentLand("Repeat power"));
        }
    }
コード例 #5
0
    static async Task DamageInAdjacentLand(TargetSpaceCtx ctx)
    {
        var adjCtx = await ctx.SelectAdjacentLand("1 damage");

        if (adjCtx != null)
        {
            await adjCtx.DamageInvaders(1);
        }
    }
コード例 #6
0
    static async Task <TargetSpaceCtx> SelectSpaceCloserToTheOcean(TargetSpaceCtx ctx)
    {
        var oceans             = ctx.GameState.Island.Boards.Select(b => b.Ocean);
        var distanceFromOceans = new MinDistanceCalculator()
                                 .SetTargets(oceans)
                                 .Calculate();
        int curDistance = distanceFromOceans[ctx.Space];
        var closerSpace = await ctx.SelectAdjacentLand("Push explorer/town towards ocean", a => distanceFromOceans[a.Space] < curDistance);

        return(closerSpace);
    }
コード例 #7
0
    static Task DuringRavage_InvadersDamageInvadersInAdjacentLandsInsteadOfDahan(TargetSpaceCtx ctx)
    {
        // Note - this works regardless of them ravaging in target land or not. yay!
        int damageFromStrifedInvaders = ctx.Tokens.Invaders().OfType <HealthToken>().Where(x => x.StrifeCount > 0).Sum(si => si.FullHealth * ctx.Tokens[si]);

        async Task Sequence(RavageAction eng)
        {
            // they damage invaders in adjacent lands instead of dahan and the land.
            var invaderSpaceCtx = await ctx.SelectAdjacentLand($"Apply {damageFromStrifedInvaders} damage to", x => x.HasInvaders);

            if (invaderSpaceCtx != null)
            {
                await StrifedRavage.DamageUnStriffed(invaderSpaceCtx, damageFromStrifedInvaders);
            }
            // dahan in target land do not fight back.
        }

        ctx.ModifyRavage(cfg => cfg.RavageSequence = Sequence);
        return(Task.CompletedTask);
    }