Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#505): Re-balance upgrade costs #514

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
})
})
Loading