wc3maptranslator 3.0.3 → 4.0.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.
Files changed (100) hide show
  1. package/.codeclimate.yml +0 -1
  2. package/.eslintignore +0 -1
  3. package/.github/workflows/codeql-analysis.yml +54 -0
  4. package/.nycrc +1 -2
  5. package/.travis.yml +1 -2
  6. package/CHANGELOG.md +78 -0
  7. package/LICENSE.md +23 -0
  8. package/README.md +68 -75
  9. package/index.js +11 -15
  10. package/index.ts +12 -30
  11. package/lib/CommonInterfaces.ts +22 -0
  12. package/lib/HexBuffer.ts +11 -14
  13. package/lib/W3Buffer.ts +7 -3
  14. package/lib/translators/CamerasTranslator.ts +36 -41
  15. package/lib/translators/DoodadsTranslator.ts +57 -55
  16. package/lib/translators/ImportsTranslator.ts +29 -31
  17. package/lib/translators/InfoTranslator.ts +252 -204
  18. package/lib/translators/{object/ObjectsTranslator.ts → ObjectsTranslator.ts} +84 -82
  19. package/lib/translators/RegionsTranslator.ts +40 -58
  20. package/lib/translators/SoundsTranslator.ts +112 -96
  21. package/lib/translators/StringsTranslator.ts +23 -49
  22. package/lib/translators/TerrainTranslator.ts +166 -97
  23. package/lib/translators/UnitsTranslator.ts +98 -97
  24. package/lib/translators/index.ts +0 -1
  25. package/package.json +23 -16
  26. package/test/.mocharc.json +4 -0
  27. package/test/HexBufferTest.ts +11 -15
  28. package/test/TranslatorReversion.ts +104 -115
  29. package/test/W3BufferTest.ts +19 -13
  30. package/test/data/cameras.json +16 -0
  31. package/test/data/doodads.json +2730 -0
  32. package/test/data/imports.json +386 -0
  33. package/test/data/info.json +250 -0
  34. package/test/data/obj-abilities.json +4892 -0
  35. package/test/data/obj-buffs.json +38 -0
  36. package/test/data/obj-destructables.json +31 -0
  37. package/test/data/obj-doodads.json +38 -0
  38. package/test/data/obj-items.json +31 -0
  39. package/test/data/obj-units.json +40 -0
  40. package/test/data/obj-upgrades.json +38 -0
  41. package/test/data/regions.json +206 -0
  42. package/test/data/sounds.json +50 -0
  43. package/test/data/strings.json +115 -0
  44. package/test/data/terrain.json +1 -0
  45. package/test/data/units.json +452 -0
  46. package/test/data/war3map.doo +0 -0
  47. package/test/data/war3map.imp +0 -0
  48. package/test/data/war3map.j +3442 -0
  49. package/test/data/war3map.shd +0 -0
  50. package/test/data/war3map.w3a +0 -0
  51. package/test/data/war3map.w3b +0 -0
  52. package/test/data/war3map.w3c +0 -0
  53. package/test/data/war3map.w3d +0 -0
  54. package/test/data/war3map.w3e +0 -0
  55. package/test/data/war3map.w3h +0 -0
  56. package/test/data/war3map.w3i +0 -0
  57. package/test/data/war3map.w3q +0 -0
  58. package/test/data/war3map.w3r +0 -0
  59. package/test/data/war3map.w3s +0 -0
  60. package/test/data/war3map.w3t +0 -0
  61. package/test/data/war3map.w3u +0 -0
  62. package/test/data/war3map.wts +631 -0
  63. package/test/data/war3mapUnits.doo +0 -0
  64. package/examples/index.js +0 -123
  65. package/examples/index.ts +0 -134
  66. package/examples/json/cameras.json +0 -16
  67. package/examples/json/doodads.json +0 -28499
  68. package/examples/json/imports.json +0 -10
  69. package/examples/json/info.json +0 -111
  70. package/examples/json/object-abilities.json +0 -31
  71. package/examples/json/object-buffs.json +0 -24
  72. package/examples/json/object-destructables.json +0 -31
  73. package/examples/json/object-doodads.json +0 -24
  74. package/examples/json/object-items.json +0 -45
  75. package/examples/json/object-units.json +0 -45
  76. package/examples/json/object-upgrades.json +0 -31
  77. package/examples/json/regions.json +0 -36
  78. package/examples/json/sounds.json +0 -46
  79. package/examples/json/strings.json +0 -83
  80. package/examples/json/terrain.json +0 -46633
  81. package/examples/json/units.json +0 -332
  82. package/examples/package.json +0 -17
  83. package/examples/tsconfig.json +0 -27
  84. package/examples/war/war3map.doo +0 -0
  85. package/examples/war/war3map.imp +0 -0
  86. package/examples/war/war3map.w3a +0 -0
  87. package/examples/war/war3map.w3b +0 -0
  88. package/examples/war/war3map.w3c +0 -0
  89. package/examples/war/war3map.w3d +0 -0
  90. package/examples/war/war3map.w3e +0 -0
  91. package/examples/war/war3map.w3h +0 -0
  92. package/examples/war/war3map.w3i +0 -0
  93. package/examples/war/war3map.w3q +0 -0
  94. package/examples/war/war3map.w3r +0 -0
  95. package/examples/war/war3map.w3s +0 -0
  96. package/examples/war/war3map.w3t +0 -0
  97. package/examples/war/war3map.w3u +0 -0
  98. package/examples/war/war3map.wts +0 -99
  99. package/lib/translators/index.js +0 -16
  100. package/test/mocha.opts +0 -4
