narrat 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +734 -117
- package/lib/index.js +736 -116
- 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 +30 -0
- package/lib/stores/quest-log.d.ts +36 -0
- package/lib/stores/vm-store.d.ts +1 -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/lib/vm/commands/run.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: {
|
|
@@ -226,6 +227,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
|
|
|
226
227
|
previousStack(): void;
|
|
227
228
|
finishGame(): void;
|
|
228
229
|
runLine(): Promise<void>;
|
|
230
|
+
runLabelFunction(label: string): Promise<void>;
|
|
229
231
|
runLabel(label: string): void;
|
|
230
232
|
}>;
|
|
231
233
|
hud: import("pinia").Store<"hud", import("./hud-stats-store").HudState, {}, {
|
|
@@ -242,6 +244,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
|
|
|
242
244
|
setMusic(music: string, soundId: number): void;
|
|
243
245
|
generateSaveData(): import("./audio-store").AudioSave;
|
|
244
246
|
loadSaveData(data: import("./audio-store").AudioSave): void;
|
|
247
|
+
reset(): void;
|
|
245
248
|
}>;
|
|
246
249
|
rendering: import("pinia").Store<"rendering", import("./rendering-store").RenderingState, {}, {
|
|
247
250
|
updateScreenSize(width: number, height: number, textWidth: number): void;
|
|
@@ -250,6 +253,33 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
|
|
|
250
253
|
addNotification(text: string): Promise<void>;
|
|
251
254
|
deleteNotification(id: string): void;
|
|
252
255
|
}>;
|
|
256
|
+
inventory: import("pinia").Store<"inventory", import("./inventory-store").InventoryState, {}, {
|
|
257
|
+
generateSaveData(): import("./inventory-store").InventoryState;
|
|
258
|
+
loadSaveData(save: import("./inventory-store").InventoryState): void;
|
|
259
|
+
setupItems(items: {
|
|
260
|
+
[key: string]: import("..").ItemData;
|
|
261
|
+
}): void;
|
|
262
|
+
getExistingItem(id: string): import("./inventory-store").ItemState;
|
|
263
|
+
getItemAmount(id: string): number;
|
|
264
|
+
add(item: import("./inventory-store").ItemState): void;
|
|
265
|
+
remove(item: import("./inventory-store").ItemState): void;
|
|
266
|
+
deleteItem(id: string): void;
|
|
267
|
+
}>;
|
|
268
|
+
quests: import("pinia").Store<"quests", import("./quest-log").QuestLogState, {}, {
|
|
269
|
+
getQuest(questId: string): import("./quest-log").QuestState;
|
|
270
|
+
getObjective(quest: string, objectiveId: string): import("./quest-log").ObjectiveState;
|
|
271
|
+
setupQuests(quests: {
|
|
272
|
+
[key: string]: import("..").QuestData;
|
|
273
|
+
}): void;
|
|
274
|
+
startQuest(questId: string): void;
|
|
275
|
+
startObjective(questId: string, objectiveId: string): void;
|
|
276
|
+
completeObjective(questId: string, objectiveId: string): void;
|
|
277
|
+
completeQuest(questId: string, ending?: string): void;
|
|
278
|
+
isQuestCompleted(questId: string): boolean;
|
|
279
|
+
removeQuest(id: string): void;
|
|
280
|
+
generateSaveData(): import("./quest-log").QuestLogState;
|
|
281
|
+
loadSaveData(data: import("./quest-log").QuestLogState): void;
|
|
282
|
+
}>;
|
|
253
283
|
};
|
|
254
284
|
overrideStates(override: any): void;
|
|
255
285
|
}>;
|
|
@@ -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/stores/vm-store.d.ts
CHANGED
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;
|