@dreadwood-types/types 0.1.108 → 0.1.110

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.
Files changed (53) hide show
  1. package/dist/aquarium.d.ts +1 -1
  2. package/dist/aquarium.d.ts.map +1 -1
  3. package/dist/aquarium.js +6 -0
  4. package/dist/aquarium.js.map +1 -1
  5. package/dist/areaTransitions.d.ts +1 -1
  6. package/dist/areaTransitions.d.ts.map +1 -1
  7. package/dist/areaTransitions.js +11 -0
  8. package/dist/areaTransitions.js.map +1 -1
  9. package/dist/attackableNpcs.d.ts.map +1 -1
  10. package/dist/attackableNpcs.js +1 -0
  11. package/dist/attackableNpcs.js.map +1 -1
  12. package/dist/capitalAquarium.d.ts +1 -1
  13. package/dist/capitalAquarium.d.ts.map +1 -1
  14. package/dist/capitalAquarium.js +3 -2
  15. package/dist/capitalAquarium.js.map +1 -1
  16. package/dist/constants.d.ts +5 -3
  17. package/dist/constants.d.ts.map +1 -1
  18. package/dist/constants.js +60 -1
  19. package/dist/constants.js.map +1 -1
  20. package/dist/cooking.d.ts.map +1 -1
  21. package/dist/cooking.js +10 -0
  22. package/dist/cooking.js.map +1 -1
  23. package/dist/groundItems.d.ts.map +1 -1
  24. package/dist/groundItems.js +6 -0
  25. package/dist/groundItems.js.map +1 -1
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +2 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/landmarks.d.ts.map +1 -1
  31. package/dist/landmarks.js +12 -0
  32. package/dist/landmarks.js.map +1 -1
  33. package/dist/messages.d.ts +1 -1
  34. package/dist/messages.d.ts.map +1 -1
  35. package/dist/mining.d.ts +2 -0
  36. package/dist/mining.d.ts.map +1 -1
  37. package/dist/mining.js +11 -4
  38. package/dist/mining.js.map +1 -1
  39. package/dist/riverFishing.d.ts +85 -0
  40. package/dist/riverFishing.d.ts.map +1 -0
  41. package/dist/riverFishing.js +89 -0
  42. package/dist/riverFishing.js.map +1 -0
  43. package/dist/storyQuests.js +1 -1
  44. package/dist/storyQuests.js.map +1 -1
  45. package/dist/timedRun.d.ts +3 -1
  46. package/dist/timedRun.d.ts.map +1 -1
  47. package/dist/timedRun.js +2 -0
  48. package/dist/timedRun.js.map +1 -1
  49. package/dist/worldEvents.d.ts +263 -0
  50. package/dist/worldEvents.d.ts.map +1 -0
  51. package/dist/worldEvents.js +544 -0
  52. package/dist/worldEvents.js.map +1 -0
  53. package/package.json +1 -1
package/dist/timedRun.js CHANGED
@@ -11,8 +11,10 @@
11
11
  * character who closes the game inside a cave finds themselves outside when they come back.
12
12
  */
13
13
  import { timedAreaDef } from './timedAccess.js';
14
+ import { WORLD_EVENTS, WORLD_EVENT_DURATION_MS, WORLD_EVENT_IDS } from './worldEvents.js';
14
15
  export const TIMED_RUNS = {
15
16
  'rat-den': { id: 'rat-den', label: 'Rat Cave', durationMs: 5 * 60_000 },
17
+ ...Object.fromEntries(WORLD_EVENT_IDS.map((id) => [id, { id, label: WORLD_EVENTS[id].short, durationMs: WORLD_EVENT_DURATION_MS }])),
16
18
  };
