warscript 0.0.1-dev.a45bc10 → 0.0.1-dev.a5f2d10
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 +12 -0
- package/attributes.lua +16 -0
- package/binaryreader.d.ts +1 -0
- package/binaryreader.lua +3 -0
- package/core/types/effect.d.ts +13 -3
- package/core/types/effect.lua +116 -17
- package/core/types/frame.d.ts +8 -1
- package/core/types/frame.lua +93 -1
- package/core/types/group.d.ts +0 -1
- package/core/types/handle.d.ts +2 -1
- package/core/types/handle.lua +5 -0
- package/core/types/image.d.ts +0 -1
- package/core/types/missile.d.ts +2 -2
- package/core/types/missile.lua +8 -2
- package/core/types/unit.lua +8 -0
- package/core/util.d.ts +1 -1
- package/core/util.lua +12 -0
- package/decl/index.d.ts +1 -0
- package/engine/ability.d.ts +1 -1
- package/engine/behavior.d.ts +10 -10
- 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/apply-unit-behavior.d.ts +6 -1
- package/engine/behaviour/ability/damage.d.ts +33 -11
- package/engine/behaviour/ability/damage.lua +89 -31
- package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
- package/engine/behaviour/ability/emulate-impact.lua +28 -0
- package/engine/behaviour/ability/heal.d.ts +33 -6
- package/engine/behaviour/ability/heal.lua +89 -10
- package/engine/behaviour/ability/instant-impact.d.ts +2 -2
- package/engine/behaviour/ability/instant-impact.lua +4 -15
- 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/restore-mana.d.ts +15 -0
- package/engine/behaviour/ability/restore-mana.lua +29 -0
- package/engine/behaviour/ability.d.ts +22 -3
- package/engine/behaviour/ability.lua +134 -13
- package/engine/behaviour/unit/stun-immunity.d.ts +0 -1
- package/engine/behaviour/unit.d.ts +8 -2
- package/engine/behaviour/unit.lua +27 -0
- package/engine/buff.d.ts +71 -21
- package/engine/buff.lua +291 -90
- package/engine/game-map.d.ts +7 -0
- package/engine/game-map.lua +32 -0
- package/engine/internal/ability.d.ts +16 -13
- package/engine/internal/ability.lua +80 -76
- package/engine/internal/item/ability.lua +106 -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/object-data/auto-attack-speed-increase.d.ts +1 -1
- package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
- package/engine/internal/object-data/evasion-probability.d.ts +2 -0
- package/engine/internal/object-data/evasion-probability.lua +16 -0
- package/engine/internal/unit/ability.d.ts +10 -1
- package/engine/internal/unit/ability.lua +36 -14
- package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
- package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot.lua +50 -0
- package/engine/internal/unit/bonus.d.ts +11 -8
- package/engine/internal/unit/bonus.lua +23 -1
- package/engine/internal/unit/ignore-events-items.d.ts +2 -0
- package/engine/internal/unit/ignore-events-items.lua +5 -0
- package/engine/internal/unit/item.d.ts +24 -0
- package/engine/internal/unit/item.lua +78 -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+transport.lua +4 -10
- package/engine/internal/unit-missile-launch.lua +25 -6
- package/engine/internal/unit.d.ts +59 -16
- package/engine/internal/unit.lua +373 -132
- package/engine/internal/utility.lua +12 -0
- package/engine/lightning.d.ts +8 -2
- package/engine/lightning.lua +27 -2
- package/engine/local-client.d.ts +7 -2
- package/engine/local-client.lua +82 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +0 -1
- package/engine/object-data/auxiliary/combat-classification.d.ts +0 -2
- package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
- package/engine/object-data/entry/ability-type/blank-configurable.d.ts +0 -1
- package/engine/object-data/entry/ability-type/blank-passive.d.ts +0 -1
- package/engine/object-data/entry/ability-type/channel.d.ts +0 -1
- package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
- package/engine/object-data/entry/ability-type/mine.lua +39 -0
- package/engine/object-data/entry/ability-type/spirit-touch.d.ts +2 -2
- package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
- package/engine/object-data/entry/ability-type.d.ts +0 -1
- package/engine/object-data/entry/ability-type.lua +8 -12
- package/engine/object-data/entry/buff-type/applicable.d.ts +0 -1
- package/engine/object-data/entry/buff-type/blank.d.ts +0 -1
- package/engine/object-data/entry/buff-type.d.ts +0 -1
- package/engine/object-data/entry/destructible-type.d.ts +0 -1
- package/engine/object-data/entry/item-type/blank.d.ts +0 -1
- package/engine/object-data/entry/item-type.d.ts +14 -1
- package/engine/object-data/entry/item-type.lua +91 -0
- package/engine/object-data/entry/lightning-type.d.ts +0 -1
- package/engine/object-data/entry/unit-type.d.ts +42 -2
- package/engine/object-data/entry/unit-type.lua +378 -50
- package/engine/object-data/entry/upgrade/blank.d.ts +0 -1
- package/engine/object-data/entry/upgrade.d.ts +0 -1
- package/engine/object-data/entry.d.ts +2 -3
- 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 -3
- package/engine/object-field.lua +4 -0
- package/engine/random.d.ts +1 -0
- package/engine/random.lua +9 -0
- package/engine/standard/entries/unit-type.d.ts +42 -1
- package/engine/standard/entries/unit-type.lua +42 -1
- package/engine/standard/fields/ability.d.ts +3 -1
- package/engine/standard/fields/ability.lua +3 -1
- package/engine/unit.d.ts +3 -0
- package/engine/unit.lua +12 -2
- package/event.d.ts +2 -3
- package/event.lua +9 -5
- package/index.d.ts +1 -0
- package/index.lua +1 -0
- package/lualib_bundle.lua +146 -42
- package/math/vec2.d.ts +2 -9
- package/math.d.ts +0 -2
- 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/ability.d.ts +0 -1
- package/objutil/buff.d.ts +0 -1
- package/objutil/buff.lua +1 -1
- package/objutil/object.d.ts +0 -1
- package/objutil/unit.d.ts +0 -1
- package/package.json +13 -14
- package/patch-lua.d.ts +0 -0
- package/patch-lua.lua +10 -0
- package/property.d.ts +55 -0
- package/property.lua +374 -0
- package/string.d.ts +30 -0
- package/string.lua +14 -0
- package/util/stream.d.ts +0 -1
- package/utility/arrays.d.ts +11 -5
- package/utility/arrays.lua +34 -3
- package/utility/bit-set.d.ts +0 -2
- package/utility/lazy.d.ts +2 -0
- package/utility/lazy.lua +14 -0
- package/utility/linked-set.d.ts +11 -3
- package/utility/linked-set.lua +5 -2
- package/utility/lua-maps.d.ts +1 -2
- package/utility/lua-sets.d.ts +1 -2
- package/utility/types.d.ts +1 -0
- package/core/mapbounds.d.ts +0 -8
- package/core/mapbounds.lua +0 -12
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,8 @@ local buffParametersKeys = {
|
|
|
94
98
|
armorIncreaseFactor = true,
|
|
95
99
|
attackSpeedIncreaseFactor = true,
|
|
96
100
|
movementSpeedIncreaseFactor = true,
|
|
101
|
+
evasionProbability = true,
|
|
102
|
+
damageFactor = true,
|
|
97
103
|
receivedDamageFactor = true,
|
|
98
104
|
receivedMagicDamageFactor = true,
|
|
99
105
|
durationIncreaseOnAutoAttack = true,
|
|
@@ -107,8 +113,26 @@ local buffParametersKeys = {
|
|
|
107
113
|
disablesAutoAttack = true,
|
|
108
114
|
destroysOnDamage = true,
|
|
109
115
|
maximumAutoAttackCount = true,
|
|
110
|
-
|
|
116
|
+
maximumDamageDealtEventCount = true,
|
|
117
|
+
maximumDamageReceivedEventCount = true,
|
|
118
|
+
uniqueGroup = true,
|
|
119
|
+
damageOnExpiration = true,
|
|
120
|
+
healingOnExpiration = true,
|
|
121
|
+
killsOnExpiration = true,
|
|
122
|
+
explodesOnExpiration = true
|
|
111
123
|
}
|
|
124
|
+
local function resolveEnumValue(ability, level, value)
|
|
125
|
+
if value == nil or type(value) == "number" then
|
|
126
|
+
return value
|
|
127
|
+
end
|
|
128
|
+
if ability == nil then
|
|
129
|
+
error(
|
|
130
|
+
__TS__New(IllegalArgumentException),
|
|
131
|
+
0
|
|
132
|
+
)
|
|
133
|
+
end
|
|
134
|
+
return value:getValue(ability, level or ability.level)
|
|
135
|
+
end
|
|
112
136
|
local function resolveNumberValue(ability, level, value)
|
|
113
137
|
if value == nil or type(value) == "number" then
|
|
114
138
|
return value
|
|
@@ -145,20 +169,33 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
|
|
|
145
169
|
buff[property] = resolvedValue
|
|
146
170
|
end
|
|
147
171
|
end
|
|
148
|
-
local buffBooleanParameters = {
|
|
172
|
+
local buffBooleanParameters = {
|
|
173
|
+
"stuns",
|
|
174
|
+
"ignoresStunImmunity",
|
|
175
|
+
"disablesAutoAttack",
|
|
176
|
+
"providesInvulnerability",
|
|
177
|
+
"killsOnExpiration",
|
|
178
|
+
"explodesOnExpiration"
|
|
179
|
+
}
|
|
149
180
|
local buffNumberParameters = {
|
|
150
181
|
"durationIncreaseOnAutoAttack",
|
|
151
182
|
"attackSpeedIncreaseFactor",
|
|
152
183
|
"movementSpeedIncreaseFactor",
|
|
184
|
+
"evasionProbability",
|
|
153
185
|
"armorIncrease",
|
|
186
|
+
"damageFactor",
|
|
154
187
|
"receivedDamageFactor",
|
|
155
188
|
"maximumAutoAttackCount",
|
|
189
|
+
"maximumDamageDealtEventCount",
|
|
190
|
+
"maximumDamageReceivedEventCount",
|
|
156
191
|
"damageInterval",
|
|
157
192
|
"damagePerInterval",
|
|
158
193
|
"damageOverDuration",
|
|
159
194
|
"healingInterval",
|
|
160
195
|
"healingPerInterval",
|
|
161
|
-
"healingOverDuration"
|
|
196
|
+
"healingOverDuration",
|
|
197
|
+
"damageOnExpiration",
|
|
198
|
+
"healingOnExpiration"
|
|
162
199
|
}
|
|
163
200
|
local unsuccessfulApplicationMarker = {}
|
|
164
201
|
local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
|
|
@@ -207,6 +244,7 @@ local function expireBuff(buff)
|
|
|
207
244
|
end
|
|
208
245
|
end
|
|
209
246
|
Timer:run(destroyBuff, buff)
|
|
247
|
+
buff:onExpiration()
|
|
210
248
|
end
|
|
211
249
|
local function buffDamageIntervalInitialTimerCallback(buff)
|
|
212
250
|
buffDamageIntervalTimerCallback(buff)
|
|
@@ -296,8 +334,6 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
296
334
|
end
|
|
297
335
|
end
|
|
298
336
|
self.typeId = typeId
|
|
299
|
-
self.polarity = polarity
|
|
300
|
-
self.resistanceType = resistanceType
|
|
301
337
|
if not __TS__InstanceOf(ability, Ability) then
|
|
302
338
|
parameters = ability
|
|
303
339
|
ability = nil
|
|
@@ -324,6 +360,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
324
360
|
learnLevelMinimum = learnLevelMinimum or ability:getField(ABILITY_IF_REQUIRED_LEVEL)
|
|
325
361
|
duration = duration or getAbilityDuration(ability, _unit)
|
|
326
362
|
end
|
|
363
|
+
self.polarity = resolveEnumValue(ability, level, polarity)
|
|
364
|
+
self.resistanceType = resolveEnumValue(ability, level, resistanceType)
|
|
327
365
|
local buffByTypeId = buffByTypeIdByUnit[_unit]
|
|
328
366
|
if buffByTypeId == nil then
|
|
329
367
|
buffByTypeId = {}
|
|
@@ -340,8 +378,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
340
378
|
if not internalApplyBuff(
|
|
341
379
|
_unit,
|
|
342
380
|
typeId,
|
|
343
|
-
polarity,
|
|
344
|
-
resistanceType,
|
|
381
|
+
self.polarity,
|
|
382
|
+
self.resistanceType,
|
|
345
383
|
level,
|
|
346
384
|
duration,
|
|
347
385
|
spellStealPriority,
|
|
@@ -450,6 +488,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
|
|
|
450
488
|
timer:start(duration, false, expireBuff, self)
|
|
451
489
|
self._timer = timer
|
|
452
490
|
end
|
|
491
|
+
self:onCreate()
|
|
453
492
|
end
|
|
454
493
|
function Buff.prototype.getUnitBonus(self, bonusType)
|
|
455
494
|
local ____opt_36 = self._bonusIdByBonusType
|
|
@@ -464,26 +503,30 @@ function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
|
|
|
464
503
|
end
|
|
465
504
|
bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
|
|
466
505
|
end
|
|
467
|
-
function Buff.prototype.flashEffect(self,
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
local ____Effect_flash_41 = Effect.flash
|
|
471
|
-
local ____array_39 = __TS__SparseArrayNew(
|
|
472
|
-
self[104],
|
|
473
|
-
isWidgetProvided and widgetOrDuration or self._unit,
|
|
474
|
-
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
475
|
-
)
|
|
476
|
-
local ____isWidgetProvided_38
|
|
477
|
-
if isWidgetProvided then
|
|
478
|
-
____isWidgetProvided_38 = duration
|
|
506
|
+
function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
507
|
+
if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
|
|
508
|
+
Effect:flash(self[104], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
|
|
479
509
|
else
|
|
480
|
-
|
|
510
|
+
local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
|
|
511
|
+
local ____Effect_40 = Effect
|
|
512
|
+
local ____Effect_flash_41 = Effect.flash
|
|
513
|
+
local ____array_39 = __TS__SparseArrayNew(
|
|
514
|
+
self[104],
|
|
515
|
+
isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
|
|
516
|
+
stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
|
|
517
|
+
)
|
|
518
|
+
local ____isWidgetProvided_38
|
|
519
|
+
if isWidgetProvided then
|
|
520
|
+
____isWidgetProvided_38 = yOrParametersOrDuration
|
|
521
|
+
else
|
|
522
|
+
____isWidgetProvided_38 = widgetOrXOrParametersOrDuration
|
|
523
|
+
end
|
|
524
|
+
__TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
|
|
525
|
+
____Effect_flash_41(
|
|
526
|
+
____Effect_40,
|
|
527
|
+
__TS__SparseArraySpread(____array_39)
|
|
528
|
+
)
|
|
481
529
|
end
|
|
482
|
-
__TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
|
|
483
|
-
____Effect_flash_41(
|
|
484
|
-
____Effect_40,
|
|
485
|
-
__TS__SparseArraySpread(____array_39)
|
|
486
|
-
)
|
|
487
530
|
end
|
|
488
531
|
function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
489
532
|
local isWidgetProvided = type(widgetOrDuration) == "table"
|
|
@@ -506,6 +549,8 @@ function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
|
|
|
506
549
|
__TS__SparseArraySpread(____array_43)
|
|
507
550
|
)
|
|
508
551
|
end
|
|
552
|
+
function Buff.prototype.onCreate(self)
|
|
553
|
+
end
|
|
509
554
|
function Buff.prototype.onDestroy(self)
|
|
510
555
|
local unit = self._unit
|
|
511
556
|
if getUnitAbility(unit.handle, self.typeId) == self.handle then
|
|
@@ -530,11 +575,11 @@ function Buff.prototype.onDestroy(self)
|
|
|
530
575
|
behavior:destroy()
|
|
531
576
|
end
|
|
532
577
|
end
|
|
533
|
-
if self[
|
|
578
|
+
if self[136] then
|
|
534
579
|
unit:decrementDisableAutoAttackCounter()
|
|
535
580
|
end
|
|
536
|
-
if self[
|
|
537
|
-
if self[
|
|
581
|
+
if self[134] then
|
|
582
|
+
if self[135] then
|
|
538
583
|
unit:decrementStunCounter()
|
|
539
584
|
end
|
|
540
585
|
unit:decrementStunCounter()
|
|
@@ -583,20 +628,34 @@ function Buff.getByTypeId(self, unit, typeId)
|
|
|
583
628
|
end
|
|
584
629
|
return nil
|
|
585
630
|
end
|
|
586
|
-
function Buff.prototype.
|
|
631
|
+
function Buff.prototype.onExpiration(self)
|
|
587
632
|
local unit = self.unit
|
|
588
633
|
if self[119] ~= nil then
|
|
634
|
+
(self[101] or unit):damageTarget(unit, self[119] or 0)
|
|
635
|
+
end
|
|
636
|
+
if self[120] ~= nil then
|
|
637
|
+
(self[101] or unit):healTarget(unit, self[119] or 0)
|
|
638
|
+
end
|
|
639
|
+
if self[139] then
|
|
640
|
+
unit:explode()
|
|
641
|
+
elseif self[138] then
|
|
642
|
+
unit:kill()
|
|
643
|
+
end
|
|
644
|
+
end
|
|
645
|
+
function Buff.prototype.onDeath(self, source)
|
|
646
|
+
local unit = self.unit
|
|
647
|
+
if self[121] ~= nil then
|
|
589
648
|
damageArea(
|
|
590
649
|
self[101] or unit,
|
|
591
|
-
self[
|
|
650
|
+
self[121],
|
|
592
651
|
unit.x,
|
|
593
652
|
unit.y,
|
|
594
|
-
self[121] or 0,
|
|
595
|
-
self[120] or 0,
|
|
596
653
|
self[123] or 0,
|
|
597
654
|
self[122] or 0,
|
|
598
655
|
self[125] or 0,
|
|
599
|
-
self[124] or 0
|
|
656
|
+
self[124] or 0,
|
|
657
|
+
self[127] or 0,
|
|
658
|
+
self[126] or 0
|
|
600
659
|
)
|
|
601
660
|
end
|
|
602
661
|
end
|
|
@@ -618,9 +677,25 @@ function Buff.prototype.onDamageDealt(self, target, event)
|
|
|
618
677
|
end
|
|
619
678
|
self.remainingDuration = remainingDuration
|
|
620
679
|
end
|
|
621
|
-
local autoAttackCount = (self[
|
|
622
|
-
self[
|
|
623
|
-
if autoAttackCount == self[
|
|
680
|
+
local autoAttackCount = (self[128] or 0) + 1
|
|
681
|
+
self[128] = autoAttackCount
|
|
682
|
+
if autoAttackCount == self[129] then
|
|
683
|
+
self:destroy()
|
|
684
|
+
end
|
|
685
|
+
end
|
|
686
|
+
if event.originalAmount ~= 0 then
|
|
687
|
+
local damageDealtEventCount = (self[130] or 0) + 1
|
|
688
|
+
self[130] = damageDealtEventCount
|
|
689
|
+
if damageDealtEventCount == self[131] then
|
|
690
|
+
self:destroy()
|
|
691
|
+
end
|
|
692
|
+
end
|
|
693
|
+
end
|
|
694
|
+
function Buff.prototype.onDamageReceived(self, source, event)
|
|
695
|
+
if event.originalAmount ~= 0 then
|
|
696
|
+
local damageReceivedEventCount = (self[132] or 0) + 1
|
|
697
|
+
self[132] = damageReceivedEventCount
|
|
698
|
+
if damageReceivedEventCount == self[133] then
|
|
624
699
|
self:destroy()
|
|
625
700
|
end
|
|
626
701
|
end
|
|
@@ -802,6 +877,45 @@ __TS__SetDescriptor(
|
|
|
802
877
|
},
|
|
803
878
|
true
|
|
804
879
|
)
|
|
880
|
+
__TS__SetDescriptor(
|
|
881
|
+
Buff.prototype,
|
|
882
|
+
"damageOnExpiration",
|
|
883
|
+
{
|
|
884
|
+
get = function(self)
|
|
885
|
+
return self[119] or 0
|
|
886
|
+
end,
|
|
887
|
+
set = function(self, damageOnExpiration)
|
|
888
|
+
self[119] = damageOnExpiration ~= 0 and damageOnExpiration or nil
|
|
889
|
+
end
|
|
890
|
+
},
|
|
891
|
+
true
|
|
892
|
+
)
|
|
893
|
+
__TS__SetDescriptor(
|
|
894
|
+
Buff.prototype,
|
|
895
|
+
"healingOnExpiration",
|
|
896
|
+
{
|
|
897
|
+
get = function(self)
|
|
898
|
+
return self[120] or 0
|
|
899
|
+
end,
|
|
900
|
+
set = function(self, healingOnExpiration)
|
|
901
|
+
self[120] = healingOnExpiration ~= 0 and healingOnExpiration or nil
|
|
902
|
+
end
|
|
903
|
+
},
|
|
904
|
+
true
|
|
905
|
+
)
|
|
906
|
+
__TS__SetDescriptor(
|
|
907
|
+
Buff.prototype,
|
|
908
|
+
"damageFactor",
|
|
909
|
+
{
|
|
910
|
+
get = function(self)
|
|
911
|
+
return self:getUnitBonus(UnitBonusType.DAMAGE_FACTOR)
|
|
912
|
+
end,
|
|
913
|
+
set = function(self, damageFactor)
|
|
914
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.DAMAGE_FACTOR, damageFactor)
|
|
915
|
+
end
|
|
916
|
+
},
|
|
917
|
+
true
|
|
918
|
+
)
|
|
805
919
|
__TS__SetDescriptor(
|
|
806
920
|
Buff.prototype,
|
|
807
921
|
"receivedDamageFactor",
|
|
@@ -833,25 +947,25 @@ __TS__SetDescriptor(
|
|
|
833
947
|
"stuns",
|
|
834
948
|
{
|
|
835
949
|
get = function(self)
|
|
836
|
-
local
|
|
837
|
-
if
|
|
838
|
-
|
|
950
|
+
local ____self__134_52 = self[134]
|
|
951
|
+
if ____self__134_52 == nil then
|
|
952
|
+
____self__134_52 = false
|
|
839
953
|
end
|
|
840
|
-
return
|
|
954
|
+
return ____self__134_52
|
|
841
955
|
end,
|
|
842
956
|
set = function(self, stuns)
|
|
843
|
-
if not stuns and self[
|
|
844
|
-
if self[
|
|
957
|
+
if not stuns and self[134] then
|
|
958
|
+
if self[135] then
|
|
845
959
|
self.object:decrementStunCounter()
|
|
846
960
|
end
|
|
847
961
|
self.object:decrementStunCounter()
|
|
848
|
-
self[
|
|
849
|
-
elseif stuns and not self[
|
|
850
|
-
if self[
|
|
962
|
+
self[134] = nil
|
|
963
|
+
elseif stuns and not self[134] then
|
|
964
|
+
if self[135] then
|
|
851
965
|
self.object:incrementStunCounter()
|
|
852
966
|
end
|
|
853
967
|
self.object:incrementStunCounter()
|
|
854
|
-
self[
|
|
968
|
+
self[134] = true
|
|
855
969
|
end
|
|
856
970
|
end
|
|
857
971
|
},
|
|
@@ -862,23 +976,23 @@ __TS__SetDescriptor(
|
|
|
862
976
|
"ignoresStunImmunity",
|
|
863
977
|
{
|
|
864
978
|
get = function(self)
|
|
865
|
-
local
|
|
866
|
-
if
|
|
867
|
-
|
|
979
|
+
local ____self__135_53 = self[135]
|
|
980
|
+
if ____self__135_53 == nil then
|
|
981
|
+
____self__135_53 = false
|
|
868
982
|
end
|
|
869
|
-
return
|
|
983
|
+
return ____self__135_53
|
|
870
984
|
end,
|
|
871
985
|
set = function(self, ignoresStunImmunity)
|
|
872
|
-
if not ignoresStunImmunity and self[
|
|
873
|
-
if self[
|
|
986
|
+
if not ignoresStunImmunity and self[135] then
|
|
987
|
+
if self[134] then
|
|
874
988
|
self.object:decrementStunCounter()
|
|
875
989
|
end
|
|
876
|
-
self[
|
|
877
|
-
elseif ignoresStunImmunity and not self[
|
|
878
|
-
if self[
|
|
990
|
+
self[135] = nil
|
|
991
|
+
elseif ignoresStunImmunity and not self[135] then
|
|
992
|
+
if self[134] then
|
|
879
993
|
self.object:incrementStunCounter()
|
|
880
994
|
end
|
|
881
|
-
self[
|
|
995
|
+
self[135] = true
|
|
882
996
|
end
|
|
883
997
|
end
|
|
884
998
|
},
|
|
@@ -889,19 +1003,19 @@ __TS__SetDescriptor(
|
|
|
889
1003
|
"disablesAutoAttack",
|
|
890
1004
|
{
|
|
891
1005
|
get = function(self)
|
|
892
|
-
local
|
|
893
|
-
if
|
|
894
|
-
|
|
1006
|
+
local ____self__136_54 = self[136]
|
|
1007
|
+
if ____self__136_54 == nil then
|
|
1008
|
+
____self__136_54 = false
|
|
895
1009
|
end
|
|
896
|
-
return
|
|
1010
|
+
return ____self__136_54
|
|
897
1011
|
end,
|
|
898
1012
|
set = function(self, disablesAutoAttack)
|
|
899
|
-
if not disablesAutoAttack and self[
|
|
1013
|
+
if not disablesAutoAttack and self[136] then
|
|
900
1014
|
self.object:decrementDisableAutoAttackCounter()
|
|
901
|
-
self[
|
|
902
|
-
elseif disablesAutoAttack and not self[
|
|
1015
|
+
self[136] = nil
|
|
1016
|
+
elseif disablesAutoAttack and not self[136] then
|
|
903
1017
|
self.object:incrementDisableAutoAttackCounter()
|
|
904
|
-
self[
|
|
1018
|
+
self[136] = true
|
|
905
1019
|
end
|
|
906
1020
|
end
|
|
907
1021
|
},
|
|
@@ -912,19 +1026,95 @@ __TS__SetDescriptor(
|
|
|
912
1026
|
"providesInvulnerability",
|
|
913
1027
|
{
|
|
914
1028
|
get = function(self)
|
|
915
|
-
local
|
|
916
|
-
if
|
|
917
|
-
|
|
1029
|
+
local ____self__137_55 = self[137]
|
|
1030
|
+
if ____self__137_55 == nil then
|
|
1031
|
+
____self__137_55 = false
|
|
918
1032
|
end
|
|
919
|
-
return
|
|
1033
|
+
return ____self__137_55
|
|
920
1034
|
end,
|
|
921
1035
|
set = function(self, providesInvulnerability)
|
|
922
|
-
if not providesInvulnerability and self[
|
|
1036
|
+
if not providesInvulnerability and self[137] then
|
|
923
1037
|
self.object:decrementInvulnerabilityCounter()
|
|
924
|
-
self[
|
|
925
|
-
elseif providesInvulnerability and not self[
|
|
1038
|
+
self[137] = nil
|
|
1039
|
+
elseif providesInvulnerability and not self[137] then
|
|
926
1040
|
self.object:incrementInvulnerabilityCounter()
|
|
927
|
-
self[
|
|
1041
|
+
self[137] = true
|
|
1042
|
+
end
|
|
1043
|
+
end
|
|
1044
|
+
},
|
|
1045
|
+
true
|
|
1046
|
+
)
|
|
1047
|
+
__TS__SetDescriptor(
|
|
1048
|
+
Buff.prototype,
|
|
1049
|
+
"killsOnExpiration",
|
|
1050
|
+
{
|
|
1051
|
+
get = function(self)
|
|
1052
|
+
local ____self__138_56 = self[138]
|
|
1053
|
+
if ____self__138_56 == nil then
|
|
1054
|
+
____self__138_56 = false
|
|
1055
|
+
end
|
|
1056
|
+
return ____self__138_56
|
|
1057
|
+
end,
|
|
1058
|
+
set = function(self, killsOnExpiration)
|
|
1059
|
+
if not killsOnExpiration and self[138] then
|
|
1060
|
+
self[138] = nil
|
|
1061
|
+
elseif killsOnExpiration and not self[138] then
|
|
1062
|
+
self[138] = true
|
|
1063
|
+
end
|
|
1064
|
+
end
|
|
1065
|
+
},
|
|
1066
|
+
true
|
|
1067
|
+
)
|
|
1068
|
+
__TS__SetDescriptor(
|
|
1069
|
+
Buff.prototype,
|
|
1070
|
+
"explodesOnExpiration",
|
|
1071
|
+
{
|
|
1072
|
+
get = function(self)
|
|
1073
|
+
local ____self__139_57 = self[139]
|
|
1074
|
+
if ____self__139_57 == nil then
|
|
1075
|
+
____self__139_57 = false
|
|
1076
|
+
end
|
|
1077
|
+
return ____self__139_57
|
|
1078
|
+
end,
|
|
1079
|
+
set = function(self, killsOnExpiration)
|
|
1080
|
+
if not killsOnExpiration and self[139] then
|
|
1081
|
+
self[139] = nil
|
|
1082
|
+
elseif killsOnExpiration and not self[139] then
|
|
1083
|
+
self[139] = true
|
|
1084
|
+
end
|
|
1085
|
+
end
|
|
1086
|
+
},
|
|
1087
|
+
true
|
|
1088
|
+
)
|
|
1089
|
+
__TS__SetDescriptor(
|
|
1090
|
+
Buff.prototype,
|
|
1091
|
+
"maximumDamageDealtEventCount",
|
|
1092
|
+
{
|
|
1093
|
+
get = function(self)
|
|
1094
|
+
return self[131] or 0
|
|
1095
|
+
end,
|
|
1096
|
+
set = function(self, maximumDamageDealtEventCount)
|
|
1097
|
+
if maximumDamageDealtEventCount == 0 then
|
|
1098
|
+
self[131] = nil
|
|
1099
|
+
else
|
|
1100
|
+
self[131] = maximumDamageDealtEventCount
|
|
1101
|
+
end
|
|
1102
|
+
end
|
|
1103
|
+
},
|
|
1104
|
+
true
|
|
1105
|
+
)
|
|
1106
|
+
__TS__SetDescriptor(
|
|
1107
|
+
Buff.prototype,
|
|
1108
|
+
"maximumDamageReceivedEventCount",
|
|
1109
|
+
{
|
|
1110
|
+
get = function(self)
|
|
1111
|
+
return self[133] or 0
|
|
1112
|
+
end,
|
|
1113
|
+
set = function(self, maximumDamageReceivedEventCount)
|
|
1114
|
+
if maximumDamageReceivedEventCount == 0 then
|
|
1115
|
+
self[133] = nil
|
|
1116
|
+
else
|
|
1117
|
+
self[133] = maximumDamageReceivedEventCount
|
|
928
1118
|
end
|
|
929
1119
|
end
|
|
930
1120
|
},
|
|
@@ -935,13 +1125,13 @@ __TS__SetDescriptor(
|
|
|
935
1125
|
"maximumAutoAttackCount",
|
|
936
1126
|
{
|
|
937
1127
|
get = function(self)
|
|
938
|
-
return self[
|
|
1128
|
+
return self[129] or 0
|
|
939
1129
|
end,
|
|
940
1130
|
set = function(self, maximumAutoAttackCount)
|
|
941
1131
|
if maximumAutoAttackCount == 0 then
|
|
942
|
-
self[
|
|
1132
|
+
self[129] = nil
|
|
943
1133
|
else
|
|
944
|
-
self[
|
|
1134
|
+
self[129] = maximumAutoAttackCount
|
|
945
1135
|
end
|
|
946
1136
|
end
|
|
947
1137
|
},
|
|
@@ -986,6 +1176,19 @@ __TS__SetDescriptor(
|
|
|
986
1176
|
},
|
|
987
1177
|
true
|
|
988
1178
|
)
|
|
1179
|
+
__TS__SetDescriptor(
|
|
1180
|
+
Buff.prototype,
|
|
1181
|
+
"evasionProbability",
|
|
1182
|
+
{
|
|
1183
|
+
get = function(self)
|
|
1184
|
+
return self:getUnitBonus(UnitBonusType.EVASION_PROBABILITY)
|
|
1185
|
+
end,
|
|
1186
|
+
set = function(self, evasionProbability)
|
|
1187
|
+
self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.EVASION_PROBABILITY, evasionProbability)
|
|
1188
|
+
end
|
|
1189
|
+
},
|
|
1190
|
+
true
|
|
1191
|
+
)
|
|
989
1192
|
__TS__SetDescriptor(
|
|
990
1193
|
Buff.prototype,
|
|
991
1194
|
"duration",
|
|
@@ -999,13 +1202,13 @@ __TS__SetDescriptor(
|
|
|
999
1202
|
"remainingDuration",
|
|
1000
1203
|
{
|
|
1001
1204
|
get = function(self)
|
|
1002
|
-
local
|
|
1003
|
-
return
|
|
1205
|
+
local ____opt_58 = self._timer
|
|
1206
|
+
return ____opt_58 and ____opt_58.remaining or 0
|
|
1004
1207
|
end,
|
|
1005
1208
|
set = function(self, remainingDuration)
|
|
1006
|
-
local
|
|
1007
|
-
local
|
|
1008
|
-
local remainingDurationDelta =
|
|
1209
|
+
local ____remainingDuration_62 = remainingDuration
|
|
1210
|
+
local ____opt_60 = self._timer
|
|
1211
|
+
local remainingDurationDelta = ____remainingDuration_62 - (____opt_60 and ____opt_60.remaining or 0)
|
|
1009
1212
|
if remainingDurationDelta ~= 0 then
|
|
1010
1213
|
self[102] = self[102] + remainingDurationDelta
|
|
1011
1214
|
if remainingDuration <= 0 then
|
|
@@ -1035,24 +1238,22 @@ __TS__SetDescriptor(
|
|
|
1035
1238
|
true
|
|
1036
1239
|
);
|
|
1037
1240
|
(function(self)
|
|
1241
|
+
local function destroyBuffIfNeeded(buff)
|
|
1242
|
+
if getUnitAbility(buff[100].handle, buff.typeId) ~= buff.handle then
|
|
1243
|
+
buff:destroy()
|
|
1244
|
+
end
|
|
1245
|
+
end
|
|
1038
1246
|
____exports.checkBuff = function(unit, buffTypeId)
|
|
1039
1247
|
local buffByTypeId = buffByTypeIdByUnit[unit]
|
|
1040
1248
|
if buffByTypeId ~= nil then
|
|
1041
1249
|
local buff = buffByTypeId[buffTypeId]
|
|
1042
|
-
if buff ~= nil
|
|
1043
|
-
buff
|
|
1250
|
+
if buff ~= nil then
|
|
1251
|
+
destroyBuffIfNeeded(buff)
|
|
1044
1252
|
end
|
|
1045
1253
|
end
|
|
1046
1254
|
end
|
|
1047
1255
|
____exports.checkBuffs = function(unit)
|
|
1048
|
-
|
|
1049
|
-
if buffByTypeId ~= nil then
|
|
1050
|
-
for ____, buff in pairs(buffByTypeId) do
|
|
1051
|
-
if getUnitAbility(unit.handle, buff.typeId) ~= buff.handle then
|
|
1052
|
-
buff:destroy()
|
|
1053
|
-
end
|
|
1054
|
-
end
|
|
1055
|
-
end
|
|
1256
|
+
____exports.Buff:forAll(unit, destroyBuffIfNeeded)
|
|
1056
1257
|
end
|
|
1057
1258
|
Unit.abilityChannelingStartEvent:addListener(
|
|
1058
1259
|
0,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local ____rect = require("core.types.rect")
|
|
6
|
+
local Rect = ____rect.Rect
|
|
7
|
+
local ____region = require("core.types.region")
|
|
8
|
+
local Region = ____region.Region
|
|
9
|
+
____exports.GameMap = __TS__Class()
|
|
10
|
+
local GameMap = ____exports.GameMap
|
|
11
|
+
GameMap.name = "GameMap"
|
|
12
|
+
function GameMap.prototype.____constructor(self)
|
|
13
|
+
end
|
|
14
|
+
__TS__ObjectDefineProperty(
|
|
15
|
+
GameMap,
|
|
16
|
+
"worldBoundsRect",
|
|
17
|
+
{get = function(self)
|
|
18
|
+
local rect = Rect:of(GetWorldBounds())
|
|
19
|
+
rawset(self, "worldBoundsRect", rect)
|
|
20
|
+
return rect
|
|
21
|
+
end}
|
|
22
|
+
)
|
|
23
|
+
__TS__ObjectDefineProperty(
|
|
24
|
+
GameMap,
|
|
25
|
+
"worldBoundsRegion",
|
|
26
|
+
{get = function(self)
|
|
27
|
+
local region = Region:create(self.worldBoundsRect)
|
|
28
|
+
rawset(self, "worldBoundsRegion", region)
|
|
29
|
+
return region
|
|
30
|
+
end}
|
|
31
|
+
)
|
|
32
|
+
return ____exports
|