narrat 1.0.0 → 1.2.1
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/lib/components/inventory.vue.d.ts +30 -0
- package/lib/components/menu.vue.d.ts +4 -0
- package/lib/components/quests.vue.d.ts +25 -0
- package/lib/config.d.ts +25 -0
- package/lib/index.esm.js +618 -31
- package/lib/index.js +620 -30
- package/lib/stores/audio-store.d.ts +1 -0
- package/lib/stores/dialog-store.d.ts +1 -0
- package/lib/stores/inventory-store.d.ts +26 -0
- package/lib/stores/main-store.d.ts +29 -0
- package/lib/stores/quest-log.d.ts +36 -0
- package/lib/types/game-save.d.ts +4 -0
- package/lib/utils/data-helpers.d.ts +6 -0
- package/lib/utils/object-iterators.d.ts +8 -0
- package/lib/vm/commands/add_item.d.ts +2 -0
- package/lib/vm/commands/quest-commands.d.ts +5 -0
- package/lib/vm/commands/remove_item.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ItemData } from '..';
|
|
2
|
+
export interface ItemState {
|
|
3
|
+
amount: number;
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface InventoryState {
|
|
7
|
+
/** Note: Items are an object so that it's easy to access specific items in game scripts.
|
|
8
|
+
* One side effect of this is that the order items appear in isn't technicaclly guaranteed.
|
|
9
|
+
* It also means there can only be one "stack" of an item at a time */
|
|
10
|
+
items: {
|
|
11
|
+
[key: string]: ItemState;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare type InventorySave = InventoryState;
|
|
15
|
+
export declare const useInventory: import("pinia").StoreDefinition<"inventory", InventoryState, {}, {
|
|
16
|
+
generateSaveData(): InventorySave;
|
|
17
|
+
loadSaveData(save: InventorySave): void;
|
|
18
|
+
setupItems(items: {
|
|
19
|
+
[key: string]: ItemData;
|
|
20
|
+
}): void;
|
|
21
|
+
getExistingItem(id: string): ItemState | undefined;
|
|
22
|
+
getItemAmount(id: string): number;
|
|
23
|
+
add(item: ItemState): void;
|
|
24
|
+
remove(item: ItemState): void;
|
|
25
|
+
deleteItem(id: string): void;
|
|
26
|
+
}>;
|
|
@@ -96,6 +96,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
|
|
|
96
96
|
}): void;
|
|
97
97
|
addDialog(dialog: import("./dialog-store").AddDialogParams): void;
|
|
98
98
|
clearDialog(): void;
|
|
99
|
+
reset(): void;
|
|
99
100
|
}>;
|
|
100
101
|
vm: import("pinia").Store<"vm", import("./vm-store").VMState, {
|
|
101
102
|
currentStack(state: {
|
|
@@ -242,6 +243,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
|
|
|
242
243
|
setMusic(music: string, soundId: number): void;
|
|
243
244
|
generateSaveData(): import("./audio-store").AudioSave;
|
|
244
245
|
loadSaveData(data: import("./audio-store").AudioSave): void;
|
|
246
|
+
reset(): void;
|
|
245
247
|
}>;
|
|
246
248
|
rendering: import("pinia").Store<"rendering", import("./rendering-store").RenderingState, {}, {
|
|
247
249
|
updateScreenSize(width: number, height: number, textWidth: number): void;
|
|
@@ -250,6 +252,33 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
|
|
|
250
252
|
addNotification(text: string): Promise<void>;
|
|
251
253
|
deleteNotification(id: string): void;
|
|
252
254
|
}>;
|
|
255
|
+
inventory: import("pinia").Store<"inventory", import("./inventory-store").InventoryState, {}, {
|
|
256
|
+
generateSaveData(): import("./inventory-store").InventoryState;
|
|
257
|
+
loadSaveData(save: import("./inventory-store").InventoryState): void;
|
|
258
|
+
setupItems(items: {
|
|
259
|
+
[key: string]: import("..").ItemData;
|
|
260
|
+
}): void;
|
|
261
|
+
getExistingItem(id: string): import("./inventory-store").ItemState;
|
|
262
|
+
getItemAmount(id: string): number;
|
|
263
|
+
add(item: import("./inventory-store").ItemState): void;
|
|
264
|
+
remove(item: import("./inventory-store").ItemState): void;
|
|
265
|
+
deleteItem(id: string): void;
|
|
266
|
+
}>;
|
|
267
|
+
quests: import("pinia").Store<"quests", import("./quest-log").QuestLogState, {}, {
|
|
268
|
+
getQuest(questId: string): import("./quest-log").QuestState;
|
|
269
|
+
getObjective(quest: string, objectiveId: string): import("./quest-log").ObjectiveState;
|
|
270
|
+
setupQuests(quests: {
|
|
271
|
+
[key: string]: import("..").QuestData;
|
|
272
|
+
}): void;
|
|
273
|
+
startQuest(questId: string): void;
|
|
274
|
+
startObjective(questId: string, objectiveId: string): void;
|
|
275
|
+
completeObjective(questId: string, objectiveId: string): void;
|
|
276
|
+
completeQuest(questId: string, ending?: string): void;
|
|
277
|
+
isQuestCompleted(questId: string): boolean;
|
|
278
|
+
removeQuest(id: string): void;
|
|
279
|
+
generateSaveData(): import("./quest-log").QuestLogState;
|
|
280
|
+
loadSaveData(data: import("./quest-log").QuestLogState): void;
|
|
281
|
+
}>;
|
|
253
282
|
};
|
|
254
283
|
overrideStates(override: any): void;
|
|
255
284
|
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { QuestData } from '..';
|
|
2
|
+
export interface QuestLogState {
|
|
3
|
+
quests: {
|
|
4
|
+
[key: string]: QuestState;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface QuestState {
|
|
8
|
+
id: string;
|
|
9
|
+
state: 'hidden' | 'unlocked' | 'completed';
|
|
10
|
+
ending?: string;
|
|
11
|
+
/** Note: Objectives are an object so that it's easy to access specific objectives in game scripts.
|
|
12
|
+
* One side effect of this is that the order objectives appear in isn't technicaclly guaranteed. */
|
|
13
|
+
objectives: {
|
|
14
|
+
[key: string]: ObjectiveState;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface ObjectiveState {
|
|
18
|
+
id: string;
|
|
19
|
+
state: 'hidden' | 'unlocked' | 'completed';
|
|
20
|
+
}
|
|
21
|
+
export declare type QuestLogSave = QuestLogState;
|
|
22
|
+
export declare const useQuests: import("pinia").StoreDefinition<"quests", QuestLogState, {}, {
|
|
23
|
+
getQuest(questId: string): QuestState;
|
|
24
|
+
getObjective(quest: string, objectiveId: string): ObjectiveState;
|
|
25
|
+
setupQuests(quests: {
|
|
26
|
+
[key: string]: QuestData;
|
|
27
|
+
}): void;
|
|
28
|
+
startQuest(questId: string): void;
|
|
29
|
+
startObjective(questId: string, objectiveId: string): void;
|
|
30
|
+
completeObjective(questId: string, objectiveId: string): void;
|
|
31
|
+
completeQuest(questId: string, ending?: string): void;
|
|
32
|
+
isQuestCompleted(questId: string): boolean;
|
|
33
|
+
removeQuest(id: string): void;
|
|
34
|
+
generateSaveData(): QuestLogSave;
|
|
35
|
+
loadSaveData(data: QuestLogSave): void;
|
|
36
|
+
}>;
|
package/lib/types/game-save.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AudioSave } from '@/stores/audio-store';
|
|
2
2
|
import { DialogSave } from '@/stores/dialog-store';
|
|
3
3
|
import { HudSave } from '@/stores/hud-stats-store';
|
|
4
|
+
import { InventorySave } from '@/stores/inventory-store';
|
|
4
5
|
import { MainSaveData } from '@/stores/main-store';
|
|
6
|
+
import { QuestLogSave } from '@/stores/quest-log';
|
|
5
7
|
import { ScreenSave } from '@/stores/screens-store';
|
|
6
8
|
import { SkillsSave } from '@/stores/skills';
|
|
7
9
|
import { VMSave } from '@/stores/vm-store';
|
|
@@ -14,4 +16,6 @@ export declare type GameSave = {
|
|
|
14
16
|
vm: VMSave;
|
|
15
17
|
audio: AudioSave;
|
|
16
18
|
hud: HudSave;
|
|
19
|
+
inventory: InventorySave;
|
|
20
|
+
quests: QuestLogSave;
|
|
17
21
|
};
|
|
@@ -5,4 +5,10 @@ export declare function getModifiableDataPinia(): {
|
|
|
5
5
|
data: import("@/stores/vm-store").DataState;
|
|
6
6
|
skills: import("@/stores/skills").SkillsState;
|
|
7
7
|
buttons: import("@/stores/screens-store").ButtonsState;
|
|
8
|
+
items: {
|
|
9
|
+
[key: string]: import("@/stores/inventory-store").ItemState;
|
|
10
|
+
};
|
|
11
|
+
quests: {
|
|
12
|
+
[key: string]: import("@/stores/quest-log").QuestState;
|
|
13
|
+
};
|
|
8
14
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const everyObject: <T>(object: T, predicate: (value: T[keyof T]) => boolean) => boolean;
|
|
2
|
+
export declare const someObject: <T>(object: T, predicate: (value: T[keyof T]) => boolean) => boolean;
|
|
3
|
+
export declare const mapObject: <T, U>(object: T, mapper: (value: T[keyof T]) => U) => {
|
|
4
|
+
[key: string]: U;
|
|
5
|
+
};
|
|
6
|
+
export declare const filterObject: <T>(object: T, predicate: (value: T[keyof T]) => boolean) => {
|
|
7
|
+
[key: string]: T[keyof T];
|
|
8
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const startQuestPlugin: CommandPlugin;
|
|
3
|
+
export declare const startObjectivePlugin: CommandPlugin;
|
|
4
|
+
export declare const completeObjectivePlugin: CommandPlugin;
|
|
5
|
+
export declare const completeQuestPlugin: CommandPlugin;
|