warscript 0.0.1-dev.ba37a78 → 0.0.1-dev.c59dd14
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/attributes.d.ts +13 -0
- package/attributes.lua +16 -0
- package/core/types/handle.d.ts +2 -1
- package/core/types/handle.lua +5 -0
- package/core/types/missile.d.ts +2 -2
- package/core/types/missile.lua +8 -2
- package/engine/behaviour/ability/apply-unit-behavior.d.ts +1 -2
- package/engine/behaviour/ability/instant-impact.lua +4 -0
- package/engine/behaviour/ability.d.ts +8 -1
- package/engine/behaviour/ability.lua +62 -0
- package/engine/internal/unit-missile-launch.lua +1 -1
- package/engine/internal/unit.d.ts +36 -8
- package/engine/internal/unit.lua +215 -63
- package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
- package/engine/object-data/entry/ability-type/mine.lua +39 -0
- package/engine/object-data/entry/ability-type/spirit-touch.d.ts +2 -2
- package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
- package/engine/object-data/entry/unit-type.d.ts +42 -1
- package/engine/object-data/entry/unit-type.lua +378 -50
- package/engine/random.d.ts +5 -0
- package/engine/random.lua +9 -0
- package/engine/standard/entries/unit-type.d.ts +42 -1
- package/engine/standard/entries/unit-type.lua +42 -1
- package/engine/standard/fields/ability.d.ts +1 -1
- package/engine/standard/fields/ability.lua +1 -1
- package/package.json +3 -4
- package/string.d.ts +14 -0
- package/string.lua +9 -0
- package/utility/types.d.ts +2 -2
|
@@ -3,6 +3,7 @@ local __TS__Class = ____lualib.__TS__Class
|
|
|
3
3
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
6
|
+
local __TS__ArrayIsArray = ____lualib.__TS__ArrayIsArray
|
|
6
7
|
local ____exports = {}
|
|
7
8
|
local ____arrays = require("utility.arrays")
|
|
8
9
|
local arrayOfNotNull = ____arrays.arrayOfNotNull
|
|
@@ -28,21 +29,21 @@ function UnitTypeWeapon.prototype.____constructor(self, unitType, index)
|
|
|
28
29
|
end
|
|
29
30
|
__TS__SetDescriptor(
|
|
30
31
|
UnitTypeWeapon.prototype,
|
|
31
|
-
"
|
|
32
|
+
"attackType",
|
|
32
33
|
{
|
|
33
34
|
get = function(self)
|
|
34
35
|
local ____self_0 = self.unitType
|
|
35
|
-
return ____self_0.
|
|
36
|
+
return ____self_0.getStringField(
|
|
36
37
|
____self_0,
|
|
37
|
-
"
|
|
38
|
+
("ua" .. tostring(self.index)) .. "t"
|
|
38
39
|
)
|
|
39
40
|
end,
|
|
40
|
-
set = function(self,
|
|
41
|
+
set = function(self, attackType)
|
|
41
42
|
local ____self_1 = self.unitType
|
|
42
|
-
____self_1.
|
|
43
|
+
____self_1.setStringField(
|
|
43
44
|
____self_1,
|
|
44
|
-
"
|
|
45
|
-
|
|
45
|
+
("ua" .. tostring(self.index)) .. "t",
|
|
46
|
+
attackType
|
|
46
47
|
)
|
|
47
48
|
end
|
|
48
49
|
},
|
|
@@ -50,19 +51,150 @@ __TS__SetDescriptor(
|
|
|
50
51
|
)
|
|
51
52
|
__TS__SetDescriptor(
|
|
52
53
|
UnitTypeWeapon.prototype,
|
|
53
|
-
"
|
|
54
|
+
"backSwingDuration",
|
|
54
55
|
{
|
|
55
56
|
get = function(self)
|
|
56
57
|
local ____self_2 = self.unitType
|
|
57
58
|
return ____self_2.getNumberField(
|
|
58
59
|
____self_2,
|
|
59
|
-
"
|
|
60
|
+
"ubs" .. tostring(self.index)
|
|
60
61
|
)
|
|
61
62
|
end,
|
|
62
|
-
set = function(self,
|
|
63
|
+
set = function(self, backSwingDuration)
|
|
63
64
|
local ____self_3 = self.unitType
|
|
64
65
|
____self_3.setNumberField(
|
|
65
66
|
____self_3,
|
|
67
|
+
"ubs" .. tostring(self.index),
|
|
68
|
+
backSwingDuration
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
},
|
|
72
|
+
true
|
|
73
|
+
)
|
|
74
|
+
__TS__SetDescriptor(
|
|
75
|
+
UnitTypeWeapon.prototype,
|
|
76
|
+
"cooldown",
|
|
77
|
+
{
|
|
78
|
+
get = function(self)
|
|
79
|
+
local ____self_4 = self.unitType
|
|
80
|
+
return ____self_4.getNumberField(
|
|
81
|
+
____self_4,
|
|
82
|
+
("ua" .. tostring(self.index)) .. "c"
|
|
83
|
+
)
|
|
84
|
+
end,
|
|
85
|
+
set = function(self, cooldown)
|
|
86
|
+
local ____self_5 = self.unitType
|
|
87
|
+
____self_5.setNumberField(
|
|
88
|
+
____self_5,
|
|
89
|
+
("ua" .. tostring(self.index)) .. "c",
|
|
90
|
+
cooldown
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
},
|
|
94
|
+
true
|
|
95
|
+
)
|
|
96
|
+
__TS__SetDescriptor(
|
|
97
|
+
UnitTypeWeapon.prototype,
|
|
98
|
+
"damage",
|
|
99
|
+
{
|
|
100
|
+
get = function(self)
|
|
101
|
+
local minimumDamage = self.damageBase + self.damageDiceCount
|
|
102
|
+
local maximumDamage = self.damageBase + self.damageDiceCount * self.damageDiceSideCount
|
|
103
|
+
return {minimumDamage, maximumDamage}
|
|
104
|
+
end,
|
|
105
|
+
set = function(self, ____bindingPattern0)
|
|
106
|
+
local maximumDamage
|
|
107
|
+
local minimumDamage
|
|
108
|
+
minimumDamage = ____bindingPattern0[1]
|
|
109
|
+
maximumDamage = ____bindingPattern0[2]
|
|
110
|
+
self.damageBase = minimumDamage - 1
|
|
111
|
+
self.damageDiceCount = 1
|
|
112
|
+
self.damageDiceSideCount = maximumDamage - minimumDamage + 1
|
|
113
|
+
end
|
|
114
|
+
},
|
|
115
|
+
true
|
|
116
|
+
)
|
|
117
|
+
__TS__SetDescriptor(
|
|
118
|
+
UnitTypeWeapon.prototype,
|
|
119
|
+
"damageBase",
|
|
120
|
+
{
|
|
121
|
+
get = function(self)
|
|
122
|
+
local ____self_6 = self.unitType
|
|
123
|
+
return ____self_6.getNumberField(
|
|
124
|
+
____self_6,
|
|
125
|
+
("ua" .. tostring(self.index)) .. "b"
|
|
126
|
+
)
|
|
127
|
+
end,
|
|
128
|
+
set = function(self, damageBase)
|
|
129
|
+
local ____self_7 = self.unitType
|
|
130
|
+
____self_7.setNumberField(
|
|
131
|
+
____self_7,
|
|
132
|
+
("ua" .. tostring(self.index)) .. "b",
|
|
133
|
+
damageBase
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
},
|
|
137
|
+
true
|
|
138
|
+
)
|
|
139
|
+
__TS__SetDescriptor(
|
|
140
|
+
UnitTypeWeapon.prototype,
|
|
141
|
+
"damageDiceCount",
|
|
142
|
+
{
|
|
143
|
+
get = function(self)
|
|
144
|
+
local ____self_8 = self.unitType
|
|
145
|
+
return ____self_8.getNumberField(
|
|
146
|
+
____self_8,
|
|
147
|
+
("ua" .. tostring(self.index)) .. "d"
|
|
148
|
+
)
|
|
149
|
+
end,
|
|
150
|
+
set = function(self, damageDiceNumber)
|
|
151
|
+
local ____self_9 = self.unitType
|
|
152
|
+
____self_9.setNumberField(
|
|
153
|
+
____self_9,
|
|
154
|
+
("ua" .. tostring(self.index)) .. "d",
|
|
155
|
+
damageDiceNumber
|
|
156
|
+
)
|
|
157
|
+
end
|
|
158
|
+
},
|
|
159
|
+
true
|
|
160
|
+
)
|
|
161
|
+
__TS__SetDescriptor(
|
|
162
|
+
UnitTypeWeapon.prototype,
|
|
163
|
+
"damageDiceSideCount",
|
|
164
|
+
{
|
|
165
|
+
get = function(self)
|
|
166
|
+
local ____self_10 = self.unitType
|
|
167
|
+
return ____self_10.getNumberField(
|
|
168
|
+
____self_10,
|
|
169
|
+
("ua" .. tostring(self.index)) .. "s"
|
|
170
|
+
)
|
|
171
|
+
end,
|
|
172
|
+
set = function(self, damageDiceSideCount)
|
|
173
|
+
local ____self_11 = self.unitType
|
|
174
|
+
____self_11.setNumberField(
|
|
175
|
+
____self_11,
|
|
176
|
+
("ua" .. tostring(self.index)) .. "s",
|
|
177
|
+
damageDiceSideCount
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
},
|
|
181
|
+
true
|
|
182
|
+
)
|
|
183
|
+
__TS__SetDescriptor(
|
|
184
|
+
UnitTypeWeapon.prototype,
|
|
185
|
+
"impactDelay",
|
|
186
|
+
{
|
|
187
|
+
get = function(self)
|
|
188
|
+
local ____self_12 = self.unitType
|
|
189
|
+
return ____self_12.getNumberField(
|
|
190
|
+
____self_12,
|
|
191
|
+
"udp" .. tostring(self.index)
|
|
192
|
+
)
|
|
193
|
+
end,
|
|
194
|
+
set = function(self, impactDelay)
|
|
195
|
+
local ____self_13 = self.unitType
|
|
196
|
+
____self_13.setNumberField(
|
|
197
|
+
____self_13,
|
|
66
198
|
"udp" .. tostring(self.index),
|
|
67
199
|
impactDelay
|
|
68
200
|
)
|
|
@@ -75,16 +207,16 @@ __TS__SetDescriptor(
|
|
|
75
207
|
"missileModelPath",
|
|
76
208
|
{
|
|
77
209
|
get = function(self)
|
|
78
|
-
local
|
|
79
|
-
return
|
|
80
|
-
|
|
210
|
+
local ____self_14 = self.unitType
|
|
211
|
+
return ____self_14.getStringField(
|
|
212
|
+
____self_14,
|
|
81
213
|
("ua" .. tostring(self.index)) .. "m"
|
|
82
214
|
)
|
|
83
215
|
end,
|
|
84
216
|
set = function(self, missileModelPath)
|
|
85
|
-
local
|
|
86
|
-
|
|
87
|
-
|
|
217
|
+
local ____self_15 = self.unitType
|
|
218
|
+
____self_15.setStringField(
|
|
219
|
+
____self_15,
|
|
88
220
|
("ua" .. tostring(self.index)) .. "m",
|
|
89
221
|
missileModelPath
|
|
90
222
|
)
|
|
@@ -92,21 +224,43 @@ __TS__SetDescriptor(
|
|
|
92
224
|
},
|
|
93
225
|
true
|
|
94
226
|
)
|
|
227
|
+
__TS__SetDescriptor(
|
|
228
|
+
UnitTypeWeapon.prototype,
|
|
229
|
+
"range",
|
|
230
|
+
{
|
|
231
|
+
get = function(self)
|
|
232
|
+
local ____self_16 = self.unitType
|
|
233
|
+
return ____self_16.getNumberField(
|
|
234
|
+
____self_16,
|
|
235
|
+
("ua" .. tostring(self.index)) .. "r"
|
|
236
|
+
)
|
|
237
|
+
end,
|
|
238
|
+
set = function(self, range)
|
|
239
|
+
local ____self_17 = self.unitType
|
|
240
|
+
____self_17.setNumberField(
|
|
241
|
+
____self_17,
|
|
242
|
+
("ua" .. tostring(self.index)) .. "r",
|
|
243
|
+
range
|
|
244
|
+
)
|
|
245
|
+
end
|
|
246
|
+
},
|
|
247
|
+
true
|
|
248
|
+
)
|
|
95
249
|
__TS__SetDescriptor(
|
|
96
250
|
UnitTypeWeapon.prototype,
|
|
97
251
|
"soundType",
|
|
98
252
|
{
|
|
99
253
|
get = function(self)
|
|
100
|
-
local
|
|
101
|
-
return
|
|
102
|
-
|
|
254
|
+
local ____self_18 = self.unitType
|
|
255
|
+
return ____self_18.getStringField(
|
|
256
|
+
____self_18,
|
|
103
257
|
"ucs" .. tostring(self.index)
|
|
104
258
|
)
|
|
105
259
|
end,
|
|
106
260
|
set = function(self, soundType)
|
|
107
|
-
local
|
|
108
|
-
|
|
109
|
-
|
|
261
|
+
local ____self_19 = self.unitType
|
|
262
|
+
____self_19.setStringField(
|
|
263
|
+
____self_19,
|
|
110
264
|
"ucs" .. tostring(self.index),
|
|
111
265
|
soundType
|
|
112
266
|
)
|
|
@@ -119,16 +273,16 @@ __TS__SetDescriptor(
|
|
|
119
273
|
"soundTypeSD",
|
|
120
274
|
{
|
|
121
275
|
get = function(self)
|
|
122
|
-
local
|
|
123
|
-
return
|
|
124
|
-
|
|
276
|
+
local ____self_20 = self.unitType
|
|
277
|
+
return ____self_20.getStringField(
|
|
278
|
+
____self_20,
|
|
125
279
|
("ucs" .. tostring(self.index)) .. ":sd"
|
|
126
280
|
)
|
|
127
281
|
end,
|
|
128
282
|
set = function(self, soundTypeSD)
|
|
129
|
-
local
|
|
130
|
-
|
|
131
|
-
|
|
283
|
+
local ____self_21 = self.unitType
|
|
284
|
+
____self_21.setStringField(
|
|
285
|
+
____self_21,
|
|
132
286
|
("ucs" .. tostring(self.index)) .. ":sd",
|
|
133
287
|
soundTypeSD
|
|
134
288
|
)
|
|
@@ -141,16 +295,16 @@ __TS__SetDescriptor(
|
|
|
141
295
|
"soundTypeHD",
|
|
142
296
|
{
|
|
143
297
|
get = function(self)
|
|
144
|
-
local
|
|
145
|
-
return
|
|
146
|
-
|
|
298
|
+
local ____self_22 = self.unitType
|
|
299
|
+
return ____self_22.getStringField(
|
|
300
|
+
____self_22,
|
|
147
301
|
("ucs" .. tostring(self.index)) .. ":hd"
|
|
148
302
|
)
|
|
149
303
|
end,
|
|
150
304
|
set = function(self, soundTypeHD)
|
|
151
|
-
local
|
|
152
|
-
|
|
153
|
-
|
|
305
|
+
local ____self_23 = self.unitType
|
|
306
|
+
____self_23.setStringField(
|
|
307
|
+
____self_23,
|
|
154
308
|
("ucs" .. tostring(self.index)) .. ":hd",
|
|
155
309
|
soundTypeHD
|
|
156
310
|
)
|
|
@@ -683,6 +837,45 @@ __TS__SetDescriptor(
|
|
|
683
837
|
},
|
|
684
838
|
true
|
|
685
839
|
)
|
|
840
|
+
__TS__SetDescriptor(
|
|
841
|
+
UnitType.prototype,
|
|
842
|
+
"runSpeed",
|
|
843
|
+
{
|
|
844
|
+
get = function(self)
|
|
845
|
+
return self:getNumberField("urun")
|
|
846
|
+
end,
|
|
847
|
+
set = function(self, runSpeed)
|
|
848
|
+
self:setNumberField("urun", runSpeed)
|
|
849
|
+
end
|
|
850
|
+
},
|
|
851
|
+
true
|
|
852
|
+
)
|
|
853
|
+
__TS__SetDescriptor(
|
|
854
|
+
UnitType.prototype,
|
|
855
|
+
"runSpeedSD",
|
|
856
|
+
{
|
|
857
|
+
get = function(self)
|
|
858
|
+
return self:getNumberField("urun:sd")
|
|
859
|
+
end,
|
|
860
|
+
set = function(self, runSpeedSD)
|
|
861
|
+
self:setNumberField("urun:sd", runSpeedSD)
|
|
862
|
+
end
|
|
863
|
+
},
|
|
864
|
+
true
|
|
865
|
+
)
|
|
866
|
+
__TS__SetDescriptor(
|
|
867
|
+
UnitType.prototype,
|
|
868
|
+
"runSpeedHD",
|
|
869
|
+
{
|
|
870
|
+
get = function(self)
|
|
871
|
+
return self:getNumberField("urun:hd")
|
|
872
|
+
end,
|
|
873
|
+
set = function(self, runSpeedHD)
|
|
874
|
+
self:setNumberField("urun:hd", runSpeedHD)
|
|
875
|
+
end
|
|
876
|
+
},
|
|
877
|
+
true
|
|
878
|
+
)
|
|
686
879
|
__TS__SetDescriptor(
|
|
687
880
|
UnitType.prototype,
|
|
688
881
|
"selectionCircleScale",
|
|
@@ -891,6 +1084,45 @@ __TS__SetDescriptor(
|
|
|
891
1084
|
},
|
|
892
1085
|
true
|
|
893
1086
|
)
|
|
1087
|
+
__TS__SetDescriptor(
|
|
1088
|
+
UnitType.prototype,
|
|
1089
|
+
"walkSpeed",
|
|
1090
|
+
{
|
|
1091
|
+
get = function(self)
|
|
1092
|
+
return self:getNumberField("uwal")
|
|
1093
|
+
end,
|
|
1094
|
+
set = function(self, walkSpeed)
|
|
1095
|
+
self:setNumberField("uwal", walkSpeed)
|
|
1096
|
+
end
|
|
1097
|
+
},
|
|
1098
|
+
true
|
|
1099
|
+
)
|
|
1100
|
+
__TS__SetDescriptor(
|
|
1101
|
+
UnitType.prototype,
|
|
1102
|
+
"walkSpeedSD",
|
|
1103
|
+
{
|
|
1104
|
+
get = function(self)
|
|
1105
|
+
return self:getNumberField("uwal:sd")
|
|
1106
|
+
end,
|
|
1107
|
+
set = function(self, walkSpeedSD)
|
|
1108
|
+
self:setNumberField("uwal:sd", walkSpeedSD)
|
|
1109
|
+
end
|
|
1110
|
+
},
|
|
1111
|
+
true
|
|
1112
|
+
)
|
|
1113
|
+
__TS__SetDescriptor(
|
|
1114
|
+
UnitType.prototype,
|
|
1115
|
+
"walkSpeedHD",
|
|
1116
|
+
{
|
|
1117
|
+
get = function(self)
|
|
1118
|
+
return self:getNumberField("uwal:hd")
|
|
1119
|
+
end,
|
|
1120
|
+
set = function(self, walkSpeedHD)
|
|
1121
|
+
self:setNumberField("uwal:hd", walkSpeedHD)
|
|
1122
|
+
end
|
|
1123
|
+
},
|
|
1124
|
+
true
|
|
1125
|
+
)
|
|
894
1126
|
__TS__SetDescriptor(
|
|
895
1127
|
UnitType.prototype,
|
|
896
1128
|
"armorSoundType",
|
|
@@ -964,25 +1196,25 @@ __TS__SetDescriptor(
|
|
|
964
1196
|
)
|
|
965
1197
|
__TS__SetDescriptor(
|
|
966
1198
|
UnitType.prototype,
|
|
967
|
-
"
|
|
1199
|
+
"weapons",
|
|
968
1200
|
{get = function(self)
|
|
969
|
-
return self
|
|
1201
|
+
return getOrCreateUnitTypeWeapons(self)
|
|
970
1202
|
end},
|
|
971
1203
|
true
|
|
972
1204
|
)
|
|
973
1205
|
__TS__SetDescriptor(
|
|
974
1206
|
UnitType.prototype,
|
|
975
|
-
"
|
|
1207
|
+
"firstWeapon",
|
|
976
1208
|
{get = function(self)
|
|
977
|
-
return self.weapons[
|
|
1209
|
+
return self.weapons[1]
|
|
978
1210
|
end},
|
|
979
1211
|
true
|
|
980
1212
|
)
|
|
981
1213
|
__TS__SetDescriptor(
|
|
982
1214
|
UnitType.prototype,
|
|
983
|
-
"
|
|
1215
|
+
"secondWeapon",
|
|
984
1216
|
{get = function(self)
|
|
985
|
-
return
|
|
1217
|
+
return self.weapons[2]
|
|
986
1218
|
end},
|
|
987
1219
|
true
|
|
988
1220
|
)
|
|
@@ -1168,6 +1400,71 @@ __TS__SetDescriptor(
|
|
|
1168
1400
|
},
|
|
1169
1401
|
true
|
|
1170
1402
|
)
|
|
1403
|
+
__TS__SetDescriptor(
|
|
1404
|
+
UnitType.prototype,
|
|
1405
|
+
"healthRegenerationRate",
|
|
1406
|
+
{
|
|
1407
|
+
get = function(self)
|
|
1408
|
+
return self:getNumberField("uhpr")
|
|
1409
|
+
end,
|
|
1410
|
+
set = function(self, healthRegenerationRate)
|
|
1411
|
+
self:setNumberField("uhpr", healthRegenerationRate)
|
|
1412
|
+
end
|
|
1413
|
+
},
|
|
1414
|
+
true
|
|
1415
|
+
)
|
|
1416
|
+
__TS__SetDescriptor(
|
|
1417
|
+
UnitType.prototype,
|
|
1418
|
+
"manaRegenerationRate",
|
|
1419
|
+
{
|
|
1420
|
+
get = function(self)
|
|
1421
|
+
return self:getNumberField("umpr")
|
|
1422
|
+
end,
|
|
1423
|
+
set = function(self, manaRegenerationRate)
|
|
1424
|
+
self:setNumberField("umpr", manaRegenerationRate)
|
|
1425
|
+
end
|
|
1426
|
+
},
|
|
1427
|
+
true
|
|
1428
|
+
)
|
|
1429
|
+
__TS__SetDescriptor(
|
|
1430
|
+
UnitType.prototype,
|
|
1431
|
+
"maximumHealth",
|
|
1432
|
+
{
|
|
1433
|
+
get = function(self)
|
|
1434
|
+
return self:getNumberField("uhpm")
|
|
1435
|
+
end,
|
|
1436
|
+
set = function(self, maximumHealth)
|
|
1437
|
+
self:setNumberField("uhpm", maximumHealth)
|
|
1438
|
+
end
|
|
1439
|
+
},
|
|
1440
|
+
true
|
|
1441
|
+
)
|
|
1442
|
+
__TS__SetDescriptor(
|
|
1443
|
+
UnitType.prototype,
|
|
1444
|
+
"maximumMana",
|
|
1445
|
+
{
|
|
1446
|
+
get = function(self)
|
|
1447
|
+
return self:getNumberField("umpm")
|
|
1448
|
+
end,
|
|
1449
|
+
set = function(self, maximumMana)
|
|
1450
|
+
self:setNumberField("umpm", maximumMana)
|
|
1451
|
+
end
|
|
1452
|
+
},
|
|
1453
|
+
true
|
|
1454
|
+
)
|
|
1455
|
+
__TS__SetDescriptor(
|
|
1456
|
+
UnitType.prototype,
|
|
1457
|
+
"initialMana",
|
|
1458
|
+
{
|
|
1459
|
+
get = function(self)
|
|
1460
|
+
return self:getNumberField("umpi")
|
|
1461
|
+
end,
|
|
1462
|
+
set = function(self, initialMana)
|
|
1463
|
+
self:setNumberField("umpi", initialMana)
|
|
1464
|
+
end
|
|
1465
|
+
},
|
|
1466
|
+
true
|
|
1467
|
+
)
|
|
1171
1468
|
__TS__SetDescriptor(
|
|
1172
1469
|
UnitType.prototype,
|
|
1173
1470
|
"isStructure",
|
|
@@ -1262,11 +1559,11 @@ __TS__SetDescriptor(
|
|
|
1262
1559
|
implementReadonlyNumberIndexSupplier(
|
|
1263
1560
|
____exports.UnitType,
|
|
1264
1561
|
function(id)
|
|
1265
|
-
local
|
|
1266
|
-
|
|
1267
|
-
__TS__ClassExtends(
|
|
1268
|
-
|
|
1269
|
-
return
|
|
1562
|
+
local ____class_24 = __TS__Class()
|
|
1563
|
+
____class_24.name = ____class_24.name
|
|
1564
|
+
__TS__ClassExtends(____class_24, ____exports.UnitType)
|
|
1565
|
+
____class_24.BASE_ID = id
|
|
1566
|
+
return ____class_24
|
|
1270
1567
|
end
|
|
1271
1568
|
)
|
|
1272
1569
|
____exports.HeroUnitType = __TS__Class()
|
|
@@ -1293,14 +1590,45 @@ __TS__SetDescriptor(
|
|
|
1293
1590
|
},
|
|
1294
1591
|
true
|
|
1295
1592
|
)
|
|
1593
|
+
__TS__SetDescriptor(
|
|
1594
|
+
HeroUnitType.prototype,
|
|
1595
|
+
"properNames",
|
|
1596
|
+
{
|
|
1597
|
+
get = function(self)
|
|
1598
|
+
return self:getStringsField("upro")
|
|
1599
|
+
end,
|
|
1600
|
+
set = function(self, properNames)
|
|
1601
|
+
if __TS__ArrayIsArray(properNames) then
|
|
1602
|
+
self:setStringsField("upro", properNames)
|
|
1603
|
+
self:setNumberField("upru", #properNames)
|
|
1604
|
+
else
|
|
1605
|
+
self:setStringField("upro", properNames)
|
|
1606
|
+
end
|
|
1607
|
+
end
|
|
1608
|
+
},
|
|
1609
|
+
true
|
|
1610
|
+
)
|
|
1611
|
+
__TS__SetDescriptor(
|
|
1612
|
+
HeroUnitType.prototype,
|
|
1613
|
+
"properNameCount",
|
|
1614
|
+
{
|
|
1615
|
+
get = function(self)
|
|
1616
|
+
return self:getNumberField("upru")
|
|
1617
|
+
end,
|
|
1618
|
+
set = function(self, properNameCount)
|
|
1619
|
+
self:setNumberField("upru", properNameCount)
|
|
1620
|
+
end
|
|
1621
|
+
},
|
|
1622
|
+
true
|
|
1623
|
+
)
|
|
1296
1624
|
implementReadonlyNumberIndexSupplier(
|
|
1297
1625
|
____exports.HeroUnitType,
|
|
1298
1626
|
function(id)
|
|
1299
|
-
local
|
|
1300
|
-
|
|
1301
|
-
__TS__ClassExtends(
|
|
1302
|
-
|
|
1303
|
-
return
|
|
1627
|
+
local ____class_25 = __TS__Class()
|
|
1628
|
+
____class_25.name = ____class_25.name
|
|
1629
|
+
__TS__ClassExtends(____class_25, ____exports.HeroUnitType)
|
|
1630
|
+
____class_25.BASE_ID = id
|
|
1631
|
+
return ____class_25
|
|
1304
1632
|
end
|
|
1305
1633
|
)
|
|
1306
1634
|
return ____exports
|
package/engine/random.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
1
2
|
/** @noSelfInFile */
|
|
2
3
|
export declare const randomAngle: () => number;
|
|
3
4
|
export declare const randomInteger: {
|
|
@@ -8,3 +9,7 @@ export declare const randomFloat: {
|
|
|
8
9
|
(upperBound?: number): number;
|
|
9
10
|
(lowerBound: number, upperBound: number): number;
|
|
10
11
|
};
|
|
12
|
+
export declare const randomXY: (centerX: number, centerY: number, range: number) => LuaMultiReturn<[
|
|
13
|
+
x: number,
|
|
14
|
+
y: number
|
|
15
|
+
]>;
|
package/engine/random.lua
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
2
|
local ____math = require("math")
|
|
3
3
|
local MAXIMUM_INTEGER = ____math.MAXIMUM_INTEGER
|
|
4
|
+
local PI = ____math.PI
|
|
4
5
|
local getRandomInt = GetRandomInt
|
|
5
6
|
local getRandomReal = GetRandomReal
|
|
7
|
+
local cos = math.cos
|
|
8
|
+
local sin = math.sin
|
|
9
|
+
local sqrt = math.sqrt
|
|
6
10
|
____exports.randomAngle = function() return getRandomReal(0, 360) end
|
|
7
11
|
____exports.randomInteger = function(m, n) return n ~= nil and getRandomInt(m, n) or getRandomInt(0, m or MAXIMUM_INTEGER) end
|
|
8
12
|
____exports.randomFloat = function(m, n) return n ~= nil and getRandomReal(m, n) or getRandomReal(0, m or MAXIMUM_INTEGER) end
|
|
13
|
+
____exports.randomXY = function(centerX, centerY, range)
|
|
14
|
+
local r = range * sqrt(getRandomReal(0, 1))
|
|
15
|
+
local t = getRandomReal(0, 1) * 2 * PI
|
|
16
|
+
return centerX + r * cos(t), centerY + r * sin(t)
|
|
17
|
+
end
|
|
9
18
|
return ____exports
|
|
@@ -9,11 +9,33 @@ export declare const RIFLEMAN_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
|
9
9
|
export declare const SIEGE_ENGINE_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
10
10
|
export declare const SORCERESS_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
11
11
|
export declare const SPELLBREAKER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
12
|
-
export declare const PALADIN_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
13
12
|
export declare const ARCHMAGE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
13
|
+
export declare const BLOOD_MAGE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
14
|
+
export declare const MOUNTAIN_KING_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
15
|
+
export declare const PALADIN_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
16
|
+
export declare const ARCHER_HIGH_ELF_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
14
17
|
export declare const CAPTAIN_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
18
|
+
export declare const SWORDSMAN_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
19
|
+
export declare const ADMIRAL_PROUDMOORE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
20
|
+
export declare const ANASTERIAN_SUNSTRIDER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
21
|
+
export declare const ANTONIDAS_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
22
|
+
export declare const ANTONIDAS_GHOST_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
15
23
|
export declare const ARTHAS_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
16
24
|
export declare const ARTHAS_WITH_FROSTMOURNE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
25
|
+
export declare const DAGREN_THE_ORCSLAYER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
26
|
+
export declare const HALAHK_THE_LIFEBRINGER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
27
|
+
export declare const JAINA_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
28
|
+
export declare const JENNALLA_DEEMSPRING_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
29
|
+
export declare const KAEL_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
30
|
+
export declare const KELEN_THE_SEEKER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
31
|
+
export declare const LORD_GARITHOS_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
32
|
+
export declare const LORD_NICHOLAS_BUZAN_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
33
|
+
export declare const MAGROTH_THE_DEFENDER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
34
|
+
export declare const MURADIN_BRONZEBEARD_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
35
|
+
export declare const SIR_GREGORY_EDMUNSON_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
36
|
+
export declare const SYLVANAS_WINDRUNNER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
37
|
+
export declare const THALORIEN_DAWNSEEKER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
38
|
+
export declare const UTHER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
17
39
|
export declare const BATRIDER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
18
40
|
export declare const DEMOLISHER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
19
41
|
export declare const GRUNT_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
@@ -25,11 +47,29 @@ export declare const SPIRIT_WALKER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
|
25
47
|
export declare const TAUREN_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
26
48
|
export declare const WIND_RIDER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
27
49
|
export declare const WITCH_DOCTOR_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
50
|
+
export declare const ARCHER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
51
|
+
export declare const CHIMAERA_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
52
|
+
export declare const DRUID_OF_THE_CLAW_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
53
|
+
export declare const DRUID_OF_THE_TALON_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
54
|
+
export declare const DRYAD_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
55
|
+
export declare const FAERIE_DRAGON_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
56
|
+
export declare const GLAIVE_THROWER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
57
|
+
export declare const HIPPOGRYPH_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
58
|
+
export declare const HIPPOGRYPH_RIDER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
59
|
+
export declare const HUNTRESS_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
60
|
+
export declare const MOUNTAIN_GIANT_THROWER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
61
|
+
export declare const WISP_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
28
62
|
export declare const DEMON_HUNTER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
63
|
+
export declare const KEEPER_OF_THE_GROVE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
64
|
+
export declare const MOON_PRIESTESS_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
65
|
+
export declare const WARDEN_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
29
66
|
export declare const DEMON_HUNTER_DEMON_FORM_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
30
67
|
export declare const ABOMINATION_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
31
68
|
export declare const GHOUL_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
32
69
|
export declare const DEATH_KNIGHT_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
70
|
+
export declare const ZOMBIE_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
71
|
+
export declare const ZOMBIE_FEMALE_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
72
|
+
export declare const ARTHAS_EVIL_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
|
|
33
73
|
export declare const DIRE_MAMMOTH_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
34
74
|
export declare const ELDER_JUNGLE_STALKER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
35
75
|
export declare const ENRAGED_ELEMENTAL_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
@@ -58,6 +98,7 @@ export declare const WENDIGO_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
|
58
98
|
export declare const WENDIGO_SHAMAN_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
59
99
|
export declare const WILDKIN_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
60
100
|
export declare const WRAITH_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
101
|
+
export declare const GOBLIN_LAND_MINE_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
61
102
|
export declare const CIRCLE_OF_POWER_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
62
103
|
export declare const CIRCLE_OF_POWER_MEDIUM_UNIT_TYPE_ID: StandardUnitTypeId;
|
|
63
104
|
export declare const CIRCLE_OF_POWER_LARGE_UNIT_TYPE_ID: StandardUnitTypeId;
|