feat: implement stat system and StatsView
Introduces a comprehensive stat management system including: - `/stat` command support (set, del, roll) - `StatsView` component for displaying grouped stat tables - Formula evaluation for derived stats (supporting arithmetic and functions) - Stat definition parsing from YAML blocks - Permission checking for stat modification based on roles
This commit is contained in:
@@ -59,6 +59,12 @@ export interface JournalStreamState {
|
||||
brokerUrl: string | null;
|
||||
/** Active player list (keyed by player name) */
|
||||
players: Record<string, { role: string }>;
|
||||
/**
|
||||
* Stat values set via /stat set/del/roll commands.
|
||||
* Key: stat key (e.g. "strength", "alice:hp"). Value: string.
|
||||
* Populated during hydration and live receipt via the stat type's reducer.
|
||||
*/
|
||||
stats: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface SessionMeta {
|
||||
@@ -95,6 +101,7 @@ const [state, setState] = createStore<JournalStreamState>({
|
||||
myRole: (persisted.myRole as "gm" | "player" | "observer") || "gm",
|
||||
brokerUrl: persisted.brokerUrl,
|
||||
players: {},
|
||||
stats: {},
|
||||
});
|
||||
|
||||
// Sync initial URL params if they came from localStorage (not URL)
|
||||
|
||||
Reference in New Issue
Block a user