@maka/maka-cli 5.1.30 → 5.1.32
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 +5 -5
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/drop.js +8 -5
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js +1 -1
- 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 +55 -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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/go.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/kill.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/kill.js +34 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/kill.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/lock.d.ts +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/lock.js +52 -18
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +4 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/read.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/read.js +26 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/read.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.d.ts +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/say.js +4 -2
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +15 -11
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/solve.js +1 -1
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/store.js +1 -1
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/talk.d.ts +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js +1 -1
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/unequip.js +1 -1
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js +35 -26
- 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 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/use.js +1 -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.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/npc-factory.js +4 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/npc-factory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js +14 -13
- package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +20 -4
- package/bundle/typescript/src/commands/game/sideQuest/game.js +255 -3
- package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/inventory.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/inventory.js +19 -6
- package/bundle/typescript/src/commands/game/sideQuest/models/inventory.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/item.d.ts +5 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js +50 -12
- package/bundle/typescript/src/commands/game/sideQuest/models/item.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.d.ts +10 -2
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +155 -23
- package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js +2 -2
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/room.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.d.ts +7 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +36 -3
- package/bundle/typescript/src/commands/game/sideQuest/models/scene.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene1.json +43 -9
- package/bundle/typescript/src/commands/game/sideQuest/scenes/scene2.json +241 -117
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/item-seed.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/types/seed/scene-seed.d.ts +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/ui.js +19 -216
- package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +6 -3
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,19 +2,23 @@ import { Command } from './command.js';
|
|
|
2
2
|
export class SearchCommand extends Command {
|
|
3
3
|
static verb = 'search';
|
|
4
4
|
static description = 'Search for items in your area';
|
|
5
|
-
execute() {
|
|
6
|
-
|
|
7
|
-
const roomItems =
|
|
8
|
-
|
|
5
|
+
async execute(args) {
|
|
6
|
+
const room = this.actor.currentLocation;
|
|
7
|
+
const roomItems = room.inventory.listItems();
|
|
8
|
+
let description = '';
|
|
9
9
|
if (roomItems.length === 0) {
|
|
10
|
-
|
|
11
|
-
return "You search the area thoroughly, but don't find anything of interest.";
|
|
10
|
+
description += "You search the area thoroughly, but don't find any items.";
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
else {
|
|
13
|
+
const itemsList = roomItems.join(', ');
|
|
14
|
+
this.logger.write(`SearchCommand: ${this.actor.name} found the following items: ${itemsList}`);
|
|
15
|
+
this.actor.performAction('search', itemsList);
|
|
16
|
+
description += `You search the area and find: ${itemsList}`;
|
|
17
|
+
}
|
|
18
|
+
if (room.puzzle && !room.puzzle.isSolved()) {
|
|
19
|
+
description += `\n\nPuzzle here: ${room.puzzle.riddle}`;
|
|
20
|
+
}
|
|
21
|
+
return description;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
//# sourceMappingURL=search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,aAAc,SAAQ,OAAO;IAC9B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,MAAM,CAAC,WAAW,GAAG,+BAA+B,CAAC;IAE/D,OAAO
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,aAAc,SAAQ,OAAO;IAC9B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,MAAM,CAAC,WAAW,GAAG,+BAA+B,CAAC;IAE/D,KAAK,CAAC,OAAO,CAAC,IAAc;QAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;QACxC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QAC7C,IAAI,WAAW,GAAG,EAAE,CAAC;QAErB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,WAAW,IAAI,2DAA2D,CAAC;QAC7E,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,IAAI,+BAA+B,SAAS,EAAE,CAAC,CAAC;YAC/F,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAC9C,WAAW,IAAI,iCAAiC,SAAS,EAAE,CAAC;QAC9D,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;YAC3C,WAAW,IAAI,oBAAoB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QAC1D,CAAC;QAED,OAAO,WAAW,CAAC;IACrB,CAAC"}
|
|
@@ -2,5 +2,5 @@ import { Command, ICommand } from './command.js';
|
|
|
2
2
|
export declare class SolveCommand extends Command implements ICommand {
|
|
3
3
|
protected static verb: string;
|
|
4
4
|
protected static description: string;
|
|
5
|
-
execute(args: string[]): string
|
|
5
|
+
execute(args: string[]): Promise<string>;
|
|
6
6
|
}
|
|
@@ -2,7 +2,7 @@ import { Command } from './command.js';
|
|
|
2
2
|
export class SolveCommand extends Command {
|
|
3
3
|
static verb = 'solve';
|
|
4
4
|
static description = 'Attempt to solve a puzzle.';
|
|
5
|
-
execute(args) {
|
|
5
|
+
async execute(args) {
|
|
6
6
|
const answer = args.join(' ').toLowerCase();
|
|
7
7
|
const room = this.actor.currentLocation;
|
|
8
8
|
if (!room || !room.puzzle) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solve.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/solve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,YAAa,SAAQ,OAAO;IAC7B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,MAAM,CAAC,WAAW,GAAG,4BAA4B,CAAC;IAE5D,OAAO,CAAC,IAAc;
|
|
1
|
+
{"version":3,"file":"solve.js","sourceRoot":"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AAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAClD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC"}
|
|
@@ -2,6 +2,6 @@ import { Command, ICommand } from './command.js';
|
|
|
2
2
|
export declare class StoreCommand extends Command implements ICommand {
|
|
3
3
|
protected static verb: string;
|
|
4
4
|
protected static description: string;
|
|
5
|
-
execute(args: string[]): string
|
|
5
|
+
execute(args: string[]): Promise<string>;
|
|
6
6
|
private store;
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import { Command } from './command.js';
|
|
|
2
2
|
export class StoreCommand extends Command {
|
|
3
3
|
static verb = 'store';
|
|
4
4
|
static description = 'Store an item from your inventory into your residence or bank.';
|
|
5
|
-
execute(args) {
|
|
5
|
+
async execute(args) {
|
|
6
6
|
this.logger.write(`${this.actor.name} is attempting 'Store' command with item: ${args.join(' ')}`);
|
|
7
7
|
return this.store(args);
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,YAAa,SAAQ,OAAO;IAC7B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,MAAM,CAAC,WAAW,GAAG,gEAAgE,CAAC;IAEhG,OAAO,CAAC,IAAc;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,YAAa,SAAQ,OAAO;IAC7B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,MAAM,CAAC,WAAW,GAAG,g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CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAC5C,OAAO,cAAc,QAAQ,GAAG,CAAC;QACnC,CAAC;aAAM,CAAC;YACN,OAAO,wCAAwC,QAAQ,GAAG,CAAC;QAC7D,CAAC;IAEH,CAAC"}
|
|
@@ -2,6 +2,6 @@ import { Command, ICommand } from './command.js';
|
|
|
2
2
|
export declare class TakeCommand extends Command implements ICommand {
|
|
3
3
|
protected static verb: string;
|
|
4
4
|
protected static description: string;
|
|
5
|
-
execute(args: string[]): string
|
|
5
|
+
execute(args: string[]): Promise<string>;
|
|
6
6
|
private take;
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import { Command } from './command.js';
|
|
|
2
2
|
export class TakeCommand extends Command {
|
|
3
3
|
static verb = 'take';
|
|
4
4
|
static description = 'Pick up an item.';
|
|
5
|
-
execute(args) {
|
|
5
|
+
async execute(args) {
|
|
6
6
|
this.logger.write(`Attempting 'Take' command with item: ${args.join(' ')}`);
|
|
7
7
|
return this.take(args);
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"take.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/take.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,WAAY,SAAQ,OAAO;IAC5B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;IACrB,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAElD,OAAO,CAAC,IAAc;
|
|
1
|
+
{"version":3,"file":"take.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/take.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,WAAY,SAAQ,OAAO;IAC5B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;IACrB,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAElD,KAAK,C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AU,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,QAAQ,UAAU,IAAI,CAAC,IAAI,0CAA0C,CAAC,CAAC;YAElH,OAAO,sBAAsB,QAAQ,GAAG,CAAC;QAE3C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACnE,OAAO,aAAa,QAAQ,0BAA0B,CAAC;QACzD,CAAC;IACH,CAAC"}
|
|
@@ -21,7 +21,7 @@ export class TalkCommand extends Command {
|
|
|
21
21
|
super(context);
|
|
22
22
|
this.context = context;
|
|
23
23
|
}
|
|
24
|
-
execute(args) {
|
|
24
|
+
async execute(args) {
|
|
25
25
|
const parsedArgs = parseArgsWithQuotes(args.join(' '));
|
|
26
26
|
if (parsedArgs.length < 2) {
|
|
27
27
|
return "Usage: talk-to <name> <message>";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"talk.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/talk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAG5D,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,MAAM,KAAK,GAAG,kBAAkB,CAAC;IACjC,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,KAAK,CAAC;IACV,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC5C,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;I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AAO,EAAE,CAAC,CAAC;QAE/C,OAAO,eAAe,MAAM,CAAC,IAAI,gBAAgB,OAAO,GAAG,CAAC;IAC9D,CAAC"}
|
|
@@ -2,5 +2,5 @@ import { Command, ICommand } from './command.js';
|
|
|
2
2
|
export declare class UnequipCommand extends Command implements ICommand {
|
|
3
3
|
protected static verb: string;
|
|
4
4
|
protected static description: string;
|
|
5
|
-
execute(args: string[]): string
|
|
5
|
+
execute(args: string[]): Promise<string>;
|
|
6
6
|
}
|
|
@@ -2,7 +2,7 @@ import { Command } from './command.js';
|
|
|
2
2
|
export class UnequipCommand extends Command {
|
|
3
3
|
static verb = 'unqeuip';
|
|
4
4
|
static description = 'Unequip an item.';
|
|
5
|
-
execute(args) {
|
|
5
|
+
async execute(args) {
|
|
6
6
|
const slotName = args.join(' ').toLowerCase();
|
|
7
7
|
const response = this.actor.unequip(slotName);
|
|
8
8
|
this.logger.write(`UnequipCommand: ${this.actor.name} unqeuiped ${response}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unequip.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/unequip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,cAAe,SAAQ,OAAO;IAC/B,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAElD,OAAO,CAAC,IAAc;
|
|
1
|
+
{"version":3,"file":"unequip.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/unequip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,cAAe,SAAQ,OAAO;IAC/B,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAElD,KAAK,CAAC,OAAO,CAAC,IAAc;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,KAAK,CAAC,IAAI,cAAc,QAAQ,EAAE,CAAC,CAAC;QAC9E,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAE9C,OAAO,QAAQ,CAAC;IAClB,CAAC"}
|
|
@@ -2,6 +2,6 @@ import { Command, ICommand } from './command.js';
|
|
|
2
2
|
export declare class UnlockCommand extends Command implements ICommand {
|
|
3
3
|
protected static verb: string;
|
|
4
4
|
protected static description: string;
|
|
5
|
-
execute(args: string[]): string
|
|
5
|
+
execute(args: string[]): Promise<string>;
|
|
6
6
|
private unlock;
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ import { Command } from './command.js';
|
|
|
3
3
|
export class UnlockCommand extends Command {
|
|
4
4
|
static verb = 'unlock';
|
|
5
5
|
static description = 'Unlock a door.';
|
|
6
|
-
execute(args) {
|
|
6
|
+
async execute(args) {
|
|
7
7
|
return this.unlock(args);
|
|
8
8
|
}
|
|
9
9
|
unlock(args) {
|
|
@@ -11,34 +11,43 @@ export class UnlockCommand extends Command {
|
|
|
11
11
|
this.logger.error('UnlockCommand: No target specified.');
|
|
12
12
|
return 'Please specify which door you want to unlock.';
|
|
13
13
|
}
|
|
14
|
-
const target = args
|
|
14
|
+
const target = args.join(' ').toLowerCase(); // Support multi-word room names
|
|
15
15
|
const room = this.actor.currentLocation;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this.logger.write(`UnlockCommand: ${target} is not a valid exit in ${room.name}.`);
|
|
35
|
-
return `There's no door named "${target}" here.`;
|
|
36
|
-
}
|
|
16
|
+
// Try finding the door by direction
|
|
17
|
+
let doorEntry = [...room.exits.entries()].find(([direction, door]) => direction.toLowerCase() === target);
|
|
18
|
+
// If not found by direction, try matching by target room name
|
|
19
|
+
if (!doorEntry) {
|
|
20
|
+
doorEntry = [...room.exits.entries()].find(([_, d]) => {
|
|
21
|
+
if (!(d instanceof Door))
|
|
22
|
+
return false;
|
|
23
|
+
const otherRoomName = d.roomA.name.toLowerCase() === room.name.toLowerCase()
|
|
24
|
+
? d.roomB.name.toLowerCase()
|
|
25
|
+
: d.roomA.name.toLowerCase();
|
|
26
|
+
return otherRoomName === target;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (!doorEntry) {
|
|
30
|
+
this.logger.write(`UnlockCommand: No door found for target "${target}" in ${room.name}.`);
|
|
31
|
+
return `There's no door named or leading to "${target}" here.`;
|
|
37
32
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
const [direction, door] = doorEntry;
|
|
34
|
+
if (!(door instanceof Door)) {
|
|
35
|
+
this.logger.write(`UnlockCommand: Exit found but is not a door: "${target}"`);
|
|
36
|
+
return `There's no door named or leading to "${target}" here.`;
|
|
37
|
+
}
|
|
38
|
+
const requiredKeyOrSolution = door.unlockItemOrSolution?.toLowerCase();
|
|
39
|
+
if (requiredKeyOrSolution && this.actor.inventory.hasItem(requiredKeyOrSolution)) {
|
|
40
|
+
const key = this.actor.inventory.getItem(requiredKeyOrSolution);
|
|
41
|
+
if (key) {
|
|
42
|
+
const unlockMessage = room.attemptUnlockExit(direction, key.name);
|
|
43
|
+
this.logger.write(`UnlockCommand: ${this.actor.name} attempted to unlock ${direction}. Result: ${unlockMessage}`);
|
|
44
|
+
this.actor.performAction('unlocked', unlockMessage);
|
|
45
|
+
this.scene.updateExits(room);
|
|
46
|
+
return unlockMessage;
|
|
47
|
+
}
|
|
41
48
|
}
|
|
49
|
+
this.logger.write(`UnlockCommand: ${this.actor.name} does not have the required key (${requiredKeyOrSolution}) for "${target}".`);
|
|
50
|
+
return `You don't have the key or solution to unlock this door.`;
|
|
42
51
|
}
|
|
43
52
|
}
|
|
44
53
|
//# sourceMappingURL=unlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unlock.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/unlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,aAAc,SAAQ,OAAO;IAC9B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,MAAM,CAAC,WAAW,GAAG,gBAAgB,CAAC;IAEhD,OAAO,CAAC,IAAc;
|
|
1
|
+
{"version":3,"file":"unlock.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/unlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,aAAc,SAAQ,OAAO;IAC9B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,MAAM,CAAC,WAAW,GAAG,gBAAgB,CAAC;IAEhD,KAAK,CAAC,OAAO,CAAC,IAAc;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAEO,MAAM,CAAC,IAAc;QAC3B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;YACzD,O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,SAAS,CAAC;QAEpC,IAAI,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iDAAiD,MAAM,GAAG,CAAC,CAAC;YAC9E,OAAO,wCAAwC,MAAM,SAAS,CAAC;QACjE,CAAC;QAED,MAAM,qBAAqB,GAAG,IAAI,CAAC,oBAAoB,EAAE,WAAW,EAAE,CAAC;QAEvE,IAAI,qBAAqB,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,CAAC;YACjF,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;YAEhE,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;gBAClE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,IAAI,wBAAwB,SAAS,aAAa,aAAa,EAAE,CAAC,CAAC;gBAClH,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;gBACpD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC7B,OAAO,aAAa,CAAC;YACvB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,IAAI,oCAAoC,qBAAqB,UAAU,MAAM,IAAI,CAAC,CAAC;QAClI,OAAO,yDAAyD,CAAC;IACnE,CAAC"}
|
|
@@ -2,6 +2,6 @@ import { Command, ICommand } from './command.js';
|
|
|
2
2
|
export declare class UseCommand extends Command implements ICommand {
|
|
3
3
|
protected static verb: string;
|
|
4
4
|
protected static description: string;
|
|
5
|
-
execute(args: string[]): string
|
|
5
|
+
execute(args: string[]): Promise<string>;
|
|
6
6
|
private use;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,UAAW,SAAQ,OAAO;IAC3B,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,MAAM,CAAC,WAAW,GAAG,cAAc,CAAC;IAE9C,OAAO,CAAC,IAAc;
|
|
1
|
+
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,UAAW,SAAQ,OAAO;IAC3B,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,MAAM,CAAC,WAAW,GAAG,cAAc,CAAC;IAE9C,KAAK,CAAC,OAAO,CAAC,IAAc;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAEO,GAAG,CAAC,IAAc;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAE9C,qDAAqD;QACrD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,KAAK,CAAC,IAAI,qBAAqB,QAAQ,oCAAoC,CAAC,CAAC;YACnH,OAAO,sBAAsB,QAAQ,UAAU,CAAC;QAClD,CAAC;QAED,uCAAuC;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEzD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,QAAQ,uBAAuB,IAAI,CAAC,KAAK,CAAC,IAAI,eAAe,CAAC,CAAC;YAChG,OAAO,sBAAsB,QAAQ,UAAU,CAAC;QAClD,CAAC;QAED,oFAAoF;QACpF,IAAI,OAAO,SAAS,CAAC,GAAG,KAAK,UAAU,EAAE,CAAC;YACxC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,KAAK,CAAC,IAAI,SAAS,QAAQ,GAAG,CAAC,CAAC;YACtE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YACxC,OAAO,MAAM,CAAC;QAChB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,QAAQ,6BAA6B,CAAC,CAAC;YACxE,OAAO,qBAAqB,QAAQ,eAAe,CAAC;QACtD,CAAC;IACH,CAAC"}
|
|
@@ -13,7 +13,8 @@ export class ItemFactory {
|
|
|
13
13
|
rating: Rating[json.rating],
|
|
14
14
|
weight: json.weight,
|
|
15
15
|
details: json.details,
|
|
16
|
-
satisfiesLifestyle: json.satisfiesLifestyle
|
|
16
|
+
satisfiesLifestyle: json.satisfiesLifestyle,
|
|
17
|
+
transferable: json.transferable
|
|
17
18
|
});
|
|
18
19
|
if (json.currencyAmount && item.isCurrencyCarrier()) {
|
|
19
20
|
item.addCurrency(json.currencyAmount);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-factory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/factories/item-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtE,MAAM,OAAO,WAAW;IACtB,KAAK,CAAC,kBAAkB,CAAC,IAAmB;QAC1C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC;YACpB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACrB,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"item-factory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/factories/item-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtE,MAAM,OAAO,WAAW;IACtB,KAAK,CAAC,kBAAkB,CAAC,IAAmB;QAC1C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC;YACpB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACrB,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC,CAAC;QAEH,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;YACpD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -3,6 +3,7 @@ import { Scene } from '../models/scene.js';
|
|
|
3
3
|
import { INPCSeedJson } from '../types/seed/npc-seed.js';
|
|
4
4
|
export declare class NPCFactory {
|
|
5
5
|
private scene;
|
|
6
|
+
private commandRegistry;
|
|
6
7
|
constructor(scene: Scene);
|
|
7
8
|
createNPCFromJson(json: INPCSeedJson): Promise<NPC>;
|
|
8
9
|
private convertPlayerSeedToConstructorConfig;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { NPC } from '../models/npc.js';
|
|
2
|
+
import { CommandRegistry } from '../commands/command-registry.js';
|
|
2
3
|
export class NPCFactory {
|
|
3
4
|
scene;
|
|
5
|
+
commandRegistry;
|
|
4
6
|
constructor(scene) {
|
|
5
7
|
this.scene = scene;
|
|
6
8
|
}
|
|
@@ -9,11 +11,12 @@ export class NPCFactory {
|
|
|
9
11
|
throw new Error(`NPC missing name in player: ${JSON.stringify(json)}`);
|
|
10
12
|
}
|
|
11
13
|
const playerConstructorConfig = this.convertPlayerSeedToConstructorConfig(json.player);
|
|
14
|
+
this.commandRegistry = new CommandRegistry(this.scene);
|
|
12
15
|
return new NPC({
|
|
13
16
|
dialog: json.dialogue ?? ["..."],
|
|
14
17
|
description: json.description ?? "Not interesting",
|
|
15
18
|
playerConstructorConfig
|
|
16
|
-
});
|
|
19
|
+
}, this.commandRegistry);
|
|
17
20
|
}
|
|
18
21
|
convertPlayerSeedToConstructorConfig(seed) {
|
|
19
22
|
if (!seed.name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npc-factory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/factories/npc-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"npc-factory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/factories/npc-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAIvC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,OAAO,UAAU;IACb,KAAK,CAAQ;IACb,eAAe,CAAkB;IAEzC,YAAY,KAAY;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,IAAkB;QACxC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;QACD,MAAM,uBAAuB,GAAG,IAAI,CAAC,oCAAoC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvF,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEvD,OAAO,IAAI,GAAG,CAAC;YACb,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC;YAChC,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,iBAAiB;YAClD,uBAAuB;SACxB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAC3B,CAAC;IAEO,oCAAoC,CAAC,IAA4B;QACvE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC7D,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,IAAI;YACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,aAAa;SACd,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -15,7 +15,8 @@ export class SceneSynthesizer {
|
|
|
15
15
|
type: json.currency.type,
|
|
16
16
|
authorityRoomTags: json.currency.authorityRoomTags
|
|
17
17
|
},
|
|
18
|
-
residenceTiers: json.residenceTiers
|
|
18
|
+
residenceTiers: json.residenceTiers,
|
|
19
|
+
story: json.story,
|
|
19
20
|
});
|
|
20
21
|
// Step 2: Create and Register Rooms using RoomFactory
|
|
21
22
|
logger.write(`Creating Rooms`);
|
|
@@ -66,9 +67,8 @@ export class SceneSynthesizer {
|
|
|
66
67
|
}
|
|
67
68
|
else if (itemJson.room) {
|
|
68
69
|
scene.addItemToRoom(item, itemJson.room);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
throw new Error(`Item "${itemJson.name}" must have either 'room' or 'heldBy'.`);
|
|
70
|
+
// } else {
|
|
71
|
+
// throw new Error(`Item "${itemJson.name}" must have either 'room' or 'heldBy'.`);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
// Step 5: Add Puzzles
|
|
@@ -78,15 +78,16 @@ export class SceneSynthesizer {
|
|
|
78
78
|
scene.addPuzzleToRoom(puzzle, puzzleJson.room);
|
|
79
79
|
}
|
|
80
80
|
// Step 6: Sync AI descriptions for all rooms
|
|
81
|
-
const sceneContext = `
|
|
82
|
-
Scene: ${scene.name}
|
|
83
|
-
Currency: ${json.currency.type}
|
|
84
|
-
Residence Tiers: ${json.residenceTiers.join(', ')}
|
|
85
|
-
Key Locations: ${json.rooms.map(r => r.name).join(', ')}
|
|
86
|
-
`;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
// const sceneContext = `
|
|
82
|
+
// Scene: ${scene.name}
|
|
83
|
+
// Currency: ${json.currency.type}
|
|
84
|
+
// Residence Tiers: ${json.residenceTiers.join(', ')}
|
|
85
|
+
// Key Locations: ${json.rooms.map(r => r.name).join(', ')}
|
|
86
|
+
// `;
|
|
87
|
+
//
|
|
88
|
+
// for (const room of Object.values(scene.getRooms())) {
|
|
89
|
+
// await room.ensureAIDescription(sceneContext);
|
|
90
|
+
// }
|
|
90
91
|
// Step 7: Assign ownership to rooms and items
|
|
91
92
|
logger.write(`Assigning Ownership`);
|
|
92
93
|
for (const roomJson of json.rooms) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-factory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/factories/scene-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,MAAM,OAAO,gBAAgB;IAC3B,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAoB,EAAE,MAAc,EAAE,KAAc;QAClF,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAEpC,+DAA+D;QAC/D,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC;YACtB,MAAM;YACN,QAAQ,EAAE;gBACR,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI;gBACxB,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB;aACnD;YACD,cAAc,EAAE,IAAI,CAAC,cAAc;
|
|
1
|
+
{"version":3,"file":"scene-factory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/factories/scene-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,MAAM,OAAO,gBAAgB;IAC3B,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAoB,EAAE,MAAc,EAAE,KAAc;QAClF,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAEpC,+DAA+D;QAC/D,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC;YACtB,MAAM;YACN,QAAQ,EAAE;gBACR,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI;gBACxB,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB;aACnD;YACD,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;QAGH,sDAAsD;QACtD,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC/B,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QACtC,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6B,CAAC,CAAC;gBAC1F,CAAC;gBACD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;gBAC5B,MAAM,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,mBAAmB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;YACnE,CAAC;QACH,CAAC;QAGD,+BAA+B;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import blessed from 'blessed';
|
|
2
2
|
import { ISceneSeedJson } from './types/seed/scene-seed.js';
|
|
3
|
-
import { Room } from './models/
|
|
4
|
-
import { Player } from './models/player.js';
|
|
5
|
-
import { Scene } from './models/scene.js';
|
|
3
|
+
import { Player, Inventory, Room, Scene } from './models/_index.js';
|
|
6
4
|
import { IMainGameConfig } from './ui.js';
|
|
5
|
+
import { PlayerEquipment } from './types/player-equipment.js';
|
|
7
6
|
export default class Game {
|
|
8
7
|
private static instance;
|
|
9
8
|
private sceneSeed;
|
|
@@ -11,11 +10,28 @@ export default class Game {
|
|
|
11
10
|
player: Player;
|
|
12
11
|
currentRoom: Room;
|
|
13
12
|
rooms: Room[];
|
|
13
|
+
private _screen;
|
|
14
|
+
private _exitsBox;
|
|
15
|
+
private _inventoryBox;
|
|
16
|
+
private _logBox;
|
|
17
|
+
private _inputBox;
|
|
18
|
+
private _equipmentBox;
|
|
14
19
|
constructor(player: Player, sceneSeed: ISceneSeedJson);
|
|
15
20
|
private registerCommands;
|
|
16
21
|
private determineStartRoom;
|
|
22
|
+
get logBox(): blessed.Widgets.BoxElement;
|
|
23
|
+
get inputBox(): blessed.Widgets.TextboxElement;
|
|
17
24
|
init(options: IMainGameConfig, screen: blessed.Widgets.Screen): Promise<string>;
|
|
25
|
+
close(): Promise<void>;
|
|
26
|
+
private initMap;
|
|
27
|
+
private initInputBox;
|
|
28
|
+
private initLogBox;
|
|
29
|
+
private initEquipmentBox;
|
|
30
|
+
private initInventoryBox;
|
|
31
|
+
updateEquipment(playerEquipment: PlayerEquipment): void;
|
|
32
|
+
updateExits(room: Room): void;
|
|
33
|
+
updateInventory(playerInventory: Inventory, currencyName?: string): void;
|
|
18
34
|
static getInstance(player: Player, sceneSeed: ISceneSeedJson): Promise<Game>;
|
|
19
|
-
handleInput(input: string): string | null
|
|
35
|
+
handleInput(input: string): Promise<string | null>;
|
|
20
36
|
private getHelpMessage;
|
|
21
37
|
}
|