feat: New features (research, invest, gambling, new game+, trophies)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user