From a0a0a309c4c26f8c7d3928f75c85ae0a037fa3f2 Mon Sep 17 00:00:00 2001 From: otivm Date: Sun, 3 May 2026 01:16:14 +0000 Subject: [PATCH] prologue: add BACKGROUNDS constant and background_id to INITIAL_STATE --- src/constants.js | 58 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/src/constants.js b/src/constants.js index 16c9be5..5a2f1f9 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,6 +1,6 @@ // OTIVM constants — do not modify H3 IDs, they are permanent // H3 resolution 5 is the canonical waypoint resolution -// All five cities are within TESSERA interaction sphere (15–72N, 15W–75E) +// All five cities are within TESSERA interaction sphere (15°–72°N, 15°W–75°E) export const WAYPOINTS = { ostia: { @@ -43,7 +43,7 @@ export const WAYPOINTS = { id: 'alexandria', name: 'Alexandria', latin: 'Alexandria', - h3_r5: '853f5ba7fffffff', + h3_r5: '853f5ba7fffffff', // matches repo h3_r7: '873f5ba66ffffff', h3_r9: '893f5ba66b3ffff', chapter: 5, @@ -92,7 +92,7 @@ export const ROUTES = [ goods: 'Adriatic grain, Amber', profit: 40, cost: 24, - duration_ms: 13000, + duration_ms: 12000, chapter: 3, unlock_den: 350, unlock_aut: 15, @@ -155,7 +155,56 @@ export const JOURNAL = { ], } +// Six playable backgrounds. Canonical identifiers match background_starting_values +// in the per-player SQLite schema. Summaries are display-only — do not use for +// game logic. Starting den is the liquiditas value_true from background_starting_values. +export const BACKGROUNDS = [ + { + id: 'former_legionary', + name: 'Former Legionary', + latin: 'Miles Emeritus', + summary: 'Disciplined, road-wise, commercially raw. Modest savings. Known but not distinguished.', + starting_den: 200, + }, + { + id: 'freedman_trader', + name: 'Freedman Trader', + latin: 'Libertus Mercator', + summary: 'Active commercial network, strong negotiation. Best working capital. Limited legal standing.', + starting_den: 350, + }, + { + id: 'noble_younger_son', + name: 'Noble Younger Son', + latin: 'Filius Minor', + summary: 'High auctoritas, inherited clientela. Constrained funds. Poor market and route knowledge.', + starting_den: 150, + }, + { + id: 'failed_magistrate', + name: 'Failed Magistrate', + latin: 'Magistratus Lapsus', + summary: 'Legal contacts, formal standing intact. Depleted funds. True auctoritas lower than perceived.', + starting_den: 100, + }, + { + id: 'camp_logistician', + name: 'Camp Logistician', + latin: 'Optio Annonae', + summary: 'Expert in bulk goods and logistics pricing. Steady savings. Narrow social network.', + starting_den: 180, + }, + { + id: 'guild_scribe', + name: 'Guild Scribe', + latin: 'Scriba Collegii', + summary: 'Document and account knowledge. Careful with money. Low risk tolerance, low negotiation.', + starting_den: 120, + }, +] + export const INITIAL_STATE = { + background_id: null, // null until player selects a background on the Prologue tab den: 50, aut: 0, dispatches: 0, @@ -174,6 +223,7 @@ export const INITIAL_STATE = { created_at: null, } -export const OTIUM_DURATION_MS = 8000 +export const MS_PER_SIM_DAY = 3_000 +export const OTIUM_DURATION_MS = 9000 export const OTIUM_BASE_AUT = 1 export const MAX_CONCURRENT_PLAYERS = 128