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,10 +0,0 @@
1
- [
2
- {
3
- "type": 1,
4
- "path": "Textures\\Footman.blp"
5
- },
6
- {
7
- "type": 0,
8
- "path": "BloodElfLieutenant.blp"
9
- }
10
- ]
@@ -1,111 +0,0 @@
1
- {
2
- "map": {
3
- "name": "TRIGSTR_012",
4
- "author": "TRIGSTR_015",
5
- "description": "TRIGSTR_014",
6
- "recommendedPlayers": "TRIGSTR_013",
7
- "playableArea": {
8
- "width": 52,
9
- "height": 52
10
- },
11
- "mainTileType": "V",
12
- "flags": {
13
- "hideMinimapInPreview": false,
14
- "modifyAllyPriorities": false,
15
- "isMeleeMap": false,
16
- "unknown1": false,
17
- "maskedPartiallyVisible": true,
18
- "fixedPlayerSetting": false,
19
- "useCustomForces": false,
20
- "useCustomTechtree": false,
21
- "useCustomAbilities": false,
22
- "useCustomUpgrades": false,
23
- "unknown2": true,
24
- "waterWavesOnCliffShores": true,
25
- "waterWavesOnRollingShores": true,
26
- "unknown3": true,
27
- "unknown4": true,
28
- "unknown5": true
29
- }
30
- },
31
- "loadingScreen": {
32
- "background": 2,
33
- "path": "",
34
- "text": "TRIGSTR_018",
35
- "title": "TRIGSTR_016",
36
- "subtitle": "TRIGSTR_017"
37
- },
38
- "prologue": {
39
- "path": "",
40
- "text": "",
41
- "title": "",
42
- "subtitle": ""
43
- },
44
- "fog": {
45
- "type": 0,
46
- "startHeight": 3000,
47
- "endHeight": 5000,
48
- "density": 0.5,
49
- "color": [
50
- 0,
51
- 0,
52
- 0,
53
- 255
54
- ]
55
- },
56
- "camera": {
57
- "bounds": [
58
- -2816,
59
- -3328,
60
- 2816,
61
- 2816,
62
- -2816,
63
- 2816,
64
- 2816,
65
- -3328
66
- ],
67
- "complements": [
68
- 6,
69
- 6,
70
- 4,
71
- 8
72
- ]
73
- },
74
- "players": [
75
- {
76
- "name": "TRIGSTR_001",
77
- "startingPos": {
78
- "x": 128,
79
- "y": 320,
80
- "fixed": false
81
- },
82
- "playerNum": 0,
83
- "type": 1,
84
- "race": 1
85
- }
86
- ],
87
- "forces": [
88
- {
89
- "flags": {
90
- "allied": false,
91
- "alliedVictory": false,
92
- "shareVision": false,
93
- "shareUnitControl": false,
94
- "shareAdvUnitControl": false
95
- },
96
- "players": -1,
97
- "name": "TRIGSTR_002"
98
- }
99
- ],
100
- "saves": 9,
101
- "editorVersion": 6060,
102
- "globalWeather": "RAlr",
103
- "customSoundEnvironment": "",
104
- "customLightEnv": "0",
105
- "water": [
106
- 255,
107
- 150,
108
- 80,
109
- 255
110
- ]
111
- }
@@ -1,31 +0,0 @@
1
- {
2
- "original": {
3
- "Amls": [
4
- {
5
- "id": "abuf",
6
- "type": "string",
7
- "level": 1,
8
- "column": 0,
9
- "value": ""
10
- },
11
- {
12
- "id": "aran",
13
- "type": "unreal",
14
- "level": 1,
15
- "column": 0,
16
- "value": 900
17
- }
18
- ]
19
- },
20
- "custom": {
21
- "A000:Absk": [
22
- {
23
- "id": "anam",
24
- "type": "string",
25
- "level": 0,
26
- "column": 0,
27
- "value": "TRIGSTR_008"
28
- }
29
- ]
30
- }
31
- }
@@ -1,24 +0,0 @@
1
- {
2
- "original": {
3
- "BHav": [
4
- {
5
- "id": "fube",
6
- "type": "string",
7
- "level": 0,
8
- "column": 0,
9
- "value": "TRIGSTR_009"
10
- }
11
- ]
12
- },
13
- "custom": {
14
- "B000:BUan": [
15
- {
16
- "id": "fnam",
17
- "type": "string",
18
- "level": 0,
19
- "column": 0,
20
- "value": "TRIGSTR_010"
21
- }
22
- ]
23
- }
24
- }
@@ -1,31 +0,0 @@
1
- {
2
- "original": {
3
- "KTtw": [
4
- {
5
- "id": "bmmr",
6
- "type": "int",
7
- "level": 0,
8
- "column": 0,
9
- "value": 50
10
- }
11
- ]
12
- },
13
- "custom": {
14
- "B000:LTbs": [
15
- {
16
- "id": "bnam",
17
- "type": "string",
18
- "level": 0,
19
- "column": 0,
20
- "value": "TRIGSTR_005"
21
- },
22
- {
23
- "id": "bfvi",
24
- "type": "int",
25
- "level": 0,
26
- "column": 0,
27
- "value": 1
28
- }
29
- ]
30
- }
31
- }
@@ -1,24 +0,0 @@
1
- {
2
- "original": {
3
- "LOt1": [
4
- {
5
- "id": "dnam",
6
- "type": "string",
7
- "level": 0,
8
- "column": 0,
9
- "value": "TRIGSTR_006"
10
- }
11
- ]
12
- },
13
- "custom": {
14
- "D000:LOsk": [
15
- {
16
- "id": "dnam",
17
- "type": "string",
18
- "level": 0,
19
- "column": 0,
20
- "value": "TRIGSTR_007"
21
- }
22
- ]
23
- }
24
- }
@@ -1,45 +0,0 @@
1
- {
2
- "original": {
3
- "afac": [
4
- {
5
- "id": "iclr",
6
- "type": "int",
7
- "level": 0,
8
- "column": 0,
9
- "value": 50
10
- },
11
- {
12
- "id": "iclg",
13
- "type": "int",
14
- "level": 0,
15
- "column": 0,
16
- "value": 50
17
- },
18
- {
19
- "id": "iclb",
20
- "type": "int",
21
- "level": 0,
22
- "column": 0,
23
- "value": 50
24
- }
25
- ]
26
- },
27
- "custom": {
28
- "I000:ratf": [
29
- {
30
- "id": "unam",
31
- "type": "string",
32
- "level": 0,
33
- "column": 0,
34
- "value": "TRIGSTR_004"
35
- },
36
- {
37
- "id": "igol",
38
- "type": "int",
39
- "level": 0,
40
- "column": 0,
41
- "value": 10000
42
- }
43
- ]
44
- }
45
- }
@@ -1,45 +0,0 @@
1
- {
2
- "original": {
3
- "hfoo": [
4
- {
5
- "id": "utco",
6
- "type": "int",
7
- "level": 0,
8
- "column": 0,
9
- "value": 3
10
- },
11
- {
12
- "id": "umvs",
13
- "type": "int",
14
- "level": 0,
15
- "column": 0,
16
- "value": 290
17
- }
18
- ]
19
- },
20
- "custom": {
21
- "n000:nrac": [
22
- {
23
- "id": "unam",
24
- "type": "string",
25
- "level": 0,
26
- "column": 0,
27
- "value": "TRIGSTR_003"
28
- },
29
- {
30
- "id": "uabi",
31
- "type": "string",
32
- "level": 0,
33
- "column": 0,
34
- "value": "Avul"
35
- },
36
- {
37
- "id": "usca",
38
- "type": "real",
39
- "level": 0,
40
- "column": 0,
41
- "value": 1.2
42
- }
43
- ]
44
- }
45
- }
@@ -1,31 +0,0 @@
1
- {
2
- "original": {
3
- "Rhan": [
4
- {
5
- "id": "gba1",
6
- "type": "unreal",
7
- "level": 0,
8
- "column": 0,
9
- "value": 200
10
- }
11
- ]
12
- },
13
- "custom": {
14
- "R000:Rhme": [
15
- {
16
- "id": "gnam",
17
- "type": "string",
18
- "level": 1,
19
- "column": 0,
20
- "value": "TRIGSTR_011"
21
- },
22
- {
23
- "id": "gtib",
24
- "type": "int",
25
- "level": 0,
26
- "column": 0,
27
- "value": 120
28
- }
29
- ]
30
- }
31
- }
@@ -1,36 +0,0 @@
1
- [
2
- {
3
- "name": "Region 000",
4
- "id": 0,
5
- "weatherEffect": "MEds",
6
- "ambientSound": "gg_snd_RainAmbience",
7
- "color": [
8
- 128,
9
- 128,
10
- 255
11
- ],
12
- "position": {
13
- "left": -160,
14
- "bottom": 64,
15
- "right": 416,
16
- "top": 608
17
- }
18
- },
19
- {
20
- "name": "TavernRegion",
21
- "id": 1,
22
- "weatherEffect": "",
23
- "ambientSound": "",
24
- "color": [
25
- 0,
26
- 0,
27
- 0
28
- ],
29
- "position": {
30
- "left": 288,
31
- "bottom": 2272,
32
- "right": 480,
33
- "top": 2528
34
- }
35
- }
36
- ]
@@ -1,46 +0,0 @@
1
- [
2
- {
3
- "name": "gg_snd_ArthasTheme",
4
- "path": "Sound\\Music\\mp3Music\\ArthasTheme.mp3",
5
- "volume": 0,
6
- "pitch": 0,
7
- "channel": 0,
8
- "flags": {
9
- "looping": false,
10
- "3dSound": false,
11
- "stopOutOfRange": false,
12
- "music": true
13
- },
14
- "fadeRate": {
15
- "in": 10,
16
- "out": 10
17
- },
18
- "distance": {
19
- "min": 0,
20
- "max": 0,
21
- "cutoff": 0
22
- }
23
- },
24
- {
25
- "name": "gg_snd_RainAmbience",
26
- "path": "Sound\\Ambient\\RainAmbience.wav",
27
- "volume": 110,
28
- "pitch": 1.3,
29
- "channel": -1,
30
- "flags": {
31
- "looping": true,
32
- "3dSound": false,
33
- "stopOutOfRange": false,
34
- "music": false
35
- },
36
- "fadeRate": {
37
- "in": 15,
38
- "out": 14
39
- },
40
- "distance": {
41
- "min": 4294967296,
42
- "max": 4294967296,
43
- "cutoff": 4294967296
44
- }
45
- }
46
- ]
@@ -1,83 +0,0 @@
1
- [
2
- {
3
- "id": 1,
4
- "text": "Player 1"
5
- },
6
- {
7
- "id": 2,
8
- "text": "Force 1"
9
- },
10
- {
11
- "id": 3,
12
- "text": "Richy",
13
- "comment": "// Units: n000 (Richy), Name (Name)"
14
- },
15
- {
16
- "id": 4,
17
- "text": "Custom Claws",
18
- "comment": "// Items: I000 (Custom Claws), Name (Name)"
19
- },
20
- {
21
- "id": 5,
22
- "text": "Custom Destructable",
23
- "comment": "// Destructibles: B000 (Custom Destructable), Name (Name)"
24
- },
25
- {
26
- "id": 6,
27
- "text": "Trashy Trash",
28
- "comment": "// Doodads: LOt1 (Trashy Trash), Name (Name)"
29
- },
30
- {
31
- "id": 7,
32
- "text": "Custom Doodad",
33
- "comment": "// Doodads: D000 (Custom Doodad), Name (Name)"
34
- },
35
- {
36
- "id": 8,
37
- "text": "Custom Ability",
38
- "comment": "// Abilities: A000 (Custom Ability), Name (Name)"
39
- },
40
- {
41
- "id": 9,
42
- "text": "This is a modified original buff",
43
- "comment": "// Buffs/Effects: BHav (), Buffubertip (Tooltip - Extended)"
44
- },
45
- {
46
- "id": 10,
47
- "text": "Custom Buff",
48
- "comment": "// Buffs/Effects: B000 (Custom Buff), EditorName (Name (Editor Only))"
49
- },
50
- {
51
- "id": 11,
52
- "text": "Custom Upgrade",
53
- "comment": "// Upgrades: R000 (Iron Forged Swords,Steel Forged Swords,Mithril Forged Swords), Name (Name)"
54
- },
55
- {
56
- "id": 12,
57
- "text": "Mayhem Meadow"
58
- },
59
- {
60
- "id": 13,
61
- "text": "1"
62
- },
63
- {
64
- "id": 14,
65
- "text": "A peaceful village near a small pond. Why is it called Mayhem Meadow? Legend has it that..."
66
- },
67
- {
68
- "id": 15,
69
- "text": "WC3MapTranslator"
70
- },
71
- {
72
- "id": 16,
73
- "text": "Loading screen title"
74
- },
75
- {
76
- "id": 17,
77
- "text": "Loading screen subtitle"
78
- },
79
- {
80
- "id": 18,
81
- "text": "Wow -- WC3MapTranslator makes this so easy!"
82
- }
83
- ]