@thijshakkenberg/valkyrie-mom-mcp 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +2 -2
- package/.mcp.json +1 -1
- package/README.md +32 -12
- package/agents/scenario-designer.md +5 -3
- package/dist/catalogs/catalog-store.d.ts +10 -0
- package/dist/catalogs/catalog-store.d.ts.map +1 -1
- package/dist/catalogs/catalog-store.js +33 -2
- package/dist/catalogs/catalog-store.js.map +1 -1
- package/dist/catalogs/data/tile-geometry.d.ts +17 -6
- package/dist/catalogs/data/tile-geometry.d.ts.map +1 -1
- package/dist/catalogs/data/tile-geometry.js +183 -180
- package/dist/catalogs/data/tile-geometry.js.map +1 -1
- package/dist/diagnostics/bug-report-builder.d.ts +5 -0
- package/dist/diagnostics/bug-report-builder.d.ts.map +1 -0
- package/dist/diagnostics/bug-report-builder.js +112 -0
- package/dist/diagnostics/bug-report-builder.js.map +1 -0
- package/dist/diagnostics/ring-buffer.d.ts +16 -0
- package/dist/diagnostics/ring-buffer.d.ts.map +1 -0
- package/dist/diagnostics/ring-buffer.js +41 -0
- package/dist/diagnostics/ring-buffer.js.map +1 -0
- package/dist/diagnostics/session-trace.d.ts +19 -0
- package/dist/diagnostics/session-trace.d.ts.map +1 -0
- package/dist/diagnostics/session-trace.js +40 -0
- package/dist/diagnostics/session-trace.js.map +1 -0
- package/dist/diagnostics/tool-interceptor.d.ts +11 -0
- package/dist/diagnostics/tool-interceptor.d.ts.map +1 -0
- package/dist/diagnostics/tool-interceptor.js +73 -0
- package/dist/diagnostics/tool-interceptor.js.map +1 -0
- package/dist/diagnostics/types.d.ts +51 -0
- package/dist/diagnostics/types.d.ts.map +1 -0
- package/dist/diagnostics/types.js +2 -0
- package/dist/diagnostics/types.js.map +1 -0
- package/dist/diagnostics/valkyrie-log-finder.d.ts +12 -0
- package/dist/diagnostics/valkyrie-log-finder.d.ts.map +1 -0
- package/dist/diagnostics/valkyrie-log-finder.js +46 -0
- package/dist/diagnostics/valkyrie-log-finder.js.map +1 -0
- package/dist/io/image.d.ts +15 -0
- package/dist/io/image.d.ts.map +1 -0
- package/dist/io/image.js +179 -0
- package/dist/io/image.js.map +1 -0
- package/dist/io/localization-io.d.ts +9 -5
- package/dist/io/localization-io.d.ts.map +1 -1
- package/dist/io/localization-io.js +61 -20
- package/dist/io/localization-io.js.map +1 -1
- package/dist/io/package-builder.d.ts.map +1 -1
- package/dist/io/package-builder.js +7 -3
- package/dist/io/package-builder.js.map +1 -1
- package/dist/map/layout.d.ts +91 -0
- package/dist/map/layout.d.ts.map +1 -0
- package/dist/map/layout.js +253 -0
- package/dist/map/layout.js.map +1 -0
- package/dist/map/render.d.ts +15 -0
- package/dist/map/render.d.ts.map +1 -0
- package/dist/map/render.js +191 -0
- package/dist/map/render.js.map +1 -0
- package/dist/model/component-types.d.ts +19 -1
- package/dist/model/component-types.d.ts.map +1 -1
- package/dist/model/component-types.js +33 -1
- package/dist/model/component-types.js.map +1 -1
- package/dist/model/field-schema.d.ts +20 -0
- package/dist/model/field-schema.d.ts.map +1 -0
- package/dist/model/field-schema.js +61 -0
- package/dist/model/field-schema.js.map +1 -0
- package/dist/model/format-features.d.ts +20 -0
- package/dist/model/format-features.d.ts.map +1 -0
- package/dist/model/format-features.js +46 -0
- package/dist/model/format-features.js.map +1 -0
- package/dist/model/scenario-model.d.ts.map +1 -1
- package/dist/model/scenario-model.js +16 -0
- package/dist/model/scenario-model.js.map +1 -1
- package/dist/resources/format-docs.d.ts +3 -3
- package/dist/resources/format-docs.d.ts.map +1 -1
- package/dist/resources/format-docs.js +108 -34
- package/dist/resources/format-docs.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +100 -16
- package/dist/server.js.map +1 -1
- package/dist/tools/lifecycle.d.ts +16 -0
- package/dist/tools/lifecycle.d.ts.map +1 -1
- package/dist/tools/lifecycle.js +76 -11
- package/dist/tools/lifecycle.js.map +1 -1
- package/dist/tools/map.d.ts +11 -7
- package/dist/tools/map.d.ts.map +1 -1
- package/dist/tools/map.js +92 -52
- package/dist/tools/map.js.map +1 -1
- package/dist/tools/upsert.d.ts +3 -0
- package/dist/tools/upsert.d.ts.map +1 -1
- package/dist/tools/upsert.js +214 -5
- package/dist/tools/upsert.js.map +1 -1
- package/dist/validation/rules/catalog-references.d.ts +1 -0
- package/dist/validation/rules/catalog-references.d.ts.map +1 -1
- package/dist/validation/rules/catalog-references.js +51 -9
- package/dist/validation/rules/catalog-references.js.map +1 -1
- package/dist/validation/rules/cross-references.d.ts +1 -0
- package/dist/validation/rules/cross-references.d.ts.map +1 -1
- package/dist/validation/rules/cross-references.js +32 -1
- package/dist/validation/rules/cross-references.js.map +1 -1
- package/dist/validation/rules/custom-images.d.ts +10 -0
- package/dist/validation/rules/custom-images.d.ts.map +1 -0
- package/dist/validation/rules/custom-images.js +46 -0
- package/dist/validation/rules/custom-images.js.map +1 -0
- package/dist/validation/rules/event-flow.d.ts +5 -7
- package/dist/validation/rules/event-flow.d.ts.map +1 -1
- package/dist/validation/rules/event-flow.js +49 -70
- package/dist/validation/rules/event-flow.js.map +1 -1
- package/dist/validation/rules/event-graph.d.ts.map +1 -1
- package/dist/validation/rules/event-graph.js +4 -1
- package/dist/validation/rules/event-graph.js.map +1 -1
- package/dist/validation/rules/event-semantics.d.ts +18 -0
- package/dist/validation/rules/event-semantics.d.ts.map +1 -0
- package/dist/validation/rules/event-semantics.js +72 -0
- package/dist/validation/rules/event-semantics.js.map +1 -0
- package/dist/validation/rules/field-schema.d.ts +10 -0
- package/dist/validation/rules/field-schema.d.ts.map +1 -0
- package/dist/validation/rules/field-schema.js +47 -0
- package/dist/validation/rules/field-schema.js.map +1 -0
- package/dist/validation/rules/format-rules.d.ts +2 -1
- package/dist/validation/rules/format-rules.d.ts.map +1 -1
- package/dist/validation/rules/format-rules.js +36 -3
- package/dist/validation/rules/format-rules.js.map +1 -1
- package/dist/validation/rules/game-flow.d.ts +29 -0
- package/dist/validation/rules/game-flow.d.ts.map +1 -0
- package/dist/validation/rules/game-flow.js +201 -0
- package/dist/validation/rules/game-flow.js.map +1 -0
- package/dist/validation/rules/localization-completeness.d.ts.map +1 -1
- package/dist/validation/rules/localization-completeness.js +15 -0
- package/dist/validation/rules/localization-completeness.js.map +1 -1
- package/dist/validation/rules/mythos-structure.d.ts +1 -1
- package/dist/validation/rules/mythos-structure.js +4 -4
- package/dist/validation/rules/mythos-structure.js.map +1 -1
- package/dist/validation/rules/required-fields.d.ts +1 -1
- package/dist/validation/rules/required-fields.js +3 -3
- package/dist/validation/rules/required-fields.js.map +1 -1
- package/dist/validation/rules/tile-connectivity.d.ts +10 -3
- package/dist/validation/rules/tile-connectivity.d.ts.map +1 -1
- package/dist/validation/rules/tile-connectivity.js +66 -108
- package/dist/validation/rules/tile-connectivity.js.map +1 -1
- package/dist/validation/rules/token-event-wiring.d.ts +9 -0
- package/dist/validation/rules/token-event-wiring.d.ts.map +1 -0
- package/dist/validation/rules/token-event-wiring.js +29 -0
- package/dist/validation/rules/token-event-wiring.js.map +1 -0
- package/dist/validation/rules/triggers.d.ts +15 -0
- package/dist/validation/rules/triggers.d.ts.map +1 -0
- package/dist/validation/rules/triggers.js +62 -0
- package/dist/validation/rules/triggers.js.map +1 -0
- package/dist/validation/validator.d.ts.map +1 -1
- package/dist/validation/validator.js +14 -1
- package/dist/validation/validator.js.map +1 -1
- package/package.json +1 -1
- package/skills/custom-monsters/SKILL.md +98 -149
- package/skills/event-patterns/SKILL.md +47 -40
- package/skills/items-and-distribution/SKILL.md +15 -5
- package/skills/scenario/SKILL.md +7 -4
- package/skills/tile-placement/SKILL.md +77 -16
- package/skills/ui-and-puzzles/SKILL.md +17 -25
- package/skills/variables-and-mythos/SKILL.md +50 -56
- package/src/catalogs/catalog-store.ts +36 -2
- package/src/catalogs/data/tile-geometry.ts +198 -182
- package/src/diagnostics/bug-report-builder.ts +142 -0
- package/src/diagnostics/ring-buffer.ts +44 -0
- package/src/diagnostics/session-trace.ts +51 -0
- package/src/diagnostics/tool-interceptor.ts +74 -0
- package/src/diagnostics/types.ts +53 -0
- package/src/diagnostics/valkyrie-log-finder.ts +47 -0
- package/src/io/image.ts +173 -0
- package/src/io/localization-io.ts +60 -22
- package/src/io/package-builder.ts +6 -3
- package/src/map/layout.ts +308 -0
- package/src/map/render.ts +202 -0
- package/src/model/component-types.ts +38 -1
- package/src/model/field-schema.ts +65 -0
- package/src/model/format-features.ts +49 -0
- package/src/model/scenario-model.ts +13 -0
- package/src/resources/format-docs.ts +108 -34
- package/src/server.ts +128 -16
- package/src/tools/lifecycle.ts +85 -12
- package/src/tools/map.ts +104 -63
- package/src/tools/upsert.ts +243 -5
- package/src/validation/rules/catalog-references.ts +51 -8
- package/src/validation/rules/cross-references.ts +31 -1
- package/src/validation/rules/custom-images.ts +48 -0
- package/src/validation/rules/event-flow.ts +45 -75
- package/src/validation/rules/event-graph.ts +4 -1
- package/src/validation/rules/event-semantics.ts +79 -0
- package/src/validation/rules/field-schema.ts +54 -0
- package/src/validation/rules/format-rules.ts +37 -3
- package/src/validation/rules/game-flow.ts +198 -0
- package/src/validation/rules/localization-completeness.ts +16 -0
- package/src/validation/rules/mythos-structure.ts +4 -4
- package/src/validation/rules/required-fields.ts +3 -3
- package/src/validation/rules/tile-connectivity.ts +63 -126
- package/src/validation/rules/token-event-wiring.ts +33 -0
- package/src/validation/rules/triggers.ts +68 -0
- package/src/validation/validator.ts +14 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valkyrie-mom",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "AI-assisted Mansions of Madness scenario editor for Valkyrie",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Thijs Hakkenberg"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"mcpServers": {
|
|
11
11
|
"valkyrie-mom": {
|
|
12
12
|
"command": "npx",
|
|
13
|
-
"args": ["-y", "@thijshakkenberg/valkyrie-mom-mcp"]
|
|
13
|
+
"args": ["-y", "@thijshakkenberg/valkyrie-mom-mcp@latest"]
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|
package/.mcp.json
CHANGED
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ claude plugin install valkyrie-mom
|
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
This gives you:
|
|
23
|
-
- **MCP server** with
|
|
23
|
+
- **MCP server** with 25 tools for scenario editing (auto-started)
|
|
24
24
|
- **7 skills**: `/scenario`, `/event-patterns`, `/tile-placement`, `/variables-and-mythos`, `/custom-monsters`, `/ui-and-puzzles`, `/items-and-distribution`
|
|
25
25
|
- **Scenario designer agent** for autonomous scenario creation
|
|
26
26
|
- **5 MCP resources** for format documentation
|
|
@@ -85,6 +85,7 @@ npx tsx src/index.ts # Run MCP server via stdio
|
|
|
85
85
|
| `get_scenario_state` | Get current scenario component/localization summary |
|
|
86
86
|
| `validate_scenario` | Run all validation rules |
|
|
87
87
|
| `build_scenario` | Save and build `.valkyrie` package |
|
|
88
|
+
| `set_quest_config` | Set difficulty, play time, investigator count, cover image |
|
|
88
89
|
|
|
89
90
|
### Components
|
|
90
91
|
| Tool | Description |
|
|
@@ -96,21 +97,30 @@ npx tsx src/index.ts # Run MCP server via stdio
|
|
|
96
97
|
| `upsert_item` | Create or update an item |
|
|
97
98
|
| `upsert_puzzle` | Create or update a puzzle |
|
|
98
99
|
| `upsert_ui` | Create or update a UI element |
|
|
100
|
+
| `upsert_custom_monster` | Create or update a custom monster |
|
|
101
|
+
| `upsert_mplace` | Create or update a monster placement |
|
|
102
|
+
| `upsert_activation` | Create or update a custom monster activation |
|
|
99
103
|
| `delete_component` | Delete a component with cascade reference cleanup |
|
|
100
104
|
| `set_localization` | Set localization key-value pairs |
|
|
101
105
|
|
|
102
106
|
### Map
|
|
103
107
|
| Tool | Description |
|
|
104
108
|
|------|-------------|
|
|
105
|
-
| `get_map_ascii` |
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
109
|
+
| `get_map_ascii` | Describe the board: tile areas, doors and where they lead (with explore-token spots), tokens and their tile, ASCII sketch |
|
|
110
|
+
| `render_map` | Render the board as a PNG with the real tile artwork (from Valkyrie's imported data) or a schematic, tokens numbered |
|
|
111
|
+
| `suggest_tile_layout` | Suggest coordinates for large (7x7) tiles in linear, L-shape, or hub-spoke layouts |
|
|
112
|
+
| `place_tile_relative` | Position and rotation for a new tile against an existing one, with a door lined up |
|
|
108
113
|
|
|
109
114
|
### Reference
|
|
110
115
|
| Tool | Description |
|
|
111
116
|
|------|-------------|
|
|
112
117
|
| `search_game_content` | Search game content catalogs (846 entries across tiles, monsters, items, audio) |
|
|
113
118
|
|
|
119
|
+
### Diagnostics
|
|
120
|
+
| Tool | Description |
|
|
121
|
+
|------|-------------|
|
|
122
|
+
| `export_bug_report` | Generate a ZIP bug report with session trace, scenario files, validation results, and Valkyrie logs |
|
|
123
|
+
|
|
114
124
|
## MCP Resources
|
|
115
125
|
|
|
116
126
|
| Resource | URI |
|
|
@@ -155,25 +165,33 @@ Built scenarios are ZIP archives with a `.valkyrie` extension.
|
|
|
155
165
|
|
|
156
166
|
## Validation Rules
|
|
157
167
|
|
|
158
|
-
The server validates scenarios against
|
|
168
|
+
The server validates scenarios against 18 rule categories, checked against Valkyrie 3.28 (quest format 21):
|
|
159
169
|
|
|
160
170
|
1. **Unique names** - No duplicate component names
|
|
161
|
-
2. **Required fields** - Tiles have `side`, displayed events have `buttons`
|
|
162
|
-
3. **Cross-references** - All referenced components exist
|
|
171
|
+
2. **Required fields** - Tiles have `side` or `customImage`, displayed events have `buttons`
|
|
172
|
+
3. **Cross-references** - All referenced components exist; `remove` #keywords are valid
|
|
163
173
|
4. **Event graph** - `EventStart` trigger exists, no unreachable/dead-end events
|
|
164
|
-
5. **Event flow** -
|
|
174
|
+
5. **Event flow** - No endless loops of hidden events
|
|
165
175
|
6. **Localization completeness** - Event text, button labels, quest metadata
|
|
166
|
-
7. **Format rules** - Valid format version, type=MoM, tile rotations
|
|
176
|
+
7. **Format rules** - Valid format version (4-21) and high enough for the features used, type=MoM, tile rotations
|
|
167
177
|
8. **Catalog references** - Tile sides, monster names, items match game content
|
|
168
|
-
9. **Tile connectivity** - Tiles
|
|
178
|
+
9. **Tile connectivity** - Tiles don't overlap, touch at least one other tile, and share a lined-up door or open edge (door data measured from the tile artwork)
|
|
169
179
|
10. **Mythos structure** - Proper mythos trigger configuration
|
|
170
180
|
11. **Investigator token** - TokenInvestigators setup and removal
|
|
171
181
|
12. **Explore token** - Explore tokens linked to tile reveal events
|
|
182
|
+
13. **Field schema** - Only fields Valkyrie reads for each component type; valid `tokensize` and boolean values
|
|
183
|
+
14. **Event semantics** - How Valkyrie actually runs events: unreachable event2+ on hidden events, `conditions` ignored next to `vartests`, trailing logical operators, spawns wrongly placed in `add`
|
|
184
|
+
15. **Custom images** - Referenced image files exist in the scenario folder
|
|
185
|
+
16. **Token placement** - Tokens and monster placements sit on a tile
|
|
186
|
+
17. **Triggers** - Every trigger is one Valkyrie fires (no token triggers)
|
|
187
|
+
18. **Game flow** - The game can reach an ending from its triggers; defeat condition, mythos, items and start marker set up correctly
|
|
188
|
+
|
|
189
|
+
`build_scenario` refuses to package a scenario while any rule reports an error.
|
|
172
190
|
|
|
173
191
|
## Development
|
|
174
192
|
|
|
175
193
|
```bash
|
|
176
|
-
npm test # Run all tests (
|
|
194
|
+
npm test # Run all tests (1067 tests across 44 files)
|
|
177
195
|
npm run test:watch # Watch mode
|
|
178
196
|
npm run lint # Type check
|
|
179
197
|
npm run build # Compile to dist/
|
|
@@ -188,11 +206,12 @@ agents/ Scenario designer agent
|
|
|
188
206
|
src/
|
|
189
207
|
io/ INI parser/writer, localization CSV, ZIP packager
|
|
190
208
|
model/ ScenarioModel, LocalizationStore, component types
|
|
191
|
-
validation/
|
|
209
|
+
validation/ 15 rules + orchestrator
|
|
192
210
|
rules/ Individual validation rule implementations
|
|
193
211
|
tools/ MCP tool implementations
|
|
194
212
|
resources/ Format documentation resources
|
|
195
213
|
catalogs/ 846-entry game content catalog
|
|
214
|
+
diagnostics/ Bug report builder, session trace, ring buffer
|
|
196
215
|
server.ts MCP server registration
|
|
197
216
|
index.ts Entry point (stdio transport)
|
|
198
217
|
tests/
|
|
@@ -201,6 +220,7 @@ tests/
|
|
|
201
220
|
model/ Model layer tests
|
|
202
221
|
tools/ Tool tests
|
|
203
222
|
validation/ Validation rule tests
|
|
223
|
+
diagnostics/ Diagnostics tests
|
|
204
224
|
golden.test.ts Round-trip integrity tests
|
|
205
225
|
integration.test.ts Full pipeline tests
|
|
206
226
|
```
|
|
@@ -71,7 +71,9 @@ Use these skills for detailed pattern guidance:
|
|
|
71
71
|
- Silent events with `event1` MUST have `buttons>=1`
|
|
72
72
|
- Use `randomevents=true` for random encounter pools
|
|
73
73
|
- End scenarios with `operations=$end,=,1`
|
|
74
|
-
- Include both victory and defeat paths
|
|
74
|
+
- Include both victory and defeat paths: victory via `trigger=Defeated<SpawnName>` or the final objective, defeat via `trigger=Eliminated`
|
|
75
|
+
- Wire tokens to their events with the token's own `event1` (never `trigger=<TokenName>`); give every item an explicit `starting`
|
|
76
|
+
- `build_scenario` refuses while `validate_scenario` reports errors: fix them rather than forcing
|
|
75
77
|
- Use vartests for branching: button1=FAIL, button2=PASS
|
|
76
78
|
|
|
77
79
|
### Difficulty Balance
|
|
@@ -81,7 +83,7 @@ Use these skills for detailed pattern guidance:
|
|
|
81
83
|
- Mythos scaling formula: `deadlyRound = 20 - #heroes`, `majorRound = deadlyRound / 2`
|
|
82
84
|
- Initialize mythos variables in EventStart chain
|
|
83
85
|
- Use `>=` not `==` for round checks to avoid missed triggers
|
|
84
|
-
- Use one-shot flags (`
|
|
86
|
+
- Use one-shot flags in `vartests` (e.g. `VarOperation:fired,==,0` plus `operations: fired,=,1`) for events that should fire once
|
|
85
87
|
|
|
86
88
|
### Narrative Style
|
|
87
89
|
- Use italics `<i>text</i>` for atmospheric descriptions
|
|
@@ -111,4 +113,4 @@ Use these skills for detailed pattern guidance:
|
|
|
111
113
|
|
|
112
114
|
## Available MCP Tools
|
|
113
115
|
|
|
114
|
-
All tools from the `valkyrie-mom` MCP server are available.
|
|
116
|
+
All tools from the `valkyrie-mom` MCP server are available. Place tiles with `place_tile_relative`, put tokens on the spots `get_map_ascii` lists, and check the board with `render_map` (tiles hang east and south from their position, so floors have negative y). Run `validate_scenario` after major changes. Use `search_game_content` to find valid catalog entries for tiles, monsters, and items.
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { CatalogEntry, CatalogType } from './catalog-types.js';
|
|
2
|
+
/** Maps lowercase catalog pack IDs to Valkyrie's case-sensitive pack IDs */
|
|
3
|
+
export declare const PACK_ID_MAP: Record<string, string>;
|
|
4
|
+
/** Convert a catalog pack ID (lowercase) to Valkyrie's case-sensitive pack ID */
|
|
5
|
+
export declare function getValkyriePackId(catalogPack: string): string;
|
|
2
6
|
export declare class CatalogStore {
|
|
3
7
|
private entries;
|
|
4
8
|
private byId;
|
|
@@ -15,6 +19,12 @@ export declare class CatalogStore {
|
|
|
15
19
|
getByType(type: CatalogType): CatalogEntry[];
|
|
16
20
|
/** Get a Set of all entry IDs, optionally filtered by type. */
|
|
17
21
|
getAllIds(type?: CatalogType): Set<string>;
|
|
22
|
+
/** Get the Valkyrie pack ID for a catalog pack string */
|
|
23
|
+
getPackId(catalogPack: string): string;
|
|
24
|
+
/** Look up a tile side's pack from catalog, return Valkyrie pack ID */
|
|
25
|
+
getPackForTileSide(tileId: string): string | undefined;
|
|
26
|
+
/** Look up a monster's pack from catalog, return Valkyrie pack ID */
|
|
27
|
+
getPackForMonster(monsterId: string): string | undefined;
|
|
18
28
|
}
|
|
19
29
|
export declare function getSharedCatalog(): CatalogStore;
|
|
20
30
|
//# sourceMappingURL=catalog-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-store.d.ts","sourceRoot":"","sources":["../../src/catalogs/catalog-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAYpE,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,IAAI,CAA4B;IACxC,OAAO,CAAC,MAAM,CAAmC;;IAoCjD;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,EAAE;IAazD,uCAAuC;IACvC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAI7C,uCAAuC;IACvC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,EAAE;IAI5C,+DAA+D;IAC/D,SAAS,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-store.d.ts","sourceRoot":"","sources":["../../src/catalogs/catalog-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAYpE,4EAA4E;AAC5E,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAO9C,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,IAAI,CAA4B;IACxC,OAAO,CAAC,MAAM,CAAmC;;IAoCjD;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,EAAE;IAazD,uCAAuC;IACvC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAI7C,uCAAuC;IACvC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,EAAE;IAI5C,+DAA+D;IAC/D,SAAS,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC;IAK1C,yDAAyD;IACzD,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAItC,uEAAuE;IACvE,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAMtD,qEAAqE;IACrE,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAKzD;AAKD,wBAAgB,gBAAgB,IAAI,YAAY,CAK/C"}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { MONSTERS, TILES, AUDIO, ITEMS, INVESTIGATORS, PUZZLES, TOKENS, } from './data/all-catalogs.js';
|
|
2
2
|
import { TILE_GEOMETRY } from './data/tile-geometry.js';
|
|
3
|
+
/** Maps lowercase catalog pack IDs to Valkyrie's case-sensitive pack IDs */
|
|
4
|
+
export const PACK_ID_MAP = {
|
|
5
|
+
base: 'MoMBase',
|
|
6
|
+
btt: 'BtT',
|
|
7
|
+
hj: 'HJ',
|
|
8
|
+
pots: 'PotS',
|
|
9
|
+
soa: 'SoA',
|
|
10
|
+
sot: 'SoT',
|
|
11
|
+
};
|
|
12
|
+
/** Convert a catalog pack ID (lowercase) to Valkyrie's case-sensitive pack ID */
|
|
13
|
+
export function getValkyriePackId(catalogPack) {
|
|
14
|
+
return PACK_ID_MAP[catalogPack] ?? catalogPack;
|
|
15
|
+
}
|
|
3
16
|
export class CatalogStore {
|
|
4
17
|
entries;
|
|
5
18
|
byId;
|
|
@@ -19,8 +32,8 @@ export class CatalogStore {
|
|
|
19
32
|
if (entry.type === 'tile') {
|
|
20
33
|
const geo = TILE_GEOMETRY[entry.id];
|
|
21
34
|
if (geo) {
|
|
22
|
-
entry.
|
|
23
|
-
entry.
|
|
35
|
+
entry.size = `${geo.width}x${geo.height} units`;
|
|
36
|
+
entry.openings = geo.openings;
|
|
24
37
|
entry.desc = geo.desc;
|
|
25
38
|
}
|
|
26
39
|
}
|
|
@@ -66,6 +79,24 @@ export class CatalogStore {
|
|
|
66
79
|
const source = type ? (this.byType.get(type) ?? []) : this.entries;
|
|
67
80
|
return new Set(source.map(e => e.id));
|
|
68
81
|
}
|
|
82
|
+
/** Get the Valkyrie pack ID for a catalog pack string */
|
|
83
|
+
getPackId(catalogPack) {
|
|
84
|
+
return getValkyriePackId(catalogPack);
|
|
85
|
+
}
|
|
86
|
+
/** Look up a tile side's pack from catalog, return Valkyrie pack ID */
|
|
87
|
+
getPackForTileSide(tileId) {
|
|
88
|
+
const entry = this.byId.get(tileId);
|
|
89
|
+
if (!entry || entry.type !== 'tile')
|
|
90
|
+
return undefined;
|
|
91
|
+
return getValkyriePackId(entry.pack);
|
|
92
|
+
}
|
|
93
|
+
/** Look up a monster's pack from catalog, return Valkyrie pack ID */
|
|
94
|
+
getPackForMonster(monsterId) {
|
|
95
|
+
const entry = this.byId.get(monsterId);
|
|
96
|
+
if (!entry || entry.type !== 'monster')
|
|
97
|
+
return undefined;
|
|
98
|
+
return getValkyriePackId(entry.pack);
|
|
99
|
+
}
|
|
69
100
|
}
|
|
70
101
|
/** Shared singleton instance — avoids re-indexing 846 entries multiple times */
|
|
71
102
|
let sharedInstance = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-store.js","sourceRoot":"","sources":["../../src/catalogs/catalog-store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,KAAK,EACL,aAAa,EACb,OAAO,EACP,MAAM,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,OAAO,YAAY;IACf,OAAO,CAAiB;IACxB,IAAI,CAA4B;IAChC,MAAM,CAAmC;IAEjD;QACE,IAAI,CAAC,OAAO,GAAG;YACb,GAAG,QAAQ;YACX,GAAG,KAAK;YACR,GAAG,KAAK;YACR,GAAG,KAAK;YACR,GAAG,aAAa;YAChB,GAAG,OAAO;YACV,GAAG,MAAM;SACV,CAAC;QAEF,6CAA6C;QAC7C,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBAC1B,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACpC,IAAI,GAAG,EAAE,CAAC;oBACR,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-store.js","sourceRoot":"","sources":["../../src/catalogs/catalog-store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,KAAK,EACL,aAAa,EACb,OAAO,EACP,MAAM,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,WAAW,GAA2B;IACjD,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;CACX,CAAC;AAEF,iFAAiF;AACjF,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,OAAO,WAAW,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC;AACjD,CAAC;AAED,MAAM,OAAO,YAAY;IACf,OAAO,CAAiB;IACxB,IAAI,CAA4B;IAChC,MAAM,CAAmC;IAEjD;QACE,IAAI,CAAC,OAAO,GAAG;YACb,GAAG,QAAQ;YACX,GAAG,KAAK;YACR,GAAG,KAAK;YACR,GAAG,KAAK;YACR,GAAG,aAAa;YAChB,GAAG,OAAO;YACV,GAAG,MAAM;SACV,CAAC;QAEF,6CAA6C;QAC7C,KAAK,MAAM,KAAK,IAAI,IAAI,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,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC;IAED,uEAAuE;IACvE,kBAAkB,CAAC,MAAc;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,SAAS,CAAC;QACtD,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,qEAAqE;IACrE,iBAAiB,CAAC,SAAiB;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QACzD,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACF;AAED,gFAAgF;AAChF,IAAI,cAAc,GAAwB,IAAI,CAAC;AAE/C,MAAM,UAAU,gBAAgB;IAC9B,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,cAAc,GAAG,IAAI,YAAY,EAAE,CAAC;IACtC,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
export interface TileOpening {
|
|
2
|
+
from: number;
|
|
3
|
+
to: number;
|
|
4
|
+
/** door: a doorway about one unit wide; open: an open edge (streets, yards) */
|
|
5
|
+
kind: 'door' | 'open';
|
|
6
|
+
}
|
|
1
7
|
export interface TileGeometry {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
/** Image name in Valkyrie's import/img folder, without the .dds extension */
|
|
11
|
+
image: string;
|
|
12
|
+
/** true when the image ships with Valkyrie rather than being imported from the FFG app */
|
|
13
|
+
bundled?: boolean;
|
|
14
|
+
openings: {
|
|
15
|
+
N: TileOpening[];
|
|
16
|
+
E: TileOpening[];
|
|
17
|
+
S: TileOpening[];
|
|
18
|
+
W: TileOpening[];
|
|
8
19
|
};
|
|
9
20
|
desc: string;
|
|
10
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile-geometry.d.ts","sourceRoot":"","sources":["../../../src/catalogs/data/tile-geometry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tile-geometry.d.ts","sourceRoot":"","sources":["../../../src/catalogs/data/tile-geometry.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE;QAAE,CAAC,EAAE,WAAW,EAAE,CAAC;QAAC,CAAC,EAAE,WAAW,EAAE,CAAC;QAAC,CAAC,EAAE,WAAW,EAAE,CAAC;QAAC,CAAC,EAAE,WAAW,EAAE,CAAA;KAAE,CAAC;IACrF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAqLtD,CAAC"}
|