DionysianIdle/src/constants/index.ts
2025-05-26 20:41:32 -05:00

225 lines
4.5 KiB
TypeScript

import { CropDefinitions, Upgrade, Equipment } from '../types'
export const INITIAL_CASH = 50
export const INITIAL_FIELD_SIZE = 3
export const COOLDOWN_DURATION = 2000 // 2 seconds in milliseconds
export const TICK_INTERVAL = 12000 // 12 seconds in milliseconds
export const GAME_SPEEDS = {
NORMAL: 1,
FAST: 5,
SUPER_FAST: 10,
}
export const INITIAL_GAME_SPEED = GAME_SPEEDS.NORMAL
export const FIELD_UPGRADE_COSTS = [100, 1000, 10000, 100000]
export const CROPS: CropDefinitions = {
celery: {
id: 'celery',
name: 'Celery',
growthTicks: 36,
waterPerTick: 1 / 20,
yield: 1,
yieldType: 'celery',
fertilityDepletion: 0.1,
seedType: 'celery_seed',
},
corn: {
id: 'corn',
name: 'Corn',
growthTicks: 120,
waterPerTick: 1 / 40,
yield: 5,
yieldType: 'corn',
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
},
}
export const INITIAL_INVENTORY = {
celery_seed: 8,
}
export const UPGRADES: Record<string, Upgrade> = {
aqueous_vigor_1: {
id: 'aqueous_vigor_1',
name: 'Aqueous Vigor I',
description: 'Reduces watering cooldown by 25%',
cost: [
{
itemId: 'celery',
amount: 10,
},
],
},
aqueous_vigor_2: {
id: 'aqueous_vigor_2',
name: 'Aqueous Vigor II',
description:
'Reduces watering cooldown by an additional 25% (requires Aqueous Vigor I)',
cost: [
{
itemId: 'celery',
amount: 25,
},
],
},
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 Item {
id: string
name: string
emoji: string
buyPrice: number | null // null means not buyable
sellPrice: number | null // null means not sellable
}
export const EQUIPMENT: Record<string, Equipment> = {
press: {
id: 'press',
type: 'press',
name: 'Press',
emoji: '🛢️',
cost: 100,
recipes: [
{
id: 'olive_oil',
name: 'Olive Oil',
inputItem: 'olive',
inputAmount: 10,
outputItem: 'olive_oil',
outputAmount: 1,
processTicks: 10,
cooldownDuration: 10000, // 10 seconds
},
{
id: 'grape_juice',
name: 'Grape Juice',
inputItem: 'grape',
inputAmount: 20,
outputItem: 'grape_juice',
outputAmount: 1,
processTicks: 20,
cooldownDuration: 15000, // 15 seconds
},
],
progress: 0,
isProcessing: false,
},
}
export const ITEMS: Record<string, Item> = {
additional_land: {
id: 'additional_land',
name: 'Additional Land',
emoji: '🌱',
buyPrice: 100,
sellPrice: null,
},
celery_seed: {
id: 'celery_seed',
name: 'Celery Seeds',
emoji: '🌰',
buyPrice: 1,
sellPrice: null,
},
corn_seed: {
id: 'corn_seed',
name: 'Corn Seeds',
emoji: '🌰',
buyPrice: 5,
sellPrice: null,
},
celery: {
id: 'celery',
name: 'Celery',
emoji: '🥬',
buyPrice: null,
sellPrice: 5,
},
corn: {
id: 'corn',
name: 'Corn',
emoji: '🌽',
buyPrice: null,
sellPrice: 8,
},
olive: {
id: 'olive',
name: 'Olive',
emoji: '🫒',
buyPrice: 15,
sellPrice: null,
},
olive_oil: {
id: 'olive_oil',
name: 'Olive Oil',
emoji: '🫒',
buyPrice: null,
sellPrice: 50,
},
grape: {
id: 'grape',
name: 'Grape',
emoji: '🍇',
buyPrice: null,
sellPrice: 20,
},
grape_juice: {
id: 'grape_juice',
name: 'Grape Juice',
emoji: '🍇juice',
buyPrice: null,
sellPrice: 100,
},
wine: {
id: 'wine',
name: 'Wine',
emoji: '🍷',
buyPrice: null,
sellPrice: 100,
},
}