advanced-poe-filter-parser 0.2.8 → 0.9.0
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/.eslintrc +3 -16
- package/.github/workflows/main.yml +2 -2
- package/.node-version +1 -1
- package/.prettierrc.json +11 -0
- package/.vscode/settings.json +17 -0
- package/lib/{parser.js → parser.cjs} +3 -6
- package/lib/parser.d.ts +159 -0
- package/package.json +15 -16
- package/test/parser.test.js +228 -228
- package/babel.config.js +0 -15
package/.eslintrc
CHANGED
|
@@ -4,27 +4,14 @@
|
|
|
4
4
|
"amd": true,
|
|
5
5
|
"node": true
|
|
6
6
|
},
|
|
7
|
-
"extends": [
|
|
8
|
-
"eslint:recommended",
|
|
9
|
-
"plugin:prettier/recommended"
|
|
10
|
-
],
|
|
7
|
+
"extends": ["eslint:recommended", "prettier"],
|
|
11
8
|
"parserOptions": {
|
|
12
|
-
"ecmaVersion":
|
|
9
|
+
"ecmaVersion": 2022,
|
|
13
10
|
"sourceType": "module"
|
|
14
11
|
},
|
|
15
12
|
"rules": {
|
|
16
13
|
"no-console": "off",
|
|
17
14
|
"no-control-regex": "off",
|
|
18
|
-
"no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }]
|
|
19
|
-
"prettier/prettier": [
|
|
20
|
-
"error",
|
|
21
|
-
{
|
|
22
|
-
"semi": false,
|
|
23
|
-
"singleQuote": true,
|
|
24
|
-
"trailingComma": "es5",
|
|
25
|
-
"printWidth": 160,
|
|
26
|
-
"arrowParens": "always"
|
|
27
|
-
}
|
|
28
|
-
]
|
|
15
|
+
"no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }]
|
|
29
16
|
}
|
|
30
17
|
}
|
|
@@ -8,7 +8,7 @@ jobs:
|
|
|
8
8
|
|
|
9
9
|
strategy:
|
|
10
10
|
matrix:
|
|
11
|
-
node-version: [
|
|
11
|
+
node-version: [16.x, 18.x, 20.x]
|
|
12
12
|
|
|
13
13
|
steps:
|
|
14
14
|
- uses: actions/checkout@v3
|
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
- uses: actions/checkout@v3
|
|
27
27
|
- uses: actions/setup-node@v3
|
|
28
28
|
with:
|
|
29
|
-
node-version:
|
|
29
|
+
node-version: 20.x
|
|
30
30
|
cache: 'npm'
|
|
31
31
|
- run: npm install
|
|
32
32
|
- run: npm run lint
|
package/.node-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
20.5.0
|
package/.prettierrc.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
3
|
+
"editor.codeActionsOnSave": {
|
|
4
|
+
"source.fixAll.eslint": true
|
|
5
|
+
},
|
|
6
|
+
"editor.formatOnSave": false,
|
|
7
|
+
"cSpell.userWords": ["pegjs", "synthesised", "archnemesis"],
|
|
8
|
+
"[javascript]": {
|
|
9
|
+
"editor.formatOnSave": true
|
|
10
|
+
},
|
|
11
|
+
"[json]": {
|
|
12
|
+
"editor.formatOnSave": true
|
|
13
|
+
},
|
|
14
|
+
"[typescript]": {
|
|
15
|
+
"editor.formatOnSave": true
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Generated by PEG.js v0.11.0-master.b7b87ea, https://pegjs.org/
|
|
2
2
|
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
3
5
|
function peg$subclass(child, parent) {
|
|
4
6
|
function C() { this.constructor = child; }
|
|
5
7
|
C.prototype = parent.prototype;
|
|
@@ -6323,12 +6325,7 @@ function peg$parse(input, options) {
|
|
|
6323
6325
|
}
|
|
6324
6326
|
}
|
|
6325
6327
|
|
|
6326
|
-
|
|
6327
|
-
peg$SyntaxError as SyntaxError,
|
|
6328
|
-
peg$parse as parse
|
|
6329
|
-
};
|
|
6330
|
-
|
|
6331
|
-
export default {
|
|
6328
|
+
module.exports = {
|
|
6332
6329
|
SyntaxError: peg$SyntaxError,
|
|
6333
6330
|
parse: peg$parse
|
|
6334
6331
|
};
|
package/lib/parser.d.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
type MatchOperator = "==" | "="
|
|
2
|
+
type NumOperator = "<=" | ">=" | "<" | ">" | "="
|
|
3
|
+
|
|
4
|
+
type Rarity = "Normal" | "Magic" | "Rare" | "Unique"
|
|
5
|
+
type Influence = "Shaper" | "Elder" | "Crusader" | "Hunter" | "Redeemer" | "Warlord" | "None"
|
|
6
|
+
type GemQualityType = "Superior" | "Divergent" | "Anomalous" | "Phantasmal"
|
|
7
|
+
type SocketType = "R" | "G" | "B" | "W" | "A" | "D"
|
|
8
|
+
|
|
9
|
+
type MinimapIconSize = 0 | 1 | 2 | "0" | "1" | "2" | "Largest" | "Medium" | "Small"
|
|
10
|
+
type MinimapIconColor = "Red" | "Green" | "Blue" | "Brown" | "White" | "Yellow" | "Cyan" | "Grey" | "Orange" | "Pink" | "Purple"
|
|
11
|
+
type MinimapIconShape =
|
|
12
|
+
| "Circle"
|
|
13
|
+
| "Diamond"
|
|
14
|
+
| "Hexagon"
|
|
15
|
+
| "Square"
|
|
16
|
+
| "Star"
|
|
17
|
+
| "Triangle"
|
|
18
|
+
| "Cross"
|
|
19
|
+
| "Moon"
|
|
20
|
+
| "Raindrop"
|
|
21
|
+
| "Kite"
|
|
22
|
+
| "Pentagon"
|
|
23
|
+
| "UpsideDownHouse"
|
|
24
|
+
type PlayEffectColor = "Red" | "Green" | "Blue" | "Brown" | "White" | "Yellow" | "Cyan" | "Grey" | "Orange" | "Pink" | "Purple"
|
|
25
|
+
type SoundId =
|
|
26
|
+
| 1
|
|
27
|
+
| 2
|
|
28
|
+
| 3
|
|
29
|
+
| 4
|
|
30
|
+
| 5
|
|
31
|
+
| 6
|
|
32
|
+
| 7
|
|
33
|
+
| 8
|
|
34
|
+
| 9
|
|
35
|
+
| 10
|
|
36
|
+
| 11
|
|
37
|
+
| 12
|
|
38
|
+
| 13
|
|
39
|
+
| 14
|
|
40
|
+
| 15
|
|
41
|
+
| 16
|
|
42
|
+
| "1"
|
|
43
|
+
| "2"
|
|
44
|
+
| "3"
|
|
45
|
+
| "4"
|
|
46
|
+
| "5"
|
|
47
|
+
| "6"
|
|
48
|
+
| "7"
|
|
49
|
+
| "8"
|
|
50
|
+
| "9"
|
|
51
|
+
| "10"
|
|
52
|
+
| "11"
|
|
53
|
+
| "12"
|
|
54
|
+
| "13"
|
|
55
|
+
| "14"
|
|
56
|
+
| "15"
|
|
57
|
+
| "16"
|
|
58
|
+
| "ShAlchemy"
|
|
59
|
+
| "ShBlessed"
|
|
60
|
+
| "ShChaos"
|
|
61
|
+
| "ShDivine"
|
|
62
|
+
| "ShExalted"
|
|
63
|
+
| "ShFusing"
|
|
64
|
+
| "ShGeneral"
|
|
65
|
+
| "ShMirror"
|
|
66
|
+
| "ShRegal"
|
|
67
|
+
| "ShVaal"
|
|
68
|
+
|
|
69
|
+
type AdvancedBlock = {
|
|
70
|
+
id: string
|
|
71
|
+
name: string
|
|
72
|
+
activity: string
|
|
73
|
+
conditions: {
|
|
74
|
+
Class?: { ope: MatchOperator; vals: string[] }
|
|
75
|
+
BaseType?: { ope: MatchOperator; vals: string[] }
|
|
76
|
+
Rarity?: `${MatchOperator} ${Rarity}`
|
|
77
|
+
BaseDefencePercentile?: `${NumOperator} ${number}`
|
|
78
|
+
BaseArmour?: `${NumOperator} ${number}`
|
|
79
|
+
BaseEnergyShield?: `${NumOperator} ${number}`
|
|
80
|
+
BaseEvasion?: `${NumOperator} ${number}`
|
|
81
|
+
BaseWard?: `${NumOperator} ${number}`
|
|
82
|
+
DropLevel?: `${NumOperator} ${number}`
|
|
83
|
+
ItemLevel?: `${NumOperator} ${number}`
|
|
84
|
+
AreaLevel?: `${NumOperator} ${number}`
|
|
85
|
+
GemLevel?: `${NumOperator} ${number}`
|
|
86
|
+
GemQualityType?: { ope: MatchOperator; vals: GemQualityType[] }
|
|
87
|
+
StackSize?: `${NumOperator} ${number}`
|
|
88
|
+
MapTier?: `${NumOperator} ${number}`
|
|
89
|
+
Quality?: `${NumOperator} ${number}`
|
|
90
|
+
LinkedSockets?: `${NumOperator} ${number}`
|
|
91
|
+
Sockets?: `${NumOperator} ${number}`
|
|
92
|
+
SocketGroup?: `${NumOperator} ${string}` | string
|
|
93
|
+
FracturedItem?: boolean
|
|
94
|
+
SynthesisedItem?: boolean
|
|
95
|
+
Corrupted?: boolean
|
|
96
|
+
Mirrored?: boolean
|
|
97
|
+
Identified?: boolean
|
|
98
|
+
Scourged?: boolean
|
|
99
|
+
ShapedMap?: boolean
|
|
100
|
+
ElderMap?: boolean
|
|
101
|
+
BlightedMap?: boolean
|
|
102
|
+
UberBlightedMap?: boolean
|
|
103
|
+
Height?: `${NumOperator} ${number}`
|
|
104
|
+
Width?: `${NumOperator} ${number}`
|
|
105
|
+
CorruptedMods?: `${NumOperator} ${number}`
|
|
106
|
+
EnchantmentPassiveNum?: `${NumOperator} ${number}`
|
|
107
|
+
HasExplicitMod?: { ope: MatchOperator; vals: string[] }
|
|
108
|
+
HasImplicitMod?: boolean
|
|
109
|
+
HasEaterOfWorldsImplicit?: `${NumOperator} ${number}`
|
|
110
|
+
HasSearingExarchImplicit?: `${NumOperator} ${number}`
|
|
111
|
+
AnyEnchantment?: boolean
|
|
112
|
+
HasEnchantment?: { ope: MatchOperator; vals: string[] }
|
|
113
|
+
HasInfluence?: { ope: MatchOperator; vals: Influence[] }
|
|
114
|
+
EnchantmentPassiveNode?: { ope: MatchOperator; vals: string[] }
|
|
115
|
+
AlternateQuality?: boolean
|
|
116
|
+
Replica?: boolean
|
|
117
|
+
ArchnemesisMod?: { ope: MatchOperator; vals: string[] }
|
|
118
|
+
HasCruciblePassiveTree?: boolean
|
|
119
|
+
}
|
|
120
|
+
actions: {
|
|
121
|
+
SetFontSize?: number
|
|
122
|
+
SetTextColor?: { rgb: { r: number; g: number; b: number }; alpha: number }
|
|
123
|
+
SetBackgroundColor?: { rgb: { r: number; g: number; b: number }; alpha: number }
|
|
124
|
+
SetBorderColor?: { rgb: { r: number; g: number; b: number }; alpha: number }
|
|
125
|
+
MinimapIcon?: { size: MinimapIconSize; color: MinimapIconColor; shape: MinimapIconShape }
|
|
126
|
+
PlayEffect?: { color: PlayEffectColor; temp: boolean }
|
|
127
|
+
PlayAlertSound?: { id: SoundId; volume: number | undefined }
|
|
128
|
+
PlayAlertSoundPositional?: { id: SoundId; volume: number | undefined }
|
|
129
|
+
CustomAlertSound?: {
|
|
130
|
+
filePath: string
|
|
131
|
+
volume: number | undefined
|
|
132
|
+
}
|
|
133
|
+
DisableDropSound?: boolean
|
|
134
|
+
EnableDropSound?: boolean
|
|
135
|
+
}
|
|
136
|
+
branches: Array<Branch>
|
|
137
|
+
location: {
|
|
138
|
+
start: { line: number; column: number; offset: number }
|
|
139
|
+
end: { line: number; column: number; offset: number }
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
type Branch = {
|
|
144
|
+
name: string
|
|
145
|
+
type: string
|
|
146
|
+
blocks: Array<AdvancedBlock>
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
type Condition = keyof AdvancedBlock["conditions"]
|
|
150
|
+
type Action = keyof AdvancedBlock["actions"]
|
|
151
|
+
|
|
152
|
+
export function parse(input: string): AdvancedBlock[]
|
|
153
|
+
|
|
154
|
+
export class SyntaxError {
|
|
155
|
+
public message: any
|
|
156
|
+
public expected: any
|
|
157
|
+
public found: any
|
|
158
|
+
public location: any
|
|
159
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "advanced-poe-filter-parser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"path-of-exile",
|
|
6
6
|
"filter-of-kalandra",
|
|
@@ -8,33 +8,32 @@
|
|
|
8
8
|
],
|
|
9
9
|
"homepage": "https://github.com/isuke/advanced-poe-filter-parser",
|
|
10
10
|
"repository": "git@github.com:isuke/advanced-poe-filter-parser.git",
|
|
11
|
-
"main": "lib/parser.
|
|
11
|
+
"main": "lib/parser.cjs",
|
|
12
|
+
"module": "lib/parser.mjs",
|
|
13
|
+
"types": "lib/parser.d.ts",
|
|
12
14
|
"author": "isuke <isuke770@gmail.com>",
|
|
13
15
|
"license": "MIT",
|
|
14
16
|
"private": false,
|
|
15
17
|
"type": "module",
|
|
16
18
|
"scripts": {
|
|
17
|
-
"lint": "eslint
|
|
18
|
-
"fix": "eslint --fix
|
|
19
|
+
"lint": "eslint test/**/*.js",
|
|
20
|
+
"lint:fix": "eslint --fix test/**/*.js",
|
|
21
|
+
"prettier": "prettier --write --log-level=warn '**/*.js'",
|
|
19
22
|
"test": "ava --verbose",
|
|
20
|
-
"build": "pegjs
|
|
23
|
+
"build:c": "pegjs -o lib/parser.cjs src/advanced-poe-filter.pegjs --format=commonjs",
|
|
24
|
+
"build:m": "pegjs -o lib/parser.mjs src/advanced-poe-filter.pegjs --format=es",
|
|
25
|
+
"build": "npm run --silent build:c; npm rum --silent build:m",
|
|
21
26
|
"predeploy": "npm run build",
|
|
22
27
|
"deploy": "npm publish"
|
|
23
28
|
},
|
|
24
29
|
"dependencies": {},
|
|
25
30
|
"devDependencies": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"ava": "5.0.1",
|
|
30
|
-
"eslint": "8.26.0",
|
|
31
|
-
"eslint-config-prettier": "8.5.0",
|
|
32
|
-
"eslint-plugin-prettier": "4.2.1",
|
|
31
|
+
"ava": "5.3.1",
|
|
32
|
+
"eslint": "8.48.0",
|
|
33
|
+
"eslint-config-prettier": "9.0.0",
|
|
33
34
|
"outdent": "0.8.0",
|
|
34
35
|
"pegjs": "0.11.0-master.b7b87ea",
|
|
35
|
-
"prettier": "
|
|
36
|
-
"sinon": "
|
|
37
|
-
"webpack": "5.74.0",
|
|
38
|
-
"webpack-cli": "4.10.00"
|
|
36
|
+
"prettier": "3.0.3",
|
|
37
|
+
"sinon": "15.2.0"
|
|
39
38
|
}
|
|
40
39
|
}
|
package/test/parser.test.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import test from
|
|
2
|
-
import outdent from
|
|
1
|
+
import test from "ava"
|
|
2
|
+
import outdent from "outdent"
|
|
3
3
|
|
|
4
|
-
import { parse } from
|
|
4
|
+
import { parse } from "../lib/parser.mjs"
|
|
5
5
|
|
|
6
|
-
test(
|
|
6
|
+
test("parse : blank and comment lines", (t) => {
|
|
7
7
|
const script = [
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
"# This is a comment",
|
|
9
|
+
"# This is a comment",
|
|
10
10
|
'Hide "Hide Map Section"',
|
|
11
11
|
' Class "Maps"',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
" MapTier <= 4",
|
|
13
|
+
" ",
|
|
14
|
+
"# This is a comment",
|
|
15
15
|
'Show "Flask Section"',
|
|
16
|
-
|
|
16
|
+
" # This is a comment",
|
|
17
17
|
' Class "Life Flasks" "Mana Flasks" "Hybrid Flasks"',
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
" SetBorderColor 250 251 252",
|
|
19
|
+
" PlayAlertSound 1 300",
|
|
20
|
+
" ",
|
|
21
21
|
'Hide "Remain Section"',
|
|
22
|
-
|
|
23
|
-
].join(
|
|
22
|
+
"",
|
|
23
|
+
].join("\n")
|
|
24
24
|
|
|
25
25
|
const expected = [
|
|
26
26
|
{
|
|
27
|
-
id:
|
|
28
|
-
name:
|
|
29
|
-
activity:
|
|
27
|
+
id: "0001",
|
|
28
|
+
name: "Hide Map Section",
|
|
29
|
+
activity: "Hide",
|
|
30
30
|
conditions: {
|
|
31
|
-
Class: { ope:
|
|
32
|
-
MapTier:
|
|
31
|
+
Class: { ope: "=", vals: ["Maps"] },
|
|
32
|
+
MapTier: "<= 4",
|
|
33
33
|
},
|
|
34
34
|
actions: {},
|
|
35
35
|
branches: [],
|
|
@@ -47,15 +47,15 @@ test('parse : blank and comment lines', (t) => {
|
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
id:
|
|
51
|
-
name:
|
|
52
|
-
activity:
|
|
50
|
+
id: "0001",
|
|
51
|
+
name: "Flask Section",
|
|
52
|
+
activity: "Show",
|
|
53
53
|
conditions: {
|
|
54
|
-
Class: { ope:
|
|
54
|
+
Class: { ope: "=", vals: ["Life Flasks", "Mana Flasks", "Hybrid Flasks"] },
|
|
55
55
|
},
|
|
56
56
|
actions: {
|
|
57
57
|
SetBorderColor: { rgb: { r: 250, g: 251, b: 252 }, alpha: 255 },
|
|
58
|
-
PlayAlertSound: { id:
|
|
58
|
+
PlayAlertSound: { id: "1", volume: 300 },
|
|
59
59
|
},
|
|
60
60
|
branches: [],
|
|
61
61
|
location: {
|
|
@@ -72,9 +72,9 @@ test('parse : blank and comment lines', (t) => {
|
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
id:
|
|
76
|
-
name:
|
|
77
|
-
activity:
|
|
75
|
+
id: "0001",
|
|
76
|
+
name: "Remain Section",
|
|
77
|
+
activity: "Hide",
|
|
78
78
|
conditions: {},
|
|
79
79
|
actions: {},
|
|
80
80
|
branches: [],
|
|
@@ -98,7 +98,7 @@ test('parse : blank and comment lines', (t) => {
|
|
|
98
98
|
t.deepEqual(result, expected)
|
|
99
99
|
})
|
|
100
100
|
|
|
101
|
-
test(
|
|
101
|
+
test("parse : all actions and conditions", (t) => {
|
|
102
102
|
const script = outdent`
|
|
103
103
|
Show "Section1"
|
|
104
104
|
Class "Maps"
|
|
@@ -198,29 +198,29 @@ Unset "Section6"
|
|
|
198
198
|
|
|
199
199
|
const expected = [
|
|
200
200
|
{
|
|
201
|
-
id:
|
|
202
|
-
name:
|
|
203
|
-
activity:
|
|
201
|
+
id: "0001",
|
|
202
|
+
name: "Section1",
|
|
203
|
+
activity: "Show",
|
|
204
204
|
conditions: {
|
|
205
|
-
Class: { ope:
|
|
206
|
-
BaseType: { ope:
|
|
207
|
-
DropLevel:
|
|
208
|
-
ItemLevel:
|
|
209
|
-
AreaLevel:
|
|
210
|
-
GemLevel:
|
|
211
|
-
GemQualityType: { ope:
|
|
212
|
-
StackSize:
|
|
213
|
-
MapTier:
|
|
214
|
-
Quality:
|
|
215
|
-
LinkedSockets:
|
|
216
|
-
Sockets:
|
|
217
|
-
SocketGroup:
|
|
218
|
-
Rarity:
|
|
219
|
-
BaseDefencePercentile:
|
|
220
|
-
BaseArmour:
|
|
221
|
-
BaseEnergyShield:
|
|
222
|
-
BaseEvasion:
|
|
223
|
-
BaseWard:
|
|
205
|
+
Class: { ope: "=", vals: ["Maps"] },
|
|
206
|
+
BaseType: { ope: "=", vals: ["Sacrificial Garb"] },
|
|
207
|
+
DropLevel: "> 85",
|
|
208
|
+
ItemLevel: ">= 70",
|
|
209
|
+
AreaLevel: "< 30",
|
|
210
|
+
GemLevel: "= 10",
|
|
211
|
+
GemQualityType: { ope: "=", vals: ["Superior"] },
|
|
212
|
+
StackSize: "< 11",
|
|
213
|
+
MapTier: "<= 12",
|
|
214
|
+
Quality: "= 15",
|
|
215
|
+
LinkedSockets: "= 6",
|
|
216
|
+
Sockets: "= 5",
|
|
217
|
+
SocketGroup: "RGB",
|
|
218
|
+
Rarity: "= Rare",
|
|
219
|
+
BaseDefencePercentile: "> 50",
|
|
220
|
+
BaseArmour: "> 40",
|
|
221
|
+
BaseEnergyShield: "> 41",
|
|
222
|
+
BaseEvasion: "> 42",
|
|
223
|
+
BaseWard: "> 43",
|
|
224
224
|
FracturedItem: false,
|
|
225
225
|
SynthesisedItem: false,
|
|
226
226
|
Corrupted: true,
|
|
@@ -231,24 +231,24 @@ Unset "Section6"
|
|
|
231
231
|
ElderMap: true,
|
|
232
232
|
BlightedMap: true,
|
|
233
233
|
UberBlightedMap: true,
|
|
234
|
-
Height:
|
|
235
|
-
Width:
|
|
236
|
-
CorruptedMods:
|
|
237
|
-
EnchantmentPassiveNum:
|
|
238
|
-
HasExplicitMod: { ope:
|
|
234
|
+
Height: "> 1",
|
|
235
|
+
Width: "> 2",
|
|
236
|
+
CorruptedMods: ">= 1",
|
|
237
|
+
EnchantmentPassiveNum: "> 5",
|
|
238
|
+
HasExplicitMod: { ope: "=", vals: ["Foo", "Bar"] },
|
|
239
239
|
HasImplicitMod: true,
|
|
240
|
-
HasEaterOfWorldsImplicit:
|
|
241
|
-
HasSearingExarchImplicit:
|
|
240
|
+
HasEaterOfWorldsImplicit: ">= 4",
|
|
241
|
+
HasSearingExarchImplicit: ">= 4",
|
|
242
242
|
AnyEnchantment: true,
|
|
243
|
-
HasEnchantment: { ope:
|
|
244
|
-
HasInfluence: { ope:
|
|
243
|
+
HasEnchantment: { ope: "=", vals: ["Foo", "Bar"] },
|
|
244
|
+
HasInfluence: { ope: "=", vals: ["Shaper", "Elder"] },
|
|
245
245
|
EnchantmentPassiveNode: {
|
|
246
|
-
ope:
|
|
247
|
-
vals: [
|
|
246
|
+
ope: "=",
|
|
247
|
+
vals: ["Damage while you have a Herald", "Projectile Damage"],
|
|
248
248
|
},
|
|
249
249
|
AlternateQuality: true,
|
|
250
250
|
Replica: true,
|
|
251
|
-
ArchnemesisMod: { ope:
|
|
251
|
+
ArchnemesisMod: { ope: "=", vals: ["Toxic"] },
|
|
252
252
|
HasCruciblePassiveTree: true,
|
|
253
253
|
},
|
|
254
254
|
actions: {
|
|
@@ -256,11 +256,11 @@ Unset "Section6"
|
|
|
256
256
|
SetTextColor: { rgb: { r: 103, g: 104, b: 105 }, alpha: 255 },
|
|
257
257
|
SetBackgroundColor: { rgb: { r: 106, g: 107, b: 108 }, alpha: 255 },
|
|
258
258
|
SetFontSize: 30,
|
|
259
|
-
PlayAlertSound: { id:
|
|
259
|
+
PlayAlertSound: { id: "16", volume: 300 },
|
|
260
260
|
EnableDropSound: true,
|
|
261
|
-
CustomAlertSound: { filePath:
|
|
262
|
-
MinimapIcon: { size:
|
|
263
|
-
PlayEffect: { color:
|
|
261
|
+
CustomAlertSound: { filePath: "C\\foobar\\sound.mp3", volume: 300 },
|
|
262
|
+
MinimapIcon: { size: "Largest", color: "Red", shape: "Circle" },
|
|
263
|
+
PlayEffect: { color: "Red", temp: false },
|
|
264
264
|
},
|
|
265
265
|
branches: [],
|
|
266
266
|
location: {
|
|
@@ -277,36 +277,36 @@ Unset "Section6"
|
|
|
277
277
|
},
|
|
278
278
|
},
|
|
279
279
|
{
|
|
280
|
-
id:
|
|
281
|
-
name:
|
|
282
|
-
activity:
|
|
280
|
+
id: "0001",
|
|
281
|
+
name: "Section2",
|
|
282
|
+
activity: "Show",
|
|
283
283
|
conditions: {
|
|
284
284
|
Class: {
|
|
285
|
-
ope:
|
|
286
|
-
vals: [
|
|
285
|
+
ope: "=",
|
|
286
|
+
vals: ["Life Flasks", "Mana Flasks", "Hybrid Flasks"],
|
|
287
287
|
},
|
|
288
288
|
BaseType: {
|
|
289
|
-
ope:
|
|
290
|
-
vals: [
|
|
289
|
+
ope: "=",
|
|
290
|
+
vals: ["Two-Toned Boots", "Spiked Gloves", "Gripped Gloves", "Fingerless Silk Gloves", "Bone Helmet"],
|
|
291
291
|
},
|
|
292
|
-
SocketGroup:
|
|
293
|
-
Rarity:
|
|
294
|
-
HasExplicitMod: { ope:
|
|
295
|
-
HasEnchantment: { ope:
|
|
296
|
-
HasInfluence: { ope:
|
|
292
|
+
SocketGroup: "W",
|
|
293
|
+
Rarity: "Rare",
|
|
294
|
+
HasExplicitMod: { ope: "==", vals: ["Foo", "Bar"] },
|
|
295
|
+
HasEnchantment: { ope: "==", vals: ["Foo", "Bar"] },
|
|
296
|
+
HasInfluence: { ope: "==", vals: ["Shaper", "Elder"] },
|
|
297
297
|
},
|
|
298
298
|
actions: {
|
|
299
299
|
SetBorderColor: { rgb: { r: 100, g: 101, b: 102 }, alpha: 200 },
|
|
300
300
|
SetTextColor: { rgb: { r: 103, g: 104, b: 105 }, alpha: 201 },
|
|
301
301
|
SetBackgroundColor: { rgb: { r: 106, g: 107, b: 108 }, alpha: 202 },
|
|
302
|
-
PlayAlertSound: { id:
|
|
302
|
+
PlayAlertSound: { id: "2", volume: undefined },
|
|
303
303
|
DisableDropSound: true,
|
|
304
304
|
CustomAlertSound: {
|
|
305
|
-
filePath:
|
|
305
|
+
filePath: "C\\foobar\\sound.mp3",
|
|
306
306
|
volume: undefined,
|
|
307
307
|
},
|
|
308
|
-
MinimapIcon: { size:
|
|
309
|
-
PlayEffect: { color:
|
|
308
|
+
MinimapIcon: { size: "Medium", color: "Red", shape: "Circle" },
|
|
309
|
+
PlayEffect: { color: "Blue", temp: true },
|
|
310
310
|
},
|
|
311
311
|
branches: [],
|
|
312
312
|
location: {
|
|
@@ -323,26 +323,26 @@ Unset "Section6"
|
|
|
323
323
|
},
|
|
324
324
|
},
|
|
325
325
|
{
|
|
326
|
-
id:
|
|
327
|
-
name:
|
|
328
|
-
activity:
|
|
326
|
+
id: "0001",
|
|
327
|
+
name: "Section3",
|
|
328
|
+
activity: "Show",
|
|
329
329
|
conditions: {
|
|
330
330
|
HasExplicitMod: {
|
|
331
|
-
numeric: { ope:
|
|
332
|
-
vals: [
|
|
331
|
+
numeric: { ope: ">=", val: 2 },
|
|
332
|
+
vals: ["Foo", "Bar"],
|
|
333
333
|
},
|
|
334
334
|
HasEnchantment: {
|
|
335
|
-
numeric: { ope:
|
|
336
|
-
vals: [
|
|
335
|
+
numeric: { ope: ">=", val: 2 },
|
|
336
|
+
vals: ["Foo", "Bar"],
|
|
337
337
|
},
|
|
338
|
-
HasInfluence: { ope: undefined, val:
|
|
338
|
+
HasInfluence: { ope: undefined, val: "None" },
|
|
339
339
|
},
|
|
340
340
|
actions: {
|
|
341
|
-
SetBorderColor: { function:
|
|
342
|
-
SetTextColor: { function:
|
|
343
|
-
SetBackgroundColor: { function:
|
|
344
|
-
SetFontSize: { function:
|
|
345
|
-
PlayAlertSoundPositional: { id:
|
|
341
|
+
SetBorderColor: { function: "Negate", val: undefined },
|
|
342
|
+
SetTextColor: { function: "Grayscale", val: undefined },
|
|
343
|
+
SetBackgroundColor: { function: "Lighten", val: 0.1 },
|
|
344
|
+
SetFontSize: { function: "Plus", val: 5 },
|
|
345
|
+
PlayAlertSoundPositional: { id: "ShAlchemy", volume: 200 },
|
|
346
346
|
},
|
|
347
347
|
branches: [],
|
|
348
348
|
location: {
|
|
@@ -359,16 +359,16 @@ Unset "Section6"
|
|
|
359
359
|
},
|
|
360
360
|
},
|
|
361
361
|
{
|
|
362
|
-
id:
|
|
363
|
-
name:
|
|
364
|
-
activity:
|
|
362
|
+
id: "0001",
|
|
363
|
+
name: "Section4",
|
|
364
|
+
activity: "Ignore",
|
|
365
365
|
conditions: {},
|
|
366
366
|
actions: {
|
|
367
|
-
SetBorderColor: { function:
|
|
368
|
-
SetTextColor: { function:
|
|
369
|
-
SetBackgroundColor: { function:
|
|
370
|
-
SetFontSize: { function:
|
|
371
|
-
PlayAlertSoundPositional: { id:
|
|
367
|
+
SetBorderColor: { function: "Darken", val: 0.2 },
|
|
368
|
+
SetTextColor: { function: "Whiten", val: 0.31 },
|
|
369
|
+
SetBackgroundColor: { function: "Blacken", val: 1 },
|
|
370
|
+
SetFontSize: { function: "Minus", val: 6 },
|
|
371
|
+
PlayAlertSoundPositional: { id: "ShBlessed", volume: undefined },
|
|
372
372
|
},
|
|
373
373
|
branches: [],
|
|
374
374
|
location: {
|
|
@@ -385,14 +385,14 @@ Unset "Section6"
|
|
|
385
385
|
},
|
|
386
386
|
},
|
|
387
387
|
{
|
|
388
|
-
id:
|
|
389
|
-
name:
|
|
390
|
-
activity:
|
|
388
|
+
id: "0001",
|
|
389
|
+
name: "Section5",
|
|
390
|
+
activity: "Hide",
|
|
391
391
|
conditions: {},
|
|
392
392
|
actions: {
|
|
393
|
-
SetBorderColor: { function:
|
|
394
|
-
SetTextColor: { function:
|
|
395
|
-
SetBackgroundColor: { function:
|
|
393
|
+
SetBorderColor: { function: "Saturate", val: 0.42 },
|
|
394
|
+
SetTextColor: { function: "Desaturate", val: 0.53 },
|
|
395
|
+
SetBackgroundColor: { function: "Hex", val: 123 },
|
|
396
396
|
},
|
|
397
397
|
branches: [],
|
|
398
398
|
location: {
|
|
@@ -409,13 +409,13 @@ Unset "Section6"
|
|
|
409
409
|
},
|
|
410
410
|
},
|
|
411
411
|
{
|
|
412
|
-
id:
|
|
413
|
-
name:
|
|
414
|
-
activity:
|
|
412
|
+
id: "0001",
|
|
413
|
+
name: "Section6",
|
|
414
|
+
activity: "Unset",
|
|
415
415
|
conditions: {},
|
|
416
416
|
actions: {
|
|
417
|
-
SetBorderColor: { function:
|
|
418
|
-
SetTextColor: { function:
|
|
417
|
+
SetBorderColor: { function: "Saturationv", val: 64 },
|
|
418
|
+
SetTextColor: { function: "Lightness", val: 75 },
|
|
419
419
|
},
|
|
420
420
|
branches: [],
|
|
421
421
|
location: {
|
|
@@ -438,7 +438,7 @@ Unset "Section6"
|
|
|
438
438
|
t.deepEqual(result, expected)
|
|
439
439
|
})
|
|
440
440
|
|
|
441
|
-
test(
|
|
441
|
+
test("parse : empty section", (t) => {
|
|
442
442
|
const script = outdent`
|
|
443
443
|
Hide "All Section"
|
|
444
444
|
|
|
@@ -446,9 +446,9 @@ Hide "All Section"
|
|
|
446
446
|
|
|
447
447
|
const expected = [
|
|
448
448
|
{
|
|
449
|
-
id:
|
|
450
|
-
name:
|
|
451
|
-
activity:
|
|
449
|
+
id: "0001",
|
|
450
|
+
name: "All Section",
|
|
451
|
+
activity: "Hide",
|
|
452
452
|
conditions: {},
|
|
453
453
|
actions: {},
|
|
454
454
|
branches: [],
|
|
@@ -472,7 +472,7 @@ Hide "All Section"
|
|
|
472
472
|
t.deepEqual(result, expected)
|
|
473
473
|
})
|
|
474
474
|
|
|
475
|
-
test(
|
|
475
|
+
test("parse : single section", (t) => {
|
|
476
476
|
const script = outdent`
|
|
477
477
|
Show "Map Section"
|
|
478
478
|
Class "Maps"
|
|
@@ -484,16 +484,16 @@ Show "Map Section"
|
|
|
484
484
|
|
|
485
485
|
const expected = [
|
|
486
486
|
{
|
|
487
|
-
id:
|
|
488
|
-
name:
|
|
489
|
-
activity:
|
|
487
|
+
id: "0001",
|
|
488
|
+
name: "Map Section",
|
|
489
|
+
activity: "Show",
|
|
490
490
|
conditions: {
|
|
491
|
-
Class: { ope:
|
|
492
|
-
MapTier:
|
|
491
|
+
Class: { ope: "=", vals: ["Maps"] },
|
|
492
|
+
MapTier: "> 3",
|
|
493
493
|
},
|
|
494
494
|
actions: {
|
|
495
495
|
SetBorderColor: { rgb: { r: 250, g: 251, b: 252 }, alpha: 255 },
|
|
496
|
-
PlayAlertSound: { id:
|
|
496
|
+
PlayAlertSound: { id: "1", volume: 300 },
|
|
497
497
|
},
|
|
498
498
|
branches: [],
|
|
499
499
|
location: {
|
|
@@ -516,7 +516,7 @@ Show "Map Section"
|
|
|
516
516
|
t.deepEqual(result, expected)
|
|
517
517
|
})
|
|
518
518
|
|
|
519
|
-
test(
|
|
519
|
+
test("parse : multi section", (t) => {
|
|
520
520
|
const script = outdent`
|
|
521
521
|
Hide "Hide Map Section"
|
|
522
522
|
Class "Maps"
|
|
@@ -533,12 +533,12 @@ Hide "Remain Section"
|
|
|
533
533
|
|
|
534
534
|
const expected = [
|
|
535
535
|
{
|
|
536
|
-
id:
|
|
537
|
-
name:
|
|
538
|
-
activity:
|
|
536
|
+
id: "0001",
|
|
537
|
+
name: "Hide Map Section",
|
|
538
|
+
activity: "Hide",
|
|
539
539
|
conditions: {
|
|
540
|
-
Class: { ope:
|
|
541
|
-
MapTier:
|
|
540
|
+
Class: { ope: "=", vals: ["Maps"] },
|
|
541
|
+
MapTier: "<= 4",
|
|
542
542
|
},
|
|
543
543
|
actions: {},
|
|
544
544
|
branches: [],
|
|
@@ -556,15 +556,15 @@ Hide "Remain Section"
|
|
|
556
556
|
},
|
|
557
557
|
},
|
|
558
558
|
{
|
|
559
|
-
id:
|
|
560
|
-
name:
|
|
561
|
-
activity:
|
|
559
|
+
id: "0001",
|
|
560
|
+
name: "Flask Section",
|
|
561
|
+
activity: "Show",
|
|
562
562
|
conditions: {
|
|
563
|
-
Class: { ope:
|
|
563
|
+
Class: { ope: "=", vals: ["Life Flasks", "Mana Flasks", "Hybrid Flasks"] },
|
|
564
564
|
},
|
|
565
565
|
actions: {
|
|
566
566
|
SetBorderColor: { rgb: { r: 250, g: 251, b: 252 }, alpha: 255 },
|
|
567
|
-
PlayAlertSound: { id:
|
|
567
|
+
PlayAlertSound: { id: "1", volume: 300 },
|
|
568
568
|
},
|
|
569
569
|
branches: [],
|
|
570
570
|
location: {
|
|
@@ -581,9 +581,9 @@ Hide "Remain Section"
|
|
|
581
581
|
},
|
|
582
582
|
},
|
|
583
583
|
{
|
|
584
|
-
id:
|
|
585
|
-
name:
|
|
586
|
-
activity:
|
|
584
|
+
id: "0001",
|
|
585
|
+
name: "Remain Section",
|
|
586
|
+
activity: "Hide",
|
|
587
587
|
conditions: {},
|
|
588
588
|
actions: {},
|
|
589
589
|
branches: [],
|
|
@@ -607,7 +607,7 @@ Hide "Remain Section"
|
|
|
607
607
|
t.deepEqual(result, expected)
|
|
608
608
|
})
|
|
609
609
|
|
|
610
|
-
test(
|
|
610
|
+
test("parse : single fork", (t) => {
|
|
611
611
|
const script = outdent`
|
|
612
612
|
Show "Map Section"
|
|
613
613
|
Class "Maps"
|
|
@@ -627,27 +627,27 @@ Show "Map Section"
|
|
|
627
627
|
|
|
628
628
|
const expected = [
|
|
629
629
|
{
|
|
630
|
-
id:
|
|
631
|
-
name:
|
|
632
|
-
activity:
|
|
630
|
+
id: "0003",
|
|
631
|
+
name: "Map Section",
|
|
632
|
+
activity: "Show",
|
|
633
633
|
conditions: {
|
|
634
|
-
Class: { ope:
|
|
635
|
-
MapTier:
|
|
634
|
+
Class: { ope: "=", vals: ["Maps"] },
|
|
635
|
+
MapTier: "> 3",
|
|
636
636
|
},
|
|
637
637
|
actions: {
|
|
638
638
|
SetBorderColor: { rgb: { r: 250, g: 251, b: 252 }, alpha: 255 },
|
|
639
|
-
PlayAlertSound: { id:
|
|
639
|
+
PlayAlertSound: { id: "1", volume: 300 },
|
|
640
640
|
},
|
|
641
641
|
branches: [
|
|
642
642
|
{
|
|
643
|
-
name:
|
|
644
|
-
type:
|
|
643
|
+
name: "Rarity",
|
|
644
|
+
type: "Fork",
|
|
645
645
|
blocks: [
|
|
646
646
|
{
|
|
647
|
-
id:
|
|
648
|
-
name:
|
|
649
|
-
activity:
|
|
650
|
-
conditions: { Rarity:
|
|
647
|
+
id: "0001",
|
|
648
|
+
name: "Rare",
|
|
649
|
+
activity: "Show",
|
|
650
|
+
conditions: { Rarity: "Rare" },
|
|
651
651
|
actions: { SetBackgroundColor: { rgb: { r: 255, g: 0, b: 0 }, alpha: 100 } },
|
|
652
652
|
branches: [],
|
|
653
653
|
location: {
|
|
@@ -664,10 +664,10 @@ Show "Map Section"
|
|
|
664
664
|
},
|
|
665
665
|
},
|
|
666
666
|
{
|
|
667
|
-
id:
|
|
668
|
-
name:
|
|
669
|
-
activity:
|
|
670
|
-
conditions: { Rarity:
|
|
667
|
+
id: "0002",
|
|
668
|
+
name: "Magic",
|
|
669
|
+
activity: "Hide",
|
|
670
|
+
conditions: { Rarity: "Magic" },
|
|
671
671
|
actions: {},
|
|
672
672
|
branches: [],
|
|
673
673
|
location: {
|
|
@@ -718,7 +718,7 @@ Show "Map Section"
|
|
|
718
718
|
t.deepEqual(result, expected)
|
|
719
719
|
})
|
|
720
720
|
|
|
721
|
-
test(
|
|
721
|
+
test("parse : single mixin", (t) => {
|
|
722
722
|
const script = outdent`
|
|
723
723
|
Show "Map Section"
|
|
724
724
|
Class "Maps"
|
|
@@ -738,27 +738,27 @@ Show "Map Section"
|
|
|
738
738
|
|
|
739
739
|
const expected = [
|
|
740
740
|
{
|
|
741
|
-
id:
|
|
742
|
-
name:
|
|
743
|
-
activity:
|
|
741
|
+
id: "0003",
|
|
742
|
+
name: "Map Section",
|
|
743
|
+
activity: "Show",
|
|
744
744
|
conditions: {
|
|
745
|
-
Class: { ope:
|
|
746
|
-
MapTier:
|
|
745
|
+
Class: { ope: "=", vals: ["Maps"] },
|
|
746
|
+
MapTier: "> 3",
|
|
747
747
|
},
|
|
748
748
|
actions: {
|
|
749
749
|
SetBorderColor: { rgb: { r: 250, g: 251, b: 252 }, alpha: 255 },
|
|
750
|
-
PlayAlertSound: { id:
|
|
750
|
+
PlayAlertSound: { id: "1", volume: 300 },
|
|
751
751
|
},
|
|
752
752
|
branches: [
|
|
753
753
|
{
|
|
754
|
-
name:
|
|
755
|
-
type:
|
|
754
|
+
name: "Rarity",
|
|
755
|
+
type: "Mixin",
|
|
756
756
|
blocks: [
|
|
757
757
|
{
|
|
758
|
-
id:
|
|
759
|
-
name:
|
|
760
|
-
activity:
|
|
761
|
-
conditions: { Rarity:
|
|
758
|
+
id: "0001",
|
|
759
|
+
name: "Rare",
|
|
760
|
+
activity: "Show",
|
|
761
|
+
conditions: { Rarity: "Rare" },
|
|
762
762
|
actions: { SetBackgroundColor: { rgb: { r: 255, g: 0, b: 0 }, alpha: 100 } },
|
|
763
763
|
branches: [],
|
|
764
764
|
location: {
|
|
@@ -775,10 +775,10 @@ Show "Map Section"
|
|
|
775
775
|
},
|
|
776
776
|
},
|
|
777
777
|
{
|
|
778
|
-
id:
|
|
779
|
-
name:
|
|
780
|
-
activity:
|
|
781
|
-
conditions: { Rarity:
|
|
778
|
+
id: "0002",
|
|
779
|
+
name: "Magic",
|
|
780
|
+
activity: "Hide",
|
|
781
|
+
conditions: { Rarity: "Magic" },
|
|
782
782
|
actions: {},
|
|
783
783
|
branches: [],
|
|
784
784
|
location: {
|
|
@@ -829,7 +829,7 @@ Show "Map Section"
|
|
|
829
829
|
t.deepEqual(result, expected)
|
|
830
830
|
})
|
|
831
831
|
|
|
832
|
-
test(
|
|
832
|
+
test("parse : multi mixin", (t) => {
|
|
833
833
|
const script = outdent`
|
|
834
834
|
Show "Map Section"
|
|
835
835
|
Class "Maps"
|
|
@@ -855,23 +855,23 @@ Show "Map Section"
|
|
|
855
855
|
|
|
856
856
|
const expected = [
|
|
857
857
|
{
|
|
858
|
-
id:
|
|
859
|
-
name:
|
|
860
|
-
activity:
|
|
858
|
+
id: "0005",
|
|
859
|
+
name: "Map Section",
|
|
860
|
+
activity: "Show",
|
|
861
861
|
conditions: {
|
|
862
|
-
Class: { ope:
|
|
862
|
+
Class: { ope: "=", vals: ["Maps"] },
|
|
863
863
|
},
|
|
864
864
|
actions: {},
|
|
865
865
|
branches: [
|
|
866
866
|
{
|
|
867
|
-
name:
|
|
868
|
-
type:
|
|
867
|
+
name: "Rarity",
|
|
868
|
+
type: "Mixin",
|
|
869
869
|
blocks: [
|
|
870
870
|
{
|
|
871
|
-
id:
|
|
872
|
-
name:
|
|
873
|
-
activity:
|
|
874
|
-
conditions: { Rarity:
|
|
871
|
+
id: "0001",
|
|
872
|
+
name: "Rare",
|
|
873
|
+
activity: "Show",
|
|
874
|
+
conditions: { Rarity: "Rare" },
|
|
875
875
|
actions: { SetBackgroundColor: { rgb: { r: 255, g: 0, b: 0 }, alpha: 100 } },
|
|
876
876
|
branches: [],
|
|
877
877
|
location: {
|
|
@@ -888,10 +888,10 @@ Show "Map Section"
|
|
|
888
888
|
},
|
|
889
889
|
},
|
|
890
890
|
{
|
|
891
|
-
id:
|
|
892
|
-
name:
|
|
893
|
-
activity:
|
|
894
|
-
conditions: { Rarity:
|
|
891
|
+
id: "0002",
|
|
892
|
+
name: "Magic",
|
|
893
|
+
activity: "Hide",
|
|
894
|
+
conditions: { Rarity: "Magic" },
|
|
895
895
|
actions: {},
|
|
896
896
|
branches: [],
|
|
897
897
|
location: {
|
|
@@ -922,15 +922,15 @@ Show "Map Section"
|
|
|
922
922
|
},
|
|
923
923
|
},
|
|
924
924
|
{
|
|
925
|
-
name:
|
|
926
|
-
type:
|
|
925
|
+
name: "Tier",
|
|
926
|
+
type: "Mixin",
|
|
927
927
|
blocks: [
|
|
928
928
|
{
|
|
929
|
-
id:
|
|
930
|
-
name:
|
|
931
|
-
activity:
|
|
932
|
-
conditions: { MapTier:
|
|
933
|
-
actions: { PlayAlertSound: { id:
|
|
929
|
+
id: "0003",
|
|
930
|
+
name: "High Tier",
|
|
931
|
+
activity: "Show",
|
|
932
|
+
conditions: { MapTier: ">= 11" },
|
|
933
|
+
actions: { PlayAlertSound: { id: "1", volume: 300 } },
|
|
934
934
|
branches: [],
|
|
935
935
|
location: {
|
|
936
936
|
start: {
|
|
@@ -946,11 +946,11 @@ Show "Map Section"
|
|
|
946
946
|
},
|
|
947
947
|
},
|
|
948
948
|
{
|
|
949
|
-
id:
|
|
950
|
-
name:
|
|
951
|
-
activity:
|
|
952
|
-
conditions: { MapTier:
|
|
953
|
-
actions: { PlayAlertSound: { id:
|
|
949
|
+
id: "0004",
|
|
950
|
+
name: "Middle Tier",
|
|
951
|
+
activity: "Show",
|
|
952
|
+
conditions: { MapTier: ">= 6" },
|
|
953
|
+
actions: { PlayAlertSound: { id: "2", volume: 300 } },
|
|
954
954
|
branches: [],
|
|
955
955
|
location: {
|
|
956
956
|
start: {
|
|
@@ -1000,7 +1000,7 @@ Show "Map Section"
|
|
|
1000
1000
|
t.deepEqual(result, expected)
|
|
1001
1001
|
})
|
|
1002
1002
|
|
|
1003
|
-
test(
|
|
1003
|
+
test("parse : nested mixin", (t) => {
|
|
1004
1004
|
const script = outdent`
|
|
1005
1005
|
Show "Map Section"
|
|
1006
1006
|
Class "Maps"
|
|
@@ -1026,23 +1026,23 @@ Show "Map Section"
|
|
|
1026
1026
|
|
|
1027
1027
|
const expected = [
|
|
1028
1028
|
{
|
|
1029
|
-
id:
|
|
1030
|
-
name:
|
|
1031
|
-
activity:
|
|
1029
|
+
id: "0005",
|
|
1030
|
+
name: "Map Section",
|
|
1031
|
+
activity: "Show",
|
|
1032
1032
|
conditions: {
|
|
1033
|
-
Class: { ope:
|
|
1033
|
+
Class: { ope: "=", vals: ["Maps"] },
|
|
1034
1034
|
},
|
|
1035
1035
|
actions: {},
|
|
1036
1036
|
branches: [
|
|
1037
1037
|
{
|
|
1038
|
-
name:
|
|
1039
|
-
type:
|
|
1038
|
+
name: "Rarity",
|
|
1039
|
+
type: "Mixin",
|
|
1040
1040
|
blocks: [
|
|
1041
1041
|
{
|
|
1042
|
-
id:
|
|
1043
|
-
name:
|
|
1044
|
-
activity:
|
|
1045
|
-
conditions: { Rarity:
|
|
1042
|
+
id: "0001",
|
|
1043
|
+
name: "Rare",
|
|
1044
|
+
activity: "Show",
|
|
1045
|
+
conditions: { Rarity: "Rare" },
|
|
1046
1046
|
actions: { SetBackgroundColor: { rgb: { r: 255, g: 0, b: 0 }, alpha: 100 } },
|
|
1047
1047
|
branches: [],
|
|
1048
1048
|
location: {
|
|
@@ -1059,22 +1059,22 @@ Show "Map Section"
|
|
|
1059
1059
|
},
|
|
1060
1060
|
},
|
|
1061
1061
|
{
|
|
1062
|
-
id:
|
|
1063
|
-
name:
|
|
1064
|
-
activity:
|
|
1065
|
-
conditions: { Rarity:
|
|
1062
|
+
id: "0004",
|
|
1063
|
+
name: "Magic",
|
|
1064
|
+
activity: "Hide",
|
|
1065
|
+
conditions: { Rarity: "Magic" },
|
|
1066
1066
|
actions: {},
|
|
1067
1067
|
branches: [
|
|
1068
1068
|
{
|
|
1069
|
-
name:
|
|
1070
|
-
type:
|
|
1069
|
+
name: "Tier",
|
|
1070
|
+
type: "Mixin",
|
|
1071
1071
|
blocks: [
|
|
1072
1072
|
{
|
|
1073
|
-
id:
|
|
1074
|
-
name:
|
|
1075
|
-
activity:
|
|
1076
|
-
conditions: { MapTier:
|
|
1077
|
-
actions: { PlayAlertSound: { id:
|
|
1073
|
+
id: "0002",
|
|
1074
|
+
name: "High Tier",
|
|
1075
|
+
activity: "Show",
|
|
1076
|
+
conditions: { MapTier: ">= 11" },
|
|
1077
|
+
actions: { PlayAlertSound: { id: "1", volume: 300 } },
|
|
1078
1078
|
branches: [],
|
|
1079
1079
|
location: {
|
|
1080
1080
|
start: {
|
|
@@ -1090,11 +1090,11 @@ Show "Map Section"
|
|
|
1090
1090
|
},
|
|
1091
1091
|
},
|
|
1092
1092
|
{
|
|
1093
|
-
id:
|
|
1094
|
-
name:
|
|
1095
|
-
activity:
|
|
1096
|
-
conditions: { MapTier:
|
|
1097
|
-
actions: { PlayAlertSound: { id:
|
|
1093
|
+
id: "0003",
|
|
1094
|
+
name: "Middle Tier",
|
|
1095
|
+
activity: "Show",
|
|
1096
|
+
conditions: { MapTier: ">= 6" },
|
|
1097
|
+
actions: { PlayAlertSound: { id: "2", volume: 300 } },
|
|
1098
1098
|
branches: [],
|
|
1099
1099
|
location: {
|
|
1100
1100
|
start: {
|