Compare commits

..

No commits in common. "c11a2dde948c41abd2df3bfc6675ebf765c0bb97" and "23c312299c3b612e225f4c09d4505480b0efd9f8" have entirely different histories.

4 changed files with 3 additions and 121 deletions

View file

@ -148,13 +148,6 @@ const TempleComponent: React.FC = () => {
return false return false
} }
if (
upgrade.id === 'aqua_diffundere_2' &&
!purchasedUpgrades.includes('aqua_diffundere_1')
) {
return false
}
return true return true
} }
@ -168,12 +161,6 @@ const TempleComponent: React.FC = () => {
) { ) {
return 'Requires Aqueous Vigor I' return 'Requires Aqueous Vigor I'
} }
if (
upgrade.id === 'aqua_diffundere_2' &&
!purchasedUpgrades.includes('aqua_diffundere_1')
) {
return 'Requires Aqua Diffundere I'
}
if (!canAffordUpgrade(upgrade.cost)) { if (!canAffordUpgrade(upgrade.cost)) {
return 'Cannot Afford' return 'Cannot Afford'
} }

View file

@ -22,7 +22,6 @@ export const CROPS: CropDefinitions = {
yield: 1, yield: 1,
yieldType: 'celery', yieldType: 'celery',
fertilityDepletion: 0.1, fertilityDepletion: 0.1,
seedType: 'celery_seed',
}, },
corn: { corn: {
id: 'corn', id: 'corn',
@ -32,19 +31,6 @@ export const CROPS: CropDefinitions = {
yield: 5, yield: 5,
yieldType: 'corn', yieldType: 'corn',
fertilityDepletion: 0.3, fertilityDepletion: 0.3,
seedType: 'corn_seed',
},
olive: {
id: 'olive',
name: 'Olive Tree',
growthTicks: 200,
waterPerTick: 1 / 50,
yield: 5,
yieldType: 'olive',
fertilityDepletion: 0.1,
seedType: 'olive', // Uses olives as seeds
isPerennial: true,
regrowthProgress: 150, // Resets to 150 ticks after harvest
}, },
} }
@ -76,36 +62,6 @@ export const UPGRADES: Record<string, Upgrade> = {
}, },
], ],
}, },
aqua_diffundere_1: {
id: 'aqua_diffundere_1',
name: 'Aqua Diffundere I',
description: 'Watering a plot also increases water level of adjacent plots by 10%',
cost: [
{
itemId: 'celery',
amount: 10,
},
{
itemId: 'corn',
amount: 15,
},
],
},
aqua_diffundere_2: {
id: 'aqua_diffundere_2',
name: 'Aqua Diffundere II',
description: 'Watering a plot also increases water level of adjacent plots by 30% (requires Aqua Diffundere I)',
cost: [
{
itemId: 'corn',
amount: 100,
},
{
itemId: 'celery',
amount: 25,
},
],
},
} }
export interface MarketItem { export interface MarketItem {
@ -145,18 +101,5 @@ export const MARKET_ITEMS: Record<string, MarketItem> = {
buyPrice: null, buyPrice: null,
sellPrice: 5, sellPrice: 5,
}, },
corn: { corn: { id: 'corn', name: 'Corn', emoji: '🌽', buyPrice: null, sellPrice: 8 },
id: 'corn',
name: 'Corn',
emoji: '🌽',
buyPrice: null,
sellPrice: 8,
},
olive: {
id: 'olive',
name: 'Olive',
emoji: '🫒',
buyPrice: 15,
sellPrice: null,
},
} }

View file

@ -144,8 +144,7 @@ export const useGameStore = create<
const plot = plots[row][col] const plot = plots[row][col]
if (plot.intended && !plot.current) { if (plot.intended && !plot.current) {
const crop = CROPS[plot.intended] const seedId = `${plot.intended}_seed`
const seedId = crop.seedType
if (inventory[seedId] && inventory[seedId] > 0) { if (inventory[seedId] && inventory[seedId] > 0) {
set( set(
@ -188,39 +187,6 @@ export const useGameStore = create<
produce((state) => { produce((state) => {
state.plots[row][col].moisture = 1 state.plots[row][col].moisture = 1
state.actionCooldown = finalCooldown state.actionCooldown = finalCooldown
// Handle water diffusion to adjacent plots
const diffusionAmount = purchasedUpgrades.includes('aqua_diffundere_2')
? 0.3
: purchasedUpgrades.includes('aqua_diffundere_1')
? 0.1
: 0
if (diffusionAmount > 0) {
// Check and water adjacent plots (up, right, down, left)
const adjacentPositions = [
[row - 1, col], // up
[row, col + 1], // right
[row + 1, col], // down
[row, col - 1], // left
]
adjacentPositions.forEach(([adjRow, adjCol]) => {
// Check if the adjacent position is within bounds
if (
adjRow >= 0 &&
adjRow < state.plots.length &&
adjCol >= 0 &&
adjCol < state.plots[0].length
) {
const adjPlot = state.plots[adjRow][adjCol]
state.plots[adjRow][adjCol].moisture = Math.min(
1,
adjPlot.moisture + diffusionAmount
)
}
})
}
}), }),
) )
} }
@ -241,18 +207,7 @@ export const useGameStore = create<
set( set(
produce((state) => { produce((state) => {
if (crop.isPerennial) {
// For perennial crops, reset progress instead of clearing
state.plots[row][col].current = {
cropId: plot.current!.cropId,
progress: crop.regrowthProgress!,
mature: false,
}
} else {
// For regular crops, clear the plot
state.plots[row][col].current = undefined state.plots[row][col].current = undefined
}
state.inventory[yieldItem] = state.inventory[yieldItem] =
(state.inventory[yieldItem] || 0) + yieldAmount (state.inventory[yieldItem] || 0) + yieldAmount
state.plots[row][col].fertility = Math.max( state.plots[row][col].fertility = Math.max(

View file

@ -6,9 +6,6 @@ export interface Crop {
yield: number yield: number
yieldType: string yieldType: string
fertilityDepletion: number fertilityDepletion: number
seedType: string
isPerennial?: boolean
regrowthProgress?: number
} }
export interface CropDefinitions { export interface CropDefinitions {