narrat 2.0.0-test-4 → 2.0.2

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.
Files changed (99) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +38 -38
  3. package/dist/app.vue.d.ts +106 -0
  4. package/dist/components/MainMenu.vue.d.ts +12 -0
  5. package/dist/components/Skills.vue.d.ts +22 -0
  6. package/dist/components/debug/debug-menu.vue.d.ts +48 -0
  7. package/dist/components/dialog-picture.vue.d.ts +9 -0
  8. package/dist/components/game-dialog.vue.d.ts +65 -0
  9. package/dist/components/hud.vue.d.ts +12 -0
  10. package/dist/components/inventory-ui.vue.d.ts +30 -0
  11. package/dist/components/loading-bar.vue.d.ts +10 -0
  12. package/dist/components/menu-buttons.vue.d.ts +26 -0
  13. package/dist/components/notification-toast.vue.d.ts +6 -0
  14. package/dist/components/quests-ui.vue.d.ts +20 -0
  15. package/dist/components/utils/modal.vue.d.ts +6 -0
  16. package/dist/components/volume-controls.vue.d.ts +7 -0
  17. package/dist/config.d.ts +151 -0
  18. package/dist/constants.d.ts +1 -0
  19. package/dist/data/characters.json +62 -62
  20. package/dist/data/config.json +182 -176
  21. package/dist/data/example.rpy +360 -356
  22. package/dist/data/refactor.rpy +30 -30
  23. package/dist/defaultConfig.d.ts +2 -0
  24. package/dist/demo/demo.d.ts +1 -0
  25. package/dist/dialog-box.vue.d.ts +37 -0
  26. package/dist/exports/config.d.ts +1 -0
  27. package/dist/exports/display.d.ts +2 -0
  28. package/dist/exports/plugins.d.ts +20 -0
  29. package/dist/fonts/OpenDyslexic.ttf.svg +2326 -2326
  30. package/dist/gameloop.d.ts +3 -0
  31. package/dist/lib/lib.d.ts +15 -0
  32. package/dist/lib.css +1 -1
  33. package/dist/main.d.ts +5 -0
  34. package/dist/narrat.es.js +19015 -21676
  35. package/dist/narrat.umd.js +112 -112
  36. package/dist/plugins/NarratPlugin.d.ts +11 -0
  37. package/dist/stores/audio-store.d.ts +12 -0
  38. package/dist/stores/dialog-store.d.ts +31 -0
  39. package/dist/stores/hud-stats-store.d.ts +22 -0
  40. package/dist/stores/inventory-store.d.ts +37 -0
  41. package/dist/stores/main-store.d.ts +276 -0
  42. package/dist/stores/notification-store.d.ts +12 -0
  43. package/dist/stores/quest-log.d.ts +39 -0
  44. package/dist/stores/rendering-store.d.ts +13 -0
  45. package/dist/stores/screens-store.d.ts +23 -0
  46. package/dist/stores/skills.d.ts +36 -0
  47. package/dist/stores/vm-store.d.ts +148 -0
  48. package/dist/types/app-types.d.ts +4 -0
  49. package/dist/types/character-types.d.ts +27 -0
  50. package/dist/types/dialog-box-types.d.ts +10 -0
  51. package/dist/types/game-save.d.ts +21 -0
  52. package/dist/types/parser.d.ts +92 -0
  53. package/dist/types/state.d.ts +3 -0
  54. package/dist/utils/ajax.d.ts +1 -0
  55. package/dist/utils/audio-loader.d.ts +13 -0
  56. package/dist/utils/characters.d.ts +5 -0
  57. package/dist/utils/data-helpers.d.ts +19 -0
  58. package/dist/utils/debounce.d.ts +14 -0
  59. package/dist/utils/error-handling.d.ts +3 -0
  60. package/dist/utils/helpers.d.ts +6 -0
  61. package/dist/utils/images-loader.d.ts +6 -0
  62. package/dist/utils/logger.d.ts +11 -0
  63. package/dist/utils/object-iterators.d.ts +8 -0
  64. package/dist/utils/promises.d.ts +1 -0
  65. package/dist/utils/randomId.d.ts +1 -0
  66. package/dist/utils/skillchecks.d.ts +17 -0
  67. package/dist/utils/string-helpers.d.ts +3 -0
  68. package/dist/utils/time-helpers.d.ts +2 -0
  69. package/dist/vm/commands/arithmetic-commands.d.ts +17 -0
  70. package/dist/vm/commands/audio-commands.d.ts +8 -0
  71. package/dist/vm/commands/choice.d.ts +37 -0
  72. package/dist/vm/commands/clear_dialog.d.ts +2 -0
  73. package/dist/vm/commands/command-helpers.d.ts +2 -0
  74. package/dist/vm/commands/command-plugin.d.ts +30 -0
  75. package/dist/vm/commands/flow-commands.d.ts +14 -0
  76. package/dist/vm/commands/if.d.ts +10 -0
  77. package/dist/vm/commands/index.d.ts +2 -0
  78. package/dist/vm/commands/inventory-commands.d.ts +15 -0
  79. package/dist/vm/commands/logic-command.d.ts +42 -0
  80. package/dist/vm/commands/notify.d.ts +4 -0
  81. package/dist/vm/commands/quest-commands.d.ts +30 -0
  82. package/dist/vm/commands/screen-commands.d.ts +8 -0
  83. package/dist/vm/commands/set.d.ts +6 -0
  84. package/dist/vm/commands/skill-commands.d.ts +33 -0
  85. package/dist/vm/commands/stats-commands.d.ts +12 -0
  86. package/dist/vm/commands/string-commands.d.ts +9 -0
  87. package/dist/vm/commands/text-field.d.ts +7 -0
  88. package/dist/vm/commands/text.d.ts +13 -0
  89. package/dist/vm/commands/wait.d.ts +4 -0
  90. package/dist/vm/vm-helpers.d.ts +16 -0
  91. package/dist/vm/vm-parser.d.ts +19 -0
  92. package/dist/vm/vm-parser.test.d.ts +1 -0
  93. package/dist/vm/vm.d.ts +19 -0
  94. package/package.json +79 -73
  95. package/CHANGELOG.md +0 -730
  96. package/dist/.DS_Store +0 -0
  97. package/dist/img/.DS_Store +0 -0
  98. package/dist/music/.DS_Store +0 -0
  99. package/dist/sounds/.DS_Store +0 -0
