static async Task AddDiseaseAndStrife(TargetSpaceCtx ctx) { await ctx.Disease.Add(1); await ctx.AddStrife(); if (await ctx.YouHave("2 moon,3 fire")) { await ctx.AddStrife(); await ctx.AddStrife(); } }
static public async Task ActAsync(TargetSpaceCtx ctx) { // 4 fear ctx.AddFear(4); // add 1 strife await ctx.AddStrife(); // if you have 3moon, 2 air, 3 plant (before the terror level check) if (await ctx.YouHave("3 moon,2 air,3 plant")) { ctx.AddFear(3); await ctx.DamageInvaders(3); } // if terror level is 2 or higher, remove 2 invaders if (2 <= ctx.GameState.Fear.TerrorLevel) { for (int i = 0; i < 2; ++i) { var invader = await ctx.Decision(Select.Invader.ToRemove(ctx.Space, ctx.Tokens.Invaders())); if (invader == null) { break; } await ctx.Invaders.Remove(invader, 1); } } }
public static async Task AddStrifeThenStrifedInvadersDamageUnstrifed(TargetSpaceCtx ctx) { // add 1 strife await ctx.AddStrife(); await StrifedRavage.StrifedInvadersDamageUnstrifed(ctx); }
static public async Task ActAsync(TargetSpaceCtx ctx) { await ctx.Gather(1, Invader.Explorer); await ctx.Gather(1, Invader.Town); await ctx.AddStrife(); }
static async Task RemoveTokensForFearAndDamage(TargetSpaceCtx ctx) { var removed = new List <Token>(); Token[] options = GetRemovableTokens(ctx); // if you have 2 moon, 3 fire: if you have remvoed tokens, return up to 2 of them. Otherwise, add 2 strife // Instead of having Bonus return 2 tokens (like strife...), we will just not remove them bool hasBonus = await ctx.YouHave("2 moon,3 fire"); int returnCount = hasBonus ? System.Math.Min(2, options.Length) : 0; while (options.Length > 0) { // This is kind of special purpose var removeTokenDecision = new Select.TokenFrom1Space( $"Remove token for (1 fear,3 damage) total({removed.Count},{removed.Count * 3})" , ctx.Space, options, Present.Done ); var tokenToRemove = await ctx.Decision(removeTokenDecision); if (tokenToRemove == null) { break; } // If bonus allowed us to return some if (returnCount > 0) { returnCount--; } else { RemoveToken(ctx, tokenToRemove); } // Do fear now ctx.AddFear(1); // do damage later removed.Add(tokenToRemove); // Next options = GetRemovableTokens(ctx); } // now do damage all at once await ctx.DamageInvaders(removed.Count * 3); // if you have 2 moon, 3 fire but didn't remove any if (hasBonus && removed.Count == 0) { // add 2 strife for (int i = 0; i < 2; ++i) { await ctx.AddStrife(); } } }
static public async Task ActAsync(TargetSpaceCtx ctx) { // Add 1 strife await ctx.AddStrife(); // Push 1 dahan await ctx.PushDahan(1); // Each remaining Dahan take 1 damage await ctx.Apply1DamageToEachDahan(); }
static public async Task ActAsync(TargetSpaceCtx ctx) { switch (ctx.GameState.Fear.TerrorLevel) { case 1: ctx.AddFear(3); break; case 2: await ctx.SelectActionOption(Cmd.AddFear(2), Cmd.AddStrife(1)); break; case 3: await ctx.AddStrife(); break; } }
// Extension to SpiritGameStateCtx public static async Task <Space> AddStrifeToOne(this SelfCtx spirit, IEnumerable <Space> options, params TokenClass[] groups) { bool HasInvaders(Space s) => spirit.Target(s).HasInvaders; TargetSpaceCtx spaceCtx = await spirit.SelectSpace("Add strife", options.Where(HasInvaders)); if (spaceCtx != null) { await spaceCtx.AddStrife(groups); } return(spaceCtx?.Space); }
public static async Task ActAsync(TargetSpaceCtx ctx) { // for each blight in or adjcent to target target land int blightCount = BlightInOrAdjacent(ctx); int badland = 0, disease = 0, strife = 0; for (int i = 0; i < blightCount; i++) { // add 1 badland, 1 disease, or 1 strife. (Max +3 of each) await ctx.SelectActionOption( new SpaceAction("Add Badland", async ctx => { await ctx.Badlands.Add(1); ++badland; } ).FilterOption(badland < 3), new SpaceAction("Add Disease", async ctx => { await ctx.Disease.Add(1); ++disease; } ).FilterOption(disease < 3), new SpaceAction("Add Strife", async ctx => { await ctx.AddStrife(); ++strife; } ).FilterOption(strife < 3) ); } // then 2 fear. 1 damage. ctx.AddFear(2); await ctx.DamageInvaders(1); // if you have 3 moon 2 animal: if (await ctx.YouHave("3 moon,2 animal")) { // For each type of token you added, add 1 more within range 1. if (0 < badland) { await AddTokenToLandWithinRange(ctx, TokenType.Badlands, 1); } if (0 < disease) { await AddTokenToLandWithinRange(ctx, TokenType.Disease, 1); } if (0 < strife) { await AddStrifeToLandWithinRange(ctx, 1); } // 1 damage in an adjcaent land await DamageLandWithinRange(ctx, 1); } }
static public async Task ActAsync(TargetSpaceCtx ctx) { // 1 fear. ctx.AddFear(1); // 1 damage. await ctx.DamageInvaders(1); // 1 Damage to Dahan await ctx.DamageDahan(1); // Add 1 badlands, 1 beast, 1 disease, 1 strife, 1 wilds, and 1 blight. await ctx.Badlands.Add(1); await ctx.Beasts.Add(1); await ctx.AddStrife(); await ctx.Wilds.Add(1); await ctx.AddBlight(1); }
static public async Task ActAsync(TargetSpaceCtx ctx) { // Choose a type of token from badlands / beast / disease / strife / wilds that exists in an adjacent land; var candidates = FindHazardTokenInAdjacentLand(ctx); if (candidates.Length == 0) { return; } var tokenChoice = (await ctx.Decision(new Select.TokenFromManySpaces("Select hazard to add to " + ctx.Space.Label, candidates, Present.Always))).Token; // choosing disease costs 1 energy. if (tokenChoice == TokenType.Disease) { ctx.Self.Energy--; } // Add 1 of that type of token to target land. if (tokenChoice is HealthToken ht && 0 < ht.StrifeCount) { await ctx.AddStrife(); }
static public async Task ActAsync(TargetSpaceCtx ctx) { bool originallyHadInvaders = ctx.HasInvaders; // for each strife or blight in target land, int count = ctx.Tokens.Keys.OfType <HealthToken>().Sum(x => x.StrifeCount * ctx.Tokens[x]) + ctx.Blight.Count; // 1 fear ctx.AddFear(count); // and 2 damage. await ctx.DamageInvaders(count * 2); // if this destroys all invaders in target land, add 1 beast. if (originallyHadInvaders && !ctx.HasInvaders) { await ctx.Beasts.Add(1); } // if you have 4 moon, 2 fire if (await ctx.YouHave("4 moon,2 fire")) { // add 1 strife in up to 3 adjacent lands. var tokenSpaces = ctx.Adjacent .Where(s => ctx.Target(s).HasInvaders) .ToList(); for (int i = 0; tokenSpaces.Count > 0 && i < 3; ++i) { var space = await ctx.Decision(new Select.Space("Add Strife", tokenSpaces, Present.Done)); await ctx.AddStrife(); tokenSpaces.Remove(space); } } }
static Task FearAndStrife(TargetSpaceCtx ctx) { ctx.AddFear(1); return(ctx.AddStrife()); }
static public Task Option2(TargetSpaceCtx ctx) => ctx.AddStrife();
static public async Task ActAsync(TargetSpaceCtx ctx) { ctx.AddFear(2); await ctx.AddStrife(); }
static public Task ActAsymc(TargetSpaceCtx ctx) { // Add 1 strife return(ctx.AddStrife()); }