Ejemplo n.º 1
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // replace 1 city with 2 exploreres.
        await ReplaceInvader.SingleInvaderWithExplorers(ctx.Self, ctx.Invaders, Invader.City, 2);

        // replace 1 town with 1 explorer
        await ReplaceInvader.SingleInvaderWithExplorers(ctx.Self, ctx.Invaders, Invader.Town, 1);

        // replace 1 dahan with 1 explorer.
        if (await ctx.Tokens.Dahan.Remove1(RemoveReason.Replaced) != null)
        {
            await ctx.Tokens.AddDefault(Invader.Explorer, 1, AddReason.AsReplacement);
        }

        // if you have 2 fire 2 water 3 animal
        if (await ctx.YouHave("2 fire,2 water,3 animal"))
        {
            // before pushing, explorers and city/town do damage to each other
            int damageFromExplorers = ctx.Tokens.Sum(Invader.Explorer);
            int damageToExplorers   = ctx.Tokens.Sum(Invader.City) * 3 + ctx.Tokens.Sum(Invader.Town) * 2;
            await ctx.DamageInvaders(damageFromExplorers, Invader.City, Invader.Town);

            await ctx.DamageInvaders(damageToExplorers, Invader.Explorer);
        }

        // Push all explorers from target land to as many different lands as possible
        await ctx.Push(int.MaxValue, Invader.Explorer);
    }
Ejemplo n.º 2
0
    static public Task ActAsync(TargetSpaceCtx ctx)
    {
        // 2 fear
        ctx.AddFear(2);

        return(ReplaceInvader.Downgrade(ctx, Invader.City, Invader.Town));
    }
Ejemplo n.º 3
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);
    }
Ejemplo n.º 4
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);
        }
    }