예제 #1
0
    static public Task ActAsync(TargetSpaceCtx ctx)
    {
        // 2 fear
        ctx.AddFear(2);

        return(ReplaceInvader.Downgrade(ctx, Invader.City, Invader.Town));
    }
예제 #2
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // 1 fear and defend 6
        ctx.AddFear(1);
        ctx.Defend(6);

        // replace 1 city with 1 town OR 1 town with 1 explorer
        await ReplaceInvader.Downgrade(ctx, Invader.City, Invader.Town);
    }
예제 #3
0
    public async Task Level3(FearCtx ctx)
    {
        var gs = ctx.GameState;

        foreach (var spirit in gs.Spirits)
        {
            var options = gs.Island.AllSpaces.Where(s => s.IsCoastal && gs.Tokens[s].HasAny(Invader.Town, Invader.City)).ToArray();
            if (options.Length == 0)
            {
                return;
            }
            var target = await spirit.Action.Decision(new Select.Space("Replace town with explorer or city with town", options, Present.Always));

            await ReplaceInvader.Downgrade(spirit.Bind( gs ).Target(target), Invader.Town, Invader.City);
        }
    }