From 875b592d47433b71e19886b4af815053d4221da2 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Tue, 3 Sep 2024 09:00:56 -0500 Subject: [PATCH] feat(#505): re-balance upgrade costs --- src/constants.js | 18 +++++++++--------- .../reducers/purchaseCombine.test.js | 7 +++++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/constants.js b/src/constants.js index 2e9a2070..007359f9 100644 --- a/src/constants.js +++ b/src/constants.js @@ -44,8 +44,8 @@ export const INITIAL_FIELD_HEIGHT = 10 export const PURCHASEABLE_FIELD_SIZES = freeze( new Map([ [1, { columns: 8, rows: 12, price: 1_000 }], - [2, { columns: 10, rows: 16, price: 2_000 }], - [3, { columns: 12, rows: 18, price: 3_000 }], + [2, { columns: 10, rows: 16, price: 5_000 }], + [3, { columns: 12, rows: 18, price: 20_000 }], ]) ) @@ -68,7 +68,7 @@ export const LARGEST_PURCHASABLE_FIELD_SIZE = /** @type {farmhand.purchaseableFi )) export const PURCHASEABLE_COMBINES = freeze( - new Map([[1, { type: 'Basic', price: 500_000 }]]) + new Map([[1, { type: 'Basic', price: 250_000 }]]) ) export const PURCHASEABLE_COMPOSTERS = freeze( @@ -76,22 +76,22 @@ export const PURCHASEABLE_COMPOSTERS = freeze( ) export const PURCHASEABLE_SMELTERS = freeze( - new Map([[1, { type: 'Basic', price: 500_000 }]]) + new Map([[1, { type: 'Basic', price: 250_000 }]]) ) export const PURCHASEABLE_COW_PENS = freeze( new Map([ - [1, { cows: 10, price: 1500 }], - [2, { cows: 20, price: 2500 }], - [3, { cows: 30, price: 3500 }], + [1, { cows: 10, price: 1_500 }], + [2, { cows: 20, price: 10_000 }], + [3, { cows: 30, price: 50_000 }], ]) ) export const PURCHASEABLE_CELLARS = freeze( new Map([ [1, { space: 10, price: 250_000 }], - [2, { space: 20, price: 400_000 }], - [3, { space: 30, price: 500_000 }], + [2, { space: 20, price: 750_000 }], + [3, { space: 30, price: 2_000_000 }], ]) ) diff --git a/src/game-logic/reducers/purchaseCombine.test.js b/src/game-logic/reducers/purchaseCombine.test.js index 0af94ec2..7d61b8b1 100644 --- a/src/game-logic/reducers/purchaseCombine.test.js +++ b/src/game-logic/reducers/purchaseCombine.test.js @@ -14,7 +14,10 @@ describe('purchaseCombine', () => { }) test('deducts money', () => { - const { money } = purchaseCombine({ money: 500000 }, 1) - expect(money).toEqual(PURCHASEABLE_COMBINES.get(1).price - 500000) + const { money } = purchaseCombine( + { money: (PURCHASEABLE_COMBINES.get(1)?.price ?? 0) + 10 }, + 1 + ) + expect(money).toEqual(10) }) })