generated from nhcarrigan/template
feat: scale adventurer tier costs progressively
Each adventurer tier now has a unique baseCost that scales ~7x per tier (L1: 10 → L32: ~2.5e27). The per-count scaling factor (1.15×) is unchanged. Closes #10
This commit is contained in:
@@ -18,7 +18,7 @@ const BATCH_OPTIONS: BatchSize[] = [1, 5, 10, 25, 100, "max"];
|
||||
const computeBatchCost = (adventurer: Adventurer, quantity: number): number => {
|
||||
let total = 0;
|
||||
for (let i = 0; i < quantity; i++) {
|
||||
total += 10 * Math.pow(1.15, adventurer.count + i);
|
||||
total += adventurer.baseCost * Math.pow(1.15, adventurer.count + i);
|
||||
}
|
||||
return total;
|
||||
};
|
||||
@@ -27,7 +27,7 @@ const computeMaxAffordable = (adventurer: Adventurer, gold: number): number => {
|
||||
let total = 0;
|
||||
let quantity = 0;
|
||||
for (let i = 0; i < 100_000; i++) {
|
||||
const cost = 10 * Math.pow(1.15, adventurer.count + i);
|
||||
const cost = adventurer.baseCost * Math.pow(1.15, adventurer.count + i);
|
||||
if (total + cost > gold) break;
|
||||
total += cost;
|
||||
quantity++;
|
||||
|
||||
@@ -450,7 +450,7 @@ export const GameProvider = ({ children }: { children: React.ReactNode }): React
|
||||
let purchased = 0;
|
||||
|
||||
for (let i = 0; i < quantity; i++) {
|
||||
const cost = 10 * Math.pow(1.15, count);
|
||||
const cost = adventurer.baseCost * Math.pow(1.15, count);
|
||||
if (gold < cost) break;
|
||||
gold -= cost;
|
||||
count++;
|
||||
|
||||
Reference in New Issue
Block a user