warscript 0.0.1-dev.858ac09 → 0.0.1-dev.85b1c63

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.
Files changed (125) hide show
  1. package/attributes.d.ts +5 -0
  2. package/attributes.lua +8 -1
  3. package/core/types/effect.d.ts +1 -3
  4. package/core/types/effect.lua +26 -29
  5. package/core/types/frame.lua +10 -12
  6. package/core/types/player.lua +3 -1
  7. package/core/types/playerCamera.d.ts +2 -0
  8. package/core/types/playerCamera.lua +79 -5
  9. package/core/types/sound.d.ts +17 -25
  10. package/core/types/sound.lua +85 -44
  11. package/core/types/timer.d.ts +8 -8
  12. package/core/types/timer.lua +39 -23
  13. package/decl/native.d.ts +844 -788
  14. package/engine/behavior.d.ts +4 -0
  15. package/engine/behavior.lua +84 -27
  16. package/engine/behaviour/ability/apply-buff.lua +1 -1
  17. package/engine/behaviour/ability/damage.d.ts +6 -3
  18. package/engine/behaviour/ability/damage.lua +24 -36
  19. package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
  20. package/engine/behaviour/ability/emulate-impact.lua +18 -3
  21. package/engine/behaviour/ability/restore-mana.d.ts +1 -1
  22. package/engine/behaviour/ability/restore-mana.lua +6 -6
  23. package/engine/behaviour/ability.d.ts +4 -1
  24. package/engine/behaviour/ability.lua +14 -21
  25. package/engine/behaviour/unit/stun-immunity.d.ts +5 -3
  26. package/engine/behaviour/unit/stun-immunity.lua +43 -27
  27. package/engine/behaviour/unit.d.ts +31 -1
  28. package/engine/behaviour/unit.lua +185 -4
  29. package/engine/buff.d.ts +14 -11
  30. package/engine/buff.lua +130 -114
  31. package/engine/internal/ability.d.ts +7 -1
  32. package/engine/internal/ability.lua +48 -9
  33. package/engine/internal/item/ability.lua +63 -11
  34. package/engine/internal/item+owner.lua +12 -6
  35. package/engine/internal/item.d.ts +5 -2
  36. package/engine/internal/item.lua +85 -10
  37. package/engine/internal/mechanics/ability-duration.lua +1 -1
  38. package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
  39. package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
  40. package/engine/internal/misc/frame-coordinates.d.ts +2 -0
  41. package/engine/internal/misc/frame-coordinates.lua +21 -0
  42. package/engine/internal/misc/get-terrain-z.d.ts +2 -0
  43. package/engine/internal/misc/get-terrain-z.lua +11 -0
  44. package/engine/internal/misc/player-local-handle.d.ts +2 -0
  45. package/engine/internal/misc/player-local-handle.lua +5 -0
  46. package/engine/internal/unit/ability.d.ts +35 -0
  47. package/engine/internal/unit/ability.lua +62 -0
  48. package/engine/internal/unit/allowed-targets.d.ts +1 -1
  49. package/engine/internal/unit/allowed-targets.lua +9 -1
  50. package/engine/internal/unit/order.d.ts +20 -0
  51. package/engine/internal/unit/order.lua +136 -0
  52. package/engine/internal/unit+ability.lua +10 -1
  53. package/engine/internal/unit+damage.d.ts +2 -11
  54. package/engine/internal/unit+damage.lua +10 -14
  55. package/engine/internal/unit+spellSteal.lua +1 -2
  56. package/engine/internal/unit-missile-launch.lua +9 -2
  57. package/engine/internal/unit.d.ts +24 -7
  58. package/engine/internal/unit.lua +247 -107
  59. package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
  60. package/engine/object-data/auxiliary/armor-type.lua +46 -0
  61. package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
  62. package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
  63. package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
  64. package/engine/object-data/auxiliary/attack-type.lua +42 -0
  65. package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
  66. package/engine/object-data/auxiliary/movement-type.lua +22 -0
  67. package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
  68. package/engine/object-data/auxiliary/sound-eax.lua +2 -0
  69. package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
  70. package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
  71. package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
  72. package/engine/object-data/entry/ability-type/berserk.lua +13 -0
  73. package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
  74. package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
  75. package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
  76. package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
  77. package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
  78. package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
  79. package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
  80. package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
  81. package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
  82. package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
  83. package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
  84. package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
  85. package/engine/object-data/entry/ability-type/web.d.ts +12 -0
  86. package/engine/object-data/entry/ability-type/web.lua +52 -0
  87. package/engine/object-data/entry/ability-type.d.ts +11 -11
  88. package/engine/object-data/entry/ability-type.lua +32 -13
  89. package/engine/object-data/entry/buff-type/applicable.lua +5 -0
  90. package/engine/object-data/entry/buff-type.d.ts +5 -11
  91. package/engine/object-data/entry/buff-type.lua +11 -27
  92. package/engine/object-data/entry/sound-preset.d.ts +17 -0
  93. package/engine/object-data/entry/sound-preset.lua +104 -0
  94. package/engine/object-data/entry/unit-type.d.ts +13 -4
  95. package/engine/object-data/entry/unit-type.lua +153 -85
  96. package/engine/object-field/ability.d.ts +4 -4
  97. package/engine/object-field/ability.lua +7 -6
  98. package/engine/object-field/unit.d.ts +57 -3
  99. package/engine/object-field/unit.lua +207 -7
  100. package/engine/object-field.d.ts +17 -6
  101. package/engine/object-field.lua +188 -92
  102. package/engine/standard/entries/buff-type.d.ts +3 -0
  103. package/engine/standard/entries/buff-type.lua +3 -0
  104. package/engine/standard/fields/unit.d.ts +4 -0
  105. package/engine/standard/fields/unit.lua +7 -0
  106. package/engine/text-tag.d.ts +36 -2
  107. package/engine/text-tag.lua +249 -10
  108. package/engine/unit.d.ts +1 -0
  109. package/engine/unit.lua +1 -0
  110. package/objutil/buff.lua +1 -2
  111. package/package.json +2 -2
  112. package/utility/arrays.d.ts +1 -0
  113. package/utility/arrays.lua +3 -0
  114. package/utility/callback-array.d.ts +13 -0
  115. package/utility/callback-array.lua +46 -0
  116. package/utility/functions.d.ts +8 -0
  117. package/utility/functions.lua +13 -0
  118. package/utility/linked-set.d.ts +1 -0
  119. package/utility/linked-set.lua +3 -0
  120. package/utility/lua-maps.d.ts +4 -0
  121. package/utility/lua-maps.lua +20 -0
  122. package/utility/lua-sets.d.ts +2 -0
  123. package/utility/lua-sets.lua +7 -0
  124. package/core/types/order.d.ts +0 -25
  125. package/core/types/order.lua +0 -55
