Exemplo n.º 1
0
    static public async Task ActAsymc(TargetSpaceCtx ctx)
    {
        int startingInvaderCount = ctx.Tokens.InvaderTotal();

        // 1 invader with strife deals damage to other invaders (not to each)
        int damage = StrifedRavage.DamageFrom1StrifedInvaders(ctx.Tokens);
        await StrifedRavage.DamageUnStriffed(ctx, damage);

        // 1 fear per invader this power destroyed. // ??? What if Bringer uses this?  Does nightmare death count as death
        int killed = startingInvaderCount - ctx.Tokens.InvaderTotal();

        ctx.AddFear(killed);
    }
 static public async Task ActionAsync(TargetSpaceCtx ctx)
 {
     // If target land is mountain or sand,
     if (ctx.IsOneOf(Terrain.Mountain, Terrain.Sand))
     {
         // instead 1 damange to EACH town/city
         await ctx.DamageEachInvader(1, Invader.City, Invader.Town);
     }
     else
     {
         await ctx.DamageInvaders(1, Invader.Town, Invader.City);
     }
 }
Exemplo n.º 3
0
 static public async Task ActAsync(TargetSpaceCtx ctx)
 {
     await ctx.SelectActionOption(
         new SpaceAction(
             "Add strife. Invaders with strife deal Damage to other Invaders in target land.",
             AddStrifeThenStrifedInvadersDamageUnstrifed
             )
         , new SpaceAction(
             "Instead, if Invaders Ravage in target land, damage invaders in adjacent lands instead of dahan"
             , DuringRavage_InvadersDamageInvadersInAdjacentLandsInsteadOfDahan
             ).FilterOption(await ctx.YouHave("4 sun,2 fire,2 animal"))
         );
 }
Exemplo n.º 4
0
    static public Task Act(TargetSpaceCtx ctx)
    {
        // 2 fear
        ctx.AddFear(2);

        // if target is M/J, Defend 3
        if (ctx.IsOneOf(Terrain.Jungle, Terrain.Mountain))
        {
            ctx.Defend(3);
        }

        return(Task.CompletedTask);
    }
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // 6 fear
        ctx.AddFear(6);
        // destroy all invaders
        await ctx.Invaders.DestroyAny(int.MaxValue, Invader.City, Invader.Town, Invader.Explorer);

        // if you have (2 sun, 2 moon, 4 water, 4 earth):
        if (await ctx.YouHave("2 sun,2 moon,4 water,4 earth"))
        {
            await DestroyBoard(ctx, ctx.Space.Board);
        }
    }
Exemplo n.º 6
0
    static public async Task Act(TargetSpaceCtx ctx)
    {
        // 1 fear
        ctx.AddFear(1);

        // Push 1 explorer/town
        await ctx.Push(1, Invader.Explorer, Invader.Town);

        if (await ctx.YouHave("2 fire"))
        {
            ctx.AddFear(1);
        }
    }
Exemplo n.º 7
0
 static public async Task ActAsync(TargetSpaceCtx ctx)
 {
     await ctx.Gatherer
     // gather up to 2 explorers
     .AddGroup(2, Invader.Explorer)
     // gather up to 2 towns
     .AddGroup(2, Invader.Town)
     // gather up to 2 beast
     .AddGroup(2, TokenType.Beast)
     // gather up to 2 dahan
     .AddGroup(2, TokenType.Dahan)
     .GatherUpToN();
 }
Exemplo n.º 8
0
    static public Task ActAsync(TargetSpaceCtx ctx)
    {
        // 2 damage
        int damage = 2;

        if (3 <= ctx.Dahan.Count)
        {
            damage += 3;
            ctx.AddFear(2);
        }

        return(ctx.DamageInvaders(damage));
    }
Exemplo n.º 9
0
    static public async Task Act(TargetSpaceCtx ctx)
    {
        // gather up to 4 dahan
        await ctx.GatherUpToNDahan(4);

        // if invaders are present and dahan now out numberthem, 3 fear
        var invaderCount = ctx.Tokens.InvaderTotal();

        if (0 < invaderCount && invaderCount < ctx.Dahan.Count)
        {
            ctx.AddFear(3);
        }
    }
Exemplo n.º 10
0
    static async Task <PowerCard> DawCardAndActivateAtMax(TargetSpaceCtx ctx)
    {
        // Discard Minor Powers from the deck until you get one that targets a land.
        PowerCard card = DiscardMinorPowersUntilYouTargetLand(ctx);

        // Show to the user what card is being triggered
        await ctx.Self.SelectFactory("Perform All Action at Max", new IActionFactory[] { card });

        // Use immediately. All 'up to' instructions must be used at max and 'OR's treated as 'AND's "
        await card.InvokeOn(new LetsSeeWhatHappensCtx( ctx ));

        return(card);
    }
