@maka/maka-cli 5.9.0 → 5.11.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.
Files changed (81) hide show
  1. package/bundle/typescript/package.json +1 -1
  2. package/bundle/typescript/src/commands/game/sideQuest/archetypes.js +3 -1
  3. package/bundle/typescript/src/commands/game/sideQuest/archetypes.js.map +1 -1
  4. package/bundle/typescript/src/commands/game/sideQuest/commands/ask.js +1 -1
  5. package/bundle/typescript/src/commands/game/sideQuest/commands/ask.js.map +1 -1
  6. package/bundle/typescript/src/commands/game/sideQuest/commands/call.js +10 -2
  7. package/bundle/typescript/src/commands/game/sideQuest/commands/call.js.map +1 -1
  8. package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js +2 -0
  9. package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js.map +1 -1
  10. package/bundle/typescript/src/commands/game/sideQuest/commands/contacts.js +8 -2
  11. package/bundle/typescript/src/commands/game/sideQuest/commands/contacts.js.map +1 -1
  12. package/bundle/typescript/src/commands/game/sideQuest/commands/docwagon.d.ts +14 -0
  13. package/bundle/typescript/src/commands/game/sideQuest/commands/docwagon.js +86 -0
  14. package/bundle/typescript/src/commands/game/sideQuest/commands/docwagon.js.map +1 -0
  15. package/bundle/typescript/src/commands/game/sideQuest/commands/grapple.js +8 -2
  16. package/bundle/typescript/src/commands/game/sideQuest/commands/grapple.js.map +1 -1
  17. package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js +6 -4
  18. package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js.map +1 -1
  19. package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js +5 -0
  20. package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js.map +1 -1
  21. package/bundle/typescript/src/commands/game/sideQuest/commands/job-offer.d.ts +32 -0
  22. package/bundle/typescript/src/commands/game/sideQuest/commands/job-offer.js +94 -0
  23. package/bundle/typescript/src/commands/game/sideQuest/commands/job-offer.js.map +1 -0
  24. package/bundle/typescript/src/commands/game/sideQuest/commands/lead.d.ts +39 -0
  25. package/bundle/typescript/src/commands/game/sideQuest/commands/lead.js +187 -0
  26. package/bundle/typescript/src/commands/game/sideQuest/commands/lead.js.map +1 -0
  27. package/bundle/typescript/src/commands/game/sideQuest/commands/palm.d.ts +16 -0
  28. package/bundle/typescript/src/commands/game/sideQuest/commands/palm.js +86 -0
  29. package/bundle/typescript/src/commands/game/sideQuest/commands/palm.js.map +1 -0
  30. package/bundle/typescript/src/commands/game/sideQuest/commands/perform.d.ts +13 -0
  31. package/bundle/typescript/src/commands/game/sideQuest/commands/perform.js +48 -0
  32. package/bundle/typescript/src/commands/game/sideQuest/commands/perform.js.map +1 -0
  33. package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js +13 -3
  34. package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js.map +1 -1
  35. package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +7 -2
  36. package/bundle/typescript/src/commands/game/sideQuest/commands/search.js.map +1 -1
  37. package/bundle/typescript/src/commands/game/sideQuest/commands/source.d.ts +9 -0
  38. package/bundle/typescript/src/commands/game/sideQuest/commands/source.js +159 -0
  39. package/bundle/typescript/src/commands/game/sideQuest/commands/source.js.map +1 -0
  40. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js +6 -3
  41. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js.map +1 -1
  42. package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +79 -1
  43. package/bundle/typescript/src/commands/game/sideQuest/game.js +483 -13
  44. package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
  45. package/bundle/typescript/src/commands/game/sideQuest/models/npc.d.ts +2 -0
  46. package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +12 -1
  47. package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
  48. package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +21 -1
  49. package/bundle/typescript/src/commands/game/sideQuest/models/player.js +56 -9
  50. package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
  51. package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.d.ts +10 -0
  52. package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js +10 -0
  53. package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js.map +1 -1
  54. package/bundle/typescript/src/commands/game/sideQuest/models/scene.d.ts +17 -0
  55. package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +39 -1
  56. package/bundle/typescript/src/commands/game/sideQuest/models/scene.js.map +1 -1
  57. package/bundle/typescript/src/commands/game/sideQuest/scenes/scene2.json +299 -60
  58. package/bundle/typescript/src/commands/game/sideQuest/types/save-file.d.ts +230 -0
  59. package/bundle/typescript/src/commands/game/sideQuest/types/save-file.js +14 -0
  60. package/bundle/typescript/src/commands/game/sideQuest/types/save-file.js.map +1 -0
  61. package/bundle/typescript/src/commands/game/sideQuest/ui.d.ts +6 -0
  62. package/bundle/typescript/src/commands/game/sideQuest/ui.js +48 -4
  63. package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
  64. package/bundle/typescript/src/commands/game/sideQuest/utilities/cloud-saves.d.ts +50 -0
  65. package/bundle/typescript/src/commands/game/sideQuest/utilities/cloud-saves.js +232 -0
  66. package/bundle/typescript/src/commands/game/sideQuest/utilities/cloud-saves.js.map +1 -0
  67. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.d.ts +3 -0
  68. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js +41 -9
  69. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js.map +1 -1
  70. package/bundle/typescript/src/commands/game/sideQuest/utilities/comm-style.d.ts +19 -0
  71. package/bundle/typescript/src/commands/game/sideQuest/utilities/comm-style.js +13 -0
  72. package/bundle/typescript/src/commands/game/sideQuest/utilities/comm-style.js.map +1 -1
  73. package/bundle/typescript/src/commands/game/sideQuest/utilities/docwagon.d.ts +33 -0
  74. package/bundle/typescript/src/commands/game/sideQuest/utilities/docwagon.js +44 -0
  75. package/bundle/typescript/src/commands/game/sideQuest/utilities/docwagon.js.map +1 -0
  76. package/bundle/typescript/src/commands/game/sideQuest/utilities/persistence.d.ts +71 -0
  77. package/bundle/typescript/src/commands/game/sideQuest/utilities/persistence.js +447 -0
  78. package/bundle/typescript/src/commands/game/sideQuest/utilities/persistence.js.map +1 -0
  79. package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +165 -18
  80. package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
  81. package/package.json +1 -1
