warscript 0.0.1-dev.2ae9956 → 0.0.1-dev.2b9d42c
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 +6 -0
- package/attributes.lua +17 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/types/effect.d.ts +1 -3
- package/core/types/effect.lua +26 -29
- package/core/types/frame.lua +24 -21
- package/core/types/player.d.ts +16 -0
- package/core/types/player.lua +60 -15
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/sound.d.ts +17 -24
- package/core/types/sound.lua +99 -24
- package/core/types/tileCell.d.ts +11 -1
- package/core/types/tileCell.lua +97 -0
- package/core/types/timer.d.ts +9 -8
- package/core/types/timer.lua +45 -23
- package/core/util.lua +6 -1
- package/decl/native.d.ts +846 -790
- package/engine/behavior.d.ts +12 -1
- package/engine/behavior.lua +172 -70
- package/engine/behaviour/ability/apply-buff.lua +5 -5
- package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
- package/engine/behaviour/ability/damage.d.ts +9 -3
- package/engine/behaviour/ability/damage.lua +26 -38
- package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
- package/engine/behaviour/ability/emulate-impact.lua +18 -3
- package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
- package/engine/behaviour/ability/remove-buffs.lua +21 -0
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.d.ts +7 -2
- package/engine/behaviour/ability.lua +28 -22
- package/engine/behaviour/unit/stun-immunity.d.ts +11 -5
- package/engine/behaviour/unit/stun-immunity.lua +53 -28
- package/engine/behaviour/unit.d.ts +40 -2
- package/engine/behaviour/unit.lua +259 -6
- package/engine/buff.d.ts +63 -45
- package/engine/buff.lua +329 -234
- package/engine/internal/ability.d.ts +7 -1
- package/engine/internal/ability.lua +49 -9
- package/engine/internal/item/ability.lua +63 -11
- package/engine/internal/item+owner.lua +12 -6
- package/engine/internal/item.d.ts +18 -17
- package/engine/internal/item.lua +137 -51
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- 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.d.ts +35 -0
- package/engine/internal/unit/ability.lua +98 -9
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/main-selected.lua +12 -27
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -0
- package/engine/internal/unit+ability.lua +10 -1
- package/engine/internal/unit+damage.d.ts +2 -11
- package/engine/internal/unit+damage.lua +10 -14
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit-missile-launch.lua +45 -14
- package/engine/internal/unit.d.ts +42 -17
- package/engine/internal/unit.lua +331 -165
- package/engine/lightning.d.ts +4 -3
- package/engine/lightning.lua +21 -12
- package/engine/local-client.d.ts +2 -0
- package/engine/local-client.lua +30 -0
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- 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/auxiliary/attachment-preset.d.ts +7 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
- package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -0
- package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type.d.ts +19 -17
- package/engine/object-data/entry/ability-type.lua +85 -24
- package/engine/object-data/entry/buff-type/applicable.lua +18 -37
- package/engine/object-data/entry/buff-type.d.ts +6 -12
- package/engine/object-data/entry/buff-type.lua +13 -29
- package/engine/object-data/entry/destructible-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.lua +4 -4
- package/engine/object-data/entry/lightning-type.d.ts +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -0
- package/engine/object-data/entry/unit-type.d.ts +25 -5
- package/engine/object-data/entry/unit-type.lua +258 -93
- package/engine/object-data/entry/upgrade.d.ts +1 -1
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +16 -14
- package/engine/object-data/entry.lua +60 -32
- package/engine/object-field/ability.d.ts +4 -4
- package/engine/object-field/ability.lua +7 -6
- package/engine/object-field/unit.d.ts +69 -3
- package/engine/object-field/unit.lua +264 -7
- package/engine/object-field.d.ts +23 -6
- package/engine/object-field.lua +309 -126
- package/engine/random.d.ts +9 -0
- package/engine/random.lua +13 -0
- package/engine/standard/entries/buff-type.d.ts +3 -0
- package/engine/standard/entries/buff-type.lua +3 -0
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/engine/standard/fields/ability.d.ts +2 -2
- package/engine/standard/fields/ability.lua +2 -2
- package/engine/standard/fields/unit.d.ts +6 -0
- package/engine/standard/fields/unit.lua +11 -0
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +250 -10
- package/engine/unit.d.ts +3 -0
- package/engine/unit.lua +3 -0
- package/net/socket.lua +1 -1
- package/objutil/buff.lua +2 -3
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +2 -0
- package/utility/arrays.lua +11 -0
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +8 -0
- package/utility/functions.lua +13 -0
- package/utility/linked-set.d.ts +2 -0
- package/utility/linked-set.lua +22 -1
- package/utility/lua-maps.d.ts +15 -2
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +2 -0
- package/utility/lua-sets.lua +7 -0
- package/utility/reflection.lua +11 -7
- package/utility/types.d.ts +3 -0
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
package/engine/buff.lua
CHANGED
|
@@ -16,6 +16,7 @@ local internalApplyBuff = ____applicable.internalApplyBuff
|
|
|
16
16
|
local removeBuff = ____applicable.removeBuff
|
|
17
17
|
local ____ability = require("engine.internal.ability")
|
|
18
18
|
local Ability = ____ability.Ability
|
|
19
|
+
local UnitAbility = ____ability.UnitAbility
|
|
19
20
|
local ____ability = require("engine.object-field.ability")
|
|
20
21
|
local AbilityBooleanField = ____ability.AbilityBooleanField
|
|
21
22
|
local AbilityNumberField = ____ability.AbilityNumberField
|
|
@@ -28,13 +29,11 @@ local ____math = require("math")
|
|
|
28
29
|
local max = ____math.max
|
|
29
30
|
local min = ____math.min
|
|
30
31
|
local ____bonus = require("engine.internal.unit.bonus")
|
|
31
|
-
local addOrUpdateOrRemoveUnitBonus = ____bonus.addOrUpdateOrRemoveUnitBonus
|
|
32
|
-
local getUnitBonus = ____bonus.getUnitBonus
|
|
33
|
-
local removeUnitBonus = ____bonus.removeUnitBonus
|
|
34
32
|
local UnitBonusType = ____bonus.UnitBonusType
|
|
35
33
|
local ____area_2Ddamage = require("engine.internal.mechanics.area-damage")
|
|
36
34
|
local damageArea = ____area_2Ddamage.damageArea
|
|
37
35
|
local ____preconditions = require("utility.preconditions")
|
|
36
|
+
local check = ____preconditions.check
|
|
38
37
|
local checkNotNull = ____preconditions.checkNotNull
|
|
39
38
|
local ____effect = require("core.types.effect")
|
|
40
39
|
local Effect = ____effect.Effect
|
|
@@ -52,6 +51,10 @@ local ____item = require("engine.internal.item")
|
|
|
52
51
|
local Item = ____item.Item
|
|
53
52
|
local ____destructable = require("core.types.destructable")
|
|
54
53
|
local Destructable = ____destructable.Destructable
|
|
54
|
+
local ____ability = require("engine.standard.fields.ability")
|
|
55
|
+
local COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD = ____ability.COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD
|
|
56
|
+
local ____ability = require("engine.behaviour.ability")
|
|
57
|
+
local AbilityBehavior = ____ability.AbilityBehavior
|
|
55
58
|
local getUnitAbility = BlzGetUnitAbility
|
|
56
59
|
local stringValueByBuffTypeIdByFieldId = postcompile(function()
|
|
57
60
|
local stringValueByBuffTypeIdByFieldId = {}
|
|
@@ -101,12 +104,14 @@ local buffParametersKeys = {
|
|
|
101
104
|
attackSpeedIncreaseFactor = true,
|
|
102
105
|
movementSpeedIncreaseFactor = true,
|
|
103
106
|
evasionProbability = true,
|
|
107
|
+
missProbability = true,
|
|
104
108
|
damageFactor = true,
|
|
105
109
|
receivedDamageFactor = true,
|
|
106
110
|
receivedMagicDamageFactor = true,
|
|
107
111
|
durationIncreaseOnAutoAttack = true,
|
|
108
112
|
maximumDuration = true,
|
|
109
113
|
maximumRemainingDuration = true,
|
|
114
|
+
turnsIntoGhost = true,
|
|
110
115
|
stuns = true,
|
|
111
116
|
ignoresStunImmunity = true,
|
|
112
117
|
providesStunImmunity = true,
|
|
@@ -121,7 +126,8 @@ local buffParametersKeys = {
|
|
|
121
126
|
damageOnExpiration = true,
|
|
122
127
|
healingOnExpiration = true,
|
|
123
128
|
killsOnExpiration = true,
|
|
124
|
-
explodesOnExpiration = true
|
|
129
|
+
explodesOnExpiration = true,
|
|
130
|
+
abilityCooldownFactor = true
|
|
125
131
|
}
|
|
126
132
|
local function resolveEnumValue(ability, level, value)
|
|
127
133
|
if value == nil or type(value) == "number" then
|
|
@@ -172,6 +178,7 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
172
178
|
end
|
|
173
179
|
end
|
|
174
180
|
local buffBooleanParameters = {
|
|
181
|
+
"turnsIntoGhost",
|
|
175
182
|
"stuns",
|
|
176
183
|
"ignoresStunImmunity",
|
|
177
184
|
"disablesAutoAttack",
|
|
@@ -197,7 +204,8 @@ local buffNumberParameters = {
|
|
|
197
204
|
"healingPerInterval",
|
|
198
205
|
"healingOverDuration",
|
|
199
206
|
"damageOnExpiration",
|
|
200
|
-
"healingOnExpiration"
|
|
207
|
+
"healingOnExpiration",
|
|
208
|
+
"abilityCooldownFactor"
|
|
201
209
|
}
|
|
202
210
|
local unsuccessfulApplicationMarker = {}
|
|
203
211
|
local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
@@ -224,7 +232,7 @@ local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
|
224
232
|
return checkNotNull(firstNativeBuffTypeId)
|
|
225
233
|
end
|
|
226
234
|
local function destroyBuffIfItHasSameUniqueGroup(buff, uniqueGroup)
|
|
227
|
-
if buff[
|
|
235
|
+
if buff[104] == uniqueGroup then
|
|
228
236
|
buff:destroy()
|
|
229
237
|
end
|
|
230
238
|
end
|
|
@@ -232,17 +240,17 @@ local function destroyBuff(buff)
|
|
|
232
240
|
buff:destroy()
|
|
233
241
|
end
|
|
234
242
|
local function expireBuff(buff)
|
|
235
|
-
local remainingDamageOverDuration = buff[
|
|
236
|
-
local remainingHealingOverDuration = buff[
|
|
243
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
244
|
+
local remainingHealingOverDuration = buff[113] or 0
|
|
237
245
|
if remainingDamageOverDuration ~= 0 or remainingHealingOverDuration ~= 0 then
|
|
238
246
|
buff:flashSpecialEffect()
|
|
239
247
|
if remainingDamageOverDuration ~= 0 then
|
|
240
|
-
(buff[
|
|
241
|
-
buff[
|
|
248
|
+
(buff[102] or buff[101]):damageTarget(buff[101], remainingDamageOverDuration)
|
|
249
|
+
buff[113] = nil
|
|
242
250
|
end
|
|
243
251
|
if remainingHealingOverDuration ~= 0 then
|
|
244
|
-
(buff[
|
|
245
|
-
buff[
|
|
252
|
+
(buff[102] or buff[101]):healTarget(buff[101], remainingHealingOverDuration)
|
|
253
|
+
buff[118] = nil
|
|
246
254
|
end
|
|
247
255
|
end
|
|
248
256
|
Timer:run(destroyBuff, buff)
|
|
@@ -250,57 +258,58 @@ local function expireBuff(buff)
|
|
|
250
258
|
end
|
|
251
259
|
local function buffDamageIntervalInitialTimerCallback(buff)
|
|
252
260
|
buffDamageIntervalTimerCallback(buff)
|
|
253
|
-
local timer = buff[
|
|
254
|
-
local damageInterval = buff[
|
|
261
|
+
local timer = buff[114]
|
|
262
|
+
local damageInterval = buff[112]
|
|
255
263
|
if timer ~= nil and damageInterval ~= nil and damageInterval > 0 then
|
|
256
264
|
timer:start(damageInterval, true, buffDamageIntervalTimerCallback, buff)
|
|
257
265
|
end
|
|
258
266
|
end
|
|
259
267
|
buffDamageIntervalTimerCallback = function(buff)
|
|
260
268
|
buff:flashSpecialEffect()
|
|
261
|
-
local source = buff[
|
|
262
|
-
local remainingDamageOverDuration = buff[
|
|
269
|
+
local source = buff[102] or buff[101]
|
|
270
|
+
local remainingDamageOverDuration = buff[113] or 0
|
|
263
271
|
if remainingDamageOverDuration ~= 0 then
|
|
264
|
-
local damageInterval = buff[
|
|
272
|
+
local damageInterval = buff[112] or 0
|
|
265
273
|
if damageInterval ~= 0 then
|
|
266
274
|
local damage = remainingDamageOverDuration / (1 + buff.remainingDuration / damageInterval)
|
|
267
|
-
source:damageTarget(buff[
|
|
268
|
-
buff[
|
|
275
|
+
source:damageTarget(buff[101], damage)
|
|
276
|
+
buff[113] = remainingDamageOverDuration - damage
|
|
269
277
|
end
|
|
270
278
|
end
|
|
271
|
-
local damagePerInterval = buff[
|
|
279
|
+
local damagePerInterval = buff[111] or 0
|
|
272
280
|
if remainingDamageOverDuration == 0 or damagePerInterval ~= 0 then
|
|
273
|
-
source:damageTarget(buff[
|
|
281
|
+
source:damageTarget(buff[101], damagePerInterval)
|
|
274
282
|
end
|
|
275
283
|
end
|
|
276
284
|
local function buffHealingIntervalInitialTimerCallback(buff)
|
|
277
285
|
buffHealingIntervalTimerCallback(buff)
|
|
278
|
-
local timer = buff[
|
|
279
|
-
local healingInterval = buff[
|
|
286
|
+
local timer = buff[119]
|
|
287
|
+
local healingInterval = buff[117]
|
|
280
288
|
if timer ~= nil and healingInterval ~= nil and healingInterval > 0 then
|
|
281
289
|
timer:start(healingInterval, true, buffHealingIntervalTimerCallback, buff)
|
|
282
290
|
end
|
|
283
291
|
end
|
|
284
292
|
buffHealingIntervalTimerCallback = function(buff)
|
|
285
|
-
if buff[
|
|
293
|
+
if buff[117] ~= buff[112] then
|
|
286
294
|
buff:flashSpecialEffect()
|
|
287
295
|
end
|
|
288
|
-
local source = buff[
|
|
289
|
-
local remainingHealingOverDuration = buff[
|
|
296
|
+
local source = buff[102] or buff[101]
|
|
297
|
+
local remainingHealingOverDuration = buff[118] or 0
|
|
290
298
|
if remainingHealingOverDuration ~= 0 then
|
|
291
|
-
local healingInterval = buff[
|
|
299
|
+
local healingInterval = buff[117] or 0
|
|
292
300
|
if healingInterval ~= 0 then
|
|
293
301
|
local healing = remainingHealingOverDuration / (1 + buff.remainingDuration / healingInterval)
|
|
294
|
-
source:healTarget(buff[
|
|
295
|
-
buff[
|
|
302
|
+
source:healTarget(buff[101], healing)
|
|
303
|
+
buff[118] = remainingHealingOverDuration - healing
|
|
296
304
|
end
|
|
297
305
|
end
|
|
298
|
-
local healingPerInterval = buff[
|
|
306
|
+
local healingPerInterval = buff[116] or 0
|
|
299
307
|
if remainingHealingOverDuration == 0 or healingPerInterval ~= 0 then
|
|
300
|
-
source:healTarget(buff[
|
|
308
|
+
source:healTarget(buff[101], healingPerInterval)
|
|
301
309
|
end
|
|
302
310
|
end
|
|
303
|
-
local
|
|
311
|
+
local buffCreatedEvent = __TS__New(Event)
|
|
312
|
+
local buffBeingDestroyedEvent = __TS__New(Event)
|
|
304
313
|
____exports.Buff = __TS__Class()
|
|
305
314
|
local Buff = ____exports.Buff
|
|
306
315
|
Buff.name = "Buff"
|
|
@@ -309,38 +318,44 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
309
318
|
UnitBehavior.prototype.____constructor(self, _unit)
|
|
310
319
|
self._unit = _unit
|
|
311
320
|
self.parameters = nil
|
|
312
|
-
self[100] =
|
|
321
|
+
self[100] = 0
|
|
322
|
+
self[101] = _unit
|
|
313
323
|
local typeId
|
|
314
324
|
local polarity
|
|
315
325
|
local resistanceType
|
|
316
326
|
local ability
|
|
327
|
+
local abilityBehavior
|
|
317
328
|
if type(typeIdOrTypeIds) ~= "number" then
|
|
318
329
|
typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
|
|
319
330
|
polarity = resistanceTypeOrPolarity
|
|
320
331
|
resistanceType = abilityOrParametersOrResistanceType
|
|
321
|
-
if __TS__InstanceOf(parametersOrAbility,
|
|
332
|
+
if __TS__InstanceOf(parametersOrAbility, AbilityBehavior) then
|
|
333
|
+
abilityBehavior = parametersOrAbility
|
|
334
|
+
ability = abilityBehavior.ability
|
|
335
|
+
elseif __TS__InstanceOf(parametersOrAbility, Ability) then
|
|
322
336
|
ability = parametersOrAbility
|
|
323
|
-
|
|
324
|
-
ability = nil
|
|
337
|
+
elseif parametersOrAbility ~= nil then
|
|
325
338
|
parameters = parametersOrAbility
|
|
326
339
|
end
|
|
327
340
|
else
|
|
328
341
|
typeId = typeIdOrTypeIds
|
|
329
342
|
polarity = polarityOrTypeIdSelectionPolicy
|
|
330
343
|
resistanceType = resistanceTypeOrPolarity
|
|
331
|
-
if __TS__InstanceOf(abilityOrParametersOrResistanceType,
|
|
344
|
+
if __TS__InstanceOf(abilityOrParametersOrResistanceType, AbilityBehavior) then
|
|
345
|
+
abilityBehavior = abilityOrParametersOrResistanceType
|
|
346
|
+
ability = abilityBehavior.ability
|
|
347
|
+
parameters = parametersOrAbility
|
|
348
|
+
elseif __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
|
|
332
349
|
ability = abilityOrParametersOrResistanceType
|
|
333
350
|
parameters = parametersOrAbility
|
|
334
|
-
|
|
335
|
-
ability = nil
|
|
351
|
+
elseif abilityOrParametersOrResistanceType ~= nil then
|
|
336
352
|
parameters = abilityOrParametersOrResistanceType
|
|
353
|
+
else
|
|
354
|
+
parameters = parametersOrAbility
|
|
337
355
|
end
|
|
338
356
|
end
|
|
357
|
+
self.sourceAbilityBehavior = abilityBehavior
|
|
339
358
|
self.typeId = typeId
|
|
340
|
-
if not __TS__InstanceOf(ability, Ability) then
|
|
341
|
-
parameters = ability
|
|
342
|
-
ability = nil
|
|
343
|
-
end
|
|
344
359
|
local defaultParameters = self.constructor.defaultParameters
|
|
345
360
|
local level = parameters and parameters.level or defaultParameters.level
|
|
346
361
|
local spellStealPriority = parameters and parameters.spellStealPriority or defaultParameters.spellStealPriority
|
|
@@ -365,14 +380,19 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
365
380
|
end
|
|
366
381
|
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
367
382
|
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
383
|
+
local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
|
|
384
|
+
if missProbability ~= nil then
|
|
385
|
+
missProbability = resolveNumberValue(ability, level, missProbability)
|
|
386
|
+
self[142] = missProbability
|
|
387
|
+
end
|
|
368
388
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
369
389
|
if buffByTypeId == nil then
|
|
370
390
|
buffByTypeId = {}
|
|
371
391
|
buffByTypeIdByUnit[_unit] = buffByTypeId
|
|
372
392
|
end
|
|
373
|
-
local
|
|
374
|
-
if
|
|
375
|
-
|
|
393
|
+
local ____opt_15 = buffByTypeId[typeId]
|
|
394
|
+
if ____opt_15 ~= nil then
|
|
395
|
+
____opt_15:destroy()
|
|
376
396
|
end
|
|
377
397
|
local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
|
|
378
398
|
if uniqueGroup ~= nil then
|
|
@@ -386,13 +406,16 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
386
406
|
level,
|
|
387
407
|
duration,
|
|
388
408
|
spellStealPriority,
|
|
389
|
-
learnLevelMinimum
|
|
409
|
+
learnLevelMinimum,
|
|
410
|
+
missProbability
|
|
390
411
|
) then
|
|
412
|
+
self[100] = 1
|
|
391
413
|
UnitBehavior.prototype.destroy(self)
|
|
392
414
|
error(unsuccessfulApplicationMarker, 0)
|
|
393
415
|
end
|
|
394
416
|
local handle = BlzGetUnitAbility(_unit.handle, typeId)
|
|
395
417
|
if handle == nil then
|
|
418
|
+
self[100] = 1
|
|
396
419
|
UnitBehavior.prototype.destroy(self)
|
|
397
420
|
error(unsuccessfulApplicationMarker, 0)
|
|
398
421
|
end
|
|
@@ -401,20 +424,20 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
401
424
|
self._level = level
|
|
402
425
|
self._spellStealPriority = spellStealPriority
|
|
403
426
|
self._learnLevelMinimum = learnLevelMinimum
|
|
404
|
-
self[
|
|
405
|
-
self[
|
|
406
|
-
self[
|
|
407
|
-
self[
|
|
408
|
-
self[
|
|
427
|
+
self[102] = source
|
|
428
|
+
self[103] = duration or 0
|
|
429
|
+
self[104] = uniqueGroup
|
|
430
|
+
self[105] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_EFFECT, 0)
|
|
431
|
+
self[106] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
|
|
409
432
|
if parameters ~= nil or (next(defaultParameters)) ~= nil then
|
|
410
433
|
for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
|
|
411
|
-
local
|
|
412
|
-
local
|
|
413
|
-
local
|
|
414
|
-
if
|
|
415
|
-
|
|
434
|
+
local ____ability_24 = ability
|
|
435
|
+
local ____level_25 = level
|
|
436
|
+
local ____temp_23 = parameters and parameters[buffBooleanParameter]
|
|
437
|
+
if ____temp_23 == nil then
|
|
438
|
+
____temp_23 = defaultParameters[buffBooleanParameter]
|
|
416
439
|
end
|
|
417
|
-
if resolveBooleanValue(
|
|
440
|
+
if resolveBooleanValue(____ability_24, ____level_25, ____temp_23) then
|
|
418
441
|
self[buffBooleanParameter] = true
|
|
419
442
|
end
|
|
420
443
|
end
|
|
@@ -430,11 +453,11 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
430
453
|
end
|
|
431
454
|
local maximumDuration = parameters and parameters.maximumDuration or defaultParameters.maximumDuration
|
|
432
455
|
if maximumDuration ~= nil then
|
|
433
|
-
self[
|
|
456
|
+
self[108] = resolveNumberValue(ability, level, maximumDuration)
|
|
434
457
|
end
|
|
435
458
|
local maximumRemainingDuration = parameters and parameters.maximumRemainingDuration or defaultParameters.maximumRemainingDuration
|
|
436
459
|
if maximumRemainingDuration ~= nil then
|
|
437
|
-
self[
|
|
460
|
+
self[109] = resolveNumberValue(ability, level, maximumRemainingDuration)
|
|
438
461
|
end
|
|
439
462
|
local parametersAbilityTypeIds = parameters and parameters.abilityTypeIds or defaultParameters.abilityTypeIds
|
|
440
463
|
if parametersAbilityTypeIds ~= nil then
|
|
@@ -492,29 +515,34 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
492
515
|
self._timer = timer
|
|
493
516
|
end
|
|
494
517
|
self:onCreate()
|
|
518
|
+
self[100] = 1
|
|
519
|
+
Event.invoke(buffCreatedEvent, self)
|
|
495
520
|
end
|
|
496
|
-
function Buff.prototype.
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
521
|
+
function Buff.prototype.onAbilityGained(self, ability)
|
|
522
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
523
|
+
local abilityCooldownModifier = self[144]
|
|
524
|
+
if abilityCooldownModifier then
|
|
525
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, abilityCooldownModifier)
|
|
526
|
+
end
|
|
527
|
+
end
|
|
500
528
|
end
|
|
501
|
-
function Buff.prototype.
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
529
|
+
function Buff.prototype.onAbilityLost(self, ability)
|
|
530
|
+
if __TS__InstanceOf(ability, UnitAbility) then
|
|
531
|
+
local abilityCooldownModifier = self[144]
|
|
532
|
+
if abilityCooldownModifier then
|
|
533
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, abilityCooldownModifier)
|
|
534
|
+
end
|
|
506
535
|
end
|
|
507
|
-
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
508
536
|
end
|
|
509
537
|
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
510
538
|
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
511
|
-
Effect:flash(self[
|
|
539
|
+
Effect:flash(self[105], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
512
540
|
else
|
|
513
541
|
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
514
542
|
local ____Effect_40 = Effect
|
|
515
543
|
local ____Effect_flash_41 = Effect.flash
|
|
516
544
|
local ____array_39 = __TS__SparseArrayNew(
|
|
517
|
-
self[
|
|
545
|
+
self[105],
|
|
518
546
|
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
519
547
|
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
520
548
|
)
|
|
@@ -536,7 +564,7 @@ function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
|
536
564
|
local ____Effect_44 = Effect
|
|
537
565
|
local ____Effect_flash_45 = Effect.flash
|
|
538
566
|
local ____array_43 = __TS__SparseArrayNew(
|
|
539
|
-
self[
|
|
567
|
+
self[106],
|
|
540
568
|
isWidgetProvided and widgetOrDuration or self._unit,
|
|
541
569
|
stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
|
|
542
570
|
)
|
|
@@ -555,20 +583,22 @@ end
|
|
|
555
583
|
function Buff.prototype.onCreate(self)
|
|
556
584
|
end
|
|
557
585
|
function Buff.prototype.onDestroy(self)
|
|
586
|
+
check(self[100] ~= 0, "Cannot destroy a buff that has not finished creating yet.")
|
|
587
|
+
self[100] = 2
|
|
558
588
|
local unit = self._unit
|
|
559
589
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
560
590
|
removeBuff(unit.handle, self.typeId)
|
|
561
591
|
end
|
|
562
592
|
buffByTypeIdByUnit[unit][self.typeId] = nil
|
|
563
|
-
local healingIntervalTimer = self[
|
|
593
|
+
local healingIntervalTimer = self[119]
|
|
564
594
|
if healingIntervalTimer ~= nil then
|
|
565
595
|
healingIntervalTimer:destroy()
|
|
566
|
-
self[
|
|
596
|
+
self[119] = nil
|
|
567
597
|
end
|
|
568
|
-
local damageIntervalTimer = self[
|
|
598
|
+
local damageIntervalTimer = self[114]
|
|
569
599
|
if damageIntervalTimer ~= nil then
|
|
570
600
|
damageIntervalTimer:destroy()
|
|
571
|
-
self[
|
|
601
|
+
self[114] = nil
|
|
572
602
|
end
|
|
573
603
|
if self._timer ~= nil then
|
|
574
604
|
self._timer:destroy()
|
|
@@ -578,26 +608,34 @@ function Buff.prototype.onDestroy(self)
|
|
|
578
608
|
behavior:destroy()
|
|
579
609
|
end
|
|
580
610
|
end
|
|
581
|
-
|
|
611
|
+
local previousAbilityCooldownModifier = self[144]
|
|
612
|
+
if previousAbilityCooldownModifier then
|
|
613
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
614
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
615
|
+
end
|
|
616
|
+
end
|
|
617
|
+
if self[139] then
|
|
618
|
+
unit:decrementInvulnerabilityCounter()
|
|
619
|
+
end
|
|
620
|
+
if self[138] then
|
|
582
621
|
unit:decrementDisableAutoAttackCounter()
|
|
583
622
|
end
|
|
584
|
-
if self[
|
|
585
|
-
if self[
|
|
586
|
-
unit:
|
|
623
|
+
if self[136] then
|
|
624
|
+
if self[137] then
|
|
625
|
+
unit:decrementForceStunCounter()
|
|
587
626
|
end
|
|
588
627
|
unit:decrementStunCounter()
|
|
589
628
|
end
|
|
629
|
+
if self[135] then
|
|
630
|
+
unit:decrementGhostCounter()
|
|
631
|
+
end
|
|
590
632
|
if self._abilityTypeIds ~= nil then
|
|
591
633
|
for abilityTypeId in pairs(self._abilityTypeIds) do
|
|
592
634
|
unit:removeAbility(abilityTypeId)
|
|
593
635
|
end
|
|
594
636
|
end
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
removeUnitBonus(unit, bonusType, bonusId)
|
|
598
|
-
end
|
|
599
|
-
end
|
|
600
|
-
Event.invoke(buffDestroyEvent, self)
|
|
637
|
+
Event.invoke(buffBeingDestroyedEvent, self)
|
|
638
|
+
self[100] = 3
|
|
601
639
|
return UnitBehavior.prototype.onDestroy(self)
|
|
602
640
|
end
|
|
603
641
|
function Buff.apply(self, ...)
|
|
@@ -634,72 +672,72 @@ function Buff.getByTypeId(self, unit, typeId)
|
|
|
634
672
|
end
|
|
635
673
|
function Buff.prototype.onExpiration(self)
|
|
636
674
|
local unit = self.unit
|
|
637
|
-
if self[119] ~= nil then
|
|
638
|
-
(self[101] or unit):damageTarget(unit, self[119] or 0)
|
|
639
|
-
end
|
|
640
675
|
if self[120] ~= nil then
|
|
641
|
-
(self[
|
|
676
|
+
(self[102] or unit):damageTarget(unit, self[120] or 0)
|
|
642
677
|
end
|
|
643
|
-
if self[
|
|
678
|
+
if self[121] ~= nil then
|
|
679
|
+
(self[102] or unit):healTarget(unit, self[120] or 0)
|
|
680
|
+
end
|
|
681
|
+
if self[141] then
|
|
644
682
|
unit:explode()
|
|
645
|
-
elseif self[
|
|
683
|
+
elseif self[140] then
|
|
646
684
|
unit:kill()
|
|
647
685
|
end
|
|
648
686
|
end
|
|
649
687
|
function Buff.prototype.onDeath(self, source)
|
|
650
688
|
local unit = self.unit
|
|
651
|
-
if self[
|
|
689
|
+
if self[122] ~= nil then
|
|
652
690
|
damageArea(
|
|
653
|
-
self[
|
|
654
|
-
self[
|
|
691
|
+
self[102] or unit,
|
|
692
|
+
self[122],
|
|
655
693
|
unit.x,
|
|
656
694
|
unit.y,
|
|
695
|
+
self[124] or 0,
|
|
657
696
|
self[123] or 0,
|
|
658
|
-
self[
|
|
697
|
+
self[126] or 0,
|
|
659
698
|
self[125] or 0,
|
|
660
|
-
self[
|
|
661
|
-
self[127] or 0
|
|
662
|
-
self[126] or 0
|
|
699
|
+
self[128] or 0,
|
|
700
|
+
self[127] or 0
|
|
663
701
|
)
|
|
664
702
|
end
|
|
665
703
|
end
|
|
666
704
|
function Buff.prototype.onDamageDealt(self, target, event)
|
|
667
705
|
if event.isAttack then
|
|
668
|
-
if self[
|
|
669
|
-
local durationIncrease = self[
|
|
670
|
-
local maximumDuration = self[
|
|
706
|
+
if self[107] ~= nil then
|
|
707
|
+
local durationIncrease = self[107]
|
|
708
|
+
local maximumDuration = self[108] or 0
|
|
671
709
|
if maximumDuration > 0 then
|
|
672
710
|
durationIncrease = min(
|
|
673
711
|
durationIncrease,
|
|
674
|
-
max(0, maximumDuration - self[
|
|
712
|
+
max(0, maximumDuration - self[103])
|
|
675
713
|
)
|
|
676
714
|
end
|
|
677
715
|
local remainingDuration = self.remainingDuration + durationIncrease
|
|
678
|
-
local maximumRemainingDuration = self[
|
|
716
|
+
local maximumRemainingDuration = self[109] or 0
|
|
679
717
|
if maximumRemainingDuration > 0 then
|
|
680
718
|
remainingDuration = min(remainingDuration, maximumRemainingDuration)
|
|
681
719
|
end
|
|
682
720
|
self.remainingDuration = remainingDuration
|
|
683
721
|
end
|
|
684
|
-
local autoAttackCount = (self[
|
|
685
|
-
self[
|
|
686
|
-
if autoAttackCount == self[
|
|
722
|
+
local autoAttackCount = (self[129] or 0) + 1
|
|
723
|
+
self[129] = autoAttackCount
|
|
724
|
+
if autoAttackCount == self[130] then
|
|
687
725
|
self:destroy()
|
|
688
726
|
end
|
|
689
727
|
end
|
|
690
728
|
if event.originalAmount ~= 0 then
|
|
691
|
-
local damageDealtEventCount = (self[
|
|
692
|
-
self[
|
|
693
|
-
if damageDealtEventCount == self[
|
|
729
|
+
local damageDealtEventCount = (self[131] or 0) + 1
|
|
730
|
+
self[131] = damageDealtEventCount
|
|
731
|
+
if damageDealtEventCount == self[132] then
|
|
694
732
|
self:destroy()
|
|
695
733
|
end
|
|
696
734
|
end
|
|
697
735
|
end
|
|
698
736
|
function Buff.prototype.onDamageReceived(self, source, event)
|
|
699
737
|
if event.originalAmount ~= 0 then
|
|
700
|
-
local damageReceivedEventCount = (self[
|
|
701
|
-
self[
|
|
702
|
-
if damageReceivedEventCount == self[
|
|
738
|
+
local damageReceivedEventCount = (self[133] or 0) + 1
|
|
739
|
+
self[133] = damageReceivedEventCount
|
|
740
|
+
if damageReceivedEventCount == self[134] then
|
|
703
741
|
self:destroy()
|
|
704
742
|
end
|
|
705
743
|
end
|
|
@@ -709,7 +747,7 @@ __TS__SetDescriptor(
|
|
|
709
747
|
Buff.prototype,
|
|
710
748
|
"source",
|
|
711
749
|
{get = function(self)
|
|
712
|
-
return self[
|
|
750
|
+
return self[102] or self._unit
|
|
713
751
|
end},
|
|
714
752
|
true
|
|
715
753
|
)
|
|
@@ -726,13 +764,13 @@ __TS__SetDescriptor(
|
|
|
726
764
|
"remainingDamageOverDuration",
|
|
727
765
|
{
|
|
728
766
|
get = function(self)
|
|
729
|
-
return self[
|
|
767
|
+
return self[113] or 0
|
|
730
768
|
end,
|
|
731
769
|
set = function(self, remainingDamageOverDuration)
|
|
732
|
-
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[
|
|
733
|
-
self[
|
|
734
|
-
local damageOverDuration = (self[
|
|
735
|
-
self[
|
|
770
|
+
local remainingDamageOverDurationDelta = remainingDamageOverDuration - (self[113] or 0)
|
|
771
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
772
|
+
local damageOverDuration = (self[110] or 0) + remainingDamageOverDurationDelta
|
|
773
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
736
774
|
end
|
|
737
775
|
},
|
|
738
776
|
true
|
|
@@ -742,13 +780,13 @@ __TS__SetDescriptor(
|
|
|
742
780
|
"damageOverDuration",
|
|
743
781
|
{
|
|
744
782
|
get = function(self)
|
|
745
|
-
return self[
|
|
783
|
+
return self[110] or 0
|
|
746
784
|
end,
|
|
747
785
|
set = function(self, damageOverDuration)
|
|
748
|
-
local damageOverDurationDelta = damageOverDuration - (self[
|
|
749
|
-
self[
|
|
750
|
-
local remainingDamageOverDuration = (self[
|
|
751
|
-
self[
|
|
786
|
+
local damageOverDurationDelta = damageOverDuration - (self[110] or 0)
|
|
787
|
+
self[110] = damageOverDuration ~= 0 and damageOverDuration or nil
|
|
788
|
+
local remainingDamageOverDuration = (self[113] or 0) + damageOverDurationDelta
|
|
789
|
+
self[113] = remainingDamageOverDuration ~= 0 and remainingDamageOverDuration or nil
|
|
752
790
|
end
|
|
753
791
|
},
|
|
754
792
|
true
|
|
@@ -758,10 +796,10 @@ __TS__SetDescriptor(
|
|
|
758
796
|
"damagePerInterval",
|
|
759
797
|
{
|
|
760
798
|
get = function(self)
|
|
761
|
-
return self[
|
|
799
|
+
return self[111] or 0
|
|
762
800
|
end,
|
|
763
801
|
set = function(self, damagePerInterval)
|
|
764
|
-
self[
|
|
802
|
+
self[111] = damagePerInterval ~= 0 and damagePerInterval or nil
|
|
765
803
|
end
|
|
766
804
|
},
|
|
767
805
|
true
|
|
@@ -771,25 +809,25 @@ __TS__SetDescriptor(
|
|
|
771
809
|
"damageInterval",
|
|
772
810
|
{
|
|
773
811
|
get = function(self)
|
|
774
|
-
return self[
|
|
812
|
+
return self[112] or 0
|
|
775
813
|
end,
|
|
776
814
|
set = function(self, damageInterval)
|
|
777
815
|
if damageInterval <= 0 then
|
|
778
|
-
self[
|
|
779
|
-
local timer = self[
|
|
816
|
+
self[112] = damageInterval ~= 0 and damageInterval or nil
|
|
817
|
+
local timer = self[114]
|
|
780
818
|
if timer ~= nil then
|
|
781
819
|
timer:destroy()
|
|
782
|
-
self[
|
|
820
|
+
self[114] = nil
|
|
783
821
|
end
|
|
784
822
|
return
|
|
785
823
|
end
|
|
786
|
-
self[
|
|
824
|
+
self[112] = damageInterval
|
|
787
825
|
local ____opt_48 = self._timer
|
|
788
826
|
local elapsed = ____opt_48 and ____opt_48.elapsed or 0
|
|
789
|
-
local timer = self[
|
|
827
|
+
local timer = self[114]
|
|
790
828
|
if timer == nil then
|
|
791
829
|
timer = Timer:create()
|
|
792
|
-
self[
|
|
830
|
+
self[114] = timer
|
|
793
831
|
end
|
|
794
832
|
local initialDelay = damageInterval - (elapsed >= damageInterval and math.fmod(elapsed, damageInterval) or elapsed)
|
|
795
833
|
if initialDelay == damageInterval then
|
|
@@ -806,13 +844,13 @@ __TS__SetDescriptor(
|
|
|
806
844
|
"remainingHealingOverDuration",
|
|
807
845
|
{
|
|
808
846
|
get = function(self)
|
|
809
|
-
return self[
|
|
847
|
+
return self[118] or 0
|
|
810
848
|
end,
|
|
811
849
|
set = function(self, remainingHealingOverDuration)
|
|
812
|
-
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[
|
|
813
|
-
self[
|
|
814
|
-
local healingOverDuration = (self[
|
|
815
|
-
self[
|
|
850
|
+
local remainingHealingOverDurationDelta = remainingHealingOverDuration - (self[118] or 0)
|
|
851
|
+
self[113] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
852
|
+
local healingOverDuration = (self[115] or 0) + remainingHealingOverDurationDelta
|
|
853
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
816
854
|
end
|
|
817
855
|
},
|
|
818
856
|
true
|
|
@@ -822,13 +860,13 @@ __TS__SetDescriptor(
|
|
|
822
860
|
"healingOverDuration",
|
|
823
861
|
{
|
|
824
862
|
get = function(self)
|
|
825
|
-
return self[
|
|
863
|
+
return self[115] or 0
|
|
826
864
|
end,
|
|
827
865
|
set = function(self, healingOverDuration)
|
|
828
|
-
local healingOverDurationDelta = healingOverDuration - (self[
|
|
829
|
-
self[
|
|
830
|
-
local remainingHealingOverDuration = (self[
|
|
831
|
-
self[
|
|
866
|
+
local healingOverDurationDelta = healingOverDuration - (self[115] or 0)
|
|
867
|
+
self[115] = healingOverDuration ~= 0 and healingOverDuration or nil
|
|
868
|
+
local remainingHealingOverDuration = (self[118] or 0) + healingOverDurationDelta
|
|
869
|
+
self[118] = remainingHealingOverDuration ~= 0 and remainingHealingOverDuration or nil
|
|
832
870
|
end
|
|
833
871
|
},
|
|
834
872
|
true
|
|
@@ -838,10 +876,10 @@ __TS__SetDescriptor(
|
|
|
838
876
|
"healingPerInterval",
|
|
839
877
|
{
|
|
840
878
|
get = function(self)
|
|
841
|
-
return self[
|
|
879
|
+
return self[116] or 0
|
|
842
880
|
end,
|
|
843
881
|
set = function(self, healingPerInterval)
|
|
844
|
-
self[
|
|
882
|
+
self[116] = healingPerInterval ~= 0 and healingPerInterval or nil
|
|
845
883
|
end
|
|
846
884
|
},
|
|
847
885
|
true
|
|
@@ -851,25 +889,25 @@ __TS__SetDescriptor(
|
|
|
851
889
|
"healingInterval",
|
|
852
890
|
{
|
|
853
891
|
get = function(self)
|
|
854
|
-
return self[
|
|
892
|
+
return self[117] or 0
|
|
855
893
|
end,
|
|
856
894
|
set = function(self, healingInterval)
|
|
857
895
|
if healingInterval <= 0 then
|
|
858
|
-
self[
|
|
859
|
-
local timer = self[
|
|
896
|
+
self[117] = healingInterval ~= 0 and healingInterval or nil
|
|
897
|
+
local timer = self[119]
|
|
860
898
|
if timer ~= nil then
|
|
861
899
|
timer:destroy()
|
|
862
|
-
self[
|
|
900
|
+
self[119] = nil
|
|
863
901
|
end
|
|
864
902
|
return
|
|
865
903
|
end
|
|
866
|
-
self[
|
|
904
|
+
self[117] = healingInterval
|
|
867
905
|
local ____opt_50 = self._timer
|
|
868
906
|
local elapsed = ____opt_50 and ____opt_50.elapsed or 0
|
|
869
|
-
local timer = self[
|
|
907
|
+
local timer = self[119]
|
|
870
908
|
if timer == nil then
|
|
871
909
|
timer = Timer:create()
|
|
872
|
-
self[
|
|
910
|
+
self[119] = timer
|
|
873
911
|
end
|
|
874
912
|
local initialDelay = healingInterval - (elapsed >= healingInterval and math.fmod(elapsed, healingInterval) or elapsed)
|
|
875
913
|
if initialDelay == healingInterval then
|
|
@@ -886,10 +924,10 @@ __TS__SetDescriptor(
|
|
|
886
924
|
"damageOnExpiration",
|
|
887
925
|
{
|
|
888
926
|
get = function(self)
|
|
889
|
-
return self[
|
|
927
|
+
return self[120] or 0
|
|
890
928
|
end,
|
|
891
929
|
set = function(self, damageOnExpiration)
|
|
892
|
-
self[
|
|
930
|
+
self[120] = damageOnExpiration ~= 0 and damageOnExpiration or nil
|
|
893
931
|
end
|
|
894
932
|
},
|
|
895
933
|
true
|
|
@@ -899,10 +937,10 @@ __TS__SetDescriptor(
|
|
|
899
937
|
"healingOnExpiration",
|
|
900
938
|
{
|
|
901
939
|
get = function(self)
|
|
902
|
-
return self[
|
|
940
|
+
return self[121] or 0
|
|
903
941
|
end,
|
|
904
942
|
set = function(self, healingOnExpiration)
|
|
905
|
-
self[
|
|
943
|
+
self[121] = healingOnExpiration ~= 0 and healingOnExpiration or nil
|
|
906
944
|
end
|
|
907
945
|
},
|
|
908
946
|
true
|
|
@@ -946,30 +984,53 @@ __TS__SetDescriptor(
|
|
|
946
984
|
},
|
|
947
985
|
true
|
|
948
986
|
)
|
|
987
|
+
__TS__SetDescriptor(
|
|
988
|
+
Buff.prototype,
|
|
989
|
+
"turnsIntoGhost",
|
|
990
|
+
{
|
|
991
|
+
get = function(self)
|
|
992
|
+
local ____self__135_52 = self[135]
|
|
993
|
+
if ____self__135_52 == nil then
|
|
994
|
+
____self__135_52 = false
|
|
995
|
+
end
|
|
996
|
+
return ____self__135_52
|
|
997
|
+
end,
|
|
998
|
+
set = function(self, turnsIntoGhost)
|
|
999
|
+
if not turnsIntoGhost and self[135] then
|
|
1000
|
+
self.object:decrementGhostCounter()
|
|
1001
|
+
self[135] = nil
|
|
1002
|
+
elseif turnsIntoGhost and not self[135] then
|
|
1003
|
+
self.object:incrementGhostCounter()
|
|
1004
|
+
self[135] = true
|
|
1005
|
+
end
|
|
1006
|
+
end
|
|
1007
|
+
},
|
|
1008
|
+
true
|
|
1009
|
+
)
|
|
949
1010
|
__TS__SetDescriptor(
|
|
950
1011
|
Buff.prototype,
|
|
951
1012
|
"stuns",
|
|
952
1013
|
{
|
|
953
1014
|
get = function(self)
|
|
954
|
-
local
|
|
955
|
-
if
|
|
956
|
-
|
|
1015
|
+
local ____self__136_53 = self[136]
|
|
1016
|
+
if ____self__136_53 == nil then
|
|
1017
|
+
____self__136_53 = false
|
|
957
1018
|
end
|
|
958
|
-
return
|
|
1019
|
+
return ____self__136_53
|
|
959
1020
|
end,
|
|
960
1021
|
set = function(self, stuns)
|
|
961
|
-
if not stuns and self[
|
|
962
|
-
if self[
|
|
963
|
-
self.object:
|
|
1022
|
+
if not stuns and self[136] then
|
|
1023
|
+
if self[137] then
|
|
1024
|
+
self.object:decrementForceStunCounter()
|
|
964
1025
|
end
|
|
965
1026
|
self.object:decrementStunCounter()
|
|
966
|
-
self[
|
|
967
|
-
elseif stuns and not self[
|
|
968
|
-
if self[
|
|
969
|
-
self.object:
|
|
1027
|
+
self[136] = nil
|
|
1028
|
+
elseif stuns and not self[136] then
|
|
1029
|
+
if self[137] then
|
|
1030
|
+
self.object:incrementForceStunCounter()
|
|
970
1031
|
end
|
|
971
1032
|
self.object:incrementStunCounter()
|
|
972
|
-
self[
|
|
1033
|
+
self[136] = true
|
|
973
1034
|
end
|
|
974
1035
|
end
|
|
975
1036
|
},
|
|
@@ -980,23 +1041,23 @@ __TS__SetDescriptor(
|
|
|
980
1041
|
"ignoresStunImmunity",
|
|
981
1042
|
{
|
|
982
1043
|
get = function(self)
|
|
983
|
-
local
|
|
984
|
-
if
|
|
985
|
-
|
|
1044
|
+
local ____self__137_54 = self[137]
|
|
1045
|
+
if ____self__137_54 == nil then
|
|
1046
|
+
____self__137_54 = false
|
|
986
1047
|
end
|
|
987
|
-
return
|
|
1048
|
+
return ____self__137_54
|
|
988
1049
|
end,
|
|
989
1050
|
set = function(self, ignoresStunImmunity)
|
|
990
|
-
if not ignoresStunImmunity and self[
|
|
991
|
-
if self[
|
|
992
|
-
self.object:
|
|
1051
|
+
if not ignoresStunImmunity and self[137] then
|
|
1052
|
+
if self[136] then
|
|
1053
|
+
self.object:decrementForceStunCounter()
|
|
993
1054
|
end
|
|
994
|
-
self[
|
|
995
|
-
elseif ignoresStunImmunity and not self[
|
|
996
|
-
if self[
|
|
997
|
-
self.object:
|
|
1055
|
+
self[137] = nil
|
|
1056
|
+
elseif ignoresStunImmunity and not self[137] then
|
|
1057
|
+
if self[136] then
|
|
1058
|
+
self.object:incrementForceStunCounter()
|
|
998
1059
|
end
|
|
999
|
-
self[
|
|
1060
|
+
self[137] = true
|
|
1000
1061
|
end
|
|
1001
1062
|
end
|
|
1002
1063
|
},
|
|
@@ -1007,19 +1068,19 @@ __TS__SetDescriptor(
|
|
|
1007
1068
|
"disablesAutoAttack",
|
|
1008
1069
|
{
|
|
1009
1070
|
get = function(self)
|
|
1010
|
-
local
|
|
1011
|
-
if
|
|
1012
|
-
|
|
1071
|
+
local ____self__138_55 = self[138]
|
|
1072
|
+
if ____self__138_55 == nil then
|
|
1073
|
+
____self__138_55 = false
|
|
1013
1074
|
end
|
|
1014
|
-
return
|
|
1075
|
+
return ____self__138_55
|
|
1015
1076
|
end,
|
|
1016
1077
|
set = function(self, disablesAutoAttack)
|
|
1017
|
-
if not disablesAutoAttack and self[
|
|
1078
|
+
if not disablesAutoAttack and self[138] then
|
|
1018
1079
|
self.object:decrementDisableAutoAttackCounter()
|
|
1019
|
-
self[
|
|
1020
|
-
elseif disablesAutoAttack and not self[
|
|
1080
|
+
self[138] = nil
|
|
1081
|
+
elseif disablesAutoAttack and not self[138] then
|
|
1021
1082
|
self.object:incrementDisableAutoAttackCounter()
|
|
1022
|
-
self[
|
|
1083
|
+
self[138] = true
|
|
1023
1084
|
end
|
|
1024
1085
|
end
|
|
1025
1086
|
},
|
|
@@ -1030,19 +1091,19 @@ __TS__SetDescriptor(
|
|
|
1030
1091
|
"providesInvulnerability",
|
|
1031
1092
|
{
|
|
1032
1093
|
get = function(self)
|
|
1033
|
-
local
|
|
1034
|
-
if
|
|
1035
|
-
|
|
1094
|
+
local ____self__139_56 = self[139]
|
|
1095
|
+
if ____self__139_56 == nil then
|
|
1096
|
+
____self__139_56 = false
|
|
1036
1097
|
end
|
|
1037
|
-
return
|
|
1098
|
+
return ____self__139_56
|
|
1038
1099
|
end,
|
|
1039
1100
|
set = function(self, providesInvulnerability)
|
|
1040
|
-
if not providesInvulnerability and self[
|
|
1101
|
+
if not providesInvulnerability and self[139] then
|
|
1041
1102
|
self.object:decrementInvulnerabilityCounter()
|
|
1042
|
-
self[
|
|
1043
|
-
elseif providesInvulnerability and not self[
|
|
1103
|
+
self[139] = nil
|
|
1104
|
+
elseif providesInvulnerability and not self[139] then
|
|
1044
1105
|
self.object:incrementInvulnerabilityCounter()
|
|
1045
|
-
self[
|
|
1106
|
+
self[139] = true
|
|
1046
1107
|
end
|
|
1047
1108
|
end
|
|
1048
1109
|
},
|
|
@@ -1053,17 +1114,17 @@ __TS__SetDescriptor(
|
|
|
1053
1114
|
"killsOnExpiration",
|
|
1054
1115
|
{
|
|
1055
1116
|
get = function(self)
|
|
1056
|
-
local
|
|
1057
|
-
if
|
|
1058
|
-
|
|
1117
|
+
local ____self__140_57 = self[140]
|
|
1118
|
+
if ____self__140_57 == nil then
|
|
1119
|
+
____self__140_57 = false
|
|
1059
1120
|
end
|
|
1060
|
-
return
|
|
1121
|
+
return ____self__140_57
|
|
1061
1122
|
end,
|
|
1062
1123
|
set = function(self, killsOnExpiration)
|
|
1063
|
-
if not killsOnExpiration and self[
|
|
1064
|
-
self[
|
|
1065
|
-
elseif killsOnExpiration and not self[
|
|
1066
|
-
self[
|
|
1124
|
+
if not killsOnExpiration and self[140] then
|
|
1125
|
+
self[140] = nil
|
|
1126
|
+
elseif killsOnExpiration and not self[140] then
|
|
1127
|
+
self[140] = true
|
|
1067
1128
|
end
|
|
1068
1129
|
end
|
|
1069
1130
|
},
|
|
@@ -1074,17 +1135,17 @@ __TS__SetDescriptor(
|
|
|
1074
1135
|
"explodesOnExpiration",
|
|
1075
1136
|
{
|
|
1076
1137
|
get = function(self)
|
|
1077
|
-
local
|
|
1078
|
-
if
|
|
1079
|
-
|
|
1138
|
+
local ____self__141_58 = self[141]
|
|
1139
|
+
if ____self__141_58 == nil then
|
|
1140
|
+
____self__141_58 = false
|
|
1080
1141
|
end
|
|
1081
|
-
return
|
|
1142
|
+
return ____self__141_58
|
|
1082
1143
|
end,
|
|
1083
1144
|
set = function(self, killsOnExpiration)
|
|
1084
|
-
if not killsOnExpiration and self[
|
|
1085
|
-
self[
|
|
1086
|
-
elseif killsOnExpiration and not self[
|
|
1087
|
-
self[
|
|
1145
|
+
if not killsOnExpiration and self[141] then
|
|
1146
|
+
self[141] = nil
|
|
1147
|
+
elseif killsOnExpiration and not self[141] then
|
|
1148
|
+
self[141] = true
|
|
1088
1149
|
end
|
|
1089
1150
|
end
|
|
1090
1151
|
},
|
|
@@ -1095,13 +1156,13 @@ __TS__SetDescriptor(
|
|
|
1095
1156
|
"maximumDamageDealtEventCount",
|
|
1096
1157
|
{
|
|
1097
1158
|
get = function(self)
|
|
1098
|
-
return self[
|
|
1159
|
+
return self[132] or 0
|
|
1099
1160
|
end,
|
|
1100
1161
|
set = function(self, maximumDamageDealtEventCount)
|
|
1101
1162
|
if maximumDamageDealtEventCount == 0 then
|
|
1102
|
-
self[
|
|
1163
|
+
self[132] = nil
|
|
1103
1164
|
else
|
|
1104
|
-
self[
|
|
1165
|
+
self[132] = maximumDamageDealtEventCount
|
|
1105
1166
|
end
|
|
1106
1167
|
end
|
|
1107
1168
|
},
|
|
@@ -1112,13 +1173,13 @@ __TS__SetDescriptor(
|
|
|
1112
1173
|
"maximumDamageReceivedEventCount",
|
|
1113
1174
|
{
|
|
1114
1175
|
get = function(self)
|
|
1115
|
-
return self[
|
|
1176
|
+
return self[134] or 0
|
|
1116
1177
|
end,
|
|
1117
1178
|
set = function(self, maximumDamageReceivedEventCount)
|
|
1118
1179
|
if maximumDamageReceivedEventCount == 0 then
|
|
1119
|
-
self[
|
|
1180
|
+
self[134] = nil
|
|
1120
1181
|
else
|
|
1121
|
-
self[
|
|
1182
|
+
self[134] = maximumDamageReceivedEventCount
|
|
1122
1183
|
end
|
|
1123
1184
|
end
|
|
1124
1185
|
},
|
|
@@ -1129,13 +1190,13 @@ __TS__SetDescriptor(
|
|
|
1129
1190
|
"maximumAutoAttackCount",
|
|
1130
1191
|
{
|
|
1131
1192
|
get = function(self)
|
|
1132
|
-
return self[
|
|
1193
|
+
return self[130] or 0
|
|
1133
1194
|
end,
|
|
1134
1195
|
set = function(self, maximumAutoAttackCount)
|
|
1135
1196
|
if maximumAutoAttackCount == 0 then
|
|
1136
|
-
self[
|
|
1197
|
+
self[130] = nil
|
|
1137
1198
|
else
|
|
1138
|
-
self[
|
|
1199
|
+
self[130] = maximumAutoAttackCount
|
|
1139
1200
|
end
|
|
1140
1201
|
end
|
|
1141
1202
|
},
|
|
@@ -1146,10 +1207,10 @@ __TS__SetDescriptor(
|
|
|
1146
1207
|
"durationIncreaseOnAutoAttack",
|
|
1147
1208
|
{
|
|
1148
1209
|
get = function(self)
|
|
1149
|
-
return self[
|
|
1210
|
+
return self[107] or 0
|
|
1150
1211
|
end,
|
|
1151
1212
|
set = function(self, durationIncreaseOnAutoAttack)
|
|
1152
|
-
self[
|
|
1213
|
+
self[107] = durationIncreaseOnAutoAttack
|
|
1153
1214
|
end
|
|
1154
1215
|
},
|
|
1155
1216
|
true
|
|
@@ -1197,7 +1258,7 @@ __TS__SetDescriptor(
|
|
|
1197
1258
|
Buff.prototype,
|
|
1198
1259
|
"duration",
|
|
1199
1260
|
{get = function(self)
|
|
1200
|
-
return self[
|
|
1261
|
+
return self[103]
|
|
1201
1262
|
end},
|
|
1202
1263
|
true
|
|
1203
1264
|
)
|
|
@@ -1206,15 +1267,15 @@ __TS__SetDescriptor(
|
|
|
1206
1267
|
"remainingDuration",
|
|
1207
1268
|
{
|
|
1208
1269
|
get = function(self)
|
|
1209
|
-
local
|
|
1210
|
-
return
|
|
1270
|
+
local ____opt_59 = self._timer
|
|
1271
|
+
return ____opt_59 and ____opt_59.remaining or 0
|
|
1211
1272
|
end,
|
|
1212
1273
|
set = function(self, remainingDuration)
|
|
1213
|
-
local
|
|
1214
|
-
local
|
|
1215
|
-
local remainingDurationDelta =
|
|
1274
|
+
local ____remainingDuration_63 = remainingDuration
|
|
1275
|
+
local ____opt_61 = self._timer
|
|
1276
|
+
local remainingDurationDelta = ____remainingDuration_63 - (____opt_61 and ____opt_61.remaining or 0)
|
|
1216
1277
|
if remainingDurationDelta ~= 0 then
|
|
1217
|
-
self[
|
|
1278
|
+
self[103] = self[103] + remainingDurationDelta
|
|
1218
1279
|
if remainingDuration <= 0 then
|
|
1219
1280
|
Timer:run(destroyBuff, self)
|
|
1220
1281
|
else
|
|
@@ -1226,7 +1287,8 @@ __TS__SetDescriptor(
|
|
|
1226
1287
|
self._level,
|
|
1227
1288
|
remainingDuration,
|
|
1228
1289
|
self._spellStealPriority,
|
|
1229
|
-
self._learnLevelMinimum
|
|
1290
|
+
self._learnLevelMinimum,
|
|
1291
|
+
self[142]
|
|
1230
1292
|
) then
|
|
1231
1293
|
local timer = self._timer
|
|
1232
1294
|
if timer == nil then
|
|
@@ -1241,10 +1303,37 @@ __TS__SetDescriptor(
|
|
|
1241
1303
|
},
|
|
1242
1304
|
true
|
|
1243
1305
|
)
|
|
1244
|
-
|
|
1306
|
+
__TS__SetDescriptor(
|
|
1307
|
+
Buff.prototype,
|
|
1308
|
+
"abilityCooldownFactor",
|
|
1309
|
+
{
|
|
1310
|
+
get = function(self)
|
|
1311
|
+
return self[143] or 1
|
|
1312
|
+
end,
|
|
1313
|
+
set = function(self, abilityCooldownFactor)
|
|
1314
|
+
local previousAbilityCooldownModifier = self[144]
|
|
1315
|
+
if previousAbilityCooldownModifier then
|
|
1316
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1317
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:removeModifier(ability, previousAbilityCooldownModifier)
|
|
1318
|
+
end
|
|
1319
|
+
end
|
|
1320
|
+
local function modifier(ability, level, cooldown)
|
|
1321
|
+
return cooldown * abilityCooldownFactor
|
|
1322
|
+
end
|
|
1323
|
+
for ____, ability in ipairs(self._unit.abilities) do
|
|
1324
|
+
COOLDOWN_ABILITY_FLOAT_LEVEL_FIELD:applyModifier(ability, modifier)
|
|
1325
|
+
end
|
|
1326
|
+
self[144] = modifier
|
|
1327
|
+
self[143] = abilityCooldownFactor
|
|
1328
|
+
end
|
|
1329
|
+
},
|
|
1330
|
+
true
|
|
1331
|
+
)
|
|
1332
|
+
Buff.createdEvent = buffCreatedEvent
|
|
1333
|
+
Buff.beingDestroyedEvent = buffBeingDestroyedEvent;
|
|
1245
1334
|
(function(self)
|
|
1246
1335
|
local function destroyBuffIfNeeded(buff)
|
|
1247
|
-
if getUnitAbility(buff[
|
|
1336
|
+
if getUnitAbility(buff[101].handle, buff.typeId) ~= buff.handle and buff[100] == 1 then
|
|
1248
1337
|
buff:destroy()
|
|
1249
1338
|
end
|
|
1250
1339
|
end
|
|
@@ -1295,5 +1384,11 @@ Buff.destroyEvent = buffDestroyEvent;
|
|
|
1295
1384
|
____exports.checkBuffs(target)
|
|
1296
1385
|
end
|
|
1297
1386
|
)
|
|
1387
|
+
buffCreatedEvent:addListener(function(buff)
|
|
1388
|
+
UnitBehavior:forAll(buff.unit, "onBuffGained", buff)
|
|
1389
|
+
end)
|
|
1390
|
+
buffBeingDestroyedEvent:addListener(function(buff)
|
|
1391
|
+
UnitBehavior:forAll(buff.unit, "onBuffLost", buff)
|
|
1392
|
+
end)
|
|
1298
1393
|
end)(Buff)
|
|
1299
1394
|
return ____exports
|