Exemplo n.º 11
0
    static void PushFutureInvadersFromLands(TargetSpaceCtx ctx)
    {
        // each invader added to target land this turn may be immediatley pushed to any adjacent land
        ctx.GameState.Tokens.TokenAdded.ForRound.Add(PushAddedInvader);

        async Task PushAddedInvader(ITokenAddedArgs args)
        {
            if (args.Space == ctx.Space && (args.Reason == AddReason.Explore || args.Reason == AddReason.Build))                  // ??? is there any other way to add invaders?

            {
                await ctx.Pusher.PushToken(args.Token);
            }
        }
    }
Exemplo n.º 12
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // 4 fear
        ctx.AddFear(4);

        // invaders skip all actions in target land this turn
        ctx.SkipAllInvaderActions();

        // if you have 2 air 3 earth, +4 fear
        if (await ctx.YouHave("2 air,3 earth"))
        {
            ctx.AddFear(4);
        }
    }
Exemplo n.º 13
0
    static public void AddFear(TargetSpaceCtx ctx)
    {
        int fearCount = 2;

        if (ctx.Disease.Any)
        {
            fearCount++;
        }
        if (ctx.Blight > 0)
        {
            fearCount++;
        }
        ctx.AddFear(fearCount);
    }
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // 1 fear.
        ctx.AddFear(1);

        // Defend 5.
        ctx.Defend(5);

        // If you have 3 moon:  Add 1 Beast
        if (await ctx.YouHave("3 moon"))
        {
            await ctx.Beasts.Add(1);
        }
    }
Exemplo n.º 15
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        await ActInnerAsync(ctx);

        // You may repeat this Power (once) on the same land by spending 1 Time.
        if (ctx.Self is FracturedDaysSplitTheSky frac &&
            frac.Time > 0 &&
            await frac.UserSelectsFirstText($"Pay 1 Time to repeat '{BlurTheArcOfYears.Name}' on {ctx.Space.Label}?", "Yes", "No, thank you")
            )
        {
            await frac.SpendTime(1);
            await ActInnerAsync(ctx);
        }
    }
Exemplo n.º 16
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // destroy 1 explorer
        await ctx.Invaders.Destroy(1, Invader.Explorer);

        // and 1 dahan
        await ctx.DestroyDahan(1);

        // add 1 wilds
        await ctx.Wilds.Add(1);

        // defend 2
        ctx.Defend(2);
    }
    static public async Task Act(TargetSpaceCtx ctx)
    {
        // 2 fear
        ctx.AddFear(2);

        // if target is M/J, Push 1 explorer and 1 town
        if (ctx.IsOneOf(Terrain.Mountain, Terrain.Jungle))
        {
            await ctx.Pusher
            .AddGroup(1, Invader.Town)
            .AddGroup(1, Invader.Explorer)
            .MoveN();
        }
    }
    static public Task ActAsync(TargetSpaceCtx ctx)
    {
        // 1 fear
        ctx.AddFear(1);
        // Defend 3
        ctx.Defend(3);
        // If beast are present, +2 fear.
        if (ctx.Beasts.Any)
        {
            ctx.AddFear(2);
        }

        return(Task.CompletedTask);
    }
Exemplo n.º 19
0
    static public async Task ActionAsync(TargetSpaceCtx ctx)
    {
        // Push up to 2 dahan.
        var destinationSpaces = await ctx.PushUpToNDahan(2);

        // if pushed dahan into town or city
        bool pushedToBuildingSpace = destinationSpaces
                                     .Any(neighbor => ctx.Target(neighbor).Tokens.HasAny(Invader.Town, Invader.City));

        if (pushedToBuildingSpace)
        {
            ctx.AddFear(1);
        }
    }
Exemplo n.º 20
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);
        }
    }
Exemplo n.º 21
0
 static public async Task Act(TargetSpaceCtx ctx)
 {
     // if you have 2 moon, you may instead replace 1 town with 1 dahan
     if (ctx.Tokens.Has(Invader.Town) && await ctx.YouHave("2 moon"))
     {
         await ctx.RemoveInvader(Invader.Town);               // !!! ??? reports event?
     }
     else if (ctx.Tokens.Has(Invader.Explorer))
     {
         // replace 1 explorer with 1 dahan
         await ctx.RemoveInvader(Invader.Explorer);               // ??? reports event?
     }
     await ctx.Dahan.Add(1, AddReason.AsReplacement);
 }
Exemplo n.º 22
0
    static async Task EffectAdjacentLand(TargetSpaceCtx adj)
    {
        // 10 damage,
        await adj.DamageInvaders(10);

        // destroy all dahan and beast.
        await DestroyDahanAndBeasts(adj);

        // IF there are no blight, add 1 blight
        if (adj.Blight.Count == 0)
        {
            await adj.AddBlight(1);
        }
    }
