warscript 0.0.1-dev.5abc199 → 0.0.1-dev.5c35450
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 +47 -1
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- package/core/types/sound.lua +1 -1
- package/engine/behaviour/ability/damage.d.ts +3 -0
- package/engine/behaviour/ability/damage.lua +8 -2
- package/engine/behaviour/ability/emulate-impact.lua +5 -4
- package/engine/behaviour/ability.d.ts +5 -5
- package/engine/buff.d.ts +41 -13
- package/engine/buff.lua +222 -116
- package/engine/internal/ability.lua +25 -15
- package/engine/internal/item/fields.d.ts +12 -0
- package/engine/internal/item/fields.lua +33 -0
- package/engine/internal/item.d.ts +0 -4
- package/engine/internal/item.lua +0 -37
- package/engine/internal/object-data/attribute-bonus.lua +2 -2
- package/engine/internal/object-data/health-bonus.d.ts +2 -0
- package/engine/internal/object-data/health-bonus.lua +16 -0
- package/engine/internal/object-data/mana-bonus.d.ts +2 -0
- package/engine/internal/object-data/mana-bonus.lua +16 -0
- package/engine/internal/unit/bonus.d.ts +4 -0
- package/engine/internal/unit/bonus.lua +23 -3
- package/engine/internal/unit+bonus.lua +3 -3
- package/engine/local-client.d.ts +5 -0
- package/engine/local-client.lua +56 -1
- package/engine/object-data/auxiliary/unit-attribute.lua +1 -1
- package/engine/object-data/entry/ability-type/{armor-increase.d.ts → armor-bonus.d.ts} +3 -3
- package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
- package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type.lua +4 -0
- package/engine/object-data/entry/buff-type/applicable.lua +113 -109
- package/engine/object-field/ability.lua +2 -2
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field.d.ts +1 -1
- package/engine/object-field.lua +9 -7
- package/engine/standard/fields/item.d.ts +4 -0
- package/engine/standard/fields/item.lua +6 -0
- package/lualib_bundle.lua +1 -1
- package/math.d.ts +2 -0
- package/math.lua +14 -0
- package/objutil/object.lua +1 -1
- package/operation.lua +1 -4
- package/package.json +4 -4
- package/utility/linked-map.d.ts +2 -1
- package/utility/linked-map.lua +6 -0
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +6 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- /package/engine/internal/object-data/{armor-increase.d.ts → armor-bonus.d.ts} +0 -0
- /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
package/engine/buff.lua
CHANGED
|
@@ -103,7 +103,8 @@ local buffParametersKeys = {
|
|
|
103
103
|
damageIncrease = true,
|
|
104
104
|
damageIncreaseFactor = true,
|
|
105
105
|
armorIncrease = true,
|
|
106
|
-
|
|
106
|
+
maxHealthIncrease = true,
|
|
107
|
+
maxManaIncrease = true,
|
|
107
108
|
attackSpeedIncreaseFactor = true,
|
|
108
109
|
movementSpeedIncreaseFactor = true,
|
|
109
110
|
manaRegenerationRateIncreaseFactor = true,
|
|
@@ -126,6 +127,9 @@ local buffParametersKeys = {
|
|
|
126
127
|
maximumAutoAttackCount = true,
|
|
127
128
|
maximumDamageDealtEventCount = true,
|
|
128
129
|
maximumDamageReceivedEventCount = true,
|
|
130
|
+
absorbedDamageFactor = true,
|
|
131
|
+
maximumDamageAbsorbed = true,
|
|
132
|
+
destroysOnMaximumDamageAbsorbed = true,
|
|
129
133
|
uniqueGroup = true,
|
|
130
134
|
damageOnExpiration = true,
|
|
131
135
|
healingOnExpiration = true,
|
|
@@ -182,6 +186,7 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
182
186
|
end
|
|
183
187
|
end
|
|
184
188
|
local buffBooleanParameters = {
|
|
189
|
+
"destroysOnMaximumDamageAbsorbed",
|
|
185
190
|
"turnsIntoGhost",
|
|
186
191
|
"stuns",
|
|
187
192
|
"ignoresStunImmunity",
|
|
@@ -197,6 +202,8 @@ local buffNumberParameters = {
|
|
|
197
202
|
"manaRegenerationRateIncreaseFactor",
|
|
198
203
|
"evasionProbability",
|
|
199
204
|
"armorIncrease",
|
|
205
|
+
"maxHealthIncrease",
|
|
206
|
+
"maxManaIncrease",
|
|
200
207
|
"damageFactor",
|
|
201
208
|
"receivedDamageFactor",
|
|
202
209
|
"maximumAutoAttackCount",
|
|
@@ -210,6 +217,8 @@ local buffNumberParameters = {
|
|
|
210
217
|
"healingOverDuration",
|
|
211
218
|
"damageOnExpiration",
|
|
212
219
|
"healingOnExpiration",
|
|
220
|
+
"absorbedDamageFactor",
|
|
221
|
+
"maximumDamageAbsorbed",
|
|
213
222
|
"abilityCooldownFactor"
|
|
214
223
|
}
|
|
215
224
|
local unsuccessfulApplicationMarker = {}
|
|
@@ -388,14 +397,15 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
388
397
|
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
389
398
|
if missProbability ~= nil then
|
|
390
399
|
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
391
|
-
self[
|
|
400
|
+
self[146] = missProbability
|
|
392
401
|
end
|
|
393
402
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
394
403
|
if buffByTypeId == nil then
|
|
395
404
|
buffByTypeId = {}
|
|
396
405
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
397
406
|
end
|
|
398
|
-
|
|
407
|
+
self.previousBuff = buffByTypeId[typeId]
|
|
408
|
+
local ____opt_15 = self.previousBuff
|
|
399
409
|
if ____opt_15 ~= nil then
|
|
400
410
|
____opt_15:destroy()
|
|
401
411
|
end
|
|
@@ -525,7 +535,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
525
535
|
end
|
|
526
536
|
function Buff.prototype.onAbilityGained(self, ability)
|
|
527
537
|
if __TS__InstanceOf(ability, UnitAbility) then
|
|
528
|
-
local abilityCooldownModifier = self[
|
|
538
|
+
local abilityCooldownModifier = self[148]
|
|
529
539
|
if abilityCooldownModifier then
|
|
530
540
|
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, abilityCooldownModifier)
|
|
531
541
|
end
|
|
@@ -533,24 +543,38 @@ function Buff.prototype.onAbilityGained(self, ability)
|
|
|
533
543
|
end
|
|
534
544
|
function Buff.prototype.onAbilityLost(self, ability)
|
|
535
545
|
if __TS__InstanceOf(ability, UnitAbility) then
|
|
536
|
-
local abilityCooldownModifier = self[
|
|
546
|
+
local abilityCooldownModifier = self[148]
|
|
537
547
|
if abilityCooldownModifier then
|
|
538
548
|
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, abilityCooldownModifier)
|
|
539
549
|
end
|
|
540
550
|
end
|
|
541
551
|
end
|
|
542
552
|
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
553
|
+
self:flash(
|
|
554
|
+
self[105],
|
|
555
|
+
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin",
|
|
556
|
+
widgetOrXOrParametersOrDuration,
|
|
557
|
+
yOrParametersOrDuration,
|
|
558
|
+
parametersOrDuration
|
|
559
|
+
)
|
|
560
|
+
end
|
|
561
|
+
function Buff.prototype.flashSpecialEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
562
|
+
self:flash(
|
|
563
|
+
self[106],
|
|
564
|
+
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin",
|
|
565
|
+
widgetOrXOrParametersOrDuration,
|
|
566
|
+
yOrParametersOrDuration,
|
|
567
|
+
parametersOrDuration
|
|
568
|
+
)
|
|
569
|
+
end
|
|
570
|
+
function Buff.prototype.flash(self, modelPath, attachmentPoint, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
543
571
|
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
544
|
-
Effect:flash(
|
|
572
|
+
Effect:flash(modelPath, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
545
573
|
else
|
|
546
574
|
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
547
575
|
local ____Effect_40 = Effect
|
|
548
576
|
local ____Effect_flash_41 = Effect.flash
|
|
549
|
-
local ____array_39 = __TS__SparseArrayNew(
|
|
550
|
-
self[105],
|
|
551
|
-
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
552
|
-
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
553
|
-
)
|
|
577
|
+
local ____array_39 = __TS__SparseArrayNew(modelPath, isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit, attachmentPoint)
|
|
554
578
|
local ____isWidgetProvided_38
|
|
555
579
|
if isWidgetProvided then
|
|
556
580
|
____isWidgetProvided_38 = yOrParametersOrDuration
|
|
@@ -564,27 +588,6 @@ function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrPa
|
|
|
564
588
|
)
|
|
565
589
|
end
|
|
566
590
|
end
|
|
567
|
-
function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
568
|
-
local isWidgetProvided = type(widgetOrDuration) == "table"
|
|
569
|
-
local ____Effect_44 = Effect
|
|
570
|
-
local ____Effect_flash_45 = Effect.flash
|
|
571
|
-
local ____array_43 = __TS__SparseArrayNew(
|
|
572
|
-
self[106],
|
|
573
|
-
isWidgetProvided and widgetOrDuration or self._unit,
|
|
574
|
-
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
|
|
575
|
-
)
|
|
576
|
-
local ____isWidgetProvided_42
|
|
577
|
-
if isWidgetProvided then
|
|
578
|
-
____isWidgetProvided_42 = duration
|
|
579
|
-
else
|
|
580
|
-
____isWidgetProvided_42 = widgetOrDuration
|
|
581
|
-
end
|
|
582
|
-
__TS__SparseArrayPush(____array_43, ____isWidgetProvided_42)
|
|
583
|
-
____Effect_flash_45(
|
|
584
|
-
____Effect_44,
|
|
585
|
-
__TS__SparseArraySpread(____array_43)
|
|
586
|
-
)
|
|
587
|
-
end
|
|
588
591
|
function Buff.prototype.expire(self)
|
|
589
592
|
expireBuff(self)
|
|
590
593
|
end
|
|
@@ -616,25 +619,25 @@ function Buff.prototype.onDestroy(self)
|
|
|
616
619
|
behavior:destroy()
|
|
617
620
|
end
|
|
618
621
|
end
|
|
619
|
-
local previousAbilityCooldownModifier = self[
|
|
622
|
+
local previousAbilityCooldownModifier = self[148]
|
|
620
623
|
if previousAbilityCooldownModifier then
|
|
621
624
|
for ____, ability in ipairs(self._unit.abilities) do
|
|
622
625
|
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
623
626
|
end
|
|
624
627
|
end
|
|
625
|
-
if self[
|
|
628
|
+
if self[143] then
|
|
626
629
|
unit:decrementInvulnerabilityCounter()
|
|
627
630
|
end
|
|
628
|
-
if self[
|
|
631
|
+
if self[142] then
|
|
629
632
|
unit:decrementDisableAutoAttackCounter()
|
|
630
633
|
end
|
|
631
|
-
if self[
|
|
632
|
-
if self[
|
|
634
|
+
if self[140] then
|
|
635
|
+
if self[141] then
|
|
633
636
|
unit:decrementForceStunCounter()
|
|
634
637
|
end
|
|
635
638
|
unit:decrementStunCounter()
|
|
636
639
|
end
|
|
637
|
-
if self[
|
|
640
|
+
if self[139] then
|
|
638
641
|
unit:decrementGhostCounter()
|
|
639
642
|
end
|
|
640
643
|
if self._abilityTypeIds ~= nil then
|
|
@@ -671,8 +674,8 @@ function Buff.apply(self, ...)
|
|
|
671
674
|
end
|
|
672
675
|
end
|
|
673
676
|
function Buff.getByTypeId(self, unit, typeId)
|
|
674
|
-
local
|
|
675
|
-
local buff =
|
|
677
|
+
local ____opt_42 = buffByTypeIdByUnit[unit]
|
|
678
|
+
local buff = ____opt_42 and ____opt_42[typeId]
|
|
676
679
|
if __TS__InstanceOf(buff, self) then
|
|
677
680
|
return buff
|
|
678
681
|
end
|
|
@@ -686,9 +689,9 @@ function Buff.prototype.onExpiration(self)
|
|
|
686
689
|
if self[121] ~= nil then
|
|
687
690
|
(self[102] or unit):healTarget(unit, self[120] or 0)
|
|
688
691
|
end
|
|
689
|
-
if self[
|
|
692
|
+
if self[145] then
|
|
690
693
|
unit:explode()
|
|
691
|
-
elseif self[
|
|
694
|
+
elseif self[144] then
|
|
692
695
|
unit:kill()
|
|
693
696
|
end
|
|
694
697
|
end
|
|
@@ -743,6 +746,18 @@ function Buff.prototype.onDamageDealt(self, target, event)
|
|
|
743
746
|
end
|
|
744
747
|
function Buff.prototype.onDamageReceived(self, source, event)
|
|
745
748
|
if event.originalAmount ~= 0 then
|
|
749
|
+
local absorbedDamage = min(event.amount * (self[135] or 1), (self[136] or 0) - (self[137] or 0))
|
|
750
|
+
if absorbedDamage > 0 then
|
|
751
|
+
event.amount = event.amount - absorbedDamage
|
|
752
|
+
self[137] = (self[137] or 0) + absorbedDamage
|
|
753
|
+
local ____self__138_44 = self[138]
|
|
754
|
+
if ____self__138_44 == nil then
|
|
755
|
+
____self__138_44 = true
|
|
756
|
+
end
|
|
757
|
+
if ____self__138_44 and self[137] >= (self[136] or 0) then
|
|
758
|
+
self:destroy()
|
|
759
|
+
end
|
|
760
|
+
end
|
|
746
761
|
local damageReceivedEventCount = (self[133] or 0) + 1
|
|
747
762
|
self[133] = damageReceivedEventCount
|
|
748
763
|
if damageReceivedEventCount == self[134] then
|
|
@@ -830,8 +845,8 @@ __TS__SetDescriptor(
|
|
|
830
845
|
return
|
|
831
846
|
end
|
|
832
847
|
self[112] = damageInterval
|
|
833
|
-
local
|
|
834
|
-
local elapsed =
|
|
848
|
+
local ____opt_45 = self._timer
|
|
849
|
+
local elapsed = ____opt_45 and ____opt_45.elapsed or 0
|
|
835
850
|
local timer = self[114]
|
|
836
851
|
if timer == nil then
|
|
837
852
|
timer = Timer:create()
|
|
@@ -910,8 +925,8 @@ __TS__SetDescriptor(
|
|
|
910
925
|
return
|
|
911
926
|
end
|
|
912
927
|
self[117] = healingInterval
|
|
913
|
-
local
|
|
914
|
-
local elapsed =
|
|
928
|
+
local ____opt_47 = self._timer
|
|
929
|
+
local elapsed = ____opt_47 and ____opt_47.elapsed or 0
|
|
915
930
|
local timer = self[119]
|
|
916
931
|
if timer == nil then
|
|
917
932
|
timer = Timer:create()
|
|
@@ -992,24 +1007,50 @@ __TS__SetDescriptor(
|
|
|
992
1007
|
},
|
|
993
1008
|
true
|
|
994
1009
|
)
|
|
1010
|
+
__TS__SetDescriptor(
|
|
1011
|
+
Buff.prototype,
|
|
1012
|
+
"maxHealthIncrease",
|
|
1013
|
+
{
|
|
1014
|
+
get = function(self)
|
|
1015
|
+
return self:getUnitBonus(UnitBonusType.HEALTH)
|
|
1016
|
+
end,
|
|
1017
|
+
set = function(self, maxHealthIncrease)
|
|
1018
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.HEALTH, maxHealthIncrease)
|
|
1019
|
+
end
|
|
1020
|
+
},
|
|
1021
|
+
true
|
|
1022
|
+
)
|
|
1023
|
+
__TS__SetDescriptor(
|
|
1024
|
+
Buff.prototype,
|
|
1025
|
+
"maxManaIncrease",
|
|
1026
|
+
{
|
|
1027
|
+
get = function(self)
|
|
1028
|
+
return self:getUnitBonus(UnitBonusType.MANA)
|
|
1029
|
+
end,
|
|
1030
|
+
set = function(self, maxManaIncrease)
|
|
1031
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.MANA, maxManaIncrease)
|
|
1032
|
+
end
|
|
1033
|
+
},
|
|
1034
|
+
true
|
|
1035
|
+
)
|
|
995
1036
|
__TS__SetDescriptor(
|
|
996
1037
|
Buff.prototype,
|
|
997
1038
|
"turnsIntoGhost",
|
|
998
1039
|
{
|
|
999
1040
|
get = function(self)
|
|
1000
|
-
local
|
|
1001
|
-
if
|
|
1002
|
-
|
|
1041
|
+
local ____self__139_49 = self[139]
|
|
1042
|
+
if ____self__139_49 == nil then
|
|
1043
|
+
____self__139_49 = false
|
|
1003
1044
|
end
|
|
1004
|
-
return
|
|
1045
|
+
return ____self__139_49
|
|
1005
1046
|
end,
|
|
1006
1047
|
set = function(self, turnsIntoGhost)
|
|
1007
|
-
if not turnsIntoGhost and self[
|
|
1048
|
+
if not turnsIntoGhost and self[139] then
|
|
1008
1049
|
self.object:decrementGhostCounter()
|
|
1009
|
-
self[
|
|
1010
|
-
elseif turnsIntoGhost and not self[
|
|
1050
|
+
self[139] = nil
|
|
1051
|
+
elseif turnsIntoGhost and not self[139] then
|
|
1011
1052
|
self.object:incrementGhostCounter()
|
|
1012
|
-
self[
|
|
1053
|
+
self[139] = true
|
|
1013
1054
|
end
|
|
1014
1055
|
end
|
|
1015
1056
|
},
|
|
@@ -1020,25 +1061,25 @@ __TS__SetDescriptor(
|
|
|
1020
1061
|
"stuns",
|
|
1021
1062
|
{
|
|
1022
1063
|
get = function(self)
|
|
1023
|
-
local
|
|
1024
|
-
if
|
|
1025
|
-
|
|
1064
|
+
local ____self__140_50 = self[140]
|
|
1065
|
+
if ____self__140_50 == nil then
|
|
1066
|
+
____self__140_50 = false
|
|
1026
1067
|
end
|
|
1027
|
-
return
|
|
1068
|
+
return ____self__140_50
|
|
1028
1069
|
end,
|
|
1029
1070
|
set = function(self, stuns)
|
|
1030
|
-
if not stuns and self[
|
|
1031
|
-
if self[
|
|
1071
|
+
if not stuns and self[140] then
|
|
1072
|
+
if self[141] then
|
|
1032
1073
|
self.object:decrementForceStunCounter()
|
|
1033
1074
|
end
|
|
1034
1075
|
self.object:decrementStunCounter()
|
|
1035
|
-
self[
|
|
1036
|
-
elseif stuns and not self[
|
|
1037
|
-
if self[
|
|
1076
|
+
self[140] = nil
|
|
1077
|
+
elseif stuns and not self[140] then
|
|
1078
|
+
if self[141] then
|
|
1038
1079
|
self.object:incrementForceStunCounter()
|
|
1039
1080
|
end
|
|
1040
1081
|
self.object:incrementStunCounter()
|
|
1041
|
-
self[
|
|
1082
|
+
self[140] = true
|
|
1042
1083
|
end
|
|
1043
1084
|
end
|
|
1044
1085
|
},
|
|
@@ -1049,23 +1090,23 @@ __TS__SetDescriptor(
|
|
|
1049
1090
|
"ignoresStunImmunity",
|
|
1050
1091
|
{
|
|
1051
1092
|
get = function(self)
|
|
1052
|
-
local
|
|
1053
|
-
if
|
|
1054
|
-
|
|
1093
|
+
local ____self__141_51 = self[141]
|
|
1094
|
+
if ____self__141_51 == nil then
|
|
1095
|
+
____self__141_51 = false
|
|
1055
1096
|
end
|
|
1056
|
-
return
|
|
1097
|
+
return ____self__141_51
|
|
1057
1098
|
end,
|
|
1058
1099
|
set = function(self, ignoresStunImmunity)
|
|
1059
|
-
if not ignoresStunImmunity and self[
|
|
1060
|
-
if self[
|
|
1100
|
+
if not ignoresStunImmunity and self[141] then
|
|
1101
|
+
if self[140] then
|
|
1061
1102
|
self.object:decrementForceStunCounter()
|
|
1062
1103
|
end
|
|
1063
|
-
self[
|
|
1064
|
-
elseif ignoresStunImmunity and not self[
|
|
1065
|
-
if self[
|
|
1104
|
+
self[141] = nil
|
|
1105
|
+
elseif ignoresStunImmunity and not self[141] then
|
|
1106
|
+
if self[140] then
|
|
1066
1107
|
self.object:incrementForceStunCounter()
|
|
1067
1108
|
end
|
|
1068
|
-
self[
|
|
1109
|
+
self[141] = true
|
|
1069
1110
|
end
|
|
1070
1111
|
end
|
|
1071
1112
|
},
|
|
@@ -1076,19 +1117,19 @@ __TS__SetDescriptor(
|
|
|
1076
1117
|
"disablesAutoAttack",
|
|
1077
1118
|
{
|
|
1078
1119
|
get = function(self)
|
|
1079
|
-
local
|
|
1080
|
-
if
|
|
1081
|
-
|
|
1120
|
+
local ____self__142_52 = self[142]
|
|
1121
|
+
if ____self__142_52 == nil then
|
|
1122
|
+
____self__142_52 = false
|
|
1082
1123
|
end
|
|
1083
|
-
return
|
|
1124
|
+
return ____self__142_52
|
|
1084
1125
|
end,
|
|
1085
1126
|
set = function(self, disablesAutoAttack)
|
|
1086
|
-
if not disablesAutoAttack and self[
|
|
1127
|
+
if not disablesAutoAttack and self[142] then
|
|
1087
1128
|
self.object:decrementDisableAutoAttackCounter()
|
|
1088
|
-
self[
|
|
1089
|
-
elseif disablesAutoAttack and not self[
|
|
1129
|
+
self[142] = nil
|
|
1130
|
+
elseif disablesAutoAttack and not self[142] then
|
|
1090
1131
|
self.object:incrementDisableAutoAttackCounter()
|
|
1091
|
-
self[
|
|
1132
|
+
self[142] = true
|
|
1092
1133
|
end
|
|
1093
1134
|
end
|
|
1094
1135
|
},
|
|
@@ -1099,19 +1140,19 @@ __TS__SetDescriptor(
|
|
|
1099
1140
|
"providesInvulnerability",
|
|
1100
1141
|
{
|
|
1101
1142
|
get = function(self)
|
|
1102
|
-
local
|
|
1103
|
-
if
|
|
1104
|
-
|
|
1143
|
+
local ____self__143_53 = self[143]
|
|
1144
|
+
if ____self__143_53 == nil then
|
|
1145
|
+
____self__143_53 = false
|
|
1105
1146
|
end
|
|
1106
|
-
return
|
|
1147
|
+
return ____self__143_53
|
|
1107
1148
|
end,
|
|
1108
1149
|
set = function(self, providesInvulnerability)
|
|
1109
|
-
if not providesInvulnerability and self[
|
|
1150
|
+
if not providesInvulnerability and self[143] then
|
|
1110
1151
|
self.object:decrementInvulnerabilityCounter()
|
|
1111
|
-
self[
|
|
1112
|
-
elseif providesInvulnerability and not self[
|
|
1152
|
+
self[143] = nil
|
|
1153
|
+
elseif providesInvulnerability and not self[143] then
|
|
1113
1154
|
self.object:incrementInvulnerabilityCounter()
|
|
1114
|
-
self[
|
|
1155
|
+
self[143] = true
|
|
1115
1156
|
end
|
|
1116
1157
|
end
|
|
1117
1158
|
},
|
|
@@ -1122,17 +1163,17 @@ __TS__SetDescriptor(
|
|
|
1122
1163
|
"killsOnExpiration",
|
|
1123
1164
|
{
|
|
1124
1165
|
get = function(self)
|
|
1125
|
-
local
|
|
1126
|
-
if
|
|
1127
|
-
|
|
1166
|
+
local ____self__144_54 = self[144]
|
|
1167
|
+
if ____self__144_54 == nil then
|
|
1168
|
+
____self__144_54 = false
|
|
1128
1169
|
end
|
|
1129
|
-
return
|
|
1170
|
+
return ____self__144_54
|
|
1130
1171
|
end,
|
|
1131
1172
|
set = function(self, killsOnExpiration)
|
|
1132
|
-
if not killsOnExpiration and self[
|
|
1133
|
-
self[
|
|
1134
|
-
elseif killsOnExpiration and not self[
|
|
1135
|
-
self[
|
|
1173
|
+
if not killsOnExpiration and self[144] then
|
|
1174
|
+
self[144] = nil
|
|
1175
|
+
elseif killsOnExpiration and not self[144] then
|
|
1176
|
+
self[144] = true
|
|
1136
1177
|
end
|
|
1137
1178
|
end
|
|
1138
1179
|
},
|
|
@@ -1143,17 +1184,17 @@ __TS__SetDescriptor(
|
|
|
1143
1184
|
"explodesOnExpiration",
|
|
1144
1185
|
{
|
|
1145
1186
|
get = function(self)
|
|
1146
|
-
local
|
|
1147
|
-
if
|
|
1148
|
-
|
|
1187
|
+
local ____self__145_55 = self[145]
|
|
1188
|
+
if ____self__145_55 == nil then
|
|
1189
|
+
____self__145_55 = false
|
|
1149
1190
|
end
|
|
1150
|
-
return
|
|
1191
|
+
return ____self__145_55
|
|
1151
1192
|
end,
|
|
1152
1193
|
set = function(self, killsOnExpiration)
|
|
1153
|
-
if not killsOnExpiration and self[
|
|
1154
|
-
self[
|
|
1155
|
-
elseif killsOnExpiration and not self[
|
|
1156
|
-
self[
|
|
1194
|
+
if not killsOnExpiration and self[145] then
|
|
1195
|
+
self[145] = nil
|
|
1196
|
+
elseif killsOnExpiration and not self[145] then
|
|
1197
|
+
self[145] = true
|
|
1157
1198
|
end
|
|
1158
1199
|
end
|
|
1159
1200
|
},
|
|
@@ -1302,13 +1343,13 @@ __TS__SetDescriptor(
|
|
|
1302
1343
|
"remainingDuration",
|
|
1303
1344
|
{
|
|
1304
1345
|
get = function(self)
|
|
1305
|
-
local
|
|
1306
|
-
return
|
|
1346
|
+
local ____opt_56 = self._timer
|
|
1347
|
+
return ____opt_56 and ____opt_56.remaining or 0
|
|
1307
1348
|
end,
|
|
1308
1349
|
set = function(self, remainingDuration)
|
|
1309
|
-
local
|
|
1310
|
-
local
|
|
1311
|
-
local remainingDurationDelta =
|
|
1350
|
+
local ____remainingDuration_60 = remainingDuration
|
|
1351
|
+
local ____opt_58 = self._timer
|
|
1352
|
+
local remainingDurationDelta = ____remainingDuration_60 - (____opt_58 and ____opt_58.remaining or 0)
|
|
1312
1353
|
if remainingDurationDelta ~= 0 then
|
|
1313
1354
|
self[103] = self[103] + remainingDurationDelta
|
|
1314
1355
|
if remainingDuration <= 0 then
|
|
@@ -1323,7 +1364,7 @@ __TS__SetDescriptor(
|
|
|
1323
1364
|
remainingDuration,
|
|
1324
1365
|
self._spellStealPriority,
|
|
1325
1366
|
self._learnLevelMinimum,
|
|
1326
|
-
self[
|
|
1367
|
+
self[146]
|
|
1327
1368
|
) then
|
|
1328
1369
|
local timer = self._timer
|
|
1329
1370
|
if timer == nil then
|
|
@@ -1338,15 +1379,80 @@ __TS__SetDescriptor(
|
|
|
1338
1379
|
},
|
|
1339
1380
|
true
|
|
1340
1381
|
)
|
|
1382
|
+
__TS__SetDescriptor(
|
|
1383
|
+
Buff.prototype,
|
|
1384
|
+
"absorbedDamageFactor",
|
|
1385
|
+
{
|
|
1386
|
+
get = function(self)
|
|
1387
|
+
return self[135] or 1
|
|
1388
|
+
end,
|
|
1389
|
+
set = function(self, absorbedDamageFactor)
|
|
1390
|
+
if absorbedDamageFactor == 1 then
|
|
1391
|
+
self[135] = nil
|
|
1392
|
+
else
|
|
1393
|
+
self[135] = absorbedDamageFactor
|
|
1394
|
+
end
|
|
1395
|
+
end
|
|
1396
|
+
},
|
|
1397
|
+
true
|
|
1398
|
+
)
|
|
1399
|
+
__TS__SetDescriptor(
|
|
1400
|
+
Buff.prototype,
|
|
1401
|
+
"maximumDamageAbsorbed",
|
|
1402
|
+
{
|
|
1403
|
+
get = function(self)
|
|
1404
|
+
return self[136] or 0
|
|
1405
|
+
end,
|
|
1406
|
+
set = function(self, maximumDamageAbsorbed)
|
|
1407
|
+
if maximumDamageAbsorbed == 0 then
|
|
1408
|
+
self[136] = nil
|
|
1409
|
+
else
|
|
1410
|
+
self[136] = maximumDamageAbsorbed
|
|
1411
|
+
end
|
|
1412
|
+
end
|
|
1413
|
+
},
|
|
1414
|
+
true
|
|
1415
|
+
)
|
|
1416
|
+
__TS__SetDescriptor(
|
|
1417
|
+
Buff.prototype,
|
|
1418
|
+
"damageAbsorbed",
|
|
1419
|
+
{get = function(self)
|
|
1420
|
+
return self[137] or 0
|
|
1421
|
+
end},
|
|
1422
|
+
true
|
|
1423
|
+
)
|
|
1424
|
+
__TS__SetDescriptor(
|
|
1425
|
+
Buff.prototype,
|
|
1426
|
+
"destroysOnMaximumDamageAbsorbed",
|
|
1427
|
+
{
|
|
1428
|
+
get = function(self)
|
|
1429
|
+
local ____self__138_61 = self[138]
|
|
1430
|
+
if ____self__138_61 == nil then
|
|
1431
|
+
____self__138_61 = true
|
|
1432
|
+
end
|
|
1433
|
+
return ____self__138_61
|
|
1434
|
+
end,
|
|
1435
|
+
set = function(self, destroysOnMaximumDamageAbsorbed)
|
|
1436
|
+
local ____destroysOnMaximumDamageAbsorbed_62
|
|
1437
|
+
if destroysOnMaximumDamageAbsorbed then
|
|
1438
|
+
____destroysOnMaximumDamageAbsorbed_62 = nil
|
|
1439
|
+
else
|
|
1440
|
+
____destroysOnMaximumDamageAbsorbed_62 = false
|
|
1441
|
+
end
|
|
1442
|
+
self[138] = ____destroysOnMaximumDamageAbsorbed_62
|
|
1443
|
+
end
|
|
1444
|
+
},
|
|
1445
|
+
true
|
|
1446
|
+
)
|
|
1341
1447
|
__TS__SetDescriptor(
|
|
1342
1448
|
Buff.prototype,
|
|
1343
1449
|
"abilityCooldownFactor",
|
|
1344
1450
|
{
|
|
1345
1451
|
get = function(self)
|
|
1346
|
-
return self[
|
|
1452
|
+
return self[147] or 1
|
|
1347
1453
|
end,
|
|
1348
1454
|
set = function(self, abilityCooldownFactor)
|
|
1349
|
-
local previousAbilityCooldownModifier = self[
|
|
1455
|
+
local previousAbilityCooldownModifier = self[148]
|
|
1350
1456
|
if previousAbilityCooldownModifier then
|
|
1351
1457
|
for ____, ability in ipairs(self._unit.abilities) do
|
|
1352
1458
|
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
@@ -1358,8 +1464,8 @@ __TS__SetDescriptor(
|
|
|
1358
1464
|
for ____, ability in ipairs(self._unit.abilities) do
|
|
1359
1465
|
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, modifier)
|
|
1360
1466
|
end
|
|
1361
|
-
self[
|
|
1362
|
-
self[
|
|
1467
|
+
self[148] = modifier
|
|
1468
|
+
self[147] = abilityCooldownFactor
|
|
1363
1469
|
end
|
|
1364
1470
|
},
|
|
1365
1471
|
true
|
|
@@ -14,6 +14,8 @@ local abilityActionDummy = ____ability.abilityActionDummy
|
|
|
14
14
|
local doAbilityAction = ____ability.doAbilityAction
|
|
15
15
|
local doAbilityActionForceDummy = ____ability.doAbilityActionForceDummy
|
|
16
16
|
local startItemCooldown = ____ability.startItemCooldown
|
|
17
|
+
local ____timer = require("core.types.timer")
|
|
18
|
+
local Timer = ____timer.Timer
|
|
17
19
|
local getUnitAbilityLevel = GetUnitAbilityLevel
|
|
18
20
|
local setUnitAbilityLevel = SetUnitAbilityLevel
|
|
19
21
|
local setAbilityIntegerField = BlzSetAbilityIntegerField
|
|
@@ -35,8 +37,6 @@ local getAbilityStringLevelField = BlzGetAbilityStringLevelField
|
|
|
35
37
|
local getUnitAbilityCooldownRemaining = BlzGetUnitAbilityCooldownRemaining
|
|
36
38
|
local startUnitAbilityCooldown = BlzStartUnitAbilityCooldown
|
|
37
39
|
local getHandleId = GetHandleId
|
|
38
|
-
local getItemBooleanField = BlzGetItemBooleanField
|
|
39
|
-
local setItemBooleanField = BlzSetItemBooleanField
|
|
40
40
|
local unitHideAbility = BlzUnitHideAbility
|
|
41
41
|
local unitDisableAbility = BlzUnitDisableAbility
|
|
42
42
|
local match = string.match
|
|
@@ -516,11 +516,21 @@ function ItemAbility.prototype.setField(self, field, levelOrValue, value)
|
|
|
516
516
|
)
|
|
517
517
|
end
|
|
518
518
|
function ItemAbility.prototype.interruptCast(self)
|
|
519
|
-
local
|
|
520
|
-
local
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
519
|
+
local item = self.owner
|
|
520
|
+
local itemHandle = item.handle
|
|
521
|
+
local ____opt_1 = item.owner
|
|
522
|
+
local itemOwnerHandle = ____opt_1 and ____opt_1.handle
|
|
523
|
+
local cooldownRemaining = doAbilityActionForceDummy(itemHandle, itemOwnerHandle, getAbilityCooldown, self.typeId)
|
|
524
|
+
if cooldownRemaining == 0 then
|
|
525
|
+
local cooldown = doAbilityAction(
|
|
526
|
+
itemHandle,
|
|
527
|
+
getAbilityField,
|
|
528
|
+
self,
|
|
529
|
+
ABILITY_RLF_COOLDOWN,
|
|
530
|
+
0
|
|
531
|
+
)
|
|
532
|
+
startItemCooldown(itemHandle, itemOwnerHandle, 1)
|
|
533
|
+
Timer:run(startItemCooldown, itemHandle, itemOwnerHandle, cooldown)
|
|
524
534
|
end
|
|
525
535
|
end
|
|
526
536
|
function ItemAbility.prototype.onDestroy(self)
|
|
@@ -543,17 +553,17 @@ __TS__SetDescriptor(
|
|
|
543
553
|
{
|
|
544
554
|
get = function(self)
|
|
545
555
|
local item = self.owner
|
|
546
|
-
local
|
|
547
|
-
local
|
|
548
|
-
local
|
|
549
|
-
return
|
|
556
|
+
local ____doAbilityActionForceDummy_6 = doAbilityActionForceDummy
|
|
557
|
+
local ____item_handle_5 = item.handle
|
|
558
|
+
local ____opt_3 = item.owner
|
|
559
|
+
return ____doAbilityActionForceDummy_6(____item_handle_5, ____opt_3 and ____opt_3.handle, getAbilityCooldown, self.typeId)
|
|
550
560
|
end,
|
|
551
561
|
set = function(self, cooldownRemaining)
|
|
552
562
|
local item = self.owner
|
|
553
|
-
local
|
|
554
|
-
local
|
|
555
|
-
local
|
|
556
|
-
|
|
563
|
+
local ____startItemCooldown_10 = startItemCooldown
|
|
564
|
+
local ____item_handle_9 = item.handle
|
|
565
|
+
local ____opt_7 = item.owner
|
|
566
|
+
____startItemCooldown_10(____item_handle_9, ____opt_7 and ____opt_7.handle, cooldownRemaining)
|
|
557
567
|
end
|
|
558
568
|
},
|
|
559
569
|
true
|