@@ -6,23 +6,53 @@ import "../internal/unit+ability";
6
6
  import "../internal/unit-missile-launch";
7
7
  import { Item } from "../internal/item";
8
8
  import type { AbilityBehavior } from "./ability";
9
+ import { Event } from "../../event";
10
+ import { Destructor } from "../../destroyable";
11
+ import type { Widget } from "../../core/types/widget";
12
+ import { Destructable } from "../../core/types/destructable";
13
+ import type { Buff } from "../buff";
14
+ import { UnitBonusType } from "../internal/unit/bonus";
9
15
  export type UnitBehaviorConstructor<Args extends any[]> = new (unit: Unit, ...args: Args) => UnitBehavior;
10
16
  export declare abstract class UnitBehavior<PeriodicActionParameters extends any[] = any[]> extends Behavior<Unit, PeriodicActionParameters> {
11
- constructor(unit: Unit);
12
17
  readonly sourceAbilityBehavior?: AbilityBehavior;
18
+ private _bonusIdByBonusType?;
19
+ constructor(unit: Unit);
20
+ protected onDestroy(): Destructor;
13
21
  get unit(): Unit;
22
+ protected getUnitBonus(bonusType: UnitBonusType): number;
23
+ protected addOrUpdateOrRemoveUnitBonus(bonusType: UnitBonusType, value: number): void;
24
+ protected registerInRangeUnitEvent<T extends string, Args extends any[]>(this: UnitBehavior<PeriodicActionParameters> & Record<T, (this: this, ...args: Args) => unknown>, event: Event<[...Args]>, extractUnit: (...args: Args) => Unit | undefined, range: number, listener: T): void;
25
+ onImmediateOrder(orderId: number): void;
26
+ onTargetOrder(orderId: number, target: Widget): void;
27
+ onPointOrder(orderId: number, x: number, y: number): void;
14
28
  onAutoAttackStart(target: Unit): void;
15
29
  onAutoAttackFinish(target: Unit): void;
30
+ onTargetingAutoAttackStart(source: Unit): void;
31
+ onTargetingAutoAttackFinish(source: Unit): void;
16
32
  onDamageDealing(target: Unit, event: DamagingEvent): void;
17
33
  onDamageDealt(target: Unit, event: DamageEvent): void;
18
34
  onDamageReceiving(source: Unit | undefined, event: DamagingEvent): void;
19
35
  onDamageReceived(source: Unit | undefined, event: DamageEvent): void;
20
36
  onAbilityGained(ability: Ability): void;
21
37
  onAbilityLost(ability: Ability): void;
38
+ onAbilityChannelingStart(ability: Ability): void;
39
+ onAbilityImpact(ability: Ability): void;
40
+ onAbilityWidgetTargetImpact(ability: Ability, target: Widget): void;
41
+ onAbilityUnitTargetImpact(ability: Ability, target: Unit): void;
42
+ onAbilityItemTargetImpact(ability: Ability, target: Item): void;
43
+ onAbilityDestructibleTargetImpact(ability: Ability, target: Destructable): void;
44
+ onAbilityPointTargetImpact(ability: Ability, x: number, y: number): void;
45
+ onAbilityNoTargetImpact(ability: Ability): void;
46
+ onAbilityChannelingFinish(ability: Ability): void;
47
+ onAbilityStop(ability: Ability): void;
48
+ onTargetingAbilityChannelingStart(ability: Ability, source: Unit): void;
49
+ onTargetingAbilityImpact(ability: Ability, source: Unit): void;
50
+ onBuffGained(buff: Buff): void;
22
51
  onItemDropped(item: Item): void;
23
52
  onItemPickedUp(item: Item): void;
24
53
  onItemUsed(item: Item): void;
25
54
  onItemStacked(item: Item): void;
55
+ onItemChargesChanged(item: Item): void;
26
56
  onKill(target: Unit): void;
27
57
  onDeath(source: Unit | undefined): void;
28
58
  }