Exemplo n.º 23
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);
        }
    }
Exemplo n.º 24
0
    static async Task SelectUpTo3DamagedInvadersToNotParticipate(TargetSpaceCtx ctx)
    {
        // Find Damaged Invaders
        var damagedInvaders = new List <Token>();

        foreach (var token in ctx.Tokens.Invaders().Where(t => t.RemainingHealth < t.FullHealth))
        {
            for (int i = 0; i < ctx.Tokens[token]; ++i)
            {
                damagedInvaders.Add(token);
            }
        }
        if (damagedInvaders.Count == 0)
        {
            return;
        }

        // Create a list to hold ones we've selected to exclude
        var skipInvaders = new List <Token>();
        // Select up to 3 to put in the skip-list
        int remaining = 3;

        while (remaining-- > 0 && damagedInvaders.Count > 0)
        {
            var skip = await ctx.Decision(new Select.TokenFrom1Space(
                                              "Select invader to not participate in ravage", ctx.Space,
                                              damagedInvaders.Distinct(),
                                              Present.Done
                                              ));

            if (skip == null)
            {
                break;
            }
            skipInvaders.Add(skip);
            damagedInvaders.Remove(skip);
        }

        // If we selected any, remove them from the fight
        if (skipInvaders.Count > 0)
        {
            ctx.GameState.ModifyRavage(ctx.Space, cfg => {
                foreach (var s in skipInvaders)
                {
                    cfg.NotParticipating[s]++;
                }
            });
        }
    }
Exemplo n.º 25
0
    static public Task ActAsync(TargetSpaceCtx ctx)
    {
        // Defend 1 per dahan  (protects the land)
        ctx.Defend(ctx.Dahan.Count);

        // dahan in target land cannot be changed. (when they would be damaged, destroyed, removed, replaced, or moved, instead don't)
        ctx.Tokens.Dahan.Frozen = true;

        ctx.GameState.TimePasses_ThisRound.Push((gs) => {
            gs.Tokens[ctx.Space].Dahan.Frozen = false;
            return(Task.CompletedTask);
        });

        return(Task.CompletedTask);
    }
Exemplo n.º 26
0
 static async Task DoFireDamage(TargetSpaceCtx ctx, int fireDamage)
 {
     if (fireDamage == 0)
     {
         return;
     }
     if (await CanSplitDamage(ctx))
     {
         await DoFireDamageToMultipleTargets(ctx, fireDamage);
     }
     else
     {
         await ctx.DamageInvaders(fireDamage);
     }
 }
Exemplo n.º 27
0
    static public async Task ActAsync(TargetSpaceCtx ctx)
    {
        // You may Gather 1 dahan
        await ctx.GatherUpToNDahan(1);

        // If the Terro Level is 2 or lower
        if (ctx.GameState.Fear.TerrorLevel <= 2)
        {
            // Gather 1 town
            await ctx.Gather(1, Invader.Town);

            // And the first ravage in target land becomes a build there instead.
            FirstRavageBecomesABuild(ctx);
        }
    }
Exemplo n.º 28
0
    static void FirstRavageBecomesABuild(TargetSpaceCtx ctx)
    {
        ctx.GameState.PreRavaging.ForRound.Add((args) => {
            if (!args.Spaces.Contains(ctx.Space))
            {
                return;
            }

            // Stop Ravage
            args.Skip1(ctx.Space);             // Stop Ravage

            // Add Build
            args.GameState.PreBuilding.ForRound.Add((buildArgs) => buildArgs.Add(ctx.Space));
        });
    }
Exemplo n.º 29
0
	static public async Task ActAsync(TargetSpaceCtx ctx ) {

		// 1 fear.
		ctx.AddFear(1);

		// add 1 badlands.
		await ctx.Badlands.Add(1);

		// Add 1 beast within 1 range.
		var spaceCtx = await ctx.SelectSpace("Add beast", ctx.FindSpacesWithinRangeOf(1,Target.Any));
		await spaceCtx.Beasts.Add(1);

		// Push up to 2 dahan.
		await ctx.PushUpToNDahan(2);
	}
Exemplo n.º 30
0
    public static Task ActAsync(TargetSpaceCtx ctx)
    {
        // 2 fear if Invaders are present.
        if (ctx.HasInvaders)
        {
            ctx.AddFear(2);
        }

        // Push 2 dahan and 2 explorer / town to land(s) without your presence.
        return(ctx.Pusher
               .AddGroup(2, Invader.Explorer, Invader.Town)
               .AddGroup(2, TokenType.Dahan)
               .FilterDestinations(s => !ctx.Self.Presence.IsOn(s))
               .MoveN());
    }