feat: New features (research, invest, gambling, new game+, trophies)

This commit is contained in:
gauvainboiche
2026-10-08 14:03:00 +02:00
parent 1caa4d92b9
commit fc0d5e3ba4
56 changed files with 4332 additions and 249 deletions
+8
View File
@@ -4,6 +4,14 @@ export function clamp(value, min, max) {
return Math.min(max, Math.max(min, value));
}
/**
* Demand bonus from owning chips: diminishing returns (logarithmic), so a big
* lucky streak can never run away with the game.
*/
export function chipDemandBonus(chips, gamble) {
return 1 + gamble.chipBonusScale * Math.log2(1 + Math.max(0, chips));
}
/** Price of the next item when `owned` items are already owned. */
export function unitCost(base, growth, owned) {
return base * growth ** owned;