Skip to content

Commit

Permalink
feat(balance): [closes #505] re-balance upgrade costs (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn authored Sep 7, 2024
1 parent e53a6e2 commit 28bec13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }],
])
)

Expand All @@ -68,30 +68,30 @@ 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(
new Map([[1, { type: 'Basic', price: 1_000 }]])
)

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 }],
])
)

Expand Down
7 changes: 5 additions & 2 deletions src/game-logic/reducers/purchaseCombine.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})

0 comments on commit 28bec13

Please sign in to comment.