@maka/maka-cli 5.4.0 → 5.6.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/bundle/typescript/package.json +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.d.ts +20 -1
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js +76 -11
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/advance.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/advance.js +65 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/advance.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/assense.d.ts +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js +72 -29
- package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js +21 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js +39 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/brandish.d.ts +21 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/brandish.js +82 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/brandish.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.d.ts +13 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.js +93 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js +21 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/drone.js +13 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/drone.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/drop.js +3 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/drop.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js +19 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.js +9 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.d.ts +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js +33 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js +43 -20
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.d.ts +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js +75 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/inv.js +5 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/inv.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +16 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.d.ts +18 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.js +100 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pick.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js +22 -7
- package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js +8 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +55 -8
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js +11 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.d.ts +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.js +35 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js +21 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/subdue.js +4 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/subdue.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js +70 -13
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js +8 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/unequip.js +6 -3
- package/bundle/typescript/src/commands/game/sideQuest/commands/unequip.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.js +5 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/room-factory.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/room-factory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.d.ts +175 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js +673 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.d.ts +64 -9
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js +265 -434
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +69 -1
- package/bundle/typescript/src/commands/game/sideQuest/game.js +388 -67
- package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.d.ts +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +92 -3
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +66 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js +151 -15
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js +29 -4
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/room.d.ts +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js +14 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.d.ts +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +35 -3
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene1.json +275 -105
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene2.json +662 -233
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/player-seed.d.ts +8 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/puzzle-seed.d.ts +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/room-seed.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/scene-seed.d.ts +6 -3
- package/bundle/typescript/src/commands/game/sideQuest/ui.js +19 -20
- package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.d.ts +6 -4
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js +31 -5
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.d.ts +34 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js +72 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +27 -3
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/tools/ai/ai.class.d.ts +8 -1
- package/bundle/typescript/src/tools/ai/ai.class.js +8 -3
- package/bundle/typescript/src/tools/ai/ai.class.js.map +1 -1
- package/bundle/typescript/src/tools/https/https.class.d.ts +2 -2
- package/bundle/typescript/src/tools/https/https.class.js +10 -4
- package/bundle/typescript/src/tools/https/https.class.js.map +1 -1
- package/bundle/typescript/src/tools/https/https.interface.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from './command.js';
|
|
2
|
+
import { canReachHost } from '../utilities/planes.js';
|
|
2
3
|
export class TakeCommand extends Command {
|
|
3
4
|
static verb = 'take';
|
|
4
5
|
static description = 'Pick up an item. "take all" sweeps everything here -- but only after you have searched the room.';
|
|
@@ -21,48 +22,85 @@ export class TakeCommand extends Command {
|
|
|
21
22
|
*/
|
|
22
23
|
takeAll() {
|
|
23
24
|
const room = this.actor.currentLocation;
|
|
24
|
-
// You sweep what you've SEEN: "take all" only works after this actor
|
|
25
|
-
// has actually searched this room. (When perception checks arrive,
|
|
26
|
-
// this same gate narrows further to what the search roll revealed.)
|
|
27
|
-
if (!room.searchedBy.has(this.actor.name)) {
|
|
28
|
-
return `You haven't cased this place yet -- "search" first, then sweep what you find.`;
|
|
29
|
-
}
|
|
30
25
|
// Your plane's items only: an astral form can SEE the meat world's
|
|
31
26
|
// gear but its hands pass straight through; a Matrix persona sweeps
|
|
32
27
|
// files, not furniture.
|
|
33
28
|
if (this.actor.plane === 'astral') {
|
|
34
29
|
return `Your hands pass through everything here -- the astral can look, not carry.`;
|
|
35
30
|
}
|
|
36
|
-
|
|
31
|
+
// A matrix-plane sweep only ever contains the host's files -- which
|
|
32
|
+
// stay vaulted until the host is cracked, and unreachable entirely
|
|
33
|
+
// when it's air-gapped and the persona rode in wireless (see the
|
|
34
|
+
// single-take gate below for the same rules one item at a time).
|
|
35
|
+
if (this.actor.plane === 'matrix' && room.hasNode) {
|
|
36
|
+
if (!canReachHost(this.actor, room)) {
|
|
37
|
+
return `The host here is AIR-GAPPED -- its files never touch the wireless grid. Jack in from a hard line INSIDE ${room.name} (get your body here first).`;
|
|
38
|
+
}
|
|
39
|
+
if (!room.hostCracked && room.inventory.getAllItems().some(i => i.plane === 'matrix')) {
|
|
40
|
+
return `The files here are sealed inside the host's data vault. Crack the node first ("hack") -- then sweep it clean.`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// You sweep what you've SEEN. Normally that means having searched this
|
|
44
|
+
// room -- but gear that arrived in the open in front of you (a dead
|
|
45
|
+
// NPC's scattered kit, a witnessed drop; see Room.plainSightItems)
|
|
46
|
+
// never needed casing, so an unsearched sweep grabs exactly that
|
|
47
|
+
// subset. (When perception checks arrive, the searched gate narrows
|
|
48
|
+
// further to what the search roll revealed.)
|
|
49
|
+
const searched = room.searchedBy.has(this.actor.name);
|
|
50
|
+
let items = [...room.inventory.getAllItems()].filter(i => i.plane === this.actor.plane);
|
|
51
|
+
if (!searched) {
|
|
52
|
+
items = items.filter(i => room.plainSightItems.has(i.name.toLowerCase()));
|
|
53
|
+
if (items.length === 0) {
|
|
54
|
+
return `You haven't cased this place yet -- "search" first, then sweep what you find.`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
37
57
|
if (items.length === 0) {
|
|
38
58
|
return `There's nothing here to take.`;
|
|
39
59
|
}
|
|
40
60
|
this.actor.performAction('take', 'everything in the room');
|
|
41
61
|
const lines = [`You sweep ${room.name}:`];
|
|
42
62
|
let tookAnything = false;
|
|
63
|
+
const taken = [];
|
|
43
64
|
for (const item of items) {
|
|
44
65
|
try {
|
|
45
66
|
this.actor.addInventory(item);
|
|
46
67
|
room.inventory.removeItem(item.name);
|
|
68
|
+
room.plainSightItems.delete(item.name.toLowerCase());
|
|
47
69
|
tookAnything = true;
|
|
70
|
+
taken.push(item.name);
|
|
48
71
|
this.logger.write(`take all: ${this.actor.name} took "${item.name}" from ${room.name}.`);
|
|
49
72
|
lines.push(` • took the ${item.name}`);
|
|
50
73
|
if (item.owner && item.owner !== this.actor.name) {
|
|
51
74
|
this.scene.addWorldEvent(`${this.actor.name} took ${item.name} (belonging to ${item.owner}) from ${room.name}.`);
|
|
52
75
|
}
|
|
53
|
-
if (!this.scene.isWinConditionTarget(this.actor.name)) {
|
|
54
|
-
this.scene.checkWinCondition(item.name, this.actor.name);
|
|
55
|
-
}
|
|
56
76
|
}
|
|
57
77
|
catch {
|
|
58
78
|
this.logger.write(`take all: "${item.name}" too heavy for ${this.actor.name}.`);
|
|
59
79
|
lines.push(` • the ${item.name} is too heavy to carry -- left it`);
|
|
60
80
|
}
|
|
61
81
|
}
|
|
82
|
+
if (!searched) {
|
|
83
|
+
lines.push(` (just what was lying in the open -- "search" to case the rest of the place)`);
|
|
84
|
+
}
|
|
62
85
|
if (tookAnything) {
|
|
63
86
|
this.scene.updateInventory(this.scene.getPlayer().inventory);
|
|
64
87
|
}
|
|
65
|
-
|
|
88
|
+
// Win-condition checks run AFTER the sweep summary renders: the check
|
|
89
|
+
// logs the JOB COMPLETE banner itself, and running it per-item used to
|
|
90
|
+
// splice the banner between "took the..." lines mid-list. For the
|
|
91
|
+
// player, print the summary directly and return nothing (the combat
|
|
92
|
+
// self-announce pattern); an NPC actor still gets the text back for
|
|
93
|
+
// its AI history, where ordering doesn't matter.
|
|
94
|
+
const isPlayer = this.actor === this.scene.getPlayer();
|
|
95
|
+
if (isPlayer) {
|
|
96
|
+
this.logger.log(lines.join('\n'));
|
|
97
|
+
}
|
|
98
|
+
if (!this.scene.isWinConditionTarget(this.actor.name)) {
|
|
99
|
+
for (const name of taken) {
|
|
100
|
+
this.scene.checkWinCondition(name, this.actor.name);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return isPlayer ? '' : lines.join('\n');
|
|
66
104
|
}
|
|
67
105
|
take(args) {
|
|
68
106
|
const itemName = args?.join(' ').toLowerCase();
|
|
@@ -89,6 +127,17 @@ export class TakeCommand extends Command {
|
|
|
89
127
|
? `The ${itemName} is DATA -- it only exists on the grid. Jack in to take it.`
|
|
90
128
|
: `The ${itemName} isn't reachable from this plane.`;
|
|
91
129
|
}
|
|
130
|
+
// The host is the vault: files in a node room stay sealed until the
|
|
131
|
+
// host is cracked ("hack") -- and an air-gapped host doesn't even talk
|
|
132
|
+
// to personas who rode in over the wireless grid (planes.canReachHost).
|
|
133
|
+
if (item.plane === 'matrix' && room.hasNode) {
|
|
134
|
+
if (!canReachHost(this.actor, room)) {
|
|
135
|
+
return `The host here is AIR-GAPPED -- its files never touch the wireless grid. Jack in from a hard line INSIDE ${room.name} (get your body here first).`;
|
|
136
|
+
}
|
|
137
|
+
if (!room.hostCracked) {
|
|
138
|
+
return `The ${item.name} is sealed inside the host's data vault. Crack the node first ("hack") -- then it's yours.`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
92
141
|
// Try adding the item to the player's inventory
|
|
93
142
|
try {
|
|
94
143
|
this.actor.performAction('take', itemName);
|
|
@@ -99,17 +148,25 @@ export class TakeCommand extends Command {
|
|
|
99
148
|
}
|
|
100
149
|
// Remove item from room's inventory
|
|
101
150
|
room.inventory.removeItem(itemName);
|
|
151
|
+
room.plainSightItems.delete(item.name.toLowerCase());
|
|
102
152
|
this.logger.write(`Successfully removed "${itemName}" from ${room.name} room's inventory during 'Take' command.`);
|
|
103
153
|
// Possession-based win condition: if some OTHER actor ends up with
|
|
104
154
|
// the item the win condition's target NPC wants, that counts just as
|
|
105
155
|
// much as the player handing it over directly (emergent delivery).
|
|
106
156
|
// But the target NPC grabbing their own reward off the floor doesn't
|
|
107
157
|
// count -- that's the job-giver completing their own job, not a
|
|
108
|
-
// genuine hand-off.
|
|
158
|
+
// genuine hand-off. Same ordering rule as takeAll(): the check logs
|
|
159
|
+
// the JOB COMPLETE banner itself, so the pickup confirmation must
|
|
160
|
+
// render BEFORE it -- print directly for the player, return the text
|
|
161
|
+
// for an NPC actor's AI history.
|
|
162
|
+
const isPlayer = this.actor === this.scene.getPlayer();
|
|
163
|
+
if (isPlayer) {
|
|
164
|
+
this.logger.log(`You have taken the ${itemName}.`);
|
|
165
|
+
}
|
|
109
166
|
if (!this.scene.isWinConditionTarget(this.actor.name)) {
|
|
110
167
|
this.scene.checkWinCondition(item.name, this.actor.name);
|
|
111
168
|
}
|
|
112
|
-
return `You have taken the ${itemName}.`;
|
|
169
|
+
return isPlayer ? '' : `You have taken the ${itemName}.`;
|
|
113
170
|
}
|
|
114
171
|
catch (error) {
|
|
115
172
|
this.logger.error(`Error during 'Take' command: ${error.message}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"take.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/take.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"take.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/take.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE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,CAAC;QAE3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACnE,OAAO,aAAa,QAAQ,0BAA0B,CAAC;QACzD,CAAC;IACH,CAAC"}
|
|
@@ -45,6 +45,14 @@ export class TalkCommand extends Command {
|
|
|
45
45
|
if (target === speaker) {
|
|
46
46
|
return "You can't talk to yourself (try 'say' instead).";
|
|
47
47
|
}
|
|
48
|
+
// Cross-plane whisper goes nowhere -- target.hear() would drop it
|
|
49
|
+
// silently (see Player.canPerceive), so refuse with the actual rule
|
|
50
|
+
// instead of confirming a conversation that never happened.
|
|
51
|
+
if (!target.canPerceive(speaker)) {
|
|
52
|
+
return speaker.plane === 'astral'
|
|
53
|
+
? `${target.name} can't hear you -- you're astral, they're meat. Your voice doesn't cross the veil; "return" to your body to talk to the living.`
|
|
54
|
+
: `${target.name} can't perceive you from the plane you're on.`;
|
|
55
|
+
}
|
|
48
56
|
// Private communication
|
|
49
57
|
await speaker.hear(speaker, `(to ${target.name}) ${message}`);
|
|
50
58
|
await target.hear(speaker, `(privately) ${message}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"talk.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/talk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAG5D,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,MAAM,KAAK,GAAG,kBAAkB,CAAC;IACjC,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,KAAK,CAAC;IACV,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC5C,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,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QAEF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,+BAA+B,UAAU,SAAS,CAAC;QAC5D,CAAC;QAED,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAO,iDAAiD,CAAC;QAC3D,CAAC;QAED,kEAAkE;QAClE,oEAAoE;QACpE,4DAA4D;QAC5D,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;YACjC,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ;gBAC/B,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,iIAAiI;gBACjJ,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,+CAA+C,CAAC;QACpE,CAAC;QAED,wBAAwB;QACxB,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAC9D,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,OAAO,EAAE,CAAC,CAAC;QAErD,OAAO,eAAe,MAAM,CAAC,IAAI,gBAAgB,OAAO,GAAG,CAAC;IAC9D,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Command } from './command.js';
|
|
2
2
|
export class UnequipCommand extends Command {
|
|
3
|
-
static verb = '
|
|
3
|
+
static verb = 'unequip';
|
|
4
4
|
static description = 'Unequip an item.';
|
|
5
5
|
async execute(args) {
|
|
6
6
|
const slotName = args.join(' ').toLowerCase();
|
|
7
7
|
const response = this.actor.unequip(slotName);
|
|
8
|
-
this.logger.write(`UnequipCommand: ${this.actor.name}
|
|
9
|
-
|
|
8
|
+
this.logger.write(`UnequipCommand: ${this.actor.name} unequipped ${response}`);
|
|
9
|
+
// The slot/item the player NAMED, not the full response sentence --
|
|
10
|
+
// witnesses previously read "Maka unqeuip You unequipped X from your
|
|
11
|
+
// rightHand.weapon slot.", second person and all.
|
|
12
|
+
this.actor.performAction('unequips', slotName);
|
|
10
13
|
return response;
|
|
11
14
|
}
|
|
12
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unequip.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/unequip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,cAAe,SAAQ,OAAO;IAC/B,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAElD,KAAK,CAAC,OAAO,CAAC,IAAc;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,KAAK,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"unequip.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/unequip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,cAAe,SAAQ,OAAO;IAC/B,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAElD,KAAK,CAAC,OAAO,CAAC,IAAc;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,KAAK,CAAC,IAAI,eAAe,QAAQ,EAAE,CAAC,CAAC;QAC/E,oEAAoE;QACpE,qEAAqE;QACrE,kDAAkD;QAClD,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE/C,OAAO,QAAQ,CAAC;IAClB,CAAC"}
|
|
@@ -59,11 +59,12 @@ export class UseCommand extends Command {
|
|
|
59
59
|
if (this.actor.damageTaken === 0) {
|
|
60
60
|
return `You're not hurt -- save the ${kit.name} for when you're bleeding.`;
|
|
61
61
|
}
|
|
62
|
-
// First aid is
|
|
63
|
-
//
|
|
64
|
-
//
|
|
62
|
+
// First aid is Logic + FIRST-AID skill now (unskilled: Logic - 1,
|
|
63
|
+
// fumbling with the sprays), with the kit's quality still deciding how
|
|
64
|
+
// much each hit actually closes (hits + 1 + quality below).
|
|
65
65
|
const quality = kit.qualityBonus;
|
|
66
|
-
const
|
|
66
|
+
const firstAid = this.actor.skillRating('first-aid');
|
|
67
|
+
const roll = rollPool(Math.max(1, this.actor.logic + (firstAid > 0 ? firstAid : -1) + this.actor.woundModifier));
|
|
67
68
|
const healed = this.actor.healDamage(roll.hits + 1 + quality);
|
|
68
69
|
this.actor.inventory.removeItem(kit.name);
|
|
69
70
|
this.logger.write(`UseCommand: ${this.actor.name} used ${kit.name} and healed ${healed} boxes (${this.actor.damageTaken}/${this.actor.maxConditionBoxes}).`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,OAAO,UAAW,SAAQ,OAAO;IAC3B,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,MAAM,CAAC,WAAW,GAAG,qFAAqF,CAAC;IAErH,KAAK,CAAC,OAAO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jF,IAAI,QAAQ,EAAE,CAAC;gBACb,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;oBAClC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,IAAI,yCAAyC,EAAE,KAAK,CAAC,CAAC;oBAC3G,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;gBAC3D,CAAC,CAAC,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,sEAAsE,CAAC,CAAC;YACzF,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACxC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,uDAAuD,CAAC,CAAC;YAC5F,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room-factory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/factories/room-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA0B,MAAM,qBAAqB,CAAC;AAGnE,MAAM,OAAO,WAAW;IACtB,KAAK,CAAC,kBAAkB,CAAC,MAAqB;QAC5C,MAAM,UAAU,GAA2B,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;QACpF,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,OAAO,IAAI,CA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 @@
|
|
|
1
|
+
import { Player } from '../models/player.js';
|
|
2
|
+
import { ISceneSeedJson } from '../types/seed/scene-seed.js';
|
|
3
|
+
/**
|
|
4
|
+
* CHUNKED scene generation (see SceneSeedGenerator.generate for the
|
|
5
|
+
* pipeline that drives this module). One monolithic whole-scene completion
|
|
6
|
+
* kept hitting the response token ceiling as scenes grew -- a real session
|
|
7
|
+
* lost four of six tier-2 attempts to JSON truncated mid-string -- and a
|
|
8
|
+
* single validation miss threw the entire scene away. So generation now
|
|
9
|
+
* runs in passes:
|
|
10
|
+
*
|
|
11
|
+
* 1. SKELETON: the whole scene's STRUCTURE -- rooms with exits/locks/
|
|
12
|
+
* nodes, the NPC roster with locations, puzzle placements, every
|
|
13
|
+
* item's name/role/location, and the win condition. Compact (one-line
|
|
14
|
+
* concepts instead of prose), so every cross-reference the validators
|
|
15
|
+
* check lives in one small completion.
|
|
16
|
+
* 2. DETAIL CHUNKS, each its own small completion against the fixed
|
|
17
|
+
* skeleton: room prose; NPC voices/stats; puzzle riddles and
|
|
18
|
+
* passphrases; item descriptions (clue items get their puzzle's exact
|
|
19
|
+
* phrase baked into "details" -- which is why items runs AFTER
|
|
20
|
+
* puzzles).
|
|
21
|
+
* 3. Assembly + the same validators as ever; a failure regenerates ONLY
|
|
22
|
+
* the chunk responsible.
|
|
23
|
+
*
|
|
24
|
+
* No single completion carries the whole scene, so scene scale is no
|
|
25
|
+
* longer bounded by the provider's output budget.
|
|
26
|
+
*/
|
|
27
|
+
export declare const FIXER_NAME = "Mr. Johnson";
|
|
28
|
+
export interface ISkeletonExit {
|
|
29
|
+
direction: string;
|
|
30
|
+
targetRoom: string;
|
|
31
|
+
keyRequired?: string;
|
|
32
|
+
puzzle?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ISkeletonRoom {
|
|
35
|
+
name: string;
|
|
36
|
+
concept: string;
|
|
37
|
+
roomType?: string;
|
|
38
|
+
isStartRoom?: boolean;
|
|
39
|
+
reachable?: boolean;
|
|
40
|
+
hasNode?: boolean;
|
|
41
|
+
nodeAccess?: 'wireless' | 'wired';
|
|
42
|
+
warded?: boolean;
|
|
43
|
+
owner?: string;
|
|
44
|
+
exits?: ISkeletonExit[];
|
|
45
|
+
}
|
|
46
|
+
export interface ISkeletonNpc {
|
|
47
|
+
name: string;
|
|
48
|
+
concept: string;
|
|
49
|
+
plane?: 'meat' | 'matrix' | 'astral';
|
|
50
|
+
startLocation: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ISkeletonPuzzle {
|
|
53
|
+
name: string;
|
|
54
|
+
/** Room-anchored placement; omit for a door puzzle (referenced from exits[].puzzle). */
|
|
55
|
+
room?: string;
|
|
56
|
+
concept: string;
|
|
57
|
+
bypassType?: 'lockpick' | 'hack' | 'spell' | 'con';
|
|
58
|
+
requiresPuzzle?: string;
|
|
59
|
+
rewardItem?: string;
|
|
60
|
+
}
|
|
61
|
+
export type SkeletonItemRole = 'winCondition' | 'reward' | 'key' | 'clue' | 'loot' | 'starting';
|
|
62
|
+
export interface ISkeletonItem {
|
|
63
|
+
name: string;
|
|
64
|
+
role: SkeletonItemRole;
|
|
65
|
+
category: string;
|
|
66
|
+
room?: string;
|
|
67
|
+
heldBy?: string;
|
|
68
|
+
plane?: 'meat' | 'matrix';
|
|
69
|
+
/** clue items only: which puzzle's requiredPhrase this clue reveals. */
|
|
70
|
+
forPuzzle?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ISceneSkeleton {
|
|
73
|
+
name: string;
|
|
74
|
+
story: string;
|
|
75
|
+
completionMessage: string;
|
|
76
|
+
rooms: ISkeletonRoom[];
|
|
77
|
+
npcs: ISkeletonNpc[];
|
|
78
|
+
puzzles: ISkeletonPuzzle[];
|
|
79
|
+
items: ISkeletonItem[];
|
|
80
|
+
winCondition: {
|
|
81
|
+
item: string;
|
|
82
|
+
toNpc: string;
|
|
83
|
+
payout: number;
|
|
84
|
+
rewardItem?: string;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export interface IRoomDetail {
|
|
88
|
+
name: string;
|
|
89
|
+
description: string;
|
|
90
|
+
roomType?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface INpcDetail {
|
|
93
|
+
name: string;
|
|
94
|
+
description: string;
|
|
95
|
+
dialogue: string[];
|
|
96
|
+
combat?: Record<string, unknown>;
|
|
97
|
+
}
|
|
98
|
+
export interface IPuzzleDetail {
|
|
99
|
+
name: string;
|
|
100
|
+
riddle: string;
|
|
101
|
+
requiredPhrase: string;
|
|
102
|
+
successMessage: string;
|
|
103
|
+
failureMessage: string;
|
|
104
|
+
lockedMessage?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface IItemDetail {
|
|
107
|
+
name: string;
|
|
108
|
+
description: string;
|
|
109
|
+
size: string;
|
|
110
|
+
category: string;
|
|
111
|
+
shape: string;
|
|
112
|
+
color: string;
|
|
113
|
+
texture: string;
|
|
114
|
+
rating: string;
|
|
115
|
+
weight: number;
|
|
116
|
+
currencyAmount?: number;
|
|
117
|
+
details?: string;
|
|
118
|
+
transferable?: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface ISceneDetails {
|
|
121
|
+
rooms: IRoomDetail[];
|
|
122
|
+
npcs: INpcDetail[];
|
|
123
|
+
puzzles: IPuzzleDetail[];
|
|
124
|
+
items: IItemDetail[];
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* A compact character sheet injected into the skeleton prompt so a job is
|
|
128
|
+
* built FOR the runner actually playing it (archetype, stats, toolkit).
|
|
129
|
+
* Returns '' when no player is available.
|
|
130
|
+
*/
|
|
131
|
+
export declare function buildPlayerDossier(player?: Player): string;
|
|
132
|
+
export declare function buildSkeletonPrompt(tier: number, previousFixerName?: string, player?: Player, previousError?: string): string;
|
|
133
|
+
export declare function buildRoomsPrompt(skeleton: ISceneSkeleton, previousError?: string): string;
|
|
134
|
+
export declare function buildNpcsPrompt(skeleton: ISceneSkeleton, previousError?: string): string;
|
|
135
|
+
export declare function buildPuzzlesPrompt(skeleton: ISceneSkeleton, previousError?: string): string;
|
|
136
|
+
export declare function buildItemsPrompt(skeleton: ISceneSkeleton, puzzles: IPuzzleDetail[], previousError?: string): string;
|
|
137
|
+
/**
|
|
138
|
+
* Whether THIS runner can reliably work a barrier of the given bypassType
|
|
139
|
+
* with their own hands -- no written-down credential required. This is
|
|
140
|
+
* what loosens the "every puzzle needs a discoverable clue" rule when the
|
|
141
|
+
* scene is generated against a dossier: a lockpick maglock in a scene
|
|
142
|
+
* built for a master locksmith doesn't need its code lying in a book --
|
|
143
|
+
* the pick IS their route. Deliberately conservative: EXPLICIT skill
|
|
144
|
+
* ratings only (the combatSkill fallback would let any bruiser "qualify"
|
|
145
|
+
* as a hacker), threshold 3 (trained professional), and with no dossier
|
|
146
|
+
* at all the strict clue rule stays.
|
|
147
|
+
*/
|
|
148
|
+
export declare function canBypassUnaided(player: Player | undefined, bypassType?: string): boolean;
|
|
149
|
+
/** Strips accidental markdown fences and parses; throws with a useful message. */
|
|
150
|
+
export declare function parseJsonReply<T>(reply: string): T;
|
|
151
|
+
/**
|
|
152
|
+
* Fast structural checks on the skeleton BEFORE any detail pass spends
|
|
153
|
+
* tokens building on it. Deeper semantics (reachability, clue coverage,
|
|
154
|
+
* matrix defense...) are still enforced by the assembled-scene validators.
|
|
155
|
+
*/
|
|
156
|
+
export declare function validateSkeleton(skeleton: ISceneSkeleton, player?: Player): void;
|
|
157
|
+
/**
|
|
158
|
+
* Auto-fixes skeleton faults that have exactly one sane resolution,
|
|
159
|
+
* instead of burning a whole retry on them. Today: a puzzle both placed
|
|
160
|
+
* in a room AND referenced by exactly one door keeps the DOOR placement
|
|
161
|
+
* (the model near-always meant "the door in that room" -- this exact
|
|
162
|
+
* fault killed two consecutive real generations). Returns notes for the
|
|
163
|
+
* log.
|
|
164
|
+
*/
|
|
165
|
+
export declare function normalizeSkeleton(skeleton: ISceneSkeleton): string[];
|
|
166
|
+
/** Merges the skeleton's structure with the detail passes into a full seed. */
|
|
167
|
+
export declare function assembleScene(skeleton: ISceneSkeleton, details: ISceneDetails, playerName: string): ISceneSeedJson;
|
|
168
|
+
export type RepairTarget = 'rooms' | 'npcs' | 'puzzles' | 'items' | 'skeleton';
|
|
169
|
+
/**
|
|
170
|
+
* Maps a validation failure to the chunk that owns the broken content, so
|
|
171
|
+
* a repair regenerates ONE pass instead of the whole scene. Anything
|
|
172
|
+
* structural (topology, placement, rosters) is skeleton-owned and restarts
|
|
173
|
+
* the pipeline with the error as feedback.
|
|
174
|
+
*/
|
|
175
|
+
export declare function classifyRepair(message: string): RepairTarget;
|