static async Task DamageLandWithinRange(TargetSpaceCtx ctx, int range) { // !!! could make this a single SpaceToken step. var space = await ctx.Decision(new Select.Space("Select land for 1 Damage", ctx.Range(range), Present.Always)); await ctx.Target(space).DamageInvaders(1); }
static public async Task ActAsync(TargetSpaceCtx ctx) { // destroy all explorers. await ctx.Invaders.Destroy(int.MaxValue, Invader.Explorer); // Add 1 wilds. await ctx.Wilds.Add(1); // Add 1 wilds in the originating Sands. // !! won't find original if this was picked using a range-extender - would need to capture that info during the targetting process var originatingOptions = ctx.Range(1) .Where(a => ctx.Self.Presence.Spaces.Contains(a) && a.IsSand) .ToArray(); var originalCtx = await ctx.SelectSpace("Select origination space", originatingOptions, Present.AutoSelectSingle); if (originalCtx != null) { await originalCtx.Wilds.Add(1); } // 1 damage per wilds in / adjacent to target land. int wildsDamage = ctx.Space.Range(1).Sum(s => ctx.Target(s).Wilds.Count); // if you have 2 fire, 3 plant: // +1 damage per wilds in / adjacent to target land. if (await ctx.YouHave("2 fire,3 plant")) { wildsDamage += wildsDamage; } await ctx.DamageInvaders(wildsDamage); }
static public async Task ActAsync(TargetSpaceCtx ctx) { // 2 fear ctx.AddFear(2); // for each of your SS in / adjacent to target land, 2 damage int sacredSiteCount = ctx.Range(1).Intersect(ctx.Self.Presence.SacredSites).Count(); await ctx.DamageInvaders(2 *sacredSiteCount); // destroy all dahan await ctx.DestroyDahan(int.MaxValue); }
static async Task AddStrifeToLandWithinRange(TargetSpaceCtx ctx, int range) { var space = await ctx.Decision(new Select.Space("Add Strife", ctx.Range(range), Present.Always)); await ctx.Target(space).AddStrife(); }
static async Task AddTokenToLandWithinRange(TargetSpaceCtx ctx, Token token, int range) { var space = await ctx.Decision(new Select.Space($"Add {token.Text}", ctx.Range(range), Present.Always)); await ctx.Target(space).Tokens.Add(token, 1); }
static int BlightInOrAdjacent(TargetSpaceCtx ctx) => ctx.Range(1).Sum(s => ctx.Target(s).Blight.Count);
static public async Task ActAsync(TargetSpaceCtx ctx) { // add 2 disease var disease = ctx.Disease; await disease.Add(2); // for each disease in target land, defend 1 in target and all adjacent lands ctx.Defend(disease.Count); foreach (var adjacent in ctx.Adjacent) { ctx.Target(adjacent).Defend(disease.Count); } // if you have 2 earthn 4 animal: if (await ctx.YouHave("2 earth,4 animal")) { // 2 fear. ctx.AddFear(2); // For each disease in target land, do 1 damage in target or adjacent land int damage = disease.Count; var space = await ctx.Decision(new Select.Space($"Select space to apply {damage} damage", ctx.Range(1), Present.Always)); // can we wrap this and make it easier to call? await ctx.Target(space).DamageInvaders(damage); } }