@maka/maka-cli 5.7.0 → 5.9.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/deploy/ubuntu.sub.cmd.js +16 -31
- package/bundle/typescript/src/commands/deploy/ubuntu.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js +6 -4
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/advance.js +3 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/advance.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/ask.js +19 -7
- package/bundle/typescript/src/commands/game/sideQuest/commands/ask.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js +3 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js +35 -9
- package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/buy.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/buy.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js +31 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.js +16 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.d.ts +7 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js +118 -29
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/companions.d.ts +33 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/companions.js +138 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/companions.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/contacts.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/contacts.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js +5 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/give.js +5 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/give.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js +138 -19
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/grapple.d.ts +38 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/grapple.js +178 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/grapple.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js +14 -5
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js +7 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/hints.d.ts +10 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/hints.js +24 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/hints.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/initiate.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/initiate.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/inv.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/inv.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/jump.js +25 -3
- package/bundle/typescript/src/commands/game/sideQuest/commands/jump.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/lifestyle.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/lifestyle.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +53 -8
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/map.js +3 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/map.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/move.d.ts +41 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/move.js +160 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/move.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/order.d.ts +19 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/order.js +152 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/order.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.js +5 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/project.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/project.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/quality-trade.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/quality-trade.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js +3 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +24 -6
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/sell.js +7 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/sell.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/silent.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/silent.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.js +3 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/solve.js +11 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/solve.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js +24 -13
- package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/summon.d.ts +19 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/summon.js +113 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/summon.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/surrender.js +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/surrender.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js +37 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/treat.js +5 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/treat.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js +9 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/work.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/work.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/item-factory.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/item-factory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/puzzle-factory.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/puzzle-factory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/room-factory.js +5 -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 +11 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js +138 -23
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js +12 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +91 -0
- package/bundle/typescript/src/commands/game/sideQuest/game.js +501 -23
- package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/item.d.ts +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js +3 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.d.ts +44 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +349 -9
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +10 -2
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js +36 -7
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.d.ts +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js +9 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/room.d.ts +13 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js +57 -4
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.d.ts +28 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +172 -4
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene1.json +76 -20
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene2.json +157 -34
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/exit-seed.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/item-seed.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/player-seed.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/puzzle-seed.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/room-seed.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/ui.js +81 -5
- package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js +21 -5
- package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.d.ts +25 -3
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js +128 -28
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.d.ts +7 -4
- package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.js +8 -5
- package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/grapple.d.ts +36 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/grapple.js +57 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/grapple.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/hints.d.ts +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/hints.js +55 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/hints.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/log-style.d.ts +14 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/log-style.js +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/log-style.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.js +49 -4
- package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js +31 -7
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.d.ts +121 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.js +315 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.js.map +1 -0
- package/bundle/typescript/src/commands/ssl.js +10 -15
- package/bundle/typescript/src/commands/ssl.js.map +1 -1
- package/bundle/typescript/src/templates/react/kit/mui/auth/password-reset/basic-password-reset-page.js.tsx +3 -4
- package/bundle/typescript/src/tools/ssl/ssl.class.d.ts +8 -0
- package/bundle/typescript/src/tools/ssl/ssl.class.js +53 -0
- package/bundle/typescript/src/tools/ssl/ssl.class.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,9 @@ import { NPC } from '../models/npc.js';
|
|
|
3
3
|
import { Category } from '../types/shared/item-enum.js';
|
|
4
4
|
import { Command } from './command.js';
|
|
5
5
|
import { shellsInRoom, canReachHost } from '../utilities/planes.js';
|
|
6
|
+
import { BULLET } from '../utilities/log-style.js';
|
|
7
|
+
import { spotsActive, whoIsWhereLine, highlightSpots, highlightActors, exitSpot } from '../utilities/spots.js';
|
|
8
|
+
import { rollPool, formatRoll } from '../utilities/dice.js';
|
|
6
9
|
export class LookCommand extends Command {
|
|
7
10
|
static verb = 'look';
|
|
8
11
|
static description = 'Examine your surroundings';
|
|
@@ -48,7 +51,10 @@ export class LookCommand extends Command {
|
|
|
48
51
|
this.logger.error(`${this.actor.name} is not in a valid room during 'Look' command execution.`);
|
|
49
52
|
return "You're not in a valid room.";
|
|
50
53
|
}
|
|
51
|
-
|
|
54
|
+
// "At" spots live IN the prose, keyword-colored, and so do the
|
|
55
|
+
// OBVIOUS people standing in it (player request) -- see
|
|
56
|
+
// utilities/spots.ts highlightSpots / highlightActors.
|
|
57
|
+
let description = highlightActors(room, highlightSpots(room, (room.details) ? room.details : room.description), this.actor);
|
|
52
58
|
// Plane dressing: what a room IS depends on where you're standing.
|
|
53
59
|
// A node reads differently by state: burning (hackable), dark
|
|
54
60
|
// (air-gapped, hard line only -- see planes.canReachHost), or cracked
|
|
@@ -77,10 +83,26 @@ export class LookCommand extends Command {
|
|
|
77
83
|
const otherActors = this.scene
|
|
78
84
|
.getActorsInRoom(room)
|
|
79
85
|
.filter(a => a.name !== this.actor.name && this.actor.canPerceive(a));
|
|
80
|
-
|
|
86
|
+
// "At" spots: one compact who-stands-where line (player ruling:
|
|
87
|
+
// casing WHO is where happens on "look", and it's a PERCEPTION
|
|
88
|
+
// check -- Observe in Detail, p.135). One roll; occupants tucked
|
|
89
|
+
// behind cover need the RAW thresholds (see whoIsWhereLine) or the
|
|
90
|
+
// booth simply ate them.
|
|
91
|
+
if (spotsActive(room) && this.actor.plane === 'meat') {
|
|
92
|
+
const perception = this.actor.skillRating('perception');
|
|
93
|
+
const pool = Math.max(1, this.actor.intuition + (perception > 0 ? perception : -1) + this.actor.augBonus('perception') + this.actor.woundModifier - this.actor.sustainingPenalty);
|
|
94
|
+
const roll = rollPool(pool);
|
|
95
|
+
if (this.actor === this.scene.getPlayer()) {
|
|
96
|
+
this.logger.meta(`Perception (look): ${formatRoll(roll)} (2+ spots partial cover, 4+ good)`);
|
|
97
|
+
}
|
|
98
|
+
const who = whoIsWhereLine(room, this.actor, roll.hits);
|
|
99
|
+
if (who)
|
|
100
|
+
description += `\n\n${who}.`;
|
|
101
|
+
}
|
|
102
|
+
else if (otherActors.length > 0) {
|
|
81
103
|
const actorList = otherActors.map(a => {
|
|
82
104
|
const aura = this.actor.plane === 'astral' && a.plane === 'meat' ? ' (an aura, dim and physical)' : '';
|
|
83
|
-
return
|
|
105
|
+
return `${BULLET}${a.name}${aura}`;
|
|
84
106
|
}).join('\n');
|
|
85
107
|
description += `\n\nYou see:\n${actorList}`;
|
|
86
108
|
}
|
|
@@ -89,23 +111,28 @@ export class LookCommand extends Command {
|
|
|
89
111
|
if (this.actor.plane !== 'matrix') {
|
|
90
112
|
const shells = shellsInRoom(this.scene, room).filter(s => s !== this.actor);
|
|
91
113
|
if (shells.length > 0) {
|
|
92
|
-
const shellList = shells.map(s =>
|
|
114
|
+
const shellList = shells.map(s => `${BULLET}${s.name}'s body -- slumped and vacant, nobody home`).join('\n');
|
|
93
115
|
description += `\n\n${shellList}`;
|
|
94
116
|
}
|
|
95
117
|
}
|
|
96
118
|
// --- Add exits here ---
|
|
97
119
|
const exits = Array.from(room.exits.entries())
|
|
98
120
|
.map(([direction, exit]) => {
|
|
121
|
+
// "At" spots: name WHERE each way out is (a real session's bar
|
|
122
|
+
// had one "door" spot and two doorways, with nothing saying the
|
|
123
|
+
// backroom door lived at the back corner).
|
|
124
|
+
const from = exitSpot(room, direction);
|
|
125
|
+
const fromNote = from ? ` -- from the ${from}` : '';
|
|
99
126
|
if (typeof exit === 'string') {
|
|
100
|
-
return
|
|
127
|
+
return `${BULLET}${direction}: ${exit}${fromNote}`;
|
|
101
128
|
}
|
|
102
129
|
else if (exit instanceof Door) {
|
|
103
130
|
const targetRoom = exit.getOtherSideToName(room);
|
|
104
131
|
const lockedStr = exit.checkIfLocked() ? ' (locked)' : '';
|
|
105
|
-
return
|
|
132
|
+
return `${BULLET}${direction}: ${targetRoom}${lockedStr}${fromNote}`;
|
|
106
133
|
}
|
|
107
134
|
else {
|
|
108
|
-
return
|
|
135
|
+
return `${BULLET}${direction}: Unknown`;
|
|
109
136
|
}
|
|
110
137
|
});
|
|
111
138
|
if (exits.length > 0) {
|
|
@@ -159,6 +186,24 @@ export class LookCommand extends Command {
|
|
|
159
186
|
if (target instanceof NPC && target.appearance) {
|
|
160
187
|
lines.push(target.appearance);
|
|
161
188
|
}
|
|
189
|
+
// LIVE STATE (player ruling: room prose stays stateless -- "look at
|
|
190
|
+
// <name>" is where you read what condition someone is in now).
|
|
191
|
+
if (target.isIncapacitated()) {
|
|
192
|
+
lines.push(target.isDown()
|
|
193
|
+
? `They're DOWN -- bleeding out, not moving.`
|
|
194
|
+
: `They're out cold -- breathing, but nobody's home.`);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
const state = [];
|
|
198
|
+
if (target.surrendered)
|
|
199
|
+
state.push(`hands up -- they've surrendered`);
|
|
200
|
+
if (target.damageTaken > 0)
|
|
201
|
+
state.push(`bleeding (${target.damageTaken}/${target.maxConditionBoxes} physical)`);
|
|
202
|
+
if (target.stunTaken > 0)
|
|
203
|
+
state.push(`battered (${target.stunTaken}/${target.maxStunBoxes} stun)`);
|
|
204
|
+
if (state.length > 0)
|
|
205
|
+
lines.push(`Right now: ${state.join(', ')}.`);
|
|
206
|
+
}
|
|
162
207
|
const equipment = target.equipment;
|
|
163
208
|
for (const groupKey of Object.keys(equipment)) {
|
|
164
209
|
const group = equipment[groupKey];
|
|
@@ -167,7 +212,7 @@ export class LookCommand extends Command {
|
|
|
167
212
|
for (const slotKey of Object.keys(group)) {
|
|
168
213
|
const item = group[slotKey];
|
|
169
214
|
if (item) {
|
|
170
|
-
lines.push(
|
|
215
|
+
lines.push(`${BULLET}${groupKey}.${slotKey}: ${item.name}`);
|
|
171
216
|
}
|
|
172
217
|
}
|
|
173
218
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"look.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/look.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"look.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/look.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,OAAO,WAAY,SAAQ,OAAO;IAC5B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;IACrB,MAAM,CAAC,WAAW,GAAG,2BAA2B,CAAC;IAE3D,KAAK,CAAC,OAAO,CAAC,IAAc;QAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAE/C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,C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AAI,CAAC,aAAa,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,YAAY,QAAQ,CAAC,CAAC;YACnG,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtE,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAEnC,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAA+B,EAAE,CAAC;YAC5E,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;YAClC,IAAI,CAAC,KAAK;gBAAE,SAAS;YAErB,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC5B,IAAI,IAAI,EAAE,CAAC;oBACT,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,QAAQ,IAAI,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC9D,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,yCAAyC,CAAC,CAAC;QACtE,CAAC;QAED,OAAO,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from './command.js';
|
|
2
|
+
import { hint } from '../utilities/hints.js';
|
|
2
3
|
import { Door } from '../models/door.js';
|
|
3
4
|
import { capitalCase } from 'change-case';
|
|
4
5
|
/**
|
|
@@ -36,8 +37,8 @@ export class MapCommand extends Command {
|
|
|
36
37
|
lines.push('');
|
|
37
38
|
for (const barrier of barriers) {
|
|
38
39
|
lines.push(barrier.direction
|
|
39
|
-
? `A barrier blocks the way ${barrier.direction}
|
|
40
|
-
: `There's a barrier here
|
|
40
|
+
? `A barrier blocks the way ${barrier.direction}.${hint(` ("search" for a closer look.)`)}`
|
|
41
|
+
: `There's a barrier here.${hint(` ("search" for a closer look.)`)}`);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
return lines.join('\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IAC3B,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,MAAM,CAAC,WAAW,GAAG,oDAAoD,CAAC;IAEpF,KAAK,CAAC,OAAO,CAAC,QAAkB,EAAE;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;QACxC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,gCAAgC,CAAC;QAC1C,CAAC;QAED,MAAM,KAAK,GAAa,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAE/D,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;YACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,KAAK,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,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,CAAC;QACzC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAC/B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS;oBAC1B,CAAC,CAAC,4BAA4B,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,gCAAgC,CAAC,EAAE;oBAC3F,CAAC,CAAC,0BAA0B,IAAI,CAAC,gCAAgC,CAAC,EAAE,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
2
|
+
/**
|
|
3
|
+
* "walk to <spot>" / "run to <spot>" / "sprint to <spot>" -- crossing
|
|
4
|
+
* the CURRENT room to one of its "at" spots (see utilities/spots.ts;
|
|
5
|
+
* player request: rooms felt like everything stood at your elbow). The
|
|
6
|
+
* three verbs are SR5e's movement modes (p.161-162); out of combat all
|
|
7
|
+
* three are free narration and differ only in flavor. In combat the
|
|
8
|
+
* mode is the tactical choice -- walk exposed but steady, run harder to
|
|
9
|
+
* hit but -2 on your next action, sprint an Athletics test to cross
|
|
10
|
+
* clean (Phase 2; v1 refuses spot moves mid-exchange like go.ts does
|
|
11
|
+
* room moves).
|
|
12
|
+
*
|
|
13
|
+
* "move" and "approach" alias walk. A Direction argument delegates to
|
|
14
|
+
* "go" ("move north" is a thing players type; on a name collision the
|
|
15
|
+
* direction wins, documented here).
|
|
16
|
+
*/
|
|
17
|
+
export declare class MoveCommand extends Command implements ICommand {
|
|
18
|
+
protected static verb: string;
|
|
19
|
+
protected static description: string;
|
|
20
|
+
/** Which movement mode this registration answers to (see subclasses). */
|
|
21
|
+
protected mode(): 'walk' | 'run' | 'sprint';
|
|
22
|
+
execute(args?: string[]): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* "move to Brick": fuzzy-resolves the words as a person in this room
|
|
25
|
+
* (same matcher call.ts uses for names). Only people the actor can
|
|
26
|
+
* perceive count -- an astral shadow you can't see isn't a landmark.
|
|
27
|
+
*/
|
|
28
|
+
private resolveActorTarget;
|
|
29
|
+
}
|
|
30
|
+
/** "run to <spot>" -- same crossing, faster (combat semantics in Phase 2). */
|
|
31
|
+
export declare class RunCommand extends MoveCommand {
|
|
32
|
+
protected static verb: string;
|
|
33
|
+
protected static description: string;
|
|
34
|
+
protected mode(): 'walk' | 'run' | 'sprint';
|
|
35
|
+
}
|
|
36
|
+
/** "sprint to <spot>" -- flat out (combat semantics in Phase 2). */
|
|
37
|
+
export declare class SprintCommand extends MoveCommand {
|
|
38
|
+
protected static verb: string;
|
|
39
|
+
protected static description: string;
|
|
40
|
+
protected mode(): 'walk' | 'run' | 'sprint';
|
|
41
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Command } from './command.js';
|
|
2
|
+
import { GoCommand } from './go.js';
|
|
3
|
+
import { NPC } from '../models/npc.js';
|
|
4
|
+
import { fuzzyPickName } from '../utilities/fuzzy-match.js';
|
|
5
|
+
import { heldBy, holding } from '../utilities/grapple.js';
|
|
6
|
+
import { spotsActive, resolveSpot, spotOf, describeSpotRoster, OPEN_FLOOR } from '../utilities/spots.js';
|
|
7
|
+
/**
|
|
8
|
+
* "walk to <spot>" / "run to <spot>" / "sprint to <spot>" -- crossing
|
|
9
|
+
* the CURRENT room to one of its "at" spots (see utilities/spots.ts;
|
|
10
|
+
* player request: rooms felt like everything stood at your elbow). The
|
|
11
|
+
* three verbs are SR5e's movement modes (p.161-162); out of combat all
|
|
12
|
+
* three are free narration and differ only in flavor. In combat the
|
|
13
|
+
* mode is the tactical choice -- walk exposed but steady, run harder to
|
|
14
|
+
* hit but -2 on your next action, sprint an Athletics test to cross
|
|
15
|
+
* clean (Phase 2; v1 refuses spot moves mid-exchange like go.ts does
|
|
16
|
+
* room moves).
|
|
17
|
+
*
|
|
18
|
+
* "move" and "approach" alias walk. A Direction argument delegates to
|
|
19
|
+
* "go" ("move north" is a thing players type; on a name collision the
|
|
20
|
+
* direction wins, documented here).
|
|
21
|
+
*/
|
|
22
|
+
export class MoveCommand extends Command {
|
|
23
|
+
static verb = 'walk';
|
|
24
|
+
static description = 'Cross the room to a named spot or person: "move to bar", "move to Brick" (also "walk"/"approach"; "run to"/"sprint to" are the fast crossings). Bare "move" lists the room\'s spots. You must share a spot with someone to talk or trade with them.';
|
|
25
|
+
/** Which movement mode this registration answers to (see subclasses). */
|
|
26
|
+
mode() {
|
|
27
|
+
return 'walk';
|
|
28
|
+
}
|
|
29
|
+
async execute(args = []) {
|
|
30
|
+
const actor = this.actor;
|
|
31
|
+
const room = actor.currentLocation;
|
|
32
|
+
// "move to the bar" reads naturally -- strip the connective and
|
|
33
|
+
// article (order.ts precedent).
|
|
34
|
+
let words = [...(args ?? [])];
|
|
35
|
+
if (words[0]?.toLowerCase() === 'to')
|
|
36
|
+
words = words.slice(1);
|
|
37
|
+
if (/^(the|a|an)$/i.test(words[0] ?? ''))
|
|
38
|
+
words = words.slice(1);
|
|
39
|
+
// "move north": a Direction is a room move -- hand it to go.
|
|
40
|
+
if (words.length > 0 && this.isValidDirection(words[0].toLowerCase())) {
|
|
41
|
+
return await new GoCommand({ actor, scene: this.scene, game: this.game }).execute([words[0].toLowerCase()]);
|
|
42
|
+
}
|
|
43
|
+
// GRAPPLED (p.195): held fast means no crossing the room either --
|
|
44
|
+
// and a holder's hands are full (see commands/grapple.ts).
|
|
45
|
+
const gripHolder = heldBy(actor, this.scene);
|
|
46
|
+
if (gripHolder) {
|
|
47
|
+
return `${gripHolder.name} has you locked down -- "struggle" to break the hold.`;
|
|
48
|
+
}
|
|
49
|
+
const gripHeld = holding(actor, this.scene);
|
|
50
|
+
if (gripHeld) {
|
|
51
|
+
return `You're holding ${gripHeld.name} -- "release" before you move off.`;
|
|
52
|
+
}
|
|
53
|
+
if (!spotsActive(room)) {
|
|
54
|
+
return `There's nowhere more specific to stand here.`;
|
|
55
|
+
}
|
|
56
|
+
if (actor.plane !== 'meat') {
|
|
57
|
+
return `Spots are a meat-world concern -- your present form is everywhere in the room at once.`;
|
|
58
|
+
}
|
|
59
|
+
if (words.length === 0) {
|
|
60
|
+
return [`Places in ${room.name}:`, ...describeSpotRoster(room, actor).map(l => ` • ${l}`)].join('\n');
|
|
61
|
+
}
|
|
62
|
+
// Spot names first (unchanged behavior); then PEOPLE (player
|
|
63
|
+
// request: "move to Brick") -- walking to someone means walking to
|
|
64
|
+
// where they stand. On a name collision the place wins, same
|
|
65
|
+
// precedence school as the direction check above.
|
|
66
|
+
let spot = resolveSpot(room, words.join(' '));
|
|
67
|
+
let toWhom = '';
|
|
68
|
+
if (!spot) {
|
|
69
|
+
const target = this.resolveActorTarget(room, words.join(' '));
|
|
70
|
+
if (target) {
|
|
71
|
+
const theirSpot = spotOf(target);
|
|
72
|
+
if (theirSpot === undefined) {
|
|
73
|
+
// Circulating reaches everyone (see spots.ts sameSpot) --
|
|
74
|
+
// there's no fixed ground to cross to, and none needed.
|
|
75
|
+
return `${target.name} is drifting the room -- already in reach right where you stand.`;
|
|
76
|
+
}
|
|
77
|
+
spot = room.spots.find(s => s.name === theirSpot) ?? { name: theirSpot };
|
|
78
|
+
toWhom = target.name;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (!spot) {
|
|
82
|
+
return `No "${words.join(' ')}" here. Places: ${room.spots.map(s => s.name).join(', ')}.`;
|
|
83
|
+
}
|
|
84
|
+
if (spotOf(actor) === spot.name) {
|
|
85
|
+
return toWhom
|
|
86
|
+
? `You're already at the ${spot.name} with ${toWhom}.`
|
|
87
|
+
: `You're already at the ${spot.name}.`;
|
|
88
|
+
}
|
|
89
|
+
// Mid-exchange, nobody strolls (same rule as go.ts room moves): the
|
|
90
|
+
// player is refused; an NPC's AI retries in the lull. Phase 2 will
|
|
91
|
+
// route this through the crossing-exposure machinery instead.
|
|
92
|
+
if (actor.inExchange) {
|
|
93
|
+
return `You're mid-exchange -- crossing open floor now means eating lead. Let it settle.`;
|
|
94
|
+
}
|
|
95
|
+
actor.atSpot = spot.name;
|
|
96
|
+
// A mundane verb on purpose: crossing a room shouldn't wake every
|
|
97
|
+
// NPC in it (that's the exact wall-of-attention this feature
|
|
98
|
+
// removes). NPC.see makes ONE exception -- an approach that ends AT
|
|
99
|
+
// an NPC's own spot is a social event for them (the bartender greets
|
|
100
|
+
// you when you reach the bar).
|
|
101
|
+
actor.performAction('moves to', `the ${spot.name}`);
|
|
102
|
+
this.logger.write(`MoveCommand: ${actor.name} ${this.mode()}s to ${spot.name} in ${room.name}.`);
|
|
103
|
+
// Companions drift along with their master (go.ts follow precedent).
|
|
104
|
+
if (actor === this.scene.getPlayer() && this.game) {
|
|
105
|
+
for (const c of this.game.companions) {
|
|
106
|
+
if (c.npc.currentLocation === room && !c.npc.isIncapacitated() && c.npc.plane === 'meat') {
|
|
107
|
+
c.npc.atSpot = spot.name;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
this.scene.updateStatus();
|
|
112
|
+
if (actor instanceof NPC) {
|
|
113
|
+
return `${actor.name} moves to the ${spot.name}.`;
|
|
114
|
+
}
|
|
115
|
+
const here = room.getActors()
|
|
116
|
+
.filter(a => a !== actor && a.atSpot === spot.name && actor.canPerceive(a) && a.name !== toWhom)
|
|
117
|
+
.map(a => a.name);
|
|
118
|
+
// The neutral ground gets its own verb: you peel off, you don't
|
|
119
|
+
// "cross to" a place that isn't one.
|
|
120
|
+
if (spot.name === OPEN_FLOOR) {
|
|
121
|
+
if (toWhom) {
|
|
122
|
+
return `You step out onto the open floor where ${toWhom} stands.${here.length > 0 ? ` Also out here: ${here.join(', ')}.` : ''}`;
|
|
123
|
+
}
|
|
124
|
+
return `You peel off to the open floor -- nobody's company but your own.${here.length > 0 ? ` Out here with you: ${here.join(', ')}.` : ''}`;
|
|
125
|
+
}
|
|
126
|
+
const pace = this.mode() === 'walk' ? 'cross to' : this.mode() === 'run' ? 'hustle over to' : 'sprint to';
|
|
127
|
+
const spotDesc = spot.description ? ` ${spot.description}` : '';
|
|
128
|
+
const company = toWhom
|
|
129
|
+
? `, coming up beside ${toWhom}.`
|
|
130
|
+
: '.';
|
|
131
|
+
return `You ${pace} the ${spot.name}${company}${spotDesc}${here.length > 0 ? ` Here: ${here.join(', ')}.` : ''}`;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* "move to Brick": fuzzy-resolves the words as a person in this room
|
|
135
|
+
* (same matcher call.ts uses for names). Only people the actor can
|
|
136
|
+
* perceive count -- an astral shadow you can't see isn't a landmark.
|
|
137
|
+
*/
|
|
138
|
+
resolveActorTarget(room, query) {
|
|
139
|
+
const candidates = room.getActors().filter(a => a !== this.actor && this.actor.canPerceive(a));
|
|
140
|
+
const picked = fuzzyPickName(query, candidates.map(a => a.name));
|
|
141
|
+
return picked ? candidates.find(a => a.name === picked) : undefined;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/** "run to <spot>" -- same crossing, faster (combat semantics in Phase 2). */
|
|
145
|
+
export class RunCommand extends MoveCommand {
|
|
146
|
+
static verb = 'run';
|
|
147
|
+
static description = 'Run to a spot in the room ("run to door"). Out of a fight it\'s just faster; in one, speed will matter.';
|
|
148
|
+
mode() {
|
|
149
|
+
return 'run';
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/** "sprint to <spot>" -- flat out (combat semantics in Phase 2). */
|
|
153
|
+
export class SprintCommand extends MoveCommand {
|
|
154
|
+
static verb = 'sprint';
|
|
155
|
+
static description = 'Sprint flat-out to a spot in the room ("sprint to booths").';
|
|
156
|
+
mode() {
|
|
157
|
+
return 'sprint';
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=move.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move.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nH,CAAC;IAED;;;;OAIG;IACK,kBAAkB,CAAC,IAAU,EAAE,KAAa;QAClD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/F,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACjE,OAAO,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,CAAC;;AAGH,8EAA8E;AAC9E,MAAM,OAAO,UAAW,SAAQ,WAAW;IAC/B,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,MAAM,CAAC,WAAW,GAAG,yGAAyG,CAAC;IAC/H,IAAI;QACZ,OAAO,KAAK,CAAC;IACf,CAAC;;AAGH,oEAAoE;AACpE,MAAM,OAAO,aAAc,SAAQ,WAAW;IAClC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,MAAM,CAAC,WAAW,GAAG,6DAA6D,CAAC;IACnF,IAAI;QACZ,OAAO,QAAQ,CAAC;IAClB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
2
|
+
/**
|
|
3
|
+
* Deterministic companion control: "order <companion> <command...>" runs
|
|
4
|
+
* the command AS the companion, through its own scene-bound registry
|
|
5
|
+
* (NPC.runCommand -- no AI round trip, no reflect chain: an order is an
|
|
6
|
+
* order). The companion's AI still acts on its own between orders (its
|
|
7
|
+
* prompt carries the allegiance block); this verb is for the moments
|
|
8
|
+
* that must happen NOW -- "order spirit attack krow". A spirit charges
|
|
9
|
+
* one service for an ordered physical task (fights bill separately in
|
|
10
|
+
* combat-exchange, one per fight).
|
|
11
|
+
*/
|
|
12
|
+
export declare class OrderCommand extends Command implements ICommand {
|
|
13
|
+
protected static verb: string;
|
|
14
|
+
protected static description: string;
|
|
15
|
+
execute(args?: string[]): Promise<string>;
|
|
16
|
+
/** Per-kind feed styling -- matches the HUD's plane color language. */
|
|
17
|
+
private static readonly FEED;
|
|
18
|
+
private static readonly ATOMIC_REFUSAL;
|
|
19
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Command } from './command.js';
|
|
2
|
+
import { hint } from '../utilities/hints.js';
|
|
3
|
+
import { fuzzyPickName } from '../utilities/fuzzy-match.js';
|
|
4
|
+
import { AI } from '../../../../tools/ai/ai.class.js';
|
|
5
|
+
/**
|
|
6
|
+
* Deterministic companion control: "order <companion> <command...>" runs
|
|
7
|
+
* the command AS the companion, through its own scene-bound registry
|
|
8
|
+
* (NPC.runCommand -- no AI round trip, no reflect chain: an order is an
|
|
9
|
+
* order). The companion's AI still acts on its own between orders (its
|
|
10
|
+
* prompt carries the allegiance block); this verb is for the moments
|
|
11
|
+
* that must happen NOW -- "order spirit attack krow". A spirit charges
|
|
12
|
+
* one service for an ordered physical task (fights bill separately in
|
|
13
|
+
* combat-exchange, one per fight).
|
|
14
|
+
*/
|
|
15
|
+
export class OrderCommand extends Command {
|
|
16
|
+
static verb = 'order';
|
|
17
|
+
static description = 'Command a companion: exact commands run instantly ("order spirit attack Krow"); anything else becomes a standing DIRECTIVE its AI pursues ("order agent to find Mr. Krow"). Spirit tasks cost a service.';
|
|
18
|
+
async execute(args = []) {
|
|
19
|
+
const game = this.game;
|
|
20
|
+
if (!game || game.companions.length === 0) {
|
|
21
|
+
return `You have no one to order -- no spirit bound, no agent running, no drone deployed.`;
|
|
22
|
+
}
|
|
23
|
+
if (!args || args.length < 2) {
|
|
24
|
+
const roster = game.companions.map(c => c.npc.name).join(', ');
|
|
25
|
+
return `Order WHO to do WHAT? With you: ${roster}. ("order <name> <command>")`;
|
|
26
|
+
}
|
|
27
|
+
// Longest-prefix companion match, remainder is the command.
|
|
28
|
+
let entry;
|
|
29
|
+
let commandWords = [];
|
|
30
|
+
for (let i = args.length - 1; i >= 1; i--) {
|
|
31
|
+
const picked = fuzzyPickName(args.slice(0, i).join(' '), game.companions.map(c => c.npc.name));
|
|
32
|
+
if (picked) {
|
|
33
|
+
entry = game.companions.find(c => c.npc.name === picked);
|
|
34
|
+
commandWords = args.slice(i);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (!entry) {
|
|
39
|
+
return `None of yours answers to that. With you: ${game.companions.map(c => c.npc.name).join(', ')}.`;
|
|
40
|
+
}
|
|
41
|
+
if (commandWords.length === 0) {
|
|
42
|
+
return `Order ${entry.npc.name} to do WHAT?`;
|
|
43
|
+
}
|
|
44
|
+
if (entry.npc.isIncapacitated()) {
|
|
45
|
+
return `${entry.npc.name} is past taking orders.`;
|
|
46
|
+
}
|
|
47
|
+
// "order agent to find krow" reads naturally -- strip the connective
|
|
48
|
+
// FIRST, so every check below sees the bare command ("to attack krow"
|
|
49
|
+
// must read as the attack it is).
|
|
50
|
+
if (commandWords[0]?.toLowerCase() === 'to')
|
|
51
|
+
commandWords = commandWords.slice(1);
|
|
52
|
+
const cmd = commandWords.join(' ');
|
|
53
|
+
// The feed wears its plane's colors (player request: what the
|
|
54
|
+
// companion SEES should read as coming through its senses) -- the
|
|
55
|
+
// same visual language the HUD already speaks: yellow ✈ for a
|
|
56
|
+
// drone's sensor feed, magenta ✧ for a spirit's otherworldly report,
|
|
57
|
+
// cyan ▣ for an agent on the grid.
|
|
58
|
+
const feed = OrderCommand.FEED[entry.kind] ?? OrderCommand.FEED.ally;
|
|
59
|
+
this.actor.performAction('orders', `${entry.npc.name}: "${cmd}"`);
|
|
60
|
+
this.logger.logWithColor(`${feed.icon} [order] ${entry.npc.name}: ${cmd}`, feed.color);
|
|
61
|
+
this.logger.write(`OrderCommand: ${this.actor.name} -> ${entry.npc.name}: ${cmd}`);
|
|
62
|
+
// RECALL intent folds the companion deterministically and FREE --
|
|
63
|
+
// it must never reach the registry, where the astral "return" verb
|
|
64
|
+
// would run as the companion and answer "You're already in your
|
|
65
|
+
// body." (a real session's agent couldn't be brought home by any
|
|
66
|
+
// natural phrasing: "order agent return", "return to deck"...).
|
|
67
|
+
// ("return fire" is exempt -- that's a shooting order, not a fold.)
|
|
68
|
+
if (entry.kind !== 'ally'
|
|
69
|
+
&& /^(return(?!\s+fire)|recall|come\s+(back|home)|fold|dismiss|stand\s+down|go\s+home)\b/i.test(cmd)) {
|
|
70
|
+
const foldLine = entry.kind === 'spirit'
|
|
71
|
+
? `${feed.icon} You speak the release. The spirit inclines its head -- the bargain closes${(entry.services ?? 0) > 0 ? `, ${entry.services} unspent service${entry.services === 1 ? '' : 's'} forfeit` : ''} -- and it thins back to its own plane.`
|
|
72
|
+
: entry.kind === 'drone'
|
|
73
|
+
? `${feed.icon} The ${entry.boundDevice?.name ?? entry.npc.name} banks once and settles back onto your hand, rotors folding.${entry.boundDevice && entry.boundDevice.droneDamage > 0 ? ` The airframe carries its dents (${entry.boundDevice.droneSummary()})${hint(' -- rest repairs it')}.` : ''}`
|
|
74
|
+
: this.actor.plane === 'matrix'
|
|
75
|
+
? `${feed.icon} Your agent's icon collapses back into your persona -- folded into the deck.`
|
|
76
|
+
: `${feed.icon} The deck spins its agent down -- the DECK IN AR light dies as the icon folds home.`;
|
|
77
|
+
game.dismissCompanion(entry, `ordered home: "${cmd}"`);
|
|
78
|
+
this.scene.updateStatus();
|
|
79
|
+
return `{${feed.color}-fg}${foldLine}{/${feed.color}-fg}`;
|
|
80
|
+
}
|
|
81
|
+
// Spirits bill non-combat tasks a service (combat bills per-fight in
|
|
82
|
+
// combat-exchange, so attack orders aren't double-charged). The
|
|
83
|
+
// CHARGE lands on the success paths below -- a refused order (AI-off
|
|
84
|
+
// directive, unknown target) costs nothing; a spent bargain refuses
|
|
85
|
+
// up front.
|
|
86
|
+
// Anywhere in the phrase, not just the start: "find Mr. Krow and
|
|
87
|
+
// kill him" is an attack order too -- a real session billed it as a
|
|
88
|
+
// task, then the fight's own per-fight charge found the bargain
|
|
89
|
+
// already at zero and dismissed the spirit mid-lunge.
|
|
90
|
+
const isAttackOrder = /\b(attack|kill|subdue|fight|slay|destroy)\b/i.test(cmd);
|
|
91
|
+
const billsService = entry.kind === 'spirit' && !isAttackOrder;
|
|
92
|
+
if (billsService && (entry.services ?? 0) <= 0) {
|
|
93
|
+
return `${entry.npc.name} regards you flatly. The bargain is spent -- no services remain.`;
|
|
94
|
+
}
|
|
95
|
+
const chargeService = () => {
|
|
96
|
+
if (!billsService)
|
|
97
|
+
return;
|
|
98
|
+
entry.services = (entry.services ?? 0) - 1;
|
|
99
|
+
// Resource arithmetic -- Mechanics ticker (readability pass).
|
|
100
|
+
this.logger.meta(`👥 One service spent (${entry.services} left).`, 'green');
|
|
101
|
+
};
|
|
102
|
+
// Tier 1 -- ATOMIC: a known command runs deterministically, no AI.
|
|
103
|
+
// A parsed command whose RESULT is a refusal is NOT obedience: a real
|
|
104
|
+
// session's "go kill Mr. Krow" parsed as go("kill"), answered "That
|
|
105
|
+
// is not a way to go" -- and billed a service for it; "kill Mr.
|
|
106
|
+
// Krow" with Krow two rooms off shrugged instead of hunting. Refused
|
|
107
|
+
// atomics cost nothing and escalate to the directive tier.
|
|
108
|
+
const direct = await entry.npc.tryRunCommand(cmd);
|
|
109
|
+
const atomicRefused = direct !== null && OrderCommand.ATOMIC_REFUSAL.test(direct);
|
|
110
|
+
if (direct !== null && !atomicRefused) {
|
|
111
|
+
chargeService();
|
|
112
|
+
this.scene.updateStatus();
|
|
113
|
+
const report = direct || `${entry.npc.name} moves to obey.`;
|
|
114
|
+
return `{${feed.color}-fg}${feed.icon} ${report}{/${feed.color}-fg}`;
|
|
115
|
+
}
|
|
116
|
+
// Tier 2 -- DIRECTIVE (player request: "order agent to find mr.
|
|
117
|
+
// krow"): not a command (or a refused one), a GOAL. Set it as the
|
|
118
|
+
// companion's standing objective (surfaced in every future prompt)
|
|
119
|
+
// and spur its AI now -- the reflect chain lets it move rooms,
|
|
120
|
+
// search, and act several steps on its own, then keep pursuing on
|
|
121
|
+
// later stimuli.
|
|
122
|
+
if (!AI.isConfigured()) {
|
|
123
|
+
if (direct !== null) {
|
|
124
|
+
// No AI to escalate to -- at least show the refusal, unbilled.
|
|
125
|
+
return `{${feed.color}-fg}${feed.icon} ${direct}{/${feed.color}-fg}`;
|
|
126
|
+
}
|
|
127
|
+
return `{${feed.color}-fg}${feed.icon} ${entry.npc.name} needs exact commands without an AI brain -- try "order ${entry.npc.name.toLowerCase()} go north" or "... attack <name>".{/${feed.color}-fg}`;
|
|
128
|
+
}
|
|
129
|
+
chargeService();
|
|
130
|
+
entry.npc.setObjective(`ORDERED by ${this.actor.name}: ${cmd}. Pursue this until done or countermanded.`);
|
|
131
|
+
// viaLink: the order rides the bond (deck/rigger/summoning), so it
|
|
132
|
+
// reaches the companion across rooms and planes -- a meat-side
|
|
133
|
+
// master in AR must still reach their agent on the grid.
|
|
134
|
+
void Promise.resolve(entry.npc.hear(this.actor, `${cmd} [System note: this is a direct ORDER from ${this.actor.name}, your master. Acknowledge in ONE short line in your own voice, then PURSUE it immediately with [COMMAND] actions -- move rooms ("go <direction>"), search, act; several steps now if needed. Keep pursuing it on future turns until it's done.]`, { viaLink: true })).catch(err => {
|
|
135
|
+
this.logger.error(`${entry.npc.name} failed to take the directive: ${err}`);
|
|
136
|
+
});
|
|
137
|
+
this.scene.updateStatus();
|
|
138
|
+
return `{${feed.color}-fg}${feed.icon} ${entry.npc.name} takes the directive -- "${cmd}" -- and moves on it.{/${feed.color}-fg}`;
|
|
139
|
+
}
|
|
140
|
+
/** Per-kind feed styling -- matches the HUD's plane color language. */
|
|
141
|
+
static FEED = {
|
|
142
|
+
spirit: { color: 'magenta', icon: '✧' },
|
|
143
|
+
drone: { color: 'yellow', icon: '✈' },
|
|
144
|
+
agent: { color: 'cyan', icon: '▣' },
|
|
145
|
+
ally: { color: 'white', icon: '👥' },
|
|
146
|
+
};
|
|
147
|
+
// Result strings that mean the atomic tier bounced -- collected from
|
|
148
|
+
// real refusals (go/attack/talk/take across sessions). The ’ variant
|
|
149
|
+
// covers commands that answer with a smart quote.
|
|
150
|
+
static ATOMIC_REFUSAL = /not a way to go|can['’]t go that way|isn['’]t here|don['’]t see|there is no item|too heavy|doesn['’]t know how|not valid|doesn['’]t seem to have/i;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,kCAAkC,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO;IAC7B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,MAAM,CAAC,WAAW,GAAG,0MAA0M,CAAC;IAE1O,KAAK,CAAC,OAAO,CAAC,OAAiB,EAAE;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1C,OAAO,mFAAmF,CAAC;QAC7F,CAAC;QACD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAA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I,EAAE,GAAG,EAAE;QACvC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE;QACrC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE;QACnC,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;KACrC,CAAC;IAEF,qEAAqE;IACrE,qEAAqE;IACrE,kDAAkD;IAC1C,MAAM,CAAU,cAAc,GACpC,mJAAmJ,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { Command } from './command.js';
|
|
|
2
2
|
import { NPC } from '../models/npc.js';
|
|
3
3
|
import { rollPool, formatRoll } from '../utilities/dice.js';
|
|
4
4
|
import { fuzzyPickName } from '../utilities/fuzzy-match.js';
|
|
5
|
+
import { sameSpot, spotOf, spotRefusal } from '../utilities/spots.js';
|
|
5
6
|
/**
|
|
6
7
|
* The NEGOTIATION skill against a PERSON: "persuade <name> [your pitch]"
|
|
7
8
|
* rolls opposed Charisma + negotiation, and the OUTCOME is mechanically
|
|
@@ -49,6 +50,10 @@ export class PersuadeCommand extends Command {
|
|
|
49
50
|
if (!(target instanceof NPC)) {
|
|
50
51
|
return `${target.name} knows all your tricks already.`;
|
|
51
52
|
}
|
|
53
|
+
// "At" spots: working someone takes proximity (utilities/spots.ts).
|
|
54
|
+
if (!sameSpot(actor, target)) {
|
|
55
|
+
return spotRefusal(target.name, spotOf(target));
|
|
56
|
+
}
|
|
52
57
|
const mark = `persuaded-by:${actor.name}`;
|
|
53
58
|
if (target.socialMarks.has(mark)) {
|
|
54
59
|
return `You've already made your play with ${target.name} this job -- pushing again would just read as desperation.`;
|