wc3maptranslator 4.0.0 → 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 (34) hide show
  1. package/.github/workflows/codeql-analysis.yml +54 -54
  2. package/CHANGELOG.md +5 -0
  3. package/LICENSE.md +23 -23
  4. package/lib/HexBuffer.ts +81 -81
  5. package/lib/W3Buffer.ts +69 -69
  6. package/lib/translators/CamerasTranslator.ts +101 -101
  7. package/lib/translators/DoodadsTranslator.ts +178 -178
  8. package/lib/translators/ImportsTranslator.ts +78 -78
  9. package/lib/translators/InfoTranslator.ts +584 -584
  10. package/lib/translators/RegionsTranslator.ts +123 -123
  11. package/lib/translators/SoundsTranslator.ts +237 -237
  12. package/lib/translators/StringsTranslator.ts +49 -49
  13. package/lib/translators/TerrainTranslator.ts +276 -276
  14. package/lib/translators/UnitsTranslator.ts +261 -261
  15. package/lib/translators/index.ts +10 -10
  16. package/package.json +2 -1
  17. package/test/HexBufferTest.ts +170 -170
  18. package/test/TranslatorReversion.ts +218 -218
  19. package/test/data/cameras.json +15 -15
  20. package/test/data/doodads.json +2729 -2729
  21. package/test/data/imports.json +385 -385
  22. package/test/data/info.json +249 -249
  23. package/test/data/obj-abilities.json +4891 -4891
  24. package/test/data/obj-buffs.json +37 -37
  25. package/test/data/obj-destructables.json +30 -30
  26. package/test/data/obj-doodads.json +37 -37
  27. package/test/data/obj-items.json +30 -30
  28. package/test/data/obj-units.json +39 -39
  29. package/test/data/obj-upgrades.json +37 -37
  30. package/test/data/regions.json +205 -205
  31. package/test/data/sounds.json +49 -49
  32. package/test/data/strings.json +114 -114
  33. package/test/data/terrain.json +1 -1
  34. package/test/data/units.json +451 -451
