narrat 0.7.1 → 0.8.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.
- package/LICENSE +21 -21
- package/README.md +30 -30
- package/lib/components/menu.vue.d.ts +61 -0
- package/lib/index.esm.js +202 -102
- package/lib/index.js +201 -101
- package/lib/renpy/renpy-helpers.d.ts +2 -0
- package/lib/utils/data-helpers.d.ts +3 -3
- package/package.json +82 -82
- package/CHANGELOG.md +0 -112
|
@@ -5,6 +5,8 @@ export interface SkillCheckParams {
|
|
|
5
5
|
skill: string;
|
|
6
6
|
value: number;
|
|
7
7
|
id: string;
|
|
8
|
+
success?: string;
|
|
9
|
+
failure?: string;
|
|
8
10
|
}
|
|
9
11
|
export declare function runSkillCheck(ctx: ActionContext<State, State>, params: SkillCheckParams): boolean;
|
|
10
12
|
export declare function runConditionCommand(ctx: ActionContext<State, State>, command: Parser.Command): Parser.Branch | undefined;
|
|
@@ -3,7 +3,7 @@ export declare function findDataHelper<T>(sourceObj: any, path: string): [T, str
|
|
|
3
3
|
export declare function setDataHelper<T>(sourceObj: any, path: string, value: T): void;
|
|
4
4
|
export declare function addDataHelper<T>(sourceObj: any, path: string, value: T): void;
|
|
5
5
|
export declare function getModifiableData(state: State): {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
data: import("../types/vuex").DataState;
|
|
7
|
+
skills: import("../types/vuex").SkillsState;
|
|
8
|
+
buttons: import("vue").ButtonsState;
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "narrat",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "narrat narrative engine",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"module": "lib/index.esm.js",
|
|
7
|
-
"files": [
|
|
8
|
-
"lib/"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
-
"start": "snowpack dev",
|
|
13
|
-
"version": "npm run build",
|
|
14
|
-
"build": "cross-env NODE_ENV=production rollup -c",
|
|
15
|
-
"build-demo": "snowpack build",
|
|
16
|
-
"lint": "eslint src --ext=.js,.jsx,.ts,.tsx",
|
|
17
|
-
"preversion": "npm run build && npm run lint",
|
|
18
|
-
"postversion": "git push && git push --tags"
|
|
19
|
-
},
|
|
20
|
-
"keywords": [
|
|
21
|
-
"game"
|
|
22
|
-
],
|
|
23
|
-
"author": "Liana Pigeot <liana.pigeot@protonmail.com>",
|
|
24
|
-
"license": "MIT",
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"@babel/core": "^7.12.10",
|
|
27
|
-
"@babel/preset-env": "^7.12.11",
|
|
28
|
-
"@rollup/plugin-commonjs": "^16.0.0",
|
|
29
|
-
"@rollup/plugin-node-resolve": "^10.0.0",
|
|
30
|
-
"@rollup/plugin-typescript": "^8.2.5",
|
|
31
|
-
"@snowpack/plugin-postcss": "^1.4.3",
|
|
32
|
-
"@snowpack/plugin-sass": "^1.4.0",
|
|
33
|
-
"@snowpack/plugin-typescript": "^1.2.1",
|
|
34
|
-
"@snowpack/plugin-vue": "^2.6.2",
|
|
35
|
-
"@types/howler": "^2.2.3",
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "^4.28.3",
|
|
37
|
-
"@typescript-eslint/parser": "^4.28.3",
|
|
38
|
-
"@vue/compiler-sfc": "^3.0.4",
|
|
39
|
-
"babel-loader": "^8.2.2",
|
|
40
|
-
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
|
41
|
-
"babel-preset-vue": "^2.0.2",
|
|
42
|
-
"cross-env": "^7.0.3",
|
|
43
|
-
"css-loader": "^5.0.1",
|
|
44
|
-
"es6-promise": "^4.2.8",
|
|
45
|
-
"eslint": "^7.30.0",
|
|
46
|
-
"eslint-config-airbnb-base": "^14.2.1",
|
|
47
|
-
"eslint-config-prettier": "^8.3.0",
|
|
48
|
-
"eslint-config-standard": "^16.0.3",
|
|
49
|
-
"eslint-import-resolver-typescript": "^2.4.0",
|
|
50
|
-
"eslint-plugin-import": "^2.23.4",
|
|
51
|
-
"eslint-plugin-node": "^11.1.0",
|
|
52
|
-
"eslint-plugin-promise": "^5.1.0",
|
|
53
|
-
"eslint-plugin-vue": "^7.13.0",
|
|
54
|
-
"postcss": "^8.2.1",
|
|
55
|
-
"postcss-cli": "^8.3.1",
|
|
56
|
-
"prettier": "2.3.2",
|
|
57
|
-
"rollup": "^2.35.1",
|
|
58
|
-
"rollup-plugin-analyzer": "^4.0.0",
|
|
59
|
-
"rollup-plugin-inject-process-env": "^1.3.1",
|
|
60
|
-
"rollup-plugin-paths": "^0.0.4",
|
|
61
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
62
|
-
"rollup-plugin-postcss": "^4.0.0",
|
|
63
|
-
"rollup-plugin-typescript2": "^0.30.0",
|
|
64
|
-
"rollup-plugin-version-injector": "^1.3.0",
|
|
65
|
-
"rollup-plugin-vue": "^6.0.0-beta.11",
|
|
66
|
-
"snowpack": "^3.8.6",
|
|
67
|
-
"tailwindcss": "^2.0.2",
|
|
68
|
-
"typescript": "^4.2.3",
|
|
69
|
-
"vue": "^3.2.2",
|
|
70
|
-
"vuex": "^4.0.0-rc.2"
|
|
71
|
-
},
|
|
72
|
-
"peerDependencies": {
|
|
73
|
-
"es6-promise": "^4.2.8",
|
|
74
|
-
"vue": "^3.0.4",
|
|
75
|
-
"vuex": "^4.0.0-rc.2"
|
|
76
|
-
},
|
|
77
|
-
"dependencies": {
|
|
78
|
-
"autoprefixer": "^10.2.6",
|
|
79
|
-
"howler": "^2.2.3",
|
|
80
|
-
"vue3-mq": "^3.0.0"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "narrat",
|
|
3
|
+
"version": "0.8.2",
|
|
4
|
+
"description": "narrat narrative engine",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"module": "lib/index.esm.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib/"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
+
"start": "snowpack dev",
|
|
13
|
+
"version": "npm run build",
|
|
14
|
+
"build": "cross-env NODE_ENV=production rollup -c",
|
|
15
|
+
"build-demo": "snowpack build",
|
|
16
|
+
"lint": "eslint src --ext=.js,.jsx,.ts,.tsx",
|
|
17
|
+
"preversion": "npm run build && npm run lint",
|
|
18
|
+
"postversion": "git push && git push --tags"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"game"
|
|
22
|
+
],
|
|
23
|
+
"author": "Liana Pigeot <liana.pigeot@protonmail.com>",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@babel/core": "^7.12.10",
|
|
27
|
+
"@babel/preset-env": "^7.12.11",
|
|
28
|
+
"@rollup/plugin-commonjs": "^16.0.0",
|
|
29
|
+
"@rollup/plugin-node-resolve": "^10.0.0",
|
|
30
|
+
"@rollup/plugin-typescript": "^8.2.5",
|
|
31
|
+
"@snowpack/plugin-postcss": "^1.4.3",
|
|
32
|
+
"@snowpack/plugin-sass": "^1.4.0",
|
|
33
|
+
"@snowpack/plugin-typescript": "^1.2.1",
|
|
34
|
+
"@snowpack/plugin-vue": "^2.6.2",
|
|
35
|
+
"@types/howler": "^2.2.3",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^4.28.3",
|
|
37
|
+
"@typescript-eslint/parser": "^4.28.3",
|
|
38
|
+
"@vue/compiler-sfc": "^3.0.4",
|
|
39
|
+
"babel-loader": "^8.2.2",
|
|
40
|
+
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
|
41
|
+
"babel-preset-vue": "^2.0.2",
|
|
42
|
+
"cross-env": "^7.0.3",
|
|
43
|
+
"css-loader": "^5.0.1",
|
|
44
|
+
"es6-promise": "^4.2.8",
|
|
45
|
+
"eslint": "^7.30.0",
|
|
46
|
+
"eslint-config-airbnb-base": "^14.2.1",
|
|
47
|
+
"eslint-config-prettier": "^8.3.0",
|
|
48
|
+
"eslint-config-standard": "^16.0.3",
|
|
49
|
+
"eslint-import-resolver-typescript": "^2.4.0",
|
|
50
|
+
"eslint-plugin-import": "^2.23.4",
|
|
51
|
+
"eslint-plugin-node": "^11.1.0",
|
|
52
|
+
"eslint-plugin-promise": "^5.1.0",
|
|
53
|
+
"eslint-plugin-vue": "^7.13.0",
|
|
54
|
+
"postcss": "^8.2.1",
|
|
55
|
+
"postcss-cli": "^8.3.1",
|
|
56
|
+
"prettier": "2.3.2",
|
|
57
|
+
"rollup": "^2.35.1",
|
|
58
|
+
"rollup-plugin-analyzer": "^4.0.0",
|
|
59
|
+
"rollup-plugin-inject-process-env": "^1.3.1",
|
|
60
|
+
"rollup-plugin-paths": "^0.0.4",
|
|
61
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
62
|
+
"rollup-plugin-postcss": "^4.0.0",
|
|
63
|
+
"rollup-plugin-typescript2": "^0.30.0",
|
|
64
|
+
"rollup-plugin-version-injector": "^1.3.0",
|
|
65
|
+
"rollup-plugin-vue": "^6.0.0-beta.11",
|
|
66
|
+
"snowpack": "^3.8.6",
|
|
67
|
+
"tailwindcss": "^2.0.2",
|
|
68
|
+
"typescript": "^4.2.3",
|
|
69
|
+
"vue": "^3.2.2",
|
|
70
|
+
"vuex": "^4.0.0-rc.2"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"es6-promise": "^4.2.8",
|
|
74
|
+
"vue": "^3.0.4",
|
|
75
|
+
"vuex": "^4.0.0-rc.2"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"autoprefixer": "^10.2.6",
|
|
79
|
+
"howler": "^2.2.3",
|
|
80
|
+
"vue3-mq": "^3.0.0"
|
|
81
|
+
}
|
|
82
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# Narrat changelog
|
|
2
|
-
|
|
3
|
-
## 0.7.1
|
|
4
|
-
|
|
5
|
-
- Added `stop` and `pause` functions which work similarly to play for stopping or pausing audio.
|
|
6
|
-
|
|
7
|
-
## 0.6.5
|
|
8
|
-
|
|
9
|
-
- Audio and music options from the config now get passed to howler
|
|
10
|
-
- Renamed `path` to `src` in audio config (to be consistent with howler)
|
|
11
|
-
|
|
12
|
-
## 0.6.0
|
|
13
|
-
|
|
14
|
-
Added stats feature for tracking numbers and displaying them in the hud
|
|
15
|
-
|
|
16
|
-
Example config:
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
"hudStats": {
|
|
20
|
-
"money": {
|
|
21
|
-
"icon": "img/ui/money.png",
|
|
22
|
-
"name": "Money",
|
|
23
|
-
"startingValue": 0,
|
|
24
|
-
"minValue": 0
|
|
25
|
-
},
|
|
26
|
-
"energy": {
|
|
27
|
-
"icon": "img/ui/energy.png",
|
|
28
|
-
"name": "Energy",
|
|
29
|
-
"startingValue": 10,
|
|
30
|
-
"minValue": 0,
|
|
31
|
-
"maxValue": 10
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## 0.5.4
|
|
37
|
-
|
|
38
|
-
- Improved responsive layout and fixed some issues in it
|
|
39
|
-
|
|
40
|
-
New config keys required in the layout part of the config (to be documented):
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
"layout": {
|
|
44
|
-
"backgrounds": {
|
|
45
|
-
"width": 880,
|
|
46
|
-
"height": 720
|
|
47
|
-
},
|
|
48
|
-
"dialogBottomPadding": 70,
|
|
49
|
-
"minTextWidth": 475,
|
|
50
|
-
"mobileDialogHeightPercentage": 60,
|
|
51
|
-
"verticalLayoutThreshold": 1000,
|
|
52
|
-
"portraits": {
|
|
53
|
-
"width": 100,
|
|
54
|
-
"height": 100
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## 0.4.0
|
|
60
|
-
|
|
61
|
-
Added responsive layout for mobile and small screens. Still in progress, but functionnal enough to be better than before so I'm releasing it.
|
|
62
|
-
|
|
63
|
-
## 0.3.4
|
|
64
|
-
|
|
65
|
-
- Improved string templating to work with deep nesting and also inside choice text
|
|
66
|
-
|
|
67
|
-
## 0.3.3
|
|
68
|
-
|
|
69
|
-
- Now detects indentation size and can support any indentation size
|
|
70
|
-
|
|
71
|
-
## 0.3.2
|
|
72
|
-
|
|
73
|
-
- Added a new `add_level` function for increasing the level of a skill. Example: `add_level someSkill 1` will increase the player's level in `someSkill` by 1
|
|
74
|
-
- Added a new `notify` function for displaying a notification toast that disappears after a few seconds (duration configurable in `config.json`). Example: `notify "Hello, this is a notification"`.
|
|
75
|
-
|
|
76
|
-
## 0.3.1
|
|
77
|
-
|
|
78
|
-
Added new config options for controlling how skill rolls are done and the display of their difficulty
|
|
79
|
-
|
|
80
|
-
## 0.3.0
|
|
81
|
-
|
|
82
|
-
Breaking changes around renaming data access from scripts
|
|
83
|
-
|
|
84
|
-
### New Add Command
|
|
85
|
-
|
|
86
|
-
New `add` command, works the same way as `set` but increments the value based on the existing value, ie. `set SKILLS.someSkill.level 2` will increment `someSkill.level` by 2.
|
|
87
|
-
|
|
88
|
-
### Skills
|
|
89
|
-
|
|
90
|
-
- Now possible to set the starting value of a skill (in the config)
|
|
91
|
-
- Now possible to edit a skill's value with `set SKILLS.someSkill.level 2` for example
|
|
92
|
-
- Skillcheck command renamed to roll (`if this.roll("someSkillCheck", "testSkill", 40);`)
|
|
93
|
-
|
|
94
|
-
### General
|
|
95
|
-
|
|
96
|
-
The `set` and `$if` command now refer to data in caps and have access to more data:
|
|
97
|
-
|
|
98
|
-
- `set SKILLS.someSkill.level [value]` Sets the value of a skill
|
|
99
|
-
- `set DATA.someData [value]` Sets a value in the data object (data is for any game-created variables)
|
|
100
|
-
- `$if this.SKILLCHECKS.someSkillCheck.passed` now available for checking if a skillcheck has already been passed
|
|
101
|
-
|
|
102
|
-
## 0.0.14
|
|
103
|
-
|
|
104
|
-
- Added the changelog (manually made for now)
|
|
105
|
-
|
|
106
|
-
## 0.0.13
|
|
107
|
-
|
|
108
|
-
- Added debug menu for jumping to labels (currently doesn't support production builds disabling it)
|
|
109
|
-
- Added saving and loading of the game (works by storing data, skills, skillchecks etc. When the game is reloaded, it is brought back at the last label visited)
|
|
110
|
-
- Fixed a bug where conditional choices would play the wrong result if a choice is removed due to a condition
|
|
111
|
-
- Made script loading and compilation happen during the initial loading, so everything is ready to play when pressing start game
|
|
112
|
-
- Skill checks now also save and load their data, so a failed check becomes impossible to choose, and a succeeded skill check can be skipped if shown again
|