Skip to content

Commit

Permalink
tweak commonness
Browse files Browse the repository at this point in the history
  • Loading branch information
charredUtensil committed Sep 17, 2024
1 parent 0ffb628 commit 774f961
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/core/architects/build_and_power.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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<BuildAndPowerMetadata>[]

0 comments on commit 774f961

Please sign in to comment.