warscript 0.0.1-dev.a5f2d10 → 0.0.1-dev.a9a8ba4
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 +5 -0
- package/attributes.lua +8 -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/sound.d.ts +17 -24
- package/core/types/sound.lua +99 -24
- package/core/types/timer.d.ts +7 -8
- package/core/types/timer.lua +18 -21
- package/core/util.lua +6 -1
- package/decl/native.d.ts +840 -786
- package/engine/behaviour/ability/apply-buff.d.ts +5 -0
- package/engine/behaviour/ability/apply-buff.lua +32 -0
- 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.lua +16 -2
- package/engine/behaviour/ability.d.ts +5 -1
- package/engine/behaviour/ability.lua +26 -21
- package/engine/behaviour/unit/stun-immunity.d.ts +5 -3
- package/engine/behaviour/unit/stun-immunity.lua +43 -27
- package/engine/behaviour/unit.d.ts +28 -0
- package/engine/behaviour/unit.lua +160 -4
- package/engine/buff.d.ts +54 -41
- package/engine/buff.lua +286 -228
- package/engine/internal/ability.d.ts +4 -0
- package/engine/internal/ability.lua +17 -0
- package/engine/internal/item/ability.lua +62 -11
- package/engine/internal/item.d.ts +7 -4
- package/engine/internal/item.lua +131 -28
- 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/unit/ability.d.ts +35 -0
- package/engine/internal/unit/ability.lua +62 -0
- package/engine/internal/unit/add-item-to-slot.lua +4 -2
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- 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 +1 -1
- package/engine/internal/unit.d.ts +28 -5
- package/engine/internal/unit.lua +243 -74
- package/engine/lightning.d.ts +4 -3
- package/engine/lightning.lua +21 -12
- 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/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 +81 -21
- 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 +10 -3
- package/engine/object-data/entry/unit-type.lua +155 -92
- 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 +1 -1
- package/engine/object-field/unit.d.ts +50 -3
- package/engine/object-field/unit.lua +186 -7
- package/engine/object-field.d.ts +15 -4
- package/engine/object-field.lua +184 -90
- 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/unit.d.ts +3 -0
- package/engine/standard/fields/unit.lua +5 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +175 -10
- package/engine/unit.d.ts +1 -0
- package/engine/unit.lua +1 -0
- package/objutil/buff.lua +1 -2
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +3 -0
- package/utility/functions.d.ts +1 -0
- package/utility/functions.lua +1 -0
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +3 -0
- package/utility/lua-maps.d.ts +4 -0
- package/utility/lua-maps.lua +20 -0
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +3 -0
- package/utility/reflection.lua +11 -7
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
3
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
5
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
6
|
local ____exports = {}
|
|
6
7
|
local ____behavior = require("engine.behavior")
|
|
@@ -9,6 +10,17 @@ local ____unit = require("engine.internal.unit")
|
|
|
9
10
|
local Unit = ____unit.Unit
|
|
10
11
|
require("engine.internal.unit+ability")
|
|
11
12
|
require("engine.internal.unit-missile-launch")
|
|
13
|
+
local ____linked_2Dset = require("utility.linked-set")
|
|
14
|
+
local LinkedSet = ____linked_2Dset.LinkedSet
|
|
15
|
+
local ____lua_2Dmaps = require("utility.lua-maps")
|
|
16
|
+
local getOrPut = ____lua_2Dmaps.getOrPut
|
|
17
|
+
local mutableLuaMap = ____lua_2Dmaps.mutableLuaMap
|
|
18
|
+
local ____lua_2Dsets = require("utility.lua-sets")
|
|
19
|
+
local mutableLuaSet = ____lua_2Dsets.mutableLuaSet
|
|
20
|
+
local behaviorsByEvent = {}
|
|
21
|
+
local rangeByBehaviorByEvent = {}
|
|
22
|
+
local listenerByBehaviorByEvent = {}
|
|
23
|
+
local eventsByBehavior = {}
|
|
12
24
|
____exports.UnitBehavior = __TS__Class()
|
|
13
25
|
local UnitBehavior = ____exports.UnitBehavior
|
|
14
26
|
UnitBehavior.name = "UnitBehavior"
|
|
@@ -16,10 +28,66 @@ __TS__ClassExtends(UnitBehavior, Behavior)
|
|
|
16
28
|
function UnitBehavior.prototype.____constructor(self, unit)
|
|
17
29
|
Behavior.prototype.____constructor(self, unit)
|
|
18
30
|
end
|
|
31
|
+
function UnitBehavior.prototype.onDestroy(self)
|
|
32
|
+
local events = eventsByBehavior[self]
|
|
33
|
+
if events ~= nil then
|
|
34
|
+
for event in pairs(events) do
|
|
35
|
+
local ____opt_0 = behaviorsByEvent[event]
|
|
36
|
+
if ____opt_0 ~= nil then
|
|
37
|
+
____opt_0:remove(self)
|
|
38
|
+
end
|
|
39
|
+
local ____opt_2 = rangeByBehaviorByEvent[event]
|
|
40
|
+
if ____opt_2 ~= nil then
|
|
41
|
+
____opt_2[self] = nil
|
|
42
|
+
end
|
|
43
|
+
local ____opt_4 = listenerByBehaviorByEvent[event]
|
|
44
|
+
if ____opt_4 ~= nil then
|
|
45
|
+
____opt_4[self] = nil
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
eventsByBehavior[self] = nil
|
|
49
|
+
end
|
|
50
|
+
return Behavior.prototype.onDestroy(self)
|
|
51
|
+
end
|
|
52
|
+
function UnitBehavior.prototype.registerInRangeUnitEvent(self, event, range, listener)
|
|
53
|
+
local rangeByBehavior = getOrPut(rangeByBehaviorByEvent, event, mutableLuaMap)
|
|
54
|
+
rangeByBehavior[self] = range
|
|
55
|
+
local listenerByBehavior = getOrPut(listenerByBehaviorByEvent, event, mutableLuaMap)
|
|
56
|
+
listenerByBehavior[self] = listener
|
|
57
|
+
getOrPut(eventsByBehavior, self, mutableLuaSet)[event] = true
|
|
58
|
+
local behaviors = behaviorsByEvent[event]
|
|
59
|
+
if behaviors == nil then
|
|
60
|
+
event:addListener(function(unit, ...)
|
|
61
|
+
local behaviors = behaviorsByEvent[event]
|
|
62
|
+
if behaviors ~= nil then
|
|
63
|
+
for behavior in pairs(behaviors) do
|
|
64
|
+
local range = rangeByBehavior[behavior]
|
|
65
|
+
if range ~= nil and unit:getCollisionDistanceTo(behavior.unit) <= range then
|
|
66
|
+
local ____self_6 = behavior
|
|
67
|
+
____self_6[listenerByBehavior[behavior]](____self_6, unit, ...)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end)
|
|
72
|
+
behaviors = __TS__New(LinkedSet)
|
|
73
|
+
behaviorsByEvent[event] = behaviors
|
|
74
|
+
end
|
|
75
|
+
behaviors:add(self)
|
|
76
|
+
end
|
|
77
|
+
function UnitBehavior.prototype.onImmediateOrder(self, orderId)
|
|
78
|
+
end
|
|
79
|
+
function UnitBehavior.prototype.onTargetOrder(self, orderId, target)
|
|
80
|
+
end
|
|
81
|
+
function UnitBehavior.prototype.onPointOrder(self, orderId, x, y)
|
|
82
|
+
end
|
|
19
83
|
function UnitBehavior.prototype.onAutoAttackStart(self, target)
|
|
20
84
|
end
|
|
21
85
|
function UnitBehavior.prototype.onAutoAttackFinish(self, target)
|
|
22
86
|
end
|
|
87
|
+
function UnitBehavior.prototype.onTargetingAutoAttackStart(self, source)
|
|
88
|
+
end
|
|
89
|
+
function UnitBehavior.prototype.onTargetingAutoAttackFinish(self, source)
|
|
90
|
+
end
|
|
23
91
|
function UnitBehavior.prototype.onDamageDealing(self, target, event)
|
|
24
92
|
end
|
|
25
93
|
function UnitBehavior.prototype.onDamageDealt(self, target, event)
|
|
@@ -32,6 +100,32 @@ function UnitBehavior.prototype.onAbilityGained(self, ability)
|
|
|
32
100
|
end
|
|
33
101
|
function UnitBehavior.prototype.onAbilityLost(self, ability)
|
|
34
102
|
end
|
|
103
|
+
function UnitBehavior.prototype.onAbilityChannelingStart(self, ability)
|
|
104
|
+
end
|
|
105
|
+
function UnitBehavior.prototype.onAbilityImpact(self, ability)
|
|
106
|
+
end
|
|
107
|
+
function UnitBehavior.prototype.onAbilityWidgetTargetImpact(self, ability, target)
|
|
108
|
+
end
|
|
109
|
+
function UnitBehavior.prototype.onAbilityUnitTargetImpact(self, ability, target)
|
|
110
|
+
end
|
|
111
|
+
function UnitBehavior.prototype.onAbilityItemTargetImpact(self, ability, target)
|
|
112
|
+
end
|
|
113
|
+
function UnitBehavior.prototype.onAbilityDestructibleTargetImpact(self, ability, target)
|
|
114
|
+
end
|
|
115
|
+
function UnitBehavior.prototype.onAbilityPointTargetImpact(self, ability, x, y)
|
|
116
|
+
end
|
|
117
|
+
function UnitBehavior.prototype.onAbilityNoTargetImpact(self, ability)
|
|
118
|
+
end
|
|
119
|
+
function UnitBehavior.prototype.onAbilityChannelingFinish(self, ability)
|
|
120
|
+
end
|
|
121
|
+
function UnitBehavior.prototype.onAbilityStop(self, ability)
|
|
122
|
+
end
|
|
123
|
+
function UnitBehavior.prototype.onTargetingAbilityChannelingStart(self, ability, source)
|
|
124
|
+
end
|
|
125
|
+
function UnitBehavior.prototype.onTargetingAbilityImpact(self, ability, source)
|
|
126
|
+
end
|
|
127
|
+
function UnitBehavior.prototype.onBuffGained(self, buff)
|
|
128
|
+
end
|
|
35
129
|
function UnitBehavior.prototype.onItemDropped(self, item)
|
|
36
130
|
end
|
|
37
131
|
function UnitBehavior.prototype.onItemPickedUp(self, item)
|
|
@@ -40,6 +134,8 @@ function UnitBehavior.prototype.onItemUsed(self, item)
|
|
|
40
134
|
end
|
|
41
135
|
function UnitBehavior.prototype.onItemStacked(self, item)
|
|
42
136
|
end
|
|
137
|
+
function UnitBehavior.prototype.onItemChargesChanged(self, item)
|
|
138
|
+
end
|
|
43
139
|
function UnitBehavior.prototype.onKill(self, target)
|
|
44
140
|
end
|
|
45
141
|
function UnitBehavior.prototype.onDeath(self, source)
|
|
@@ -53,11 +149,28 @@ __TS__SetDescriptor(
|
|
|
53
149
|
true
|
|
54
150
|
);
|
|
55
151
|
(function(self)
|
|
152
|
+
Unit.onImmediateOrder:addListener(function(source, orderId)
|
|
153
|
+
____exports.UnitBehavior:forAll(source, "onImmediateOrder", orderId)
|
|
154
|
+
end)
|
|
155
|
+
Unit.onTargetOrder:addListener(function(source, orderId, target)
|
|
156
|
+
____exports.UnitBehavior:forAll(source, "onTargetOrder", orderId, target)
|
|
157
|
+
end)
|
|
158
|
+
Unit.onPointOrder:addListener(function(source, orderId, x, y)
|
|
159
|
+
____exports.UnitBehavior:forAll(
|
|
160
|
+
source,
|
|
161
|
+
"onPointOrder",
|
|
162
|
+
orderId,
|
|
163
|
+
x,
|
|
164
|
+
y
|
|
165
|
+
)
|
|
166
|
+
end)
|
|
56
167
|
Unit.autoAttackStartEvent:addListener(function(source, target)
|
|
57
168
|
____exports.UnitBehavior:forAll(source, "onAutoAttackStart", target)
|
|
169
|
+
____exports.UnitBehavior:forAll(target, "onTargetingAutoAttackStart", source)
|
|
58
170
|
end)
|
|
59
171
|
Unit.autoAttackFinishEvent:addListener(function(source, target)
|
|
60
172
|
____exports.UnitBehavior:forAll(source, "onAutoAttackFinish", target)
|
|
173
|
+
____exports.UnitBehavior:forAll(target, "onTargetingAutoAttackFinish", source)
|
|
61
174
|
end)
|
|
62
175
|
Unit.onDamaging:addListener(function(source, target, event)
|
|
63
176
|
if source ~= nil then
|
|
@@ -71,11 +184,51 @@ __TS__SetDescriptor(
|
|
|
71
184
|
end
|
|
72
185
|
____exports.UnitBehavior:forAll(target, "onDamageReceived", source, event)
|
|
73
186
|
end)
|
|
74
|
-
Unit.abilityGainedEvent:addListener(function(source,
|
|
75
|
-
____exports.UnitBehavior:forAll(source, "onAbilityGained",
|
|
187
|
+
Unit.abilityGainedEvent:addListener(function(source, ability)
|
|
188
|
+
____exports.UnitBehavior:forAll(source, "onAbilityGained", ability)
|
|
189
|
+
end)
|
|
190
|
+
Unit.abilityLostEvent:addListener(function(source, ability)
|
|
191
|
+
____exports.UnitBehavior:forAll(source, "onAbilityLost", ability)
|
|
192
|
+
end)
|
|
193
|
+
Unit.abilityChannelingStartEvent:addListener(function(source, ability)
|
|
194
|
+
____exports.UnitBehavior:forAll(source, "onAbilityChannelingStart", ability)
|
|
195
|
+
end)
|
|
196
|
+
Unit.abilityUnitTargetChannelingStartEvent:addListener(function(source, ability, target)
|
|
197
|
+
____exports.UnitBehavior:forAll(target, "onTargetingAbilityChannelingStart", ability, source)
|
|
76
198
|
end)
|
|
77
|
-
Unit.
|
|
78
|
-
____exports.UnitBehavior:forAll(source, "
|
|
199
|
+
Unit.abilityImpactEvent:addListener(function(source, ability)
|
|
200
|
+
____exports.UnitBehavior:forAll(source, "onAbilityImpact", ability)
|
|
201
|
+
end)
|
|
202
|
+
Unit.abilityWidgetTargetImpactEvent:addListener(function(source, ability, target)
|
|
203
|
+
____exports.UnitBehavior:forAll(source, "onAbilityWidgetTargetImpact", ability, target)
|
|
204
|
+
end)
|
|
205
|
+
Unit.abilityUnitTargetImpactEvent:addListener(function(source, ability, target)
|
|
206
|
+
____exports.UnitBehavior:forAll(source, "onAbilityUnitTargetImpact", ability, target)
|
|
207
|
+
____exports.UnitBehavior:forAll(target, "onTargetingAbilityImpact", ability, source)
|
|
208
|
+
end)
|
|
209
|
+
Unit.abilityItemTargetImpactEvent:addListener(function(source, ability, target)
|
|
210
|
+
____exports.UnitBehavior:forAll(source, "onAbilityItemTargetImpact", ability, target)
|
|
211
|
+
end)
|
|
212
|
+
Unit.abilityDestructibleTargetImpactEvent:addListener(function(source, ability, target)
|
|
213
|
+
____exports.UnitBehavior:forAll(source, "onAbilityDestructibleTargetImpact", ability, target)
|
|
214
|
+
end)
|
|
215
|
+
Unit.abilityPointTargetImpactEvent:addListener(function(source, ability, x, y)
|
|
216
|
+
____exports.UnitBehavior:forAll(
|
|
217
|
+
source,
|
|
218
|
+
"onAbilityPointTargetImpact",
|
|
219
|
+
ability,
|
|
220
|
+
x,
|
|
221
|
+
y
|
|
222
|
+
)
|
|
223
|
+
end)
|
|
224
|
+
Unit.abilityNoTargetImpactEvent:addListener(function(source, ability)
|
|
225
|
+
____exports.UnitBehavior:forAll(source, "onAbilityNoTargetImpact", ability)
|
|
226
|
+
end)
|
|
227
|
+
Unit.abilityChannelingFinishEvent:addListener(function(source, ability)
|
|
228
|
+
____exports.UnitBehavior:forAll(source, "onAbilityChannelingFinish", ability)
|
|
229
|
+
end)
|
|
230
|
+
Unit.abilityStopEvent:addListener(function(source, ability)
|
|
231
|
+
____exports.UnitBehavior:forAll(source, "onAbilityStop", ability)
|
|
79
232
|
end)
|
|
80
233
|
Unit.deathEvent:addListener(function(target, source)
|
|
81
234
|
if source ~= nil then
|
|
@@ -95,6 +248,9 @@ __TS__SetDescriptor(
|
|
|
95
248
|
Unit.itemStackedEvent:addListener(function(unit, item)
|
|
96
249
|
____exports.UnitBehavior:forAll(unit, "onItemStacked", item)
|
|
97
250
|
end)
|
|
251
|
+
Unit.itemChargesChangedEvent:addListener(function(unit, item)
|
|
252
|
+
____exports.UnitBehavior:forAll(unit, "onItemChargesChanged", item)
|
|
253
|
+
end)
|
|
98
254
|
end)(UnitBehavior)
|
|
99
255
|
Unit.destroyEvent:addListener(function(unit)
|
|
100
256
|
____exports.UnitBehavior:forAll(unit, "destroy")
|
package/engine/buff.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { EffectParameters } from "../core/types/effect";
|
|
|
12
12
|
import { UnitBehavior } from "./behaviour/unit";
|
|
13
13
|
import type { Widget } from "../core/types/widget";
|
|
14
14
|
import { Destructor } from "../destroyable";
|
|
15
|
+
import { Event } from "../event";
|
|
15
16
|
export type BuffConstructor<T extends Buff<any> = Buff<any>, Args extends any[] = any> = OmitConstructor<typeof Buff<any>> & (new (...args: Args) => T);
|
|
16
17
|
type EnumParameterValueType<T extends number> = T | AbilityEnumLevelField<T>;
|
|
17
18
|
type NumberParameterValueType = number | AbilityNumberField | AbilityNumberLevelField;
|
|
@@ -56,12 +57,14 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
|
|
|
56
57
|
attackSpeedIncreaseFactor?: NumberParameterValueType;
|
|
57
58
|
movementSpeedIncreaseFactor?: NumberParameterValueType;
|
|
58
59
|
evasionProbability?: NumberParameterValueType;
|
|
60
|
+
missProbability?: NumberParameterValueType;
|
|
59
61
|
damageFactor?: NumberParameterValueType;
|
|
60
62
|
receivedDamageFactor?: NumberParameterValueType;
|
|
61
63
|
receivedMagicDamageFactor?: NumberParameterValueType;
|
|
62
64
|
durationIncreaseOnAutoAttack?: NumberParameterValueType;
|
|
63
65
|
maximumRemainingDuration?: NumberParameterValueType;
|
|
64
66
|
maximumDuration?: NumberParameterValueType;
|
|
67
|
+
turnsIntoGhost?: BooleanParameterValueType;
|
|
65
68
|
stuns?: BooleanParameterValueType;
|
|
66
69
|
ignoresStunImmunity?: BooleanParameterValueType;
|
|
67
70
|
providesStunImmunity?: BooleanParameterValueType;
|
|
@@ -79,46 +82,49 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
|
|
|
79
82
|
uniqueGroup?: BuffUniqueGroup;
|
|
80
83
|
} : BuffParameters & (T extends Buff<infer AdditionalParameters> ? AdditionalParameters : object);
|
|
81
84
|
declare const enum BuffPropertyKey {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
85
|
+
STATE = 100,
|
|
86
|
+
UNIT = 101,
|
|
87
|
+
SOURCE = 102,
|
|
88
|
+
DURATION = 103,
|
|
89
|
+
UNIQUE_GROUP = 104,
|
|
90
|
+
EFFECT_MODEL_PATH = 105,
|
|
91
|
+
SPECIAL_EFFECT_MODEL_PATH = 106,
|
|
92
|
+
DURATION_INCREASE_ON_AUTO_ATTACK = 107,
|
|
93
|
+
MAXIMUM_DURATION = 108,
|
|
94
|
+
MAXIMUM_REMAINING_DURATION = 109,
|
|
95
|
+
DAMAGE_OVER_DURATION = 110,
|
|
96
|
+
DAMAGE_PER_INTERVAL = 111,
|
|
97
|
+
DAMAGE_INTERVAL = 112,
|
|
98
|
+
REMAINING_DAMAGE_OVER_DURATION = 113,
|
|
99
|
+
DAMAGE_INTERVAL_TIMER = 114,
|
|
100
|
+
HEALING_OVER_DURATION = 115,
|
|
101
|
+
HEALING_PER_INTERVAL = 116,
|
|
102
|
+
HEALING_INTERVAL = 117,
|
|
103
|
+
REMAINING_HEALING_OVER_DURATION = 118,
|
|
104
|
+
HEALING_INTERVAL_TIMER = 119,
|
|
105
|
+
DAMAGE_ON_EXPIRATION = 120,
|
|
106
|
+
HEALING_ON_EXPIRATION = 121,
|
|
107
|
+
DAMAGE_UPON_DEATH_ALLOWED_TARGET_CLASSIFICATIONS = 122,
|
|
108
|
+
DAMAGE_UPON_DEATH = 123,
|
|
109
|
+
DAMAGE_UPON_DEATH_RANGE = 124,
|
|
110
|
+
MEDIUM_DAMAGE_UPON_DEATH = 125,
|
|
111
|
+
MEDIUM_DAMAGE_UPON_DEATH_RANGE = 126,
|
|
112
|
+
SMALL_DAMAGE_UPON_DEATH = 127,
|
|
113
|
+
SMALL_DAMAGE_UPON_DEATH_RANGE = 128,
|
|
114
|
+
AUTO_ATTACK_COUNT = 129,
|
|
115
|
+
MAXIMUM_AUTO_ATTACK_COUNT = 130,
|
|
116
|
+
DAMAGE_DEALT_EVENT_COUNT = 131,
|
|
117
|
+
MAXIMUM_DAMAGE_DEALT_EVENT_COUNT = 132,
|
|
118
|
+
DAMAGE_RECEIVED_EVENT_COUNT = 133,
|
|
119
|
+
MAXIMUM_DAMAGE_RECEIVED_EVENT_COUNT = 134,
|
|
120
|
+
TURNS_INTO_GHOST = 135,
|
|
121
|
+
STUNS = 136,
|
|
122
|
+
IGNORES_STUN_IMMUNITY = 137,
|
|
123
|
+
DISABLES_AUTO_ATTACK = 138,
|
|
124
|
+
PROVIDES_INVULNERABILITY = 139,
|
|
125
|
+
KILLS_ON_EXPIRATION = 140,
|
|
126
|
+
EXPLODES_ON_EXPIRATION = 141,
|
|
127
|
+
MISS_PROBABILITY = 142
|
|
122
128
|
}
|
|
123
129
|
export declare const enum BuffTypeIdSelectionPolicy {
|
|
124
130
|
LEAST_DURATION = 0
|
|
@@ -132,13 +138,14 @@ export type BuffConstructorParameters<AdditionalParameters extends BuffAdditiona
|
|
|
132
138
|
polarity: BuffPolarityParameterType,
|
|
133
139
|
resistanceType: BuffResistanceTypeParameterType,
|
|
134
140
|
...abilityOrParameters: [
|
|
135
|
-
ability
|
|
141
|
+
ability?: Ability,
|
|
136
142
|
parameters?: BuffParameters & Omit<AdditionalParameters, keyof BuffParameters>
|
|
137
143
|
] | [parameters?: BuffParameters & Omit<AdditionalParameters, keyof BuffParameters>]
|
|
138
144
|
];
|
|
139
145
|
export declare class Buff<AdditionalParameters extends Prohibit<Record<string, any>, keyof BuffParameters> = object> extends UnitBehavior {
|
|
140
146
|
private _unit;
|
|
141
147
|
protected readonly __additionalParametersBrand?: AdditionalParameters;
|
|
148
|
+
private [BuffPropertyKey.STATE];
|
|
142
149
|
private [BuffPropertyKey.UNIT];
|
|
143
150
|
private [BuffPropertyKey.SOURCE]?;
|
|
144
151
|
private [BuffPropertyKey.DURATION];
|
|
@@ -173,6 +180,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
173
180
|
private [BuffPropertyKey.DAMAGE_DEALT_EVENT_COUNT]?;
|
|
174
181
|
private [BuffPropertyKey.MAXIMUM_DAMAGE_RECEIVED_EVENT_COUNT]?;
|
|
175
182
|
private [BuffPropertyKey.DAMAGE_RECEIVED_EVENT_COUNT]?;
|
|
183
|
+
private [BuffPropertyKey.TURNS_INTO_GHOST]?;
|
|
176
184
|
private [BuffPropertyKey.STUNS]?;
|
|
177
185
|
private [BuffPropertyKey.IGNORES_STUN_IMMUNITY]?;
|
|
178
186
|
private [BuffPropertyKey.DISABLES_AUTO_ATTACK]?;
|
|
@@ -192,6 +200,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
192
200
|
private readonly _level?;
|
|
193
201
|
private readonly _spellStealPriority?;
|
|
194
202
|
private readonly _learnLevelMinimum?;
|
|
203
|
+
private readonly [BuffPropertyKey.MISS_PROBABILITY]?;
|
|
195
204
|
private _bonusIdByBonusType?;
|
|
196
205
|
private readonly _abilityTypeIds?;
|
|
197
206
|
private _behaviors?;
|
|
@@ -225,6 +234,8 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
225
234
|
set receivedDamageFactor(receivedDamageFactor: number);
|
|
226
235
|
get armorIncrease(): number;
|
|
227
236
|
set armorIncrease(armorIncrease: number);
|
|
237
|
+
get turnsIntoGhost(): boolean;
|
|
238
|
+
set turnsIntoGhost(turnsIntoGhost: boolean);
|
|
228
239
|
get stuns(): boolean;
|
|
229
240
|
set stuns(stuns: boolean);
|
|
230
241
|
get ignoresStunImmunity(): boolean;
|
|
@@ -267,5 +278,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
|
|
|
267
278
|
onDeath(source: Unit | undefined): void;
|
|
268
279
|
onDamageDealt(target: Unit, event: DamageEvent): void;
|
|
269
280
|
onDamageReceived(source: Unit | undefined, event: DamageEvent): void;
|
|
281
|
+
static readonly createdEvent: Event<[Buff<object>]>;
|
|
282
|
+
static readonly beingDestroyedEvent: Event<[Buff<object>]>;
|
|
270
283
|
}
|
|
271
284
|
export {};
|