@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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from './command.js';
|
|
2
|
+
import { Player } from '../models/player.js';
|
|
3
|
+
import { NPC } from '../models/npc.js';
|
|
4
|
+
import { Scene } from '../models/scene.js';
|
|
5
|
+
export declare class CommandRegistry {
|
|
6
|
+
private scene;
|
|
7
|
+
constructor(scene: Scene);
|
|
8
|
+
parse(commandString: string, actor: Player | NPC): Command | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/commands/command-registry.ts
|
|
2
|
+
import { CommandFactory } from '../factories/command-factory.js';
|
|
3
|
+
export class CommandRegistry {
|
|
4
|
+
scene;
|
|
5
|
+
constructor(scene) {
|
|
6
|
+
this.scene = scene;
|
|
7
|
+
}
|
|
8
|
+
parse(commandString, actor) {
|
|
9
|
+
const parts = commandString.trim().split(' ');
|
|
10
|
+
const verb = parts[0].toLowerCase();
|
|
11
|
+
const args = parts.slice(1);
|
|
12
|
+
const context = {
|
|
13
|
+
actor,
|
|
14
|
+
rooms: this.scene.getRooms(),
|
|
15
|
+
scene: this.scene,
|
|
16
|
+
args, // optional, not all commands use this at construction time
|
|
17
|
+
};
|
|
18
|
+
const command = CommandFactory.createCommand(verb, context);
|
|
19
|
+
if (!command)
|
|
20
|
+
return null;
|
|
21
|
+
// Wrap the command with the args pre-bound (if needed)
|
|
22
|
+
command.execute(args); // only if you have such a method
|
|
23
|
+
return command;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=command-registry.js.map
|
|
@@ -0,0 +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,aAAqB,EAAE,KAAmB;QAC9C,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,uDAAuD;QACvD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,iCAAiC;QAExD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { Direction } from '../types/
|
|
2
|
-
import { Player, Scene } from '../models/_index.js';
|
|
3
|
-
import { IRooms } from '../types/interfaces.js';
|
|
1
|
+
import { Direction } from '../types/shared/direction-enum.js';
|
|
2
|
+
import { Player, Scene, Room, NPC } from '../models/_index.js';
|
|
4
3
|
import { Logger } from '../utilities/logger.js';
|
|
5
|
-
|
|
4
|
+
export interface ICommand {
|
|
5
|
+
execute(args: string[]): string;
|
|
6
|
+
}
|
|
7
|
+
export interface ICommandConstructor {
|
|
8
|
+
actor: Player | NPC;
|
|
9
|
+
scene: Scene;
|
|
10
|
+
rooms?: Record<string, Room>;
|
|
11
|
+
}
|
|
6
12
|
export declare abstract class Command {
|
|
7
13
|
protected static verb: string;
|
|
8
14
|
protected static description: string;
|
|
9
|
-
protected actor: Player;
|
|
10
|
-
protected rooms?:
|
|
15
|
+
protected actor: Player | NPC;
|
|
16
|
+
protected rooms?: Record<string, Room>;
|
|
11
17
|
protected logger: Logger;
|
|
12
18
|
protected scene: Scene;
|
|
13
|
-
constructor(context:
|
|
19
|
+
constructor(context: ICommandConstructor);
|
|
14
20
|
abstract execute(args?: string[]): string;
|
|
15
21
|
protected isValidDirection(value: string): value is Direction;
|
|
16
22
|
static getDescription(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAYhD,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;IAEvB,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;IAC7B,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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class DropCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -22,7 +22,8 @@ export class DropCommand extends Command {
|
|
|
22
22
|
// Remove the item from player's inventory and add it to the current room's inventory
|
|
23
23
|
this.actor.inventory.removeItem(itemName);
|
|
24
24
|
this.actor.currentLocation.inventory.addItem(itemToDrop);
|
|
25
|
-
this.logger.write(`${this.actor.name} has successfully dropped "${itemName}" from inventory to
|
|
25
|
+
this.logger.write(`${this.actor.name} has successfully dropped "${itemName}" from inventory to ${this.actor.currentLocation.name} during 'Drop' command.`);
|
|
26
|
+
this.actor.performAction('drop', itemName);
|
|
26
27
|
return `You dropped ${itemName}.`;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/drop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"drop.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/drop.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,mCAAmC,CAAC;IAEnE,OAAO,CAAC,IAAc;QACpB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,4CAA4C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClG,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEO,IAAI,CAAC,IAAc;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAE,4CAA4C;QAE5F,qDAAqD;QACrD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,QAAQ,kBAAkB,IAAI,CAAC,KAAK,CAAC,IAAI,qCAAqC,CAAC,CAAC;YAC3G,OAAO,kBAAkB,QAAQ,qBAAqB,CAAC;QACzD,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAE1D,oDAAoD;QACpD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,QAAQ,wBAAwB,IAAI,CAAC,KAAK,CAAC,IAAI,qCAAqC,CAAC,CAAC;YACjH,OAAO,kBAAkB,QAAQ,qBAAqB,CAAC;QACzD,CAAC;QAED,qFAAqF;QACrF,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,8BAA8B,QAAQ,uBAAuB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,yBAAyB,CAAC,CAAC;QAE3J,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC3C,OAAO,eAAe,QAAQ,GAAG,CAAC;IACpC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class EquipCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -25,6 +25,7 @@ export class EquipCommand extends Command {
|
|
|
25
25
|
return `You don't have ${itemName} in your inventory, and it's not in this room.`;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
this.actor.performAction('equip', itemToEquip.name);
|
|
28
29
|
const equipResponse = this.actor.equip(itemToEquip);
|
|
29
30
|
this.logger.write(`EquipCommand: ${equipResponse}`);
|
|
30
31
|
return equipResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equip.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/equip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"equip.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/equip.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,gBAAgB,CAAC;IAEhD,OAAO,CAAC,IAAc;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAEO,KAAK,CAAC,IAAc;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAE9C,qGAAqG;QACrG,IAAI,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEzD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;YAExC,mGAAmG;YACnG,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAE/C,IAAI,WAAW,EAAE,CAAC;gBAChB,8FAA8F;gBAC9F,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;gBAE1C,oGAAoG;gBACpG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;gBAEpC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,QAAQ,iCAAiC,IAAI,CAAC,KAAK,CAAC,IAAI,eAAe,CAAC,CAAC;YAC9G,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,QAAQ,iBAAiB,IAAI,CAAC,KAAK,CAAC,IAAI,iBAAiB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,QAAQ,CAAC,CAAC;gBACrI,OAAO,kBAAkB,QAAQ,gDAAgD,CAAC;YACpF,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,aAAa,EAAE,CAAC,CAAC;QAEpD,OAAO,aAAa,CAAC;IACvB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Command } from './command.js';
|
|
2
|
+
export class GiveCommand extends Command {
|
|
3
|
+
static verb = 'give';
|
|
4
|
+
static description = 'Give an item or money to someone.';
|
|
5
|
+
execute(args) {
|
|
6
|
+
this.logger.write(`Attempting 'Give' command with input: ${args.join(' ')}`);
|
|
7
|
+
return this.give(args);
|
|
8
|
+
}
|
|
9
|
+
give(args) {
|
|
10
|
+
const argString = args.join(' ');
|
|
11
|
+
const match = argString.match(/^(.+?) to (.+)$/i);
|
|
12
|
+
if (!match) {
|
|
13
|
+
this.logger.write(`Invalid syntax for 'Give' command: ${argString}`);
|
|
14
|
+
return `Usage: give <item|amount> to <actor>`;
|
|
15
|
+
}
|
|
16
|
+
const [, itemOrAmount, recipientName] = match;
|
|
17
|
+
const room = this.actor.currentLocation;
|
|
18
|
+
const recipient = room.getActors().find(a => a.name.toLowerCase() === recipientName.toLowerCase());
|
|
19
|
+
if (!recipient) {
|
|
20
|
+
this.logger.write(`Recipient "${recipientName}" not found in room ${room.name}`);
|
|
21
|
+
return `You don’t see anyone named "${recipientName}" here.`;
|
|
22
|
+
}
|
|
23
|
+
// === Try to give currency ===
|
|
24
|
+
const currencyMatch = itemOrAmount.match(/^(\d+)\s*(nuyen|¥)?$/i);
|
|
25
|
+
if (currencyMatch) {
|
|
26
|
+
const amount = parseInt(currencyMatch[1], 10);
|
|
27
|
+
const currencyType = this.scene.currency?.type || 'currency';
|
|
28
|
+
if (this.actor.currency < amount) {
|
|
29
|
+
this.logger.write(`${this.actor.name} tried to give ${amount} ${currencyType} but lacks funds.`);
|
|
30
|
+
return `You don’t have ${amount} ${currencyType}.`;
|
|
31
|
+
}
|
|
32
|
+
this.actor.adjustCurrency(-amount);
|
|
33
|
+
recipient.adjustCurrency(amount);
|
|
34
|
+
this.actor.performAction('give', `${amount} ${currencyType} to ${recipient.name}`);
|
|
35
|
+
this.logger.write(`${this.actor.name} gave ${amount} ${currencyType} to ${recipient.name}`);
|
|
36
|
+
return `You gave ${amount} ${currencyType} to ${recipient.name}.`;
|
|
37
|
+
}
|
|
38
|
+
// === Try to give an item ===
|
|
39
|
+
const item = this.actor.inventory.getItem(itemOrAmount);
|
|
40
|
+
if (!item) {
|
|
41
|
+
this.logger.write(`${this.actor.name} tried to give item "${itemOrAmount}" but does not have it.`);
|
|
42
|
+
return `You don’t have "${itemOrAmount}".`;
|
|
43
|
+
}
|
|
44
|
+
this.actor.removeInventory(item);
|
|
45
|
+
recipient.addInventory(item);
|
|
46
|
+
this.actor.performAction('give', `${item.name} to ${recipient.name}`);
|
|
47
|
+
this.logger.write(`${this.actor.name} gave item "${item.name}" to ${recipient.name}`);
|
|
48
|
+
return `You gave ${item.name} to ${recipient.name}.`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=give.js.map
|
|
@@ -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AAI,CAAC,KAAK,CAAC,IAAI,wBAAwB,YAAY,yBAAyB,CAAC,CAAC;YACnG,OAAO,mBAAmB,YAAY,IAAI,CAAC;QAC7C,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACjC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAE7B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,eAAe,IAAI,CAAC,IAAI,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;QAEtF,OAAO,YAAY,IAAI,CAAC,IAAI,OAAO,SAAS,CAAC,IAAI,GAAG,CAAC;IACvD,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class GoCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -30,6 +30,7 @@ export class GoCommand extends Command {
|
|
|
30
30
|
// If it's a Door, determine the target room
|
|
31
31
|
if (exit instanceof Door) {
|
|
32
32
|
if (exit.checkIfLocked()) {
|
|
33
|
+
this.actor.performAction('is prevented by locked door', currentRoom.name);
|
|
33
34
|
return `The door in the direction "${direction}" is locked.`;
|
|
34
35
|
}
|
|
35
36
|
// Get the other side of the door (the room the player should move to)
|
|
@@ -39,6 +40,7 @@ export class GoCommand extends Command {
|
|
|
39
40
|
return 'There seems to be an error with the door you\'re trying to go through.';
|
|
40
41
|
}
|
|
41
42
|
this.actor.currentLocation = targetRoom; // Update player's location
|
|
43
|
+
this.actor.performAction('enters', targetRoom.name);
|
|
42
44
|
}
|
|
43
45
|
else {
|
|
44
46
|
// If it's a room name (string)
|
|
@@ -48,6 +50,7 @@ export class GoCommand extends Command {
|
|
|
48
50
|
return 'There seems to be an error with the room you\'re trying to go to.';
|
|
49
51
|
}
|
|
50
52
|
this.actor.currentLocation = nextRoom;
|
|
53
|
+
this.actor.performAction('enters', nextRoom.name);
|
|
51
54
|
}
|
|
52
55
|
this.logger.write(`${this.actor.name} moved to room: ${this.actor.currentLocation.name || 'Unnamed room'}.`);
|
|
53
56
|
// Use the LookCommand to get the description of the new room
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"go.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/go.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"go.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/go.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,SAAU,SAAQ,OAAO;IAC1B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,WAAW,GAAG,kCAAkC,CAAC;IAElE,OAAO,CAAC,IAAc;QACpB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,+CAA+C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrG,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAEO,EAAE,CAAC,IAAc;QACvB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,iD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K,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,uEAAuE,CAAC,CAAC;gBAC7G,OAAO,wEAAwE,CAAC;YAClF,CAAC;YAED,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,UAAU,CAAC,CAAE,2BAA2B;YACrE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;aAAM,CAAC;YACN,+BAA+B;YAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAE,+BAA+B;YACjF,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,+BAA+B,IAAI,cAAc,CAAC,CAAC;gBACvF,OAAO,mEAAmE,CAAC;YAC7E,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;YACtC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,mBAAmB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,IAAI,cAAc,GAAG,CAAC,CAAC;QAE7G,6DAA6D;QAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC;IAChD,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class LockCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -21,6 +21,7 @@ export class LockCommand extends Command {
|
|
|
21
21
|
if (requiredKeyOrSolution && this.actor.inventory.hasItem(requiredKeyOrSolution)) {
|
|
22
22
|
door.isLocked = true;
|
|
23
23
|
this.logger.write(`LockCommand: ${this.actor.name} Locked the ${target} door.`);
|
|
24
|
+
this.actor.performAction('lock', target);
|
|
24
25
|
return `You locked the door named "${target}".`;
|
|
25
26
|
}
|
|
26
27
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/lock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/lock.ts"],"names":[],"mappings":"AAEA,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,cAAc,CAAC;IAE9C,OAAO,CAAC,IAAc;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEO,IAAI,CAAC,IAAc;QACzB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;YACvD,OAAO,6CAA6C,CAAC;QACvD,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;QAExC,IAAI,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5D,MAAM,IAAI,GAAS,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAS,CAAC;YAElD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,OAAO,mBAAmB,MAAM,sBAAsB,CAAC;YACzD,CAAC;YAED,MAAM,qBAAqB,GAAG,IAAI,CAAC,oBAAoB,EAAE,WAAW,EAAE,CAAC;YAEvE,IAAI,qBAAqB,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,CAAC;gBACjF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;gBACrB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,IAAI,CAAC,KAAK,CAAC,IAAI,eAAe,MAAM,QAAQ,CAAC,CAAC;gBAChF,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBACzC,OAAO,8BAA8B,MAAM,IAAI,CAAC;YAClD,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,IAAI,CAAC,KAAK,CAAC,IAAI,wCAAwC,MAAM,GAAG,CAAC,CAAC;gBACpG,OAAO,2CAA2C,CAAC;YACrD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,MAAM,oCAAoC,CAAC,CAAC;YAC9E,OAAO,0BAA0B,MAAM,SAAS,CAAC;QACnD,CAAC;IACH,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class LookCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -25,6 +25,7 @@ export class LookCommand extends Command {
|
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
27
|
this.logger.write(`${this.actor.name} is looking around the current room.`);
|
|
28
|
+
this.actor.performAction('looks', `around ${this.actor.currentLocation.name}`);
|
|
28
29
|
return this.look();
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -34,7 +35,7 @@ export class LookCommand extends Command {
|
|
|
34
35
|
this.logger.error(`${this.actor.name} is not in a valid room during 'Look' command execution.`);
|
|
35
36
|
return "You're not in a valid room.";
|
|
36
37
|
}
|
|
37
|
-
let description = room.description;
|
|
38
|
+
let description = (room.details) ? room.details : room.description;
|
|
38
39
|
const otherActors = this.scene
|
|
39
40
|
.getActorsInRoom(room)
|
|
40
41
|
.filter(a => a !== this.actor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"look.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/look.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAIzC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"look.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/look.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAIzC,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,2BAA2B,CAAC;IAE3D,OAAO,CAAC,OAAiB,EAAE;QACzB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAE/C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE9B,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBACzC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,MAAM,QAAQ,IAAI,CAAC,KAAK,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,IAAI,YAAY,IAAI,EAAE,CAAC;YACzB,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;aAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACpC,YAAY,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC9C,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,OAAO,oDAAoD,SAAS,IAAI,CAAC;YAC3E,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,yEAAyE,SAAS,IAAI,CAAC;QAChG,CAAC;QAGD,OAAO,wBAAwB,CAAC;IAClC,CAAC;IAEO,WAAW,CAAC,QAAgB,EAAE,SAAoB;QACxD,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEzC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,qBAAqB,QAAQ,QAAQ,CAAC;QAC/C,CAAC;QAED,qGAAqG;QACrG,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,IAAI,uBAAuB,QAAQ,GAAG,CAAC;IAChF,CAAC"}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommandContext } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommandConstructor } from './command.js';
|
|
3
2
|
export declare class SayCommand extends Command {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
6
|
-
protected context:
|
|
7
|
-
constructor(context:
|
|
8
|
-
execute(args: string[]): string;
|
|
9
|
-
}
|
|
10
|
-
export declare class SayToCommand extends Command {
|
|
11
|
-
protected static verb: string;
|
|
12
|
-
protected static description: string;
|
|
13
|
-
protected context: ICommandContext;
|
|
14
|
-
constructor(context: ICommandContext);
|
|
5
|
+
protected context: ICommandConstructor;
|
|
6
|
+
constructor(context: ICommandConstructor);
|
|
15
7
|
execute(args: string[]): string;
|
|
16
8
|
}
|
|
@@ -21,38 +21,13 @@ export class SayCommand extends Command {
|
|
|
21
21
|
}
|
|
22
22
|
const roomActors = scene.allActors.filter(actor => actor.currentLocation === currentPlayer.currentLocation);
|
|
23
23
|
for (const actor of roomActors) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export class SayToCommand extends Command {
|
|
32
|
-
// Add verb and description as per the abstract Command class
|
|
33
|
-
static verb = "say to";
|
|
34
|
-
static description = "Send a message to one person in the room.";
|
|
35
|
-
context;
|
|
36
|
-
constructor(context) {
|
|
37
|
-
super(context);
|
|
38
|
-
this.context = context;
|
|
39
|
-
}
|
|
40
|
-
execute(args) {
|
|
41
|
-
if (args.length === 0) {
|
|
42
|
-
return "What do you want to say?";
|
|
43
|
-
}
|
|
44
|
-
const message = args.join(' ');
|
|
45
|
-
const currentPlayer = this.actor;
|
|
46
|
-
const scene = this.context.scene; // Assuming you have scene in ICommandContext
|
|
47
|
-
if (!scene) {
|
|
48
|
-
this.logger.log("Scene is missing from context."); // Using logger for potential error
|
|
49
|
-
return "An error occurred.";
|
|
50
|
-
}
|
|
51
|
-
const roomActors = scene.allActors.filter(actor => actor.currentLocation === currentPlayer.currentLocation);
|
|
52
|
-
for (const actor of roomActors) {
|
|
53
|
-
// Again, in a real game, you'd have each actor "hear" the message in some way
|
|
54
|
-
this.logger.log(`${currentPlayer.name} says to ${actor.name}: "${message}"`);
|
|
55
|
-
this.actor.currentLocation.say(actor, message);
|
|
24
|
+
if (actor == currentPlayer) {
|
|
25
|
+
this.actor.currentLocation.say(actor, message);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.logger.logWithColor(`${currentPlayer.name} says "${message}"`, 'yellow');
|
|
29
|
+
}
|
|
30
|
+
actor.hear(currentPlayer, message);
|
|
56
31
|
}
|
|
57
32
|
return ``;
|
|
58
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"say.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/say.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"say.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/say.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAE5D,MAAM,OAAO,UAAW,SAAQ,OAAO;IACrC,6DAA6D;IACnD,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,MAAM,CAAC,WAAW,GAAG,sDAAsD,CAAC;IAC5E,OAAO,CAAsB;IAEvC,YAAY,OAA4B;QACtC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,IAAc;QACpB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,0BAA0B,CAAC;QACpC,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,6CAA6C;QAE/E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC,CAAC,mCAAmC;YACtF,OAAO,oBAAoB,CAAC;QAC9B,CAAC;QAED,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,KAAK,aAAa,CAAC,eAAe,CAAC,CAAC;QAE5G,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;YAC/B,IAAI,KAAK,IAAI,aAAa,EAAE,CAAC;gBAC3B,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACjD,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,aAAa,CAAC,IAAI,UAAU,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC;YAChF,CAAC;YAED,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACrC,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class SearchCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -13,6 +13,7 @@ export class SearchCommand extends Command {
|
|
|
13
13
|
// If items are present, list them and log the action
|
|
14
14
|
const itemsList = roomItems.join(', ');
|
|
15
15
|
this.logger.write(`SearchCommand: ${this.actor.name} found the following items: ${itemsList}`);
|
|
16
|
+
this.actor.performAction('search', itemsList);
|
|
16
17
|
return `You search the area and find: ${itemsList}`;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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,OAAO;QACL,0FAA0F;QAC1F,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QAEnE,oDAAoD;QACpD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,IAAI,uCAAuC,CAAC,CAAC;YAC5F,OAAO,sEAAsE,CAAC;QAChF,CAAC;QAED,qDAAqD;QACrD,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,IAAI,+BAA+B,SAAS,EAAE,CAAC,CAAC;QAC/F,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC9C,OAAO,iCAAiC,SAAS,EAAE,CAAC;IACtD,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class SolveCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -16,6 +16,7 @@ export class SolveCommand extends Command {
|
|
|
16
16
|
this.logger.write(`${this.actor.name} has solved ${room.puzzle.name}`);
|
|
17
17
|
}
|
|
18
18
|
this.logger.write(`SolveCommand: ${result.message}`);
|
|
19
|
+
this.actor.performAction('solve', result.message);
|
|
19
20
|
return result.message;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solve.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/solve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"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AiB,MAAM,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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class StoreCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -22,6 +22,7 @@ export class StoreCommand extends Command {
|
|
|
22
22
|
const itemStored = this.actor.currentLocation.storeItemFromActor(this.actor, itemToStore);
|
|
23
23
|
if (itemStored) {
|
|
24
24
|
this.actor.inventory.removeItem(itemName);
|
|
25
|
+
this.actor.performAction('solve', itemName);
|
|
25
26
|
return `You stored ${itemName}.`;
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
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;QACpB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,6CAA6C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnG,OAAO,IAAI,CAAC,KAA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
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class TakeCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -22,6 +22,7 @@ export class TakeCommand extends Command {
|
|
|
22
22
|
}
|
|
23
23
|
// Try adding the item to the player's inventory
|
|
24
24
|
try {
|
|
25
|
+
this.actor.performAction('take', itemName);
|
|
25
26
|
this.actor.addInventory(item);
|
|
26
27
|
this.logger.write(`Successfully added "${itemName}" to ${this.actor.name}'s inventory during 'Take' command.`);
|
|
27
28
|
// Remove item from room's inventory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"take.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/take.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
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;QACpB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEO,IAAI,CAAC,IAAc;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;QAExC,mDAAmD;QACnD,IAAI,CAAC,IAAI,CAAC,SAAS,C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
|
2
|
-
import { ICommandContext } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommandConstructor } from './command.js';
|
|
3
2
|
export declare function parseArgsWithQuotes(input: string): string[];
|
|
4
3
|
export declare class TalkCommand extends Command {
|
|
5
4
|
protected static verb: string;
|
|
6
5
|
protected static description: string;
|
|
7
|
-
protected context:
|
|
8
|
-
constructor(context:
|
|
6
|
+
protected context: ICommandConstructor;
|
|
7
|
+
constructor(context: ICommandConstructor);
|
|
9
8
|
execute(args: string[]): string;
|
|
10
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"talk.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/talk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
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;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAGD,MAAM,OAAO,WAAY,SAAQ,OAAO;IAC5B,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,MAAM,CAAC,WAAW,GAAG,0CAA0C,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AAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QACxD,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,OAAO,EAAE,CAAC,CAAC;QAE/C,OAAO,eAAe,MAAM,CAAC,IAAI,gBAAgB,OAAO,GAAG,CAAC;IAC9D,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class UnequipCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|
|
@@ -6,6 +6,7 @@ export class UnequipCommand extends Command {
|
|
|
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}`);
|
|
9
|
+
this.actor.performAction('unqeuip', response);
|
|
9
10
|
return response;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unequip.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/unequip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
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;QACpB,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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Command } from './command.js';
|
|
2
|
-
import { ICommand } from '../types/interfaces.js';
|
|
1
|
+
import { Command, ICommand } from './command.js';
|
|
3
2
|
export declare class UnlockCommand extends Command implements ICommand {
|
|
4
3
|
protected static verb: string;
|
|
5
4
|
protected static description: string;
|