コード例 #1
0
 static public Task ActAsync(TargetSpaceCtx ctx)
 {
     // 1 fear per type of Invader present.
     ctx.AddFear(ctx.Tokens.InvaderTotal());
     // Push up to 1 explorer / town per blight.
     return(ctx.PushUpTo(ctx.Blight.Count, Invader.Explorer, Invader.Town));
 }
コード例 #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 Task ActAsync(TargetSpaceCtx ctx)
 {
     return(ctx.SelectActionOption(
                new SpaceAction("Add 1 beast", ctx => ctx.Beasts.Add(1)),
                new SpaceAction("Push up to 2 explorers", ctx => ctx.PushUpTo(2, Invader.Explorer))
                .Matches(x => x.Beasts.Any)
                ));
 }
コード例 #4
0
    static public async Task Option2Async(TargetSpaceCtx ctx)
    {
        await Option1Async(ctx);

        // For each 2 moon 2 earth you have
        int count = Math.Min(ctx.Self.Elements[Element.Moon], ctx.Self.Elements[Element.Earth]) / 2;

        // 2 fear
        ctx.AddFear(count * 2);
        // you may Push 1 town from target land.
        await ctx.PushUpTo(count, Invader.Town);
    }
コード例 #5
0
 static public Task ActAsync(TargetSpaceCtx ctx)
 {
     return(ctx.SelectActionOption(
                new SpaceAction("1 damage to each town / city. Push 1 town.", async ctx => {
         // 1 damage to each town / city.
         await ctx.DamageEachInvader(1, Invader.Town, Invader.City);
         // push up to 1 town.
         await ctx.PushUpTo(1, Invader.Town);
     }),
                Cmd.DestroyTown(1)
                ));
 }
コード例 #6
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // you may push 1 explorer / town / dahan
        await ctx.PushUpTo(1, Invader.Explorer, Invader.Town, TokenType.Dahan);

        // 2 fear
        ctx.AddFear(2);
        // if target land has any beasts, 1 fear
        if (ctx.Beasts.Any)
        {
            ctx.AddFear(1);
        }
    }
コード例 #7
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // Defend 4
        ctx.Defend(4);

        // Push up to 1 blight.
        await ctx.PushUpTo(4, TokenType.Blight);

        // If you have 2 sun: 1 fear
        if (await ctx.YouHave("2 sun"))
        {
            ctx.AddFear(1);
        }
    }
コード例 #8
0
    static public async Task Act(TargetSpaceCtx ctx)
    {
        // 2 fear
        ctx.AddFear(2);

        // push up to 4 explorers or towns
        await ctx.PushUpTo(4, Invader.Explorer, Invader.Town);

        // if you have 4 moon, +4 fear
        if (await ctx.YouHave("4 moon"))
        {
            ctx.AddFear(4);
        }
    }
コード例 #9
0
    static async Task TargetSpiritActions(TargetSpaceCtx otherCtx)
    {
        // In that land: Replace each of their presence with badlands;  The replaced presence leaves the game.
        int count = otherCtx.Self.Presence.CountOn(otherCtx.Space);

        for (int i = 0; i < count; ++i)
        {
            await otherCtx.Presence.RemoveFrom(otherCtx.Space);
        }
        await otherCtx.Badlands.Add(count, AddReason.AsReplacement);

        // Push any number of those Badlands.
        await otherCtx.PushUpTo(count, TokenType.Badlands);

        // 3 fear.
        otherCtx.AddFear(3);

        // 3 damage per presence replaced
        await otherCtx.DamageInvaders(count * 3);
    }
コード例 #10
0
    public static async Task ActAsync(TargetSpaceCtx ctx)
    {
        // 2 fear. 2 damage.
        ctx.AddFear(2);
        await ctx.DamageInvaders(2);

        // if no beasts are present, add beast.
        if (!ctx.Beasts.Any)
        {
            await ctx.Beasts.Add(1);
        }
        else
        {
            // otherwise, +2 Damage,
            await ctx.DamageInvaders(2);

            // and Push up to 1 beast.
            await ctx.PushUpTo(1, TokenType.Beast);
        }

        if (await ctx.YouHave("2 fire,3 animal"))
        {
            // 1 fear and
            ctx.AddFear(1);
            // destroy 1 explorer/town in an adjacent land with beast
            var tokens = ctx.Adjacent
                         .Select(ctx.Target)
                         .Where(x => x.Beasts.Any)
                         .SelectMany(x => x.Tokens.OfType(Invader.Explorer)
                                     .Select(t => new SpaceToken(x.Space, t))
                                     )
                         .ToArray();
            var st = await ctx.Decision(new Select.TokenFromManySpaces("Destroy Explorer", tokens, Present.Always));

            if (st != null)
            {
                await ctx.Target(st.Space).Invaders.Destroy(1, (HealthToken)st.Token);
            }
        }
    }
コード例 #11
0
    static public async Task Act(TargetSpaceCtx ctx)
    {
        // 2 fear
        ctx.AddFear(2);

        // Push up to 2 explorer/towns
        int pushCount = 2;

        // if target has blight
        if (ctx.HasBlight)
        {
            // +2 fear
            ctx.AddFear(2);

            // push up to 2 more explorers/towns
            pushCount += 2;
        }

        // add 1 blight
        await ctx.AddBlight(1);

        await ctx.PushUpTo(pushCount, Invader.Explorer, Invader.Town);
    }
コード例 #12
0
 static public Task Option3(TargetSpaceCtx ctx)
 {
     return(ctx.PushUpTo(2, Invader.Explorer, TokenType.Dahan));
 }
コード例 #13
0
 static public Task ActAsync(TargetSpaceCtx ctx)
 {
     // push up to 2 towns
     return(ctx.PushUpTo(2, Invader.Town));
 }
コード例 #14
0
 static public Task ActAsync(TargetSpaceCtx ctx)
 {
     // Push up to 1 blight, Explorer, Town.
     return(ctx.PushUpTo(1, TokenType.Blight, Invader.Explorer, Invader.Town));
 }
コード例 #15
0
ファイル: RagingHunt.cs プロジェクト: rettigcd/spiritisland
 static public void Noop(TargetSpaceCtx ctx) => ctx.PushUpTo(2, TokenType.Beast);
コード例 #16
0
 static public async Task ActionAsync(TargetSpaceCtx ctx)
 {
     await ctx.PushUpTo(3, Invader.Town, Invader.Explorer);
 }
コード例 #17
0
 static public Task Option3(TargetSpaceCtx ctx)
 {
     return(ctx.PushUpTo(3, TokenType.Beast));
 }
コード例 #18
0
    static public async Task Option2Async(TargetSpaceCtx ctx)
    {
        await ctx.DamageInvaders(2);

        await ctx.PushUpTo(3, Invader.Town, Invader.Explorer);
    }