@dreadwood-types/types 0.1.290 → 0.1.292

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.
@@ -0,0 +1,580 @@
1
+ /**
2
+ * VOYAGES (T89, 2026-10-14; plan `.cursor/task-plans/2026-10-14-t89-voyages.md`): the sea as something to DO for levels 8-35.
3
+ * The chart (travel.ts) and its three ports are unchanged (ids and fares frozen); this file adds, on top of them:
4
+ *
5
+ * 1. THE CAPTAIN'S LOG: five story quests, all from Branson on the Long Pier, one leg at a time: a crate to the Sundered Span,
6
+ * salt for Saltmere across the free skiff, a passenger who must not be hurt (the story engine's `passenger` rule), a
7
+ * storm-timed crossing on the wall clock (the engine's `clock`) and the last entry, in which the corsairs are repelled.
8
+ * Finishing the log makes you Branson's friend: chart fares a fifth cheaper.
9
+ * 2. CORSAIR BOARDINGS: the ship-board set piece. A corsair sloop grapples a chart quay for the first half of a slot, one slot in
10
+ * four per port, read off the wall clock (never rolled, so every server agrees and a restart changes nothing), like the
11
+ * Passing Bay raid (passingBay.ts). Fight the boarders (three down and still standing is thanked) or survive them: sail
12
+ * away, walk off, or stay out of the quay.
13
+ * 3. THE SHIPPING BOARD: the harbour masters' daily freight contracts (a bond, one active contract, cargo handed in at the
14
+ * destination master; three a day, four for members).
15
+ * 4. FARES: a voyage step or a loaded freight contract waives the fare on that leg only; the Battlefield Bridge lock is never
16
+ * waived (travel.ts travelPortLockReason). Nothing members-only is free: the members' Deep Sea trip (deepSea.ts) is a
17
+ * separate 500-coin boat and stays so.
18
+ *
19
+ * Imports are type-only from storyQuests.ts and travel.ts (both import this file's neighbours at load: no import cycle).
20
+ * EVERY NUMBER HERE (levels, times, pay, bonds) IS A PLACEHOLDER for the balance pass (balance is last, PLAN_1_TO_40.md).
21
+ */
22
+ import { FROZEN_SHORE_LANDING, HOPE_BEACH_LANDING } from './landmarks.js';
23
+ import { HARBOUR_LANDING } from './harbour.js';
24
+ import { shiftSurfaceZ } from './starterExpansion.js';
25
+ export const VOYAGE_PORT_IDS = ['hope-beach', 'frozen-shore', 'capital-harbour'];
26
+ /**
27
+ * The chart's landings in the PUBLIC frame (the same tiles `TRAVEL_PORTS` holds: the generator-frame landmarks moved south by
28
+ * `shiftSurfaceZ`, exactly as expandedContracts.ts does for the ports). Every box and arena in this file is public-frame.
29
+ */
30
+ const publicTile = (p) => ({ x: p.x, z: shiftSurfaceZ(p.x, p.z) });
31
+ export const VOYAGE_LANDINGS = {
32
+ 'hope-beach': publicTile(HOPE_BEACH_LANDING),
33
+ 'frozen-shore': publicTile(FROZEN_SHORE_LANDING),
34
+ 'capital-harbour': publicTile(HARBOUR_LANDING),
35
+ };
36
+ export const VOYAGE_PORT_LABELS = {
37
+ 'hope-beach': 'the Long Pier at Hope Beach',
38
+ 'frozen-shore': "Branson's Landing",
39
+ 'capital-harbour': "the King's Harbour",
40
+ };
41
+ /** A box round a landing, inclusive world tiles. */
42
+ function landingBox(id, r) {
43
+ const l = VOYAGE_LANDINGS[id];
44
+ return { minX: l.x - r, maxX: l.x + r, minZ: l.z - r, maxZ: l.z + r };
45
+ }
46
+ // ---------------------------------------------------------------------------------------------------------------------------------
47
+ // 1. The Captain's Log
48
+ // ---------------------------------------------------------------------------------------------------------------------------------
49
+ export const CRATE_FOR_THE_COAST_ID = 'crateForTheCoast';
50
+ export const SALTMERE_RUN_ID = 'saltmereRun';
51
+ export const NERVOUS_PASSENGER_ID = 'nervousPassenger';
52
+ export const STORM_CROSSING_ID = 'stormCrossing';
53
+ export const CAPTAINS_LAST_ENTRY_ID = 'captainsLastEntry';
54
+ export const VOYAGE_QUEST_IDS = [
55
+ CRATE_FOR_THE_COAST_ID,
56
+ SALTMERE_RUN_ID,
57
+ NERVOUS_PASSENGER_ID,
58
+ STORM_CROSSING_ID,
59
+ CAPTAINS_LAST_ENTRY_ID,
60
+ ];
61
+ /** Combat levels the five ask (placeholders; the log runs 8-30). */
62
+ export const VOYAGE_COMBAT = { crate: 8, saltmere: 10, passenger: 16, storm: 22, last: 28 };
63
+ /** The Storm Crossing's clock: the squall line crosses the bay this long after Branson gives you the glass. */
64
+ export const STORM_CROSSING_MS = 10 * 60_000;
65
+ export const STORM_CROSSING_WARN_AT_MS = [5 * 60_000, 3 * 60_000, 2 * 60_000, 60_000, 30_000];
66
+ /** The passenger of The Nervous Passenger: the fright that makes them bolt (the third hit taken), and the lines. */
67
+ export const NERVOUS_PASSENGER_NAME = 'Pim Sallow';
68
+ export const NERVOUS_PASSENGER_BOLTS_AT = 3;
69
+ /** Corsair boarders the Captain's Last Entry wants repelled (the engine counts the boarders as the `cb-corsair` kind). */
70
+ export const CAPTAINS_LAST_BOARDERS = 6;
71
+ export const CORSAIR_STORY_KIND = 'cb-corsair';
72
+ /** Chart fares are this much cheaper for Branson's friend (the log done): a fifth. */
73
+ export const CAPTAINS_FRIEND_DISCOUNT = 0.2;
74
+ export const CAPTAINS_FRIEND_PERK = "Captain's Friend: chart fares to Branson's Landing and the King's Harbour are a fifth cheaper";
75
+ const BRANSON = { kind: 'branson', name: 'Branson' };
76
+ const OSKAR = { kind: 'landingmate', name: 'Oskar' };
77
+ const MARLOW = { kind: 'harbourmaster', name: 'Marlow' };
78
+ const OSMUND = { kind: 'bridgewarden', name: 'Bridgewarden Osmund' };
79
+ const TAMSIN = { kind: 'resident', name: 'Tamsin Vale' };
80
+ const BRANSON_WHERE = "Branson stands on the landing stage at the end of the Long Pier's east branch, Hope Beach. The sea passage back to Hope Beach is always free.";
81
+ const OSKAR_WHERE = "Oskar, Branson's mate, stands on the landing head at Branson's Landing. Sail from Branson's chart (the Battlefield Bridge must be mended first) or walk.";
82
+ const MARLOW_WHERE = "Marlow the harbour master stands on the Royal Pier at the King's Harbour, under the lighthouse.";
83
+ const OSMUND_WHERE = 'Bridgewarden Osmund keeps the Sundered Span, the long bridge south-east of Hope Beach.';
84
+ const TAMSIN_WHERE = "Tamsin Vale works the salt pans at Saltmere Crescent. Row across from the skiff on the South Fields' west beach (it is free), and ask along the pans.";
85
+ export const VOYAGE_QUESTS = {
86
+ // ---- 1. A Crate for the Coast ----------------------------------------------------------------------------------------------
87
+ crateForTheCoast: {
88
+ giver: BRANSON,
89
+ requires: {
90
+ combat: VOYAGE_COMBAT.crate,
91
+ refuse: "The log is for those who've a few fights behind them (Combat 8). The coast road isn't kind to the green. Come back when it won't eat you.",
92
+ },
93
+ offer: "A crate of caulking for the Sundered Span, and my knees say no to that road. The bridgewarden's boats are leaking worse than my pier. Take it down to Bridgewarden Osmund, will you? I keep a log of every leg I sail or send, and this one goes in it.",
94
+ accept: "Osmund keeps the Span, the long bridge south-east of the beach. Hand him the crate and come back to me for the next page of the log.",
95
+ decline: 'Then the Span leaks and the log stays blank. Another day.',
96
+ steps: [
97
+ {
98
+ kind: 'talk',
99
+ npc: OSMUND,
100
+ label: "Take Branson's crate of caulking to Bridgewarden Osmund at the Sundered Span",
101
+ hint: OSMUND_WHERE,
102
+ say: "Branson's caulking! He remembered. Tell him the Span is dry as a bone and he can stop worrying about my boats.",
103
+ },
104
+ {
105
+ kind: 'talk',
106
+ npc: BRANSON,
107
+ label: 'Tell Branson the crate is delivered',
108
+ hint: BRANSON_WHERE,
109
+ say: 'Delivered, and the Span dry. That goes in the log in my best hand.',
110
+ },
111
+ ],
112
+ done: "First leg done. Here is something for the road, and there are more pages in this log if you want them.",
113
+ after: 'The first page of the log is written in your name. Ask me about the next leg when you are ready.',
114
+ rewards: { coins: 120, xp: { explorer: 250 } },
115
+ },
116
+ // ---- 2. The Saltmere Run ---------------------------------------------------------------------------------------------------
117
+ saltmereRun: {
118
+ giver: BRANSON,
119
+ requires: {
120
+ quest: CRATE_FOR_THE_COAST_ID,
121
+ combat: VOYAGE_COMBAT.saltmere,
122
+ refuse: 'Do the crate to the Span for me first (A Crate for the Coast), and have a few more fights behind you (Combat 10). Then we can talk salt.',
123
+ },
124
+ offer: "Saltmere's pans want a barrel of my pickling brine, and nobody sails there but the lads with the skiff on the South Fields' beach. It's a free crossing and a short row. Take the brine across to Tamsin Vale, and see what the salt coast makes of you.",
125
+ accept: "The skiff beaches on the South Fields' west shore. Row across, find Tamsin Vale at the pans, then row back to me. Mind the crabs.",
126
+ decline: 'Then the pans stay dry and the brine goes off. Another day.',
127
+ steps: [
128
+ {
129
+ kind: 'talk',
130
+ npc: TAMSIN,
131
+ label: "Take Branson's brine to Tamsin Vale at Saltmere Crescent",
132
+ hint: TAMSIN_WHERE,
133
+ say: "Branson's brine! Good strong stuff. Tell him the pans are running and the salt will be in his barrels by the new moon. Row safe.",
134
+ },
135
+ {
136
+ kind: 'talk',
137
+ npc: BRANSON,
138
+ label: "Tell Branson the pans are running",
139
+ hint: BRANSON_WHERE,
140
+ say: "The pans are running. Good. Salt is the one cargo a ship can never have enough of.",
141
+ },
142
+ ],
143
+ done: 'Two legs in the log. You are quicker than my old mate was. Take this for the oar-work.',
144
+ after: 'Saltmere is in my log now, and so are you.',
145
+ rewards: { coins: 200, xp: { explorer: 400 } },
146
+ },
147
+ // ---- 3. The Nervous Passenger ---------------------------------------------------------------------------------------------
148
+ nervousPassenger: {
149
+ giver: BRANSON,
150
+ requires: {
151
+ quest: SALTMERE_RUN_ID,
152
+ combat: VOYAGE_COMBAT.passenger,
153
+ refuse: "A passenger wants a steady hand (Combat 16), a finished Saltmere Run and the way north open (the Battlefield Bridge). Come back when you have all three.",
154
+ },
155
+ offer: "Pim Sallow, mapmaker, wants to see Branson's Landing and the King's Harbour, and he'll flinch at every wolf on the way. If he's frightened three times he'll bolt and I'll never hear the end of it. Sail him there (on my account: I'll waive your fare on this run), hand him to Oskar, then to Marlow, then tell me he came to no harm.",
156
+ accept: "Pim is yours until Marlow signs for him. Sail to Branson's Landing from my chart (I've paid your fare), hand him to Oskar, then sail on to the King's Harbour and Marlow. Every hit you take frightens him. Three frights and he bolts, and you'll start the run again.",
157
+ decline: 'Then Pim stays on the pier with his maps, and nobody sees the coast.',
158
+ steps: [
159
+ {
160
+ kind: 'reach',
161
+ area: landingBox('frozen-shore', 8),
162
+ at: { ...VOYAGE_LANDINGS['frozen-shore'], label: "Branson's Landing" },
163
+ label: "Sail Pim to Branson's Landing (the fare is on Branson's account)",
164
+ hint: "Open Branson's chart (talk to him, then Travel) and sail to Branson's Landing: Branson pays your fare for this run. Every hit you take frightens Pim.",
165
+ },
166
+ {
167
+ kind: 'talk',
168
+ npc: OSKAR,
169
+ label: 'Show Pim the Landing and tell Oskar he is aboard',
170
+ hint: OSKAR_WHERE,
171
+ say: "A mapmaker, in this weather! Welcome, Master Sallow. Mind the wolves, they like new faces. I'll mark him down. Now the harbour.",
172
+ },
173
+ {
174
+ kind: 'reach',
175
+ area: landingBox('capital-harbour', 8),
176
+ at: { ...VOYAGE_LANDINGS['capital-harbour'], label: "The King's Harbour" },
177
+ label: "Sail Pim on to the King's Harbour (the fare is on Branson's account)",
178
+ hint: "Open the chart from Oskar or any harbour master and sail to the King's Harbour: your fare is still on Branson's account. Keep Pim out of trouble.",
179
+ },
180
+ {
181
+ kind: 'talk',
182
+ npc: MARLOW,
183
+ label: "Hand Pim to Marlow at the King's Harbour",
184
+ hint: MARLOW_WHERE,
185
+ say: "Pim Sallow, mapmaker, arrived whole. That is a rare thing on this run. I will sign him in.",
186
+ },
187
+ {
188
+ kind: 'talk',
189
+ npc: BRANSON,
190
+ label: 'Tell Branson Pim came to no harm',
191
+ hint: BRANSON_WHERE,
192
+ say: "Not a scratch on him, and not a word of complaint? He must be in love with the sea. That's a good passage.",
193
+ },
194
+ ],
195
+ passenger: {
196
+ name: NERVOUS_PASSENGER_NAME,
197
+ fromStep: 0,
198
+ toStep: 3,
199
+ restartStep: 0,
200
+ boltsAt: NERVOUS_PASSENGER_BOLTS_AT,
201
+ hurt: 'Pim flinches ({n} of {max}). Get him out of trouble.',
202
+ fail: "Pim has had enough: that was one blow too many, and he bolts for the nearest ship. Branson will send him again. You start the run over from the pier.",
203
+ },
204
+ done: "A passenger delivered whole is worth ten crates. You've earned your keep on this log.",
205
+ after: 'Pim sent me a map of the coast, with me on it. He draws a fine Branson.',
206
+ rewards: { coins: 450, xp: { explorer: 700 } },
207
+ },
208
+ // ---- 4. The Storm Crossing --------------------------------------------------------------------------------------------------
209
+ stormCrossing: {
210
+ giver: BRANSON,
211
+ requires: {
212
+ quest: NERVOUS_PASSENGER_ID,
213
+ combat: VOYAGE_COMBAT.storm,
214
+ refuse: 'The squalls are for those who have carried a passenger (The Nervous Passenger) and can hold their own (Combat 22). Come back when you have both.',
215
+ },
216
+ offer: "My glass is falling and a squall line is crossing the bay: ten minutes and it breaks. My log needs the weather entry from Oskar at the Landing and from Marlow at the King's Harbour before it does, and then back here. Fares waived, the ship will sail you. Do it in time and the log gets its best page. Are you in?",
217
+ accept: "The glass is sealed and the clock is running: ten minutes. Sail to the Landing and find Oskar, sail on to the King's Harbour and find Marlow, then home to me. The ship takes you free on these legs. The countdown will be called as it runs.",
218
+ decline: 'Then the storm breaks on an empty log. Your loss, and mine.',
219
+ clock: {
220
+ durationMs: STORM_CROSSING_MS,
221
+ warnAtMs: STORM_CROSSING_WARN_AT_MS,
222
+ warn: 'The squall line: {left} left. Next: {next}.',
223
+ fail: 'The squall breaks over the bay and the glass goes black. The entries were not in. Branson will give you another go when the weather clears.',
224
+ },
225
+ steps: [
226
+ {
227
+ kind: 'reach',
228
+ area: landingBox('frozen-shore', 8),
229
+ at: { ...VOYAGE_LANDINGS['frozen-shore'], label: "Branson's Landing" },
230
+ label: "Sail to Branson's Landing (the fare is waived)",
231
+ hint: "Open Branson's chart (talk to him, then Travel) and sail to Branson's Landing: the fare is waived on this run.",
232
+ },
233
+ {
234
+ kind: 'talk',
235
+ npc: OSKAR,
236
+ label: "Get the weather entry from Oskar at Branson's Landing",
237
+ hint: OSKAR_WHERE,
238
+ say: "Glass falling, wind backing north-west, ice on the boards. Write that down. And tell Marlow to bring the cranes in.",
239
+ },
240
+ {
241
+ kind: 'reach',
242
+ area: landingBox('capital-harbour', 8),
243
+ at: { ...VOYAGE_LANDINGS['capital-harbour'], label: "The King's Harbour" },
244
+ label: "Sail on to the King's Harbour (the fare is waived)",
245
+ hint: "Open the chart from Oskar and sail to the King's Harbour: the fare is waived on this run.",
246
+ },
247
+ {
248
+ kind: 'talk',
249
+ npc: MARLOW,
250
+ label: "Get the weather entry from Marlow at the King's Harbour",
251
+ hint: MARLOW_WHERE,
252
+ say: "Cranes in, boats lashed, lamps lit. The lighthouse will burn tonight. Put that in the log, and run.",
253
+ },
254
+ {
255
+ kind: 'talk',
256
+ npc: BRANSON,
257
+ label: 'Bring the log home to Branson before the squall breaks',
258
+ hint: BRANSON_WHERE,
259
+ say: 'Both entries, inside the time. The squall can break now.',
260
+ },
261
+ ],
262
+ done: "Two ports, one squall, and every entry inside the clock. That's the best page this log has had. Take this.",
263
+ after: 'The Storm Crossing page is the one visitors read first. It has your name on it.',
264
+ rewards: { coins: 650, xp: { explorer: 900 }, choiceXp: { qty: 400 } },
265
+ },
266
+ // ---- 5. The Captain's Last Entry --------------------------------------------------------------------------------------------
267
+ captainsLastEntry: {
268
+ giver: BRANSON,
269
+ requires: {
270
+ quest: STORM_CROSSING_ID,
271
+ combat: VOYAGE_COMBAT.last,
272
+ refuse: 'The last entry is for a captain who has weathered a squall (The Storm Crossing) and can hold a deck (Combat 28). Come back when you are both.',
273
+ },
274
+ offer: "Corsairs have taken to grappling the quays: a sloop comes alongside, the boarders swarm out, and my chart goes quiet till they're gone. The last page of the log is yours if you turn six of them back, at any of the three quays. Watch the harbour bells: a boarding lasts a few minutes, and the next comes round on the clock. Fight, don't fall, and come home.",
275
+ accept: "Six boarders, at the Long Pier, the Landing or the King's Harbour, whichever quay the bell rings for. Each port is boarded one slot in four; any harbour master can tell you when. Fares on the chart are waived for the run. Sail to the quay in trouble and fight there.",
276
+ decline: 'Then the corsairs keep the quays and the log stays open. A pity.',
277
+ steps: [
278
+ {
279
+ kind: 'kill',
280
+ npcKinds: [CORSAIR_STORY_KIND],
281
+ qty: CAPTAINS_LAST_BOARDERS,
282
+ npcLabel: 'Corsair boarders',
283
+ label: `Repel ${CAPTAINS_LAST_BOARDERS} corsair boarders at any chart quay`,
284
+ hint: 'Corsairs board one quay in four, for the first half of a slot (the harbour masters know the clock, and /corsairs is the same answer in chat). Sail to the quay that is under attack, or wait at the pier for its turn.',
285
+ },
286
+ {
287
+ kind: 'talk',
288
+ npc: BRANSON,
289
+ label: 'Close the log with Branson',
290
+ hint: BRANSON_WHERE,
291
+ say: 'Six corsairs turned back from my quays. That is the last entry. The log is full, and so is my heart.',
292
+ },
293
+ ],
294
+ done: "The last page is written. You are Branson's friend now: my chart fares are a fifth cheaper for you, for life.",
295
+ after: "Captain's Friend, in my book. The corsairs still come, but not for lack of you trying.",
296
+ rewards: { coins: 900, xp: { explorer: 1200 }, choiceXp: { qty: 600 }, perk: CAPTAINS_FRIEND_PERK },
297
+ },
298
+ };
299
+ /** The journal cards' words (quests.ts QUEST_META reads these through storyMeta). */
300
+ export const VOYAGE_QUEST_META = {
301
+ crateForTheCoast: {
302
+ title: 'A Crate for the Coast',
303
+ description: "Branson's log needs its first page. Carry a crate of caulking down to Bridgewarden Osmund at the Sundered Span, then tell Branson it is delivered.",
304
+ category: 'side',
305
+ art: { npc: 'branson' },
306
+ },
307
+ saltmereRun: {
308
+ title: 'The Saltmere Run',
309
+ description: "Take Branson's pickling brine across the free skiff to Tamsin Vale at Saltmere Crescent, and row back with the news.",
310
+ category: 'side',
311
+ art: { npc: 'branson' },
312
+ },
313
+ nervousPassenger: {
314
+ title: 'The Nervous Passenger',
315
+ description: "Sail Pim Sallow, a mapmaker who flinches at every wolf, to Branson's Landing and the King's Harbour on Branson's account. Three frights and he bolts, and the run starts over.",
316
+ category: 'side',
317
+ art: { npc: 'branson' },
318
+ },
319
+ stormCrossing: {
320
+ title: 'The Storm Crossing',
321
+ description: "A squall line is crossing the bay. Get the weather entry from Oskar at the Landing and Marlow at the King's Harbour, and be home with Branson inside ten minutes. The fares are waived.",
322
+ category: 'side',
323
+ art: { npc: 'branson' },
324
+ },
325
+ captainsLastEntry: {
326
+ title: "The Captain's Last Entry",
327
+ description: "Corsairs are boarding the quays. Turn back six of them at any chart quay, then close the log with Branson. He will cut your chart fares by a fifth.",
328
+ category: 'side',
329
+ art: { npc: 'branson' },
330
+ },
331
+ };
332
+ // ---------------------------------------------------------------------------------------------------------------------------------
333
+ // 2. Fares: the voyage waiver and Captain's Friend
334
+ // ---------------------------------------------------------------------------------------------------------------------------------
335
+ /**
336
+ * A voyage quest under way whose current step is a `reach` step ending at this port's landing waives the fare on that leg
337
+ * (the log's legs are Branson's business). Derived from the quest data: a quest step added later needs no list. It only
338
+ * waives the fare: the Battlefield Bridge lock is checked separately and never waived.
339
+ */
340
+ export function voyageWaivesFare(portId, quests, story) {
341
+ const land = VOYAGE_LANDINGS[portId];
342
+ for (const id of VOYAGE_QUEST_IDS) {
343
+ if (quests[id] !== 'active')
344
+ continue;
345
+ const step = VOYAGE_QUESTS[id].steps[story[id]?.step ?? 0];
346
+ if (step?.kind === 'reach' && land.x >= step.area.minX && land.x <= step.area.maxX && land.z >= step.area.minZ && land.z <= step.area.maxZ)
347
+ return true;
348
+ // The Captain's Last Entry: the sloop's quay is the whole point of the run, so every quay is free while it is under way.
349
+ if (id === CAPTAINS_LAST_ENTRY_ID && step?.kind === 'kill')
350
+ return true;
351
+ }
352
+ return false;
353
+ }
354
+ /** Branson's friend (the log done): a fifth off any fare, rounded to a whole coin; a free sailing stays free. */
355
+ export function captainsFriendFare(fare, quests) {
356
+ if (fare <= 0 || quests[CAPTAINS_LAST_ENTRY_ID] !== 'completed')
357
+ return fare;
358
+ return Math.max(1, Math.round(fare * (1 - CAPTAINS_FRIEND_DISCOUNT)));
359
+ }
360
+ // ---------------------------------------------------------------------------------------------------------------------------------
361
+ // 3. Corsair boardings (the ship-board set piece)
362
+ // ---------------------------------------------------------------------------------------------------------------------------------
363
+ /** Slots of this length per port; a port is boarded in one slot in `CORSAIR_EVERY`, for the first `CORSAIR_RAID_MS` of it. */
364
+ export const CORSAIR_SLOT_MS = 8 * 60_000;
365
+ export const CORSAIR_RAID_MS = 4 * 60_000;
366
+ export const CORSAIR_EVERY = 4;
367
+ /** Slot 0 of the clock (any fixed instant; a test pins it). */
368
+ export const CORSAIR_EPOCH_MS = Date.UTC(2026, 9, 14);
369
+ /** Each port is boarded in a different slot of the four, so exactly one slot in four has no boarding anywhere. */
370
+ export const CORSAIR_PORT_OFFSET = { 'hope-beach': 0, 'frozen-shore': 1, 'capital-harbour': 2 };
371
+ /** The boarders: Blackwake deckhands in looks (the nearest pirate the game has), scaled to whoever stands on the quay. */
372
+ export const CORSAIR_STREAM = {
373
+ kind: 'blackwakedeckhand',
374
+ name: 'Corsair boarder',
375
+ levels: [10, 35],
376
+ /** Alive at once with one player on the quay, plus `perExtraPlayer` for each more (twice `cap` at most). */
377
+ cap: 3,
378
+ perExtraPlayer: 1,
379
+ everyMs: 9_000,
380
+ firstWave: 2,
381
+ /** Boarders ignore anyone below this Combat (a newcomer on the pier is left alone). */
382
+ aggroCombat: 8,
383
+ aggroRadius: 7,
384
+ leashRadius: 30,
385
+ aggroText: 'A corsair leaps from the grappled sloop and comes at you!',
386
+ };
387
+ /** The quay's ground the boarders hold and the players fight on: a box of this reach round the landing. */
388
+ export const CORSAIR_ARENA_RADIUS = 11;
389
+ /** Boarders felled in one boarding, and still standing when it ends, that earn the quay's thanks (once per boarding per player). */
390
+ export const CORSAIR_KILLS_TO_PAY = 3;
391
+ export const CORSAIR_REWARD = { coins: 100, explorerXp: 150 };
392
+ export const CORSAIR_DIFFICULTY = 1;
393
+ export const CORSAIR_TEXTS = {
394
+ start: (port) => `Corsairs have grappled the quay at ${port}! Fight them off, or sail or walk clear.`,
395
+ quiet: (port) => `A corsair sloop has grappled the quay at ${port}, but the boarders have no interest in someone so green. Keep clear.`,
396
+ endPaid: 'The sloop casts off and the quay falls quiet. The harbour thanks you for standing your ground.',
397
+ endPlain: 'The sloop casts off and the quay falls quiet.',
398
+ hurt: (n) => `${n} boarder${n === 1 ? '' : 's'} down. Stay on your feet until the sloop casts off and the quay will thank you.`,
399
+ };
400
+ /** Whether a port is under boarding at `nowMs`, read off the wall clock. */
401
+ export function corsairWindow(nowMs, portId) {
402
+ const slot = Math.floor((nowMs - CORSAIR_EPOCH_MS) / CORSAIR_SLOT_MS);
403
+ const slotStartMs = CORSAIR_EPOCH_MS + slot * CORSAIR_SLOT_MS;
404
+ const slotRaided = ((((slot - CORSAIR_PORT_OFFSET[portId]) % CORSAIR_EVERY) + CORSAIR_EVERY) % CORSAIR_EVERY) === 0;
405
+ const raidEndMs = slotStartMs + CORSAIR_RAID_MS;
406
+ return { slot, slotStartMs, raidEndMs, slotRaided, raided: slotRaided && nowMs < raidEndMs };
407
+ }
408
+ /** Is this tile on the quay of this port (the arena of its boarding)? */
409
+ export function inCorsairArena(portId, x, z) {
410
+ const l = VOYAGE_LANDINGS[portId];
411
+ return Math.max(Math.abs(x - l.x), Math.abs(z - l.z)) <= CORSAIR_ARENA_RADIUS;
412
+ }
413
+ /** The port whose quay holds this tile, or null. */
414
+ export function corsairPortAt(x, z) {
415
+ for (const id of VOYAGE_PORT_IDS)
416
+ if (inCorsairArena(id, x, z))
417
+ return id;
418
+ return null;
419
+ }
420
+ /** "The Long Pier is boarded now (2 minutes left)" or "next boarding at the Landing in 5 minutes": one line for /corsairs and the masters. */
421
+ export function corsairDescribe(nowMs) {
422
+ const secs = (ms) => Math.max(1, Math.round(ms / 1000));
423
+ const span = (ms) => {
424
+ const s = secs(ms);
425
+ return s < 90 ? `${s} seconds` : `${Math.round(s / 60)} minutes`;
426
+ };
427
+ const lines = [];
428
+ for (const id of VOYAGE_PORT_IDS) {
429
+ const w = corsairWindow(nowMs, id);
430
+ if (w.raided) {
431
+ lines.push(`${VOYAGE_PORT_LABELS[id]}: corsairs alongside now, ${span(w.raidEndMs - nowMs)} left`);
432
+ continue;
433
+ }
434
+ const here = corsairWindow(nowMs, id);
435
+ for (let k = 1; k <= CORSAIR_EVERY + 1; k++) {
436
+ const startMs = here.slotStartMs + k * CORSAIR_SLOT_MS;
437
+ if (!corsairWindow(startMs, id).slotRaided)
438
+ continue;
439
+ lines.push(`${VOYAGE_PORT_LABELS[id]}: next boarding in ${span(startMs - nowMs)}`);
440
+ break;
441
+ }
442
+ }
443
+ return lines.join('; ');
444
+ }
445
+ // ---------------------------------------------------------------------------------------------------------------------------------
446
+ // 4. The shipping board (daily freight contracts)
447
+ // ---------------------------------------------------------------------------------------------------------------------------------
448
+ /** Contracts a character may finish in a day (three; the fourth is the members' extra, like the Deep Sea). */
449
+ export const SHIPPING_DAILY_CAP = 3;
450
+ export const SHIPPING_MEMBER_EXTRA = 1;
451
+ /** A contract is on the board in a band of Combat; the board shows this many at a port. */
452
+ export const SHIPPING_BOARD_SIZE = 3;
453
+ const contract = (id, label, cargo, to, minCombat, maxCombat, coins) => ({ id, label, cargo, to, minCombat, maxCombat, coins, explorerXp: 60 + Math.round(coins / 10), bond: Math.floor((coins * 0.2) / 5) * 5 });
454
+ /**
455
+ * The pool. Cargo values (what any trader pays) and the coins here follow `coins ~= 1.5 x value + 50` (a hauling premium; the
456
+ * backend smoke `voyages-smoke.ts` checks every row against the live counters).
457
+ */
458
+ export const SHIPPING_CONTRACTS = [
459
+ contract('crab-landing', 'Cooked crab for the Landing galley', { kind: 'cookedcrab', qty: 12, label: 'Cooked crab' }, 'frozen-shore', 8, 30, 195),
460
+ contract('driftwood-harbour', 'Driftwood for the harbour braziers', { kind: 'driftwood', qty: 20, label: 'Driftwood' }, 'capital-harbour', 8, 30, 140),
461
+ contract('shells-pier', 'Seashells for the pier stalls', { kind: 'seashell', qty: 12, label: 'Seashells' }, 'hope-beach', 8, 30, 140),
462
+ contract('snapper-harbour', 'Fresh tide snapper for the harbour fishwives', { kind: 'rawtidesnapper', qty: 10, label: 'Raw tide snapper' }, 'capital-harbour', 10, 30, 185),
463
+ contract('charcoal-landing', 'Charcoal for the Landing stoves', { kind: 'charcoal', qty: 15, label: 'Charcoal' }, 'frozen-shore', 12, 34, 320),
464
+ contract('charcoal-pier', 'Charcoal for the pier forge', { kind: 'charcoal', qty: 20, label: 'Charcoal' }, 'hope-beach', 14, 36, 410),
465
+ contract('grayling-harbour', 'Cooked grayling for the harbour inn', { kind: 'cookedgrayling', qty: 8, label: 'Cooked grayling' }, 'capital-harbour', 16, 36, 435),
466
+ contract('grayling-pier', 'Cooked grayling for the pier cookhouse', { kind: 'cookedgrayling', qty: 6, label: 'Cooked grayling' }, 'hope-beach', 16, 36, 340),
467
+ contract('silver-harbour', 'Silver bars for the harbour mint', { kind: 'silverbar', qty: 3, label: 'Silver bars' }, 'capital-harbour', 28, 40, 390),
468
+ contract('silver-pier', 'Silver bars for the pier chandlers', { kind: 'silverbar', qty: 4, label: 'Silver bars' }, 'hope-beach', 28, 40, 500),
469
+ contract('gold-landing', 'Gold bars for the Landing strongroom', { kind: 'goldbar', qty: 3, label: 'Gold bars' }, 'frozen-shore', 30, 40, 545),
470
+ contract('gold-pier', 'Gold bars for the pier counting-house', { kind: 'goldbar', qty: 2, label: 'Gold bars' }, 'hope-beach', 30, 40, 380),
471
+ ];
472
+ export function shippingContractById(id) {
473
+ return SHIPPING_CONTRACTS.find((c) => c.id === id) ?? null;
474
+ }
475
+ /** The day a moment falls in (UTC); the same count as dailyHooks.ts dailyDay, duplicated so this file imports nothing from it. */
476
+ export function shippingDay(nowMs) {
477
+ return Math.floor(nowMs / (24 * 60 * 60_000));
478
+ }
479
+ function mix(day, salt) {
480
+ let seed = (Math.imul(day + 1, 2654435761) + Math.imul(salt + 13, 40503) + 211) >>> 0;
481
+ seed = (Math.imul(seed ^ (seed >>> 15), 2246822519) + 3266489917) >>> 0;
482
+ seed = (Math.imul(seed ^ (seed >>> 13), 3266489917) + 668265263) >>> 0;
483
+ return seed >>> 0;
484
+ }
485
+ /** Ports a character may take freight to: Hope Beach always, the others once the Battlefield Bridge is mended (the chart's own lock). */
486
+ export function shippingOpenPorts(quests) {
487
+ return quests.battlefieldBridge === 'completed' ? [...VOYAGE_PORT_IDS] : ['hope-beach'];
488
+ }
489
+ /**
490
+ * Today's contracts at this port for this character: the pool filtered to the character's Combat band and to destinations
491
+ * that are open to them and are not this port, three of them picked by the day and the port (a member sees one more).
492
+ * Pure: the server and the client agree, and the same day gives the same board. Empty when nothing is open.
493
+ */
494
+ export function shippingBoard(input) {
495
+ const open = new Set(shippingOpenPorts(input.quests));
496
+ const eligible = SHIPPING_CONTRACTS.filter((c) => c.to !== input.here && open.has(c.to) && input.combat >= c.minCombat && input.combat <= c.maxCombat);
497
+ const want = SHIPPING_BOARD_SIZE + (input.member ? SHIPPING_MEMBER_EXTRA : 0);
498
+ const pool = [...eligible];
499
+ const out = [];
500
+ const salt = VOYAGE_PORT_IDS.indexOf(input.here) * 97 + pool.length;
501
+ let draw = 0;
502
+ while (pool.length > 0 && out.length < want) {
503
+ const i = mix(input.day, salt + draw++) % pool.length;
504
+ out.push(pool.splice(i, 1)[0]);
505
+ }
506
+ return out;
507
+ }
508
+ export const EMPTY_SHIPPING = { day: 0, done: 0, active: '', activeDay: 0, bond: 0 };
509
+ export function normalizeShippingState(raw) {
510
+ if (!raw || typeof raw !== 'object')
511
+ return { ...EMPTY_SHIPPING };
512
+ const r = raw;
513
+ const int = (v, max) => (typeof v === 'number' && Number.isFinite(v) && v > 0 ? Math.min(max, Math.floor(v)) : 0);
514
+ const active = typeof r.active === 'string' && shippingContractById(r.active) ? r.active : '';
515
+ return {
516
+ day: int(r.day, 1_000_000),
517
+ done: int(r.done, 1000),
518
+ active,
519
+ activeDay: active ? int(r.activeDay, 1_000_000) : 0,
520
+ bond: active ? int(r.bond, 100_000) : 0,
521
+ };
522
+ }
523
+ /** Contracts the character may still finish today. */
524
+ export function shippingLeftToday(state, day, member) {
525
+ const cap = SHIPPING_DAILY_CAP + (member ? SHIPPING_MEMBER_EXTRA : 0);
526
+ const done = state.day === day ? state.done : 0;
527
+ return Math.max(0, cap - done);
528
+ }
529
+ /** The contract under way, or null (a lapsed one is returned too, with `lapsed` true: its day is over). */
530
+ export function shippingActive(state, day) {
531
+ const c = state.active ? shippingContractById(state.active) : null;
532
+ return c ? { contract: c, lapsed: state.activeDay !== day } : null;
533
+ }
534
+ /** A loaded freight contract waives the fare to its port: the active contract is going there, in time, and the bag holds the cargo. */
535
+ export function freightWaivesFare(portId, state, day, held) {
536
+ const a = shippingActive(state, day);
537
+ if (!a || a.lapsed || a.contract.to !== portId)
538
+ return false;
539
+ return held(a.contract.cargo.kind) >= a.contract.cargo.qty;
540
+ }
541
+ /** The shipping board's dialog actions (the three travel masters' menus send these). */
542
+ export const SHIPPING_ACTION_PREFIX = 'ship:';
543
+ export const SHIPPING_TAKE_PREFIX = 'ship:take:';
544
+ export const SHIPPING_DELIVER_ACTION = 'ship:deliver';
545
+ export const SHIPPING_ABANDON_ACTION = 'ship:abandon';
546
+ export const SHIPPING_BOARD_ACTION = 'ship:board';
547
+ export function shippingTakeAction(id) {
548
+ return `${SHIPPING_TAKE_PREFIX}${id}`;
549
+ }
550
+ export function shippingTakeId(action) {
551
+ return action.startsWith(SHIPPING_TAKE_PREFIX) ? action.slice(SHIPPING_TAKE_PREFIX.length) : null;
552
+ }
553
+ /** One board row in words ("Cooked crab x12 to Branson's Landing: 195 coins, bond 35"). */
554
+ export function shippingContractLine(c) {
555
+ return `${c.cargo.label} x${c.cargo.qty} to ${VOYAGE_PORT_LABELS[c.to]}: ${c.coins} coins, bond ${c.bond}`;
556
+ }
557
+ // ---------------------------------------------------------------------------------------------------------------------------------
558
+ // 5. The Explorer's Ledger page
559
+ // ---------------------------------------------------------------------------------------------------------------------------------
560
+ export const VOYAGE_MARKS = {
561
+ boardingPier: 'voyage:boarding-pier',
562
+ boardingLanding: 'voyage:boarding-landing',
563
+ boardingHarbour: 'voyage:boarding-harbour',
564
+ contract: 'voyage:contract',
565
+ passenger: 'voyage:passenger',
566
+ storm: 'voyage:storm',
567
+ };
568
+ export const LEDGER_VOYAGE_LINES = [
569
+ { id: VOYAGE_MARKS.boardingPier, label: "Held the Long Pier against a corsair boarding" },
570
+ { id: VOYAGE_MARKS.boardingLanding, label: "Held Branson's Landing against a corsair boarding" },
571
+ { id: VOYAGE_MARKS.boardingHarbour, label: "Held the King's Harbour against a corsair boarding" },
572
+ { id: VOYAGE_MARKS.contract, label: 'Delivered a shipping contract' },
573
+ { id: VOYAGE_MARKS.passenger, label: 'Delivered a nervous passenger whole' },
574
+ { id: VOYAGE_MARKS.storm, label: 'Beat the squall to the log' },
575
+ ];
576
+ /** The ledger mark a boarding at this port writes. */
577
+ export function corsairLedgerMark(portId) {
578
+ return portId === 'hope-beach' ? VOYAGE_MARKS.boardingPier : portId === 'frozen-shore' ? VOYAGE_MARKS.boardingLanding : VOYAGE_MARKS.boardingHarbour;
579
+ }
580
+ //# sourceMappingURL=voyages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voyages.js","sourceRoot":"","sources":["../src/voyages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAOtD,MAAM,CAAC,MAAM,eAAe,GAA4B,CAAC,YAAY,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAE1G;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,CAA2B,EAA4B,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACvH,MAAM,CAAC,MAAM,eAAe,GAA6D;IACvF,YAAY,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAC5C,cAAc,EAAE,UAAU,CAAC,oBAAoB,CAAC;IAChD,iBAAiB,EAAE,UAAU,CAAC,eAA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