@@ -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,21 @@ 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 ____bonus = require("engine.internal.unit.bonus")
21
+ local addOrUpdateOrRemoveUnitBonus = ____bonus.addOrUpdateOrRemoveUnitBonus
22
+ local getUnitBonus = ____bonus.getUnitBonus
23
+ local removeUnitBonus = ____bonus.removeUnitBonus
24
+ local behaviorsByEvent = {}
25
+ local rangeByBehaviorByEvent = {}
26
+ local listenerByBehaviorByEvent = {}
27
+ local eventsByBehavior = {}
12
28
  ____exports.UnitBehavior = __TS__Class()
13
29
  local UnitBehavior = ____exports.UnitBehavior
14
30
  UnitBehavior.name = "UnitBehavior"
@@ -16,10 +32,87 @@ __TS__ClassExtends(UnitBehavior, Behavior)
16
32
  function UnitBehavior.prototype.____constructor(self, unit)
17
33
  Behavior.prototype.____constructor(self, unit)
18
34
  end
35
+ function UnitBehavior.prototype.onDestroy(self)
36
+ local events = eventsByBehavior[self]
37
+ if events ~= nil then
38
+ for event in pairs(events) do
39
+ local ____opt_0 = behaviorsByEvent[event]
40
+ if ____opt_0 ~= nil then
41
+ ____opt_0:remove(self)
42
+ end
43
+ local ____opt_2 = rangeByBehaviorByEvent[event]
44
+ if ____opt_2 ~= nil then
45
+ ____opt_2[self] = nil
46
+ end
47
+ local ____opt_4 = listenerByBehaviorByEvent[event]
48
+ if ____opt_4 ~= nil then
49
+ ____opt_4[self] = nil
50
+ end
51
+ end
52
+ eventsByBehavior[self] = nil
53
+ end
54
+ if self._bonusIdByBonusType ~= nil then
55
+ for bonusType, bonusId in pairs(self._bonusIdByBonusType) do
56
+ removeUnitBonus(self.object, bonusType, bonusId)
57
+ end
58
+ end
59
+ return Behavior.prototype.onDestroy(self)
60
+ end
61
+ function UnitBehavior.prototype.getUnitBonus(self, bonusType)
62
+ local ____opt_6 = self._bonusIdByBonusType
63
+ local bonusId = ____opt_6 and ____opt_6[bonusType]
64
+ return bonusId == nil and 0 or getUnitBonus(self.object, bonusType, bonusId)
65
+ end
66
+ function UnitBehavior.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
67
+ local bonusIdByBonusType = self._bonusIdByBonusType
68
+ if bonusIdByBonusType == nil then
69
+ bonusIdByBonusType = {}
70
+ self._bonusIdByBonusType = bonusIdByBonusType
71
+ end
72
+ bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self.object, bonusType, bonusIdByBonusType[bonusType], value)
73
+ end
74
+ function UnitBehavior.prototype.registerInRangeUnitEvent(self, event, extractUnit, range, listener)
75
+ local rangeByBehavior = getOrPut(rangeByBehaviorByEvent, event, mutableLuaMap)
76
+ rangeByBehavior[self] = range
77
+ local listenerByBehavior = getOrPut(listenerByBehaviorByEvent, event, mutableLuaMap)
78
+ listenerByBehavior[self] = listener
79
+ getOrPut(eventsByBehavior, self, mutableLuaSet)[event] = true
80
+ local behaviors = behaviorsByEvent[event]
81
+ if behaviors == nil then
82
+ event:addListener(function(...)
83
+ local behaviors = behaviorsByEvent[event]
84
+ if behaviors ~= nil then
85
+ local unit = extractUnit(...)
86
+ if unit ~= nil then
87
+ for behavior in pairs(behaviors) do
88
+ local range = rangeByBehavior[behavior]
89
+ if range ~= nil and unit:getCollisionDistanceTo(behavior.unit) <= range then
90
+ local ____self_8 = behavior
91
+ ____self_8[listenerByBehavior[behavior]](____self_8, ...)
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end)
97
+ behaviors = __TS__New(LinkedSet)
98
+ behaviorsByEvent[event] = behaviors
99
+ end
100
+ behaviors:add(self)
101
+ end
102
+ function UnitBehavior.prototype.onImmediateOrder(self, orderId)
103
+ end
104
+ function UnitBehavior.prototype.onTargetOrder(self, orderId, target)
105
+ end
106
+ function UnitBehavior.prototype.onPointOrder(self, orderId, x, y)
107
+ end
19
108
  function UnitBehavior.prototype.onAutoAttackStart(self, target)