@@ -1,452 +1,452 @@
1
- [
2
- {
3
- "type": "sloc",
4
- "variation": 0,
5
- "position": [
6
- 0,
7
- -256,
8
- -128
9
- ],
10
- "rotation": 4.712,
11
- "scale": [
12
- 1,
13
- 1,
14
- 1
15
- ],
16
- "hero": {
17
- "level": 0,
18
- "str": 0,
19
- "agi": 0,
20
- "int": 0
21
- },
22
- "inventory": [],
23
- "abilities": [],
24
- "player": 0,
25
- "hitpoints": -1,
26
- "mana": -1,
27
- "gold": 0,
28
- "targetAcquisition": 0,
29
- "color": -1,
30
- "id": 1
31
- },
32
- {
33
- "type": "sloc",
34
- "variation": 11,
35
- "position": [
36
- 0,
37
- -256,
38
- -128
39
- ],
40
- "rotation": 4.712,
41
- "scale": [
42
- 1,
43
- 1,
44
- 1
45
- ],
46
- "hero": {
47
- "level": 0,
48
- "str": 0,
49
- "agi": 0,
50
- "int": 0
51
- },
52
- "inventory": [],
53
- "abilities": [],
54
- "player": 11,
55
- "hitpoints": -1,
56
- "mana": -1,
57
- "gold": 0,
58
- "targetAcquisition": 0,
59
- "color": -1,
60
- "id": 17
61
- },
62
- {
63
- "type": "sloc",
64
- "variation": 1,
65
- "position": [
66
- 0,
67
- -256,
68
- -128
69
- ],
70
- "rotation": 4.712,
71
- "scale": [
72
- 1,
73
- 1,
74
- 1
75
- ],
76
- "hero": {
77
- "level": 0,
78
- "str": 0,
79
- "agi": 0,
80
- "int": 0
81
- },
82
- "inventory": [],
83
- "abilities": [],
84
- "player": 1,
85
- "hitpoints": -1,
86
- "mana": -1,
87
- "gold": 0,
88
- "targetAcquisition": 0,
89
- "color": -1,
90
- "id": 0
91
- },
92
- {
93
- "type": "sloc",
94
- "variation": 2,
95
- "position": [
96
- 0,
97
- -256,
98
- -128
99
- ],
100
- "rotation": 4.712,
101
- "scale": [
102
- 1,
103
- 1,
104
- 1
105
- ],
106
- "hero": {
107
- "level": 0,
108
- "str": 0,
109
- "agi": 0,
110
- "int": 0
111
- },
112
- "inventory": [],
113
- "abilities": [],
114
- "player": 2,
115
- "hitpoints": -1,
116
- "mana": -1,
117
- "gold": 0,
118
- "targetAcquisition": 0,
119
- "color": -1,
120
- "id": 2
121
- },
122
- {
123
- "type": "sloc",
124
- "variation": 3,
125
- "position": [
126
- 0,
127
- -256,
128
- -128
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": 3,
145
- "hitpoints": -1,
146
- "mana": -1,
147
- "gold": 0,
148
- "targetAcquisition": 0,
149
- "color": -1,
150
- "id": 3
151
- },
152
- {
153
- "type": "sloc",
154
- "variation": 4,
155
- "position": [
156
- 0,
157
- -256,
158
- -128
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": 4,
175
- "hitpoints": -1,
176
- "mana": -1,
177
- "gold": 0,
178
- "targetAcquisition": 0,
179
- "color": -1,
180
- "id": 10
181
- },
182
- {
183
- "type": "sloc",
184
- "variation": 5,
185
- "position": [
186
- 0,
187
- -256,
188
- -128
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": 5,
205
- "hitpoints": -1,
206
- "mana": -1,
207
- "gold": 0,
208
- "targetAcquisition": 0,
209
- "color": -1,
210
- "id": 11
211
- },
212
- {
213
- "type": "sloc",
214
- "variation": 6,
215
- "position": [
216
- 0,
217
- -256,
218
- -128
219
- ],
220
- "rotation": 4.712,
221
- "scale": [
222
- 1,
223
- 1,
224
- 1
225
- ],
226
- "hero": {
227
- "level": 0,
228
- "str": 0,
229
- "agi": 0,
230
- "int": 0
231
- },
232
- "inventory": [],
233
- "abilities": [],
234
- "player": 6,
235
- "hitpoints": -1,
236
- "mana": -1,
237
- "gold": 0,
238
- "targetAcquisition": 0,
239
- "color": -1,
240
- "id": 12
241
- },
242
- {
243
- "type": "sloc",
244
- "variation": 7,
245
- "position": [
246
- 0,
247
- -256,
248
- -128
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": 7,
265
- "hitpoints": -1,
266
- "mana": -1,
267
- "gold": 0,
268
- "targetAcquisition": 0,
269
- "color": -1,
270
- "id": 13
271
- },
272
- {
273
- "type": "sloc",
274
- "variation": 8,
275
- "position": [
276
- 0,
277
- -256,
278
- -128
279
- ],
280
- "rotation": 4.712,
281
- "scale": [
282
- 1,
283
- 1,
284
- 1
285
- ],
286
- "hero": {
287
- "level": 0,
288
- "str": 0,
289
- "agi": 0,
290
- "int": 0
291
- },
292
- "inventory": [],
293
- "abilities": [],
294
- "player": 8,
295
- "hitpoints": -1,
296
- "mana": -1,
297
- "gold": 0,
298
- "targetAcquisition": 0,
299
- "color": -1,
300
- "id": 14
301
- },
302
- {
303
- "type": "sloc",
304
- "variation": 9,
305
- "position": [
306
- 0,
307
- -256,
308
- -128
309
- ],
310
- "rotation": 4.712,
311
- "scale": [
312
- 1,
313
- 1,
314
- 1
315
- ],
316
- "hero": {
317
- "level": 0,
318
- "str": 0,
319
- "agi": 0,
320
- "int": 0
321
- },
322
- "inventory": [],
323
- "abilities": [],
324
- "player": 9,
325
- "hitpoints": -1,
326
- "mana": -1,
327
- "gold": 0,
328
- "targetAcquisition": 0,
329
- "color": -1,
330
- "id": 15
331
- },
332
- {
333
- "type": "sloc",
334
- "variation": 10,
335
- "position": [
336
- 0,
337
- -256,
338
- -128
339
- ],
340
- "rotation": 4.712,
341
- "scale": [
342
- 1,
343
- 1,
344
- 1
345
- ],
346
- "hero": {
347
- "level": 0,
348
- "str": 0,
349
- "agi": 0,
350
- "int": 0
351
- },
352
- "inventory": [],
353
- "abilities": [],
354
- "player": 10,
355
- "hitpoints": -1,
356
- "mana": -1,
357
- "gold": 0,
358
- "targetAcquisition": 0,
359
- "color": -1,
360
- "id": 16
361
- },
362
- {
363
- "type": "H000",
364
- "variation": 0,
365
- "position": [
366
- 413.455,
367
- -94.833,
368
- -128
369
- ],
370
- "rotation": 1.611,
371
- "scale": [
372
- 1,
373
- 1,
374
- 1
375
- ],
376
- "hero": {
377
- "level": 1,
378
- "str": 0,
379
- "agi": 0,
380
- "int": 0
381
- },
382
- "inventory": [],
383
- "abilities": [],
384
- "player": 1,
385
- "hitpoints": -1,
386
- "mana": -1,
387
- "gold": 12500,
388
- "targetAcquisition": -1,
389
- "color": -1,
390
- "id": 4
391
- },
392
- {
393
- "type": "hpea",
394
- "variation": 0,
395
- "position": [
396
- -308.096,
397
- -542.293,
398
- -128
399
- ],
400
- "rotation": 0.657,
401
- "scale": [
402
- 1,
403
- 1,
404
- 1
405
- ],
406
- "hero": {
407
- "level": 1,
408
- "str": 0,
409
- "agi": 0,
410
- "int": 0
411
- },
412
- "inventory": [],
413
- "abilities": [],
414
- "player": 1,
415
- "hitpoints": -1,
416
- "mana": -1,
417
- "gold": 12500,
418
- "targetAcquisition": -1,
419
- "color": -1,
420
- "id": 5
421
- },
422
- {
423
- "type": "hkni",
424
- "variation": 0,
425
- "position": [
426
- -249.695,
427
- 98.257,
428
- -128
429
- ],
430
- "rotation": 4.08,
431
- "scale": [
432
- 1,
433
- 1,
434
- 1
435
- ],
436
- "hero": {
437
- "level": 1,
438
- "str": 0,
439
- "agi": 0,
440
- "int": 0
441
- },
442
- "inventory": [],
443
- "abilities": [],
444
- "player": 3,
445
- "hitpoints": -1,
446
- "mana": -1,
447
- "gold": 12500,
448
- "targetAcquisition": -1,
449
- "color": -1,
450
- "id": 6
451
- }
1
+ [
2
+ {
3
+ "type": "sloc",
4
+ "variation": 0,
5
+ "position": [
6
+ 0,
7
+ -256,
8
+ -128
9
+ ],
10
+ "rotation": 4.712,
11
+ "scale": [
12
+ 1,
13
+ 1,
14
+ 1
15
+ ],
16
+ "hero": {
17
+ "level": 0,
18
+ "str": 0,
19
+ "agi": 0,
20
+ "int": 0
21
+ },
22
+ "inventory": [],
23
+ "abilities": [],
24
+ "player": 0,
25
+ "hitpoints": -1,
26
+ "mana": -1,
27
+ "gold": 0,
28
+ "targetAcquisition": 0,
29
+ "color": -1,
30
+ "id": 1
31
+ },
32
+ {
33
+ "type": "sloc",
34
+ "variation": 11,
35
+ "position": [
36
+ 0,
37
+ -256,
38
+ -128
39
+ ],
40
+ "rotation": 4.712,
41
+ "scale": [
42
+ 1,
43
+ 1,
44
+ 1
45
+ ],
46
+ "hero": {
47
+ "level": 0,
48
+ "str": 0,
49
+ "agi": 0,
50
+ "int": 0
51
+ },
52
+ "inventory": [],
53
+ "abilities": [],
54
+ "player": 11,
55
+ "hitpoints": -1,
56
+ "mana": -1,
57
+ "gold": 0,
58
+ "targetAcquisition": 0,
59
+ "color": -1,
60
+ "id": 17
61
+ },
62
+ {
63
+ "type": "sloc",
64
+ "variation": 1,
65
+ "position": [
66
+ 0,
67
+ -256,
68
+ -128
69
+ ],
70
+ "rotation": 4.712,
71
+ "scale": [
72
+ 1,
73
+ 1,
74
+ 1
75
+ ],
76
+ "hero": {
77
+ "level": 0,
78
+ "str": 0,
79
+ "agi": 0,
80
+ "int": 0
81
+ },
82
+ "inventory": [],
83
+ "abilities": [],
84
+ "player": 1,
85
+ "hitpoints": -1,
86
+ "mana": -1,
87
+ "gold": 0,
88
+ "targetAcquisition": 0,
89
+ "color": -1,
90
+ "id": 0
91
+ },
92
+ {
93
+ "type": "sloc",
94
+ "variation": 2,
95
+ "position": [
96
+ 0,
97
+ -256,
98
+ -128
99
+ ],
100
+ "rotation": 4.712,
101
+ "scale": [
102
+ 1,
103
+ 1,
104
+ 1
105
+ ],
106
+ "hero": {
107
+ "level": 0,
108
+ "str": 0,
109
+ "agi": 0,
110
+ "int": 0
111
+ },
112
+ "inventory": [],
113
+ "abilities": [],
114
+ "player": 2,
115
+ "hitpoints": -1,
116
+ "mana": -1,
117
+ "gold": 0,
118
+ "targetAcquisition": 0,
119
+ "color": -1,
120
+ "id": 2
121
+ },
122
+ {
123
+ "type": "sloc",
124
+ "variation": 3,
125
+ "position": [
126
+ 0,
127
+ -256,
128
+ -128
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": 3,
145
+ "hitpoints": -1,
146
+ "mana": -1,
147
+ "gold": 0,
148
+ "targetAcquisition": 0,
149
+ "color": -1,
150
+ "id": 3
151
+ },
152
+ {
153
+ "type": "sloc",
154
+ "variation": 4,
155
+ "position": [
156
+ 0,
157
+ -256,
158
+ -128
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": 4,
175
+ "hitpoints": -1,
176
+ "mana": -1,
177
+ "gold": 0,
178
+ "targetAcquisition": 0,
179
+ "color": -1,
180
+ "id": 10
181
+ },
182
+ {
183
+ "type": "sloc",
184
+ "variation": 5,
185
+ "position": [
186
+ 0,
187
+ -256,
188
+ -128
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": 5,
205
+ "hitpoints": -1,
206
+ "mana": -1,
207
+ "gold": 0,
208
+ "targetAcquisition": 0,
209
+ "color": -1,
210
+ "id": 11
211
+ },
212
+ {
213
+ "type": "sloc",
214
+ "variation": 6,
215
+ "position": [
216
+ 0,
217
+ -256,
218
+ -128
219
+ ],
220
+ "rotation": 4.712,
221
+ "scale": [
222
+ 1,
223
+ 1,
224
+ 1
225
+ ],
226
+ "hero": {
227
+ "level": 0,
228
+ "str": 0,
229
+ "agi": 0,
230
+ "int": 0
231
+ },
232
+ "inventory": [],
233
+ "abilities": [],
234
+ "player": 6,
235
+ "hitpoints": -1,
236
+ "mana": -1,
237
+ "gold": 0,
238
+ "targetAcquisition": 0,
239
+ "color": -1,
240
+ "id": 12
241
+ },
242
+ {
243
+ "type": "sloc",
244
+ "variation": 7,
245
+ "position": [
246
+ 0,
247
+ -256,
248
+ -128
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": 7,
265
+ "hitpoints": -1,
266
+ "mana": -1,
267
+ "gold": 0,
268
+ "targetAcquisition": 0,
269
+ "color": -1,
270
+ "id": 13
271
+ },
272
+ {
273
+ "type": "sloc",
274
+ "variation": 8,
275
+ "position": [
276
+ 0,
277
+ -256,
278
+ -128
279
+ ],
280
+ "rotation": 4.712,
281
+ "scale": [
282
+ 1,
283
+ 1,
284
+ 1
285
+ ],
286
+ "hero": {
287
+ "level": 0,
288
+ "str": 0,
289
+ "agi": 0,
290
+ "int": 0
291
+ },
292
+ "inventory": [],
293
+ "abilities": [],
294
+ "player": 8,
295
+ "hitpoints": -1,
296
+ "mana": -1,
297
+ "gold": 0,
298
+ "targetAcquisition": 0,
299
+ "color": -1,
300
+ "id": 14
301
+ },
302
+ {
303
+ "type": "sloc",
304
+ "variation": 9,
305
+ "position": [
306
+ 0,
307
+ -256,
308
+ -128
309
+ ],
310
+ "rotation": 4.712,
311
+ "scale": [
312
+ 1,
313
+ 1,
314
+ 1
315
+ ],
316
+ "hero": {
317
+ "level": 0,
318
+ "str": 0,
319
+ "agi": 0,
320
+ "int": 0
321
+ },
322
+ "inventory": [],
323
+ "abilities": [],
324
+ "player": 9,
325
+ "hitpoints": -1,
326
+ "mana": -1,
327
+ "gold": 0,
328
+ "targetAcquisition": 0,
329
+ "color": -1,
330
+ "id": 15
331
+ },
332
+ {
333
+ "type": "sloc",
334
+ "variation": 10,
335
+ "position": [
336
+ 0,
337
+ -256,
338
+ -128
339
+ ],
340
+ "rotation": 4.712,
341
+ "scale": [
342
+ 1,
343
+ 1,
344
+ 1
345
+ ],
346
+ "hero": {
347
+ "level": 0,
348
+ "str": 0,
349
+ "agi": 0,
350
+ "int": 0
351
+ },
352
+ "inventory": [],
353
+ "abilities": [],
354
+ "player": 10,
355
+ "hitpoints": -1,
356
+ "mana": -1,
357
+ "gold": 0,
358
+ "targetAcquisition": 0,
359
+ "color": -1,
360
+ "id": 16
361
+ },
362
+ {
363
+ "type": "H000",
364
+ "variation": 0,
365
+ "position": [
366
+ 413.455,
367
+ -94.833,
368
+ -128
369
+ ],
370
+ "rotation": 1.611,
371
+ "scale": [
372
+ 1,
373
+ 1,
374
+ 1
375
+ ],
376
+ "hero": {
377
+ "level": 1,
378
+ "str": 0,
379
+ "agi": 0,
380
+ "int": 0
381
+ },
382
+ "inventory": [],
383
+ "abilities": [],
384
+ "player": 1,
385
+ "hitpoints": -1,
386
+ "mana": -1,
387
+ "gold": 12500,
388
+ "targetAcquisition": -1,
389
+ "color": -1,
390
+ "id": 4
391
+ },
392
+ {
393
+ "type": "hpea",
394
+ "variation": 0,
395
+ "position": [
396
+ -308.096,
397
+ -542.293,
398
+ -128
399
+ ],
400
+ "rotation": 0.657,
401
+ "scale": [
402
+ 1,
403
+ 1,
404
+ 1
405
+ ],
406
+ "hero": {
407
+ "level": 1,
408
+ "str": 0,
409
+ "agi": 0,
410
+ "int": 0
411
+ },
412
+ "inventory": [],
413
+ "abilities": [],
414
+ "player": 1,
415
+ "hitpoints": -1,
416
+ "mana": -1,
417
+ "gold": 12500,
418
+ "targetAcquisition": -1,
419
+ "color": -1,
420
+ "id": 5
421
+ },
422
+ {
423
+ "type": "hkni",
424
+ "variation": 0,
425
+ "position": [
426
+ -249.695,
427
+ 98.257,
428
+ -128
429
+ ],
430
+ "rotation": 4.08,
431
+ "scale": [
432
+ 1,
433
+ 1,
434
+ 1
435
+ ],
436
+ "hero": {
437
+ "level": 1,
438
+ "str": 0,
439
+ "agi": 0,
440
+ "int": 0
441
+ },
442
+ "inventory": [],
443
+ "abilities": [],
444
+ "player": 3,
445
+ "hitpoints": -1,
446
+ "mana": -1,
447
+ "gold": 12500,
448
+ "targetAcquisition": -1,
449
+ "color": -1,
450
+ "id": 6
451
+ }
452
452
  ]