narrat 2.0.11 → 2.0.12

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 (104) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +105 -105
  3. package/dist/app.vue.d.ts +96 -96
  4. package/dist/components/MainMenu.vue.d.ts +12 -12
  5. package/dist/components/Skills.vue.d.ts +22 -22
  6. package/dist/components/debug/debug-menu.vue.d.ts +48 -48
  7. package/dist/components/dialog-picture.vue.d.ts +9 -9
  8. package/dist/components/game-dialog.vue.d.ts +65 -65
  9. package/dist/components/hud.vue.d.ts +12 -12
  10. package/dist/components/inventory-ui.vue.d.ts +30 -30
  11. package/dist/components/loading-bar.vue.d.ts +10 -10
  12. package/dist/components/menu-buttons.vue.d.ts +26 -26
  13. package/dist/components/notification-toast.vue.d.ts +6 -6
  14. package/dist/components/quests-ui.vue.d.ts +20 -20
  15. package/dist/components/screen-layer.vue.d.ts +54 -0
  16. package/dist/components/screens.vue.d.ts +46 -46
  17. package/dist/components/utils/modal.vue.d.ts +6 -6
  18. package/dist/components/volume-controls.vue.d.ts +7 -7
  19. package/dist/config.d.ts +158 -158
  20. package/dist/constants.d.ts +1 -1
  21. package/dist/data/characters.json +62 -62
  22. package/dist/data/config.json +187 -184
  23. package/dist/data/example.rpy +369 -367
  24. package/dist/data/refactor.rpy +30 -30
  25. package/dist/defaultConfig.d.ts +2 -2
  26. package/dist/demo/demo.d.ts +1 -1
  27. package/dist/dialog-box.vue.d.ts +37 -37
  28. package/dist/exports/config.d.ts +1 -1
  29. package/dist/exports/display.d.ts +2 -2
  30. package/dist/exports/plugins.d.ts +20 -20
  31. package/dist/fonts/OpenDyslexic.ttf.svg +2326 -2326
  32. package/dist/img/backgrounds/test-layers.gif +0 -0
  33. package/dist/lib/lib.d.ts +15 -15
  34. package/dist/lib.css +1 -1
  35. package/dist/main.d.ts +5 -5
  36. package/dist/narrat.es.js +135 -85
  37. package/dist/narrat.es.js.map +1 -1
  38. package/dist/narrat.umd.js +71 -70
  39. package/dist/narrat.umd.js.map +1 -1
  40. package/dist/plugins/NarratPlugin.d.ts +11 -11
  41. package/dist/stores/audio-store.d.ts +12 -12
  42. package/dist/stores/dialog-store.d.ts +31 -31
  43. package/dist/stores/hud-stats-store.d.ts +22 -22
  44. package/dist/stores/inventory-store.d.ts +37 -37
  45. package/dist/stores/main-store.d.ts +339 -338
  46. package/dist/stores/notification-store.d.ts +12 -12
  47. package/dist/stores/quest-log.d.ts +39 -39
  48. package/dist/stores/rendering-store.d.ts +13 -13
  49. package/dist/stores/screens-store.d.ts +23 -22
  50. package/dist/stores/skills.d.ts +36 -36
  51. package/dist/stores/vm-store.d.ts +155 -155
  52. package/dist/types/app-types.d.ts +4 -4
  53. package/dist/types/character-types.d.ts +27 -27
  54. package/dist/types/dialog-box-types.d.ts +10 -10
  55. package/dist/types/game-save.d.ts +21 -21
  56. package/dist/types/parser.d.ts +93 -93
  57. package/dist/types/state.d.ts +3 -3
  58. package/dist/utils/ajax.d.ts +1 -1
  59. package/dist/utils/audio-loader.d.ts +13 -13
  60. package/dist/utils/characters.d.ts +5 -5
  61. package/dist/utils/data-helpers.d.ts +19 -19
  62. package/dist/utils/debounce.d.ts +14 -14
  63. package/dist/utils/error-handling.d.ts +3 -3
  64. package/dist/utils/helpers.d.ts +6 -6
  65. package/dist/utils/images-loader.d.ts +6 -6
  66. package/dist/utils/logger.d.ts +11 -11
  67. package/dist/utils/object-iterators.d.ts +8 -8
  68. package/dist/utils/promises.d.ts +1 -1
  69. package/dist/utils/randomId.d.ts +1 -1
  70. package/dist/utils/save-helpers.d.ts +3 -3
  71. package/dist/utils/skillchecks.d.ts +17 -17
  72. package/dist/utils/string-helpers.d.ts +3 -3
  73. package/dist/utils/time-helpers.d.ts +2 -2
  74. package/dist/vm/commands/arithmetic-commands.d.ts +17 -17
  75. package/dist/vm/commands/audio-commands.d.ts +8 -8
  76. package/dist/vm/commands/choice.d.ts +37 -37
  77. package/dist/vm/commands/clear_dialog.d.ts +2 -2
  78. package/dist/vm/commands/command-helpers.d.ts +2 -2
  79. package/dist/vm/commands/command-plugin.d.ts +43 -43
  80. package/dist/vm/commands/flow-commands.d.ts +14 -14
  81. package/dist/vm/commands/if.d.ts +10 -10
  82. package/dist/vm/commands/index.d.ts +2 -2
  83. package/dist/vm/commands/inventory-commands.d.ts +15 -15
  84. package/dist/vm/commands/logic-command.d.ts +42 -42
  85. package/dist/vm/commands/notify.d.ts +4 -4
  86. package/dist/vm/commands/quest-commands.d.ts +30 -30
  87. package/dist/vm/commands/screen-commands.d.ts +12 -8
  88. package/dist/vm/commands/set.d.ts +6 -6
  89. package/dist/vm/commands/skill-commands.d.ts +33 -33
  90. package/dist/vm/commands/stats-commands.d.ts +12 -12
  91. package/dist/vm/commands/string-commands.d.ts +9 -9
  92. package/dist/vm/commands/text-field.d.ts +7 -7
  93. package/dist/vm/commands/text.d.ts +13 -13
  94. package/dist/vm/commands/wait.d.ts +4 -4
  95. package/dist/vm/vm-helpers.d.ts +16 -16
  96. package/dist/vm/vm-parser.d.ts +19 -19
  97. package/dist/vm/vm-parser.test.d.ts +1 -1
  98. package/dist/vm/vm.d.ts +19 -19
  99. package/package.json +79 -79
  100. package/CHANGELOG.md +0 -844
  101. package/dist/.DS_Store +0 -0
  102. package/dist/img/.DS_Store +0 -0
  103. package/dist/music/.DS_Store +0 -0
  104. package/dist/sounds/.DS_Store +0 -0
