@maka/maka-cli 5.1.29 → 5.1.31
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/commands/command-registry.d.ts +9 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/command-registry.js +26 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/command-registry.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/command.d.ts +13 -7
- package/bundle/typescript/src/commands/game/sideQuest/commands/command.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/command.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/drop.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/drop.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/drop.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/give.d.ts +7 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/give.js +51 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/give.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js +3 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/lock.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/lock.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/lock.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.d.ts +3 -11
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js +7 -32
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/solve.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/solve.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/solve.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/store.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/store.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/store.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/talk.d.ts +3 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/unequip.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/unequip.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/unequip.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js +34 -24
- package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.d.ts +1 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.js +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/command-factory.d.ts +9 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/{commandF.js → command-factory.js} +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/command-factory.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/item-factory.d.ts +5 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/item-factory.js +24 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/item-factory.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/npc-factory.d.ts +10 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/npc-factory.js +36 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/npc-factory.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/puzzle-factory.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/puzzle-factory.js +24 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/puzzle-factory.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/room-factory.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/room-factory.js +19 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/room-factory.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/{sceneSynthesizer.d.ts → scene-factory.d.ts} +2 -2
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js +115 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +11 -5
- package/bundle/typescript/src/commands/game/sideQuest/game.js +102 -10
- package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/door.d.ts +7 -3
- package/bundle/typescript/src/commands/game/sideQuest/models/door.js +1 -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 +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/inventory.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/inventory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/item.d.ts +26 -4
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js +36 -4
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.d.ts +22 -14
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +141 -49
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +16 -4
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js +85 -57
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.d.ts +11 -2
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js +2 -2
- package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/room.d.ts +29 -6
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js +79 -7
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.d.ts +29 -18
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +82 -69
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene1.json +93 -114
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene2.json +130 -151
- package/bundle/typescript/src/commands/game/sideQuest/types/enums.d.ts +13 -7
- package/bundle/typescript/src/commands/game/sideQuest/types/enums.js +12 -6
- package/bundle/typescript/src/commands/game/sideQuest/types/enums.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/types/{types.d.ts → player-equipment.d.ts} +8 -10
- package/bundle/typescript/src/commands/game/sideQuest/types/player-equipment.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/player-equipment.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/exit-seed.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/exit-seed.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/exit-seed.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/item-seed.d.ts +22 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/item-seed.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/item-seed.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/lifestyle-seed.d.ts +22 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/lifestyle-seed.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/lifestyle-seed.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/npc-seed.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/npc-seed.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/npc-seed.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/player-seed.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/player-seed.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/player-seed.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/puzzle-seed.d.ts +11 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/puzzle-seed.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/puzzle-seed.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/room-seed.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/room-seed.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/room-seed.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/scene-seed.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/scene-seed.js +2 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/scene-seed.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/{abstracts.d.ts → shared/abstracts.d.ts} +12 -9
- package/bundle/typescript/src/commands/game/sideQuest/types/{abstracts.js → shared/abstracts.js} +7 -2
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/abstracts.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/direction-enum.d.ts +8 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/direction-enum.js +10 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/direction-enum.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/equipment-enum.d.ts +25 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/equipment-enum.js +27 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/equipment-enum.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.d.ts +34 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.js +38 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/ui.d.ts +6 -2
- package/bundle/typescript/src/commands/game/sideQuest/ui.js +48 -79
- package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.d.ts +4 -2
- package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.js +8 -4
- package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +20 -13
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/tools/https/https.class.d.ts +1 -0
- package/bundle/typescript/src/tools/https/https.class.js +49 -1
- package/bundle/typescript/src/tools/https/https.class.js.map +1 -1
- package/package.json +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/commandF.d.ts +0 -10
- package/bundle/typescript/src/commands/game/sideQuest/factories/commandF.js.map +0 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/roomsF.d.ts +0 -6
- package/bundle/typescript/src/commands/game/sideQuest/factories/roomsF.js +0 -18
- package/bundle/typescript/src/commands/game/sideQuest/factories/roomsF.js.map +0 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/sceneSynthesizer.js +0 -77
- package/bundle/typescript/src/commands/game/sideQuest/factories/sceneSynthesizer.js.map +0 -1
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene3.json +0 -380
- package/bundle/typescript/src/commands/game/sideQuest/types/abstracts.js.map +0 -1
- package/bundle/typescript/src/commands/game/sideQuest/types/interfaces.d.ts +0 -197
- package/bundle/typescript/src/commands/game/sideQuest/types/interfaces.js +0 -2
- package/bundle/typescript/src/commands/game/sideQuest/types/interfaces.js.map +0 -1
- package/bundle/typescript/src/commands/game/sideQuest/types/types.js +0 -2
- package/bundle/typescript/src/commands/game/sideQuest/types/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game.js","sourceRoot":"","sources":["../../../../../../src/commands/game/sideQuest/game.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"game.js","sourceRoot":"","sources":["../../../../../../src/commands/game/sideQuest/game.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAKxC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,E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,MAAM,QAAQ,GAAG,cAAc,CAAC,wBAAwB,EAAE,CAAC;QAC3D,IAAI,QAAQ,GAAG,uBAAuB,CAAC;QAEvC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC5B,IAAI,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClC,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAA8B,CAAC;gBACjE,QAAQ,IAAI,KAAK,IAAI,KAAK,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC;YAC9D,CAAC;QACH,CAAC;QAED,QAAQ,IAAI,8BAA8B,CAAC;QAC3C,QAAQ,IAAI,0BAA0B,CAAC;QAEvC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { Logger } from '../utilities/logger.js';
|
|
2
2
|
import { Room } from './room.js';
|
|
3
|
-
import { AbstractDoor } from '../types/abstracts.js';
|
|
4
|
-
|
|
3
|
+
import { AbstractDoor } from '../types/shared/abstracts.js';
|
|
4
|
+
export interface IDoorConstructorConfig {
|
|
5
|
+
roomA: Room;
|
|
6
|
+
roomB: Room;
|
|
7
|
+
isLocked?: boolean;
|
|
8
|
+
unlockItemOrSolution?: string;
|
|
9
|
+
}
|
|
5
10
|
export declare class Door extends AbstractDoor {
|
|
6
11
|
roomA: Room;
|
|
7
12
|
roomB: Room;
|
|
8
13
|
isLocked: boolean;
|
|
9
14
|
unlockItemOrSolution?: string;
|
|
10
|
-
name: string;
|
|
11
15
|
logger: Logger;
|
|
12
16
|
isLockable: boolean;
|
|
13
17
|
constructor(config: IDoorConstructorConfig);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Logger } from '../utilities/logger.js';
|
|
2
|
-
import { AbstractDoor } from '../types/abstracts.js';
|
|
2
|
+
import { AbstractDoor } from '../types/shared/abstracts.js';
|
|
3
3
|
export class Door extends AbstractDoor {
|
|
4
4
|
roomA; // One side of the door
|
|
5
5
|
roomB; // The other side of the door
|
|
6
6
|
isLocked;
|
|
7
7
|
unlockItemOrSolution;
|
|
8
|
-
name;
|
|
9
8
|
logger;
|
|
10
9
|
isLockable;
|
|
11
10
|
constructor(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"door.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/models/door.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"door.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/models/door.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAS5D,MAAM,OAAO,IAAK,SAAQ,YAAY;IACpC,KAAK,CAAO,CAAE,uBAAuB;IACrC,KAAK,CAAO,CAAE,6BAA6B;IAC3C,QAAQ,CAAU;IAClB,oBAAoB,CAAU;IAC9B,MAAM,CAAS;IACf,UAAU,CAAS;IAEnB,YAAY,MAA8B;QACxC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC;QACzC,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAC;QACxD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC;QAEhD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,IAAI,CAAC,KAAK,CAAC,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,gBAAgB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnH,CAAC;IAED,YAAY,CAAC,WAAiB;QAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IAChE,CAAC;IAED,kBAAkB,CAAC,WAAiB;QAClC,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1F,CAAC;IAED,aAAa,CAAC,cAAsB;QAClC,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,oBAAoB,KAAK,cAAc,EAAE,CAAC;YAC/F,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,IAAI,WAAW,cAAc,EAAE,CAAC,CAAC;YAC1E,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,IAAI,CAAC,IAAI,WAAW,cAAc,EAAE,CAAC,CAAC;QAClF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Logger } from '../utilities/logger.js';
|
|
2
2
|
import { Item } from './item.js';
|
|
3
|
-
import { AbstractInventory } from '../types/abstracts.js';
|
|
3
|
+
import { AbstractInventory } from '../types/shared/abstracts.js';
|
|
4
4
|
export declare class Inventory extends AbstractInventory {
|
|
5
5
|
protected items: Map<string, Item>;
|
|
6
6
|
protected logger: Logger;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { capitalCase } from 'change-case';
|
|
2
2
|
import { Logger } from '../utilities/logger.js';
|
|
3
|
-
import { AbstractInventory } from '../types/abstracts.js';
|
|
3
|
+
import { AbstractInventory } from '../types/shared/abstracts.js';
|
|
4
4
|
export class Inventory extends AbstractInventory {
|
|
5
5
|
items;
|
|
6
6
|
logger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/models/inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/models/inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,OAAO,SAAU,SAAQ,iBAAiB;IACpC,KAAK,CAAoB;IACzB,MAAM,CAAS;IACjB,WAAW,GAAwB,IAAI,GAAG,EAAE,CAAC,CAAC,uBAAuB;IAE7E;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAgB,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,gCAAgC;IACtE,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,IAAU;QAChB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;QAC9C,IAAI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size, Category, Rating } from '../types/
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { Size, Category, Rating } from '../types/shared/item-enum.js';
|
|
2
|
+
import { AbstractItem } from '../types/shared/abstracts.js';
|
|
3
|
+
export interface IItemConstructorConfig {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
size: Size;
|
|
7
|
+
category: Category;
|
|
8
|
+
shape: string;
|
|
9
|
+
color: string;
|
|
10
|
+
texture: string;
|
|
11
|
+
rating: Rating;
|
|
12
|
+
weight: number;
|
|
13
|
+
details?: string;
|
|
14
|
+
content?: string;
|
|
15
|
+
satisfiesLifestyle?: {
|
|
16
|
+
addictionTypes?: string[];
|
|
17
|
+
habitTags?: string[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
4
20
|
export declare class Item extends AbstractItem {
|
|
5
|
-
|
|
21
|
+
private _id;
|
|
22
|
+
private _owner?;
|
|
6
23
|
name: string;
|
|
7
24
|
description: string;
|
|
8
25
|
size: Size;
|
|
@@ -12,6 +29,7 @@ export declare class Item extends AbstractItem {
|
|
|
12
29
|
texture: string;
|
|
13
30
|
rating: Rating;
|
|
14
31
|
weight: number;
|
|
32
|
+
content?: string;
|
|
15
33
|
details?: string;
|
|
16
34
|
satisfiesLifestyle?: {
|
|
17
35
|
addictionTypes?: string[];
|
|
@@ -20,6 +38,9 @@ export declare class Item extends AbstractItem {
|
|
|
20
38
|
protected _currencyAmount: number;
|
|
21
39
|
protected _currencyCapacity?: number;
|
|
22
40
|
constructor(options: IItemConstructorConfig);
|
|
41
|
+
get owner(): string | undefined;
|
|
42
|
+
set owner(owner: string | undefined);
|
|
43
|
+
get id(): string;
|
|
23
44
|
use(): string;
|
|
24
45
|
supportsAddiction(addiction: string): boolean;
|
|
25
46
|
supportsHabit(habit: string): boolean;
|
|
@@ -27,4 +48,5 @@ export declare class Item extends AbstractItem {
|
|
|
27
48
|
get currencyAmount(): number;
|
|
28
49
|
addCurrency(amount: number): number;
|
|
29
50
|
deductCurrency(amount: number): number;
|
|
51
|
+
getCharacteristics(): Record<string, string | number | string[] | undefined>;
|
|
30
52
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Size, Category, Rating } from '../types/
|
|
1
|
+
import { Size, Category, Rating } from '../types/shared/item-enum.js';
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
-
import { AbstractItem } from '../types/abstracts.js';
|
|
3
|
+
import { AbstractItem } from '../types/shared/abstracts.js';
|
|
4
4
|
export class Item extends AbstractItem {
|
|
5
|
-
|
|
5
|
+
_id;
|
|
6
|
+
_owner;
|
|
6
7
|
name;
|
|
7
8
|
description;
|
|
8
9
|
size;
|
|
@@ -12,6 +13,7 @@ export class Item extends AbstractItem {
|
|
|
12
13
|
texture;
|
|
13
14
|
rating;
|
|
14
15
|
weight;
|
|
16
|
+
content;
|
|
15
17
|
details;
|
|
16
18
|
satisfiesLifestyle;
|
|
17
19
|
// New currency-related fields
|
|
@@ -39,8 +41,9 @@ export class Item extends AbstractItem {
|
|
|
39
41
|
this.rating = options.rating;
|
|
40
42
|
this.weight = options.weight;
|
|
41
43
|
this.details = options.details;
|
|
44
|
+
this.content = options.content;
|
|
42
45
|
this.satisfiesLifestyle = options.satisfiesLifestyle;
|
|
43
|
-
this.
|
|
46
|
+
this._id = uuidv4();
|
|
44
47
|
// Optional: you can define capacity by size
|
|
45
48
|
if (this.isCurrencyCarrier()) {
|
|
46
49
|
switch (this.size) {
|
|
@@ -56,6 +59,15 @@ export class Item extends AbstractItem {
|
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
}
|
|
62
|
+
get owner() {
|
|
63
|
+
return this._owner;
|
|
64
|
+
}
|
|
65
|
+
set owner(owner) {
|
|
66
|
+
this._owner = owner;
|
|
67
|
+
}
|
|
68
|
+
get id() {
|
|
69
|
+
return this._id;
|
|
70
|
+
}
|
|
59
71
|
use() {
|
|
60
72
|
return `You use the ${this.name}. Nothing special happens.`;
|
|
61
73
|
}
|
|
@@ -89,5 +101,25 @@ export class Item extends AbstractItem {
|
|
|
89
101
|
this._currencyAmount -= deducted;
|
|
90
102
|
return deducted;
|
|
91
103
|
}
|
|
104
|
+
getCharacteristics() {
|
|
105
|
+
return {
|
|
106
|
+
id: this._id,
|
|
107
|
+
name: this.name,
|
|
108
|
+
description: this.description,
|
|
109
|
+
size: this.size,
|
|
110
|
+
category: this.category,
|
|
111
|
+
shape: this.shape,
|
|
112
|
+
color: this.color,
|
|
113
|
+
texture: this.texture,
|
|
114
|
+
rating: this.rating,
|
|
115
|
+
weight: this.weight,
|
|
116
|
+
content: this.content,
|
|
117
|
+
details: this.details,
|
|
118
|
+
addictionTypes: this.satisfiesLifestyle?.addictionTypes,
|
|
119
|
+
habitTags: this.satisfiesLifestyle?.habitTags,
|
|
120
|
+
currencyAmount: this.isCurrencyCarrier() ? this._currencyAmount : undefined,
|
|
121
|
+
currencyCapacity: this.isCurrencyCarrier() ? this._currencyCapacity : undefined,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
92
124
|
}
|
|
93
125
|
//# sourceMappingURL=item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/models/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/models/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAoB5D,MAAM,OAAO,IAAK,SAAQ,YAAY;IAC5B,GAAG,CAAS;IACZ,MAAM,CAAsB;IAC7B,IAAI,CAAS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AAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,cAAc,EAAE,IAAI,CAAC,kBAAkB,EAAE,cAAc;YACvD,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS;YAC7C,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS;YAC3E,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS;SAChF,CAAC;IACJ,CAAC;CAEF"}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { Room } from './room.js';
|
|
2
1
|
import { Player } from './player.js';
|
|
3
|
-
import {
|
|
2
|
+
import { Scene } from './scene.js';
|
|
3
|
+
import { IPlayerConstructorConfig } from '../models/player.js';
|
|
4
|
+
import { CommandRegistry } from '../commands/command-registry.js';
|
|
5
|
+
export interface INPCConstructorConfig {
|
|
6
|
+
dialog: string[];
|
|
7
|
+
description: string;
|
|
8
|
+
playerConstructorConfig: IPlayerConstructorConfig;
|
|
9
|
+
}
|
|
4
10
|
export declare class NPC extends Player {
|
|
5
|
-
readonly _name: string;
|
|
6
11
|
private _dialogue;
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
private _description;
|
|
13
|
+
private _scene;
|
|
14
|
+
private _history;
|
|
15
|
+
private readonly _maxHistory;
|
|
16
|
+
private commandRegistry;
|
|
17
|
+
constructor(npcConfig: INPCConstructorConfig, commandRegistry: CommandRegistry);
|
|
18
|
+
set scene(scene: Scene);
|
|
19
|
+
get description(): string;
|
|
20
|
+
act(commandString: string): void;
|
|
21
|
+
hear(actor: Player, message: string): Promise<void>;
|
|
22
|
+
see(actor: Player, verb: string, details?: string): Promise<void>;
|
|
23
|
+
private _addToHistory;
|
|
24
|
+
private getHistorySummary;
|
|
14
25
|
speak(): string;
|
|
15
|
-
|
|
16
|
-
moveTo(direction: string): void;
|
|
17
|
-
get image(): string;
|
|
18
|
-
set image(asciiArtImage: string);
|
|
26
|
+
respondTo(actor: Player, message: string): Promise<void>;
|
|
19
27
|
}
|
|
@@ -1,26 +1,66 @@
|
|
|
1
|
+
import { capitalCase } from 'change-case';
|
|
1
2
|
import { Player } from './player.js';
|
|
2
|
-
import {
|
|
3
|
+
import { Door } from './door.js';
|
|
3
4
|
import { HTTPS } from '../../../../tools/https/https.class.js';
|
|
4
5
|
export class NPC extends Player {
|
|
5
|
-
_name;
|
|
6
6
|
_dialogue;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
this.
|
|
7
|
+
_description;
|
|
8
|
+
_scene;
|
|
9
|
+
_history = [];
|
|
10
|
+
_maxHistory = 10;
|
|
11
|
+
commandRegistry;
|
|
12
|
+
constructor(npcConfig, commandRegistry) {
|
|
13
|
+
super(npcConfig.playerConstructorConfig);
|
|
14
|
+
this._dialogue = npcConfig.dialog;
|
|
15
|
+
this._description = npcConfig.description;
|
|
16
|
+
this.commandRegistry = commandRegistry;
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
set scene(scene) {
|
|
19
|
+
this._scene = scene;
|
|
18
20
|
}
|
|
19
|
-
|
|
21
|
+
get description() {
|
|
22
|
+
return this._description;
|
|
23
|
+
}
|
|
24
|
+
act(commandString) {
|
|
25
|
+
const command = this.commandRegistry.parse(commandString, this);
|
|
26
|
+
if (command) {
|
|
27
|
+
const response = command.execute(); // assume args already set
|
|
28
|
+
this.respondTo(this, response);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.logger.error(`${this.name} tried to perform unknown command: ${commandString}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async hear(actor, message) {
|
|
20
35
|
if (actor === this)
|
|
21
36
|
return;
|
|
22
|
-
|
|
23
|
-
this.
|
|
37
|
+
const entry = `${actor.name} says: "${message}"`;
|
|
38
|
+
this._addToHistory(entry);
|
|
39
|
+
this.logger.write(`${this.name} heard from ${actor.name}`);
|
|
40
|
+
await this.respondTo(actor, message);
|
|
41
|
+
}
|
|
42
|
+
async see(actor, verb, details) {
|
|
43
|
+
if (actor === this)
|
|
44
|
+
return;
|
|
45
|
+
const entry = `${actor.name} ${verb}${details ? ` ${details}` : ''}`;
|
|
46
|
+
this._addToHistory(entry);
|
|
47
|
+
this.logger.write(`${this.name} sees ${entry}`);
|
|
48
|
+
await this.respondTo(actor, entry);
|
|
49
|
+
}
|
|
50
|
+
_addToHistory(entry) {
|
|
51
|
+
this._history.push(entry);
|
|
52
|
+
if (this._history.length > this._maxHistory) {
|
|
53
|
+
this._history.shift();
|
|
54
|
+
}
|
|
55
|
+
this.logger.write(`Added ${entry} to ${this.name} history`);
|
|
56
|
+
}
|
|
57
|
+
getHistorySummary() {
|
|
58
|
+
if (this._history.length === 0)
|
|
59
|
+
return `This NPC has not observed any recent activity.`;
|
|
60
|
+
return `Recent activity around this NPC:\n${this._history.map((h, i) => ` ${i + 1}. ${h}`).join('\n')}`;
|
|
61
|
+
}
|
|
62
|
+
speak() {
|
|
63
|
+
return this._dialogue[Math.floor(Math.random() * this._dialogue.length)];
|
|
24
64
|
}
|
|
25
65
|
async respondTo(actor, message) {
|
|
26
66
|
this.logger.write('Attempting to respond');
|
|
@@ -29,27 +69,71 @@ export class NPC extends Player {
|
|
|
29
69
|
actor.hear(this, this.speak());
|
|
30
70
|
return;
|
|
31
71
|
}
|
|
72
|
+
const commandHelp = `
|
|
73
|
+
Available in-game commands (use with [COMMAND] prefix):
|
|
74
|
+
|
|
75
|
+
- go <direction> — move in a direction like north, south, east, west
|
|
76
|
+
- say <message> — speak a message
|
|
77
|
+
- take <item name> — pick up an item
|
|
78
|
+
- drop <item name> — drop an item
|
|
79
|
+
- use <item name> — use an item
|
|
80
|
+
- equip <item name> — equip an item
|
|
81
|
+
- unequip <item name> — remove an equipped item
|
|
82
|
+
- unlock <door name> — unlock a door (if you have the key or solution)
|
|
83
|
+
- lock <door name> — lock a door
|
|
84
|
+
- solve <puzzle name> — attempt to solve a puzzle
|
|
85
|
+
- search — search the room for hidden things
|
|
86
|
+
- look — look around the current room
|
|
87
|
+
- store <item name> — store an item (in bank, safe, etc.)
|
|
88
|
+
- give <item name> to <target> — give an item to someone
|
|
89
|
+
- talk-to <target> — initiate conversation with another character
|
|
90
|
+
`.trim();
|
|
91
|
+
const historySummary = this.getHistorySummary();
|
|
32
92
|
const lifestyleSummary = this.lifestyleChoices.length > 0
|
|
33
93
|
? `This NPC has the following lifestyle characteristics: ${this.lifestyleChoices.join(', ')}.`
|
|
34
94
|
: `This NPC has no defined lifestyle preferences.`;
|
|
35
|
-
// Room description
|
|
36
95
|
const room = this.currentLocation;
|
|
37
96
|
const roomDesc = `They are currently in: "${room.name}" — ${room.description}`;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
97
|
+
let exitList;
|
|
98
|
+
if (room.exits && room.exits.size > 0) {
|
|
99
|
+
const formattedExits = Array.from(room.exits.entries()).map(([direction, exit]) => {
|
|
100
|
+
const directionLabel = capitalCase(direction);
|
|
101
|
+
if (exit instanceof Door) {
|
|
102
|
+
const targetRoom = exit.getOtherSideToName(room);
|
|
103
|
+
const lockedStatus = exit.checkIfLocked()
|
|
104
|
+
? ' (Locked)'
|
|
105
|
+
: (exit.checkIfLockable() ? ' (Unlocked)' : '');
|
|
106
|
+
return `${directionLabel} → ${targetRoom}${lockedStatus}`;
|
|
107
|
+
}
|
|
108
|
+
else if (typeof exit === 'string') {
|
|
109
|
+
return `${directionLabel} → ${exit}`;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return `${directionLabel} → Unknown`;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
exitList = `The room has the following exits:\n${formattedExits.map(e => ` - ${e}`).join('\n')}`;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
exitList = `The room has no obvious exits.`;
|
|
119
|
+
}
|
|
43
120
|
const visibleItems = room.inventory.getAllItems?.() ?? [];
|
|
44
121
|
const roomInventoryDesc = visibleItems.length > 0
|
|
45
122
|
? `Items visible in the room: ${visibleItems.map(item => item.name).join(', ')}.`
|
|
46
123
|
: `There are no visible items in the room.`;
|
|
47
|
-
// NPC inventory
|
|
48
124
|
const npcItems = this.inventory?.getAllItems?.() ?? [];
|
|
49
125
|
const npcInventoryDesc = npcItems.length > 0
|
|
50
|
-
? `This NPC is carrying
|
|
51
|
-
: `This NPC is not
|
|
52
|
-
|
|
126
|
+
? `This NPC is carrying the following items:\n${npcItems.map(item => `- ${item.getCharacteristics?.() ?? item.name}`).join('\n')}`
|
|
127
|
+
: `This NPC is not carrying anything.`;
|
|
128
|
+
const ownedRooms = this._scene?.getOwnedRoomsBy?.(this.name) ?? [];
|
|
129
|
+
const ownedRoomsDesc = ownedRooms.length > 0
|
|
130
|
+
? `They own the following rooms: ${ownedRooms.map(r => `"${r.name}"`).join(', ')}.`
|
|
131
|
+
: `They do not appear to own any rooms.`;
|
|
132
|
+
const ownedItems = this._scene?.getOwnedItemsBy?.(this.name) ?? [];
|
|
133
|
+
const ownedItemsDesc = ownedItems.length > 0
|
|
134
|
+
? `They own the following items: ${ownedItems.map(i => `"${i.name}"`).join(', ')}.`
|
|
135
|
+
: `They do not appear to own any items.`;
|
|
136
|
+
// GPT prompt with command instruction
|
|
53
137
|
const prompt = `
|
|
54
138
|
You are an NPC named ${this.name} in a gritty cyberpunk text adventure game.
|
|
55
139
|
|
|
@@ -60,7 +144,18 @@ You are an NPC named ${this.name} in a gritty cyberpunk text adventure game.
|
|
|
60
144
|
${lifestyleSummary}
|
|
61
145
|
${npcInventoryDesc}
|
|
62
146
|
|
|
147
|
+
${ownedRoomsDesc}
|
|
148
|
+
${ownedItemsDesc}
|
|
149
|
+
|
|
150
|
+
${historySummary}
|
|
151
|
+
|
|
63
152
|
Stay in character. Respond naturally based on your surroundings, personality, and the player’s message.
|
|
153
|
+
Any exposition should be in 3rd person.
|
|
154
|
+
|
|
155
|
+
If you want to perform an action, include a separate line that starts with:
|
|
156
|
+
[COMMAND] <your in-game command here>
|
|
157
|
+
|
|
158
|
+
${commandHelp}
|
|
64
159
|
|
|
65
160
|
Player: ${message}
|
|
66
161
|
${this.name}:
|
|
@@ -75,35 +170,32 @@ Player: ${message}
|
|
|
75
170
|
throw new Error(JSON.parse(result.data).error.message);
|
|
76
171
|
}
|
|
77
172
|
const reply = JSON.parse(result.data)?.choices?.[0]?.message?.content?.trim();
|
|
78
|
-
|
|
79
|
-
|
|
173
|
+
if (!reply) {
|
|
174
|
+
actor.hear(this, this.speak());
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
this._addToHistory(reply);
|
|
178
|
+
const lines = reply.split('\n');
|
|
179
|
+
const spokenLines = lines.filter(line => !line.startsWith('[COMMAND]')).join('\n').trim();
|
|
180
|
+
const commandLines = lines.filter(line => line.startsWith('[COMMAND]'));
|
|
181
|
+
// Speak first
|
|
182
|
+
actor.hear(this, spokenLines || this.speak());
|
|
183
|
+
// Act on any commands
|
|
184
|
+
for (const commandLine of commandLines) {
|
|
185
|
+
const commandText = commandLine.replace('[COMMAND]', '').trim();
|
|
186
|
+
this.logger.write(`${this.name} attempts to execute: ${commandText}`);
|
|
187
|
+
try {
|
|
188
|
+
this.act(commandText);
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
this.logger.error(`${this.name} failed to execute command "${commandText}": ${err}`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
80
194
|
}
|
|
81
195
|
catch (err) {
|
|
82
196
|
this.logger.write(`GPT fallback due to error: ${err}`);
|
|
83
197
|
actor.hear(this, this.speak());
|
|
84
198
|
}
|
|
85
199
|
}
|
|
86
|
-
speak() {
|
|
87
|
-
return this._dialogue[Math.floor(Math.random() * this._dialogue.length)];
|
|
88
|
-
}
|
|
89
|
-
autonomousMove(possibleRooms) {
|
|
90
|
-
const nextRoom = possibleRooms[Math.floor(Math.random() * possibleRooms.length)];
|
|
91
|
-
this.moveTo(nextRoom.name);
|
|
92
|
-
}
|
|
93
|
-
moveTo(direction) {
|
|
94
|
-
const context = {
|
|
95
|
-
actor: this,
|
|
96
|
-
rooms: this.rooms,
|
|
97
|
-
scene: this.scene
|
|
98
|
-
};
|
|
99
|
-
const goCommand = new GoCommand(context);
|
|
100
|
-
goCommand.execute([direction]);
|
|
101
|
-
}
|
|
102
|
-
get image() {
|
|
103
|
-
return this._image;
|
|
104
|
-
}
|
|
105
|
-
set image(asciiArtImage) {
|
|
106
|
-
this._image = asciiArtImage;
|
|
107
|
-
}
|
|
108
200
|
}
|
|
109
201
|
//# sourceMappingURL=npc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npc.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/models/npc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"npc.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/models/npc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAQ/D,MAAM,OAAO,GAAI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AM,WAAW,IAAI,YAAY,EAAE,CAAC;gBACvC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBAChE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,yBAAyB,WAAW,EAAE,CAAC,CAAC;gBACtE,IAAI,CAAC;oBACH,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBACxB,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,+BAA+B,WAAW,MAAM,GAAG,EAAE,CAAC,CAAC;gBACvF,CAAC;YACH,CAAC;QAEH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,GAAG,EAAE,CAAC,CAAC;YACvD,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;CAGF"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { PlayerEquipment } from '../types/
|
|
2
|
-
import {
|
|
1
|
+
import { PlayerEquipment } from '../types/player-equipment.js';
|
|
2
|
+
import { LifestyleChoices } from '../types/seed/lifestyle-seed.js';
|
|
3
3
|
import { Logger } from '../utilities/logger.js';
|
|
4
4
|
import { Room } from './room.js';
|
|
5
5
|
import { Item } from './item.js';
|
|
6
6
|
import { Inventory } from './inventory.js';
|
|
7
|
-
import { AbstractPlayer } from '../types/abstracts.js';
|
|
8
|
-
export
|
|
7
|
+
import { AbstractPlayer } from '../types/shared/abstracts.js';
|
|
8
|
+
export interface IPlayerConstructorConfig {
|
|
9
|
+
playerName: string;
|
|
10
|
+
startLocation: Room;
|
|
11
|
+
lifestyleChoices?: LifestyleChoices;
|
|
12
|
+
}
|
|
13
|
+
export declare class Player extends AbstractPlayer {
|
|
9
14
|
readonly _playerName: string;
|
|
10
15
|
protected _currentLocation: Room;
|
|
11
16
|
protected _inventory: Inventory;
|
|
@@ -32,6 +37,13 @@ export declare class Player extends AbstractPlayer implements IPlayer {
|
|
|
32
37
|
private canEquip;
|
|
33
38
|
private unequipBySlot;
|
|
34
39
|
hear(actor: Player, message: string): void;
|
|
40
|
+
see(actor: Player, verb: string, details?: string): void;
|
|
41
|
+
performAction(verb: string, details?: string): void;
|
|
42
|
+
readonly _onSeenAction: ({ actor, verb, details }: {
|
|
43
|
+
actor: Player;
|
|
44
|
+
verb: string;
|
|
45
|
+
details?: string;
|
|
46
|
+
}) => void;
|
|
35
47
|
enterRoom(room: Room): void;
|
|
36
48
|
leaveRoom(): void;
|
|
37
49
|
get lifestyleChoices(): LifestyleChoices;
|