import type { SeasonalPhase } from '@ai-tycoon/shared'; import { SEASONAL_CYCLE_TICKS, SEASONAL_MULTIPLIERS } from '@ai-tycoon/shared'; export interface SeasonalResult { phase: SeasonalPhase; multipliers: { consumer: number; api: number; enterprise: number }; } const PHASES: SeasonalPhase[] = ['q1', 'q2', 'q3', 'q4']; export function computeSeasonal(tickCount: number): SeasonalResult { const positionInCycle = tickCount % SEASONAL_CYCLE_TICKS; const quarterLength = SEASONAL_CYCLE_TICKS / 4; const phaseIndex = Math.min(3, Math.floor(positionInCycle / quarterLength)); const phase = PHASES[phaseIndex]; const raw = SEASONAL_MULTIPLIERS[phase]; return { phase, multipliers: { consumer: raw.consumer, api: raw.api, enterprise: raw.enterprise, }, }; }