Add Week 3 polish and late-game features
VC funding system (seed through IPO with requirements gating), 15 achievements with engine checker, model tuning presets and unlockable sliders, overload policy controls, open-source mechanic with reputation boost, enhanced Recharts analytics (subscriber/reputation/revenue vs expenses charts), M&A acquisition system, sidebar NEW badges on era transitions, tutorial hints, and wired-up settings toggles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,8 @@ import {
|
||||
CONSUMER_QUALITY_GROWTH_MULTIPLIER,
|
||||
CONSUMER_BASE_CHURN,
|
||||
API_TOKENS_PER_REQUEST,
|
||||
OPEN_SOURCE_REVENUE_PENALTY,
|
||||
OPEN_SOURCE_TALENT_ATTRACTION,
|
||||
} from '@ai-tycoon/shared';
|
||||
|
||||
export interface MarketTickResult {
|
||||
@@ -84,13 +86,35 @@ export function processMarket(state: GameState, compute: ComputeState): MarketTi
|
||||
consumers.totalSubscribers * 100 +
|
||||
enterprise.activeContracts.reduce((s, c) => s + c.tokensPerTick, 0);
|
||||
|
||||
const openSourceCount = state.market.openSourcedModels.length;
|
||||
if (openSourceCount > 0) {
|
||||
const growthBoost = 1 + openSourceCount * OPEN_SOURCE_TALENT_ATTRACTION;
|
||||
consumers.totalSubscribers *= growthBoost > 1 ? 1 + (growthBoost - 1) * 0.01 : 1;
|
||||
apiRevenue *= 1 - openSourceCount * OPEN_SOURCE_REVENUE_PENALTY * 0.3;
|
||||
}
|
||||
|
||||
const policy = state.market.overloadPolicy;
|
||||
if (policy.degradeQualityUnderLoad && compute.inferenceUtilization > 0.85) {
|
||||
consumers.satisfaction = Math.max(0, consumers.satisfaction - 0.02);
|
||||
}
|
||||
if (policy.prioritizeEnterprise && compute.inferenceUtilization > 0.9) {
|
||||
consumers.satisfaction = Math.max(0, consumers.satisfaction - 0.01);
|
||||
}
|
||||
|
||||
const subscriberHistory = [...(state.market.subscriberHistory || [])];
|
||||
if (state.meta.tickCount % 60 === 0) {
|
||||
subscriberHistory.push({ tick: state.meta.tickCount, subscribers: consumers.totalSubscribers });
|
||||
if (subscriberHistory.length > 500) subscriberHistory.shift();
|
||||
}
|
||||
|
||||
return {
|
||||
marketState: {
|
||||
...state.market,
|
||||
consumers,
|
||||
enterprise,
|
||||
subscriberHistory,
|
||||
},
|
||||
apiRevenue,
|
||||
apiRevenue: Math.max(0, apiRevenue),
|
||||
subscriptionRevenue,
|
||||
totalTokenDemand,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user