diff --git a/src/payload-types.ts b/src/payload-types.ts index dc0d640..8af1c96 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -104,6 +104,9 @@ export interface Config { loadouts: Loadout; 'market-listings': MarketListing; 'market-negotiations': MarketNegotiation; + 'market-state': MarketState; + 'voice-scripts': VoiceScript; + 'voice-submissions': VoiceSubmission; tickets: Ticket; 'ticket-votes': TicketVote; 'wiki-pages': WikiPage; @@ -172,6 +175,9 @@ export interface Config { loadouts: LoadoutsSelect | LoadoutsSelect; 'market-listings': MarketListingsSelect | MarketListingsSelect; 'market-negotiations': MarketNegotiationsSelect | MarketNegotiationsSelect; + 'market-state': MarketStateSelect | MarketStateSelect; + 'voice-scripts': VoiceScriptsSelect | VoiceScriptsSelect; + 'voice-submissions': VoiceSubmissionsSelect | VoiceSubmissionsSelect; tickets: TicketsSelect | TicketsSelect; 'ticket-votes': TicketVotesSelect | TicketVotesSelect; 'wiki-pages': WikiPagesSelect | WikiPagesSelect; @@ -703,6 +709,27 @@ export interface Resource { */ tradeable?: boolean | null; rarity: 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary' | 'exotic' | 'unique'; + /** + * Baseline world supply and demand used by the market economy simulation (economy tick). + */ + economy?: { + /** + * Whether the economy simulation tracks this resource. Disabled items keep their resting price. + */ + enabled?: boolean | null; + /** + * GM-set resting world supply. Used as the starting point of this resource's market-state ledger. + */ + baselineSupply?: number | null; + /** + * GM-set resting demand (NPC faction pressure). Used as the starting point of this resource's market-state ledger. + */ + baselineDemand?: number | null; + /** + * Price band, as a fraction of the base value (e.g. 0.5 = price can move ±50%). Leave empty to use the global default band from Game Rules. + */ + maxModifier?: number | null; + }; /** * The unit of measure for this resource in singular form (no plurals, e.g., liter, kg, point, unit, megawatt, person, etc.) */ @@ -910,6 +937,27 @@ export interface Asset { baseSellPrice?: number | null; }; }; + /** + * Baseline world supply and demand used by the market economy simulation (economy tick). + */ + economy?: { + /** + * Whether the economy simulation tracks this asset. Disabled items keep their resting price. + */ + enabled?: boolean | null; + /** + * GM-set resting world supply. Used as the starting point of this asset's market-state ledger. + */ + baselineSupply?: number | null; + /** + * GM-set resting demand (NPC faction pressure). Used as the starting point of this asset's market-state ledger. + */ + baselineDemand?: number | null; + /** + * Price band, as a fraction of the base price (e.g. 0.5 = price can move ±50%). Leave empty to use the global default band from Game Rules. + */ + maxModifier?: number | null; + }; crafting: { craftable?: boolean | null; /** @@ -1528,6 +1576,11 @@ export interface Role { | 'market-negotiations:update' | 'market-negotiations:delete' | 'admin:market-negotiations:manage' + | 'market-state:create' + | 'market-state:read' + | 'market-state:update' + | 'market-state:delete' + | 'admin:market-state:manage' | 'projects:create' | 'projects:read' | 'projects:update' @@ -1819,6 +1872,7 @@ export interface GameEventLog { | 'loadouts' | 'market-listings' | 'market-negotiations' + | 'market-state' | 'evaluations' | 'tickets' | 'wiki-pages' @@ -1826,6 +1880,8 @@ export interface GameEventLog { | 'wiki-templates' | 'game-servers' | 'assignment-transfers' + | 'voice-scripts' + | 'voice-submissions' ) | null; targetId?: number | null; @@ -1976,6 +2032,9 @@ export interface Profile { xpEarned?: number | null; }; }; + voiceover?: { + xpEarned?: number | null; + }; }; updatedAt: string; createdAt: string; @@ -2975,6 +3034,103 @@ export interface MarketNegotiation { updatedAt: string; createdAt: string; } +/** + * Supply/demand ledger per item, maintained by the economy tick. Baselines are copied from the item's Supply & Demand fields on first creation. + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "market-state". + */ +export interface MarketState { + id: number; + /** + * Which collection this ledger entry tracks. + */ + itemType: 'resource' | 'asset'; + /** + * ID of the tracked resource or asset document. + */ + itemId: number; + /** + * GM-set resting supply. Copied from the item's Supply & Demand baseline when this entry is first created. + */ + gmBaselineSupply: number; + /** + * GM-set resting demand. Copied from the item's Supply & Demand baseline when this entry is first created. + */ + gmBaselineDemand: number; + /** + * Living abstract supply. Decremented by unit purchases from NPC listings, incremented by production/sales (later phases). + */ + currentSupply: number; + /** + * NPC faction demand pressure. Slow-drifting random walk bounded around the GM baseline, updated per economy tick. + */ + artificialDemand: number; + /** + * Decaying rolling aggregate of completed unit purchases (quantity-weighted). Decayed each tick by the Game Rules decay factor. + */ + realDemand: number; + /** + * Computed price multiplier applied to the item's base price when generating NEW NPC listings only (1 = resting price). Existing listings and open negotiations are never repriced. + */ + priceModifier: number; + /** + * When the economy tick last recomputed this entry. + */ + lastComputedAt?: string | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "voice-scripts". + */ +export interface VoiceScript { + id: number; + title: string; + /** + * Voice talent reads this verbatim. Inline emotion tags like [calm] are stored as written. + */ + script: string; + /** + * XP awarded per accepted submission of this script. + */ + xpAmount: number; + /** + * Closed scripts reject new submissions + */ + status: 'open' | 'closed'; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "voice-submissions". + */ +export interface VoiceSubmission { + id: number; + script: number | VoiceScript; + /** + * Submitter + */ + user: number | User; + status: 'pending' | 'accepted' | 'rejected'; + /** + * Optional admin review note. + */ + reviewNote?: string | null; + updatedAt: string; + createdAt: string; + url?: string | null; + thumbnailURL?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; + focalX?: number | null; + focalY?: number | null; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "tickets". @@ -3665,6 +3821,18 @@ export interface PayloadLockedDocument { relationTo: 'market-negotiations'; value: number | MarketNegotiation; } | null) + | ({ + relationTo: 'market-state'; + value: number | MarketState; + } | null) + | ({ + relationTo: 'voice-scripts'; + value: number | VoiceScript; + } | null) + | ({ + relationTo: 'voice-submissions'; + value: number | VoiceSubmission; + } | null) | ({ relationTo: 'tickets'; value: number | Ticket; @@ -4156,6 +4324,11 @@ export interface ProfilesSelect { xpEarned?: T; }; }; + voiceover?: + | T + | { + xpEarned?: T; + }; }; updatedAt?: T; createdAt?: T; @@ -4560,6 +4733,14 @@ export interface AssetsSelect { baseSellPrice?: T; }; }; + economy?: + | T + | { + enabled?: T; + baselineSupply?: T; + baselineDemand?: T; + maxModifier?: T; + }; crafting?: | T | { @@ -4621,6 +4802,14 @@ export interface ResourcesSelect { baseValue?: T; tradeable?: T; rarity?: T; + economy?: + | T + | { + enabled?: T; + baselineSupply?: T; + baselineDemand?: T; + maxModifier?: T; + }; unitOfMeasure?: T; massPerUnit?: T; stackSize?: T; @@ -4990,6 +5179,56 @@ export interface MarketNegotiationsSelect { updatedAt?: T; createdAt?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "market-state_select". + */ +export interface MarketStateSelect { + itemType?: T; + itemId?: T; + gmBaselineSupply?: T; + gmBaselineDemand?: T; + currentSupply?: T; + artificialDemand?: T; + realDemand?: T; + priceModifier?: T; + lastComputedAt?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "voice-scripts_select". + */ +export interface VoiceScriptsSelect { + title?: T; + script?: T; + xpAmount?: T; + status?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "voice-submissions_select". + */ +export interface VoiceSubmissionsSelect { + script?: T; + user?: T; + status?: T; + reviewNote?: T; + updatedAt?: T; + createdAt?: T; + url?: T; + thumbnailURL?: T; + filename?: T; + mimeType?: T; + filesize?: T; + width?: T; + height?: T; + focalX?: T; + focalY?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "tickets_select". @@ -5396,6 +5635,39 @@ export interface GameRule { * Message shown to logistics officers when hiring is disabled, e.g. explaining the in-universe reason. */ staffHiringDisabledMessage?: string | null; + /** + * Global knobs for the supply-and-demand market simulation run by the economy tick (docs/economy/supply-demand-design.md). + */ + economy?: { + /** + * Master gate for the market economy simulation. When off, the economy tick leaves all prices at their resting values. + */ + enabled?: boolean | null; + /** + * Default price band as a fraction of base price (e.g. 0.5 = price can move ±50%). Used when an item does not set its own band. + */ + defaultPriceBand?: number | null; + /** + * How many economy ticks of completed-purchase history feed the real-demand signal. + */ + realDemandWindowTicks?: number | null; + /** + * Fraction of accumulated real demand that survives each tick (0.5 halves it every tick). + */ + realDemandDecay?: number | null; + /** + * How far the NPC (artificial) demand random walk may move per tick, as a fraction of the GM baseline. + */ + artificialDemandDrift?: number | null; + /** + * Completed purchases needed before an item's price starts moving. Until then items stay at their resting price (modifier 1). + */ + coldStartObservations?: number | null; + /** + * Suggested economy tick cadence in minutes, for cron documentation only — the tick itself is triggered externally. + */ + tickIntervalHintMinutes?: number | null; + }; updatedAt?: string | null; createdAt?: string | null; } @@ -5477,6 +5749,17 @@ export interface GameRulesSelect { lockerGridHeight?: T; staffHiringEnabled?: T; staffHiringDisabledMessage?: T; + economy?: + | T + | { + enabled?: T; + defaultPriceBand?: T; + realDemandWindowTicks?: T; + realDemandDecay?: T; + artificialDemandDrift?: T; + coldStartObservations?: T; + tickIntervalHintMinutes?: T; + }; updatedAt?: T; createdAt?: T; globalType?: T;