@@ -2,6 +2,8 @@ import blessed from 'blessed';
2
2
  import { ISceneSeedJson } from './types/seed/scene-seed.js';
3
3
  import { Item } from './models/item.js';
4
4
  import { Player, Inventory, Room, Scene } from './models/_index.js';
5
+ import { ISaveFileV1, ISavedItem, SaveReason } from './types/save-file.js';
6
+ import { IDocwagonContract } from './utilities/docwagon.js';
5
7
  import { ILifestyleTier } from './utilities/commerce.js';
6
8
  import { NPC } from './models/npc.js';
7
9
  import { AutoFight } from './utilities/auto-fight.js';
@@ -36,8 +38,57 @@ export default class Game {
36
38
  spent: number;
37
39
  gigs: number;
38
40
  asked: boolean;
41
+ role?: string;
39
42
  }>;
43
+ pendingProcurements: {
44
+ contact: string;
45
+ itemConfig: ISavedItem;
46
+ price: number;
47
+ }[];
48
+ docwagon?: IDocwagonContract;
49
+ enlistedAlly?: {
50
+ name: string;
51
+ description: string;
52
+ combat: Record<string, unknown>;
53
+ };
54
+ commandRefusals: Record<string, number>;
55
+ performedThisCycle: boolean;
56
+ /** The recruited contact joins at the jobsite curb ("takes their own
57
+ * ride and meets you there" -- the companion convention). */
58
+ spawnEnlistedAlly(): string[];
59
+ /** Bills a DocWagon fee: cred first, shortfall onto the rent tab (the
60
+ * street's one universal collections agency). Returns the line. */
61
+ private billDocwagon;
62
+ /**
63
+ * The band answers (SR5e p.450). 'htr': a High Threat Response team
64
+ * extracts a flatlining KO'd runner instead of the street deciding.
65
+ * 'resusc': clinical death reversed -- a free resuscitation or the
66
+ * 5,000 fee -- the sanctioned carve-out to permadeath (player ruling;
67
+ * overflow-past-Body instant death isn't modeled yet, so every death
68
+ * is currently within reach of the crash cart). Returns true when the
69
+ * rescue engages -- the caller must then NOT end the game.
70
+ */
71
+ tryDocwagonRescue(kind: 'htr' | 'resusc', opts?: {
72
+ standingHostiles?: string[];
73
+ }): boolean;
74
+ /** Where the wagon drops you (player ruling: the CLINIC, not your own
75
+ * cot): the district Street Doc's room, generically -- so generated
76
+ * hubs work too. Falls back to the hideout if the hub has no doc. */
77
+ private docwagonDropOff;
78
+ /** The ride out on a stretcher: mid-run this is a homecoming (rent and
79
+ * all), then the recovery bed at the clinic. */
80
+ private docwagonMedevac;
40
81
  /** How much juice the name carries, read off the role. */