20
109
  end
21
110
  function UnitBehavior.prototype.onAutoAttackFinish(self, target)
22
111
  end
112
+ function UnitBehavior.prototype.onTargetingAutoAttackStart(self, source)
113
+ end
114
+ function UnitBehavior.prototype.onTargetingAutoAttackFinish(self, source)
115
+ end
23
116
  function UnitBehavior.prototype.onDamageDealing(self, target, event)
24
117
  end
25
118
  function UnitBehavior.prototype.onDamageDealt(self, target, event)
@@ -32,6 +125,32 @@ function UnitBehavior.prototype.onAbilityGained(self, ability)
32
125
  end
33
126
  function UnitBehavior.prototype.onAbilityLost(self, ability)
34
127
  end
128
+ function UnitBehavior.prototype.onAbilityChannelingStart(self, ability)
129
+ end
130
+ function UnitBehavior.prototype.onAbilityImpact(self, ability)
131
+ end
132
+ function UnitBehavior.prototype.onAbilityWidgetTargetImpact(self, ability, target)
133
+ end
134
+ function UnitBehavior.prototype.onAbilityUnitTargetImpact(self, ability, target)
135
+ end
136
+ function UnitBehavior.prototype.onAbilityItemTargetImpact(self, ability, target)
137
+ end
138
+ function UnitBehavior.prototype.onAbilityDestructibleTargetImpact(self, ability, target)
139
+ end
140
+ function UnitBehavior.prototype.onAbilityPointTargetImpact(self, ability, x, y)
141
+ end
142
+ function UnitBehavior.prototype.onAbilityNoTargetImpact(self, ability)
143
+ end
144
+ function UnitBehavior.prototype.onAbilityChannelingFinish(self, ability)
145
+ end
146
+ function UnitBehavior.prototype.onAbilityStop(self, ability)
147
+ end
148
+ function UnitBehavior.prototype.onTargetingAbilityChannelingStart(self, ability, source)
149
+ end
150
+ function UnitBehavior.prototype.onTargetingAbilityImpact(self, ability, source)
151
+ end
152
+ function UnitBehavior.prototype.onBuffGained(self, buff)
153
+ end
35
154
  function UnitBehavior.prototype.onItemDropped(self, item)
