narrat 2.9.3 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +136 -128
- package/dist/app.vue.d.ts +78 -78
- package/dist/components/MainMenu.vue.d.ts +7 -7
- package/dist/components/SkillsWindow.vue.d.ts +28 -28
- package/dist/components/StartMenu.vue.d.ts +46 -46
- package/dist/components/auto-play/AutoPlayFeedback.vue.d.ts +46 -46
- package/dist/components/debug/debug-menu.vue.d.ts +51 -51
- package/dist/components/dialog-picture.vue.d.ts +11 -11
- package/dist/components/engine-splash/engine-splash.vue.d.ts +54 -54
- package/dist/components/game-dialog.vue.d.ts +65 -65
- package/dist/components/game-splash/game-splash.vue.d.ts +46 -46
- package/dist/components/hud.vue.d.ts +20 -20
- package/dist/components/in-game.vue.d.ts +46 -46
- package/dist/components/inventory/inventory-section.vue.d.ts +61 -61
- package/dist/components/inventory/item-details.vue.d.ts +76 -76
- package/dist/components/inventory-ui.vue.d.ts +39 -39
- package/dist/components/loading-bar.vue.d.ts +10 -10
- package/dist/components/menu-buttons.vue.d.ts +46 -46
- package/dist/components/notification-toast.vue.d.ts +6 -6
- package/dist/components/quests/QuestDetails.vue.d.ts +64 -64
- package/dist/components/quests/QuestDisplay.vue.d.ts +64 -64
- package/dist/components/quests/quests-list-section.vue.d.ts +75 -75
- package/dist/components/quests-ui.vue.d.ts +22 -22
- package/dist/components/save-slots.vue.d.ts +79 -79
- package/dist/components/saves/save-slot-ui.vue.d.ts +108 -108
- package/dist/components/screen-layer.vue.d.ts +76 -76
- package/dist/components/screen-objects/screen-object.vue.d.ts +68 -0
- package/dist/components/screens.vue.d.ts +46 -46
- package/dist/components/tabs/TabsController.vue.d.ts +72 -72
- package/dist/components/tabs/tab-selector.vue.d.ts +82 -82
- package/dist/components/tooltips/tooltips-ui.vue.d.ts +46 -46
- package/dist/components/transitions/NarratTransition.vue.d.ts +97 -97
- package/dist/components/utils/alert-modal.vue.d.ts +82 -82
- package/dist/components/utils/floating-tooltip.vue.d.ts +62 -62
- package/dist/components/utils/modal-window.vue.d.ts +18 -18
- package/dist/components/utils/yes-no.vue.d.ts +106 -106
- package/dist/components/volume-controls.vue.d.ts +18 -18
- package/dist/config/audio-config.d.ts +58 -58
- package/dist/config/buttons-config.d.ts +68 -64
- package/dist/config/characters-config.d.ts +36 -0
- package/dist/config/common-config.d.ts +80 -80
- package/dist/config/config-input.d.ts +231 -213
- package/dist/config/config-output.d.ts +232 -212
- package/dist/config/items-config.d.ts +71 -71
- package/dist/config/layout-config.d.ts +26 -26
- package/dist/config/quests-config.d.ts +48 -48
- package/dist/config/screens-config.d.ts +133 -128
- package/dist/config/skills-config.d.ts +70 -70
- package/dist/config/tooltips-config.d.ts +15 -15
- package/dist/config.d.ts +182 -164
- package/dist/constants.d.ts +12 -12
- package/dist/demo/demo.d.ts +1 -1
- package/dist/dialog-box.vue.d.ts +71 -71
- package/dist/exports/components.d.ts +2 -2
- package/dist/exports/config.d.ts +1 -1
- package/dist/exports/display.d.ts +2 -2
- package/dist/exports/events.d.ts +1 -1
- package/dist/exports/others.d.ts +1 -1
- package/dist/exports/plugins.d.ts +47 -38
- package/dist/exports/stores.d.ts +11 -11
- package/dist/favicon.svg +30 -30
- package/dist/gamepad/gamepad.d.ts +1 -1
- package/dist/hooks/util-hooks.d.ts +1 -0
- package/dist/lib.d.ts +18 -18
- package/dist/main.d.ts +6 -6
- package/dist/menu-buttons/menu-buttons.d.ts +7 -7
- package/dist/narrat.es.js +15682 -15571
- package/dist/narrat.es.js.map +1 -1
- package/dist/narrat.umd.js +119 -119
- package/dist/narrat.umd.js.map +1 -1
- package/dist/plugins/NarratPlugin.d.ts +11 -11
- package/dist/stores/audio-store.d.ts +56 -56
- package/dist/stores/config-store.d.ts +6 -6
- package/dist/stores/dialog-store.d.ts +35 -35
- package/dist/stores/hud-stats-store.d.ts +20 -20
- package/dist/stores/inventory-store.d.ts +49 -49
- package/dist/stores/main-store.d.ts +1627 -1797
- package/dist/stores/menu-store.d.ts +45 -45
- package/dist/stores/notification-store.d.ts +15 -15
- package/dist/stores/quest-log.d.ts +37 -37
- package/dist/stores/rendering-store.d.ts +20 -19
- package/dist/stores/screen-objects-store.d.ts +67 -0
- package/dist/stores/screens-store.d.ts +34 -33
- package/dist/stores/skills.d.ts +39 -39
- package/dist/stores/tooltip-store.d.ts +18 -18
- package/dist/stores/vm-store.d.ts +181 -181
- package/dist/style.css +1 -1
- package/dist/types/app-types.d.ts +8 -9
- package/dist/types/dialog-box-types.d.ts +11 -11
- package/dist/types/game-save.d.ts +40 -40
- package/dist/types/parser.d.ts +93 -93
- package/dist/types/state.d.ts +3 -3
- package/dist/utils/InputsListener.d.ts +9 -9
- package/dist/utils/ajax.d.ts +2 -2
- package/dist/utils/audio-loader.d.ts +10 -10
- package/dist/utils/characters.d.ts +4 -5
- package/dist/utils/data-helpers.d.ts +31 -32
- package/dist/utils/data-helpers.test.d.ts +1 -1
- package/dist/utils/debounce.d.ts +14 -14
- package/dist/utils/error-handling.d.ts +4 -4
- package/dist/utils/getWindow.d.ts +1 -1
- package/dist/utils/helpers.d.ts +6 -6
- package/dist/utils/images-loader.d.ts +7 -7
- package/dist/utils/logger.d.ts +11 -11
- package/dist/utils/object-iterators.d.ts +9 -9
- package/dist/utils/promises.d.ts +1 -1
- package/dist/utils/randomId.d.ts +1 -1
- package/dist/utils/save-helpers.d.ts +16 -16
- package/dist/utils/skillchecks.d.ts +17 -17
- package/dist/utils/string-helpers.d.ts +5 -5
- package/dist/utils/time-helpers.d.ts +2 -2
- package/dist/utils/tooltip-utils.d.ts +2 -2
- package/dist/utils/transition.d.ts +21 -21
- package/dist/utils/type-utils.d.ts +2 -2
- package/dist/utils/typed-emitter.d.ts +18 -18
- package/dist/utils/viewport-utils.d.ts +3 -0
- package/dist/utils/vue-directives.d.ts +2 -2
- package/dist/vm/commands/arithmetic-commands.d.ts +23 -23
- package/dist/vm/commands/array-commands.d.ts +42 -42
- package/dist/vm/commands/audio-commands.d.ts +15 -15
- package/dist/vm/commands/choice.d.ts +38 -38
- package/dist/vm/commands/clear_dialog.d.ts +2 -2
- package/dist/vm/commands/command-helpers.d.ts +3 -3
- package/dist/vm/commands/command-plugin.d.ts +43 -43
- package/dist/vm/commands/flow-commands.d.ts +27 -27
- 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/math-commands.d.ts +30 -30
- package/dist/vm/commands/notify.d.ts +6 -6
- package/dist/vm/commands/quest-commands.d.ts +30 -30
- package/dist/vm/commands/random-commands.d.ts +13 -13
- package/dist/vm/commands/screen-commands.d.ts +18 -18
- package/dist/vm/commands/set.d.ts +6 -6
- package/dist/vm/commands/skill-commands.d.ts +33 -33
- package/dist/vm/commands/sprite-commands.d.ts +16 -9
- 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 +14 -14
- package/dist/vm/commands/time-commands.d.ts +16 -16
- package/dist/vm/commands/util-commands.d.ts +4 -4
- package/dist/vm/commands/wait.d.ts +4 -4
- package/dist/vm/vm-helpers.d.ts +19 -19
- 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 +21 -21
- package/package.json +2 -2
- package/dist/stores/sprites-store.d.ts +0 -54
- package/dist/types/character-types.d.ts +0 -27
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Liana Pigeot
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Liana Pigeot
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,128 +1,136 @@
|
|
|
1
|
-
# 🚀 Narrat
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
The
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- `
|
|
90
|
-
- `
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
1
|
+
# 🚀 Narrat
|
|
2
|
+
|
|
3
|
+
 [](https://app.netlify.com/sites/ornate-pie-561978/deploys)
|
|
4
|
+
|
|
5
|
+
Work on the engine directly in Codeflow:
|
|
6
|
+
|
|
7
|
+
[](https://pr.new/liana-p/narrat-engine)
|
|
8
|
+
|
|
9
|
+
Or try editing the default narrat game easily:
|
|
10
|
+
|
|
11
|
+
[](https:///pr.new/github.com/liana-p/narrat-engine/edit/main/packages/narrat/examples/games/default/scripts/default.nar)
|
|
12
|
+
|
|
13
|
+
Narrat is a game engine for making interactive narrative RPGs packed with features.. Create your game by editing with a Simple scripting syntax. It supports Skills with skill check rolls, an Items inventory, and has a Quests System. The script system is very powerful and allows branching choices, functions, variables and conditions.
|
|
14
|
+
|
|
15
|
+
More info on the [narrat website](https://get-narrat.com). There is an [online demo](https://get-narrat.com/demo/) available to try in the browser.
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
The best way to get started in a minute is to follow the [Getting Started](https://docs.get-narrat.com/guides/getting-started) documentation page. It shows you to download the ready-to-use game template to get started writing a game with narrat.
|
|
20
|
+
|
|
21
|
+
## Development (for contributors)
|
|
22
|
+
|
|
23
|
+
Note: Narrat is a monorepo using `pnpm` as package manager. The `packages` folder contains the individual packages, including the main `narrat` package.
|
|
24
|
+
|
|
25
|
+
Narrat is written in [TypeScript](https://www.typescriptlang.org/). It uses the [Vue](https://vuejs.org/) framework for front-end development. It also uses [pinia](https://pinia.vuejs.org/) for state management
|
|
26
|
+
|
|
27
|
+
### Requirements
|
|
28
|
+
|
|
29
|
+
- [node.js](https://nodejs.org/en/) (Downloading LTS is fine)
|
|
30
|
+
- [pnpm](https://pnpm.io/). This Narrat repo is a monorepo using pnpm workspaces to easily manage the different packages.
|
|
31
|
+
- A text editor capable of editing a TypeScript and Vue.js project. Recommended: [VSCode](https://code.visualstudio.com/) and the extension [Volar](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-volar) for Vue.
|
|
32
|
+
|
|
33
|
+
### Running the engine for development
|
|
34
|
+
|
|
35
|
+
1. Install dependencies
|
|
36
|
+
|
|
37
|
+
`pnpm install`
|
|
38
|
+
|
|
39
|
+
2. Run the demo
|
|
40
|
+
|
|
41
|
+
`pnpm dev`
|
|
42
|
+
|
|
43
|
+
This starts the engine on the demo page with the `example.nar` demo script loaded for testing.
|
|
44
|
+
|
|
45
|
+
### Developping narrat specifically
|
|
46
|
+
|
|
47
|
+
If developping on the narrat package, it's better to go inside the narrat package folder and run commands there.
|
|
48
|
+
|
|
49
|
+
### Multiple demo games
|
|
50
|
+
|
|
51
|
+
There are multiple demo games and it's possible to add new ones. For example `npm run rpg` will run the `rpg` demo. Demos are in the `examples` folder.
|
|
52
|
+
|
|
53
|
+
Running a specific demo is done by changing an environment variables. See the scripts in `package.json` for how to run a specific demo.
|
|
54
|
+
|
|
55
|
+
### Available pnpm commands in narrat
|
|
56
|
+
|
|
57
|
+
- `start`: Start the demo for development
|
|
58
|
+
- `build`: The main build command, builds the library in a state ready to use or publish.
|
|
59
|
+
- `test`: Unit tests, used in CI
|
|
60
|
+
- `dev`: Same as start
|
|
61
|
+
- `generate-types`: Generates `.d.ts` type declaration files for the library (auto run on builds)
|
|
62
|
+
- `fix-type-aliases`: Uses [tsc-alias](https://www.npmjs.com/package/tsc-alias) to auto-replace [path mappings](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) in the built files, as the TypeScript compiler doesn't do it. (auto run at the end of builds)
|
|
63
|
+
- `lint`: Runs the linter on the code (used in CI)
|
|
64
|
+
- `check-types`: Validates TypeScript types.
|
|
65
|
+
|
|
66
|
+
### CI info
|
|
67
|
+
|
|
68
|
+
The following tasks run on CI, and CI is required to pass for pull requests to be merged:
|
|
69
|
+
|
|
70
|
+
- Linting
|
|
71
|
+
- Engine build
|
|
72
|
+
- Unit tests (currently only the parser is unit tested)
|
|
73
|
+
- TypeScript type checking.
|
|
74
|
+
|
|
75
|
+
Please make sure your code passes lint/tests/build/type checks before opening a PR.
|
|
76
|
+
|
|
77
|
+
### Working on the code
|
|
78
|
+
|
|
79
|
+
The narrat codebase isn't currently documented, outside of the [usage docs](https://docs.get-narrat.com). The code is fully written in TypeScript though and should be clearly separated enough to be approachable.
|
|
80
|
+
|
|
81
|
+
### Engine architecture
|
|
82
|
+
|
|
83
|
+
The narrat engine runs primarily as a Vue app. All the UI in the game is made of Vue components, and when a game uses narrat it effectively creates a Vue app.
|
|
84
|
+
|
|
85
|
+
#### App state
|
|
86
|
+
|
|
87
|
+
The engine's state is stored in pinia. It is split in separate pinia modules for different areas of the engine. They can all be found in the [src/stores](src/stores) folder.
|
|
88
|
+
|
|
89
|
+
- `audio`: handles playing and stopping audio and music
|
|
90
|
+
- `dialog`: Receives and stores all lines of dialogue created by game scripts which appear at the right of the game in the main interactive narrative view.
|
|
91
|
+
- `hud`: Stores stats which are displayed on the hud
|
|
92
|
+
- `inventory`: Manages the player's item inventory
|
|
93
|
+
- `main`: Manages app-level logic and other generic systems like startup/reset/load/save
|
|
94
|
+
- `notifications`: Manages notifications which appear at the top of the screen
|
|
95
|
+
- `quests`: Manages quests and objectives
|
|
96
|
+
- `rendering`: Manages the layout's state for dynamically placing and resizing the game UI
|
|
97
|
+
- `skills`: Manages player skills and xp. Also store skill check states
|
|
98
|
+
- `vm`: Manages the virtual machine which runs the scripting language and controls the game flow.
|
|
99
|
+
|
|
100
|
+
All stores can be accessed anywhere in the code with the `use` hooks (example: `useVM()`).
|
|
101
|
+
|
|
102
|
+
#### Scripting language (VM and parser)
|
|
103
|
+
|
|
104
|
+
The scripting language for narrat runs in a virtual machine which has its state stored in the Vue app with Pinia.
|
|
105
|
+
|
|
106
|
+
The narrat scripting language relies on the parser and the vm. The code for the parser is mainly in [src/vm/vm-parser.ts](src/vm/vm-parser.ts). The parser is in charge of taking the `.nar` files as input, and returning a tree of parsed expressions that the engine can use.
|
|
107
|
+
|
|
108
|
+
The actual VM is what runs narrat games, and generally controls the flow of the application. The general logic for the vm is in the `vm` store, but there is also some logic sprinkled in the `src/vm` file.
|
|
109
|
+
|
|
110
|
+
All the actual operations available to the scripting language (like `talk`) are defined as Command plugins. The built-in commands included in the language by default are in the [src/vm/commands](src/vm/commands/) folder. More command can be added by games by registering plugins.
|
|
111
|
+
|
|
112
|
+
#### Adding new commands
|
|
113
|
+
|
|
114
|
+
Language commands are defined in the `vm/commands` folder. It should be easy to add new commands to the game engine by looking at the existing commands as an example. New command plugins are included in the `vm/commands/index` file.
|
|
115
|
+
|
|
116
|
+
#### Config file
|
|
117
|
+
|
|
118
|
+
The main config file has a type defined in `src/config.ts`. The vast majority of the config options for narrat are passed in this config files, which games must provide to the engine when starting. New options for the engine should be added to the type for the config file, and also have their default value included in the `src/defaultConfig.ts` file.
|
|
119
|
+
|
|
120
|
+
Engine code can access the config with the `getConfig()` function.
|
|
121
|
+
|
|
122
|
+
#### Plugin system
|
|
123
|
+
|
|
124
|
+
There is now a plugin system developers can use to add new functionality to narrat (more documentation soon). See the [narrat-bitsy](https://github.com/liana-pigeot/narrat-bitsy) plugin for an example.
|
|
125
|
+
|
|
126
|
+
(Note: The narrat-bitsy plugin hasn't been updated for 2.0.0 and might be a bit out of date).
|
|
127
|
+
|
|
128
|
+
## Assets used in demo games
|
|
129
|
+
|
|
130
|
+
- [Pointing arrows from OpenGameArt](https://opengameart.org/content/pointing-arrows)
|
|
131
|
+
- [UI button from OpenGameArt](https://opengameart.org/content/buttons-and-frame)
|
|
132
|
+
- [10 Basic RPG enemies](https://opengameart.org/content/10-basic-rpg-enemies)
|
|
133
|
+
- [RPG Battle backgrounds from OpenGameArt](https://opengameart.org/content/backgrounds-3)
|
|
134
|
+
- [3D City from OpenGameArt](https://opengameart.org/content/3d-city)
|
|
135
|
+
|
|
136
|
+
The rest is handmade.
|
package/dist/app.vue.d.ts
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
2
|
-
import { AppOptions } from './types/app-types';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<{
|
|
4
|
-
options: PropType<AppOptions>;
|
|
5
|
-
}, {
|
|
6
|
-
dialog: import("vue").ComputedRef<{
|
|
7
|
-
speaker: string;
|
|
8
|
-
text: string;
|
|
9
|
-
pose?: string | undefined;
|
|
10
|
-
cssClass?: string | undefined;
|
|
11
|
-
choices?: {
|
|
12
|
-
choice: string;
|
|
13
|
-
originalIndex: number;
|
|
14
|
-
allowed: boolean;
|
|
15
|
-
}[] | undefined;
|
|
16
|
-
textField?: boolean | undefined;
|
|
17
|
-
interactive: boolean;
|
|
18
|
-
id: string;
|
|
19
|
-
}[]>;
|
|
20
|
-
stack: import("vue").ComputedRef<{
|
|
21
|
-
blocks: {
|
|
22
|
-
currentIndex: number;
|
|
23
|
-
branchData: {
|
|
24
|
-
branch: {
|
|
25
|
-
code: string;
|
|
26
|
-
command: {
|
|
27
|
-
commandType: string;
|
|
28
|
-
operator: string;
|
|
29
|
-
args: (import("./types/parser").Parser.Primitive | {
|
|
30
|
-
code: string;
|
|
31
|
-
command: any;
|
|
32
|
-
fileName: string;
|
|
33
|
-
line: number;
|
|
34
|
-
})[];
|
|
35
|
-
options: import("./types/parser").Parser.DefaultArg;
|
|
36
|
-
staticOptions: {};
|
|
37
|
-
};
|
|
38
|
-
fileName: string;
|
|
39
|
-
line: number;
|
|
40
|
-
}[];
|
|
41
|
-
args?: string[] | undefined;
|
|
42
|
-
};
|
|
43
|
-
}[];
|
|
44
|
-
label: string;
|
|
45
|
-
scope: {
|
|
46
|
-
[key: string]: any;
|
|
47
|
-
};
|
|
48
|
-
returnValue: any;
|
|
49
|
-
}[]>;
|
|
50
|
-
flowState: import("vue").ComputedRef<"menu" | "engine-splash" | "game-splash" | "playing">;
|
|
51
|
-
alerts: import("vue").ComputedRef<{
|
|
52
|
-
title: string;
|
|
53
|
-
text: string;
|
|
54
|
-
resolver: () => void;
|
|
55
|
-
id: string;
|
|
56
|
-
}[]>;
|
|
57
|
-
}, {
|
|
58
|
-
lineTitle: string;
|
|
59
|
-
lineText: string;
|
|
60
|
-
}, {
|
|
61
|
-
appStyle(): any;
|
|
62
|
-
appClass(): any;
|
|
63
|
-
currentLine: () => import("./types/parser").Parser.ParsedExpression<import("./types/parser").Parser.DefaultArg, {}> | undefined;
|
|
64
|
-
gameScaleRatio: () => number;
|
|
65
|
-
gameWidth: () => number;
|
|
66
|
-
gameHeight: () => number;
|
|
67
|
-
actualGameHeight: () => number;
|
|
68
|
-
screenWidth: () => number;
|
|
69
|
-
screenHeight: () => number;
|
|
70
|
-
layoutMode: () => "horizontal" | "vertical";
|
|
71
|
-
}, {
|
|
72
|
-
closeAlert(id: string): void;
|
|
73
|
-
engineSplashDone(): void;
|
|
74
|
-
updateScreenSize(): void;
|
|
75
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
76
|
-
options: PropType<AppOptions>;
|
|
77
|
-
}>>, {}>;
|
|
78
|
-
export default _default;
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { AppOptions } from './types/app-types';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
options: PropType<AppOptions>;
|
|
5
|
+
}, {
|
|
6
|
+
dialog: import("vue").ComputedRef<{
|
|
7
|
+
speaker: string;
|
|
8
|
+
text: string;
|
|
9
|
+
pose?: string | undefined;
|
|
10
|
+
cssClass?: string | undefined;
|
|
11
|
+
choices?: {
|
|
12
|
+
choice: string;
|
|
13
|
+
originalIndex: number;
|
|
14
|
+
allowed: boolean;
|
|
15
|
+
}[] | undefined;
|
|
16
|
+
textField?: boolean | undefined;
|
|
17
|
+
interactive: boolean;
|
|
18
|
+
id: string;
|
|
19
|
+
}[]>;
|
|
20
|
+
stack: import("vue").ComputedRef<{
|
|
21
|
+
blocks: {
|
|
22
|
+
currentIndex: number;
|
|
23
|
+
branchData: {
|
|
24
|
+
branch: {
|
|
25
|
+
code: string;
|
|
26
|
+
command: {
|
|
27
|
+
commandType: string;
|
|
28
|
+
operator: string;
|
|
29
|
+
args: (import("./types/parser").Parser.Primitive | {
|
|
30
|
+
code: string;
|
|
31
|
+
command: any;
|
|
32
|
+
fileName: string;
|
|
33
|
+
line: number;
|
|
34
|
+
})[];
|
|
35
|
+
options: import("./types/parser").Parser.DefaultArg;
|
|
36
|
+
staticOptions: {};
|
|
37
|
+
};
|
|
38
|
+
fileName: string;
|
|
39
|
+
line: number;
|
|
40
|
+
}[];
|
|
41
|
+
args?: string[] | undefined;
|
|
42
|
+
};
|
|
43
|
+
}[];
|
|
44
|
+
label: string;
|
|
45
|
+
scope: {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
returnValue: any;
|
|
49
|
+
}[]>;
|
|
50
|
+
flowState: import("vue").ComputedRef<"menu" | "engine-splash" | "game-splash" | "playing">;
|
|
51
|
+
alerts: import("vue").ComputedRef<{
|
|
52
|
+
title: string;
|
|
53
|
+
text: string;
|
|
54
|
+
resolver: () => void;
|
|
55
|
+
id: string;
|
|
56
|
+
}[]>;
|
|
57
|
+
}, {
|
|
58
|
+
lineTitle: string;
|
|
59
|
+
lineText: string;
|
|
60
|
+
}, {
|
|
61
|
+
appStyle(): any;
|
|
62
|
+
appClass(): any;
|
|
63
|
+
currentLine: () => import("./types/parser").Parser.ParsedExpression<import("./types/parser").Parser.DefaultArg, {}> | undefined;
|
|
64
|
+
gameScaleRatio: () => number;
|
|
65
|
+
gameWidth: () => number;
|
|
66
|
+
gameHeight: () => number;
|
|
67
|
+
actualGameHeight: () => number;
|
|
68
|
+
screenWidth: () => number;
|
|
69
|
+
screenHeight: () => number;
|
|
70
|
+
layoutMode: () => "horizontal" | "vertical";
|
|
71
|
+
}, {
|
|
72
|
+
closeAlert(id: string): void;
|
|
73
|
+
engineSplashDone(): void;
|
|
74
|
+
updateScreenSize(): void;
|
|
75
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
76
|
+
options: PropType<AppOptions>;
|
|
77
|
+
}>>, {}>;
|
|
78
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {
|
|
2
|
-
quit(): void;
|
|
3
|
-
mainMenu(): void;
|
|
4
|
-
closeMenu(): void;
|
|
5
|
-
getPlayTimeString(): string;
|
|
6
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
7
|
-
export default _default;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {
|
|
2
|
+
quit(): void;
|
|
3
|
+
mainMenu(): void;
|
|
4
|
+
closeMenu(): void;
|
|
5
|
+
getPlayTimeString(): string;
|
|
6
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
7
|
+
export default _default;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { SkillConfig } from '../config/skills-config';
|
|
2
|
-
import { SkillsState } from '../stores/skills';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<{}, {
|
|
4
|
-
skills: import("vue").ComputedRef<SkillsState>;
|
|
5
|
-
}, {
|
|
6
|
-
chosenSkill: boolean | String;
|
|
7
|
-
}, {
|
|
8
|
-
skillsToDisplay(): SkillsState;
|
|
9
|
-
skillConf(): {
|
|
10
|
-
[key: string]: {
|
|
11
|
-
hidden?: boolean | undefined;
|
|
12
|
-
description: string;
|
|
13
|
-
name: string;
|
|
14
|
-
startingLevel: number;
|
|
15
|
-
icon: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
xpPerLevel(): number;
|
|
19
|
-
}, {
|
|
20
|
-
getSkillStyle(skill: string): any;
|
|
21
|
-
getSkillName(skill: string): string;
|
|
22
|
-
clickSkill(skill: string): void;
|
|
23
|
-
closeSkill(): void;
|
|
24
|
-
xpBarWidth(xp: number): {
|
|
25
|
-
width: string;
|
|
26
|
-
};
|
|
27
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
28
|
-
export default _default;
|
|
1
|
+
import { SkillConfig } from '../config/skills-config';
|
|
2
|
+
import { SkillsState } from '../stores/skills';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
4
|
+
skills: import("vue").ComputedRef<SkillsState>;
|
|
5
|
+
}, {
|
|
6
|
+
chosenSkill: boolean | String;
|
|
7
|
+
}, {
|
|
8
|
+
skillsToDisplay(): SkillsState;
|
|
9
|
+
skillConf(): {
|
|
10
|
+
[key: string]: {
|
|
11
|
+
hidden?: boolean | undefined;
|
|
12
|
+
description: string;
|
|
13
|
+
name: string;
|
|
14
|
+
startingLevel: number;
|
|
15
|
+
icon: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
xpPerLevel(): number;
|
|
19
|
+
}, {
|
|
20
|
+
getSkillStyle(skill: string): any;
|
|
21
|
+
getSkillName(skill: string): string;
|
|
22
|
+
clickSkill(skill: string): void;
|
|
23
|
+
closeSkill(): void;
|
|
24
|
+
xpBarWidth(xp: number): {
|
|
25
|
+
width: string;
|
|
26
|
+
};
|
|
27
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
28
|
+
export default _default;
|