@@ -0,0 +1,27 @@
1
+ export interface CharactersConfigFile {
2
+ config: {
3
+ imagesPath: string;
4
+ };
5
+ characters: {
6
+ [key: string]: CharacterData;
7
+ };
8
+ }
9
+ export interface CharacterData {
10
+ sprites?: {
11
+ [key: string]: string;
12
+ };
13
+ name: string;
14
+ style?: DialogStyle;
15
+ }
16
+ export interface DialogStyle {
17
+ color?: string;
18
+ boxCss?: {
19
+ [key: string]: any;
20
+ };
21
+ nameCss?: {
22
+ [key: string]: any;
23
+ };
24
+ textCss?: {
25
+ [key: string]: any;
26
+ };
27
+ }
@@ -0,0 +1,10 @@
1
+ import { DialogChoice } from '../stores/dialog-store';
2
+ export interface DialogBoxParameters {
3
+ title: string;
4
+ text: string;
5
+ styleId: string;
6
+ choices: DialogChoice[];
7
+ textField?: boolean;
8
+ old: boolean;
9
+ interactive: boolean;
10
+ }
@@ -0,0 +1,21 @@
1
+ import { AudioSave } from '../stores/audio-store';
2
+ import { DialogSave } from '../stores/dialog-store';
3
+ import { HudSave } from '../stores/hud-stats-store';
4
+ import { InventorySave } from '../stores/inventory-store';
5
+ import { MainSaveData } from '../stores/main-store';
6
+ import { QuestLogSave } from '../stores/quest-log';
7
+ import { ScreenSave } from '../stores/screens-store';
8
+ import { SkillsSave } from '../stores/skills';
9
+ import { VMSave } from '../stores/vm-store';
10
+ export declare type GameSave = {
11
+ version: string;
12
+ skills: SkillsSave;
13
+ screen: ScreenSave;
14
+ main: MainSaveData;
15
+ dialog: DialogSave;
16
+ vm: VMSave;
17
+ audio: AudioSave;
18
+ hud: HudSave;
19
+ inventory: InventorySave;
20
+ quests: QuestLogSave;
21
+ };
@@ -0,0 +1,92 @@
1
+ export declare namespace Parser {
2
+ type Primitive = string | number | boolean;
3
+ type Expression = Array<Primitive | Expression>;
4
+ interface IfOptions {
5
+ condition: string;
6
+ success: Branch;
7
+ failure?: Branch;
8
+ }
9
+ interface ChoiceOptions {
10
+ prompt: ParsedExpression;
11
+ choices: ChoicePrompt[];
12
+ }
13
+ interface ChoicePrompt {
14
+ choice: string;
15
+ branch: Branch;
16
+ condition?: string;
17
+ skillCheck?: SkillCheckOptions;
18
+ index: number;
19
+ }
20
+ interface PlayOptions {
21
+ mode: 'sound' | 'music';
22
+ audio: string;
23
+ }
24
+ interface StopOptions {
25
+ mode: 'sound' | 'music';
26
+ audio?: string;
27
+ }
28
+ interface SkillCheckOptions {
29
+ id: string;
30
+ skill: string;
31
+ value: number;
32
+ hideAfterRoll: boolean;
33
+ success: Branch;
34
+ failure: Branch;
35
+ }
36
+ interface JumpOptions {
37
+ label: string;
38
+ }
39
+ interface WaitOptions {
40
+ duration: number;
41
+ }
42
+ interface TextOptions {
43
+ text: string;
44
+ }
45
+ interface SetScreenOption {
46
+ screen: string;
47
+ }
48
+ interface EmptyOptions {
49
+ }
50
+ type DefaultArg = {
51
+ [key: string]: Arg;
52
+ };
53
+ type CommandOptions<T = DefaultArg> = T;
54
+ interface Command<Options = CommandOptions, StaticOptions = {}> {
55
+ args: Arg[];
56
+ commandType: string;
57
+ options: Options;
58
+ code: string;
59
+ staticOptions: StaticOptions;
60
+ operator: string;
61
+ line: number;
62
+ fileName: string;
63
+ }
64
+ type Arg = ParsedExpression | Primitive;
65
+ interface ParsedExpression<Options = CommandOptions, StaticOptions = {}> {
66
+ code: string;
67
+ command: {
68
+ commandType: string;
69
+ operator: string;
70
+ args: Arg[];
71
+ options: Options;
72
+ staticOptions: StaticOptions;
73
+ };
74
+ fileName: string;
75
+ line: number;
76
+ }
77
+ type Branch = ParsedExpression[];
78
+ interface ParsedScript {
79
+ [key: string]: ParsedLabel;
80
+ }
81
+ interface ParsedLabel {
82
+ branch: Parser.Branch;
83
+ args?: string[];
84
+ }
85
+ interface Line {
86
+ code: string;
87
+ indentation: number;
88
+ line: number;
89
+ expression: Expression;
90
+ branch?: Line[];
91
+ }
92
+ }
@@ -0,0 +1,3 @@
1
+ export interface Vue {
2
+ $mq: 'sm' | 'md' | 'lg';
3
+ }
@@ -0,0 +1 @@
1
+ export declare function getFile(url: string): Promise<string>;
@@ -0,0 +1,13 @@
1
+ import { Config, MusicConfig, AudioConfig } from '../config';
2
+ import { Howl } from 'howler';
3
+ export declare const audio: {
4
+ [key: string]: Howl;
5
+ };
6
+ export declare function loadAudioAssets(config: Config): Promise<void[]>;
7
+ export declare function audioEvent(event: string): void;
8
+ export declare function loadAudio(key: string, config: AudioConfig | MusicConfig): Promise<void>;
9
+ export declare function changeMusic(newMusic: string): Promise<void>;
10
+ export declare function playAudio(key: string): number | undefined;
11
+ export declare function getAudio(key: string): Howl | undefined;
12
+ export declare function stopAudio(key: string): void;
13
+ export declare function pauseAudio(key: string): void;
@@ -0,0 +1,5 @@
1
+ import { CharacterData, CharactersConfigFile, DialogStyle } from '../types/character-types';
2
+ export declare function setCharactersConfig(data: CharactersConfigFile): void;
3
+ export declare function getCharacterInfo(character: string): CharacterData;
4
+ export declare function getCharacterPictureUrl(character: string, pose?: string): string | undefined;
5
+ export declare function getCharacterStyle(character?: string): DialogStyle;
@@ -0,0 +1,19 @@
1
+ export declare function findDataHelper<T>(sourceObj: any, path: string): [T, string];
2
+ export declare function findDataHelperWithoutAutoCreate<T>(sourceObj: any, path: string): [T, string] | undefined;
3
+ export declare function setDataHelper<T>(sourceObj: any, path: string, value: T): void;
4
+ export declare function addDataHelper<T>(sourceObj: any, path: string, value: T): void;
5
+ export declare function getModifiableDataPinia(): {
6
+ data: import("../stores/vm-store").DataState;
7
+ skills: import("../stores/skills").SkillsState;
8
+ buttons: import("../stores/screens-store").ButtonsState;
9
+ items: {
10
+ [key: string]: import("../stores/inventory-store").ItemState;
11
+ };
12
+ quests: {
13
+ [key: string]: import("../stores/quest-log").QuestState;
14
+ };
15
+ stats: import("../stores/hud-stats-store").HudStatsState;
16
+ scope: {
17
+ [key: string]: any;
18
+ };
19
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A function that emits a side effect.
3
+ */
4
+ export declare type Procedure = (...args: any[]) => any;
5
+ export declare type Options<TT> = {
6
+ isImmediate?: boolean;
7
+ maxWait?: number;
8
+ callback?: (data: TT) => void;
9
+ };
10
+ export interface DebouncedFunction<F extends Procedure> {
11
+ (this: ThisParameterType<F>, ...args: Parameters<F>): Promise<ReturnType<F>>;
12
+ cancel: (reason?: any) => void;
13
+ }
14
+ export declare function debounce<F extends Procedure>(func: F, waitMilliseconds?: number, options?: Options<ReturnType<F>>): DebouncedFunction<F>;
@@ -0,0 +1,3 @@
1
+ import { ParserContext } from '../vm/vm-parser';
2
+ export declare function parserError(ctx: ParserContext, line: number, text: string): void;
3
+ export declare function error(text: string): void;
@@ -0,0 +1,6 @@
1
+ export declare function aspectRatioFit(screenWidth: number, screenHeight: number, gameWidth: number, gameHeight: number): number;
2
+ export declare function screenToCanvas(x: number, y: number, element: HTMLCanvasElement): {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export declare function aabb(ax: number, ay: number, aw: number, ah: number, bx: number, by: number, bw: number, bh: number): boolean;
@@ -0,0 +1,6 @@
1
+ import { Config } from '../config';
2
+ export declare const images: {
3
+ [key: string]: HTMLImageElement;
4
+ };
5
+ export declare function loadImages(config: Config): Promise<void>;
6
+ export declare function loadImage(key: string, path: string, resolver: any, rejecter: any): void;
@@ -0,0 +1,11 @@
1
+ export declare class LogManager {
2
+ debug: boolean;
3
+ logger: {
4
+ [key: string]: (...args: any[]) => void;
5
+ };
6
+ setupDebugger(debug: boolean): void;
7
+ }
8
+ export declare const logManager: LogManager;
9
+ export declare const logger: {
10
+ [key: string]: (...args: any[]) => void;
11
+ };
@@ -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) => true | undefined;
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 @@
1
+ export declare function timeout(durationMs: number): Promise<unknown>;
@@ -0,0 +1 @@
1
+ export declare function randomId(): string;
@@ -0,0 +1,17 @@
1
+ import { SkillCheckParams } from '../vm/vm-helpers';
2
+ export declare function getSkillCheckDifficultyScore(value: number, level: number): number;
3
+ export declare function getSkillCheckDifficultyText(value: number, level: number): string;
4
+ export declare function getSkillCheckText({ skill, skillCheckId, value, }: {
5
+ skill: string;
6
+ skillCheckId: string;
7
+ value: number;
8
+ }): {
9
+ difficultyText: string;
10
+ allowed: boolean;
11
+ };
12
+ export declare function getPassiveSkillCheckText(success: boolean, params: SkillCheckParams): string;
13
+ export declare function calculateSkillCheckRoll(skill: string): {
14
+ roll: number;
15
+ unmodifiedRoll: number;
16
+ };
17
+ export declare function resolveSkillCheck(params: SkillCheckParams): boolean;
@@ -0,0 +1,3 @@
1
+ export declare function processText(text: string): string;
2
+ export declare const stringRegex: RegExp;
3
+ export declare const isParsedTokenString: (arg: any) => boolean;
@@ -0,0 +1,2 @@
1
+ export declare function getPlayTime(startedAt: number, previousTime: number): number;
2
+ export declare function toHHMMSS(time: number | string): string;
@@ -0,0 +1,17 @@
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const additionPlugin: CommandPlugin<{
3
+ a: number;
4
+ b: number;
5
+ }, {}>;
6
+ export declare const substractionPlugin: CommandPlugin<{
7
+ a: number;
8
+ b: number;
9
+ }, {}>;
10
+ export declare const multiplicationPlugin: CommandPlugin<{
11
+ a: number;
12
+ b: number;
13
+ }, {}>;
14
+ export declare const divisionPlugin: CommandPlugin<{
15
+ a: number;
16
+ b: number;
17
+ }, {}>;
@@ -0,0 +1,8 @@
1
+ import { CommandPlugin } from './command-plugin';
2
+ export interface PlayCommandArgs {
3
+ mode: string;
4
+ audio: string;
5
+ }
6
+ export declare const playCommand: CommandPlugin<PlayCommandArgs, {}>;
7
+ export declare const pauseCommand: CommandPlugin<PlayCommandArgs, {}>;
8
+ export declare const stopCommand: CommandPlugin<PlayCommandArgs, {}>;
@@ -0,0 +1,37 @@
1
+ import { CommandParserFunction, CommandParsingContext, CommandPlugin, CommandRunner } from './command-plugin';
2
+ import { Parser } from '../../types/parser';
3
+ export declare const runChoice: CommandRunner<ChoiceOptions, StaticChoiceOptions>;
4
+ export declare function parseChoiceOption(ctx: CommandParsingContext, choice: Parser.Line, index: number): BranchingChoiceInfo;
5
+ export interface BranchingChoiceInfo {
6
+ prompt: Parser.ParsedExpression;
7
+ branch?: Parser.Branch;
8
+ skillBranches?: {
9
+ success: Parser.Branch;
10
+ failure: Parser.Branch;
11
+ };
12
+ }
13
+ export interface StaticChoiceOptions {
14
+ choices: BranchingChoiceInfo[];
15
+ prompt: Parser.ParsedExpression;
16
+ }
17
+ export interface ChoiceOptions {
18
+ }
19
+ export declare const choiceParser: CommandParserFunction<ChoiceOptions, StaticChoiceOptions>;
20
+ export declare const choicePlugin: CommandPlugin<ChoiceOptions, StaticChoiceOptions>;
21
+ export interface ChoicePromptOptions {
22
+ promptText: string;
23
+ condition: boolean;
24
+ }
25
+ export interface ChoicePromptReturnValue {
26
+ text: string | null;
27
+ skillCheck?: {
28
+ allowed: boolean;
29
+ skillId: string;
30
+ skillCheckId: string;
31
+ difficulty: number;
32
+ hideAfterRoll: boolean;
33
+ };
34
+ }
35
+ export declare type ChoicePromptReturn = ChoicePromptReturnValue;
36
+ /** Custom "fake" instruction generated on choice prompts to process their optional conditions */
37
+ export declare const choicePromptCommandPlugin: CommandPlugin<ChoicePromptOptions, {}>;
@@ -0,0 +1,2 @@
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const clearDialogPlugin: CommandPlugin<{}, {}>;
@@ -0,0 +1,2 @@
1
+ import { Parser } from '../../types/parser';
2
+ export declare function commandRuntimeError(cmd: Parser.Command<any, any>, errorText: string): void;
@@ -0,0 +1,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 class CommandPlugin<Options, StaticOptions = {}> {
17
+ keyword: string;
18
+ runner: CommandRunner<Options, StaticOptions>;
19
+ argTypes: ArgTypes;
20
+ parser: CommandParserFunction<Options, StaticOptions>;
21
+ onPlayerAnswered?: (cmd: Parser.Command<Options, StaticOptions>, choice: number | string) => Promise<void>;
22
+ constructor(keyword: string, argTypes: ArgTypes, runner: CommandRunner<Options, StaticOptions>, parser?: CommandParserFunction<Options, StaticOptions>);
23
+ }
24
+ export declare type ArgTypes = ArgumentDescription[] | 'any';
25
+ export interface ArgumentDescription {
26
+ name: string;
27
+ type: 'string' | 'number' | 'boolean' | 'any';
28
+ optional?: boolean;
29
+ }
30
+ export declare function generateParser<Options, StaticOptions = {}>(keyword: string, argTypes: ArgTypes): CommandParserFunction<Options, StaticOptions>;
@@ -0,0 +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
+ }, {}>;
@@ -0,0 +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>;
@@ -0,0 +1,2 @@
1
+ import { VM } from '../vm';
2
+ export declare function registerBaseCommands(vm: VM): void;
@@ -0,0 +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
+ }, {}>;
@@ -0,0 +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
+ }, {}>;
@@ -0,0 +1,4 @@
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const notifyPlugin: CommandPlugin<{
3
+ text: string;
4
+ }, {}>;
@@ -0,0 +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
+ }, {}>;
@@ -0,0 +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
+ }, {}>;
@@ -0,0 +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
+ }, {}>;
@@ -0,0 +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, {}>;
@@ -0,0 +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
+ }, {}>;
@@ -0,0 +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
+ }, {}>;
@@ -0,0 +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
+ }, {}>;
@@ -0,0 +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
+ }>;
@@ -0,0 +1,4 @@
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const waitCommand: CommandPlugin<{
3
+ duration: number;
4
+ }, {}>;
@@ -0,0 +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;