Files
AIHostingTycoon/packages/game-engine/src/systems/market/seasonalSystem.ts
T
josh 09a5cb69a7
CI / build-and-push (push) Successful in 42s
Overhaul market system with shared TAM competition, multi-tier pricing, enterprise pipeline, and developer ecosystem
Replaces the simplified single-subscriber market with a full competitive simulation:
shared TAM with softmax market shares across 4 segments, multi-tier consumer
subscriptions (Free/Plus/Pro/Team) and API tiers (Free/PAYG/Scale/Enterprise),
enterprise sales pipeline (Lead→Qualification→POC→Negotiation→Active→Renewal)
with SLA tracking, developer ecosystem flywheel, technology obsolescence pressure,
seasonal demand cycles, and two new product lines (Code Assistant, AI Agents Platform).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 08:30:24 -04:00

26 lines
803 B
TypeScript

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,
},
};
}