warscript 0.0.1-dev.404878c → 0.0.1-dev.58c74da
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/engine/behaviour/ability/apply-unit-behavior.d.ts +8 -4
- package/engine/behaviour/ability/apply-unit-behavior.lua +31 -9
- package/engine/internal/ability.d.ts +1 -1
- package/engine/internal/mechanics/ability-duration.d.ts +1 -3
- package/engine/internal/mechanics/ability-duration.lua +2 -0
- package/engine/internal/mechanics/cast-ability.d.ts +2 -0
- package/engine/internal/mechanics/cast-ability.lua +86 -0
- package/engine/internal/unit/detach-missiles.d.ts +7 -0
- package/engine/internal/unit/detach-missiles.lua +30 -0
- package/engine/internal/unit.d.ts +10 -2
- package/engine/internal/unit.lua +34 -9
- package/engine/object-data/entry/ability-type/blink.d.ts +10 -0
- package/engine/object-data/entry/ability-type/blink.lua +39 -0
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type.d.ts +1 -0
- package/engine/object-data/entry/ability-type.lua +1 -0
- package/engine/object-data/entry/buff-type/applicable.lua +27 -71
- package/engine/object-data/entry/unit-type.d.ts +21 -0
- package/engine/object-data/entry/unit-type.lua +198 -44
- package/engine/object-field/ability.d.ts +7 -5
- package/engine/object-field/ability.lua +6 -0
- package/engine/object-field/unit.d.ts +1 -0
- package/engine/object-field/unit.lua +3 -0
- package/engine/object-field.d.ts +6 -3
- package/engine/object-field.lua +38 -12
- package/engine/standard/entries/unit-type.d.ts +24 -1
- package/engine/standard/entries/unit-type.lua +24 -1
- package/engine/unit.d.ts +1 -0
- package/engine/unit.lua +1 -0
- package/exception.d.ts +2 -0
- package/exception.lua +4 -0
- package/global/vec2.lua +1 -0
- package/package.json +3 -4
- package/string.d.ts +14 -0
- package/string.lua +9 -0
- package/utility/arrays.d.ts +1 -1
- package/utility/arrays.lua +4 -1
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +16 -0
- package/utility/types.d.ts +2 -2
|
@@ -7,6 +7,7 @@ local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
|
|
|
7
7
|
local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
|
|
8
8
|
local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
|
|
9
9
|
local ____exports = {}
|
|
10
|
+
local preparePhysicalPositiveApplicatorAbility
|
|
10
11
|
local ____ability_2Dtype = require("engine.object-data.entry.ability-type")
|
|
11
12
|
local AbilityType = ____ability_2Dtype.AbilityType
|
|
12
13
|
local ____cripple = require("engine.object-data.entry.ability-type.cripple")
|
|
@@ -34,20 +35,14 @@ local ____blood_2Dlust = require("engine.object-data.entry.ability-type.blood-lu
|
|
|
34
35
|
local BloodLustAbilityType = ____blood_2Dlust.BloodLustAbilityType
|
|
35
36
|
local ____berserk = require("engine.object-data.entry.ability-type.berserk")
|
|
36
37
|
local BerserkAbilityType = ____berserk.BerserkAbilityType
|
|
37
|
-
local ____dummy_2Ditem = require("engine.internal.object-data.dummy-item")
|
|
38
|
-
local DUMMY_ITEM_ID = ____dummy_2Ditem.DUMMY_ITEM_ID
|
|
39
|
-
local ____dummy_2Dinventory = require("engine.internal.object-data.dummy-inventory")
|
|
40
|
-
local INVENTORY_ABILITY_TYPE_ID = ____dummy_2Dinventory.INVENTORY_ABILITY_TYPE_ID
|
|
41
38
|
local ____blank = require("engine.object-data.entry.upgrade.blank")
|
|
42
39
|
local BlankUpgrade = ____blank.BlankUpgrade
|
|
43
|
-
local ____dummy_2Dunits = require("engine.internal.misc.dummy-units")
|
|
44
|
-
local INVENTORY_DUMMY_NATIVE_UNIT = ____dummy_2Dunits.INVENTORY_DUMMY_NATIVE_UNIT
|
|
45
|
-
local ____preconditions = require("utility.preconditions")
|
|
46
|
-
local checkNotNull = ____preconditions.checkNotNull
|
|
47
40
|
local ____unit_2Dtype = require("engine.object-data.entry.unit-type")
|
|
48
41
|
local UnitType = ____unit_2Dtype.UnitType
|
|
49
42
|
local ____permanent_2Dimmolation = require("engine.object-data.entry.ability-type.permanent-immolation")
|
|
50
43
|
local PermanentImmolationAbilityType = ____permanent_2Dimmolation.PermanentImmolationAbilityType
|
|
44
|
+
local ____cast_2Dability = require("engine.internal.mechanics.cast-ability")
|
|
45
|
+
local castAbility = ____cast_2Dability.castAbility
|
|
51
46
|
local createItem = CreateItem
|
|
52
47
|
local getAbilityId = BlzGetAbilityId
|
|
53
48
|
local getItemAbility = BlzGetItemAbility
|
|
@@ -260,75 +255,25 @@ ____exports.internalApplyBuff = function(unit, applicableBuffTypeId, polarity, r
|
|
|
260
255
|
return unitAddAbility(unit.handle, applicatorAbilityTypeId)
|
|
261
256
|
end
|
|
262
257
|
if applicatorType == 852100 then
|
|
263
|
-
local
|
|
264
|
-
|
|
265
|
-
local nativeItem = createItem(DUMMY_ITEM_ID, 0, 0)
|
|
266
|
-
unitAddItem(INVENTORY_DUMMY_NATIVE_UNIT, nativeItem)
|
|
267
|
-
itemAddAbility(nativeItem, applicatorAbilityTypeId)
|
|
268
|
-
local applicatorAbility = checkNotNull(getItemAbility(nativeItem, applicatorAbilityTypeId))
|
|
269
|
-
if level == nil then
|
|
270
|
-
level = 0
|
|
271
|
-
setAbilityIntegerField(applicatorAbility, ABILITY_IF_LEVELS, 1)
|
|
272
|
-
end
|
|
273
|
-
setAbilityRealLevelField(applicatorAbility, ABILITY_RLF_DURATION_NORMAL, level, duration or 0)
|
|
274
|
-
setAbilityRealLevelField(applicatorAbility, ABILITY_RLF_DURATION_HERO, level, duration or 0)
|
|
275
|
-
if movementSpeedIncreaseFactor ~= nil then
|
|
276
|
-
setAbilityRealLevelField(applicatorAbility, ABILITY_RLF_MOVEMENT_SPEED_INCREASE_BSK1, level, movementSpeedIncreaseFactor)
|
|
277
|
-
end
|
|
278
|
-
setItemBooleanField(nativeItem, ITEM_BF_ACTIVELY_USED, true)
|
|
279
|
-
setItemBooleanField(nativeItem, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, true)
|
|
280
|
-
if level > 0 then
|
|
258
|
+
local nativePlayer = unit.owner.handle
|
|
259
|
+
if level ~= nil and level > 0 then
|
|
281
260
|
local upgradeId = applicatorUpgradeIdByApplicatorAbilityTypeId[applicatorAbilityTypeId]
|
|
282
261
|
if upgradeId ~= nil then
|
|
283
|
-
setPlayerTechResearched(
|
|
284
|
-
getOwningPlayer(nativeUnit),
|
|
285
|
-
upgradeId,
|
|
286
|
-
level
|
|
287
|
-
)
|
|
288
|
-
end
|
|
289
|
-
end
|
|
290
|
-
if not unitAddItem(nativeUnit, nativeItem) then
|
|
291
|
-
local latestInventoryAbilityTypeId = 0
|
|
292
|
-
local nativeItemBySlot = {}
|
|
293
|
-
local inventorySize = unitInventorySize(nativeUnit)
|
|
294
|
-
if inventorySize ~= 0 then
|
|
295
|
-
for slot = 0, inventorySize - 1 do
|
|
296
|
-
nativeItemBySlot[slot] = UnitRemoveItemFromSlot(nativeUnit, slot)
|
|
297
|
-
end
|
|
298
|
-
local unitNativeAbility = getUnitAbilityByIndex(nativeUnit, 0)
|
|
299
|
-
local i = 1
|
|
300
|
-
while unitNativeAbility ~= nil do
|
|
301
|
-
local abilityTypeId = getAbilityId(unitNativeAbility)
|
|
302
|
-
if INVENTORY_ABILITY_TYPE_IDS[abilityTypeId] ~= nil then
|
|
303
|
-
latestInventoryAbilityTypeId = abilityTypeId
|
|
304
|
-
end
|
|
305
|
-
unitNativeAbility = getUnitAbilityByIndex(nativeUnit, i)
|
|
306
|
-
i = i + 1
|
|
307
|
-
end
|
|
308
|
-
unitRemoveAbility(nativeUnit, latestInventoryAbilityTypeId)
|
|
262
|
+
setPlayerTechResearched(nativePlayer, upgradeId, level)
|
|
309
263
|
end
|
|
310
|
-
unitAddAbility(nativeUnit, INVENTORY_ABILITY_TYPE_ID)
|
|
311
|
-
success = unitAddItem(nativeUnit, nativeItem)
|
|
312
|
-
unitRemoveAbility(nativeUnit, INVENTORY_ABILITY_TYPE_ID)
|
|
313
|
-
if latestInventoryAbilityTypeId ~= 0 then
|
|
314
|
-
unitAddAbility(nativeUnit, latestInventoryAbilityTypeId)
|
|
315
|
-
for slot, nativeItem in pairs(nativeItemBySlot) do
|
|
316
|
-
unitAddItem(nativeUnit, nativeItem)
|
|
317
|
-
unitDropItemSlot(nativeUnit, nativeItem, slot)
|
|
318
|
-
end
|
|
319
|
-
end
|
|
320
|
-
else
|
|
321
|
-
success = true
|
|
322
264
|
end
|
|
323
|
-
|
|
324
|
-
|
|
265
|
+
local success = castAbility(
|
|
266
|
+
unit.handle,
|
|
267
|
+
applicatorAbilityTypeId,
|
|
268
|
+
preparePhysicalPositiveApplicatorAbility,
|
|
269
|
+
level,
|
|
270
|
+
duration or 0,
|
|
271
|
+
movementSpeedIncreaseFactor
|
|
272
|
+
)
|
|
273
|
+
if level ~= nil and level > 0 then
|
|
325
274
|
local upgradeId = applicatorUpgradeIdByApplicatorAbilityTypeId[applicatorAbilityTypeId]
|
|
326
275
|
if upgradeId ~= nil then
|
|
327
|
-
setPlayerTechResearched(
|
|
328
|
-
getOwningPlayer(nativeUnit),
|
|
329
|
-
upgradeId,
|
|
330
|
-
0
|
|
331
|
-
)
|
|
276
|
+
setPlayerTechResearched(nativePlayer, upgradeId, 0)
|
|
332
277
|
end
|
|
333
278
|
end
|
|
334
279
|
return success
|
|
@@ -364,6 +309,17 @@ ____exports.internalApplyBuff = function(unit, applicableBuffTypeId, polarity, r
|
|
|
364
309
|
end
|
|
365
310
|
return success
|
|
366
311
|
end
|
|
312
|
+
preparePhysicalPositiveApplicatorAbility = function(ability, level, duration, movementSpeedIncreaseFactor)
|
|
313
|
+
if level == nil then
|
|
314
|
+
setAbilityIntegerField(ability, ABILITY_IF_LEVELS, 1)
|
|
315
|
+
level = 1
|
|
316
|
+
end
|
|
317
|
+
setAbilityRealLevelField(ability, ABILITY_RLF_DURATION_NORMAL, level, duration)
|
|
318
|
+
setAbilityRealLevelField(ability, ABILITY_RLF_DURATION_HERO, level, duration)
|
|
319
|
+
if movementSpeedIncreaseFactor ~= nil then
|
|
320
|
+
setAbilityRealLevelField(ability, ABILITY_RLF_MOVEMENT_SPEED_INCREASE_BSK1, level, movementSpeedIncreaseFactor)
|
|
321
|
+
end
|
|
322
|
+
end
|
|
367
323
|
---
|
|
368
324
|
-- @internal For use by internal systems only.
|
|
369
325
|
____exports.removeBuff = function(unit, applicableBuffTypeId)
|
|
@@ -13,6 +13,7 @@ import { ObjectDataEntryIdGenerator } from "../utility/object-data-entry-id-gene
|
|
|
13
13
|
import type { AbilityTypeId } from "./ability-type";
|
|
14
14
|
import type { UpgradeId } from "./upgrade";
|
|
15
15
|
import { AnimationQualifier } from "../auxiliary/animation-qualifier";
|
|
16
|
+
import { AttackType } from "../auxiliary/attack-type";
|
|
16
17
|
export type UnitTypeId = ObjectDataEntryId & {
|
|
17
18
|
readonly __unitTypeId: unique symbol;
|
|
18
19
|
};
|
|
@@ -23,12 +24,16 @@ export declare class UnitTypeWeapon {
|
|
|
23
24
|
private readonly unitType;
|
|
24
25
|
private readonly index;
|
|
25
26
|
private constructor();
|
|
27
|
+
get attackType(): AttackType;
|
|
28
|
+
set attackType(attackType: AttackType);
|
|
26
29
|
get backSwingDuration(): number;
|
|
27
30
|
set backSwingDuration(backSwingDuration: number);
|
|
28
31
|
get impactDelay(): number;
|
|
29
32
|
set impactDelay(impactDelay: number);
|
|
30
33
|
get missileModelPath(): string;
|
|
31
34
|
set missileModelPath(missileModelPath: string);
|
|
35
|
+
get range(): number;
|
|
36
|
+
set range(range: number);
|
|
32
37
|
get soundType(): WeaponSoundType;
|
|
33
38
|
set soundType(soundType: WeaponSoundType);
|
|
34
39
|
get soundTypeSD(): WeaponSoundType;
|
|
@@ -117,6 +122,12 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
|
|
|
117
122
|
set modelPathSD(modelPathSD: string);
|
|
118
123
|
get modelPathHD(): string;
|
|
119
124
|
set modelPathHD(modelPathHD: string);
|
|
125
|
+
get runSpeed(): number;
|
|
126
|
+
set runSpeed(runSpeed: number);
|
|
127
|
+
get runSpeedSD(): number;
|
|
128
|
+
set runSpeedSD(runSpeedSD: number);
|
|
129
|
+
get runSpeedHD(): number;
|
|
130
|
+
set runSpeedHD(runSpeedHD: number);
|
|
120
131
|
get selectionCircleScale(): number;
|
|
121
132
|
set selectionCircleScale(selectionCircleScale: number);
|
|
122
133
|
get selectionCircleScaleSD(): number;
|
|
@@ -149,6 +160,12 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
|
|
|
149
160
|
set shadowImageXOffset(shadowImageXOffset: number);
|
|
150
161
|
get shadowImageYOffset(): number;
|
|
151
162
|
set shadowImageYOffset(shadowImageYOffset: number);
|
|
163
|
+
get walkSpeed(): number;
|
|
164
|
+
set walkSpeed(walkSpeed: number);
|
|
165
|
+
get walkSpeedSD(): number;
|
|
166
|
+
set walkSpeedSD(walkSpeedSD: number);
|
|
167
|
+
get walkSpeedHD(): number;
|
|
168
|
+
set walkSpeedHD(walkSpeedHD: number);
|
|
152
169
|
get armorSoundType(): ArmorSoundType;
|
|
153
170
|
set armorSoundType(armorSoundType: ArmorSoundType);
|
|
154
171
|
get armorSoundTypeSD(): ArmorSoundType;
|
|
@@ -215,4 +232,8 @@ export declare abstract class HeroUnitType<Id extends HeroUnitTypeId = HeroUnitT
|
|
|
215
232
|
protected static generateId(): number;
|
|
216
233
|
get heroAbilityTypeIds(): AbilityTypeId[];
|
|
217
234
|
set heroAbilityTypeIds(heroAbilityTypeIds: AbilityTypeId[]);
|
|
235
|
+
get properNames(): string[];
|
|
236
|
+
set properNames(properNames: string | string[]);
|
|
237
|
+
get properNameCount(): number;
|
|
238
|
+
set properNameCount(properNameCount: number);
|
|
218
239
|
}
|
|
@@ -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,21 +51,21 @@ __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,
|
|
66
|
-
"
|
|
67
|
-
|
|
67
|
+
"ubs" .. tostring(self.index),
|
|
68
|
+
backSwingDuration
|
|
68
69
|
)
|
|
69
70
|
end
|
|
70
71
|
},
|
|
@@ -72,21 +73,21 @@ __TS__SetDescriptor(
|
|
|
72
73
|
)
|
|
73
74
|
__TS__SetDescriptor(
|
|
74
75
|
UnitTypeWeapon.prototype,
|
|
75
|
-
"
|
|
76
|
+
"impactDelay",
|
|
76
77
|
{
|
|
77
78
|
get = function(self)
|
|
78
79
|
local ____self_4 = self.unitType
|
|
79
|
-
return ____self_4.
|
|
80
|
+
return ____self_4.getNumberField(
|
|
80
81
|
____self_4,
|
|
81
|
-
|
|
82
|
+
"udp" .. tostring(self.index)
|
|
82
83
|
)
|
|
83
84
|
end,
|
|
84
|
-
set = function(self,
|
|
85
|
+
set = function(self, impactDelay)
|
|
85
86
|
local ____self_5 = self.unitType
|
|
86
|
-
____self_5.
|
|
87
|
+
____self_5.setNumberField(
|
|
87
88
|
____self_5,
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
"udp" .. tostring(self.index),
|
|
90
|
+
impactDelay
|
|
90
91
|
)
|
|
91
92
|
end
|
|
92
93
|
},
|
|
@@ -94,21 +95,21 @@ __TS__SetDescriptor(
|
|
|
94
95
|
)
|
|
95
96
|
__TS__SetDescriptor(
|
|
96
97
|
UnitTypeWeapon.prototype,
|
|
97
|
-
"
|
|
98
|
+
"missileModelPath",
|
|
98
99
|
{
|
|
99
100
|
get = function(self)
|
|
100
101
|
local ____self_6 = self.unitType
|
|
101
102
|
return ____self_6.getStringField(
|
|
102
103
|
____self_6,
|
|
103
|
-
"
|
|
104
|
+
("ua" .. tostring(self.index)) .. "m"
|
|
104
105
|
)
|
|
105
106
|
end,
|
|
106
|
-
set = function(self,
|
|
107
|
+
set = function(self, missileModelPath)
|
|
107
108
|
local ____self_7 = self.unitType
|
|
108
109
|
____self_7.setStringField(
|
|
109
110
|
____self_7,
|
|
110
|
-
"
|
|
111
|
-
|
|
111
|
+
("ua" .. tostring(self.index)) .. "m",
|
|
112
|
+
missileModelPath
|
|
112
113
|
)
|
|
113
114
|
end
|
|
114
115
|
},
|
|
@@ -116,21 +117,21 @@ __TS__SetDescriptor(
|
|
|
116
117
|
)
|
|
117
118
|
__TS__SetDescriptor(
|
|
118
119
|
UnitTypeWeapon.prototype,
|
|
119
|
-
"
|
|
120
|
+
"range",
|
|
120
121
|
{
|
|
121
122
|
get = function(self)
|
|
122
123
|
local ____self_8 = self.unitType
|
|
123
|
-
return ____self_8.
|
|
124
|
+
return ____self_8.getNumberField(
|
|
124
125
|
____self_8,
|
|
125
|
-
("
|
|
126
|
+
("ua" .. tostring(self.index)) .. "r"
|
|
126
127
|
)
|
|
127
128
|
end,
|
|
128
|
-
set = function(self,
|
|
129
|
+
set = function(self, range)
|
|
129
130
|
local ____self_9 = self.unitType
|
|
130
|
-
____self_9.
|
|
131
|
+
____self_9.setNumberField(
|
|
131
132
|
____self_9,
|
|
132
|
-
("
|
|
133
|
-
|
|
133
|
+
("ua" .. tostring(self.index)) .. "r",
|
|
134
|
+
range
|
|
134
135
|
)
|
|
135
136
|
end
|
|
136
137
|
},
|
|
@@ -138,19 +139,63 @@ __TS__SetDescriptor(
|
|
|
138
139
|
)
|
|
139
140
|
__TS__SetDescriptor(
|
|
140
141
|
UnitTypeWeapon.prototype,
|
|
141
|
-
"
|
|
142
|
+
"soundType",
|
|
142
143
|
{
|
|
143
144
|
get = function(self)
|
|
144
145
|
local ____self_10 = self.unitType
|
|
145
146
|
return ____self_10.getStringField(
|
|
146
147
|
____self_10,
|
|
147
|
-
|
|
148
|
+
"ucs" .. tostring(self.index)
|
|
148
149
|
)
|
|
149
150
|
end,
|
|
150
|
-
set = function(self,
|
|
151
|
+
set = function(self, soundType)
|
|
151
152
|
local ____self_11 = self.unitType
|
|
152
153
|
____self_11.setStringField(
|
|
153
154
|
____self_11,
|
|
155
|
+
"ucs" .. tostring(self.index),
|
|
156
|
+
soundType
|
|
157
|
+
)
|
|
158
|
+
end
|
|
159
|
+
},
|
|
160
|
+
true
|
|
161
|
+
)
|
|
162
|
+
__TS__SetDescriptor(
|
|
163
|
+
UnitTypeWeapon.prototype,
|
|
164
|
+
"soundTypeSD",
|
|
165
|
+
{
|
|
166
|
+
get = function(self)
|
|
167
|
+
local ____self_12 = self.unitType
|
|
168
|
+
return ____self_12.getStringField(
|
|
169
|
+
____self_12,
|
|
170
|
+
("ucs" .. tostring(self.index)) .. ":sd"
|
|
171
|
+
)
|
|
172
|
+
end,
|
|
173
|
+
set = function(self, soundTypeSD)
|
|
174
|
+
local ____self_13 = self.unitType
|
|
175
|
+
____self_13.setStringField(
|
|
176
|
+
____self_13,
|
|
177
|
+
("ucs" .. tostring(self.index)) .. ":sd",
|
|
178
|
+
soundTypeSD
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
},
|
|
182
|
+
true
|
|
183
|
+
)
|
|
184
|
+
__TS__SetDescriptor(
|
|
185
|
+
UnitTypeWeapon.prototype,
|
|
186
|
+
"soundTypeHD",
|
|
187
|
+
{
|
|
188
|
+
get = function(self)
|
|
189
|
+
local ____self_14 = self.unitType
|
|
190
|
+
return ____self_14.getStringField(
|
|
191
|
+
____self_14,
|
|
192
|
+
("ucs" .. tostring(self.index)) .. ":hd"
|
|
193
|
+
)
|
|
194
|
+
end,
|
|
195
|
+
set = function(self, soundTypeHD)
|
|
196
|
+
local ____self_15 = self.unitType
|
|
197
|
+
____self_15.setStringField(
|
|
198
|
+
____self_15,
|
|
154
199
|
("ucs" .. tostring(self.index)) .. ":hd",
|
|
155
200
|
soundTypeHD
|
|
156
201
|
)
|
|
@@ -683,6 +728,45 @@ __TS__SetDescriptor(
|
|
|
683
728
|
},
|
|
684
729
|
true
|
|
685
730
|
)
|
|
731
|
+
__TS__SetDescriptor(
|
|
732
|
+
UnitType.prototype,
|
|
733
|
+
"runSpeed",
|
|
734
|
+
{
|
|
735
|
+
get = function(self)
|
|
736
|
+
return self:getNumberField("urun")
|
|
737
|
+
end,
|
|
738
|
+
set = function(self, runSpeed)
|
|
739
|
+
self:setNumberField("urun", runSpeed)
|
|
740
|
+
end
|
|
741
|
+
},
|
|
742
|
+
true
|
|
743
|
+
)
|
|
744
|
+
__TS__SetDescriptor(
|
|
745
|
+
UnitType.prototype,
|
|
746
|
+
"runSpeedSD",
|
|
747
|
+
{
|
|
748
|
+
get = function(self)
|
|
749
|
+
return self:getNumberField("urun:sd")
|
|
750
|
+
end,
|
|
751
|
+
set = function(self, runSpeedSD)
|
|
752
|
+
self:setNumberField("urun:sd", runSpeedSD)
|
|
753
|
+
end
|
|
754
|
+
},
|
|
755
|
+
true
|
|
756
|
+
)
|
|
757
|
+
__TS__SetDescriptor(
|
|
758
|
+
UnitType.prototype,
|
|
759
|
+
"runSpeedHD",
|
|
760
|
+
{
|
|
761
|
+
get = function(self)
|
|
762
|
+
return self:getNumberField("urun:hd")
|
|
763
|
+
end,
|
|
764
|
+
set = function(self, runSpeedHD)
|
|
765
|
+
self:setNumberField("urun:hd", runSpeedHD)
|
|
766
|
+
end
|
|
767
|
+
},
|
|
768
|
+
true
|
|
769
|
+
)
|
|
686
770
|
__TS__SetDescriptor(
|
|
687
771
|
UnitType.prototype,
|
|
688
772
|
"selectionCircleScale",
|
|
@@ -891,6 +975,45 @@ __TS__SetDescriptor(
|
|
|
891
975
|
},
|
|
892
976
|
true
|
|
893
977
|
)
|
|
978
|
+
__TS__SetDescriptor(
|
|
979
|
+
UnitType.prototype,
|
|
980
|
+
"walkSpeed",
|
|
981
|
+
{
|
|
982
|
+
get = function(self)
|
|
983
|
+
return self:getNumberField("uwal")
|
|
984
|
+
end,
|
|
985
|
+
set = function(self, walkSpeed)
|
|
986
|
+
self:setNumberField("uwal", walkSpeed)
|
|
987
|
+
end
|
|
988
|
+
},
|
|
989
|
+
true
|
|
990
|
+
)
|
|
991
|
+
__TS__SetDescriptor(
|
|
992
|
+
UnitType.prototype,
|
|
993
|
+
"walkSpeedSD",
|
|
994
|
+
{
|
|
995
|
+
get = function(self)
|
|
996
|
+
return self:getNumberField("uwal:sd")
|
|
997
|
+
end,
|
|
998
|
+
set = function(self, walkSpeedSD)
|
|
999
|
+
self:setNumberField("uwal:sd", walkSpeedSD)
|
|
1000
|
+
end
|
|
1001
|
+
},
|
|
1002
|
+
true
|
|
1003
|
+
)
|
|
1004
|
+
__TS__SetDescriptor(
|
|
1005
|
+
UnitType.prototype,
|
|
1006
|
+
"walkSpeedHD",
|
|
1007
|
+
{
|
|
1008
|
+
get = function(self)
|
|
1009
|
+
return self:getNumberField("uwal:hd")
|
|
1010
|
+
end,
|
|
1011
|
+
set = function(self, walkSpeedHD)
|
|
1012
|
+
self:setNumberField("uwal:hd", walkSpeedHD)
|
|
1013
|
+
end
|
|
1014
|
+
},
|
|
1015
|
+
true
|
|
1016
|
+
)
|
|
894
1017
|
__TS__SetDescriptor(
|
|
895
1018
|
UnitType.prototype,
|
|
896
1019
|
"armorSoundType",
|
|
@@ -1262,11 +1385,11 @@ __TS__SetDescriptor(
|
|
|
1262
1385
|
implementReadonlyNumberIndexSupplier(
|
|
1263
1386
|
____exports.UnitType,
|
|
1264
1387
|
function(id)
|
|
1265
|
-
local
|
|
1266
|
-
|
|
1267
|
-
__TS__ClassExtends(
|
|
1268
|
-
|
|
1269
|
-
return
|
|
1388
|
+
local ____class_16 = __TS__Class()
|
|
1389
|
+
____class_16.name = ____class_16.name
|
|
1390
|
+
__TS__ClassExtends(____class_16, ____exports.UnitType)
|
|
1391
|
+
____class_16.BASE_ID = id
|
|
1392
|
+
return ____class_16
|
|
1270
1393
|
end
|
|
1271
1394
|
)
|
|
1272
1395
|
____exports.HeroUnitType = __TS__Class()
|
|
@@ -1293,14 +1416,45 @@ __TS__SetDescriptor(
|
|
|
1293
1416
|
},
|
|
1294
1417
|
true
|
|
1295
1418
|
)
|
|
1419
|
+
__TS__SetDescriptor(
|
|
1420
|
+
HeroUnitType.prototype,
|
|
1421
|
+
"properNames",
|
|
1422
|
+
{
|
|
1423
|
+
get = function(self)
|
|
1424
|
+
return self:getStringsField("upro")
|
|
1425
|
+
end,
|
|
1426
|
+
set = function(self, properNames)
|
|
1427
|
+
if __TS__ArrayIsArray(properNames) then
|
|
1428
|
+
self:setStringsField("upro", properNames)
|
|
1429
|
+
self:setNumberField("upru", #properNames)
|
|
1430
|
+
else
|
|
1431
|
+
self:setStringField("upro", properNames)
|
|
1432
|
+
end
|
|
1433
|
+
end
|
|
1434
|
+
},
|
|
1435
|
+
true
|
|
1436
|
+
)
|
|
1437
|
+
__TS__SetDescriptor(
|
|
1438
|
+
HeroUnitType.prototype,
|
|
1439
|
+
"properNameCount",
|
|
1440
|
+
{
|
|
1441
|
+
get = function(self)
|
|
1442
|
+
return self:getNumberField("upru")
|
|
1443
|
+
end,
|
|
1444
|
+
set = function(self, properNameCount)
|
|
1445
|
+
self:setNumberField("upru", properNameCount)
|
|
1446
|
+
end
|
|
1447
|
+
},
|
|
1448
|
+
true
|
|
1449
|
+
)
|
|
1296
1450
|
implementReadonlyNumberIndexSupplier(
|
|
1297
1451
|
____exports.HeroUnitType,
|
|
1298
1452
|
function(id)
|
|
1299
|
-
local
|
|
1300
|
-
|
|
1301
|
-
__TS__ClassExtends(
|
|
1302
|
-
|
|
1303
|
-
return
|
|
1453
|
+
local ____class_17 = __TS__Class()
|
|
1454
|
+
____class_17.name = ____class_17.name
|
|
1455
|
+
__TS__ClassExtends(____class_17, ____exports.HeroUnitType)
|
|
1456
|
+
____class_17.BASE_ID = id
|
|
1457
|
+
return ____class_17
|
|
1304
1458
|
end
|
|
1305
1459
|
)
|
|
1306
1460
|
return ____exports
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import { Ability } from "../internal/ability";
|
|
2
|
+
import { Ability, jabilityfield } from "../internal/ability";
|
|
3
3
|
import { ObjectArrayField, ObjectField, ObjectFieldValueChangeEvent, ObjectLevelField, ObjectLevelFieldValueChangeEvent, ReadonlyObjectFieldType, ReadonlyObjectLevelFieldType } from "../object-field";
|
|
4
4
|
import { AbilityType, AbilityTypeId } from "../object-data/entry/ability-type";
|
|
5
5
|
import { ObjectDataEntryId } from "../object-data/entry";
|
|
6
6
|
import { LightningTypeId } from "../object-data/entry/lightning-type";
|
|
7
7
|
import { CombatClassifications } from "../object-data/auxiliary/combat-classification";
|
|
8
8
|
import { UnitTypeId } from "../object-data/entry/unit-type";
|
|
9
|
-
export declare abstract class AbilityField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType =
|
|
9
|
+
export declare abstract class AbilityField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType extends jabilityfield = jabilityfield> extends ObjectField<AbilityType, Ability, ValueType, NativeFieldType> {
|
|
10
10
|
protected get instanceClass(): typeof Ability;
|
|
11
11
|
protected getObjectDataEntryId(instance: Ability): AbilityTypeId;
|
|
12
|
+
protected hasNativeFieldValue(instance: Ability): boolean;
|
|
12
13
|
static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<AbilityField>>;
|
|
13
14
|
}
|
|
14
15
|
export declare class AbilityBooleanField extends AbilityField<boolean, jabilitybooleanfield> {
|
|
@@ -18,7 +19,7 @@ export declare class AbilityBooleanField extends AbilityField<boolean, jabilityb
|
|
|
18
19
|
protected setNativeFieldValue(instance: Ability, value: boolean): boolean;
|
|
19
20
|
static get valueChangeEvent(): ObjectFieldValueChangeEvent<AbilityBooleanField>;
|
|
20
21
|
}
|
|
21
|
-
export declare abstract class AbilityNumberField<NativeFieldType =
|
|
22
|
+
export declare abstract class AbilityNumberField<NativeFieldType extends jabilityfield = jabilityfield> extends AbilityField<number, NativeFieldType> {
|
|
22
23
|
protected get defaultValue(): number;
|
|
23
24
|
static get valueChangeEvent(): ObjectFieldValueChangeEvent<AbilityNumberField>;
|
|
24
25
|
}
|
|
@@ -59,10 +60,11 @@ export declare abstract class AbilityObjectDataEntryIdArrayField<T extends Objec
|
|
|
59
60
|
}
|
|
60
61
|
export declare class AbilityLightningTypeIdArrayField extends AbilityObjectDataEntryIdArrayField<LightningTypeId> {
|
|
61
62
|
}
|
|
62
|
-
export declare abstract class AbilityLevelField<ValueType extends number | string | boolean = number | string | boolean, InputValueType extends ValueType = never, NativeFieldType =
|
|
63
|
+
export declare abstract class AbilityLevelField<ValueType extends number | string | boolean = number | string | boolean, InputValueType extends ValueType = never, NativeFieldType extends jabilityfield = jabilityfield> extends ObjectLevelField<AbilityType, Ability, ValueType, InputValueType, NativeFieldType> {
|
|
63
64
|
protected get instanceClass(): typeof Ability;
|
|
64
65
|
protected getLevelCount(entry: AbilityType | Ability): number;
|
|
65
66
|
protected getObjectDataEntryId(instance: Ability): AbilityTypeId;
|
|
67
|
+
protected hasNativeFieldValue(instance: Ability): boolean;
|
|
66
68
|
static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<ReadonlyObjectLevelFieldType<AbilityLevelField>>;
|
|
67
69
|
}
|
|
68
70
|
export declare class AbilityBooleanLevelField extends AbilityLevelField<boolean, boolean, jabilityintegerlevelfield> {
|
|
@@ -72,7 +74,7 @@ export declare class AbilityBooleanLevelField extends AbilityLevelField<boolean,
|
|
|
72
74
|
protected setNativeFieldValue(instance: Ability, level: number, value: boolean): boolean;
|
|
73
75
|
static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<AbilityBooleanLevelField>;
|
|
74
76
|
}
|
|
75
|
-
export declare abstract class AbilityNumberLevelField<NativeFieldType =
|
|
77
|
+
export declare abstract class AbilityNumberLevelField<NativeFieldType extends jabilityfield = jabilityfield> extends AbilityLevelField<number, number, NativeFieldType> {
|
|
76
78
|
protected get defaultValue(): number;
|
|
77
79
|
static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<AbilityNumberLevelField>;
|
|
78
80
|
}
|
|
@@ -27,6 +27,9 @@ __TS__ClassExtends(AbilityField, ObjectField)
|
|
|
27
27
|
function AbilityField.prototype.getObjectDataEntryId(self, instance)
|
|
28
28
|
return instance.typeId
|
|
29
29
|
end
|
|
30
|
+
function AbilityField.prototype.hasNativeFieldValue(self, instance)
|
|
31
|
+
return instance:hasField(self.nativeField)
|
|
32
|
+
end
|
|
30
33
|
__TS__SetDescriptor(
|
|
31
34
|
AbilityField.prototype,
|
|
32
35
|
"instanceClass",
|
|
@@ -261,6 +264,9 @@ end
|
|
|
261
264
|
function AbilityLevelField.prototype.getObjectDataEntryId(self, instance)
|
|
262
265
|
return instance.typeId
|
|
263
266
|
end
|
|
267
|
+
function AbilityLevelField.prototype.hasNativeFieldValue(self, instance)
|
|
268
|
+
return instance:hasField(self.nativeField)
|
|
269
|
+
end
|
|
264
270
|
__TS__SetDescriptor(
|
|
265
271
|
AbilityLevelField.prototype,
|
|
266
272
|
"instanceClass",
|
|
@@ -9,6 +9,7 @@ export declare abstract class UnitField<ValueType extends number | string | bool
|
|
|
9
9
|
export declare class UnitStringField extends UnitField<string, junitstringfield> {
|
|
10
10
|
protected get defaultValue(): string;
|
|
11
11
|
protected getNativeFieldById(id: number): junitstringfield;
|
|
12
|
+
protected hasNativeFieldValue(): boolean;
|
|
12
13
|
protected getNativeFieldValue(instance: Unit): string;
|
|
13
14
|
protected getObjectDataEntryId(instance: Unit): UnitTypeId;
|
|
14
15
|
protected setNativeFieldValue(instance: Unit, value: string): boolean;
|
|
@@ -29,6 +29,9 @@ __TS__ClassExtends(UnitStringField, ____exports.UnitField)
|
|
|
29
29
|
function UnitStringField.prototype.getNativeFieldById(self, id)
|
|
30
30
|
return ConvertUnitStringField(id)
|
|
31
31
|
end
|
|
32
|
+
function UnitStringField.prototype.hasNativeFieldValue(self)
|
|
33
|
+
return true
|
|
34
|
+
end
|
|
32
35
|
function UnitStringField.prototype.getNativeFieldValue(self, instance)
|
|
33
36
|
return instance:getField(self.nativeField)
|
|
34
37
|
end
|