wc3maptranslator 4.0.0 → 4.0.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.
Files changed (118) hide show
  1. package/LICENSE.md +23 -23
  2. package/dist/AngleConverter.d.ts +3 -0
  3. package/dist/AngleConverter.d.ts.map +1 -0
  4. package/dist/AngleConverter.js +12 -0
  5. package/dist/AngleConverter.js.map +1 -0
  6. package/dist/CommonInterfaces.d.ts +17 -0
  7. package/dist/CommonInterfaces.d.ts.map +1 -0
  8. package/dist/CommonInterfaces.js +3 -0
  9. package/dist/CommonInterfaces.js.map +1 -0
  10. package/dist/HexBuffer.d.ts +15 -0
  11. package/dist/HexBuffer.d.ts.map +1 -0
  12. package/{lib/HexBuffer.ts → dist/HexBuffer.js} +71 -81
  13. package/dist/HexBuffer.js.map +1 -0
  14. package/dist/W3Buffer.d.ts +14 -0
  15. package/dist/W3Buffer.d.ts.map +1 -0
  16. package/{lib/W3Buffer.ts → dist/W3Buffer.js} +63 -69
  17. package/dist/W3Buffer.js.map +1 -0
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/{index.js → dist/index.js} +1 -1
  21. package/dist/index.js.map +1 -0
  22. package/dist/translators/CamerasTranslator.d.ts +23 -0
  23. package/dist/translators/CamerasTranslator.d.ts.map +1 -0
  24. package/{lib/translators/CamerasTranslator.ts → dist/translators/CamerasTranslator.js} +76 -101
  25. package/dist/translators/CamerasTranslator.js.map +1 -0
  26. package/dist/translators/DoodadsTranslator.d.ts +23 -0
  27. package/dist/translators/DoodadsTranslator.d.ts.map +1 -0
  28. package/{lib/translators/DoodadsTranslator.ts → dist/translators/DoodadsTranslator.js} +146 -178
  29. package/dist/translators/DoodadsTranslator.js.map +1 -0
  30. package/dist/translators/ImportsTranslator.d.ts +16 -0
  31. package/dist/translators/ImportsTranslator.d.ts.map +1 -0
  32. package/{lib/translators/ImportsTranslator.ts → dist/translators/ImportsTranslator.js} +62 -78
  33. package/dist/translators/ImportsTranslator.js.map +1 -0
  34. package/dist/translators/InfoTranslator.d.ts +124 -0
  35. package/dist/translators/InfoTranslator.d.ts.map +1 -0
  36. package/{lib/translators/InfoTranslator.ts → dist/translators/InfoTranslator.js} +422 -584
  37. package/dist/translators/InfoTranslator.js.map +1 -0
  38. package/dist/translators/ObjectsTranslator.d.ts +23 -0
  39. package/dist/translators/ObjectsTranslator.d.ts.map +1 -0
  40. package/{lib/translators/ObjectsTranslator.ts → dist/translators/ObjectsTranslator.js} +91 -125
  41. package/dist/translators/ObjectsTranslator.js.map +1 -0
  42. package/dist/translators/RegionsTranslator.d.ts +22 -0
  43. package/dist/translators/RegionsTranslator.d.ts.map +1 -0
  44. package/{lib/translators/RegionsTranslator.ts → dist/translators/RegionsTranslator.js} +96 -123
  45. package/dist/translators/RegionsTranslator.js.map +1 -0
  46. package/dist/translators/SoundsTranslator.d.ts +35 -0
  47. package/dist/translators/SoundsTranslator.d.ts.map +1 -0
  48. package/{lib/translators/SoundsTranslator.ts → dist/translators/SoundsTranslator.js} +183 -237
  49. package/dist/translators/SoundsTranslator.js.map +1 -0
  50. package/dist/translators/StringsTranslator.d.ts +7 -0
  51. package/dist/translators/StringsTranslator.d.ts.map +1 -0
  52. package/{lib/translators/StringsTranslator.ts → dist/translators/StringsTranslator.js} +44 -49
  53. package/dist/translators/StringsTranslator.js.map +1 -0
  54. package/dist/translators/TerrainTranslator.d.ts +33 -0
  55. package/dist/translators/TerrainTranslator.d.ts.map +1 -0
  56. package/{lib/translators/TerrainTranslator.ts → dist/translators/TerrainTranslator.js} +221 -276
  57. package/dist/translators/TerrainTranslator.js.map +1 -0
  58. package/dist/translators/UnitsTranslator.d.ts +40 -0
  59. package/dist/translators/UnitsTranslator.d.ts.map +1 -0
  60. package/{lib/translators/UnitsTranslator.ts → dist/translators/UnitsTranslator.js} +199 -261
  61. package/dist/translators/UnitsTranslator.js.map +1 -0
  62. package/{lib/translators/index.ts → dist/translators/index.d.ts} +11 -10
  63. package/dist/translators/index.d.ts.map +1 -0
  64. package/dist/translators/index.js +23 -0
  65. package/dist/translators/index.js.map +1 -0
  66. package/package.json +4 -2
  67. package/.codeclimate.yml +0 -12
  68. package/.editorconfig +0 -8
  69. package/.eslintignore +0 -5
  70. package/.eslintrc +0 -55
  71. package/.github/workflows/codeql-analysis.yml +0 -54
  72. package/.nycrc +0 -18
  73. package/.travis.yml +0 -23
  74. package/CHANGELOG.md +0 -73
  75. package/index.ts +0 -14
  76. package/lib/AngleConverter.ts +0 -7
  77. package/lib/CommonInterfaces.ts +0 -22
  78. package/test/.mocharc.json +0 -4
  79. package/test/AngleConverterTest.ts +0 -18
  80. package/test/HexBufferTest.ts +0 -170
  81. package/test/TranslatorReversion.ts +0 -218
  82. package/test/W3BufferTest.ts +0 -50
  83. package/test/data/cameras.json +0 -16
  84. package/test/data/doodads.json +0 -2730
  85. package/test/data/imports.json +0 -386
  86. package/test/data/info.json +0 -250
  87. package/test/data/obj-abilities.json +0 -4892
  88. package/test/data/obj-buffs.json +0 -38
  89. package/test/data/obj-destructables.json +0 -31
  90. package/test/data/obj-doodads.json +0 -38
  91. package/test/data/obj-items.json +0 -31
  92. package/test/data/obj-units.json +0 -40
  93. package/test/data/obj-upgrades.json +0 -38
  94. package/test/data/regions.json +0 -206
  95. package/test/data/sounds.json +0 -50
  96. package/test/data/strings.json +0 -115
  97. package/test/data/terrain.json +0 -1
  98. package/test/data/units.json +0 -452
  99. package/test/data/war3map.doo +0 -0
  100. package/test/data/war3map.imp +0 -0
  101. package/test/data/war3map.j +0 -3442
  102. package/test/data/war3map.shd +0 -0
  103. package/test/data/war3map.w3a +0 -0
  104. package/test/data/war3map.w3b +0 -0
  105. package/test/data/war3map.w3c +0 -0
  106. package/test/data/war3map.w3d +0 -0
  107. package/test/data/war3map.w3e +0 -0
  108. package/test/data/war3map.w3h +0 -0
  109. package/test/data/war3map.w3i +0 -0
  110. package/test/data/war3map.w3q +0 -0
  111. package/test/data/war3map.w3r +0 -0
  112. package/test/data/war3map.w3s +0 -0
  113. package/test/data/war3map.w3t +0 -0
  114. package/test/data/war3map.w3u +0 -0
  115. package/test/data/war3map.wts +0 -631
  116. package/test/data/war3mapUnits.doo +0 -0
  117. package/tsconfig.json +0 -25
  118. package/tslint.json +0 -47