@@ -1,332 +0,0 @@
1
- [
2
- {
3
- "type": "hlum",
4
- "variation": 0,
5
- "position": [
6
- -1184,
7
- -1696,
8
- 255.75
9
- ],
10
- "rotation": 4.712,
11
- "scale": [
12
- 1,
13
- 1,
14
- 1
15
- ],
16
- "hero": {
17
- "level": 1,
18
- "str": 0,
19
- "agi": 0,
20
- "int": 0
21
- },
22
- "inventory": [],
23
- "abilities": [],
24
- "player": 27,
25
- "hitpoints": -1,
26
- "mana": -1,
27
- "gold": 12500,
28
- "targetAcquisition": -1,
29
- "color": -1,
30
- "id": 0
31
- },
32
- {
33
- "type": "owtw",
34
- "variation": 0,
35
- "position": [
36
- -1280,
37
- 1280,
38
- 255.75
39
- ],
40
- "rotation": 4.712,
41
- "scale": [
42
- 1,
43
- 1,
44
- 1
45
- ],
46
- "hero": {
47
- "level": 1,
48
- "str": 0,
49
- "agi": 0,
50
- "int": 0
51
- },
52
- "inventory": [],
53
- "abilities": [],
54
- "player": 27,
55
- "hitpoints": -1,
56
- "mana": -1,
57
- "gold": 12500,
58
- "targetAcquisition": -1,
59
- "color": -1,
60
- "id": 1
61
- },
62
- {
63
- "type": "nmrk",
64
- "variation": 0,
65
- "position": [
66
- 128,
67
- 384,
68
- 255.75
69
- ],
70
- "rotation": 4.712,
71
- "scale": [
72
- 1,
73
- 1,
74
- 1
75
- ],
76
- "hero": {
77
- "level": 1,
78
- "str": 0,
79
- "agi": 0,
80
- "int": 0
81
- },
82
- "inventory": [],
83
- "abilities": [],
84
- "player": 27,
85
- "hitpoints": -1,
86
- "mana": -1,
87
- "gold": 12500,
88
- "targetAcquisition": -1,
89
- "color": -1,
90
- "id": 2
91
- },
92
- {
93
- "type": "ntav",
94
- "variation": 0,
95
- "position": [
96
- 768,
97
- 2112,
98
- 255.75
99
- ],
100
- "rotation": 4.712,
101
- "scale": [
102
- 1,
103
- 1,
104
- 1
105
- ],
106
- "hero": {
107
- "level": 1,
108
- "str": 0,
109
- "agi": 0,
110
- "int": 0
111
- },
112
- "inventory": [],
113
- "abilities": [],
114
- "player": 27,
115
- "hitpoints": -1,
116
- "mana": -1,
117
- "gold": 12500,
118
- "targetAcquisition": -1,
119
- "color": -1,
120
- "id": 3
121
- },
122
- {
123
- "type": "tint",
124
- "variation": 0,
125
- "position": [
126
- 41.535,
127
- 195.081,
128
- 255.75
129
- ],
130
- "rotation": 4.712,
131
- "scale": [
132
- 1,
133
- 1,
134
- 1
135
- ],
136
- "hero": {
137
- "level": 0,
138
- "str": 0,
139
- "agi": 0,
140
- "int": 0
141
- },
142
- "inventory": [],
143
- "abilities": [],
144
- "player": 27,
145
- "hitpoints": 0,
146
- "mana": 0,
147
- "gold": 0,
148
- "targetAcquisition": 0,
149
- "color": -1,
150
- "id": 4
151
- },
152
- {
153
- "type": "lmbr",
154
- "variation": 0,
155
- "position": [
156
- 302.101,
157
- 540.076,
158
- 255.75
159
- ],
160
- "rotation": 4.712,
161
- "scale": [
162
- 1,
163
- 1,
164
- 1
165
- ],
166
- "hero": {
167
- "level": 0,
168
- "str": 0,
169
- "agi": 0,
170
- "int": 0
171
- },
172
- "inventory": [],
173
- "abilities": [],
174
- "player": 27,
175
- "hitpoints": 0,
176
- "mana": 0,
177
- "gold": 0,
178
- "targetAcquisition": 0,
179
- "color": -1,
180
- "id": 5
181
- },
182
- {
183
- "type": "kgal",
184
- "variation": 0,
185
- "position": [
186
- 871.944,
187
- 1928.922,
188
- 255.75
189
- ],
190
- "rotation": 4.712,
191
- "scale": [
192
- 1,
193
- 1,
194
- 1
195
- ],
196
- "hero": {
197
- "level": 0,
198
- "str": 0,
199
- "agi": 0,
200
- "int": 0
201
- },
202
- "inventory": [],
203
- "abilities": [],
204
- "player": 27,
205
- "hitpoints": 0,
206
- "mana": 0,
207
- "gold": 0,
208
- "targetAcquisition": 0,
209
- "color": -1,
210
- "id": 6
211
- },
212
- {
213
- "type": "htow",
214
- "variation": 0,
215
- "position": [
216
- 2112,
217
- -1152,
218
- 432.5
219
- ],
220
- "rotation": 4.712,
221
- "scale": [
222
- 1,
223
- 1,
224
- 1
225
- ],
226
- "hero": {
227
- "level": 1,
228
- "str": 0,
229
- "agi": 0,
230
- "int": 0
231
- },
232
- "inventory": [],
233
- "abilities": [],
234
- "player": 27,
235
- "hitpoints": -1,
236
- "mana": -1,
237
- "gold": 12500,
238
- "targetAcquisition": -1,
239
- "color": -1,
240
- "id": 7
241
- },
242
- {
243
- "type": "sloc",
244
- "variation": 0,
245
- "position": [
246
- 128,
247
- 320,
248
- 255.75
249
- ],
250
- "rotation": 4.712,
251
- "scale": [
252
- 1,
253
- 1,
254
- 1
255
- ],
256
- "hero": {
257
- "level": 0,
258
- "str": 0,
259
- "agi": 0,
260
- "int": 0
261
- },
262
- "inventory": [],
263
- "abilities": [],
264
- "player": 0,
265
- "hitpoints": 0,
266
- "mana": 0,
267
- "gold": 0,
268
- "targetAcquisition": 0,
269
- "color": -1,
270
- "id": 8
271
- },
272
- {
273
- "type": "hfoo",
274
- "variation": 0,
275
- "position": [
276
- 282.054,
277
- 1308.762,
278
- 255.75
279
- ],
280
- "rotation": 4.482,
281
- "scale": [
282
- 1,
283
- 1,
284
- 1
285
- ],
286
- "hero": {
287
- "level": 1,
288
- "str": 0,
289
- "agi": 0,
290
- "int": 0
291
- },
292
- "inventory": [],
293
- "abilities": [],
294
- "player": 0,
295
- "hitpoints": -1,
296
- "mana": -1,
297
- "gold": 12500,
298
- "targetAcquisition": -1,
299
- "color": -1,
300
- "id": 9
301
- },
302
- {
303
- "type": "n000",
304
- "variation": 0,
305
- "position": [
306
- 62.242,
307
- 1304.974,
308
- 255.75
309
- ],
310
- "rotation": -0.764,
311
- "scale": [
312
- 1,
313
- 1,
314
- 1
315
- ],
316
- "hero": {
317
- "level": 1,
318
- "str": 0,
319
- "agi": 0,
320
- "int": 0
321
- },
322
- "inventory": [],
323
- "abilities": [],
324
- "player": 0,
325
- "hitpoints": -1,
326
- "mana": -1,
327
- "gold": 12500,
328
- "targetAcquisition": -1,
329
- "color": -1,
330
- "id": 10
331
- }
332
- ]
@@ -1,17 +0,0 @@
1
- {
2
- "name": "examples",
3
- "version": "2.0.0",
4
- "description": "Examples of using WC3MapTranslator to generate translate between war3map and JSON",
5
- "main": "index.js",
6
- "scripts": {
7
- "build": "tsc --build",
8
- "start": "npm run build && node index.js",
9
- "test": "echo \"Error: no test specified\" && exit 1"
10
- },
11
- "author": "ChiefOfGxBxL",
12
- "license": "MIT",
13
- "dependencies": {
14
- "@types/node": "^12.12.21",
15
- "typescript": "^3.7.4"
16
- }
17
- }
@@ -1,27 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "types": [
4
- "mocha",
5
- "node"
6
- ],
7
- "traceResolution": true,
8
- "declaration": true,
9
- "declarationMap": true,
10
- "target": "es2016",
11
- "module": "commonjs",
12
- "outDir": "./",
13
- "rootDir": "./",
14
- "sourceMap": true,
15
- "incremental": true,
16
- "tsBuildInfoFile": "./.tsbuildinfo",
17
- "esModuleInterop": true,
18
- "noEmit": false,
19
- },
20
- "references": [
21
- { "path": "../" }
22
- ],
23
- "exclude": [],
24
- "include": [
25
- "./**/*"
26
- ]
27
- }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,99 +0,0 @@
1
- STRING 1
2
- {
3
- Player 1
4
- }
5
-
6
- STRING 2
7
- {
8
- Force 1
9
- }
10
-
11
- STRING 3
12
- // Units: n000 (Richy), Name (Name)
13
- {
14
- Richy
15
- }
16
-
17
- STRING 4
18
- // Items: I000 (Custom Claws), Name (Name)
19
- {
20
- Custom Claws
21
- }
22
-
23
- STRING 5
24
- // Destructibles: B000 (Custom Destructable), Name (Name)
25
- {
26
- Custom Destructable
27
- }
28
-
29
- STRING 6
30
- // Doodads: LOt1 (Trashy Trash), Name (Name)
31
- {
32
- Trashy Trash
33
- }
34
-
35
- STRING 7
36
- // Doodads: D000 (Custom Doodad), Name (Name)
37
- {
38
- Custom Doodad
39
- }
40
-
41
- STRING 8
42
- // Abilities: A000 (Custom Ability), Name (Name)
43
- {
44
- Custom Ability
45
- }
46
-
47
- STRING 9
48
- // Buffs/Effects: BHav (), Buffubertip (Tooltip - Extended)
49
- {
50
- This is a modified original buff
51
- }
52
-
53
- STRING 10
54
- // Buffs/Effects: B000 (Custom Buff), EditorName (Name (Editor Only))
55
- {
56
- Custom Buff
57
- }
58
-
59
- STRING 11
60
- // Upgrades: R000 (Iron Forged Swords,Steel Forged Swords,Mithril Forged Swords), Name (Name)
61
- {
62
- Custom Upgrade
63
- }
64
-
65
- STRING 12
66
- {
67
- Mayhem Meadow
68
- }
69
-
70
- STRING 13
71
- {
72
- 1
73
- }
74
-
75
- STRING 14
76
- {
77
- A peaceful village near a small pond. Why is it called Mayhem Meadow? Legend has it that...
78
- }
79
-
80
- STRING 15
81
- {
82
- WC3MapTranslator
83
- }
84
-
85
- STRING 16
86
- {
87
- Loading screen title
88
- }
89
-
90
- STRING 17
91
- {
92
- Loading screen subtitle
93
- }
94
-
95
- STRING 18
96
- {
97
- Wow -- WC3MapTranslator makes this so easy!
98
- }
99
-
@@ -1,16 +0,0 @@
1
- "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./CamerasTranslator"));
7
- __export(require("./DoodadsTranslator"));
8
- __export(require("./ImportsTranslator"));
9
- __export(require("./InfoTranslator"));
10
- __export(require("./RegionsTranslator"));
11
- __export(require("./SoundsTranslator"));
12
- __export(require("./StringsTranslator"));
13
- __export(require("./TerrainTranslator"));
14
- __export(require("./UnitsTranslator"));
15
- __export(require("./ObjectsTranslator"));
16
- //# sourceMappingURL=index.js.map
package/test/mocha.opts DELETED
@@ -1,4 +0,0 @@
1
- # mocha.opts (https://mochajs.org/#mochaopts)
2
- --require ts-node/register
3
- --require source-map-support/register
4
- --recursive