From 774f96129b6b4263676dd628f9489111bb0d9e6f Mon Sep 17 00:00:00 2001 From: charredUtensil Date: Mon, 16 Sep 2024 23:40:09 -0400 Subject: [PATCH] tweak commonness --- src/core/architects/build_and_power.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/core/architects/build_and_power.ts b/src/core/architects/build_and_power.ts index 46559bf..d5075ba 100644 --- a/src/core/architects/build_and_power.ts +++ b/src/core/architects/build_and_power.ts @@ -157,19 +157,26 @@ function bidHelper( dormant: number, active: number, ): number | false { - let count = 0; + let extantCount = 0; + let unestablishedCount = 0; for (const p of plans) { - if (p.metadata?.tag === TAG) { + if (p.kind === 'cave' && !p.architect) { + unestablishedCount++; + } else if (p.metadata?.tag === TAG) { if (p.metadata.template !== template) { return false; } - count += 1; - if (count >= max) { + extantCount += 1; + if (extantCount >= max) { return false; } } } - return count > 0 ? active : dormant; + if (extantCount > 0) { + return active; + } else { + return unestablishedCount >= max * 2 && dormant; + } } export const BUILD_AND_POWER = [ @@ -207,7 +214,7 @@ export const BUILD_AND_POWER = [ const m = plans[h].metadata; return m?.tag === TAG && m.template === GEOLOGICAL_CENTER; }) && - bidHelper(plans, GEOLOGICAL_CENTER, 3, 0.1, 10); + bidHelper(plans, GEOLOGICAL_CENTER, 3, 0.04, 10); }, } ] as const satisfies readonly Architect[] \ No newline at end of file