17
19
  export function timedRunDef(id) {
18
20
  return TIMED_RUNS[id];
@@ -1 +1 @@
1
- {"version":3,"file":"timedRun.js","sourceRoot":"","sources":["../src/timedRun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAoB,MAAM,kBAAkB,CAAC;AAYlE,MAAM,CAAC,MAAM,UAAU,GAAoC;IACzD,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,GAAG,MAAM,EAAE;CACxE,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,EAAc;IACxC,OAAO,UAAU,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM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AAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAc,EAAE,KAAa,EAAE,MAAe;IAC1E,MAAM,QAAQ,GAAG,KAAK,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC;IACnD,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,GAA+B,EAAE,KAAa;IAChF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,263 @@
1
+ /**
2
+ * Random World Events: five-minute rewarding finds for levels 1-15 (James's sheets, 2026-10-03; backend
3
+ * design-references random-world-events and random-event-kit, then one full sheet per event under its id).
4
+ *
5
+ * How one works (every sheet's loop): an entrance turns up somewhere in the starter area; you go in and have
6
+ * WORLD_EVENT_DURATION_MS inside (a timed run keyed by the event id, timedRun.ts: logged in or not, you are put back
7
+ * outside when it runs out); NPCs keep coming; you mine, fish or forage the dense nodes; a short puzzle opens the way
8
+ * to the cache; going in pays Explorer XP and the cache pays more.
9
+ *
10
+ * The shape is the forest dens' (landmarks.ts FOREST_DEN_SITES): every candidate entrance site and every interior is
11
+ * built by world generation; only WORLD_EVENT_ACTIVE_COUNT entrances show at once, each a different event at one of
12
+ * its sites. The mouth stays open WORLD_EVENT_JOIN_WINDOW_MS after the first player goes in so friends can follow,
13
+ * then caves in. When the interior is empty again it resets (puzzle, cache, nodes, NPCs) and another event opens.
14
+ *
15
+ * An event is data: floor rooms in its plot of the underground strip, pieces (the way out, the cache, the puzzle's
16
+ * switches and the barriers they open, signs and dressing), puzzle steps, NPC streams, its loot and XP. The backend
17
+ * carves and runs it from this (worldEventsMap.ts, worldEvents.ts); the client draws the pieces as Blender models.
18
+ * Only events with `built` rotate; the others have their sites and plot and wait for their layout (James's order).
19
+ */
20
+ import { type NpcKind } from './constants.js';
21
+ /** James's build order (2026-10-03). Cart Ravine and Watch Post Cellar from the first overview are dropped. */
22
+ export type WorldEventId = 'copper-prospect' | 'buried-storehouse' | 'reedbed-sinkhole' | 'tidepool-grotto' | 'storm-felled-grove' | 'forgotten-smithy' | 'old-kings-culvert' | 'sunken-wayshrine' | 'goblin-sapper';
23
+ export declare const WORLD_EVENT_IDS: readonly WorldEventId[];
24
+ /** Time inside, wall clock (every sheet: "five minutes"). */
25
+ export declare const WORLD_EVENT_DURATION_MS: number;
26
+ /** After the first player goes in, how long the mouth stays open for others to follow into the same run. */
27
+ export declare const WORLD_EVENT_JOIN_WINDOW_MS = 30000;
28
+ /** Entrances showing across the starter area at once (never two of the same event). */
29
+ export declare const WORLD_EVENT_ACTIVE_COUNT = 3;
30
+ /** How long after one resets before the next entrance turns up, somewhere else. */
31
+ export declare const WORLD_EVENT_REOPEN_MS: {
32
+ readonly minMs: 45000;
33
+ readonly maxMs: 120000;
34
+ };
35
+ /** Kinds. Each is a Blender model prop (isModelPropKind): its style is `<model>-<facing>`, its footprint the model's. */
36
+ export declare const EVENT_ENTRANCE_KIND = "evententrance";
37
+ /** A way back out (a ladder, a crawlway, stairs). */
38
+ export declare const EVENT_EXIT_KIND = "eventexit";
39
+ /** The cache: each character in the run may open it once. */
40
+ export declare const EVENT_CHEST_KIND = "eventchest";
41
+ /** A puzzle piece you work: a lever, a winch, a wheel, a latch, a brace, bellows, a symbol. */
42
+ export declare const EVENT_SWITCH_KIND = "eventswitch";
43
+ /** Something in the way until the puzzle opens it: a fallen beam, a gate, a hidden door. */
44
+ export declare const EVENT_BARRIER_KIND = "eventbarrier";
45
+ /** The event signs (the clock, the fight, the loot, the way out): a click reads them. */
46
+ export declare const EVENT_SIGN_KIND = "eventsign";
47
+ /** A quick gather node (grain sacks, fruit shelves, a reed bed): a click gives something and some XP, then it refills. */
48
+ export declare const EVENT_NODE_KIND = "eventnode";
49
+ export declare const WORLD_EVENT_KINDS: readonly string[];
50
+ export declare function isWorldEventKind(kind: string): boolean;
51
+ export type WorldEventFacing = 'n' | 'e' | 's' | 'w';
52
+ /** A tile and the way a prop on it faces. */
53
+ export type WorldEventSpot = {
54
+ x: number;
55
+ z: number;
56
+ facing: WorldEventFacing;
57
+ };
58
+ /** One place an event's entrance can turn up: the footprint's centre tile (world space). */
59
+ export type WorldEventSite = WorldEventSpot & {
60
+ id: string;
61
+ };
62
+ /** Inclusive tile rectangle. */
63
+ export type TileRect = {
64
+ minX: number;
65
+ maxX: number;
66
+ minZ: number;
67
+ maxZ: number;
68
+ };
69
+ export type WorldEventPieceRole = 'exit' | 'cache' | 'switch' | 'barrier' | 'sign' | 'decor' | 'node';
70
+ export declare const WORLD_EVENT_ROLE_KIND: Readonly<Record<Exclude<WorldEventPieceRole, 'decor'>, string>>;
71
+ /**
72
+ * One piece of an interior. Its entity id is `ev-<event>-<id>` (worldEventPieceEntityId); decor is a plain
73
+ * `dreadmodel`, the rest are the event kinds above, so a click reaches the backend.
74
+ */
75
+ export type WorldEventPiece = WorldEventSpot & {
76
+ id: string;
77
+ role: WorldEventPieceRole;
78
+ /** The Blender model (CAPITAL_BUILDING_MODELS id) at the start of a run. */
79
+ model: string;
80
+ /** Its model once its step is done (a pulled lever, a beam pushed aside, an emptied cache). */
81
+ doneModel?: string;
82
+ /** What the client calls it, and the left-click verb ("Pull", "Push aside", "Climb out"). */
83
+ name: string;
84
+ verb: string;
85
+ /** What a click on a sign says, or a decor piece's description. */
86
+ text?: string;
87
+ /** Not there until this piece's step is done (a latch under a crate): built, hidden at boot, shown when it opens. */
88
+ hiddenUntil?: string;
89
+ /** A gather node (role 'node'): what a click gives, the skill it trains and how long until it fills again. */
90
+ node?: WorldEventNode;
91
+ };
92
+ /** A quick gather node's yield: each line rolls its own quantity; the done model shows it emptied until it refills. */
93
+ export type WorldEventNode = {
94
+ give: readonly {
95
+ kind: string;
96
+ min: number;
97
+ max: number;
98
+ }[];
99
+ skill: 'foraging' | 'fishing' | 'woodwork' | 'mining';
100
+ xp: number;
101
+ /** The skill level needed, if any. */
102
+ level?: number;
103
+ respawnMs: number;
104
+ };
105
+ /**
106
+ * A puzzle step: a click on `piece` once every piece in `needs` is done. The piece takes its done model; `opens`
107
+ * names other pieces that take theirs too (a winch lowering a walkway). A barrier's done model is walkable
108
+ * (CAPITAL_BUILDING_MODELS `walkable`), so opening one opens the way.
109
+ */
110
+ export type WorldEventStep = {
111
+ piece: string;
112
+ needs?: readonly string[];
113
+ /** Everyone inside hears this when it is done. */
114
+ text: string;
115
+ /** A click before its needs are met: the sheet's "inspect" line, which says where to go. */
116
+ notYet: string;
117
+ opens?: readonly string[];
118
+ };
119
+ /** A level range (inclusive). */
120
+ export type LevelRange = readonly [number, number];
121
+ /**
122
+ * NPCs that keep coming while anyone is inside: `firstWave` at once, then one more every `everyMs` up to `cap` (plus
123
+ * `perExtraPlayer` for each player past the first), from the nests. Levels roll inside `levels`, leaning towards the
124
+ * party's combat level. One spawn in `leader.oneIn` is the leader instead (at most `leader.max` alive).
125
+ */
126
+ export type WorldEventStream = {
127
+ kind: NpcKind;
128
+ name: string;
129
+ levels: LevelRange;
130
+ nests: readonly {
131
+ x: number;
132
+ z: number;
133
+ }[];
134
+ cap: number;
135
+ perExtraPlayer: number;
136
+ everyMs: number;
137
+ firstWave: number;
138
+ /** A newcomer below this combat level is left alone unless they strike first (the forest dens' rule). */
139
+ aggroCombat: number;
140
+ aggroText: string;
141
+ leader?: {
142
+ kind: NpcKind;
143
+ name: string;
144
+ levels: LevelRange;
145
+ oneIn: number;
146
+ max: number;
147
+ aggroText: string;
148
+ };
149
+ };
150
+ export type WorldEventLoot = {
151
+ kind: string;
152
+ min: number;
153
+ max: number;
154
+ chance: number;
155
+ };
156
+ /** Quick ore seams (orerock): the metal is the seam's style, `:cluster` draws the sheet's ore cluster model. */
157
+ export type WorldEventSeam = {
158
+ x: number;
159
+ z: number;
160
+ ore: 'copper' | 'tin' | 'iron';
161
+ };
162
+ export type WorldEventDef = {
163
+ id: WorldEventId;
164
+ /** The sheet's name. */
165
+ label: string;
166
+ /** What the HUD timer and short notices call it. */
167
+ short: string;
168
+ /** The sheet's levels: entry needs the lower combat level. */
169
+ levels: LevelRange;
170
+ /** The sheet's skills line. */
171
+ skills: string;
172
+ tagline: string;
173
+ /** What the guide says it is. */
174
+ blurb: string;
175
+ /** The entrance's Blender model (CAPITAL_BUILDING_MODELS id, 5 x 3); placed as EVENT_ENTRANCE_KIND `<model>-<facing>`. */
176
+ entranceModel: string;
177
+ /** What the left click on the mouth says ("Enter the mine mouth"). */
178
+ enterVerb: string;
179
+ /** Where the entrance can turn up (all in the starter area; scripts/world-events-smoke.ts checks every one). */
180
+ sites: readonly WorldEventSite[];
181
+ /** The plot of rock the interior is carved in (walls included): inside(), the client's lighting and clipping. */
182
+ plot: TileRect;
183
+ /** Built and in the rotation. */
184
+ built: boolean;
185
+ /** Explorer XP: on the way in (every run), and the first time a character opens the cache in a run. */
186
+ xp: {
187
+ entry: number;
188
+ cache: number;
189
+ };
190
+ /** The sheet's typical and rare cache lines, for the guide. */
191
+ rewards: string;
192
+ /** What the cache gives each character once per run. `chance` 1 is always; the rest roll on their own. */
193
+ loot: readonly WorldEventLoot[];
194
+ /** Built events only: where you land, the floor, the pieces, the puzzle, the streams, the seams. */
195
+ arrival?: {
196
+ x: number;
197
+ z: number;
198
+ };
199
+ rooms?: Readonly<Record<string, TileRect>>;
200
+ pieces?: readonly WorldEventPiece[];
201
+ steps?: readonly WorldEventStep[];
202
+ streams?: readonly WorldEventStream[];
203
+ seams?: readonly WorldEventSeam[];
204
+ /** Loose stone to gather (the `stone` pickup). */
205
+ stones?: readonly {
206
+ x: number;
207
+ z: number;
208
+ }[];
209
+ };
210
+ export declare const WORLD_EVENTS: Readonly<Record<WorldEventId, WorldEventDef>>;
211
+ export declare function worldEventDef(id: WorldEventId): WorldEventDef;
212
+ export declare function isWorldEventId(value: unknown): value is WorldEventId;
213
+ export declare function inTileRect(r: TileRect, x: number, z: number): boolean;
214
+ /** The event whose interior plot this tile is in, if any (built or not). */
215
+ export declare function worldEventAtInterior(x: number, z: number): WorldEventDef | null;
216
+ export declare function inWorldEventInterior(x: number, z: number): boolean;
217
+ /** True on an interior's carved floor (a room), not its rock. */
218
+ export declare function onWorldEventFloor(def: WorldEventDef, x: number, z: number): boolean;
219
+ /** The tile in front of an entrance: where you stand to go in, and where you come back out. */
220
+ export declare function worldEventSiteApproach(s: WorldEventSite): {
221
+ x: number;
222
+ z: number;
223
+ };
224
+ /** The entrance entity's style. */
225
+ export declare function worldEventEntranceStyle(def: WorldEventDef, s: WorldEventSite): string;
226
+ /** The stable entity ids: an entrance per site, and each piece of an interior. */
227
+ export declare function worldEventEntranceId(def: Pick<WorldEventDef, 'id'>, s: Pick<WorldEventSite, 'id'>): string;
228
+ export declare function worldEventPieceEntityId(def: Pick<WorldEventDef, 'id'>, pieceId: string): string;
229
+ /** The piece an entity is, if it is one of an event's (by its stable id). */
230
+ export declare function worldEventPieceForEntity(entityId: string): {
231
+ def: WorldEventDef;
232
+ piece: WorldEventPiece;
233
+ } | null;
234
+ /** The style of a piece's entity in a state. */
235
+ export declare function worldEventPieceStyle(piece: WorldEventPiece, done: boolean): string;
236
+ /**
237
+ * What an event model is called and what a left click on it does, for the client, which knows an entity by its
238
+ * kind and style (`<model>-<facing>`): an entrance's event and verb, a piece's name and verb. A barrier once opened
239
+ * is just the way through.
240
+ */
241
+ export declare function worldEventModelInfo(model: string): {
242
+ name: string;
243
+ verb: string;
244
+ open?: boolean;
245
+ } | null;
246
+ /** The step a click on this piece works, if it is a puzzle piece. */
247
+ export declare function worldEventStepFor(def: WorldEventDef, pieceId: string): WorldEventStep | undefined;
248
+ /** The orerock style for an event seam: the metal, drawn as the sheet's cluster. */
249
+ export declare function worldEventSeamStyle(seam: WorldEventSeam): string;
250
+ /**
251
+ * One character's share from an event cache. `roll` is called once per line (Math.random in the game, a seeded
252
+ * stream in tests). Lines that miss their chance give nothing.
253
+ */
254
+ export declare function rollWorldEventLoot(def: WorldEventDef, roll: () => number): {
255
+ kind: string;
256
+ qty: number;
257
+ }[];
258
+ /**
259
+ * A stream NPC's level: inside the range, leaning towards the party's combat level (so a level-2 newcomer meets
260
+ * level 1-3 rats and a level-9 character the top of the range), with a little spread.
261
+ */
262
+ export declare function worldEventSpawnLevel(range: LevelRange, partyCombat: number, roll: () => number): number;
263
+ //# sourceMappingURL=worldEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worldEvents.d.ts","sourceRoot":"","sources":["../src/worldEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEpE,+GAA+G;AAC/G,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,eAAe,CAAC;AAEpB,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAUlD,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,QAAa,CAAC;AAClD,4GAA4G;AAC5G,eAAO,MAAM,0BAA0B,QAAS,CAAC;AACjD,uFAAuF;AACvF,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,mFAAmF;AACnF,eAAO,MAAM,qBAAqB;;;CAA6C,CAAC;AAEhF,yHAAyH;AACzH,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,qDAAqD;AACrD,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,+F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