warscript 0.0.1-dev.ec4cf89 → 0.0.1-dev.ed60fea
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/effect.d.ts +13 -3
- package/core/types/effect.lua +116 -17
- package/core/types/frame.d.ts +6 -0
- package/core/types/frame.lua +91 -1
- package/core/util.d.ts +1 -1
- package/core/util.lua +12 -0
- package/engine/behavior.d.ts +2 -2
- package/engine/behavior.lua +6 -6
- package/engine/behaviour/ability/always-enabled.d.ts +7 -0
- package/engine/behaviour/ability/always-enabled.lua +31 -0
- package/engine/behaviour/ability/apply-buff.d.ts +3 -5
- package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
- package/engine/behaviour/ability/emulate-impact.lua +28 -0
- package/engine/behaviour/ability/instant-impact.d.ts +2 -2
- package/engine/behaviour/ability/instant-impact.lua +4 -19
- package/engine/behaviour/ability/on-command-impact.d.ts +8 -0
- package/engine/behaviour/ability/on-command-impact.lua +25 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +16 -0
- package/engine/behaviour/ability/remove-buffs.lua +28 -0
- package/engine/behaviour/ability.d.ts +14 -3
- package/engine/behaviour/ability.lua +79 -33
- package/engine/behaviour/unit.d.ts +5 -0
- package/engine/behaviour/unit.lua +20 -0
- package/engine/buff.d.ts +38 -12
- package/engine/buff.lua +171 -79
- package/engine/internal/ability.d.ts +16 -13
- package/engine/internal/ability.lua +82 -76
- package/engine/internal/item/ability.lua +90 -0
- package/engine/internal/item+owner.lua +2 -2
- package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
- package/engine/internal/misc/ability-disable-counter.lua +13 -0
- package/engine/internal/unit/ability.d.ts +10 -1
- package/engine/internal/unit/ability.lua +36 -14
- package/engine/internal/unit/bonus.d.ts +4 -2
- package/engine/internal/unit/bonus.lua +6 -1
- package/engine/internal/unit/item.d.ts +24 -0
- package/engine/internal/unit/item.lua +79 -0
- package/engine/internal/unit/main-selected.d.ts +13 -0
- package/engine/internal/unit/main-selected.lua +51 -0
- package/engine/internal/unit+ability.lua +2 -2
- package/engine/internal/unit-missile-launch.lua +24 -5
- package/engine/internal/unit.d.ts +25 -10
- package/engine/internal/unit.lua +144 -77
- package/engine/internal/utility.lua +12 -0
- package/engine/local-client.d.ts +7 -2
- package/engine/local-client.lua +82 -0
- package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
- package/engine/object-data/entry/ability-type.lua +8 -12
- package/engine/object-data/entry/item-type.d.ts +14 -0
- package/engine/object-data/entry/item-type.lua +91 -0
- package/engine/object-data/utility/object-data-entry-id-generator.lua +7 -0
- package/engine/object-field/ability.d.ts +26 -3
- package/engine/object-field/ability.lua +54 -1
- package/engine/object-field.d.ts +2 -2
- package/engine/object-field.lua +4 -0
- package/engine/standard/fields/ability.d.ts +2 -0
- package/engine/standard/fields/ability.lua +2 -0
- package/engine/unit.d.ts +2 -0
- package/engine/unit.lua +2 -0
- package/index.d.ts +1 -0
- package/index.lua +1 -0
- package/net/socket.d.ts +7 -1
- package/net/socket.lua +45 -4
- package/network.d.ts +1 -0
- package/network.lua +3 -2
- package/objutil/buff.lua +1 -1
- package/package.json +2 -2
- package/patch-lua.d.ts +0 -0
- package/patch-lua.lua +10 -0
- package/utility/arrays.d.ts +8 -1
- package/utility/arrays.lua +34 -3
- package/utility/lazy.d.ts +2 -0
- package/utility/lazy.lua +14 -0
- package/utility/linked-set.d.ts +11 -2
- package/utility/linked-set.lua +5 -2
- package/utility/types.d.ts +1 -0
package/engine/buff.lua
CHANGED
|
@@ -46,6 +46,10 @@ local ____arrays = require("utility.arrays")
|
|
|
46
46
|
local forEach = ____arrays.forEach
|
|
47
47
|
local ____ability_2Dduration = require("engine.internal.mechanics.ability-duration")
|
|
48
48
|
local getAbilityDuration = ____ability_2Dduration.getAbilityDuration
|
|
49
|
+
local ____item = require("engine.internal.item")
|
|
50
|
+
local Item = ____item.Item
|
|
51
|
+
local ____destructable = require("core.types.destructable")
|
|
52
|
+
local Destructable = ____destructable.Destructable
|
|
49
53
|
local getUnitAbility = BlzGetUnitAbility
|
|
50
54
|
local stringValueByBuffTypeIdByFieldId = postcompile(function()
|
|
51
55
|
local stringValueByBuffTypeIdByFieldId = {}
|
|
@@ -94,6 +98,7 @@ local buffParametersKeys = {
|
|
|
94
98
|
armorIncreaseFactor = true,
|
|
95
99
|
attackSpeedIncreaseFactor = true,
|
|
96
100
|
movementSpeedIncreaseFactor = true,
|
|
101
|
+
damageFactor = true,
|
|
97
102
|
receivedDamageFactor = true,
|
|
98
103
|
receivedMagicDamageFactor = true,
|
|
99
104
|
durationIncreaseOnAutoAttack = true,
|
|
@@ -107,12 +112,26 @@ local buffParametersKeys = {
|
|
|
107
112
|
disablesAutoAttack = true,
|
|
108
113
|
destroysOnDamage = true,
|
|
109
114
|
maximumAutoAttackCount = true,
|
|
115
|
+
maximumDamageDealtEventCount = true,
|
|
116
|
+
maximumDamageReceivedEventCount = true,
|
|
110
117
|
uniqueGroup = true,
|
|
111
118
|
damageOnExpiration = true,
|
|
112
119
|
healingOnExpiration = true,
|
|
113
120
|
killsOnExpiration = true,
|
|
114
121
|
explodesOnExpiration = true
|
|
115
122
|
}
|
|
123
|
+
local function resolveEnumValue(ability, level, value)
|
|
124
|
+
if value == nil or type(value) == "number" then
|
|
125
|
+
return value
|
|
126
|
+
end
|
|
127
|
+
if ability == nil then
|
|
128
|
+
error(
|
|
129
|
+
__TS__New(IllegalArgumentException),
|
|
130
|
+
0
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
return value:getValue(ability, level or ability.level)
|
|
134
|
+
end
|
|
116
135
|
local function resolveNumberValue(ability, level, value)
|
|
117
136
|
if value == nil or type(value) == "number" then
|
|
118
137
|
return value
|
|
@@ -162,8 +181,11 @@ local buffNumberParameters = {
|
|
|
162
181
|
"attackSpeedIncreaseFactor",
|
|
163
182
|
"movementSpeedIncreaseFactor",
|
|
164
183
|
"armorIncrease",
|
|
184
|
+
"damageFactor",
|
|
165
185
|
"receivedDamageFactor",
|
|
166
186
|
"maximumAutoAttackCount",
|
|
187
|
+
"maximumDamageDealtEventCount",
|
|
188
|
+
"maximumDamageReceivedEventCount",
|
|
167
189
|
"damageInterval",
|
|
168
190
|
"damagePerInterval",
|
|
169
191
|
"damageOverDuration",
|
|
@@ -310,8 +332,6 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
310
332
|
end
|
|
311
333
|
end
|
|
312
334
|
self.typeId = typeId
|
|
313
|
-
self.polarity = polarity
|
|
314
|
-
self.resistanceType = resistanceType
|
|
315
335
|
if not __TS__InstanceOf(ability, Ability) then
|
|
316
336
|
parameters = ability
|
|
317
337
|
ability = nil
|
|
@@ -338,6 +358,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
338
358
|
learnLevelMinimum = learnLevelMinimum or ability:getField(ABILITY_IF_REQUIRED_LEVEL)
|
|
339
359
|
duration = duration or getAbilityDuration(ability, _unit)
|
|
340
360
|
end
|
|
361
|
+
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
362
|
+
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
341
363
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
342
364
|
if buffByTypeId == nil then
|
|
343
365
|
buffByTypeId = {}
|
|
@@ -354,8 +376,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
354
376
|
if not internalApplyBuff(
|
|
355
377
|
_unit,
|
|
356
378
|
typeId,
|
|
357
|
-
polarity,
|
|
358
|
-
resistanceType,
|
|
379
|
+
self.polarity,
|
|
380
|
+
self.resistanceType,
|
|
359
381
|
level,
|
|
360
382
|
duration,
|
|
361
383
|
spellStealPriority,
|
|
@@ -464,6 +486,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
464
486
|
timer:start(duration, false, expireBuff, self)
|
|
465
487
|
self._timer = timer
|
|
466
488
|
end
|
|
489
|
+
self:onCreate()
|
|
467
490
|
end
|
|
468
491
|
function Buff.prototype.getUnitBonus(self, bonusType)
|
|
469
492
|
local ____opt_36 = self._bonusIdByBonusType
|
|
@@ -478,26 +501,30 @@ function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
|
|
|
478
501
|
end
|
|
479
502
|
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
480
503
|
end
|
|
481
|
-
function Buff.prototype.flashEffect(self,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
local ____Effect_flash_41 = Effect.flash
|
|
485
|
-
local ____array_39 = __TS__SparseArrayNew(
|
|
486
|
-
self[104],
|
|
487
|
-
isWidgetProvided and widgetOrDuration or self._unit,
|
|
488
|
-
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
489
|
-
)
|
|
490
|
-
local ____isWidgetProvided_38
|
|
491
|
-
if isWidgetProvided then
|
|
492
|
-
____isWidgetProvided_38 = duration
|
|
504
|
+
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
505
|
+
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
506
|
+
Effect:flash(self[104], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
493
507
|
else
|
|
494
|
-
|
|
508
|
+
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
509
|
+
local ____Effect_40 = Effect
|
|
510
|
+
local ____Effect_flash_41 = Effect.flash
|
|
511
|
+
local ____array_39 = __TS__SparseArrayNew(
|
|
512
|
+
self[104],
|
|
513
|
+
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
514
|
+
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
515
|
+
)
|
|
516
|
+
local ____isWidgetProvided_38
|
|
517
|
+
if isWidgetProvided then
|
|
518
|
+
____isWidgetProvided_38 = yOrParametersOrDuration
|
|
519
|
+
else
|
|
520
|
+
____isWidgetProvided_38 = widgetOrXOrParametersOrDuration
|
|
521
|
+
end
|
|
522
|
+
__TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
|
|
523
|
+
____Effect_flash_41(
|
|
524
|
+
____Effect_40,
|
|
525
|
+
__TS__SparseArraySpread(____array_39)
|
|
526
|
+
)
|
|
495
527
|
end
|
|
496
|
-
__TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
|
|
497
|
-
____Effect_flash_41(
|
|
498
|
-
____Effect_40,
|
|
499
|
-
__TS__SparseArraySpread(____array_39)
|
|
500
|
-
)
|
|
501
528
|
end
|
|
502
529
|
function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
503
530
|
local isWidgetProvided = type(widgetOrDuration) == "table"
|
|
@@ -520,6 +547,8 @@ function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
|
520
547
|
__TS__SparseArraySpread(____array_43)
|
|
521
548
|
)
|
|
522
549
|
end
|
|
550
|
+
function Buff.prototype.onCreate(self)
|
|
551
|
+
end
|
|
523
552
|
function Buff.prototype.onDestroy(self)
|
|
524
553
|
local unit = self._unit
|
|
525
554
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
@@ -544,11 +573,11 @@ function Buff.prototype.onDestroy(self)
|
|
|
544
573
|
behavior:destroy()
|
|
545
574
|
end
|
|
546
575
|
end
|
|
547
|
-
if self[
|
|
576
|
+
if self[136] then
|
|
548
577
|
unit:decrementDisableAutoAttackCounter()
|
|
549
578
|
end
|
|
550
|
-
if self[
|
|
551
|
-
if self[
|
|
579
|
+
if self[134] then
|
|
580
|
+
if self[135] then
|
|
552
581
|
unit:decrementStunCounter()
|
|
553
582
|
end
|
|
554
583
|
unit:decrementStunCounter()
|
|
@@ -605,9 +634,9 @@ function Buff.prototype.onExpiration(self)
|
|
|
605
634
|
if self[120] ~= nil then
|
|
606
635
|
(self[101] or unit):healTarget(unit, self[119] or 0)
|
|
607
636
|
end
|
|
608
|
-
if self[
|
|
637
|
+
if self[139] then
|
|
609
638
|
unit:explode()
|
|
610
|
-
elseif self[
|
|
639
|
+
elseif self[138] then
|
|
611
640
|
unit:kill()
|
|
612
641
|
end
|
|
613
642
|
end
|
|
@@ -652,6 +681,22 @@ function Buff.prototype.onDamageDealt(self, target, event)
|
|
|
652
681
|
self:destroy()
|
|
653
682
|
end
|
|
654
683
|
end
|
|
684
|
+
if event.originalAmount ~= 0 then
|
|
685
|
+
local damageDealtEventCount = (self[130] or 0) + 1
|
|
686
|
+
self[130] = damageDealtEventCount
|
|
687
|
+
if damageDealtEventCount == self[131] then
|
|
688
|
+
self:destroy()
|
|
689
|
+
end
|
|
690
|
+
end
|
|
691
|
+
end
|
|
692
|
+
function Buff.prototype.onDamageReceived(self, source, event)
|
|
693
|
+
if event.originalAmount ~= 0 then
|
|
694
|
+
local damageReceivedEventCount = (self[132] or 0) + 1
|
|
695
|
+
self[132] = damageReceivedEventCount
|
|
696
|
+
if damageReceivedEventCount == self[133] then
|
|
697
|
+
self:destroy()
|
|
698
|
+
end
|
|
699
|
+
end
|
|
655
700
|
end
|
|
656
701
|
Buff.defaultParameters = {}
|
|
657
702
|
__TS__SetDescriptor(
|
|
@@ -856,6 +901,19 @@ __TS__SetDescriptor(
|
|
|
856
901
|
},
|
|
857
902
|
true
|
|
858
903
|
)
|
|
904
|
+
__TS__SetDescriptor(
|
|
905
|
+
Buff.prototype,
|
|
906
|
+
"damageFactor",
|
|
907
|
+
{
|
|
908
|
+
get = function(self)
|
|
909
|
+
return self:getUnitBonus(UnitBonusType.DAMAGE_FACTOR)
|
|
910
|
+
end,
|
|
911
|
+
set = function(self, damageFactor)
|
|
912
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.DAMAGE_FACTOR, damageFactor)
|
|
913
|
+
end
|
|
914
|
+
},
|
|
915
|
+
true
|
|
916
|
+
)
|
|
859
917
|
__TS__SetDescriptor(
|
|
860
918
|
Buff.prototype,
|
|
861
919
|
"receivedDamageFactor",
|
|
@@ -887,25 +945,25 @@ __TS__SetDescriptor(
|
|
|
887
945
|
"stuns",
|
|
888
946
|
{
|
|
889
947
|
get = function(self)
|
|
890
|
-
local
|
|
891
|
-
if
|
|
892
|
-
|
|
948
|
+
local ____self__134_52 = self[134]
|
|
949
|
+
if ____self__134_52 == nil then
|
|
950
|
+
____self__134_52 = false
|
|
893
951
|
end
|
|
894
|
-
return
|
|
952
|
+
return ____self__134_52
|
|
895
953
|
end,
|
|
896
954
|
set = function(self, stuns)
|
|
897
|
-
if not stuns and self[
|
|
898
|
-
if self[
|
|
955
|
+
if not stuns and self[134] then
|
|
956
|
+
if self[135] then
|
|
899
957
|
self.object:decrementStunCounter()
|
|
900
958
|
end
|
|
901
959
|
self.object:decrementStunCounter()
|
|
902
|
-
self[
|
|
903
|
-
elseif stuns and not self[
|
|
904
|
-
if self[
|
|
960
|
+
self[134] = nil
|
|
961
|
+
elseif stuns and not self[134] then
|
|
962
|
+
if self[135] then
|
|
905
963
|
self.object:incrementStunCounter()
|
|
906
964
|
end
|
|
907
965
|
self.object:incrementStunCounter()
|
|
908
|
-
self[
|
|
966
|
+
self[134] = true
|
|
909
967
|
end
|
|
910
968
|
end
|
|
911
969
|
},
|
|
@@ -916,23 +974,23 @@ __TS__SetDescriptor(
|
|
|
916
974
|
"ignoresStunImmunity",
|
|
917
975
|
{
|
|
918
976
|
get = function(self)
|
|
919
|
-
local
|
|
920
|
-
if
|
|
921
|
-
|
|
977
|
+
local ____self__135_53 = self[135]
|
|
978
|
+
if ____self__135_53 == nil then
|
|
979
|
+
____self__135_53 = false
|
|
922
980
|
end
|
|
923
|
-
return
|
|
981
|
+
return ____self__135_53
|
|
924
982
|
end,
|
|
925
983
|
set = function(self, ignoresStunImmunity)
|
|
926
|
-
if not ignoresStunImmunity and self[
|
|
927
|
-
if self[
|
|
984
|
+
if not ignoresStunImmunity and self[135] then
|
|
985
|
+
if self[134] then
|
|
928
986
|
self.object:decrementStunCounter()
|
|
929
987
|
end
|
|
930
|
-
self[
|
|
931
|
-
elseif ignoresStunImmunity and not self[
|
|
932
|
-
if self[
|
|
988
|
+
self[135] = nil
|
|
989
|
+
elseif ignoresStunImmunity and not self[135] then
|
|
990
|
+
if self[134] then
|
|
933
991
|
self.object:incrementStunCounter()
|
|
934
992
|
end
|
|
935
|
-
self[
|
|
993
|
+
self[135] = true
|
|
936
994
|
end
|
|
937
995
|
end
|
|
938
996
|
},
|
|
@@ -943,19 +1001,19 @@ __TS__SetDescriptor(
|
|
|
943
1001
|
"disablesAutoAttack",
|
|
944
1002
|
{
|
|
945
1003
|
get = function(self)
|
|
946
|
-
local
|
|
947
|
-
if
|
|
948
|
-
|
|
1004
|
+
local ____self__136_54 = self[136]
|
|
1005
|
+
if ____self__136_54 == nil then
|
|
1006
|
+
____self__136_54 = false
|
|
949
1007
|
end
|
|
950
|
-
return
|
|
1008
|
+
return ____self__136_54
|
|
951
1009
|
end,
|
|
952
1010
|
set = function(self, disablesAutoAttack)
|
|
953
|
-
if not disablesAutoAttack and self[
|
|
1011
|
+
if not disablesAutoAttack and self[136] then
|
|
954
1012
|
self.object:decrementDisableAutoAttackCounter()
|
|
955
|
-
self[
|
|
956
|
-
elseif disablesAutoAttack and not self[
|
|
1013
|
+
self[136] = nil
|
|
1014
|
+
elseif disablesAutoAttack and not self[136] then
|
|
957
1015
|
self.object:incrementDisableAutoAttackCounter()
|
|
958
|
-
self[
|
|
1016
|
+
self[136] = true
|
|
959
1017
|
end
|
|
960
1018
|
end
|
|
961
1019
|
},
|
|
@@ -966,19 +1024,19 @@ __TS__SetDescriptor(
|
|
|
966
1024
|
"providesInvulnerability",
|
|
967
1025
|
{
|
|
968
1026
|
get = function(self)
|
|
969
|
-
local
|
|
970
|
-
if
|
|
971
|
-
|
|
1027
|
+
local ____self__137_55 = self[137]
|
|
1028
|
+
if ____self__137_55 == nil then
|
|
1029
|
+
____self__137_55 = false
|
|
972
1030
|
end
|
|
973
|
-
return
|
|
1031
|
+
return ____self__137_55
|
|
974
1032
|
end,
|
|
975
1033
|
set = function(self, providesInvulnerability)
|
|
976
|
-
if not providesInvulnerability and self[
|
|
1034
|
+
if not providesInvulnerability and self[137] then
|
|
977
1035
|
self.object:decrementInvulnerabilityCounter()
|
|
978
|
-
self[
|
|
979
|
-
elseif providesInvulnerability and not self[
|
|
1036
|
+
self[137] = nil
|
|
1037
|
+
elseif providesInvulnerability and not self[137] then
|
|
980
1038
|
self.object:incrementInvulnerabilityCounter()
|
|
981
|
-
self[
|
|
1039
|
+
self[137] = true
|
|
982
1040
|
end
|
|
983
1041
|
end
|
|
984
1042
|
},
|
|
@@ -989,17 +1047,17 @@ __TS__SetDescriptor(
|
|
|
989
1047
|
"killsOnExpiration",
|
|
990
1048
|
{
|
|
991
1049
|
get = function(self)
|
|
992
|
-
local
|
|
993
|
-
if
|
|
994
|
-
|
|
1050
|
+
local ____self__138_56 = self[138]
|
|
1051
|
+
if ____self__138_56 == nil then
|
|
1052
|
+
____self__138_56 = false
|
|
995
1053
|
end
|
|
996
|
-
return
|
|
1054
|
+
return ____self__138_56
|
|
997
1055
|
end,
|
|
998
1056
|
set = function(self, killsOnExpiration)
|
|
999
|
-
if not killsOnExpiration and self[
|
|
1000
|
-
self[
|
|
1001
|
-
elseif killsOnExpiration and not self[
|
|
1002
|
-
self[
|
|
1057
|
+
if not killsOnExpiration and self[138] then
|
|
1058
|
+
self[138] = nil
|
|
1059
|
+
elseif killsOnExpiration and not self[138] then
|
|
1060
|
+
self[138] = true
|
|
1003
1061
|
end
|
|
1004
1062
|
end
|
|
1005
1063
|
},
|
|
@@ -1010,17 +1068,51 @@ __TS__SetDescriptor(
|
|
|
1010
1068
|
"explodesOnExpiration",
|
|
1011
1069
|
{
|
|
1012
1070
|
get = function(self)
|
|
1013
|
-
local
|
|
1014
|
-
if
|
|
1015
|
-
|
|
1071
|
+
local ____self__139_57 = self[139]
|
|
1072
|
+
if ____self__139_57 == nil then
|
|
1073
|
+
____self__139_57 = false
|
|
1016
1074
|
end
|
|
1017
|
-
return
|
|
1075
|
+
return ____self__139_57
|
|
1018
1076
|
end,
|
|
1019
1077
|
set = function(self, killsOnExpiration)
|
|
1020
|
-
if not killsOnExpiration and self[
|
|
1021
|
-
self[
|
|
1022
|
-
elseif killsOnExpiration and not self[
|
|
1023
|
-
self[
|
|
1078
|
+
if not killsOnExpiration and self[139] then
|
|
1079
|
+
self[139] = nil
|
|
1080
|
+
elseif killsOnExpiration and not self[139] then
|
|
1081
|
+
self[139] = true
|
|
1082
|
+
end
|
|
1083
|
+
end
|
|
1084
|
+
},
|
|
1085
|
+
true
|
|
1086
|
+
)
|
|
1087
|
+
__TS__SetDescriptor(
|
|
1088
|
+
Buff.prototype,
|
|
1089
|
+
"maximumDamageDealtEventCount",
|
|
1090
|
+
{
|
|
1091
|
+
get = function(self)
|
|
1092
|
+
return self[131] or 0
|
|
1093
|
+
end,
|
|
1094
|
+
set = function(self, maximumDamageDealtEventCount)
|
|
1095
|
+
if maximumDamageDealtEventCount == 0 then
|
|
1096
|
+
self[131] = nil
|
|
1097
|
+
else
|
|
1098
|
+
self[131] = maximumDamageDealtEventCount
|
|
1099
|
+
end
|
|
1100
|
+
end
|
|
1101
|
+
},
|
|
1102
|
+
true
|
|
1103
|
+
)
|
|
1104
|
+
__TS__SetDescriptor(
|
|
1105
|
+
Buff.prototype,
|
|
1106
|
+
"maximumDamageReceivedEventCount",
|
|
1107
|
+
{
|
|
1108
|
+
get = function(self)
|
|
1109
|
+
return self[133] or 0
|
|
1110
|
+
end,
|
|
1111
|
+
set = function(self, maximumDamageReceivedEventCount)
|
|
1112
|
+
if maximumDamageReceivedEventCount == 0 then
|
|
1113
|
+
self[133] = nil
|
|
1114
|
+
else
|
|
1115
|
+
self[133] = maximumDamageReceivedEventCount
|
|
1024
1116
|
end
|
|
1025
1117
|
end
|
|
1026
1118
|
},
|
|
@@ -4,14 +4,6 @@ import { Event } from "../../event";
|
|
|
4
4
|
import type { Item } from "../../core/types/item";
|
|
5
5
|
import type { Unit } from "./unit";
|
|
6
6
|
import type { AbilityTypeId } from "../object-data/entry/ability-type";
|
|
7
|
-
interface Fields<K, V> {
|
|
8
|
-
set(field: K, value: V): boolean;
|
|
9
|
-
get(field: K): V;
|
|
10
|
-
has(field: K): boolean;
|
|
11
|
-
}
|
|
12
|
-
interface AbilityLevel {
|
|
13
|
-
realFields: Fields<jabilityreallevelfield, number>;
|
|
14
|
-
}
|
|
15
7
|
export type jabilityfield = jabilityintegerfield | jabilityrealfield | jabilitybooleanfield | jabilitystringfield | jabilityintegerlevelfield | jabilityreallevelfield | jabilitybooleanlevelfield | jabilitystringlevelfield;
|
|
16
8
|
export declare class AbilitySnapshot {
|
|
17
9
|
}
|
|
@@ -20,7 +12,8 @@ export declare abstract class Ability extends Handle<jability> {
|
|
|
20
12
|
protected constructor(handle: jability, typeId: number);
|
|
21
13
|
toString(): string;
|
|
22
14
|
get parentTypeId(): number;
|
|
23
|
-
get
|
|
15
|
+
get orderTypeStringId(): string;
|
|
16
|
+
get orderTypeId(): number;
|
|
24
17
|
abstract readonly owner: Unit | Item;
|
|
25
18
|
getSnapshot(): AbilitySnapshot;
|
|
26
19
|
hasField(field: jabilityfield | number): boolean;
|
|
@@ -40,9 +33,11 @@ export declare abstract class Ability extends Handle<jability> {
|
|
|
40
33
|
setField(field: jabilityintegerlevelfield | jabilityreallevelfield, level: number, value: number): boolean;
|
|
41
34
|
setField(field: jabilitybooleanlevelfield, level: number, value: boolean): boolean;
|
|
42
35
|
setField(field: jabilitystringlevelfield, level: number, value: string): boolean;
|
|
43
|
-
get
|
|
44
|
-
get levels(): readonly AbilityLevel[];
|
|
36
|
+
get levelCount(): number;
|
|
45
37
|
abstract get level(): number;
|
|
38
|
+
abstract get cooldownRemaining(): number;
|
|
39
|
+
abstract set cooldownRemaining(cooldownRemaining: number);
|
|
40
|
+
abstract interruptCast(): void;
|
|
46
41
|
static get onCreate(): Event<[Ability]>;
|
|
47
42
|
static get destroyEvent(): Event<[Ability]>;
|
|
48
43
|
}
|
|
@@ -53,15 +48,21 @@ export declare class UnrecognizedAbility extends Ability {
|
|
|
53
48
|
readonly owner: Unit;
|
|
54
49
|
constructor(typeId: number, owner: Unit);
|
|
55
50
|
get level(): number;
|
|
51
|
+
get cooldownRemaining(): number;
|
|
52
|
+
set cooldownRemaining(_: number);
|
|
53
|
+
interruptCast(): void;
|
|
56
54
|
}
|
|
57
55
|
export declare class UnitAbility extends Ability {
|
|
58
56
|
readonly owner: Unit;
|
|
59
57
|
private readonly u;
|
|
60
58
|
constructor(handle: jability, typeId: number, owner: Unit);
|
|
59
|
+
incrementHideCounter(): void;
|
|
60
|
+
decrementHideCounter(): void;
|
|
61
61
|
get level(): number;
|
|
62
62
|
set level(v: number);
|
|
63
63
|
get cooldownRemaining(): number;
|
|
64
|
-
set cooldownRemaining(
|
|
64
|
+
set cooldownRemaining(cooldownRemaining: number);
|
|
65
|
+
interruptCast(): void;
|
|
65
66
|
static get onCreate(): Event<[UnitAbility]>;
|
|
66
67
|
static get onDestroy(): Event<[UnitAbility]>;
|
|
67
68
|
}
|
|
@@ -85,7 +86,9 @@ export declare class ItemAbility extends Ability {
|
|
|
85
86
|
setField(field: jabilitybooleanlevelfield, level: number, value: boolean): boolean;
|
|
86
87
|
setField(field: jabilitystringlevelfield, level: number, value: string): boolean;
|
|
87
88
|
get level(): number;
|
|
89
|
+
get cooldownRemaining(): number;
|
|
90
|
+
set cooldownRemaining(cooldownRemaining: number);
|
|
91
|
+
interruptCast(): void;
|
|
88
92
|
static get onCreate(): Event<[ItemAbility]>;
|
|
89
93
|
static get onDestroy(): Event<[ItemAbility]>;
|
|
90
94
|
}
|
|
91
|
-
export {};
|