warscript 0.0.1-dev.dd8349d → 0.0.1-dev.e147c49
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 +1 -0
- package/attributes.lua +9 -0
- package/core/types/frame.d.ts +1 -0
- package/core/types/frame.lua +136 -58
- package/core/types/handle.lua +9 -9
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- package/core/types/player.d.ts +18 -1
- package/core/types/player.lua +76 -26
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/playerColor.lua +4 -3
- package/core/types/sound.d.ts +1 -1
- package/core/types/sound.lua +14 -9
- package/core/types/tileCell.d.ts +11 -1
- package/core/types/tileCell.lua +97 -0
- package/core/types/timer.d.ts +3 -1
- package/core/types/timer.lua +27 -2
- package/core/types/unit.d.ts +4 -0
- package/core/types/unit.lua +4 -0
- package/decl/native.d.ts +711 -11
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/behavior.d.ts +14 -1
- package/engine/behavior.lua +230 -70
- package/engine/behaviour/ability/apply-buff.lua +5 -5
- package/engine/behaviour/ability/damage.d.ts +3 -0
- package/engine/behaviour/ability/damage.lua +18 -15
- package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
- package/engine/behaviour/ability/emulate-impact.lua +16 -7
- 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 +12 -6
- package/engine/behaviour/ability.lua +49 -17
- package/engine/behaviour/unit/stun-immunity.d.ts +12 -6
- package/engine/behaviour/unit/stun-immunity.lua +57 -31
- package/engine/behaviour/unit.d.ts +28 -5
- package/engine/behaviour/unit.lua +186 -27
- package/engine/buff.d.ts +75 -28
- package/engine/buff.lua +433 -196
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +9 -1
- package/engine/internal/ability.lua +96 -44
- package/engine/internal/item/ability.lua +51 -1
- package/engine/internal/item/fields.d.ts +12 -0
- package/engine/internal/item/fields.lua +33 -0
- package/engine/internal/item+owner.d.ts +1 -0
- package/engine/internal/item+owner.lua +19 -6
- package/engine/internal/item.d.ts +24 -14
- package/engine/internal/item.lua +176 -85
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- 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/object-data/armor-bonus.d.ts +2 -0
- package/engine/internal/object-data/attribute-bonus.lua +2 -2
- package/engine/internal/object-data/health-bonus.d.ts +2 -0
- package/engine/internal/object-data/health-bonus.lua +16 -0
- package/engine/internal/object-data/mana-bonus.d.ts +2 -0
- package/engine/internal/object-data/mana-bonus.lua +16 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
- package/engine/internal/unit/ability.d.ts +35 -0
- package/engine/internal/unit/ability.lua +113 -12
- package/engine/internal/unit/appearance.d.ts +15 -0
- package/engine/internal/unit/appearance.lua +85 -0
- package/engine/internal/unit/attributes.d.ts +17 -0
- package/engine/internal/unit/attributes.lua +46 -0
- package/engine/internal/unit/bag.d.ts +18 -0
- package/engine/internal/unit/bag.lua +63 -0
- package/engine/internal/unit/bonus.d.ts +6 -0
- package/engine/internal/unit/bonus.lua +33 -3
- package/engine/internal/unit/buff.d.ts +2 -2
- package/engine/internal/unit/buff.lua +34 -19
- package/engine/internal/unit/equipment.d.ts +36 -0
- package/engine/internal/unit/equipment.lua +169 -0
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/{item.d.ts → inventory.d.ts} +3 -3
- package/engine/internal/unit/{item.lua → inventory.lua} +25 -26
- 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/pseudo-passive-abilities.d.ts +2 -0
- package/engine/internal/unit/pseudo-passive-abilities.lua +11 -0
- package/engine/internal/unit/range-event.d.ts +12 -0
- package/engine/internal/unit/range-event.lua +90 -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+bonus.lua +3 -3
- package/engine/internal/unit+damage.d.ts +9 -0
- package/engine/internal/unit+damage.lua +33 -0
- package/engine/internal/unit-missile-data.lua +58 -32
- package/engine/internal/unit-missile-launch.lua +52 -14
- package/engine/internal/unit.d.ts +19 -24
- package/engine/internal/unit.lua +233 -246
- package/engine/local-client.d.ts +27 -0
- package/engine/local-client.lua +518 -54
- 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/equipment-slot.d.ts +12 -0
- package/engine/object-data/auxiliary/equipment-slot.lua +2 -0
- package/engine/object-data/auxiliary/equipment-type.d.ts +13 -0
- package/engine/object-data/auxiliary/equipment-type.lua +2 -0
- package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
- package/engine/object-data/auxiliary/item-tag.d.ts +12 -0
- package/engine/object-data/auxiliary/item-tag.lua +2 -0
- package/engine/object-data/auxiliary/sound-set-name.d.ts +14 -3
- package/engine/object-data/auxiliary/unit-attribute.lua +1 -1
- package/engine/object-data/entry/ability-type/apprehend.d.ts +22 -0
- package/engine/object-data/entry/ability-type/apprehend.lua +66 -0
- package/engine/object-data/entry/ability-type/armor-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
- package/engine/object-data/entry/ability-type/banshee.d.ts +8 -0
- package/engine/object-data/entry/ability-type/banshee.lua +13 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.lua +27 -0
- package/engine/object-data/entry/ability-type/banshees-wail.d.ts +31 -0
- package/engine/object-data/entry/ability-type/banshees-wail.lua +117 -0
- package/engine/object-data/entry/ability-type/battering-ram.d.ts +33 -0
- package/engine/object-data/entry/ability-type/battering-ram.lua +130 -0
- package/engine/object-data/entry/ability-type/blank-configurable.d.ts +3 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +30 -0
- package/engine/object-data/entry/ability-type/cleansing-fire.d.ts +27 -0
- package/engine/object-data/entry/ability-type/cleansing-fire.lua +104 -0
- package/engine/object-data/entry/ability-type/consecration.d.ts +15 -0
- package/engine/object-data/entry/ability-type/consecration.lua +52 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.d.ts +12 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.lua +39 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.d.ts +18 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.lua +65 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.d.ts +21 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.lua +78 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.d.ts +8 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.lua +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.lua +27 -0
- package/engine/object-data/entry/ability-type/equipment.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment.lua +27 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.d.ts +8 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.lua +13 -0
- package/engine/object-data/entry/ability-type/grim-conviction.d.ts +36 -0
- package/engine/object-data/entry/ability-type/grim-conviction.lua +131 -0
- package/engine/object-data/entry/ability-type/grit.d.ts +18 -0
- package/engine/object-data/entry/ability-type/grit.lua +65 -0
- package/engine/object-data/entry/ability-type/guiding-hand.d.ts +27 -0
- package/engine/object-data/entry/ability-type/guiding-hand.lua +104 -0
- package/engine/object-data/entry/ability-type/headsplitter.d.ts +27 -0
- package/engine/object-data/entry/ability-type/headsplitter.lua +104 -0
- package/engine/object-data/entry/ability-type/{armor-increase.d.ts → healing-modifier.d.ts} +4 -3
- package/engine/object-data/entry/ability-type/healing-modifier.lua +26 -0
- package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/heroic-slash.d.ts +18 -0
- package/engine/object-data/entry/ability-type/heroic-slash.lua +65 -0
- package/engine/object-data/entry/ability-type/holy-wrath.d.ts +30 -0
- package/engine/object-data/entry/ability-type/holy-wrath.lua +117 -0
- package/engine/object-data/entry/ability-type/inspire-courage.d.ts +18 -0
- package/engine/object-data/entry/ability-type/inspire-courage.lua +65 -0
- package/engine/object-data/entry/ability-type/lights-mercy.d.ts +27 -0
- package/engine/object-data/entry/ability-type/lights-mercy.lua +104 -0
- package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.d.ts +12 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.lua +39 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/mind-control.d.ts +21 -0
- package/engine/object-data/entry/ability-type/mind-control.lua +78 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.d.ts +21 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.lua +52 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.d.ts +19 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.lua +65 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.d.ts +15 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.lua +26 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.d.ts +6 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.lua +12 -0
- package/engine/object-data/entry/ability-type/provoke.d.ts +21 -0
- package/engine/object-data/entry/ability-type/provoke.lua +66 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.d.ts +9 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.lua +26 -0
- package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
- package/engine/object-data/entry/ability-type/resolve.d.ts +12 -0
- package/engine/object-data/entry/ability-type/resolve.lua +39 -0
- package/engine/object-data/entry/ability-type/righteous-fury.d.ts +33 -0
- package/engine/object-data/entry/ability-type/righteous-fury.lua +130 -0
- package/engine/object-data/entry/ability-type/sacred-aura.d.ts +27 -0
- package/engine/object-data/entry/ability-type/sacred-aura.lua +104 -0
- package/engine/object-data/entry/ability-type/soul-lantern.d.ts +30 -0
- package/engine/object-data/entry/ability-type/soul-lantern.lua +117 -0
- package/engine/object-data/entry/ability-type/spell-amp.d.ts +15 -0
- package/engine/object-data/entry/ability-type/spell-amp.lua +52 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.lua +39 -0
- package/engine/object-data/entry/ability-type/spell-vamp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-vamp.lua +39 -0
- package/engine/object-data/entry/ability-type/stackable-evasion.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-evasion.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.d.ts +21 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.lua +78 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.lua +26 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.lua +13 -0
- package/engine/object-data/entry/ability-type/stat-details.d.ts +12 -0
- package/engine/object-data/entry/ability-type/stat-details.lua +27 -0
- package/engine/object-data/entry/ability-type/surge-of-light.d.ts +33 -0
- package/engine/object-data/entry/ability-type/surge-of-light.lua +130 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.d.ts +57 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.lua +234 -0
- package/engine/object-data/entry/ability-type/talents.d.ts +12 -0
- package/engine/object-data/entry/ability-type/talents.lua +27 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.d.ts +30 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.lua +117 -0
- package/engine/object-data/entry/ability-type/valiant-charge.d.ts +27 -0
- package/engine/object-data/entry/ability-type/valiant-charge.lua +104 -0
- package/engine/object-data/entry/ability-type/warcry.d.ts +9 -0
- package/engine/object-data/entry/ability-type/warcry.lua +26 -0
- package/engine/object-data/entry/ability-type/withering-fire.d.ts +21 -0
- package/engine/object-data/entry/ability-type/withering-fire.lua +78 -0
- package/engine/object-data/entry/ability-type.d.ts +12 -3
- package/engine/object-data/entry/ability-type.lua +142 -8
- package/engine/object-data/entry/buff-type/applicable.lua +113 -109
- package/engine/object-data/entry/buff-type.d.ts +6 -2
- package/engine/object-data/entry/buff-type.lua +26 -0
- package/engine/object-data/entry/destructible-type.d.ts +32 -2
- package/engine/object-data/entry/destructible-type.lua +181 -0
- package/engine/object-data/entry/item-type.d.ts +12 -3
- package/engine/object-data/entry/item-type.lua +52 -0
- package/engine/object-data/entry/lightning-type.d.ts +2 -2
- package/engine/object-data/entry/sound-preset.d.ts +2 -2
- package/engine/object-data/entry/unit-type.d.ts +62 -4
- package/engine/object-data/entry/unit-type.lua +474 -38
- package/engine/object-data/entry/upgrade.d.ts +2 -2
- package/engine/object-data/entry.d.ts +4 -1
- package/engine/object-field/ability.d.ts +3 -3
- package/engine/object-field/ability.lua +9 -8
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field/unit.d.ts +31 -5
- package/engine/object-field/unit.lua +95 -0
- package/engine/object-field.d.ts +18 -7
- package/engine/object-field.lua +294 -135
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +21 -0
- package/engine/standard/entries/ability-type.d.ts +3102 -7
- package/engine/standard/entries/ability-type.lua +0 -6
- package/engine/standard/entries/item-type.d.ts +1299 -0
- package/engine/standard/entries/item-type.lua +2 -0
- package/engine/standard/entries/unit-type.d.ts +5 -0
- package/engine/standard/entries/unit-type.lua +5 -0
- package/engine/standard/fields/ability.d.ts +2 -2
- package/engine/standard/fields/ability.lua +2 -2
- package/engine/standard/fields/item.d.ts +4 -0
- package/engine/standard/fields/item.lua +6 -0
- package/engine/standard/fields/unit.d.ts +12 -0
- package/engine/standard/fields/unit.lua +20 -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 +10 -1
- package/engine/unit.lua +10 -1
- package/event.d.ts +1 -1
- package/lualib_bundle.lua +1 -1
- package/math.d.ts +2 -0
- package/math.lua +14 -0
- package/net/socket.lua +1 -1
- package/network.lua +25 -1
- package/objutil/buff.lua +10 -8
- package/objutil/object.lua +1 -1
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -23
- package/patch-lua.lua +15 -0
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +8 -0
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +7 -0
- package/utility/functions.lua +12 -0
- package/utility/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +4 -1
- package/utility/linked-set.lua +46 -1
- package/utility/lua-maps.d.ts +12 -2
- package/utility/lua-maps.lua +37 -2
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +4 -0
- package/utility/random.d.ts +102 -0
- package/utility/random.lua +273 -0
- package/utility/records.lua +20 -1
- package/utility/types.d.ts +3 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/core/types/order.d.ts +0 -26
- package/core/types/order.lua +0 -65
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/frame-coordinates.d.ts} +0 -0
- /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local ____unit = require("engine.internal.unit")
|
|
5
|
+
local Unit = ____unit.Unit
|
|
6
|
+
local ____unit = require("engine.standard.fields.unit")
|
|
7
|
+
local SCALING_VALUE_UNIT_FIELD = ____unit.SCALING_VALUE_UNIT_FIELD
|
|
8
|
+
__TS__ObjectDefineProperty(
|
|
9
|
+
Unit.prototype,
|
|
10
|
+
"scale",
|
|
11
|
+
{
|
|
12
|
+
get = function(self)
|
|
13
|
+
return SCALING_VALUE_UNIT_FIELD:getValue(self)
|
|
14
|
+
end,
|
|
15
|
+
set = function(self, value)
|
|
16
|
+
SCALING_VALUE_UNIT_FIELD:setValue(self, value)
|
|
17
|
+
end
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
return ____exports
|
|
@@ -7,8 +7,8 @@ local UnitAbility = ____ability.UnitAbility
|
|
|
7
7
|
local ____unit = require("engine.internal.unit")
|
|
8
8
|
local Unit = ____unit.Unit
|
|
9
9
|
local ____event = require("event")
|
|
10
|
-
local Event = ____event.Event
|
|
11
10
|
local createDispatchingEvent = ____event.createDispatchingEvent
|
|
11
|
+
local Event = ____event.Event
|
|
12
12
|
local abilityGainedEvent = createDispatchingEvent(
|
|
13
13
|
__TS__New(Event),
|
|
14
14
|
function(unit, ability) return ability.typeId end
|
|
@@ -40,6 +40,15 @@ ItemAbility.onCreate:addListener(
|
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
)
|
|
43
|
+
ItemAbility.destroyEvent:addListener(
|
|
44
|
+
4,
|
|
45
|
+
function(ability)
|
|
46
|
+
local unit = ability.owner.owner
|
|
47
|
+
if unit ~= nil then
|
|
48
|
+
Event.invoke(abilityLostEvent, unit, ability)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
)
|
|
43
52
|
Unit.itemPickedUpEvent:addListener(
|
|
44
53
|
0,
|
|
45
54
|
function(unit, item)
|
|
@@ -3,9 +3,9 @@ local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____unit = require("engine.internal.unit")
|
|
5
5
|
local Unit = ____unit.Unit
|
|
6
|
-
local
|
|
7
|
-
local ARMOR_BONUS_DUMMY_ABILITY_FIELD =
|
|
8
|
-
local ARMOR_BONUS_DUMMY_ABILITY_TYPE_ID =
|
|
6
|
+
local ____armor_2Dbonus = require("engine.internal.object-data.armor-bonus")
|
|
7
|
+
local ARMOR_BONUS_DUMMY_ABILITY_FIELD = ____armor_2Dbonus.ARMOR_BONUS_DUMMY_ABILITY_FIELD
|
|
8
|
+
local ARMOR_BONUS_DUMMY_ABILITY_TYPE_ID = ____armor_2Dbonus.ARMOR_BONUS_DUMMY_ABILITY_TYPE_ID
|
|
9
9
|
local getUnitAbility = BlzGetUnitAbility
|
|
10
10
|
local setAbilityRealLevelField = BlzSetAbilityRealLevelField
|
|
11
11
|
local unitAddAbility = UnitAddAbility
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
+
import "./unit/allowed-targets";
|
|
2
3
|
import { Widget } from "../../core/types/widget";
|
|
3
4
|
import { AttackType } from "../object-data/auxiliary/attack-type";
|
|
5
|
+
import { CombatClassifications } from "../object-data/auxiliary/combat-classification";
|
|
4
6
|
export type DamageType = jdamagetype;
|
|
5
7
|
export declare namespace DamageType {
|
|
6
8
|
const UNKNOWN: jdamagetype;
|
|
@@ -56,5 +58,12 @@ export declare namespace WeaponType {
|
|
|
56
58
|
declare module "./unit" {
|
|
57
59
|
interface Unit {
|
|
58
60
|
damageTarget(target: Widget, amount: number, attack?: boolean, ranged?: boolean, attackType?: AttackType, damageType?: DamageType, weaponType?: WeaponType, metadata?: unknown): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Deals amount to each allowed unit in collision range of (x, y).
|
|
63
|
+
* A positive maximumDamage caps the total requested damage, shared equally
|
|
64
|
+
* between the targets. Zero or omitted means unlimited; damage mitigation
|
|
65
|
+
* and damage-event modifiers are applied afterward by damageTarget.
|
|
66
|
+
*/
|
|
67
|
+
damageArea(x: number, y: number, range: number, allowedTargetCombatClassifications: CombatClassifications, amount: number, maximumDamage?: number, attack?: boolean, ranged?: boolean, attackType?: AttackType, damageType?: DamageType, weaponType?: WeaponType, metadata?: unknown): void;
|
|
59
68
|
}
|
|
60
69
|
}
|
|
@@ -3,6 +3,7 @@ local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____unit = require("engine.internal.unit")
|
|
5
5
|
local Unit = ____unit.Unit
|
|
6
|
+
require("engine.internal.unit.allowed-targets")
|
|
6
7
|
local ____player = require("core.types.player")
|
|
7
8
|
local Player = ____player.Player
|
|
8
9
|
local ____dummy = require("objutil.dummy")
|
|
@@ -11,6 +12,8 @@ local ____attack_2Dtype = require("engine.object-data.auxiliary.attack-type")
|
|
|
11
12
|
local attackTypeToNative = ____attack_2Dtype.attackTypeToNative
|
|
12
13
|
local ____damage_2Dmetadata_2Dby_2Dtarget = require("engine.internal.misc.damage-metadata-by-target")
|
|
13
14
|
local damageMetadataByTarget = ____damage_2Dmetadata_2Dby_2Dtarget.damageMetadataByTarget
|
|
15
|
+
local ____math = require("math")
|
|
16
|
+
local min = ____math.min
|
|
14
17
|
local createUnit = CreateUnit
|
|
15
18
|
local getOwningPlayer = GetOwningPlayer
|
|
16
19
|
local showUnit = ShowUnit
|
|
@@ -116,4 +119,34 @@ Unit.prototype.damageTarget = function(self, target, amount, attack, ranged, att
|
|
|
116
119
|
weaponType
|
|
117
120
|
)
|
|
118
121
|
end
|
|
122
|
+
Unit.prototype.damageArea = function(self, x, y, range, allowedTargetCombatClassifications, amount, maximumDamage, attack, ranged, attackType, damageType, weaponType, metadata)
|
|
123
|
+
if maximumDamage == nil then
|
|
124
|
+
maximumDamage = 0
|
|
125
|
+
end
|
|
126
|
+
local targets = Unit.getAllowedTargetsInCollisionRange(
|
|
127
|
+
self,
|
|
128
|
+
allowedTargetCombatClassifications,
|
|
129
|
+
x,
|
|
130
|
+
y,
|
|
131
|
+
range
|
|
132
|
+
)
|
|
133
|
+
if #targets == 0 then
|
|
134
|
+
return
|
|
135
|
+
end
|
|
136
|
+
if maximumDamage > 0 then
|
|
137
|
+
amount = min(amount, maximumDamage / #targets)
|
|
138
|
+
end
|
|
139
|
+
for ____, target in ipairs(targets) do
|
|
140
|
+
self:damageTarget(
|
|
141
|
+
target,
|
|
142
|
+
amount,
|
|
143
|
+
attack,
|
|
144
|
+
ranged,
|
|
145
|
+
attackType,
|
|
146
|
+
damageType,
|
|
147
|
+
weaponType,
|
|
148
|
+
metadata
|
|
149
|
+
)
|
|
150
|
+
end
|
|
151
|
+
end
|
|
119
152
|
return ____exports
|
|
@@ -44,58 +44,84 @@ ____exports.MISSILE_DATA_BY_UNIT_TYPE_ID = (function()
|
|
|
44
44
|
UnitType:getAll(),
|
|
45
45
|
function(unitType) return unitType.id end,
|
|
46
46
|
function(unitType)
|
|
47
|
-
local ____ = unitType.missileImpactOffsetZSD
|
|
48
|
-
local ____ = unitType.missileImpactOffsetZHD
|
|
49
47
|
return {
|
|
50
48
|
[0] = unitType.missileImpactOffsetZSD ~= ____exports.DEFAULT_MISSILE_IMPACT_OFFSET_Z and unitType.missileImpactOffsetZSD or nil,
|
|
51
49
|
[1] = unitType.missileImpactOffsetZHD ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZHD or nil,
|
|
52
|
-
[2] = unitType.
|
|
53
|
-
[3] = unitType.
|
|
54
|
-
[4] = unitType.
|
|
55
|
-
[5] = unitType.
|
|
56
|
-
[6] = unitType.
|
|
57
|
-
[7] = unitType.
|
|
58
|
-
[8] = unitType.
|
|
59
|
-
[9] = unitType.
|
|
50
|
+
[2] = unitType.missileImpactOffsetZDE ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZDE or nil,
|
|
51
|
+
[3] = unitType.missileLaunchOffsetX ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_X and unitType.missileLaunchOffsetX or nil,
|
|
52
|
+
[4] = unitType.missileLaunchOffsetY ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Y and unitType.missileLaunchOffsetY or nil,
|
|
53
|
+
[5] = unitType.missileLaunchOffsetZSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Z and unitType.missileLaunchOffsetZSD or nil,
|
|
54
|
+
[6] = unitType.missileLaunchOffsetZHD ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZHD or nil,
|
|
55
|
+
[7] = unitType.missileLaunchOffsetZDE ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZDE or nil,
|
|
56
|
+
[8] = unitType.missileLaunchVisualOffsetXSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_X and unitType.missileLaunchVisualOffsetXSD or nil,
|
|
57
|
+
[9] = unitType.missileLaunchVisualOffsetXHD ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXHD or nil,
|
|
58
|
+
[10] = unitType.missileLaunchVisualOffsetXDE ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXDE or nil,
|
|
59
|
+
[11] = unitType.missileLaunchVisualOffsetYSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y and unitType.missileLaunchVisualOffsetYSD or nil,
|
|
60
|
+
[12] = unitType.missileLaunchVisualOffsetYHD ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYHD or nil,
|
|
61
|
+
[13] = unitType.missileLaunchVisualOffsetYDE ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYDE or nil
|
|
60
62
|
}
|
|
61
63
|
end
|
|
62
64
|
)
|
|
63
65
|
end),
|
|
64
66
|
function(data)
|
|
65
|
-
local
|
|
66
|
-
local
|
|
67
|
+
local ____setmetatable_10 = setmetatable
|
|
68
|
+
local ____LocalClient_isHD_1
|
|
67
69
|
if LocalClient.isHD then
|
|
68
|
-
|
|
70
|
+
____LocalClient_isHD_1 = data[1] or data[0]
|
|
69
71
|
else
|
|
70
|
-
|
|
72
|
+
local ____LocalClient_isDE_0
|
|
73
|
+
if LocalClient.isDE then
|
|
74
|
+
____LocalClient_isDE_0 = data[2] or data[0]
|
|
75
|
+
else
|
|
76
|
+
____LocalClient_isDE_0 = data[0]
|
|
77
|
+
end
|
|
78
|
+
____LocalClient_isHD_1 = ____LocalClient_isDE_0
|
|
71
79
|
end
|
|
72
|
-
local
|
|
73
|
-
local
|
|
74
|
-
local
|
|
80
|
+
local ____data__3_8 = data[3]
|
|
81
|
+
local ____data__4_9 = data[4]
|
|
82
|
+
local ____LocalClient_isHD_3
|
|
75
83
|
if LocalClient.isHD then
|
|
76
|
-
|
|
84
|
+
____LocalClient_isHD_3 = data[6] or data[5]
|
|
77
85
|
else
|
|
78
|
-
|
|
86
|
+
local ____LocalClient_isDE_2
|
|
87
|
+
if LocalClient.isDE then
|
|
88
|
+
____LocalClient_isDE_2 = data[7] or data[5]
|
|
89
|
+
else
|
|
90
|
+
____LocalClient_isDE_2 = data[5]
|
|
91
|
+
end
|
|
92
|
+
____LocalClient_isHD_3 = ____LocalClient_isDE_2
|
|
79
93
|
end
|
|
80
|
-
local
|
|
94
|
+
local ____LocalClient_isHD_5
|
|
81
95
|
if LocalClient.isHD then
|
|
82
|
-
|
|
96
|
+
____LocalClient_isHD_5 = data[9] or data[8]
|
|
83
97
|
else
|
|
84
|
-
|
|
98
|
+
local ____LocalClient_isDE_4
|
|
99
|
+
if LocalClient.isDE then
|
|
100
|
+
____LocalClient_isDE_4 = data[10] or data[8]
|
|
101
|
+
else
|
|
102
|
+
____LocalClient_isDE_4 = data[8]
|
|
103
|
+
end
|
|
104
|
+
____LocalClient_isHD_5 = ____LocalClient_isDE_4
|
|
85
105
|
end
|
|
86
|
-
local
|
|
106
|
+
local ____LocalClient_isHD_7
|
|
87
107
|
if LocalClient.isHD then
|
|
88
|
-
|
|
108
|
+
____LocalClient_isHD_7 = data[12] or data[11]
|
|
89
109
|
else
|
|
90
|
-
|
|
110
|
+
local ____LocalClient_isDE_6
|
|
111
|
+
if LocalClient.isDE then
|
|
112
|
+
____LocalClient_isDE_6 = data[13] or data[11]
|
|
113
|
+
else
|
|
114
|
+
____LocalClient_isDE_6 = data[11]
|
|
115
|
+
end
|
|
116
|
+
____LocalClient_isHD_7 = ____LocalClient_isDE_6
|
|
91
117
|
end
|
|
92
|
-
return
|
|
93
|
-
impactOffsetZ =
|
|
94
|
-
launchOffsetX =
|
|
95
|
-
launchOffsetY =
|
|
96
|
-
launchOffsetZ =
|
|
97
|
-
launchVisualOffsetX =
|
|
98
|
-
launchVisualOffsetY =
|
|
118
|
+
return ____setmetatable_10({
|
|
119
|
+
impactOffsetZ = ____LocalClient_isHD_1,
|
|
120
|
+
launchOffsetX = ____data__3_8,
|
|
121
|
+
launchOffsetY = ____data__4_9,
|
|
122
|
+
launchOffsetZ = ____LocalClient_isHD_3,
|
|
123
|
+
launchVisualOffsetX = ____LocalClient_isHD_5,
|
|
124
|
+
launchVisualOffsetY = ____LocalClient_isHD_7
|
|
99
125
|
}, METATABLE)
|
|
100
126
|
end
|
|
101
127
|
),
|
|
@@ -9,9 +9,18 @@ local ____timer = require("core.types.timer")
|
|
|
9
9
|
local Timer = ____timer.Timer
|
|
10
10
|
local ____lua_2Dsets = require("utility.lua-sets")
|
|
11
11
|
local luaSetOf = ____lua_2Dsets.luaSetOf
|
|
12
|
+
local ____attributes = require("attributes")
|
|
13
|
+
local attribute = ____attributes.attribute
|
|
14
|
+
local ____linked_2Dset = require("utility.linked-set")
|
|
15
|
+
local LinkedSet = ____linked_2Dset.LinkedSet
|
|
16
|
+
local ____math = require("math")
|
|
17
|
+
local ceil = ____math.ceil
|
|
12
18
|
local autoAttackFinishEvent = __TS__New(Event)
|
|
13
19
|
rawset(Unit, "autoAttackFinishEvent", autoAttackFinishEvent)
|
|
14
|
-
local
|
|
20
|
+
local units = __TS__New(LinkedSet)
|
|
21
|
+
local targetAttribute = attribute()
|
|
22
|
+
local impactDelayAttribute = attribute()
|
|
23
|
+
local passedTimeAttribute = attribute()
|
|
15
24
|
local instantOrderIds = luaSetOf(
|
|
16
25
|
orderId("avatar"),
|
|
17
26
|
orderId("berserk"),
|
|
@@ -27,25 +36,54 @@ local instantOrderIds = luaSetOf(
|
|
|
27
36
|
orderId("undivineshield"),
|
|
28
37
|
orderId("unimmolation")
|
|
29
38
|
)
|
|
30
|
-
|
|
39
|
+
---
|
|
40
|
+
-- @internal For use by internal systems only.
|
|
41
|
+
____exports.resetAutoAttackTimer = function(unit)
|
|
42
|
+
if units:remove(unit) then
|
|
43
|
+
unit[targetAttribute] = nil
|
|
44
|
+
unit[impactDelayAttribute] = nil
|
|
45
|
+
unit[passedTimeAttribute] = nil
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
local function reset(unit, orderId)
|
|
31
49
|
if not (instantOrderIds[orderId] ~= nil) then
|
|
32
|
-
|
|
33
|
-
if eventTimer then
|
|
34
|
-
eventTimer:destroy()
|
|
35
|
-
eventTimerByUnit[source] = nil
|
|
36
|
-
end
|
|
50
|
+
____exports.resetAutoAttackTimer(unit)
|
|
37
51
|
end
|
|
38
52
|
end
|
|
39
53
|
Unit.onImmediateOrder:addListener(reset)
|
|
40
54
|
Unit.onPointOrder:addListener(reset)
|
|
41
55
|
Unit.onTargetOrder:addListener(reset)
|
|
42
|
-
local
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
local timerPeriod = 1 / 64
|
|
57
|
+
local function invokeEvent(unit)
|
|
58
|
+
units:remove(unit)
|
|
59
|
+
local target = unit[targetAttribute]
|
|
60
|
+
unit[targetAttribute] = nil
|
|
61
|
+
unit[impactDelayAttribute] = nil
|
|
62
|
+
unit[passedTimeAttribute] = nil
|
|
63
|
+
Event.invoke(autoAttackFinishEvent, unit, target)
|
|
64
|
+
end
|
|
65
|
+
local function checkUnit(unit)
|
|
66
|
+
local passedTime = unit[passedTimeAttribute] + timerPeriod
|
|
67
|
+
local impactDelay = unit[impactDelayAttribute]
|
|
68
|
+
if passedTime >= impactDelay and ceil(passedTime / 0.02) >= ceil(impactDelay / 0.02) then
|
|
69
|
+
invokeEvent(unit)
|
|
70
|
+
else
|
|
71
|
+
unit[passedTimeAttribute] = passedTime
|
|
72
|
+
end
|
|
45
73
|
end
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
local timer = Timer:simple(attackPoint, timerCallback, source, target)
|
|
49
|
-
eventTimerByUnit[source] = timer
|
|
74
|
+
Timer.onPeriod[timerPeriod]:addListener(function()
|
|
75
|
+
units:forEach(checkUnit)
|
|
50
76
|
end)
|
|
77
|
+
Unit.autoAttackStartEvent:addListener(
|
|
78
|
+
999999,
|
|
79
|
+
function(source, target)
|
|
80
|
+
if source[targetAttribute] ~= nil then
|
|
81
|
+
invokeEvent(source)
|
|
82
|
+
end
|
|
83
|
+
source[targetAttribute] = target
|
|
84
|
+
source[impactDelayAttribute] = (source:chooseWeapon(target) or source.firstWeapon).impactDelay
|
|
85
|
+
source[passedTimeAttribute] = -timerPeriod
|
|
86
|
+
units:add(source)
|
|
87
|
+
end
|
|
88
|
+
)
|
|
51
89
|
return ____exports
|
|
@@ -80,6 +80,8 @@ export declare class UnitWeapon {
|
|
|
80
80
|
readonly unit: Unit;
|
|
81
81
|
readonly index: 0 | 1;
|
|
82
82
|
constructor(unit: Unit, index: 0 | 1);
|
|
83
|
+
get isEnabled(): boolean;
|
|
84
|
+
set isEnabled(isEnabled: boolean);
|
|
83
85
|
get cooldown(): number;
|
|
84
86
|
set cooldown(cooldown: number);
|
|
85
87
|
get damage(): [minimumDamage: number, maximumDamage: number];
|
|
@@ -107,12 +109,13 @@ declare const enum UnitPropertyKey {
|
|
|
107
109
|
SYNC_ID = 100,
|
|
108
110
|
IS_PAUSED = 101,
|
|
109
111
|
STUN_COUNTER = 102,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
FORCE_STUN_COUNTER = 103,
|
|
113
|
+
DELAY_HEALTH_CHECKS_COUNTER = 104,
|
|
114
|
+
DELAY_HEALTH_CHECKS_HEALTH_BONUS = 105,
|
|
115
|
+
PREVENT_DEATH_HEALTH_BONUS = 106,
|
|
116
|
+
IS_TEAM_GLOW_HIDDEN = 107,
|
|
117
|
+
LAST_X = 108,
|
|
118
|
+
LAST_Y = 109
|
|
116
119
|
}
|
|
117
120
|
export type UnitSyncId = number & {
|
|
118
121
|
readonly __unitSyncId: unique symbol;
|
|
@@ -121,6 +124,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
121
124
|
readonly syncId: UnitSyncId;
|
|
122
125
|
private [UnitPropertyKey.IS_PAUSED]?;
|
|
123
126
|
private [UnitPropertyKey.STUN_COUNTER]?;
|
|
127
|
+
private [UnitPropertyKey.FORCE_STUN_COUNTER]?;
|
|
124
128
|
private [UnitPropertyKey.DELAY_HEALTH_CHECKS_COUNTER]?;
|
|
125
129
|
private [UnitPropertyKey.DELAY_HEALTH_CHECKS_HEALTH_BONUS]?;
|
|
126
130
|
private [UnitPropertyKey.PREVENT_DEATH_HEALTH_BONUS]?;
|
|
@@ -135,6 +139,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
135
139
|
private _fields?;
|
|
136
140
|
private getEvent;
|
|
137
141
|
constructor(handle: junit);
|
|
142
|
+
private saveData;
|
|
138
143
|
protected onDestroy(): HandleDestructor;
|
|
139
144
|
addAttackHandler(condition: AttackHandlerCondition, action: AttackHandlerAction): AttackHandler;
|
|
140
145
|
removeAttackHandler(handler: AttackHandler): boolean;
|
|
@@ -160,8 +165,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
160
165
|
isInRangeOf(unit: Unit, range: number): boolean;
|
|
161
166
|
isAllyOf(unit: Unit): boolean;
|
|
162
167
|
isEnemyOf(unit: Unit): boolean;
|
|
163
|
-
playAnimation(animation: string, rarity?: jraritycontrol): void;
|
|
164
|
-
playAnimation(animation: number): void;
|
|
168
|
+
playAnimation(...parameters: [animation: number] | [animation: string, rarity?: jraritycontrol]): void;
|
|
165
169
|
resetAnimation(): void;
|
|
166
170
|
queueAnimation(animation: string): void;
|
|
167
171
|
get weapons(): [UnitWeapon, UnitWeapon];
|
|
@@ -174,16 +178,10 @@ export declare class Unit extends Handle<junit> {
|
|
|
174
178
|
set xp(v: number);
|
|
175
179
|
get primaryAttribute(): UnitAttribute;
|
|
176
180
|
set primaryAttribute(primaryAttribute: UnitAttribute);
|
|
177
|
-
get strengthBase(): number;
|
|
178
|
-
set strengthBase(strengthBase: number);
|
|
179
181
|
get strengthBonus(): number;
|
|
180
182
|
get strength(): number;
|
|
181
|
-
get agilityBase(): number;
|
|
182
|
-
set agilityBase(agilityBase: number);
|
|
183
183
|
get agilityBonus(): number;
|
|
184
184
|
get agility(): number;
|
|
185
|
-
get intelligenceBase(): number;
|
|
186
|
-
set intelligenceBase(intelligenceBase: number);
|
|
187
185
|
get intelligenceBonus(): number;
|
|
188
186
|
get intelligence(): number;
|
|
189
187
|
get name(): string;
|
|
@@ -217,8 +215,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
217
215
|
set facing(v: number);
|
|
218
216
|
get speed(): number;
|
|
219
217
|
set speed(v: number);
|
|
220
|
-
get flyHeight(): number;
|
|
221
|
-
set flyHeight(v: number);
|
|
222
218
|
get x(): number;
|
|
223
219
|
set x(v: number);
|
|
224
220
|
get y(): number;
|
|
@@ -242,8 +238,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
242
238
|
get isInvulnerable(): boolean;
|
|
243
239
|
get vertexColor(): Color;
|
|
244
240
|
set vertexColor(v: Color);
|
|
245
|
-
get scale(): number;
|
|
246
|
-
set scale(v: number);
|
|
247
241
|
get timeScale(): number;
|
|
248
242
|
set timeScale(v: number);
|
|
249
243
|
get collisionSize(): number;
|
|
@@ -267,18 +261,17 @@ export declare class Unit extends Handle<junit> {
|
|
|
267
261
|
dropItemTarget(item: Item, target: Widget): boolean;
|
|
268
262
|
dropItemSlot(item: Item, slot: number): boolean;
|
|
269
263
|
itemInSlot(slot: number): Item | null;
|
|
270
|
-
addAbility(abilityId: number): UnitAbility |
|
|
264
|
+
addAbility(abilityId: number): UnitAbility | undefined;
|
|
271
265
|
makeAbilityPermanent(abilityId: number, permanent: true): boolean;
|
|
272
266
|
setAbilityLevel(abilityId: number, level: number): number;
|
|
273
267
|
getAbilityLevel(abilityId: number): number;
|
|
274
268
|
hasAbility(abilityId: number): boolean;
|
|
275
|
-
|
|
276
|
-
removeAbility(
|
|
269
|
+
getAbility(abilityId: number): UnitAbility | undefined;
|
|
270
|
+
removeAbility(abilityTypeId: number): boolean;
|
|
277
271
|
hideAbility(abilityId: number, flag: boolean): void;
|
|
278
272
|
getAbilityRemainingCooldown(abilityId: number): number;
|
|
279
273
|
startAbilityCooldown(abilityId: number, cooldown: number): void;
|
|
280
274
|
endAbilityCooldown(abilityId: number): void;
|
|
281
|
-
interruptAttack(): void;
|
|
282
275
|
interruptCast(abilityId: number): void;
|
|
283
276
|
getDistanceTo(target: Unit | Vec2): number;
|
|
284
277
|
getCollisionDistanceTo(...target: [Unit] | [targetX: number, targetY: number]): number;
|
|
@@ -292,12 +285,13 @@ export declare class Unit extends Handle<junit> {
|
|
|
292
285
|
unpauseEx(): void;
|
|
293
286
|
incrementStunCounter(): void;
|
|
294
287
|
decrementStunCounter(): void;
|
|
288
|
+
incrementForceStunCounter(): void;
|
|
289
|
+
decrementForceStunCounter(): void;
|
|
295
290
|
set waygateActive(v: boolean);
|
|
296
291
|
get waygateActive(): boolean;
|
|
297
292
|
set waygateDestination(v: Vec2);
|
|
298
293
|
get waygateDestination(): Vec2;
|
|
299
294
|
get abilities(): ReadonlyArray<UnitAbility>;
|
|
300
|
-
get onUnitInRange(): Record<number, Event<[Unit]>>;
|
|
301
295
|
get onManaEqual(): Record<number, Event<[Unit, number]>>;
|
|
302
296
|
get manaEvent(): Record<Operator, Record<number, Event<[Unit]>>>;
|
|
303
297
|
get targetAcquiredEvent(): Event;
|
|
@@ -316,6 +310,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
316
310
|
static getInCollisionRange(x: number, y: number, range: number, predicate?: (unit: Unit) => boolean): Unit[];
|
|
317
311
|
static getInSector(pos: Vec2, range: number, offsetAngle: number, centralAngle: number): Unit[];
|
|
318
312
|
static getSelectionOf(player: Player, target?: Unit[]): Unit[];
|
|
313
|
+
static readonly levelChangedEvent: UnitTriggerEvent<[]>;
|
|
319
314
|
static readonly deathEvent: UnitTriggerEvent<[Unit]>;
|
|
320
315
|
static readonly onDecay: UnitTriggerEvent<[]>;
|
|
321
316
|
static readonly onResurrect: InitializingEvent<[Unit], void>;
|
|
@@ -353,7 +348,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
353
348
|
static itemDroppedEvent: UnitTriggerEvent<[Item]>;
|
|
354
349
|
static itemPickedUpEvent: UnitTriggerEvent<[Item]>;
|
|
355
350
|
static itemUsedEvent: UnitTriggerEvent<[Item]>;
|
|
356
|
-
static itemStackedEvent: UnitTriggerEvent<[Item]>;
|
|
357
351
|
static get itemChargesChangedEvent(): Event<[unit: Unit, item: Item]>;
|
|
358
352
|
static get itemUseOrderEvent(): Event<[unit: Unit, item: Item]>;
|
|
359
353
|
static get itemMoveOrderEvent(): Event<[
|
|
@@ -373,5 +367,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
373
367
|
setField(field: junitstringfield, value: string): boolean;
|
|
374
368
|
toString(): string;
|
|
375
369
|
static getBySyncId(syncId: UnitSyncId): Unit | undefined;
|
|
370
|
+
static synchronize: (player: Player, object: Unit | undefined) => Promise<Unit | undefined>;
|
|
376
371
|
}
|
|
377
372
|
export {};
|