82
+ /**
83
+ * A contact's ROLE, the SR5e archetype list (p.98: fixer, arms dealer,
84
+ * smuggler, talismonger, street doc, mechanic, bartender...) -- same
85
+ * keyword school as connectionFor below. Stored on the contact entry
86
+ * at open time so the roster (and the save) carry it.
87
+ */
88
+ static roleOf(npc: {
89
+ name: string;
90
+ description?: string;
91
+ }): string;
41
92
  static connectionFor(npc: {
42
93
  name: string;
43
94
  description?: string;
@@ -60,6 +111,10 @@ export default class Game {
60
111
  boundDevice?: Item;
61
112
  }[];
62
113
  private _pendingRedeploys;
114
+ private _saveFilePath?;
115
+ private _dead;
116
+ private _resume?;
117
+ private _hubSeed?;
63
118
  /**
64
119
  * The one correct runtime NPC spawn (mirrors scene-factory's seed
65
120
  * path): construct with a scene-bound registry, add to the scene
@@ -117,6 +172,9 @@ export default class Game {
117
172
  * cumulative spend raises it at each full 1,000 nuyen (cap 3).
118
173
  * Returns a player-facing line when something changed, else null.
119
174
  */
175
+ /** A hub-cast member by name, for roster displays that need the live
176
+ * actor (contacts.ts reads their commlink to show reachability). */
177
+ hubActor(name: string): Player | NPC | undefined;
120
178
  touchContact(name: string, kind: 'trade' | 'gig', spent?: number): string | null;
121
179
  pendingSale?: {
122
180
  itemName: string;
@@ -191,6 +249,9 @@ export default class Game {
191
249
  get homeRoom(): Room | undefined;
192
250
  private _pendingRunSeed?;
193
251
  private _pendingRunTier?;
252
+ pendingRunAccepted: boolean;
253
+ /** Trash the offer wholesale ("decline", and any future fixer snub). */
254
+ clearPendingRun(): void;
194
255
  get pendingRun(): ISceneSeedJson | undefined;
195
256
  get pendingRunTier(): number | undefined;
196
257
  /**
@@ -230,6 +291,23 @@ export default class Game {
230
291
  get metaBox(): blessed.Widgets.BoxElement;
231
292
  get inputBox(): blessed.Widgets.TextboxElement;
232
293
  init(options: IMainGameConfig, screen: blessed.Widgets.Screen): Promise<string>;
294
+ /**
295
+ * Everything a save restores beyond the seed synthesis: the player,
296
+ * the hub world overlay, and the Game-level ledgers. Ordering inside
297
+ * matters less than its POSITION in init(): after seedHomeTurfContacts
298
+ * and snapshotVendorStock (both deliberately pre-overlay).
299
+ */
300
+ private applyResumeState;
301
+ /**
302
+ * THE single save routine -- every safe beat funnels here. Guards make
303
+ * it a silent no-op anywhere a save would lie: mid-run (the "runs are
304
+ * disposable" ruling lives in the scene === _hubScene check), downed
305
+ * or KO'd, mid-exchange, dead, or before init finishes. Synchronous by
306
+ * design so the process-exit quit hook can use it; failures log and
307
+ * never crash a turn.
308
+ */
309
+ requestSave(reason: SaveReason): void;
310
+ private buildSaveFile;
233
311
  /**
234
312
  * Synchronous readiness check for continueToNextScene() -- lets callers
235
313
  * give instant feedback for the "not ready yet" cases (job not done, no
@@ -352,7 +430,7 @@ export default class Game {
352
430
  updateEquipment(_playerEquipment: PlayerEquipment): void;
353
431
  updateExits(_room: Room): void;
354
432
  updateInventory(_playerInventory: Inventory, _currencyName?: string): void;
355
- static getInstance(player: Player, sceneSeed: ISceneSeedJson): Promise<Game>;
433
+ static getInstance(player: Player, sceneSeed: ISceneSeedJson, resume?: ISaveFileV1): Promise<Game>;
356
434
  handleInput(input: string): Promise<string | null>;
357
435
  /**
358
436
  * The help taxonomy: every entry is [primary, ...aliases], grouped the