36
155
  end
37
156
  function UnitBehavior.prototype.onItemPickedUp(self, item)
@@ -40,6 +159,8 @@ function UnitBehavior.prototype.onItemUsed(self, item)
40
159
  end
41
160
  function UnitBehavior.prototype.onItemStacked(self, item)
42
161
  end
162
+ function UnitBehavior.prototype.onItemChargesChanged(self, item)
163
+ end
43
164
  function UnitBehavior.prototype.onKill(self, target)
44
165
  end
45
166
  function UnitBehavior.prototype.onDeath(self, source)
@@ -53,11 +174,28 @@ __TS__SetDescriptor(
53
174
  true
54
175
  );
55
176
  (function(self)
177
+ Unit.onImmediateOrder:addListener(function(source, orderId)
178
+ ____exports.UnitBehavior:forAll(source, "onImmediateOrder", orderId)
179
+ end)
180
+ Unit.onTargetOrder:addListener(function(source, orderId, target)
181
+ ____exports.UnitBehavior:forAll(source, "onTargetOrder", orderId, target)
182
+ end)
183
+ Unit.onPointOrder:addListener(function(source, orderId, x, y)
184
+ ____exports.UnitBehavior:forAll(
185
+ source,
186
+ "onPointOrder",
187
+ orderId,
188
+ x,
189
+ y
190
+ )
191
+ end)
56
192
  Unit.autoAttackStartEvent:addListener(function(source, target)
57
193
  ____exports.UnitBehavior:forAll(source, "onAutoAttackStart", target)
194
+ ____exports.UnitBehavior:forAll(target, "onTargetingAutoAttackStart", source)
58
195
  end)
59
196
  Unit.autoAttackFinishEvent:addListener(function(source, target)
60
197
  ____exports.UnitBehavior:forAll(source, "onAutoAttackFinish", target)
198
+ ____exports.UnitBehavior:forAll(target, "onTargetingAutoAttackFinish", source)
61
199
  end)
62
200
  Unit.onDamaging:addListener(function(source, target, event)
63
201
  if source ~= nil then
@@ -71,11 +209,51 @@ __TS__SetDescriptor(
71
209
  end
72
210
  ____exports.UnitBehavior:forAll(target, "onDamageReceived", source, event)
73
211
  end)
74
- Unit.abilityGainedEvent:addListener(function(source, target)
75
- ____exports.UnitBehavior:forAll(source, "onAbilityGained", target)
212
+ Unit.abilityGainedEvent:addListener(function(source, ability)
213
+ ____exports.UnitBehavior:forAll(source, "onAbilityGained", ability)
214
+ end)
215
+ Unit.abilityLostEvent:addListener(function(source, ability)
216
+ ____exports.UnitBehavior:forAll(source, "onAbilityLost", ability)
217
+ end)
218
+ Unit.abilityChannelingStartEvent:addListener(function(source, ability)
219
+ ____exports.UnitBehavior:forAll(source, "onAbilityChannelingStart", ability)
76
220
  end)
77
- Unit.abilityLostEvent:addListener(function(source, target)
78
- ____exports.UnitBehavior:forAll(source, "onAbilityLost", target)
221
+ Unit.abilityUnitTargetChannelingStartEvent:addListener(function(source, ability, target)
222
+ ____exports.UnitBehavior:forAll(target, "onTargetingAbilityChannelingStart", ability, source)
223
+ end)
224
+ Unit.abilityImpactEvent:addListener(function(source, ability)
225
+ ____exports.UnitBehavior:forAll(source, "onAbilityImpact", ability)
226
+ end)
227
+ Unit.abilityWidgetTargetImpactEvent:addListener(function(source, ability, target)
228
+ ____exports.UnitBehavior:forAll(source, "onAbilityWidgetTargetImpact", ability, target)
229
+ end)
230
+ Unit.abilityUnitTargetImpactEvent:addListener(function(source, ability, target)
231
+ ____exports.UnitBehavior:forAll(source, "onAbilityUnitTargetImpact", ability, target)
232
+ ____exports.UnitBehavior:forAll(target, "onTargetingAbilityImpact", ability, source)
233
+ end)
234
+ Unit.abilityItemTargetImpactEvent:addListener(function(source, ability, target)
235
+ ____exports.UnitBehavior:forAll(source, "onAbilityItemTargetImpact", ability, target)
236
+ end)
237
+ Unit.abilityDestructibleTargetImpactEvent:addListener(function(source, ability, target)
238
+ ____exports.UnitBehavior:forAll(source, "onAbilityDestructibleTargetImpact", ability, target)
239
+ end)
240
+ Unit.abilityPointTargetImpactEvent:addListener(function(source, ability, x, y)
241
+ ____exports.UnitBehavior:forAll(
242
+ source,
243
+ "onAbilityPointTargetImpact",
244
+ ability,
245
+ x,
246
+ y
247
+ )
248
+ end)
249
+ Unit.abilityNoTargetImpactEvent:addListener(function(source, ability)
250
+ ____exports.UnitBehavior:forAll(source, "onAbilityNoTargetImpact", ability)
251
+ end)
252
+ Unit.abilityChannelingFinishEvent:addListener(function(source, ability)
253
+ ____exports.UnitBehavior:forAll(source, "onAbilityChannelingFinish", ability)
254
+ end)
255
+ Unit.abilityStopEvent:addListener(function(source, ability)
256
+ ____exports.UnitBehavior:forAll(source, "onAbilityStop", ability)
79
257
  end)
80
258
  Unit.deathEvent:addListener(function(target, source)
81
259
  if source ~= nil then
@@ -95,6 +273,9 @@ __TS__SetDescriptor(
95
273
  Unit.itemStackedEvent:addListener(function(unit, item)
96
274
  ____exports.UnitBehavior:forAll(unit, "onItemStacked", item)
97
275
  end)
276
+ Unit.itemChargesChangedEvent:addListener(function(unit, item)
277
+ ____exports.UnitBehavior:forAll(unit, "onItemChargesChanged", item)
278
+ end)
98
279
  end)(UnitBehavior)
99
280
  Unit.destroyEvent:addListener(function(unit)
100
281
  ____exports.UnitBehavior:forAll(unit, "destroy")
package/engine/buff.d.ts CHANGED
@@ -64,6 +64,7 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
64
64
  durationIncreaseOnAutoAttack?: NumberParameterValueType;
65
65
  maximumRemainingDuration?: NumberParameterValueType;
66
66
  maximumDuration?: NumberParameterValueType;
67
+ turnsIntoGhost?: BooleanParameterValueType;
67
68
  stuns?: BooleanParameterValueType;
68
69
  ignoresStunImmunity?: BooleanParameterValueType;
69
70
  providesStunImmunity?: BooleanParameterValueType;
@@ -116,13 +117,14 @@ declare const enum BuffPropertyKey {
116
117
  MAXIMUM_DAMAGE_DEALT_EVENT_COUNT = 132,
117
118
  DAMAGE_RECEIVED_EVENT_COUNT = 133,
118
119
  MAXIMUM_DAMAGE_RECEIVED_EVENT_COUNT = 134,
119
- STUNS = 135,
120
- IGNORES_STUN_IMMUNITY = 136,
121
- DISABLES_AUTO_ATTACK = 137,
122
- PROVIDES_INVULNERABILITY = 138,
123
- KILLS_ON_EXPIRATION = 139,
124
- EXPLODES_ON_EXPIRATION = 140,
125
- MISS_PROBABILITY = 141
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
126
128
  }
127
129
  export declare const enum BuffTypeIdSelectionPolicy {
128
130
  LEAST_DURATION = 0
@@ -178,6 +180,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
178
180
  private [BuffPropertyKey.DAMAGE_DEALT_EVENT_COUNT]?;
179
181
  private [BuffPropertyKey.MAXIMUM_DAMAGE_RECEIVED_EVENT_COUNT]?;
180
182
  private [BuffPropertyKey.DAMAGE_RECEIVED_EVENT_COUNT]?;
183
+ private [BuffPropertyKey.TURNS_INTO_GHOST]?;
181
184
  private [BuffPropertyKey.STUNS]?;
182
185
  private [BuffPropertyKey.IGNORES_STUN_IMMUNITY]?;
183
186
  private [BuffPropertyKey.DISABLES_AUTO_ATTACK]?;
@@ -198,11 +201,8 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
198
201
  private readonly _spellStealPriority?;
199
202
  private readonly _learnLevelMinimum?;
200
203
  private readonly [BuffPropertyKey.MISS_PROBABILITY]?;
201
- private _bonusIdByBonusType?;
202
204
  private readonly _abilityTypeIds?;
203
205
  private _behaviors?;
204
- private getUnitBonus;
205
- private addOrUpdateOrRemoveUnitBonus;
206
206
  constructor(target: Unit, ...parameters: BuffConstructorParameters<AdditionalParameters>);
207
207
  get level(): number;
208
208
  get remainingDamageOverDuration(): number;
@@ -231,6 +231,8 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
231
231
  set receivedDamageFactor(receivedDamageFactor: number);
232
232
  get armorIncrease(): number;
233
233
  set armorIncrease(armorIncrease: number);
234
+ get turnsIntoGhost(): boolean;
235
+ set turnsIntoGhost(turnsIntoGhost: boolean);
234
236
  get stuns(): boolean;
235
237
  set stuns(stuns: boolean);
236
238
  get ignoresStunImmunity(): boolean;
@@ -273,6 +275,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
273
275
  onDeath(source: Unit | undefined): void;
274
276
  onDamageDealt(target: Unit, event: DamageEvent): void;
275
277
  onDamageReceived(source: Unit | undefined, event: DamageEvent): void;
276
- static readonly destroyEvent: Event<[Buff<object>]>;
278
+ static readonly createdEvent: Event<[Buff<object>]>;
279
+ static readonly beingDestroyedEvent: Event<[Buff<object>]>;
277
280
  }
278
281
  export {};