@@ -1,21 +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
- };
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
+ };
@@ -1,93 +1,93 @@
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
- finishCommand?: (res: any) => void;
64
- }
65
- type Arg = ParsedExpression | Primitive;
66
- interface ParsedExpression<Options = CommandOptions, StaticOptions = {}> {
67
- code: string;
68
- command: {
69
- commandType: string;
70
- operator: string;
71
- args: Arg[];
72
- options: Options;
73
- staticOptions: StaticOptions;
74
- };
75
- fileName: string;
76
- line: number;
77
- }
78
- type Branch = ParsedExpression[];
79
- interface ParsedScript {
80
- [key: string]: ParsedLabel;
81
- }
82
- interface ParsedLabel {
83
- branch: Parser.Branch;
84
- args?: string[];
85
- }
86
- interface Line {
87
- code: string;
88
- indentation: number;
89
- line: number;
90
- expression: Expression;
91
- branch?: Line[];
92
- }
93
- }
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
+ finishCommand?: (res: any) => void;
64
+ }
65
+ type Arg = ParsedExpression | Primitive;
66
+ interface ParsedExpression<Options = CommandOptions, StaticOptions = {}> {
67
+ code: string;
68
+ command: {
69
+ commandType: string;
70
+ operator: string;
71
+ args: Arg[];
72
+ options: Options;
73
+ staticOptions: StaticOptions;
74
+ };
75
+ fileName: string;
76
+ line: number;
77
+ }
78
+ type Branch = ParsedExpression[];
79
+ interface ParsedScript {
80
+ [key: string]: ParsedLabel;
81
+ }
82
+ interface ParsedLabel {
83
+ branch: Parser.Branch;
84
+ args?: string[];
85
+ }
86
+ interface Line {
87
+ code: string;
88
+ indentation: number;
89
+ line: number;
90
+ expression: Expression;
91
+ branch?: Line[];
92
+ }
93
+ }
@@ -1,3 +1,3 @@
1
- export interface Vue {
2
- $mq: 'sm' | 'md' | 'lg';
3
- }
1
+ export interface Vue {
2
+ $mq: 'sm' | 'md' | 'lg';
3
+ }
@@ -1 +1 @@
1
- export declare function getFile(url: string): Promise<string>;
1
+ export declare function getFile(url: string): Promise<string>;
@@ -1,13 +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;
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;
@@ -1,5 +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;
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;
@@ -1,19 +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
- };
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
+ };
@@ -1,14 +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>;
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>;
@@ -1,3 +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;
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;
@@ -1,6 +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;
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;
@@ -1,6 +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;
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;
@@ -1,11 +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
- };
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
+ };
@@ -1,8 +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
- };
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
+ };
@@ -1 +1 @@
1
- export declare function timeout(durationMs: number): Promise<unknown>;
1
+ export declare function timeout(durationMs: number): Promise<unknown>;
@@ -1 +1 @@
1
- export declare function randomId(): string;
1
+ export declare function randomId(): string;
@@ -1,3 +1,3 @@
1
- import { GameSave } from '../types/game-save';
2
- export declare function getSave(): GameSave;
3
- export declare function saveGame(object: GameSave): void;
1
+ import { GameSave } from '../types/game-save';
2
+ export declare function getSave(): GameSave;
3
+ export declare function saveGame(object: GameSave): void;
@@ -1,17 +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;
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;
@@ -1,3 +1,3 @@
1
- export declare function processText(text: string): string;
2
- export declare const stringRegex: RegExp;
3
- export declare const isParsedTokenString: (arg: any) => boolean;
1
+ export declare function processText(text: string): string;
2
+ export declare const stringRegex: RegExp;
3
+ export declare const isParsedTokenString: (arg: any) => boolean;
@@ -1,2 +1,2 @@
1
- export declare function getPlayTime(startedAt: number, previousTime: number): number;
2
- export declare function toHHMMSS(time: number | string): string;
1
+ export declare function getPlayTime(startedAt: number, previousTime: number): number;
2
+ export declare function toHHMMSS(time: number | string): string;
@@ -1,17 +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
- }, {}>;
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
+ }, {}>;
@@ -1,8 +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, {}>;
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, {}>;
@@ -1,37 +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, {}>;
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, {}>;
@@ -1,2 +1,2 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const clearDialogPlugin: CommandPlugin<{}, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const clearDialogPlugin: CommandPlugin<{}, {}>;
@@ -1,2 +1,2 @@
1
- import { Parser } from '../../types/parser';
2
- export declare function commandRuntimeError(cmd: Parser.Command<any, any>, errorText: string): void;
1
+ import { Parser } from '../../types/parser';
2
+ export declare function commandRuntimeError(cmd: Parser.Command<any, any>, errorText: string): void;