warscript 0.0.1-dev.e72b4b0 → 0.0.1-dev.ea102a7
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/core/types/frame.lua +24 -21
- package/core/types/player.lua +3 -1
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/tileCell.d.ts +9 -0
- package/core/types/tileCell.lua +92 -0
- package/core/types/timer.d.ts +2 -1
- package/core/types/timer.lua +21 -2
- package/decl/native.d.ts +6 -4
- package/engine/behavior.d.ts +5 -0
- package/engine/behavior.lua +106 -27
- package/engine/behaviour/ability/apply-buff.lua +1 -1
- package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
- package/engine/behaviour/ability/emulate-impact.lua +2 -1
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.lua +7 -16
- package/engine/behaviour/unit/stun-immunity.d.ts +7 -3
- package/engine/behaviour/unit/stun-immunity.lua +52 -27
- package/engine/behaviour/unit.d.ts +12 -2
- package/engine/behaviour/unit.lua +47 -7
- package/engine/buff.d.ts +2 -4
- package/engine/buff.lua +68 -83
- package/engine/internal/ability.d.ts +3 -1
- package/engine/internal/ability.lua +34 -11
- package/engine/internal/item/ability.lua +51 -1
- package/engine/internal/item+owner.lua +12 -6
- package/engine/internal/item.d.ts +13 -15
- package/engine/internal/item.lua +63 -49
- package/engine/internal/misc/frame-coordinates.d.ts +2 -0
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/unit/ability.lua +13 -5
- package/engine/internal/unit+ability.lua +10 -1
- package/engine/internal/unit-missile-launch.lua +18 -5
- package/engine/internal/unit.d.ts +5 -6
- package/engine/internal/unit.lua +73 -73
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/entry/ability-type.lua +5 -4
- package/engine/object-data/entry/unit-type.d.ts +11 -2
- package/engine/object-data/entry/unit-type.lua +59 -1
- package/engine/object-field/ability.d.ts +3 -3
- package/engine/object-field/ability.lua +7 -6
- package/engine/object-field/unit.d.ts +7 -0
- package/engine/object-field/unit.lua +21 -0
- package/engine/object-field.d.ts +2 -2
- package/engine/object-field.lua +8 -6
- package/engine/random.d.ts +9 -0
- package/engine/random.lua +13 -0
- package/engine/standard/fields/unit.d.ts +2 -1
- package/engine/standard/fields/unit.lua +2 -0
- package/engine/text-tag.d.ts +1 -1
- package/engine/text-tag.lua +91 -17
- package/objutil/buff.lua +1 -1
- package/package.json +2 -2
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +8 -0
- package/utility/callback-array.d.ts +13 -0
- package/utility/callback-array.lua +46 -0
- package/utility/functions.d.ts +7 -0
- package/utility/functions.lua +12 -0
- package/utility/lua-maps.d.ts +11 -2
- package/utility/lua-maps.lua +33 -2
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +4 -0
package/engine/internal/item.lua
CHANGED
|
@@ -46,9 +46,18 @@ local getItemY = GetItemY
|
|
|
46
46
|
local getItemCharges = GetItemCharges
|
|
47
47
|
local setItemCharges = SetItemCharges
|
|
48
48
|
local unitRemoveAbility = UnitRemoveAbility
|
|
49
|
+
local unitRemoveItem = UnitRemoveItem
|
|
49
50
|
local unitUseItem = UnitUseItem
|
|
50
51
|
local unitUseItemPoint = UnitUseItemPoint
|
|
51
52
|
local unitUseItemTarget = UnitUseItemTarget
|
|
53
|
+
local setItemDropOnDeath = SetItemDropOnDeath
|
|
54
|
+
local setItemDroppable = SetItemDroppable
|
|
55
|
+
local setItemPawnable = SetItemPawnable
|
|
56
|
+
local isItemPawnable = IsItemPawnable
|
|
57
|
+
local getItemIntegerField = BlzGetItemIntegerField
|
|
58
|
+
local setItemBooleanField = BlzSetItemBooleanField
|
|
59
|
+
local getItemBooleanField = BlzGetItemBooleanField
|
|
60
|
+
local tableRemove = table.remove
|
|
52
61
|
_G.SetItemCharges = function(whichItem, charges)
|
|
53
62
|
setItemCharges(whichItem, charges)
|
|
54
63
|
invoke(
|
|
@@ -56,9 +65,6 @@ _G.SetItemCharges = function(whichItem, charges)
|
|
|
56
65
|
____exports.Item:of(whichItem)
|
|
57
66
|
)
|
|
58
67
|
end
|
|
59
|
-
local getItemIntegerField = BlzGetItemIntegerField
|
|
60
|
-
local setItemBooleanField = BlzSetItemBooleanField
|
|
61
|
-
local getItemBooleanField = BlzGetItemBooleanField
|
|
62
68
|
invoke = Event.invoke
|
|
63
69
|
local enumRect = Rect:create(0, 0, 0, 0).handle
|
|
64
70
|
---
|
|
@@ -137,15 +143,13 @@ Item.name = "Item"
|
|
|
137
143
|
__TS__ClassExtends(Item, Handle)
|
|
138
144
|
function Item.prototype.____constructor(self, handle)
|
|
139
145
|
Handle.prototype.____constructor(self, handle)
|
|
140
|
-
|
|
141
|
-
self[100] = abilities
|
|
142
|
-
local luaIndexByAbilityTypeId = {}
|
|
143
|
-
for i = 1, #abilities do
|
|
144
|
-
luaIndexByAbilityTypeId[abilities[i].typeId] = i
|
|
145
|
-
end
|
|
146
|
-
self[101] = luaIndexByAbilityTypeId
|
|
146
|
+
self[100] = doAbilityAction(handle, getItemAbilities, self)
|
|
147
147
|
end
|
|
148
148
|
function Item.prototype.onDestroy(self)
|
|
149
|
+
local owner = self.owner
|
|
150
|
+
if owner ~= nil then
|
|
151
|
+
unitRemoveItem(owner.handle, self.handle)
|
|
152
|
+
end
|
|
149
153
|
local abilities = self[100]
|
|
150
154
|
for i = 1, #abilities do
|
|
151
155
|
abilities[i]:destroy()
|
|
@@ -191,33 +195,32 @@ function Item.prototype.addAbility(self, abilityTypeId)
|
|
|
191
195
|
if nativeAbility ~= nil then
|
|
192
196
|
local ability = ItemAbility:of(nativeAbility, abilityTypeId, self)
|
|
193
197
|
local abilities = self[100]
|
|
194
|
-
|
|
195
|
-
abilities[luaIndex] = ability
|
|
196
|
-
self[101][abilityTypeId] = luaIndex
|
|
198
|
+
abilities[#abilities + 1] = ability
|
|
197
199
|
return ability
|
|
198
200
|
end
|
|
199
201
|
return nil
|
|
200
202
|
end
|
|
201
203
|
function Item.prototype.removeAbility(self, abilityTypeId)
|
|
202
|
-
local
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
for j = luaIndex, abilityTypeIdsLength do
|
|
210
|
-
abilities[j] = abilities[j + 1]
|
|
204
|
+
local abilities = self[100]
|
|
205
|
+
for i = 1, #abilities do
|
|
206
|
+
if abilities[i].typeId == abilityTypeId then
|
|
207
|
+
local ability = abilities[i]
|
|
208
|
+
tableRemove(abilities, i)
|
|
209
|
+
ability:destroy()
|
|
210
|
+
return true
|
|
211
211
|
end
|
|
212
212
|
end
|
|
213
|
-
return
|
|
213
|
+
return doAbilityAction(self.handle, itemRemoveAbility, abilityTypeId)
|
|
214
214
|
end
|
|
215
215
|
function Item.prototype.hasAbility(self, abilityTypeId)
|
|
216
|
-
return self
|
|
216
|
+
return doAbilityAction(self.handle, getItemAbility, abilityTypeId) ~= nil
|
|
217
217
|
end
|
|
218
218
|
function Item.prototype.getAbility(self, abilityTypeId)
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
return ItemAbility:of(
|
|
220
|
+
doAbilityAction(self.handle, getItemAbility, abilityTypeId),
|
|
221
|
+
abilityTypeId,
|
|
222
|
+
self
|
|
223
|
+
)
|
|
221
224
|
end
|
|
222
225
|
function Item.getInRange(self, x, y, range)
|
|
223
226
|
targetCollection = {}
|
|
@@ -329,65 +332,68 @@ __TS__SetDescriptor(
|
|
|
329
332
|
)
|
|
330
333
|
__TS__SetDescriptor(
|
|
331
334
|
Item.prototype,
|
|
332
|
-
"
|
|
335
|
+
"dropsOnDeath",
|
|
333
336
|
{
|
|
334
337
|
get = function(self)
|
|
335
|
-
return
|
|
338
|
+
return getItemBooleanField(self.handle, ITEM_BF_DROPPED_WHEN_CARRIER_DIES)
|
|
336
339
|
end,
|
|
337
|
-
set = function(self,
|
|
338
|
-
|
|
340
|
+
set = function(self, dropsOnDeath)
|
|
341
|
+
setItemDropOnDeath(self.handle, dropsOnDeath)
|
|
339
342
|
end
|
|
340
343
|
},
|
|
341
344
|
true
|
|
342
345
|
)
|
|
343
346
|
__TS__SetDescriptor(
|
|
344
347
|
Item.prototype,
|
|
345
|
-
"
|
|
348
|
+
"canBeDropped",
|
|
346
349
|
{
|
|
347
350
|
get = function(self)
|
|
348
|
-
return
|
|
351
|
+
return getItemBooleanField(self.handle, ITEM_BF_CAN_BE_DROPPED)
|
|
349
352
|
end,
|
|
350
|
-
set = function(self,
|
|
351
|
-
|
|
353
|
+
set = function(self, canBeDropped)
|
|
354
|
+
setItemDroppable(self.handle, canBeDropped)
|
|
352
355
|
end
|
|
353
356
|
},
|
|
354
357
|
true
|
|
355
358
|
)
|
|
356
359
|
__TS__SetDescriptor(
|
|
357
360
|
Item.prototype,
|
|
358
|
-
"
|
|
361
|
+
"canBeSold",
|
|
359
362
|
{
|
|
360
363
|
get = function(self)
|
|
361
|
-
return
|
|
364
|
+
return isItemPawnable(self.handle)
|
|
362
365
|
end,
|
|
363
|
-
set = function(self,
|
|
364
|
-
|
|
366
|
+
set = function(self, canBeSold)
|
|
367
|
+
setItemPawnable(self.handle, canBeSold)
|
|
365
368
|
end
|
|
366
369
|
},
|
|
367
370
|
true
|
|
368
371
|
)
|
|
369
372
|
__TS__SetDescriptor(
|
|
370
373
|
Item.prototype,
|
|
371
|
-
"
|
|
374
|
+
"perishes",
|
|
372
375
|
{
|
|
373
376
|
get = function(self)
|
|
374
377
|
return getItemBooleanField(self.handle, ITEM_BF_PERISHABLE)
|
|
375
378
|
end,
|
|
376
|
-
set = function(self,
|
|
377
|
-
|
|
379
|
+
set = function(self, perishes)
|
|
380
|
+
local handle = self.handle
|
|
381
|
+
local powerUp = isItemPowerup(handle)
|
|
382
|
+
setItemBooleanField(handle, ITEM_BF_PERISHABLE, perishes)
|
|
383
|
+
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, powerUp)
|
|
378
384
|
end
|
|
379
385
|
},
|
|
380
386
|
true
|
|
381
387
|
)
|
|
382
388
|
__TS__SetDescriptor(
|
|
383
389
|
Item.prototype,
|
|
384
|
-
"
|
|
390
|
+
"isPowerUp",
|
|
385
391
|
{
|
|
386
392
|
get = function(self)
|
|
387
393
|
return isItemPowerup(self.handle)
|
|
388
394
|
end,
|
|
389
|
-
set = function(self,
|
|
390
|
-
setItemBooleanField(self.handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED,
|
|
395
|
+
set = function(self, isPowerUp)
|
|
396
|
+
setItemBooleanField(self.handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, isPowerUp)
|
|
391
397
|
end
|
|
392
398
|
},
|
|
393
399
|
true
|
|
@@ -423,16 +429,24 @@ __TS__SetDescriptor(
|
|
|
423
429
|
)
|
|
424
430
|
__TS__SetDescriptor(
|
|
425
431
|
Item.prototype,
|
|
426
|
-
"
|
|
432
|
+
"isActivelyUsed",
|
|
427
433
|
{
|
|
428
434
|
get = function(self)
|
|
429
435
|
return getItemBooleanField(self.handle, ITEM_BF_ACTIVELY_USED)
|
|
430
436
|
end,
|
|
431
|
-
set = function(self,
|
|
437
|
+
set = function(self, isActivelyUsed)
|
|
432
438
|
local handle = self.handle
|
|
433
|
-
local
|
|
434
|
-
|
|
435
|
-
|
|
439
|
+
local powerUp = isItemPowerup(handle)
|
|
440
|
+
local perishes = getItemBooleanField(handle, ITEM_BF_PERISHABLE)
|
|
441
|
+
local dropsOnDeath = getItemBooleanField(handle, ITEM_BF_DROPPED_WHEN_CARRIER_DIES)
|
|
442
|
+
local canBeDropped = getItemBooleanField(handle, ITEM_BF_CAN_BE_DROPPED)
|
|
443
|
+
local canBeSold = isItemPawnable(handle)
|
|
444
|
+
setItemBooleanField(handle, ITEM_BF_ACTIVELY_USED, isActivelyUsed)
|
|
445
|
+
setItemPawnable(handle, canBeSold)
|
|
446
|
+
setItemDroppable(handle, canBeDropped)
|
|
447
|
+
setItemDropOnDeath(handle, dropsOnDeath)
|
|
448
|
+
setItemBooleanField(handle, ITEM_BF_PERISHABLE, perishes)
|
|
449
|
+
setItemBooleanField(handle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, powerUp)
|
|
436
450
|
end
|
|
437
451
|
},
|
|
438
452
|
true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local getLocalClientWidth = BlzGetLocalClientWidth
|
|
3
|
+
local getLocalClientHeight = BlzGetLocalClientHeight
|
|
4
|
+
---
|
|
5
|
+
-- @internal For use by internal systems only.
|
|
6
|
+
____exports.getFrameMinXMaxX = function()
|
|
7
|
+
local w = getLocalClientWidth()
|
|
8
|
+
local h = getLocalClientHeight()
|
|
9
|
+
local width4by3 = (w - h / 600 * 800) / 2
|
|
10
|
+
local pxtodpi = 0.6 / h
|
|
11
|
+
local minX = -width4by3 * pxtodpi
|
|
12
|
+
local maxX = minX + w * pxtodpi
|
|
13
|
+
return minX, maxX
|
|
14
|
+
end
|
|
15
|
+
---
|
|
16
|
+
-- @internal For use by internal systems only.
|
|
17
|
+
____exports.FRAME_MIN_Y = 0
|
|
18
|
+
---
|
|
19
|
+
-- @internal For use by internal systems only.
|
|
20
|
+
____exports.FRAME_MAX_Y = 0.6
|
|
21
|
+
return ____exports
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local getLocationZ = GetLocationZ
|
|
3
|
+
local moveLocation = MoveLocation
|
|
4
|
+
local location = Location(0, 0)
|
|
5
|
+
---
|
|
6
|
+
-- @internal For use by internal systems only.
|
|
7
|
+
____exports.getTerrainZ = function(x, y)
|
|
8
|
+
moveLocation(location, x, y)
|
|
9
|
+
return getLocationZ(location)
|
|
10
|
+
end
|
|
11
|
+
return ____exports
|
|
@@ -23,6 +23,8 @@ local ____lazy = require("utility.lazy")
|
|
|
23
23
|
local lazyRecord = ____lazy.lazyRecord
|
|
24
24
|
local ____timer = require("core.types.timer")
|
|
25
25
|
local Timer = ____timer.Timer
|
|
26
|
+
local ____lua_2Dsets = require("utility.lua-sets")
|
|
27
|
+
local luaSetOf = ____lua_2Dsets.luaSetOf
|
|
26
28
|
local eventInvoke = Event.invoke
|
|
27
29
|
local condition = Condition
|
|
28
30
|
local createTrigger = CreateTrigger
|
|
@@ -407,14 +409,13 @@ rawset(
|
|
|
407
409
|
extractAbilityTypeId
|
|
408
410
|
)
|
|
409
411
|
)
|
|
412
|
+
local internalAbilityChannelingFinishEvent = __TS__New(UnitTriggerEvent, EVENT_PLAYER_UNIT_SPELL_FINISH, collectUnitAbilityEventParameters)
|
|
410
413
|
rawset(
|
|
411
414
|
Unit,
|
|
412
415
|
"abilityChannelingFinishEvent",
|
|
413
|
-
createDispatchingEvent(
|
|
414
|
-
__TS__New(UnitTriggerEvent, EVENT_PLAYER_UNIT_SPELL_FINISH, collectUnitAbilityEventParameters),
|
|
415
|
-
extractAbilityTypeId
|
|
416
|
-
)
|
|
416
|
+
createDispatchingEvent(internalAbilityChannelingFinishEvent, extractAbilityTypeId)
|
|
417
417
|
)
|
|
418
|
+
local internalAbilityStopEvent = __TS__New(UnitTriggerEvent, EVENT_PLAYER_UNIT_SPELL_ENDCAST, collectUnitAbilityEventParameters)
|
|
418
419
|
rawset(
|
|
419
420
|
Unit,
|
|
420
421
|
"abilityStopEvent",
|
|
@@ -438,7 +439,7 @@ rawset(
|
|
|
438
439
|
condition(function()
|
|
439
440
|
local unit = Unit:of(getTriggerUnit())
|
|
440
441
|
if unit ~= nil then
|
|
441
|
-
local ability = unit:
|
|
442
|
+
local ability = unit:getAbility(abilityTypeId)
|
|
442
443
|
if ability ~= nil then
|
|
443
444
|
eventInvoke(event, unit, ability, orderTypeStringId)
|
|
444
445
|
end
|
|
@@ -450,4 +451,11 @@ rawset(
|
|
|
450
451
|
end)
|
|
451
452
|
end)
|
|
452
453
|
)
|
|
454
|
+
local spellEffectOnlyAbilityTypeIds = luaSetOf(fourCC("AAns"))
|
|
455
|
+
internalAbilityChannelingStartEvent:addListener(function(unit, ability)
|
|
456
|
+
if spellEffectOnlyAbilityTypeIds[ability.parentTypeId] ~= nil then
|
|
457
|
+
eventInvoke(internalAbilityChannelingFinishEvent, unit, ability)
|
|
458
|
+
eventInvoke(internalAbilityStopEvent, unit, ability)
|
|
459
|
+
end
|
|
460
|
+
end)
|
|
453
461
|
return ____exports
|
|
@@ -7,8 +7,8 @@ local UnitAbility = ____ability.UnitAbility
|
|
|
7
7
|
local ____unit = require("engine.internal.unit")
|
|
8
8
|
local Unit = ____unit.Unit
|
|
9
9
|
local ____event = require("event")
|
|
10
|
-
local Event = ____event.Event
|
|
11
10
|
local createDispatchingEvent = ____event.createDispatchingEvent
|
|
11
|
+
local Event = ____event.Event
|
|
12
12
|
local abilityGainedEvent = createDispatchingEvent(
|
|
13
13
|
__TS__New(Event),
|
|
14
14
|
function(unit, ability) return ability.typeId end
|
|
@@ -40,6 +40,15 @@ ItemAbility.onCreate:addListener(
|
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
)
|
|
43
|
+
ItemAbility.destroyEvent:addListener(
|
|
44
|
+
4,
|
|
45
|
+
function(ability)
|
|
46
|
+
local unit = ability.owner.owner
|
|
47
|
+
if unit ~= nil then
|
|
48
|
+
Event.invoke(abilityLostEvent, unit, ability)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
)
|
|
43
52
|
Unit.itemPickedUpEvent:addListener(
|
|
44
53
|
0,
|
|
45
54
|
function(unit, item)
|
|
@@ -9,6 +9,8 @@ local ____timer = require("core.types.timer")
|
|
|
9
9
|
local Timer = ____timer.Timer
|
|
10
10
|
local ____lua_2Dsets = require("utility.lua-sets")
|
|
11
11
|
local luaSetOf = ____lua_2Dsets.luaSetOf
|
|
12
|
+
local ____math = require("math")
|
|
13
|
+
local min = ____math.min
|
|
12
14
|
local autoAttackFinishEvent = __TS__New(Event)
|
|
13
15
|
rawset(Unit, "autoAttackFinishEvent", autoAttackFinishEvent)
|
|
14
16
|
local eventTimerByUnit = {}
|
|
@@ -43,9 +45,20 @@ local function timerCallback(source, target)
|
|
|
43
45
|
eventTimerByUnit[source] = nil
|
|
44
46
|
Event.invoke(autoAttackFinishEvent, source, target)
|
|
45
47
|
end
|
|
46
|
-
Unit.autoAttackStartEvent:addListener(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
Unit.autoAttackStartEvent:addListener(
|
|
49
|
+
4,
|
|
50
|
+
function(source, target)
|
|
51
|
+
local attackPoint = (source:chooseWeapon(target) or source.firstWeapon).impactDelay
|
|
52
|
+
local timer = Timer:simple(
|
|
53
|
+
attackPoint + min(
|
|
54
|
+
compiletime(1 / 64),
|
|
55
|
+
attackPoint / 2
|
|
56
|
+
),
|
|
57
|
+
timerCallback,
|
|
58
|
+
source,
|
|
59
|
+
target
|
|
60
|
+
)
|
|
61
|
+
eventTimerByUnit[source] = timer
|
|
62
|
+
end
|
|
63
|
+
)
|
|
51
64
|
return ____exports
|
|
@@ -160,8 +160,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
160
160
|
isInRangeOf(unit: Unit, range: number): boolean;
|
|
161
161
|
isAllyOf(unit: Unit): boolean;
|
|
162
162
|
isEnemyOf(unit: Unit): boolean;
|
|
163
|
-
playAnimation(animation: string, rarity?: jraritycontrol): void;
|
|
164
|
-
playAnimation(animation: number): void;
|
|
163
|
+
playAnimation(...parameters: [animation: number] | [animation: string, rarity?: jraritycontrol]): void;
|
|
165
164
|
resetAnimation(): void;
|
|
166
165
|
queueAnimation(animation: string): void;
|
|
167
166
|
get weapons(): [UnitWeapon, UnitWeapon];
|
|
@@ -267,13 +266,13 @@ export declare class Unit extends Handle<junit> {
|
|
|
267
266
|
dropItemTarget(item: Item, target: Widget): boolean;
|
|
268
267
|
dropItemSlot(item: Item, slot: number): boolean;
|
|
269
268
|
itemInSlot(slot: number): Item | null;
|
|
270
|
-
addAbility(abilityId: number): UnitAbility |
|
|
269
|
+
addAbility(abilityId: number): UnitAbility | undefined;
|
|
271
270
|
makeAbilityPermanent(abilityId: number, permanent: true): boolean;
|
|
272
271
|
setAbilityLevel(abilityId: number, level: number): number;
|
|
273
272
|
getAbilityLevel(abilityId: number): number;
|
|
274
273
|
hasAbility(abilityId: number): boolean;
|
|
275
|
-
|
|
276
|
-
removeAbility(
|
|
274
|
+
getAbility(abilityId: number): UnitAbility | undefined;
|
|
275
|
+
removeAbility(abilityTypeId: number): boolean;
|
|
277
276
|
hideAbility(abilityId: number, flag: boolean): void;
|
|
278
277
|
getAbilityRemainingCooldown(abilityId: number): number;
|
|
279
278
|
startAbilityCooldown(abilityId: number, cooldown: number): void;
|
|
@@ -354,7 +353,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
354
353
|
static itemDroppedEvent: UnitTriggerEvent<[Item]>;
|
|
355
354
|
static itemPickedUpEvent: UnitTriggerEvent<[Item]>;
|
|
356
355
|
static itemUsedEvent: UnitTriggerEvent<[Item]>;
|
|
357
|
-
static itemStackedEvent: UnitTriggerEvent<[Item]>;
|
|
356
|
+
static itemStackedEvent: UnitTriggerEvent<[target: Item, source: Item]>;
|
|
358
357
|
static get itemChargesChangedEvent(): Event<[unit: Unit, item: Item]>;
|
|
359
358
|
static get itemUseOrderEvent(): Event<[unit: Unit, item: Item]>;
|
|
360
359
|
static get itemMoveOrderEvent(): Event<[
|