narrat 2.0.8 → 2.0.10
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/LICENSE +21 -21
- package/README.md +105 -105
- package/dist/app.vue.d.ts +96 -96
- package/dist/audio.7z +0 -0
- package/dist/components/MainMenu.vue.d.ts +12 -12
- package/dist/components/Skills.vue.d.ts +22 -22
- package/dist/components/debug/debug-menu.vue.d.ts +48 -48
- package/dist/components/dialog-picture.vue.d.ts +9 -9
- package/dist/components/game-dialog.vue.d.ts +65 -65
- package/dist/components/hud.vue.d.ts +12 -12
- package/dist/components/inventory-ui.vue.d.ts +30 -30
- package/dist/components/loading-bar.vue.d.ts +10 -10
- package/dist/components/menu-buttons.vue.d.ts +26 -26
- package/dist/components/notification-toast.vue.d.ts +6 -6
- package/dist/components/quests-ui.vue.d.ts +20 -20
- package/dist/components/utils/modal.vue.d.ts +6 -6
- package/dist/components/volume-controls.vue.d.ts +7 -7
- package/dist/config.d.ts +151 -151
- package/dist/constants.d.ts +1 -1
- package/dist/data/characters.json +62 -62
- package/dist/data/config.json +182 -182
- package/dist/data/example.rpy +367 -363
- package/dist/data/refactor.rpy +30 -30
- package/dist/defaultConfig.d.ts +2 -2
- package/dist/demo/demo.d.ts +1 -1
- package/dist/dialog-box.vue.d.ts +37 -37
- package/dist/exports/config.d.ts +1 -1
- package/dist/exports/display.d.ts +2 -2
- package/dist/exports/plugins.d.ts +20 -20
- package/dist/fonts/OpenDyslexic.ttf.svg +2326 -2326
- package/dist/gameloop.d.ts +3 -3
- package/dist/lib/lib.d.ts +15 -15
- package/dist/lib.css +1 -1
- package/dist/main.d.ts +5 -5
- package/dist/narrat.es.js +254 -164
- package/dist/narrat.es.js.map +1 -1
- package/dist/narrat.umd.js +84 -84
- package/dist/narrat.umd.js.map +1 -1
- package/dist/plugins/NarratPlugin.d.ts +11 -11
- package/dist/stores/audio-store.d.ts +12 -12
- package/dist/stores/dialog-store.d.ts +31 -31
- package/dist/stores/hud-stats-store.d.ts +22 -22
- package/dist/stores/inventory-store.d.ts +37 -37
- package/dist/stores/main-store.d.ts +283 -276
- package/dist/stores/notification-store.d.ts +12 -12
- package/dist/stores/quest-log.d.ts +39 -39
- package/dist/stores/rendering-store.d.ts +13 -13
- package/dist/stores/screens-store.d.ts +23 -23
- package/dist/stores/skills.d.ts +36 -36
- package/dist/stores/vm-store.d.ts +155 -148
- package/dist/types/app-types.d.ts +4 -4
- package/dist/types/character-types.d.ts +27 -27
- package/dist/types/dialog-box-types.d.ts +10 -10
- package/dist/types/game-save.d.ts +21 -21
- package/dist/types/parser.d.ts +93 -92
- package/dist/types/state.d.ts +3 -3
- package/dist/utils/ajax.d.ts +1 -1
- package/dist/utils/audio-loader.d.ts +13 -13
- package/dist/utils/characters.d.ts +5 -5
- package/dist/utils/data-helpers.d.ts +19 -19
- package/dist/utils/debounce.d.ts +14 -14
- package/dist/utils/error-handling.d.ts +3 -3
- package/dist/utils/helpers.d.ts +6 -6
- package/dist/utils/images-loader.d.ts +6 -6
- package/dist/utils/logger.d.ts +11 -11
- package/dist/utils/object-iterators.d.ts +8 -8
- package/dist/utils/promises.d.ts +1 -1
- package/dist/utils/randomId.d.ts +1 -1
- package/dist/utils/save-helpers.d.ts +3 -3
- package/dist/utils/skillchecks.d.ts +17 -17
- package/dist/utils/string-helpers.d.ts +3 -3
- package/dist/utils/time-helpers.d.ts +2 -2
- package/dist/vm/commands/arithmetic-commands.d.ts +17 -17
- package/dist/vm/commands/audio-commands.d.ts +8 -8
- package/dist/vm/commands/choice.d.ts +37 -37
- package/dist/vm/commands/clear_dialog.d.ts +2 -2
- package/dist/vm/commands/command-helpers.d.ts +2 -2
- package/dist/vm/commands/command-plugin.d.ts +43 -30
- package/dist/vm/commands/flow-commands.d.ts +14 -14
- package/dist/vm/commands/if.d.ts +10 -10
- package/dist/vm/commands/index.d.ts +2 -2
- package/dist/vm/commands/inventory-commands.d.ts +15 -15
- package/dist/vm/commands/logic-command.d.ts +42 -42
- package/dist/vm/commands/notify.d.ts +4 -4
- package/dist/vm/commands/quest-commands.d.ts +30 -30
- package/dist/vm/commands/screen-commands.d.ts +8 -8
- package/dist/vm/commands/set.d.ts +6 -6
- package/dist/vm/commands/skill-commands.d.ts +33 -33
- package/dist/vm/commands/stats-commands.d.ts +12 -12
- package/dist/vm/commands/string-commands.d.ts +9 -9
- package/dist/vm/commands/text-field.d.ts +7 -7
- package/dist/vm/commands/text.d.ts +13 -13
- package/dist/vm/commands/wait.d.ts +4 -4
- package/dist/vm/vm-helpers.d.ts +16 -16
- package/dist/vm/vm-parser.d.ts +19 -19
- package/dist/vm/vm-parser.test.d.ts +1 -1
- package/dist/vm/vm.d.ts +19 -19
- package/package.json +79 -79
- package/CHANGELOG.md +0 -785
- package/dist/.DS_Store +0 -0
- package/dist/img/.DS_Store +0 -0
- package/dist/music/.DS_Store +0 -0
- package/dist/sounds/.DS_Store +0 -0
|
@@ -1,30 +1,43 @@
|
|
|
1
|
-
import { Parser } from '../../types/parser';
|
|
2
|
-
import { ParserContext } from '../vm-parser';
|
|
3
|
-
import { DialogChoice } from '../../stores/dialog-store';
|
|
4
|
-
export declare type CommandRunner<Options, StaticOptions = {}> = (cmd: Parser.Command<Options, StaticOptions>, choices?: DialogChoice[]) => Promise<any>;
|
|
5
|
-
export declare type CommandParserFunction<Options, StaticOptions = {}> = (ctx: CommandParsingContext, command: Parser.ParsedExpression<Options, StaticOptions>) => {
|
|
6
|
-
newLine: number;
|
|
7
|
-
};
|
|
8
|
-
export declare type ProcessCommandsFunction = (ctx: ParserContext, lines: Parser.Line[], parentLine: Parser.Line | undefined) => Parser.Branch;
|
|
9
|
-
export interface CommandParsingContext {
|
|
10
|
-
parserContext: ParserContext;
|
|
11
|
-
processCommandsFunction: ProcessCommandsFunction;
|
|
12
|
-
line: Parser.Line;
|
|
13
|
-
lines: Parser.Line[];
|
|
14
|
-
currentLine: number;
|
|
15
|
-
}
|
|
16
|
-
export declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
argTypes: ArgTypes;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { Parser } from '../../types/parser';
|
|
2
|
+
import { ParserContext } from '../vm-parser';
|
|
3
|
+
import { DialogChoice } from '../../stores/dialog-store';
|
|
4
|
+
export declare type CommandRunner<Options, StaticOptions = {}> = (cmd: Parser.Command<Options, StaticOptions>, choices?: DialogChoice[]) => Promise<any>;
|
|
5
|
+
export declare type CommandParserFunction<Options, StaticOptions = {}> = (ctx: CommandParsingContext, command: Parser.ParsedExpression<Options, StaticOptions>) => {
|
|
6
|
+
newLine: number;
|
|
7
|
+
};
|
|
8
|
+
export declare type ProcessCommandsFunction = (ctx: ParserContext, lines: Parser.Line[], parentLine: Parser.Line | undefined) => Parser.Branch;
|
|
9
|
+
export interface CommandParsingContext {
|
|
10
|
+
parserContext: ParserContext;
|
|
11
|
+
processCommandsFunction: ProcessCommandsFunction;
|
|
12
|
+
line: Parser.Line;
|
|
13
|
+
lines: Parser.Line[];
|
|
14
|
+
currentLine: number;
|
|
15
|
+
}
|
|
16
|
+
export declare type OnPlayerAnswered<Options, StaticOptions> = (cmd: Parser.Command<Options, StaticOptions>, choice: number | string) => Promise<any>;
|
|
17
|
+
export interface CommandPluginOptions<Options, StaticOptions = {}> {
|
|
18
|
+
keyword: string;
|
|
19
|
+
argTypes: ArgTypes;
|
|
20
|
+
runner: CommandRunner<Options, StaticOptions>;
|
|
21
|
+
parser?: CommandParserFunction<Options, StaticOptions>;
|
|
22
|
+
onPlayerAnswered?: OnPlayerAnswered<Options, StaticOptions>;
|
|
23
|
+
returnAfterPlayerAnswer?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare class CommandPlugin<Options, StaticOptions = {}> {
|
|
26
|
+
keyword: string;
|
|
27
|
+
runner: CommandRunner<Options, StaticOptions>;
|
|
28
|
+
argTypes: ArgTypes;
|
|
29
|
+
parser: CommandParserFunction<Options, StaticOptions>;
|
|
30
|
+
onPlayerAnswered?: OnPlayerAnswered<Options, StaticOptions>;
|
|
31
|
+
returnAfterPlayerAnswer: boolean;
|
|
32
|
+
constructor(keyword: string, argTypes: ArgTypes, runner: CommandRunner<Options, StaticOptions>, parser?: CommandParserFunction<Options, StaticOptions>);
|
|
33
|
+
run(cmd: Parser.Command<Options, StaticOptions>, choices?: DialogChoice[]): Promise<any>;
|
|
34
|
+
processPlayerAnswer(cmd: Parser.Command<Options, StaticOptions>, choice: number | string): Promise<any>;
|
|
35
|
+
static FromOptions<Options, StaticOptions = {}>(options: CommandPluginOptions<Options, StaticOptions>): CommandPlugin<Options, StaticOptions>;
|
|
36
|
+
}
|
|
37
|
+
export declare type ArgTypes = ArgumentDescription[] | 'any';
|
|
38
|
+
export interface ArgumentDescription {
|
|
39
|
+
name: string;
|
|
40
|
+
type: 'string' | 'number' | 'boolean' | 'any';
|
|
41
|
+
optional?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare function generateParser<Options, StaticOptions = {}>(keyword: string, argTypes: ArgTypes): CommandParserFunction<Options, StaticOptions>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const jumpCommand: CommandPlugin<{
|
|
3
|
-
label: string;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export declare const runLabelPlugin: CommandPlugin<{
|
|
6
|
-
label: string;
|
|
7
|
-
}, {}>;
|
|
8
|
-
export declare const defineVariablePlugin: CommandPlugin<{
|
|
9
|
-
name: string;
|
|
10
|
-
value: any;
|
|
11
|
-
}, {}>;
|
|
12
|
-
export declare const returnPlugin: CommandPlugin<{
|
|
13
|
-
value: any;
|
|
14
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const jumpCommand: CommandPlugin<{
|
|
3
|
+
label: string;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare const runLabelPlugin: CommandPlugin<{
|
|
6
|
+
label: string;
|
|
7
|
+
}, {}>;
|
|
8
|
+
export declare const defineVariablePlugin: CommandPlugin<{
|
|
9
|
+
name: string;
|
|
10
|
+
value: any;
|
|
11
|
+
}, {}>;
|
|
12
|
+
export declare const returnPlugin: CommandPlugin<{
|
|
13
|
+
value: any;
|
|
14
|
+
}, {}>;
|
package/dist/vm/commands/if.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
import { Parser } from '../../types/parser';
|
|
3
|
-
export interface IfOptions {
|
|
4
|
-
condition: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface IfStaticOptions {
|
|
7
|
-
success: Parser.Branch;
|
|
8
|
-
failure?: Parser.Branch;
|
|
9
|
-
}
|
|
10
|
-
export declare const ifCommand: CommandPlugin<IfOptions, IfStaticOptions>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
import { Parser } from '../../types/parser';
|
|
3
|
+
export interface IfOptions {
|
|
4
|
+
condition: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface IfStaticOptions {
|
|
7
|
+
success: Parser.Branch;
|
|
8
|
+
failure?: Parser.Branch;
|
|
9
|
+
}
|
|
10
|
+
export declare const ifCommand: CommandPlugin<IfOptions, IfStaticOptions>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VM } from '../vm';
|
|
2
|
-
export declare function registerBaseCommands(vm: VM): void;
|
|
1
|
+
import { VM } from '../vm';
|
|
2
|
+
export declare function registerBaseCommands(vm: VM): void;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export interface InventoryChangeArgs {
|
|
3
|
-
id: string;
|
|
4
|
-
amount: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const addItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
|
|
7
|
-
export declare const removeItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
|
|
8
|
-
export declare const hasItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
|
|
9
|
-
export declare const itemAmountPlugin: CommandPlugin<InventoryChangeArgs, {}>;
|
|
10
|
-
export declare const enableInteractionPlugin: CommandPlugin<{
|
|
11
|
-
tag: string;
|
|
12
|
-
}, {}>;
|
|
13
|
-
export declare const disableInteractionPlugin: CommandPlugin<{
|
|
14
|
-
tag: string;
|
|
15
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export interface InventoryChangeArgs {
|
|
3
|
+
id: string;
|
|
4
|
+
amount: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const addItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
|
|
7
|
+
export declare const removeItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
|
|
8
|
+
export declare const hasItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
|
|
9
|
+
export declare const itemAmountPlugin: CommandPlugin<InventoryChangeArgs, {}>;
|
|
10
|
+
export declare const enableInteractionPlugin: CommandPlugin<{
|
|
11
|
+
tag: string;
|
|
12
|
+
}, {}>;
|
|
13
|
+
export declare const disableInteractionPlugin: CommandPlugin<{
|
|
14
|
+
tag: string;
|
|
15
|
+
}, {}>;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const equalPlugin: CommandPlugin<{
|
|
3
|
-
a: number;
|
|
4
|
-
b: number;
|
|
5
|
-
}, {}>;
|
|
6
|
-
export declare const greaterThanPlugin: CommandPlugin<{
|
|
7
|
-
a: number;
|
|
8
|
-
b: number;
|
|
9
|
-
}, {}>;
|
|
10
|
-
export declare const lesserThanPlugin: CommandPlugin<{
|
|
11
|
-
a: number;
|
|
12
|
-
b: number;
|
|
13
|
-
}, {}>;
|
|
14
|
-
export declare const greaterOrEqualPlugin: CommandPlugin<{
|
|
15
|
-
a: number;
|
|
16
|
-
b: number;
|
|
17
|
-
}, {}>;
|
|
18
|
-
export declare const lesserOrEqualPlugin: CommandPlugin<{
|
|
19
|
-
a: number;
|
|
20
|
-
b: number;
|
|
21
|
-
}, {}>;
|
|
22
|
-
export declare const notEqualPlugin: CommandPlugin<{
|
|
23
|
-
a: number;
|
|
24
|
-
b: number;
|
|
25
|
-
}, {}>;
|
|
26
|
-
export declare const notPlugin: CommandPlugin<{
|
|
27
|
-
a: number;
|
|
28
|
-
b: number;
|
|
29
|
-
}, {}>;
|
|
30
|
-
export declare const andPlugin: CommandPlugin<{
|
|
31
|
-
a: number;
|
|
32
|
-
b: number;
|
|
33
|
-
}, {}>;
|
|
34
|
-
export declare const orPlugin: CommandPlugin<{
|
|
35
|
-
a: number;
|
|
36
|
-
b: number;
|
|
37
|
-
}, {}>;
|
|
38
|
-
export declare const ternaryPlugin: CommandPlugin<{
|
|
39
|
-
a: boolean;
|
|
40
|
-
b: any;
|
|
41
|
-
c: any;
|
|
42
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const equalPlugin: CommandPlugin<{
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
}, {}>;
|
|
6
|
+
export declare const greaterThanPlugin: CommandPlugin<{
|
|
7
|
+
a: number;
|
|
8
|
+
b: number;
|
|
9
|
+
}, {}>;
|
|
10
|
+
export declare const lesserThanPlugin: CommandPlugin<{
|
|
11
|
+
a: number;
|
|
12
|
+
b: number;
|
|
13
|
+
}, {}>;
|
|
14
|
+
export declare const greaterOrEqualPlugin: CommandPlugin<{
|
|
15
|
+
a: number;
|
|
16
|
+
b: number;
|
|
17
|
+
}, {}>;
|
|
18
|
+
export declare const lesserOrEqualPlugin: CommandPlugin<{
|
|
19
|
+
a: number;
|
|
20
|
+
b: number;
|
|
21
|
+
}, {}>;
|
|
22
|
+
export declare const notEqualPlugin: CommandPlugin<{
|
|
23
|
+
a: number;
|
|
24
|
+
b: number;
|
|
25
|
+
}, {}>;
|
|
26
|
+
export declare const notPlugin: CommandPlugin<{
|
|
27
|
+
a: number;
|
|
28
|
+
b: number;
|
|
29
|
+
}, {}>;
|
|
30
|
+
export declare const andPlugin: CommandPlugin<{
|
|
31
|
+
a: number;
|
|
32
|
+
b: number;
|
|
33
|
+
}, {}>;
|
|
34
|
+
export declare const orPlugin: CommandPlugin<{
|
|
35
|
+
a: number;
|
|
36
|
+
b: number;
|
|
37
|
+
}, {}>;
|
|
38
|
+
export declare const ternaryPlugin: CommandPlugin<{
|
|
39
|
+
a: boolean;
|
|
40
|
+
b: any;
|
|
41
|
+
c: any;
|
|
42
|
+
}, {}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const notifyPlugin: CommandPlugin<{
|
|
3
|
-
text: string;
|
|
4
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const notifyPlugin: CommandPlugin<{
|
|
3
|
+
text: string;
|
|
4
|
+
}, {}>;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const startQuestPlugin: CommandPlugin<{
|
|
3
|
-
questId: string;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export declare const startObjectivePlugin: CommandPlugin<{
|
|
6
|
-
questId: string;
|
|
7
|
-
objectiveId: string;
|
|
8
|
-
}, {}>;
|
|
9
|
-
export declare const completeObjectivePlugin: CommandPlugin<{
|
|
10
|
-
questId: string;
|
|
11
|
-
objectiveId: string;
|
|
12
|
-
}, {}>;
|
|
13
|
-
export declare const completeQuestPlugin: CommandPlugin<{
|
|
14
|
-
questId: string;
|
|
15
|
-
ending?: string | undefined;
|
|
16
|
-
}, {}>;
|
|
17
|
-
export declare const questCompletedPlugin: CommandPlugin<{
|
|
18
|
-
questId: string;
|
|
19
|
-
}, {}>;
|
|
20
|
-
export declare const objectiveCompletedPlugin: CommandPlugin<{
|
|
21
|
-
questId: string;
|
|
22
|
-
objectiveId: string;
|
|
23
|
-
}, {}>;
|
|
24
|
-
export declare const questStartedPlugin: CommandPlugin<{
|
|
25
|
-
questId: string;
|
|
26
|
-
}, {}>;
|
|
27
|
-
export declare const objectiveStartedPlugin: CommandPlugin<{
|
|
28
|
-
questId: string;
|
|
29
|
-
objectiveId: string;
|
|
30
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const startQuestPlugin: CommandPlugin<{
|
|
3
|
+
questId: string;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare const startObjectivePlugin: CommandPlugin<{
|
|
6
|
+
questId: string;
|
|
7
|
+
objectiveId: string;
|
|
8
|
+
}, {}>;
|
|
9
|
+
export declare const completeObjectivePlugin: CommandPlugin<{
|
|
10
|
+
questId: string;
|
|
11
|
+
objectiveId: string;
|
|
12
|
+
}, {}>;
|
|
13
|
+
export declare const completeQuestPlugin: CommandPlugin<{
|
|
14
|
+
questId: string;
|
|
15
|
+
ending?: string | undefined;
|
|
16
|
+
}, {}>;
|
|
17
|
+
export declare const questCompletedPlugin: CommandPlugin<{
|
|
18
|
+
questId: string;
|
|
19
|
+
}, {}>;
|
|
20
|
+
export declare const objectiveCompletedPlugin: CommandPlugin<{
|
|
21
|
+
questId: string;
|
|
22
|
+
objectiveId: string;
|
|
23
|
+
}, {}>;
|
|
24
|
+
export declare const questStartedPlugin: CommandPlugin<{
|
|
25
|
+
questId: string;
|
|
26
|
+
}, {}>;
|
|
27
|
+
export declare const objectiveStartedPlugin: CommandPlugin<{
|
|
28
|
+
questId: string;
|
|
29
|
+
objectiveId: string;
|
|
30
|
+
}, {}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const setScreenCommand: CommandPlugin<{
|
|
3
|
-
screen: string;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export declare const setButtonCommand: CommandPlugin<{
|
|
6
|
-
buttonId: string;
|
|
7
|
-
enabled: boolean;
|
|
8
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const setScreenCommand: CommandPlugin<{
|
|
3
|
+
screen: string;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare const setButtonCommand: CommandPlugin<{
|
|
6
|
+
buttonId: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
}, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const setCommand: CommandPlugin<any, {}>;
|
|
3
|
-
export declare const addPlugin: CommandPlugin<{
|
|
4
|
-
key: any;
|
|
5
|
-
value: number;
|
|
6
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const setCommand: CommandPlugin<any, {}>;
|
|
3
|
+
export declare const addPlugin: CommandPlugin<{
|
|
4
|
+
key: any;
|
|
5
|
+
value: number;
|
|
6
|
+
}, {}>;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { Parser } from '../../types/parser';
|
|
2
|
-
import { CommandPlugin } from './command-plugin';
|
|
3
|
-
export interface AddLevelArgs {
|
|
4
|
-
skillKey: string;
|
|
5
|
-
amount: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const addLevelPlugin: CommandPlugin<AddLevelArgs, {}>;
|
|
8
|
-
export interface AddXpArgs {
|
|
9
|
-
xpKey: string;
|
|
10
|
-
xpToAdd: number;
|
|
11
|
-
}
|
|
12
|
-
export declare const addXpPlugin: CommandPlugin<AddXpArgs, {}>;
|
|
13
|
-
export interface SkillCheckOptions {
|
|
14
|
-
id: string;
|
|
15
|
-
skill: string;
|
|
16
|
-
value: number;
|
|
17
|
-
hideAfterRoll: boolean;
|
|
18
|
-
success: {
|
|
19
|
-
text: string;
|
|
20
|
-
branch: Parser.Branch;
|
|
21
|
-
};
|
|
22
|
-
failure: {
|
|
23
|
-
text: string;
|
|
24
|
-
branch?: Parser.Branch;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export interface RollArgs {
|
|
28
|
-
id: string;
|
|
29
|
-
skill: string;
|
|
30
|
-
value: number;
|
|
31
|
-
hideAfterRoll?: boolean;
|
|
32
|
-
}
|
|
33
|
-
export declare const rollPlugin: CommandPlugin<RollArgs, {}>;
|
|
1
|
+
import { Parser } from '../../types/parser';
|
|
2
|
+
import { CommandPlugin } from './command-plugin';
|
|
3
|
+
export interface AddLevelArgs {
|
|
4
|
+
skillKey: string;
|
|
5
|
+
amount: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const addLevelPlugin: CommandPlugin<AddLevelArgs, {}>;
|
|
8
|
+
export interface AddXpArgs {
|
|
9
|
+
xpKey: string;
|
|
10
|
+
xpToAdd: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const addXpPlugin: CommandPlugin<AddXpArgs, {}>;
|
|
13
|
+
export interface SkillCheckOptions {
|
|
14
|
+
id: string;
|
|
15
|
+
skill: string;
|
|
16
|
+
value: number;
|
|
17
|
+
hideAfterRoll: boolean;
|
|
18
|
+
success: {
|
|
19
|
+
text: string;
|
|
20
|
+
branch: Parser.Branch;
|
|
21
|
+
};
|
|
22
|
+
failure: {
|
|
23
|
+
text: string;
|
|
24
|
+
branch?: Parser.Branch;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface RollArgs {
|
|
28
|
+
id: string;
|
|
29
|
+
skill: string;
|
|
30
|
+
value: number;
|
|
31
|
+
hideAfterRoll?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const rollPlugin: CommandPlugin<RollArgs, {}>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const addStatPlugin: CommandPlugin<{
|
|
3
|
-
statKey: string;
|
|
4
|
-
amountToAdd: number;
|
|
5
|
-
}, {}>;
|
|
6
|
-
export declare const setStatPlugin: CommandPlugin<{
|
|
7
|
-
statKey: string;
|
|
8
|
-
value: number;
|
|
9
|
-
}, {}>;
|
|
10
|
-
export declare const getStatPlugin: CommandPlugin<{
|
|
11
|
-
statKey: string;
|
|
12
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const addStatPlugin: CommandPlugin<{
|
|
3
|
+
statKey: string;
|
|
4
|
+
amountToAdd: number;
|
|
5
|
+
}, {}>;
|
|
6
|
+
export declare const setStatPlugin: CommandPlugin<{
|
|
7
|
+
statKey: string;
|
|
8
|
+
value: number;
|
|
9
|
+
}, {}>;
|
|
10
|
+
export declare const getStatPlugin: CommandPlugin<{
|
|
11
|
+
statKey: string;
|
|
12
|
+
}, {}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const stringConcatPlugin: CommandPlugin<{
|
|
3
|
-
a: number;
|
|
4
|
-
b: number;
|
|
5
|
-
}, {}>;
|
|
6
|
-
export declare const stringJoinPlugin: CommandPlugin<{
|
|
7
|
-
a: number;
|
|
8
|
-
b: number;
|
|
9
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const stringConcatPlugin: CommandPlugin<{
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
}, {}>;
|
|
6
|
+
export declare const stringJoinPlugin: CommandPlugin<{
|
|
7
|
+
a: number;
|
|
8
|
+
b: number;
|
|
9
|
+
}, {}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const textFieldPlugin: CommandPlugin<{
|
|
3
|
-
prompt: string;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export declare const textFieldPromptPlugin: CommandPlugin<{
|
|
6
|
-
prompt: string;
|
|
7
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const textFieldPlugin: CommandPlugin<{
|
|
3
|
+
prompt: string;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare const textFieldPromptPlugin: CommandPlugin<{
|
|
6
|
+
prompt: string;
|
|
7
|
+
}, {}>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { CommandParserFunction, CommandPlugin } from './command-plugin';
|
|
2
|
-
export interface TalkArgs {
|
|
3
|
-
speaker: string;
|
|
4
|
-
pose: string;
|
|
5
|
-
text: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const talkCommand: CommandPlugin<TalkArgs, {}>;
|
|
8
|
-
export declare const textParser: () => CommandParserFunction<{}, {
|
|
9
|
-
text: string;
|
|
10
|
-
}>;
|
|
11
|
-
export declare const textCommandPlugin: CommandPlugin<{}, {
|
|
12
|
-
text: string;
|
|
13
|
-
}>;
|
|
1
|
+
import { CommandParserFunction, CommandPlugin } from './command-plugin';
|
|
2
|
+
export interface TalkArgs {
|
|
3
|
+
speaker: string;
|
|
4
|
+
pose: string;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const talkCommand: CommandPlugin<TalkArgs, {}>;
|
|
8
|
+
export declare const textParser: () => CommandParserFunction<{}, {
|
|
9
|
+
text: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const textCommandPlugin: CommandPlugin<{}, {
|
|
12
|
+
text: string;
|
|
13
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandPlugin } from './command-plugin';
|
|
2
|
-
export declare const waitCommand: CommandPlugin<{
|
|
3
|
-
duration: number;
|
|
4
|
-
}, {}>;
|
|
1
|
+
import { CommandPlugin } from './command-plugin';
|
|
2
|
+
export declare const waitCommand: CommandPlugin<{
|
|
3
|
+
duration: number;
|
|
4
|
+
}, {}>;
|
package/dist/vm/vm-helpers.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AddDialogParams } from '../stores/dialog-store';
|
|
2
|
-
import { SkillCheckState } from '../stores/skills';
|
|
3
|
-
import { Parser } from '../types/parser';
|
|
4
|
-
import { IfOptions, IfStaticOptions } from './commands/if';
|
|
5
|
-
export interface SkillCheckParams {
|
|
6
|
-
skill: string;
|
|
7
|
-
value: number;
|
|
8
|
-
id: string;
|
|
9
|
-
hideAfterRoll?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function runSkillCheck(params: SkillCheckParams): SkillCheckState;
|
|
12
|
-
export declare function runConditionCommand(command: Parser.Command<IfOptions, IfStaticOptions>): Parser.Branch | undefined;
|
|
13
|
-
export declare function isExpression(arg: Parser.Arg): arg is Parser.ParsedExpression;
|
|
14
|
-
export declare function writeText(text: string): void;
|
|
15
|
-
export declare function textCommand(dialog: AddDialogParams): Promise<void>;
|
|
16
|
-
export declare function getLine(lines: Parser.Line[], index: number): Parser.Line | undefined;
|
|
1
|
+
import { AddDialogParams } from '../stores/dialog-store';
|
|
2
|
+
import { SkillCheckState } from '../stores/skills';
|
|
3
|
+
import { Parser } from '../types/parser';
|
|
4
|
+
import { IfOptions, IfStaticOptions } from './commands/if';
|
|
5
|
+
export interface SkillCheckParams {
|
|
6
|
+
skill: string;
|
|
7
|
+
value: number;
|
|
8
|
+
id: string;
|
|
9
|
+
hideAfterRoll?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function runSkillCheck(params: SkillCheckParams): SkillCheckState;
|
|
12
|
+
export declare function runConditionCommand(command: Parser.Command<IfOptions, IfStaticOptions>): Parser.Branch | undefined;
|
|
13
|
+
export declare function isExpression(arg: Parser.Arg): arg is Parser.ParsedExpression;
|
|
14
|
+
export declare function writeText(text: string): void;
|
|
15
|
+
export declare function textCommand(dialog: AddDialogParams): Promise<void>;
|
|
16
|
+
export declare function getLine(lines: Parser.Line[], index: number): Parser.Line | undefined;
|
package/dist/vm/vm-parser.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Parser } from '../types/parser';
|
|
2
|
-
import { ProcessCommandsFunction } from './commands/command-plugin';
|
|
3
|
-
export declare type ErrorFunction = (line: number, text: string) => void;
|
|
4
|
-
export declare type ParserErrorHandler = (ctx: ParserContext, line: number, text: string) => void;
|
|
5
|
-
export interface ParserContext {
|
|
6
|
-
fileName: string;
|
|
7
|
-
currentLine: number;
|
|
8
|
-
error: ErrorFunction;
|
|
9
|
-
processCommandsFunction: ProcessCommandsFunction;
|
|
10
|
-
indentSize: number;
|
|
11
|
-
}
|
|
12
|
-
export declare function parseScript(errorHandler: ParserErrorHandler, code: string, fileName: string): Parser.ParsedScript;
|
|
13
|
-
export declare function parseCodeLine(ctx: ParserContext, codeToProcess: string): Parser.Expression;
|
|
14
|
-
export declare function parseCodeLineIntoTokens(code: string): Parser.Primitive[];
|
|
15
|
-
export declare function splitIntoTokens(code: string): Parser.Primitive[];
|
|
16
|
-
export declare function tokensToExpression(ctx: ParserContext, tokens: Parser.Primitive[]): [Parser.Expression, number];
|
|
17
|
-
export declare function validateExpression(ctx: ParserContext, expression: Parser.Expression): void;
|
|
18
|
-
export declare function findExpressionStart(tokens: Parser.Primitive[]): number;
|
|
19
|
-
export declare function findExpressionEnd(tokens: Parser.Primitive[]): number;
|
|
1
|
+
import { Parser } from '../types/parser';
|
|
2
|
+
import { ProcessCommandsFunction } from './commands/command-plugin';
|
|
3
|
+
export declare type ErrorFunction = (line: number, text: string) => void;
|
|
4
|
+
export declare type ParserErrorHandler = (ctx: ParserContext, line: number, text: string) => void;
|
|
5
|
+
export interface ParserContext {
|
|
6
|
+
fileName: string;
|
|
7
|
+
currentLine: number;
|
|
8
|
+
error: ErrorFunction;
|
|
9
|
+
processCommandsFunction: ProcessCommandsFunction;
|
|
10
|
+
indentSize: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function parseScript(errorHandler: ParserErrorHandler, code: string, fileName: string): Parser.ParsedScript;
|
|
13
|
+
export declare function parseCodeLine(ctx: ParserContext, codeToProcess: string): Parser.Expression;
|
|
14
|
+
export declare function parseCodeLineIntoTokens(code: string): Parser.Primitive[];
|
|
15
|
+
export declare function splitIntoTokens(code: string): Parser.Primitive[];
|
|
16
|
+
export declare function tokensToExpression(ctx: ParserContext, tokens: Parser.Primitive[]): [Parser.Expression, number];
|
|
17
|
+
export declare function validateExpression(ctx: ParserContext, expression: Parser.Expression): void;
|
|
18
|
+
export declare function findExpressionStart(tokens: Parser.Primitive[]): number;
|
|
19
|
+
export declare function findExpressionEnd(tokens: Parser.Primitive[]): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/vm/vm.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { CommandPlugin } from './commands/command-plugin';
|
|
2
|
-
import { NarratPluginObject } from '../exports/plugins';
|
|
3
|
-
import { Parser } from '../types/parser';
|
|
4
|
-
import { DialogChoice } from '../stores/dialog-store';
|
|
5
|
-
export declare class VM {
|
|
6
|
-
plugins: NarratPluginObject<any>[];
|
|
7
|
-
commands: {
|
|
8
|
-
[key: string]: CommandPlugin<any>;
|
|
9
|
-
};
|
|
10
|
-
addCommand(command: CommandPlugin<any, any>): void;
|
|
11
|
-
addPlugin(plugin: NarratPluginObject<any>): void;
|
|
12
|
-
callHook(hookName: string, ...args: any[]): void;
|
|
13
|
-
}
|
|
14
|
-
export declare const vm: VM;
|
|
15
|
-
export declare function runCommand(expression: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<any>;
|
|
16
|
-
export declare function generateCommand(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<Parser.Command>;
|
|
17
|
-
export declare function runExpression<ReturnType = any>(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<ReturnType>;
|
|
18
|
-
export declare function playerAnswered(choice: string | number): Promise<any>;
|
|
19
|
-
export declare function finishGame(): void;
|
|
1
|
+
import { CommandPlugin } from './commands/command-plugin';
|
|
2
|
+
import { NarratPluginObject } from '../exports/plugins';
|
|
3
|
+
import { Parser } from '../types/parser';
|
|
4
|
+
import { DialogChoice } from '../stores/dialog-store';
|
|
5
|
+
export declare class VM {
|
|
6
|
+
plugins: NarratPluginObject<any>[];
|
|
7
|
+
commands: {
|
|
8
|
+
[key: string]: CommandPlugin<any>;
|
|
9
|
+
};
|
|
10
|
+
addCommand(command: CommandPlugin<any, any>): void;
|
|
11
|
+
addPlugin(plugin: NarratPluginObject<any>): void;
|
|
12
|
+
callHook(hookName: string, ...args: any[]): void;
|
|
13
|
+
}
|
|
14
|
+
export declare const vm: VM;
|
|
15
|
+
export declare function runCommand(expression: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<any>;
|
|
16
|
+
export declare function generateCommand(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<Parser.Command>;
|
|
17
|
+
export declare function runExpression<ReturnType = any>(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<ReturnType>;
|
|
18
|
+
export declare function playerAnswered(choice: string | number): Promise<any>;
|
|
19
|
+
export declare function finishGame(): void;
|