feat: Making the game harder to 'beat'

This commit is contained in:
gauvainboiche
2026-10-08 17:17:21 +02:00
parent 2f7c307f0e
commit 8b15c76b14
20 changed files with 637 additions and 91 deletions
+10 -4
View File
@@ -3,6 +3,12 @@
import { foldEffects } from './effects.js';
import { chipDemandBonus } from './formulas.js';
/** The multiplier given by all legacy points earned so far: diminishing returns (a power below 1). */
export function passiveBonus(state, ctx) {
const { passiveScale, passivePower } = ctx.rules.legacy;
return 1 + passiveScale * state.legacy.earned ** passivePower;
}
/** All `{ effect, times }` entries that apply to `state`. */
export function collectEffects(state, ctx) {
const entries = [];
@@ -18,10 +24,10 @@ export function collectEffects(state, ctx) {
entries.push({ effect: ctx.perksById.get(id)?.effect, times: level });
}
// Every legacy point ever earned gives a small passive bonus.
const passive = 1 + ctx.rules.legacy.passivePerPoint;
entries.push({ effect: { type: 'global_mult', value: passive }, times: state.legacy.earned });
entries.push({ effect: { type: 'demand_mult', value: passive }, times: state.legacy.earned });
// Every legacy point ever earned adds a flat bonus. It has diminishing returns and does
// not compound: stacking x1.05 per point once reached 1e100 within a few runs.
entries.push({ effect: { type: 'global_mult', value: passiveBonus(state, ctx) } });
entries.push({ effect: { type: 'demand_mult', value: passiveBonus(state, ctx) } });
// Chips make the brand more attractive, with diminishing returns.
entries.push({