@maka/maka-cli 5.3.17 → 5.5.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 +62 -0
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js +196 -0
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js.map +1 -0
- 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 +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js +122 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/attack.d.ts +42 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js +243 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js.map +1 -0
- 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.d.ts +28 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js +101 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.d.ts +19 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.js +219 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/call.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.d.ts +58 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js +397 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/command-registry.d.ts +11 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/command-registry.js +8 -3
- package/bundle/typescript/src/commands/game/sideQuest/commands/command-registry.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/command.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/command.js +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/command.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/drone.d.ts +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/drone.js +72 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/drone.js.map +1 -0
- 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/edge.d.ts +13 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/edge.js +31 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/edge.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/end-call.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/end-call.js +27 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/end-call.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.d.ts +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js +59 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.d.ts +13 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.js +50 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/give.js +7 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/give.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.d.ts +13 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js +147 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.d.ts +25 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js +199 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js.map +1 -0
- 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.d.ts +12 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/inv.js +43 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/inv.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/jack.d.ts +17 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/jack.js +64 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/jack.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/kill.d.ts +10 -3
- package/bundle/typescript/src/commands/game/sideQuest/commands/kill.js +11 -33
- package/bundle/typescript/src/commands/game/sideQuest/commands/kill.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +47 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/map.d.ts +12 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/map.js +46 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/map.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pan.d.ts +12 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pan.js +55 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pan.js.map +1 -0
- 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 +10 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js +33 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/project.d.ts +19 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/project.js +54 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/project.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/read.js +6 -5
- package/bundle/typescript/src/commands/game/sideQuest/commands/read.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/reboot.d.ts +12 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/reboot.js +52 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/reboot.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/reload.d.ts +14 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/reload.js +40 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/reload.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/rest.d.ts +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js +59 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js +31 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +71 -7
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.d.ts +12 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js +58 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/silent.d.ts +13 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/silent.js +50 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/silent.js.map +1 -0
- 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/solve.js +32 -11
- package/bundle/typescript/src/commands/game/sideQuest/commands/solve.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/spells.d.ts +14 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js +86 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/stance.d.ts +12 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/stance.js +41 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/stance.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/subdue.d.ts +21 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/subdue.js +43 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/subdue.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/surrender.d.ts +20 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/surrender.js +45 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/surrender.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.d.ts +8 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js +138 -2
- 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/unlock.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.d.ts +24 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.js +102 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.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/npc-factory.js +7 -2
- package/bundle/typescript/src/commands/game/sideQuest/factories/npc-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 +3 -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.d.ts +8 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js +139 -21
- 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 +174 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js +647 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +138 -9
- package/bundle/typescript/src/commands/game/sideQuest/game.js +757 -197
- package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/minigames/hack-minigame.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/minigames/hack-minigame.js +101 -0
- package/bundle/typescript/src/commands/game/sideQuest/minigames/hack-minigame.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/minigames/lockpick-minigame.d.ts +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/minigames/lockpick-minigame.js +95 -0
- package/bundle/typescript/src/commands/game/sideQuest/minigames/lockpick-minigame.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/door.d.ts +10 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/door.js +15 -2
- package/bundle/typescript/src/commands/game/sideQuest/models/door.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/inventory.d.ts +10 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/inventory.js +54 -4
- package/bundle/typescript/src/commands/game/sideQuest/models/inventory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/item.d.ts +41 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js +106 -3
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.d.ts +27 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +312 -50
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +278 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js +661 -9
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.d.ts +75 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js +199 -6
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/room.d.ts +24 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js +53 -18
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.d.ts +73 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +208 -3
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene1.json +319 -70
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene2.json +661 -227
- package/bundle/typescript/src/commands/game/sideQuest/types/player-equipment.d.ts +1 -0
- 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/npc-seed.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/player-seed.d.ts +42 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/puzzle-seed.d.ts +15 -1
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/room-seed.d.ts +4 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/scene-seed.d.ts +8 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/win-condition-seed.d.ts +15 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/win-condition-seed.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/win-condition-seed.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/abstracts.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/abstracts.js +5 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/abstracts.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/ui.d.ts +3 -0
- package/bundle/typescript/src/commands/game/sideQuest/ui.js +95 -6
- package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.d.ts +60 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js +138 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.d.ts +145 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js +354 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/comm-style.d.ts +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/comm-style.js +12 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/comm-style.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.d.ts +22 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.js +34 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.d.ts +36 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.js +92 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.d.ts +77 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js +265 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/pursuit.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/pursuit.js +36 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/pursuit.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +78 -7
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/set/global.sub.cmd.js +59 -5
- package/bundle/typescript/src/commands/set/global.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/tools/ai/ai.class.d.ts +42 -0
- package/bundle/typescript/src/tools/ai/ai.class.js +117 -0
- package/bundle/typescript/src/tools/ai/ai.class.js.map +1 -0
- package/bundle/typescript/src/tools/fsi/fsi.interfaces.d.ts +1 -0
- package/bundle/typescript/src/tools/fsi/fsi.interfaces.js.map +1 -1
- package/bundle/typescript/src/tools/https/https.class.d.ts +3 -2
- package/bundle/typescript/src/tools/https/https.class.js +51 -2
- package/bundle/typescript/src/tools/https/https.class.js.map +1 -1
- package/bundle/typescript/src/tools/https/https.interface.d.ts +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { BypassCommand } from './bypass-command.js';
|
|
2
|
+
import { CombatExchange } from '../utilities/combat-exchange.js';
|
|
3
|
+
import { rollPool, formatRoll } from '../utilities/dice.js';
|
|
4
|
+
import { fuzzyPickName } from '../utilities/fuzzy-match.js';
|
|
5
|
+
import { describeFledTarget } from '../utilities/pursuit.js';
|
|
6
|
+
import { crossPlaneRefusal } from '../utilities/planes.js';
|
|
7
|
+
const SPELLS = {
|
|
8
|
+
// Direct combat magic: resisted by Body ALONE -- armor is useless against
|
|
9
|
+
// it, which is its whole niche next to a gun (and why its drain is the
|
|
10
|
+
// highest).
|
|
11
|
+
manabolt: { drain: 3, power: 4 },
|
|
12
|
+
// Magical healing: reusable where a medkit is consumed, but every cast
|
|
13
|
+
// costs drain -- healing yourself hurts a little.
|
|
14
|
+
heal: { drain: 2 },
|
|
15
|
+
// Sustained mystic armor: extra soak dice for as long as it's held, at
|
|
16
|
+
// -2 dice to everything else while sustaining. Cast again to release.
|
|
17
|
+
armor: { drain: 2 },
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Gear-driven spellcasting (see Player's magic section): you know a spell
|
|
21
|
+
* if you carry its SpellFormula (or any Grimoire), and the best Focus on
|
|
22
|
+
* you scales the casting pool. "cast <spell> [at <target>]" casts; a bare
|
|
23
|
+
* "cast" (or "cast <direction/barrier>") is still the ward-bypass route
|
|
24
|
+
* inherited from BypassCommand -- now gated on actually having magic gear,
|
|
25
|
+
* instead of being a free-floating coin flip anyone could attempt.
|
|
26
|
+
*/
|
|
27
|
+
export class CastCommand extends BypassCommand {
|
|
28
|
+
static verb = 'cast';
|
|
29
|
+
static description = 'Cast a spell you know: "cast manabolt at <target>", "cast heal [on <ally>]", "cast armor [on <ally>]" (support spells default to yourself; touch range). Every cast costs YOU drain. Bare "cast" attempts to bypass a warded barrier (fatal on failure).';
|
|
30
|
+
bypassType = 'spell';
|
|
31
|
+
noPuzzleMessage = "There's nothing here to cast at.";
|
|
32
|
+
async execute(args = []) {
|
|
33
|
+
// Incantations carry -- casting ends a sneak (see sneak.ts).
|
|
34
|
+
this.actor.sneaking = false;
|
|
35
|
+
const spellName = this.resolveSpellName(args?.[0]);
|
|
36
|
+
if (spellName) {
|
|
37
|
+
return this.castSpell(spellName, args.slice(1));
|
|
38
|
+
}
|
|
39
|
+
// Ward-bypass path (BypassCommand). Now that casting is a real, gated
|
|
40
|
+
// ability, throwing magic at a ward requires the talent or the gear.
|
|
41
|
+
if (!this.actor.isCaster()) {
|
|
42
|
+
return `Casting takes talent you don't have -- you'd need to be Awakened, or have a spell formula, grimoire, or focus on you.`;
|
|
43
|
+
}
|
|
44
|
+
return super.execute(args);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Lenient spell-name matching: the exact key, or a unique fragment of at
|
|
48
|
+
* least 3 characters ("bolt"/"mana" -> manabolt). Anything that doesn't
|
|
49
|
+
* resolve falls through to the ward-bypass path, which is what a
|
|
50
|
+
* direction or barrier name ("cast north", "cast maglock") needs.
|
|
51
|
+
*/
|
|
52
|
+
resolveSpellName(arg) {
|
|
53
|
+
const wanted = arg?.toLowerCase();
|
|
54
|
+
if (!wanted)
|
|
55
|
+
return undefined;
|
|
56
|
+
if (SPELLS[wanted])
|
|
57
|
+
return wanted;
|
|
58
|
+
if (wanted.length < 3)
|
|
59
|
+
return undefined;
|
|
60
|
+
const matches = Object.keys(SPELLS).filter(k => k.includes(wanted));
|
|
61
|
+
return matches.length === 1 ? matches[0] : undefined;
|
|
62
|
+
}
|
|
63
|
+
async castSpell(spellName, rest) {
|
|
64
|
+
if (this.actor.isIncapacitated()) {
|
|
65
|
+
return `You're down. No spell is coming out of you.`;
|
|
66
|
+
}
|
|
67
|
+
// Magic doesn't compile: the Matrix is a machine dream, and mana
|
|
68
|
+
// doesn't flow through silicon. (The astral is the OPPOSITE -- magic's
|
|
69
|
+
// home turf -- so casting there is fine.)
|
|
70
|
+
if (this.actor.plane === 'matrix') {
|
|
71
|
+
return `Magic doesn't work in here -- the Matrix runs on code, not mana. Jack out first.`;
|
|
72
|
+
}
|
|
73
|
+
if (!this.actor.knowsSpell(spellName)) {
|
|
74
|
+
return `You don't know "${spellName}" -- you'd need its spell formula, or a grimoire.`;
|
|
75
|
+
}
|
|
76
|
+
switch (spellName) {
|
|
77
|
+
case 'manabolt': return this.castManabolt(rest);
|
|
78
|
+
case 'heal': return this.castHeal(rest);
|
|
79
|
+
case 'armor': return this.castArmor(rest);
|
|
80
|
+
default: return `You don't know "${spellName}".`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Support spells (heal/armor) default to SELF but can target an ally:
|
|
85
|
+
* "cast heal on jinx". Touch range -- the target must share the room --
|
|
86
|
+
* and the same fuzzy name matching as everything else. Returns an error
|
|
87
|
+
* string instead of a target when the name can't be resolved here.
|
|
88
|
+
*/
|
|
89
|
+
resolveAllyTarget(rest) {
|
|
90
|
+
let words = rest;
|
|
91
|
+
if (words[0]?.toLowerCase() === 'on' || words[0]?.toLowerCase() === 'at') {
|
|
92
|
+
words = words.slice(1);
|
|
93
|
+
}
|
|
94
|
+
if (words.length === 0) {
|
|
95
|
+
return { target: this.actor };
|
|
96
|
+
}
|
|
97
|
+
const room = this.actor.currentLocation;
|
|
98
|
+
const candidates = this.scene.getActorsInRoom(room).filter(a => a.plane === this.actor.plane); // includes self ("cast heal on maka"); same plane only -- touch range
|
|
99
|
+
const pickedName = fuzzyPickName(words.join(' '), candidates.map(a => a.name));
|
|
100
|
+
const target = pickedName ? candidates.find(a => a.name === pickedName) : undefined;
|
|
101
|
+
if (!target) {
|
|
102
|
+
const cross = crossPlaneRefusal(this.scene, this.actor, room, words.join(' '), 'touch');
|
|
103
|
+
if (cross)
|
|
104
|
+
return { error: cross };
|
|
105
|
+
const fled = describeFledTarget(this.scene, room, words.join(' '));
|
|
106
|
+
if (fled)
|
|
107
|
+
return { error: `${fled.split(' -- ')[0]} -- touch range only; you'd have to reach them first.` };
|
|
108
|
+
return { error: `You don't see anyone named "${words.join(' ')}" here.` };
|
|
109
|
+
}
|
|
110
|
+
return { target };
|
|
111
|
+
}
|
|
112
|
+
/** How the caster's pool reads in narration: focus-assisted, raw talent, or book-learned. */
|
|
113
|
+
castingLabel() {
|
|
114
|
+
const focus = this.actor.getBestFocus();
|
|
115
|
+
if (focus)
|
|
116
|
+
return `through their ${focus.name}`;
|
|
117
|
+
return this.actor.isAwakened() ? 'with raw talent' : 'unaided';
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Drain, resolved AFTER the spell: resist with Body, take whatever gets
|
|
121
|
+
* through as STUN damage -- casting doesn't cut you, it wrings you out.
|
|
122
|
+
* A full stun track is a knockout, and overflow past it spills into the
|
|
123
|
+
* physical track (enough drain doesn't just put you down, it starts
|
|
124
|
+
* killing you). Callers check drainCollapse() afterward.
|
|
125
|
+
*/
|
|
126
|
+
applyDrain(spell) {
|
|
127
|
+
// Willpower resists drain (SR-correct; Body stood in before Willpower
|
|
128
|
+
// existed on the sheet). Mages want the mental muscle now.
|
|
129
|
+
const resist = rollPool(this.actor.willpower);
|
|
130
|
+
const taken = Math.max(0, spell.drain - resist.hits);
|
|
131
|
+
const lines = [` Drain (${spell.drain}): resist ${formatRoll(resist)}`];
|
|
132
|
+
if (taken === 0) {
|
|
133
|
+
lines.push(` You shake the drain off.`);
|
|
134
|
+
return lines;
|
|
135
|
+
}
|
|
136
|
+
const { stun, overflow } = this.actor.takeStun(taken);
|
|
137
|
+
this.logger.write(`${this.actor.name} took ${taken} drain (stun ${this.actor.stunTaken}/${this.actor.maxStunBoxes}, overflow ${overflow}).`);
|
|
138
|
+
lines.push(` The drain bites -- ${stun} stun: ${this.actor.stunSummary()}`);
|
|
139
|
+
if (overflow > 0) {
|
|
140
|
+
lines.push(` It's more than your mind can hold -- ${overflow} box${overflow === 1 ? '' : 'es'} spill into your body: ${this.actor.conditionSummary()}`);
|
|
141
|
+
}
|
|
142
|
+
return lines;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* What the drain just did to the caster, if anything: overflow filling
|
|
146
|
+
* the physical track is a burnout DEATH; a full stun track alone is a
|
|
147
|
+
* knockout -- out of the run, but honestly narrated as unconsciousness.
|
|
148
|
+
*/
|
|
149
|
+
async drainCollapse(exchange) {
|
|
150
|
+
if (this.actor.isDown()) {
|
|
151
|
+
return exchange.resolveDeath(this.actor, this.actor, {
|
|
152
|
+
fallLine: `The drain overwhelms you -- the spell takes everything you had, and then the rest.`,
|
|
153
|
+
gameOverLine: `💀 GAME OVER: ${this.actor.name} burned out, killed by their own spell's drain.`,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (this.actor.isUnconscious()) {
|
|
157
|
+
return exchange.resolveDeath(this.actor, this.actor, {
|
|
158
|
+
fatal: false,
|
|
159
|
+
fallLine: `The world grays out mid-syllable -- the drain drops you where you stand, out cold.`,
|
|
160
|
+
gameOverLine: `💀 GAME OVER: ${this.actor.name} knocked out cold by spell drain -- the street decides what happens to sleeping runners.`,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return [];
|
|
164
|
+
}
|
|
165
|
+
async castManabolt(targetArgs) {
|
|
166
|
+
if (targetArgs[0]?.toLowerCase() === 'at')
|
|
167
|
+
targetArgs = targetArgs.slice(1);
|
|
168
|
+
if (targetArgs.length === 0) {
|
|
169
|
+
return 'Cast it at whom? Try: `cast manabolt at <name>`';
|
|
170
|
+
}
|
|
171
|
+
// Same fuzzy matching "take" and "attack" use -- punctuation, case,
|
|
172
|
+
// typos, and partial names all resolve (see utilities/fuzzy-match.ts).
|
|
173
|
+
const room = this.actor.currentLocation;
|
|
174
|
+
const targetName = targetArgs.join(' ');
|
|
175
|
+
const candidates = this.scene.getActorsInRoom(room).filter(a => a !== this.actor && a.plane === this.actor.plane);
|
|
176
|
+
const pickedName = fuzzyPickName(targetName, candidates.map(a => a.name));
|
|
177
|
+
const target = pickedName ? candidates.find(a => a.name === pickedName) : undefined;
|
|
178
|
+
if (!target) {
|
|
179
|
+
// Visible on another plane beats "no one" -- an astral caster CAN
|
|
180
|
+
// see the meat target they're aiming at; name the actual rule
|
|
181
|
+
// (see planes.crossPlaneRefusal).
|
|
182
|
+
const cross = crossPlaneRefusal(this.scene, this.actor, room, targetName, 'spell');
|
|
183
|
+
if (cross)
|
|
184
|
+
return cross;
|
|
185
|
+
// Fled targets get a chase hint, same as attack.ts -- see pursuit.ts.
|
|
186
|
+
const fled = describeFledTarget(this.scene, room, targetName);
|
|
187
|
+
if (fled)
|
|
188
|
+
return fled;
|
|
189
|
+
const present = candidates.map(a => a.name).join(', ') || 'no one';
|
|
190
|
+
return `You don't see anyone named "${targetName}" here. Present: ${present}.`;
|
|
191
|
+
}
|
|
192
|
+
if (target.isIncapacitated()) {
|
|
193
|
+
return `${target.name} is already down. The fight is over.`;
|
|
194
|
+
}
|
|
195
|
+
// One exchange at a time per combatant, same as attack.ts: the player
|
|
196
|
+
// is refused cleanly, an NPC caster waits out the exchange and re-runs
|
|
197
|
+
// (see CombatExchange.waitForLull and the rationale in attack.ts).
|
|
198
|
+
if (this.actor.inExchange || target.inExchange) {
|
|
199
|
+
if (this.actor === this.scene.getPlayer()) {
|
|
200
|
+
return this.actor.inExchange
|
|
201
|
+
? `You're already mid-exchange -- let it resolve.`
|
|
202
|
+
: `${target.name} is already trading fire -- wait for that exchange to resolve.`;
|
|
203
|
+
}
|
|
204
|
+
if (this.actor.waitingForLull) {
|
|
205
|
+
return `You're already waiting for an opening -- one move at a time.`;
|
|
206
|
+
}
|
|
207
|
+
this.actor.waitingForLull = true;
|
|
208
|
+
try {
|
|
209
|
+
const settled = await CombatExchange.waitForLull([this.actor, target]);
|
|
210
|
+
if (!settled) {
|
|
211
|
+
return `You're already mid-exchange -- let it resolve.`;
|
|
212
|
+
}
|
|
213
|
+
// The caster may have died in the very exchange they waited out
|
|
214
|
+
// (castSpell's gate ran before the wait, not after).
|
|
215
|
+
if (this.actor.isIncapacitated()) {
|
|
216
|
+
return `You're down. The fight is over.`;
|
|
217
|
+
}
|
|
218
|
+
this.logger.write(`${this.actor.name}'s manabolt waited out an exchange and now retries.`);
|
|
219
|
+
return await this.castManabolt(targetArgs);
|
|
220
|
+
}
|
|
221
|
+
finally {
|
|
222
|
+
this.actor.waitingForLull = false;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const exchange = new CombatExchange(this.scene, this.logger, this.actor);
|
|
226
|
+
const spell = SPELLS.manabolt;
|
|
227
|
+
const report = [];
|
|
228
|
+
// Movement locks while the exchange resolves, same as attack.ts. The
|
|
229
|
+
// caster's hands are shaping mana, not clearing leather (no
|
|
230
|
+
// aggressor draw) -- but the TARGET's counter is their weapon, so
|
|
231
|
+
// beginExchange still draws for them.
|
|
232
|
+
const drawLines = exchange.beginExchange(target, { aggressorDraws: false });
|
|
233
|
+
try {
|
|
234
|
+
this.actor.performAction('casts manabolt at', target.name);
|
|
235
|
+
this.scene.addWorldEvent(`${this.actor.name} hurled a manabolt at ${target.name} in ${room.name}.`);
|
|
236
|
+
if (drawLines.length > 0) {
|
|
237
|
+
report.push(...drawLines);
|
|
238
|
+
await exchange.announce(drawLines);
|
|
239
|
+
}
|
|
240
|
+
// ---- Initiative decides who acts first, same as attack.ts. A fast
|
|
241
|
+
// target answers the incantation BEFORE the bolt flies -- and a
|
|
242
|
+
// downed caster never casts, never pays drain. ----
|
|
243
|
+
const init = exchange.rollInitiative(this.actor, target);
|
|
244
|
+
report.push(...init.lines);
|
|
245
|
+
await exchange.announce(init.lines);
|
|
246
|
+
for (const striker of [init.first, init.second]) {
|
|
247
|
+
if (striker.isIncapacitated())
|
|
248
|
+
continue;
|
|
249
|
+
const defender = striker === this.actor ? target : this.actor;
|
|
250
|
+
if (defender.isIncapacitated())
|
|
251
|
+
break;
|
|
252
|
+
if (striker === this.actor) {
|
|
253
|
+
// ---- The bolt: casting pool vs defense, resisted by Body ONLY ----
|
|
254
|
+
const strike = exchange.resolveStrike(this.actor, target, {
|
|
255
|
+
label: `with a manabolt, ${this.castingLabel()}`,
|
|
256
|
+
// An armed edge boost (see edge.ts) supercharges the bolt.
|
|
257
|
+
pool: this.actor.getMagicPool() + this.actor.consumeEdgeBoost(),
|
|
258
|
+
damageBase: spell.power,
|
|
259
|
+
soakPool: target.body,
|
|
260
|
+
});
|
|
261
|
+
report.push('', ...strike);
|
|
262
|
+
await exchange.announce(strike);
|
|
263
|
+
if (target.isDown()) {
|
|
264
|
+
report.push(...await exchange.resolveDeath(target, this.actor, {
|
|
265
|
+
fallLine: `${target.name} drops where they stand, eyes empty -- the manabolt left no mark at all. Their gear scatters across ${room.name}.`,
|
|
266
|
+
}));
|
|
267
|
+
}
|
|
268
|
+
// Drain comes due the moment the bolt flies, kill or not.
|
|
269
|
+
const drain = this.applyDrain(spell);
|
|
270
|
+
report.push('', ...drain);
|
|
271
|
+
await exchange.announce(drain);
|
|
272
|
+
const collapse = await this.drainCollapse(exchange);
|
|
273
|
+
if (collapse.length > 0) {
|
|
274
|
+
report.push(...collapse);
|
|
275
|
+
return await exchange.finishExchange(report);
|
|
276
|
+
}
|
|
277
|
+
if (target.isIncapacitated()) {
|
|
278
|
+
return await exchange.finishExchange(report);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
const prefix = striker === init.second ? [`${target.name} retaliates!`] : [`${target.name} moves before the incantation finishes!`];
|
|
283
|
+
const counter = [...prefix, ...exchange.resolveStrike(target, this.actor)];
|
|
284
|
+
report.push('', ...counter);
|
|
285
|
+
await exchange.announce(counter);
|
|
286
|
+
if (this.actor.isDown()) {
|
|
287
|
+
report.push(...await exchange.resolveDeath(this.actor, target));
|
|
288
|
+
return await exchange.finishExchange(report);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// ---- The initiative pass: the decisive winner follows up with
|
|
293
|
+
// their WEAPON (a second bolt would mean a second drain -- that
|
|
294
|
+
// takes its own cast). ----
|
|
295
|
+
if (init.extraStriker && !init.extraStriker.isIncapacitated()) {
|
|
296
|
+
const defender = init.extraStriker === this.actor ? target : this.actor;
|
|
297
|
+
if (!defender.isIncapacitated()) {
|
|
298
|
+
const strike = [`${init.extraStriker.name} presses the advantage!`, ...exchange.resolveStrike(init.extraStriker, defender)];
|
|
299
|
+
report.push('', ...strike);
|
|
300
|
+
await exchange.announce(strike);
|
|
301
|
+
if (defender.isDown()) {
|
|
302
|
+
report.push(...await exchange.resolveDeath(defender, init.extraStriker));
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return await exchange.finishExchange(report);
|
|
307
|
+
}
|
|
308
|
+
finally {
|
|
309
|
+
this.scene.endPlayerExchange();
|
|
310
|
+
exchange.releaseExchange();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
async castHeal(rest = []) {
|
|
314
|
+
const { target, error } = this.resolveAllyTarget(rest);
|
|
315
|
+
if (!target)
|
|
316
|
+
return error ?? `You don't see them here.`;
|
|
317
|
+
const self = target === this.actor;
|
|
318
|
+
if (target.isIncapacitated()) {
|
|
319
|
+
return `${self ? "You're" : `${target.name} is`} past what a heal spell can do.`;
|
|
320
|
+
}
|
|
321
|
+
if (target.damageTaken === 0) {
|
|
322
|
+
return self
|
|
323
|
+
? `You're not hurt -- no sense courting drain for nothing.`
|
|
324
|
+
: `${target.name} isn't hurt -- no sense courting drain for nothing.`;
|
|
325
|
+
}
|
|
326
|
+
const roll = rollPool(this.actor.getMagicPool());
|
|
327
|
+
const healed = target.healDamage(roll.hits);
|
|
328
|
+
const spell = SPELLS.heal;
|
|
329
|
+
this.actor.performAction('casts heal', self ? '' : `on ${target.name}`);
|
|
330
|
+
this.scene.addWorldEvent(`${this.actor.name} cast a healing spell${self ? '' : ` on ${target.name}`} in ${this.actor.currentLocation.name}.`);
|
|
331
|
+
const subject = self ? 'Your' : `${target.name}'s`;
|
|
332
|
+
const lines = [
|
|
333
|
+
`${this.actor.name} casts heal${self ? '' : ` on ${target.name}`}, ${this.castingLabel()}:`,
|
|
334
|
+
` Casting: ${formatRoll(roll)}`,
|
|
335
|
+
healed > 0
|
|
336
|
+
? ` ${subject} wounds knit closed -- ${healed} box${healed === 1 ? '' : 'es'} recovered: ${target.conditionSummary()}`
|
|
337
|
+
: ` The mana slips away -- nothing heals.`,
|
|
338
|
+
// The CASTER pays the drain, whoever the healing went to.
|
|
339
|
+
...this.applyDrain(spell),
|
|
340
|
+
];
|
|
341
|
+
lines.push(...await this.drainCollapse(new CombatExchange(this.scene, this.logger, this.actor)));
|
|
342
|
+
return this.finishSpell(lines);
|
|
343
|
+
}
|
|
344
|
+
async castArmor(rest = []) {
|
|
345
|
+
const { target, error } = this.resolveAllyTarget(rest);
|
|
346
|
+
if (!target)
|
|
347
|
+
return error ?? `You don't see them here.`;
|
|
348
|
+
const self = target === this.actor;
|
|
349
|
+
// Sustained toggle per bearer: casting at them again unravels it, no
|
|
350
|
+
// drain to let go. (The caster is the only one who can release it --
|
|
351
|
+
// a mundane bearer has no way to drop a spell themselves.)
|
|
352
|
+
if (target.sustainedArmor > 0) {
|
|
353
|
+
target.setSustainedArmor(0);
|
|
354
|
+
this.scene.updateStatus();
|
|
355
|
+
this.actor.performAction('releases armor spell', self ? '' : `on ${target.name}`);
|
|
356
|
+
return this.finishSpell([self
|
|
357
|
+
? `You let the armor spell go. The air stops humming, and the sustaining penalty lifts.`
|
|
358
|
+
: `You unravel the armor weave around ${target.name}. The shimmer fades, and their sustaining burden lifts.`]);
|
|
359
|
+
}
|
|
360
|
+
if (target.isIncapacitated()) {
|
|
361
|
+
return `${target.name} is down -- armor won't help now.`;
|
|
362
|
+
}
|
|
363
|
+
const focus = this.actor.getBestFocus();
|
|
364
|
+
const bonus = 2 + (focus ? focus.qualityBonus : 0);
|
|
365
|
+
const spell = SPELLS.armor;
|
|
366
|
+
// The weave taxes its BEARER: they get the soak and carry the -2
|
|
367
|
+
// sustaining burden. The caster pays only the drain.
|
|
368
|
+
target.setSustainedArmor(bonus);
|
|
369
|
+
this.actor.performAction('casts armor', self ? '' : `on ${target.name}`);
|
|
370
|
+
this.scene.addWorldEvent(`${this.actor.name} wrapped ${self ? 'themselves' : target.name} in a shimmering armor spell.`);
|
|
371
|
+
this.scene.updateStatus();
|
|
372
|
+
const lines = [
|
|
373
|
+
`${this.actor.name} casts armor${self ? '' : ` on ${target.name}`}, ${this.castingLabel()}:`,
|
|
374
|
+
` The air hardens around ${self ? 'you' : target.name} -- +${bonus} soak dice while sustained, -2 dice to everything else ${self ? 'you do' : 'they do'}.`,
|
|
375
|
+
` (Cast armor${self ? '' : ` on ${target.name}`} again to release it.)`,
|
|
376
|
+
...this.applyDrain(spell),
|
|
377
|
+
];
|
|
378
|
+
lines.push(...await this.drainCollapse(new CombatExchange(this.scene, this.logger, this.actor)));
|
|
379
|
+
return this.finishSpell(lines);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Non-combat casts are a single block, no exchange pacing needed: the
|
|
383
|
+
* player's own casts return the text for ui.ts to print, while an NPC's
|
|
384
|
+
* cast self-announces to a witnessing player (its return value only ever
|
|
385
|
+
* feeds its AI history) -- same rationale as CombatExchange.
|
|
386
|
+
*/
|
|
387
|
+
finishSpell(lines) {
|
|
388
|
+
this.scene.updateStatus();
|
|
389
|
+
const report = lines.join('\n');
|
|
390
|
+
const isPlayer = this.actor === this.scene.getPlayer();
|
|
391
|
+
if (!isPlayer && this.scene.getPlayer().currentLocation === this.actor.currentLocation) {
|
|
392
|
+
this.logger.log(report);
|
|
393
|
+
}
|
|
394
|
+
return report;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
//# sourceMappingURL=cast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cast.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/cast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAgB3D,MAAM,MAAM,GAA2B;IACrC,0EAA0E;IAC1E,uEAAuE;IACvE,YAAY;IACZ,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;IAChC,uEAAuE;IACvE,kDAAkD;IAClD,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;IAClB,uEAAuE;IACvE,sEAAsE;IACtE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;CACpB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,OAAO,WAAY,SAAQ,aAAa;IAClC,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;IACrB,MAAM,CAAC,WAAW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AAM,IAAI,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEjG,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACK,WAAW,CAAC,KAAe;QACjC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QACvD,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,eAAe,KAAK,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;YACvF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -5,5 +5,15 @@ import { Scene } from '../models/scene.js';
|
|
|
5
5
|
export declare class CommandRegistry {
|
|
6
6
|
private scene;
|
|
7
7
|
constructor(scene: Scene);
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Parses and constructs the command, but does NOT execute it -- callers
|
|
10
|
+
* run it exactly once with the returned args. (This used to also call
|
|
11
|
+
* execute() internally, and callers ran it a second time on top of that
|
|
12
|
+
* with no arguments at all, which crashed any command whose execute()
|
|
13
|
+
* doesn't guard against a missing `args` array.)
|
|
14
|
+
*/
|
|
15
|
+
parse(commandString: string, actor: Player | NPC): Promise<{
|
|
16
|
+
command: Command;
|
|
17
|
+
args: string[];
|
|
18
|
+
} | null>;
|
|
9
19
|
}
|
|
@@ -5,6 +5,13 @@ export class CommandRegistry {
|
|
|
5
5
|
constructor(scene) {
|
|
6
6
|
this.scene = scene;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Parses and constructs the command, but does NOT execute it -- callers
|
|
10
|
+
* run it exactly once with the returned args. (This used to also call
|
|
11
|
+
* execute() internally, and callers ran it a second time on top of that
|
|
12
|
+
* with no arguments at all, which crashed any command whose execute()
|
|
13
|
+
* doesn't guard against a missing `args` array.)
|
|
14
|
+
*/
|
|
8
15
|
async parse(commandString, actor) {
|
|
9
16
|
const parts = commandString.trim().split(' ');
|
|
10
17
|
const verb = parts[0].toLowerCase();
|
|
@@ -18,9 +25,7 @@ export class CommandRegistry {
|
|
|
18
25
|
const command = CommandFactory.createCommand(verb, context);
|
|
19
26
|
if (!command)
|
|
20
27
|
return null;
|
|
21
|
-
|
|
22
|
-
await command.execute(args); // only if you have such a method
|
|
23
|
-
return command;
|
|
28
|
+
return { command, args };
|
|
24
29
|
}
|
|
25
30
|
}
|
|
26
31
|
//# sourceMappingURL=command-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-registry.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/command-registry.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAMjE,MAAM,OAAO,eAAe;IAClB,KAAK,CAAQ;IAErB,YAAY,KAAY;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,aAAqB,EAAE,KAAmB;QACpD,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE5B,MAAM,OAAO,GAAG;YACd,KAAK;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YAC5B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,2DAA2D;SAClE,CAAC;QAEF,MAAM,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE5D,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAE1B,
|
|
1
|
+
{"version":3,"file":"command-registry.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/command-registry.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAMjE,MAAM,OAAO,eAAe;IAClB,KAAK,CAAQ;IAErB,YAAY,KAAY;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,CAAC,aAAqB,EAAE,KAAmB;QACpD,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE5B,MAAM,OAAO,GAAG;YACd,KAAK;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YAC5B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,2DAA2D;SAClE,CAAC;QAEF,MAAM,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE5D,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAE1B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import blessed from 'blessed';
|
|
1
2
|
import { Direction } from '../types/shared/direction-enum.js';
|
|
2
3
|
import { Player, Scene, Room, NPC } from '../models/_index.js';
|
|
3
4
|
import { Logger } from '../utilities/logger.js';
|
|
5
|
+
import type Game from '../game.js';
|
|
4
6
|
export interface ICommand {
|
|
5
7
|
execute(args: string[]): Promise<string>;
|
|
6
8
|
}
|
|
@@ -8,6 +10,8 @@ export interface ICommandConstructor {
|
|
|
8
10
|
actor: Player | NPC;
|
|
9
11
|
scene: Scene;
|
|
10
12
|
rooms?: Record<string, Room>;
|
|
13
|
+
screen?: blessed.Widgets.Screen;
|
|
14
|
+
game?: Game;
|
|
11
15
|
}
|
|
12
16
|
export declare abstract class Command {
|
|
13
17
|
protected static verb: string;
|
|
@@ -16,6 +20,8 @@ export declare abstract class Command {
|
|
|
16
20
|
protected rooms?: Record<string, Room>;
|
|
17
21
|
protected logger: Logger;
|
|
18
22
|
protected scene: Scene;
|
|
23
|
+
protected screen?: blessed.Widgets.Screen;
|
|
24
|
+
protected game?: Game;
|
|
19
25
|
constructor(context: ICommandConstructor);
|
|
20
26
|
abstract execute(args?: string[]): Promise<string>;
|
|
21
27
|
protected isValidDirection(value: string): value is Direction;
|
|
@@ -7,11 +7,15 @@ export class Command {
|
|
|
7
7
|
rooms;
|
|
8
8
|
logger;
|
|
9
9
|
scene;
|
|
10
|
+
screen;
|
|
11
|
+
game;
|
|
10
12
|
constructor(context) {
|
|
11
13
|
this.actor = context.actor;
|
|
12
14
|
this.rooms = context.rooms;
|
|
13
15
|
this.logger = Logger.getInstance();
|
|
14
16
|
this.scene = context.scene;
|
|
17
|
+
this.screen = context.screen;
|
|
18
|
+
this.game = context.game;
|
|
15
19
|
}
|
|
16
20
|
isValidDirection(value) {
|
|
17
21
|
return Object.values(Direction).includes(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAuBhD,MAAM,OAAgB,OAAO;IACjB,MAAM,CAAC,IAAI,CAAS;IACpB,MAAM,CAAC,WAAW,CAAS,CAAE,mBAAmB;IAChD,KAAK,CAAe;IACpB,KAAK,CAAwB;IAC7B,MAAM,CAAS;IACf,KAAK,CAAQ;IACb,MAAM,CAA0B;IAChC,IAAI,CAAQ;IAEtB,YAAY,OAA4B;QACtC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAIS,gBAAgB,CAAC,KAAa;QACtC,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAkB,CAAC,CAAC;IAC/D,CAAC;IAED,gDAAgD;IAChD,MAAM,CAAC,cAAc;QACnB,OAAO,IAAI,CAAC,WAAW,IAAI,2BAA2B,CAAC,CAAE,yDAAyD;IACpH,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
2
|
+
/**
|
|
3
|
+
* The rigger's mechanic: launch a carried surveillance drone for a live
|
|
4
|
+
* sweep of every room adjacent to this one -- who's there, what's locked,
|
|
5
|
+
* whether a Matrix node burns inside. The Fly-Spy slips through vents and
|
|
6
|
+
* cable runs, so a locked door delays it not at all; it sees the MEAT
|
|
7
|
+
* world only (no auras, no ice). Free recon each use -- the drone comes
|
|
8
|
+
* back; risking it in real trouble (jumped-in rigging, drone combat) is
|
|
9
|
+
* a later chapter.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DroneCommand extends Command implements ICommand {
|
|
12
|
+
protected static verb: string;
|
|
13
|
+
protected static description: string;
|
|
14
|
+
execute(_args?: string[]): Promise<string>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Command } from './command.js';
|
|
2
|
+
import { Door } from '../models/door.js';
|
|
3
|
+
import { Category } from '../types/shared/item-enum.js';
|
|
4
|
+
import { rollPool, formatRoll } from '../utilities/dice.js';
|
|
5
|
+
/**
|
|
6
|
+
* The rigger's mechanic: launch a carried surveillance drone for a live
|
|
7
|
+
* sweep of every room adjacent to this one -- who's there, what's locked,
|
|
8
|
+
* whether a Matrix node burns inside. The Fly-Spy slips through vents and
|
|
9
|
+
* cable runs, so a locked door delays it not at all; it sees the MEAT
|
|
10
|
+
* world only (no auras, no ice). Free recon each use -- the drone comes
|
|
11
|
+
* back; risking it in real trouble (jumped-in rigging, drone combat) is
|
|
12
|
+
* a later chapter.
|
|
13
|
+
*/
|
|
14
|
+
export class DroneCommand extends Command {
|
|
15
|
+
static verb = 'drone';
|
|
16
|
+
static description = 'Launch a carried drone to scout every adjacent room: occupants, locks, Matrix nodes. Needs a Drone in your inventory.';
|
|
17
|
+
async execute(_args = []) {
|
|
18
|
+
const actor = this.actor;
|
|
19
|
+
if (actor.plane !== 'meat') {
|
|
20
|
+
return `Your hands -- and the drone in them -- are back with your body. Piloting takes meat fingers.`;
|
|
21
|
+
}
|
|
22
|
+
if (actor.isIncapacitated()) {
|
|
23
|
+
return `You're down. The drone stays in the bag.`;
|
|
24
|
+
}
|
|
25
|
+
const drone = actor.inventory.getAllItems().find(i => i.category === Category.Drone);
|
|
26
|
+
if (!drone) {
|
|
27
|
+
return `No drone in your kit. Riggers carry their eyes with them.`;
|
|
28
|
+
}
|
|
29
|
+
const room = actor.currentLocation;
|
|
30
|
+
const exits = Array.from(room.exits.entries());
|
|
31
|
+
if (exits.length === 0) {
|
|
32
|
+
return `The ${drone.name} lifts, circles once -- nowhere to go from here.`;
|
|
33
|
+
}
|
|
34
|
+
actor.performAction('launches a drone', drone.name);
|
|
35
|
+
this.logger.write(`${actor.name} launched ${drone.name} from ${room.name}.`);
|
|
36
|
+
// A PILOTING test (Reaction + piloting; unskilled Reaction - 1): the
|
|
37
|
+
// feed is only as good as the hands on the sticks. Zero hits and the
|
|
38
|
+
// sweep comes back as static -- relaunch and try again.
|
|
39
|
+
const piloting = actor.skillRating('piloting');
|
|
40
|
+
const roll = rollPool(Math.max(1, actor.reaction + (piloting > 0 ? piloting : -1) + actor.woundModifier - actor.sustainingPenalty));
|
|
41
|
+
if (roll.hits === 0) {
|
|
42
|
+
return [
|
|
43
|
+
`The ${drone.name} whirs off your palm -- Piloting: ${formatRoll(roll)}`,
|
|
44
|
+
` It clips a railing, spins, and the feed dissolves into static. It limps home with nothing.`,
|
|
45
|
+
].join('\n');
|
|
46
|
+
}
|
|
47
|
+
const lines = [`The ${drone.name} whirs off your palm and threads the gaps -- Piloting: ${formatRoll(roll)}. Feed incoming:`];
|
|
48
|
+
for (const [direction, exit] of exits) {
|
|
49
|
+
let target;
|
|
50
|
+
let lockNote = '';
|
|
51
|
+
if (exit instanceof Door) {
|
|
52
|
+
target = exit.getOtherSide(room);
|
|
53
|
+
if (exit.checkIfLocked())
|
|
54
|
+
lockNote = ' [door LOCKED -- it slipped a vent]';
|
|
55
|
+
}
|
|
56
|
+
else if (typeof exit === 'string') {
|
|
57
|
+
target = this.rooms?.[exit];
|
|
58
|
+
}
|
|
59
|
+
if (!target)
|
|
60
|
+
continue;
|
|
61
|
+
const occupants = this.scene.getActorsInRoom(target)
|
|
62
|
+
.filter(a => a.plane === 'meat')
|
|
63
|
+
.map(a => a.name);
|
|
64
|
+
const who = occupants.length > 0 ? occupants.join(', ') : 'empty';
|
|
65
|
+
const node = target.hasNode ? ' -- a Matrix host node hums here' : '';
|
|
66
|
+
lines.push(` • ${direction}: ${target.name}${lockNote} -- ${who}${node}`);
|
|
67
|
+
}
|
|
68
|
+
lines.push(`The ${drone.name} loops home and folds back into your kit.`);
|
|
69
|
+
return lines.join('\n');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=drone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drone.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/drone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO;IAC7B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,MAAM,CAAC,WAAW,GAAG,uHAAuH,CAAC;IAEvJ,KAAK,CAAC,OAAO,CAAC,QAAkB,EAAE;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAEzB,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;YAC3B,OAAO,8FAA8F,CAAC;QACxG,CAAC;QACD,IAAI,KAAK,CAAC,eAAe,EAAE,EAAE,CAAC;YAC5B,OAAO,0CAA0C,CAAC;QACpD,CAAC;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC;QACrF,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAA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cannot drop ${itemName}`;
|
|
27
27
|
}
|
|
28
28
|
this.logger.write(`${this.actor.name} has successfully dropped "${itemName}" from inventory to ${this.actor.currentLocation.name} during 'Drop' command.`);
|
|
29
|
+
// A witnessed drop lands in the open -- sweepable without a "search"
|
|
30
|
+
// (see Room.plainSightItems).
|
|
31
|
+
this.actor.currentLocation.plainSightItems.add(itemToDrop.name.toLowerCase());
|
|
29
32
|
this.actor.performAction('drop', itemName);
|
|
30
33
|
return `You dropped ${itemName}.`;
|
|
31
34
|
}
|