@@ -1,261 +1,199 @@
1
- import { HexBuffer } from '../HexBuffer';
2
- import { W3Buffer } from '../W3Buffer';
3
- import { WarResult, JsonResult, angle } from '../CommonInterfaces'
4
-
5
- interface Unit {
6
- type: string;
7
- variation: number;
8
- position: number[];
9
- rotation: angle;
10
- scale: number[];
11
- hero: Hero;
12
- inventory: Inventory[];
13
- abilities: Abilities[];
14
- player: number;
15
- hitpoints: number;
16
- mana: number;
17
- gold: number;
18
- targetAcquisition: number; // (-1 = normal, -2 = camp),
19
- color: number;
20
- id: number;
21
- }
22
-
23
- interface Hero {
24
- level: number;
25
- str: number;
26
- agi: number;
27
- int: number;
28
- }
29
-
30
- interface Inventory {
31
- slot: number; // the int is 0-based, but json format wants 1-6
32
- type: string; // Item ID
33
- }
34
-
35
- interface Abilities {
36
- ability: string; // Ability ID
37
- active: boolean; // autocast active? 0=no, 1=active
38
- level: number;
39
- }
40
-
41
- export abstract class UnitsTranslator {
42
-
43
- public static jsonToWar(unitsJson: Unit[]): WarResult {
44
- const outBufferToWar = new HexBuffer();
45
-
46
- /*
47
- * Header
48
- */
49
- outBufferToWar.addChars('W3do');
50
- outBufferToWar.addInt(8);
51
- outBufferToWar.addInt(11);
52
- outBufferToWar.addInt(unitsJson.length); // number of units
53
-
54
- /*
55
- * Body
56
- */
57
- unitsJson.forEach((unit) => {
58
- outBufferToWar.addChars(unit.type); // type
59
- outBufferToWar.addInt(unit.variation || 0); // variation
60
- outBufferToWar.addFloat(unit.position[0]); // position x
61
- outBufferToWar.addFloat(unit.position[1]); // position y
62
- outBufferToWar.addFloat(unit.position[2]); // position z
63
- outBufferToWar.addFloat(unit.rotation || 0); // rotation angle
64
-
65
- if (!unit.scale) unit.scale = [1, 1, 1];
66
- outBufferToWar.addFloat(unit.scale[0] || 1); // scale x
67
- outBufferToWar.addFloat(unit.scale[1] || 1); // scale y
68
- outBufferToWar.addFloat(unit.scale[2] || 1); // scale z
69
-
70
- // Unit flags
71
- outBufferToWar.addByte(0); // UNSUPPORTED: flags
72
-
73
- outBufferToWar.addInt(0); // unknown
74
-
75
- outBufferToWar.addInt(unit.player); // player #
76
- outBufferToWar.addByte(0); // (byte unknown - 0)
77
- outBufferToWar.addByte(0); // (byte unknown - 0)
78
- outBufferToWar.addInt(unit.hitpoints); // hitpoints
79
- outBufferToWar.addInt(unit.mana || 0); // mana
80
-
81
- // if(unit.droppedItemSets.length === 0) { // needs to be -1 if no item sets
82
- outBufferToWar.addInt(-1);
83
- // }
84
- // else {
85
- // outBuffer.addInt(unit.droppedItemSets.length); // # item sets
86
- // }
87
- // UNSUPPORTED: dropped items
88
- outBufferToWar.addInt(0); // dropped item sets
89
-
90
- // Gold amount
91
- // Required if unit is a gold mine
92
- // Optional (set to zero) if unit is not a gold mine
93
- outBufferToWar.addInt(unit.gold);
94
- // outBufferToWar.addInt(unit.type === 'ngol' ? unit.gold : 0);
95
-
96
- outBufferToWar.addFloat(unit.targetAcquisition || 0); // target acquisition
97
-
98
- // Unit hero attributes
99
- // Can be left unspecified, but values can never be below 1
100
- if (!unit.hero) unit.hero = { level: 1, str: 1, agi: 1, int: 1 };
101
- outBufferToWar.addInt(unit.hero.level);
102
- outBufferToWar.addInt(unit.hero.str);
103
- outBufferToWar.addInt(unit.hero.agi);
104
- outBufferToWar.addInt(unit.hero.int);
105
-
106
- // Inventory - - -
107
- if (!unit.inventory) unit.inventory = [];
108
- outBufferToWar.addInt(unit.inventory.length); // # items in inventory
109
- unit.inventory.forEach((item) => {
110
- outBufferToWar.addInt(item.slot - 1); // zero-index item slot
111
- outBufferToWar.addChars(item.type);
112
- });
113
-
114
- // Modified abilities - - -
115
- if (!unit.abilities) unit.abilities = [];
116
- outBufferToWar.addInt(unit.abilities.length); // # modified abilities
117
- unit.abilities.forEach((ability) => {
118
- outBufferToWar.addChars(ability.ability); // ability string
119
- outBufferToWar.addInt(+ability.active); // 0 = not active, 1 = active
120
- outBufferToWar.addInt(ability.level);
121
- });
122
-
123
- outBufferToWar.addInt(0);
124
- outBufferToWar.addInt(1);
125
-
126
- outBufferToWar.addInt(unit.color || unit.player); // custom color, defaults to owning player
127
- outBufferToWar.addInt(0); // outBuffer.addInt(unit.waygate); // UNSUPPORTED - waygate
128
- outBufferToWar.addInt(unit.id); // id
129
- });
130
-
131
- return {
132
- errors: [],
133
- buffer: outBufferToWar.getBuffer()
134
- };
135
- }
136
-
137
- public static warToJson(buffer: Buffer): JsonResult<Unit[]> {
138
- const result = [];
139
- const outBufferToJSON = new W3Buffer(buffer);
140
-
141
- const fileId = outBufferToJSON.readChars(4), // W3do for doodad file
142
- fileVersion = outBufferToJSON.readInt(), // File version = 7
143
- subVersion = outBufferToJSON.readInt(), // 0B 00 00 00
144
- numUnits = outBufferToJSON.readInt(); // # of units
145
-
146
- for (let i = 0; i < numUnits; i++) {
147
- const unit: Unit = {
148
- type: '',
149
- variation: -1,
150
- position: [0, 0, 0],
151
- rotation: 0,
152
- scale: [0, 0, 0],
153
- hero: { level: 1, str: 1, agi: 1, int: 1 },
154
- inventory: [],
155
- abilities: [],
156
- player: 0,
157
- hitpoints: -1,
158
- mana: -1,
159
- gold: 0,
160
- targetAcquisition: -1,
161
- color: -1,
162
- id: -1
163
- };
164
-
165
- unit.type = outBufferToJSON.readChars(4); // (iDNR = random item, uDNR = random unit)
166
- unit.variation = outBufferToJSON.readInt();
167
- unit.position = [outBufferToJSON.readFloat(), outBufferToJSON.readFloat(), outBufferToJSON.readFloat()]; // X Y Z coords
168
- unit.rotation = outBufferToJSON.readFloat();
169
- unit.scale = [outBufferToJSON.readFloat(), outBufferToJSON.readFloat(), outBufferToJSON.readFloat()]; // X Y Z scaling
170
-
171
- // UNSUPPORTED: flags
172
- const flags = outBufferToJSON.readByte();
173
-
174
- outBufferToJSON.readInt(); // Unknown
175
-
176
- unit.player = outBufferToJSON.readInt(); // (player1 = 0, 16=neutral passive); note: wc3 patch now has 24 max players
177
-
178
- outBufferToJSON.readByte(); // unknown
179
- outBufferToJSON.readByte(); // unknown
180
-
181
- unit.hitpoints = outBufferToJSON.readInt(); // -1 = use default
182
- unit.mana = outBufferToJSON.readInt(); // -1 = use default, 0 = unit doesn't have mana
183
-
184
- const droppedItemSetPtr = outBufferToJSON.readInt(),
185
- numDroppedItemSets = outBufferToJSON.readInt();
186
- for (let j = 0; j < numDroppedItemSets; j++) {
187
- const numDroppableItems = outBufferToJSON.readInt();
188
- for (let k = 0; k < numDroppableItems; k++) {
189
- outBufferToJSON.readChars(4); // Item ID
190
- outBufferToJSON.readInt(); // % chance to drop
191
- }
192
- }
193
-
194
- unit.gold = outBufferToJSON.readInt();
195
- unit.targetAcquisition = outBufferToJSON.readFloat(); // (-1 = normal, -2 = camp)
196
-
197
- unit.hero = {
198
- level: outBufferToJSON.readInt(), // non-hero units = 1
199
- str: outBufferToJSON.readInt(),
200
- agi: outBufferToJSON.readInt(),
201
- int: outBufferToJSON.readInt()
202
- };
203
-
204
- const numItemsInventory = outBufferToJSON.readInt();
205
- for (let j = 0; j < numItemsInventory; j++) {
206
- unit.inventory.push({
207
- slot: outBufferToJSON.readInt() + 1, // the int is 0-based, but json format wants 1-6
208
- type: outBufferToJSON.readChars(4) // Item ID
209
- });
210
- }
211
-
212
- const numModifiedAbil = outBufferToJSON.readInt();
213
- for (let j = 0; j < numModifiedAbil; j++) {
214
- unit.abilities.push({
215
- ability: outBufferToJSON.readChars(4), // Ability ID
216
- active: !!outBufferToJSON.readInt(), // autocast active? 0=no, 1=active
217
- level: outBufferToJSON.readInt()
218
- });
219
- }
220
-
221
- const randFlag = outBufferToJSON.readInt(); // random unit/item flag "r" (for uDNR units and iDNR items)
222
- if (randFlag === 0) {
223
- // 0 = Any neutral passive building/item, in this case we have
224
- // byte[3]: level of the random unit/item,-1 = any (this is actually interpreted as a 24-bit number)
225
- // byte: item class of the random item, 0 = any, 1 = permanent ... (this is 0 for units)
226
- // r is also 0 for non random units/items so we have these 4 bytes anyway (even if the id wasnt uDNR or iDNR)
227
- outBufferToJSON.readByte();
228
- outBufferToJSON.readByte();
229
- outBufferToJSON.readByte();
230
- outBufferToJSON.readByte();
231
- } else if (randFlag === 1) {
232
- // 1 = random unit from random group (defined in the w3i), in this case we have
233
- // int: unit group number (which group from the global table)
234
- // int: position number (which column of this group)
235
- // the column should of course have the item flag set (in the w3i) if this is a random item
236
- outBufferToJSON.readInt();
237
- outBufferToJSON.readInt();
238
- } else if (randFlag === 2) {
239
- // 2 = random unit from custom table, in this case we have
240
- // int: number "n" of different available units
241
- // then we have n times a random unit structure
242
- const numDiffAvailUnits = outBufferToJSON.readInt();
243
- for (let k = 0; k < numDiffAvailUnits; k++) {
244
- outBufferToJSON.readChars(4); // Unit ID
245
- outBufferToJSON.readInt(); // % chance
246
- }
247
- }
248
-
249
- unit.color = outBufferToJSON.readInt();
250
- outBufferToJSON.readInt(); // UNSUPPORTED: waygate (-1 = deactivated, else its the creation number of the target rect as in war3map.w3r)
251
- unit.id = outBufferToJSON.readInt();
252
-
253
- result.push(unit);
254
- }
255
-
256
- return {
257
- errors: [],
258
- json: result
259
- };
260
- }
261
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnitsTranslator = void 0;
4
+ const HexBuffer_1 = require("../HexBuffer");
5
+ const W3Buffer_1 = require("../W3Buffer");
6
+ class UnitsTranslator {
7
+ static jsonToWar(unitsJson) {
8
+ const outBufferToWar = new HexBuffer_1.HexBuffer();
9
+ /*
10
+ * Header
11
+ */
12
+ outBufferToWar.addChars('W3do');
13
+ outBufferToWar.addInt(8);
14
+ outBufferToWar.addInt(11);
15
+ outBufferToWar.addInt(unitsJson.length); // number of units
16
+ /*
17
+ * Body
18
+ */
19
+ unitsJson.forEach((unit) => {
20
+ outBufferToWar.addChars(unit.type); // type
21
+ outBufferToWar.addInt(unit.variation || 0); // variation
22
+ outBufferToWar.addFloat(unit.position[0]); // position x
23
+ outBufferToWar.addFloat(unit.position[1]); // position y
24
+ outBufferToWar.addFloat(unit.position[2]); // position z
25
+ outBufferToWar.addFloat(unit.rotation || 0); // rotation angle
26
+ if (!unit.scale)
27
+ unit.scale = [1, 1, 1];
28
+ outBufferToWar.addFloat(unit.scale[0] || 1); // scale x
29
+ outBufferToWar.addFloat(unit.scale[1] || 1); // scale y
30
+ outBufferToWar.addFloat(unit.scale[2] || 1); // scale z
31
+ // Unit flags
32
+ outBufferToWar.addByte(0); // UNSUPPORTED: flags
33
+ outBufferToWar.addInt(0); // unknown
34
+ outBufferToWar.addInt(unit.player); // player #
35
+ outBufferToWar.addByte(0); // (byte unknown - 0)
36
+ outBufferToWar.addByte(0); // (byte unknown - 0)
37
+ outBufferToWar.addInt(unit.hitpoints); // hitpoints
38
+ outBufferToWar.addInt(unit.mana || 0); // mana
39
+ // if(unit.droppedItemSets.length === 0) { // needs to be -1 if no item sets
40
+ outBufferToWar.addInt(-1);
41
+ // }
42
+ // else {
43
+ // outBuffer.addInt(unit.droppedItemSets.length); // # item sets
44
+ // }
45
+ // UNSUPPORTED: dropped items
46
+ outBufferToWar.addInt(0); // dropped item sets
47
+ // Gold amount
48
+ // Required if unit is a gold mine
49
+ // Optional (set to zero) if unit is not a gold mine
50
+ outBufferToWar.addInt(unit.gold);
51
+ // outBufferToWar.addInt(unit.type === 'ngol' ? unit.gold : 0);
52
+ outBufferToWar.addFloat(unit.targetAcquisition || 0); // target acquisition
53
+ // Unit hero attributes
54
+ // Can be left unspecified, but values can never be below 1
55
+ if (!unit.hero)
56
+ unit.hero = { level: 1, str: 1, agi: 1, int: 1 };
57
+ outBufferToWar.addInt(unit.hero.level);
58
+ outBufferToWar.addInt(unit.hero.str);
59
+ outBufferToWar.addInt(unit.hero.agi);
60
+ outBufferToWar.addInt(unit.hero.int);
61
+ // Inventory - - -
62
+ if (!unit.inventory)
63
+ unit.inventory = [];
64
+ outBufferToWar.addInt(unit.inventory.length); // # items in inventory
65
+ unit.inventory.forEach((item) => {
66
+ outBufferToWar.addInt(item.slot - 1); // zero-index item slot
67
+ outBufferToWar.addChars(item.type);
68
+ });
69
+ // Modified abilities - - -
70
+ if (!unit.abilities)
71
+ unit.abilities = [];
72
+ outBufferToWar.addInt(unit.abilities.length); // # modified abilities
73
+ unit.abilities.forEach((ability) => {
74
+ outBufferToWar.addChars(ability.ability); // ability string
75
+ outBufferToWar.addInt(+ability.active); // 0 = not active, 1 = active
76
+ outBufferToWar.addInt(ability.level);
77
+ });
78
+ outBufferToWar.addInt(0);
79
+ outBufferToWar.addInt(1);
80
+ outBufferToWar.addInt(unit.color || unit.player); // custom color, defaults to owning player
81
+ outBufferToWar.addInt(0); // outBuffer.addInt(unit.waygate); // UNSUPPORTED - waygate
82
+ outBufferToWar.addInt(unit.id); // id
83
+ });
84
+ return {
85
+ errors: [],
86
+ buffer: outBufferToWar.getBuffer()
87
+ };
88
+ }
89
+ static warToJson(buffer) {
90
+ const result = [];
91
+ const outBufferToJSON = new W3Buffer_1.W3Buffer(buffer);
92
+ const fileId = outBufferToJSON.readChars(4), // W3do for doodad file
93
+ fileVersion = outBufferToJSON.readInt(), // File version = 7
94
+ subVersion = outBufferToJSON.readInt(), // 0B 00 00 00
95
+ numUnits = outBufferToJSON.readInt(); // # of units
96
+ for (let i = 0; i < numUnits; i++) {
97
+ const unit = {
98
+ type: '',
99
+ variation: -1,
100
+ position: [0, 0, 0],
101
+ rotation: 0,
102
+ scale: [0, 0, 0],
103
+ hero: { level: 1, str: 1, agi: 1, int: 1 },
104
+ inventory: [],
105
+ abilities: [],
106
+ player: 0,
107
+ hitpoints: -1,
108
+ mana: -1,
109
+ gold: 0,
110
+ targetAcquisition: -1,
111
+ color: -1,
112
+ id: -1
113
+ };
114
+ unit.type = outBufferToJSON.readChars(4); // (iDNR = random item, uDNR = random unit)
115
+ unit.variation = outBufferToJSON.readInt();
116
+ unit.position = [outBufferToJSON.readFloat(), outBufferToJSON.readFloat(), outBufferToJSON.readFloat()]; // X Y Z coords
117
+ unit.rotation = outBufferToJSON.readFloat();
118
+ unit.scale = [outBufferToJSON.readFloat(), outBufferToJSON.readFloat(), outBufferToJSON.readFloat()]; // X Y Z scaling
119
+ // UNSUPPORTED: flags
120
+ const flags = outBufferToJSON.readByte();
121
+ outBufferToJSON.readInt(); // Unknown
122
+ unit.player = outBufferToJSON.readInt(); // (player1 = 0, 16=neutral passive); note: wc3 patch now has 24 max players
123
+ outBufferToJSON.readByte(); // unknown
124
+ outBufferToJSON.readByte(); // unknown
125
+ unit.hitpoints = outBufferToJSON.readInt(); // -1 = use default
126
+ unit.mana = outBufferToJSON.readInt(); // -1 = use default, 0 = unit doesn't have mana
127
+ const droppedItemSetPtr = outBufferToJSON.readInt(), numDroppedItemSets = outBufferToJSON.readInt();
128
+ for (let j = 0; j < numDroppedItemSets; j++) {
129
+ const numDroppableItems = outBufferToJSON.readInt();
130
+ for (let k = 0; k < numDroppableItems; k++) {
131
+ outBufferToJSON.readChars(4); // Item ID
132
+ outBufferToJSON.readInt(); // % chance to drop
133
+ }
134
+ }
135
+ unit.gold = outBufferToJSON.readInt();
136
+ unit.targetAcquisition = outBufferToJSON.readFloat(); // (-1 = normal, -2 = camp)
137
+ unit.hero = {
138
+ level: outBufferToJSON.readInt(),
139
+ str: outBufferToJSON.readInt(),
140
+ agi: outBufferToJSON.readInt(),
141
+ int: outBufferToJSON.readInt()
142
+ };
143
+ const numItemsInventory = outBufferToJSON.readInt();
144
+ for (let j = 0; j < numItemsInventory; j++) {
145
+ unit.inventory.push({
146
+ slot: outBufferToJSON.readInt() + 1,
147
+ type: outBufferToJSON.readChars(4) // Item ID
148
+ });
149
+ }
150
+ const numModifiedAbil = outBufferToJSON.readInt();
151
+ for (let j = 0; j < numModifiedAbil; j++) {
152
+ unit.abilities.push({
153
+ ability: outBufferToJSON.readChars(4),
154
+ active: !!outBufferToJSON.readInt(),
155
+ level: outBufferToJSON.readInt()
156
+ });
157
+ }
158
+ const randFlag = outBufferToJSON.readInt(); // random unit/item flag "r" (for uDNR units and iDNR items)
159
+ if (randFlag === 0) {
160
+ // 0 = Any neutral passive building/item, in this case we have
161
+ // byte[3]: level of the random unit/item,-1 = any (this is actually interpreted as a 24-bit number)
162
+ // byte: item class of the random item, 0 = any, 1 = permanent ... (this is 0 for units)
163
+ // r is also 0 for non random units/items so we have these 4 bytes anyway (even if the id wasnt uDNR or iDNR)
164
+ outBufferToJSON.readByte();
165
+ outBufferToJSON.readByte();
166
+ outBufferToJSON.readByte();
167
+ outBufferToJSON.readByte();
168
+ }
169
+ else if (randFlag === 1) {
170
+ // 1 = random unit from random group (defined in the w3i), in this case we have
171
+ // int: unit group number (which group from the global table)
172
+ // int: position number (which column of this group)
173
+ // the column should of course have the item flag set (in the w3i) if this is a random item
174
+ outBufferToJSON.readInt();
175
+ outBufferToJSON.readInt();
176
+ }
177
+ else if (randFlag === 2) {
178
+ // 2 = random unit from custom table, in this case we have
179
+ // int: number "n" of different available units
180
+ // then we have n times a random unit structure
181
+ const numDiffAvailUnits = outBufferToJSON.readInt();
182
+ for (let k = 0; k < numDiffAvailUnits; k++) {
183
+ outBufferToJSON.readChars(4); // Unit ID
184
+ outBufferToJSON.readInt(); // % chance
185
+ }
186
+ }
187
+ unit.color = outBufferToJSON.readInt();
188
+ outBufferToJSON.readInt(); // UNSUPPORTED: waygate (-1 = deactivated, else its the creation number of the target rect as in war3map.w3r)
189
+ unit.id = outBufferToJSON.readInt();
190
+ result.push(unit);
191
+ }
192
+ return {
193
+ errors: [],
194
+ json: result
195
+ };
196
+ }
197
+ }
198
+ exports.UnitsTranslator = UnitsTranslator;
199
+ //# sourceMappingURL=UnitsTranslator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnitsTranslator.js","sourceRoot":"","sources":["../../src/translators/UnitsTranslator.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAC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vC,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,6GAA6G;YACxI,IAAI,CAAC,EAAE,GAAG,eAAe,CAAC,OAAO,EAAE,CAAC;YAEpC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrB;QAED,OAAO;YACH,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,MAAM;SACf,CAAC;IACN,CAAC;CACJ;AA5ND,0CA4NC"}
@@ -1,10 +1,11 @@
1
- export * from './CamerasTranslator';
2
- export * from './DoodadsTranslator';
3
- export * from './ImportsTranslator';
4
- export * from './InfoTranslator';
5
- export * from './RegionsTranslator';
6
- export * from './SoundsTranslator';
7
- export * from './StringsTranslator';
8
- export * from './TerrainTranslator';
9
- export * from './UnitsTranslator';
10
- export * from './ObjectsTranslator';
1
+ export * from './CamerasTranslator';
2
+ export * from './DoodadsTranslator';
3
+ export * from './ImportsTranslator';
4
+ export * from './InfoTranslator';
5
+ export * from './RegionsTranslator';
6
+ export * from './SoundsTranslator';
7
+ export * from './StringsTranslator';
8
+ export * from './TerrainTranslator';
9
+ export * from './UnitsTranslator';
10
+ export * from './ObjectsTranslator';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/translators/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./CamerasTranslator"), exports);
14
+ __exportStar(require("./DoodadsTranslator"), exports);
15
+ __exportStar(require("./ImportsTranslator"), exports);
16
+ __exportStar(require("./InfoTranslator"), exports);
17
+ __exportStar(require("./RegionsTranslator"), exports);
18
+ __exportStar(require("./SoundsTranslator"), exports);
19
+ __exportStar(require("./StringsTranslator"), exports);
20
+ __exportStar(require("./TerrainTranslator"), exports);
21
+ __exportStar(require("./UnitsTranslator"), exports);
22
+ __exportStar(require("./ObjectsTranslator"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/translators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,mDAAiC;AACjC,sDAAoC;AACpC,qDAAmC;AACnC,sDAAoC;AACpC,sDAAoC;AACpC,oDAAkC;AAClC,sDAAoC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wc3maptranslator",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Module to translate between `war3map` and `json` formats for WarCraft III .w3x maps",
5
5
  "keywords": [
6
6
  "wc3",
@@ -13,7 +13,9 @@
13
13
  "json",
14
14
  "w3x"
15
15
  ],
16
- "main": "index.js",
16
+ "main": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "files": ["dist/**"],
17
19
  "scripts": {
18
20
  "build": "tsc --build",
19
21
  "lint": "tslint --project .",
package/.codeclimate.yml DELETED
@@ -1,12 +0,0 @@
1
- plugins:
2
- tslint:
3
- enabled: true
4
- config: tslint.json
5
- fixme:
6
- enabled: true
7
- ratings:
8
- paths:
9
- - "**.ts"
10
- - "**.tsx"
11
- exclude_paths:
12
- - test/
package/.editorconfig DELETED
@@ -1,8 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 4
6
- charset = utf-8
7
- trim_trailing_whitespace = false
8
- insert_final_newline = false
package/.eslintignore DELETED
@@ -1,5 +0,0 @@
1
- /.git/*
2
- /.nyc_output/*
3
- /coverage/*
4
- /node_modules/*
5
- /test/*