warscript 0.0.1-dev.5abc199 → 0.0.1-dev.5bc80ec
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/core/dummy.lua +4 -2
- package/core/types/effect.d.ts +11 -1
- package/core/types/effect.lua +43 -77
- package/core/types/frame.d.ts +16 -2
- package/core/types/frame.lua +128 -67
- 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/missile.lua +7 -6
- package/core/types/player.d.ts +2 -1
- package/core/types/player.lua +18 -13
- 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 +7 -2
- package/core/types/tileCell.lua +11 -0
- package/core/types/unit.d.ts +5 -0
- package/core/types/unit.lua +5 -0
- package/core/util.d.ts +3 -1
- package/core/util.lua +109 -3
- package/decl/native.d.ts +706 -7
- package/engine/ability-type-extended-tooltip.d.ts +8 -0
- package/engine/ability-type-extended-tooltip.lua +44 -0
- package/engine/behaviour/ability/apply-unit-behavior.lua +5 -0
- package/engine/behaviour/ability/damage.d.ts +4 -0
- package/engine/behaviour/ability/damage.lua +19 -15
- package/engine/behaviour/ability/emulate-impact.d.ts +14 -0
- package/engine/behaviour/ability/emulate-impact.lua +79 -5
- package/engine/behaviour/ability/instant-impact.d.ts +12 -1
- package/engine/behaviour/ability/instant-impact.lua +17 -2
- package/engine/behaviour/ability/on-command-impact.d.ts +1 -0
- package/engine/behaviour/ability/on-command-impact.lua +1 -0
- package/engine/behaviour/ability.d.ts +13 -5
- package/engine/behaviour/ability.lua +89 -8
- package/engine/behaviour/unit.d.ts +1 -0
- package/engine/behaviour/unit.lua +1 -0
- package/engine/buff.d.ts +92 -53
- package/engine/buff.lua +427 -246
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +7 -0
- package/engine/internal/ability.lua +65 -36
- package/engine/internal/item/fields.d.ts +12 -0
- package/engine/internal/item/fields.lua +33 -0
- package/engine/internal/item/owner-cache.d.ts +5 -0
- package/engine/internal/item/owner-cache.lua +4 -0
- package/engine/internal/item+owner.d.ts +2 -0
- package/engine/internal/item+owner.lua +27 -4
- package/engine/internal/item.d.ts +20 -5
- package/engine/internal/item.lua +146 -57
- package/engine/internal/misc/unit-ability-level-natives.lua +12 -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/health-regeneration-rate-increase.d.ts +2 -0
- package/engine/internal/object-data/health-regeneration-rate-increase.lua +48 -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/returned-melee-damage-factor.d.ts +2 -0
- package/engine/internal/object-data/returned-melee-damage-factor.lua +21 -0
- package/engine/internal/unit/ability.lua +16 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +3 -14
- package/engine/internal/unit/add-item-to-slot.lua +53 -12
- package/engine/internal/unit/appearance.d.ts +15 -0
- package/engine/internal/unit/appearance.lua +85 -0
- package/engine/internal/unit/bonus.d.ts +15 -0
- package/engine/internal/unit/bonus.lua +103 -8
- package/engine/internal/unit/buff.d.ts +2 -2
- package/engine/internal/unit/buff.lua +34 -19
- package/engine/internal/unit/equipment-inventory.d.ts +44 -0
- package/engine/internal/unit/equipment-inventory.lua +233 -0
- package/engine/internal/unit/expiration-timer.lua +1 -1
- package/engine/internal/unit/extended-inventory.d.ts +25 -0
- package/engine/internal/unit/extended-inventory.lua +99 -0
- package/engine/internal/unit/ignore-events-items.lua +10 -1
- package/engine/internal/unit/{item.d.ts → inventory.d.ts} +7 -3
- package/engine/internal/unit/inventory.lua +87 -0
- package/engine/internal/unit/item-container.d.ts +25 -0
- package/engine/internal/unit/item-container.lua +11 -0
- package/engine/internal/unit/item-order-events.d.ts +17 -0
- package/engine/internal/unit/item-order-events.lua +67 -0
- package/engine/internal/unit/item-slot.d.ts +27 -0
- package/engine/internal/unit/item-slot.lua +92 -0
- package/engine/internal/unit/order.d.ts +3 -3
- package/engine/internal/unit/order.lua +10 -10
- package/engine/internal/unit+ability.d.ts +2 -1
- package/engine/internal/unit+ability.lua +73 -2
- 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+rally.lua +9 -31
- package/engine/internal/unit-missile-data.lua +58 -32
- package/engine/internal/unit-missile-launch.lua +13 -13
- package/engine/internal/unit.d.ts +2 -10
- package/engine/internal/unit.lua +53 -100
- package/engine/local-client.d.ts +26 -0
- package/engine/local-client.lua +294 -54
- package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -0
- package/engine/object-data/auxiliary/attachment-preset.lua +7 -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 +12 -0
- package/engine/object-data/auxiliary/equipment-type.lua +26 -0
- package/engine/object-data/auxiliary/item-class.d.ts +11 -0
- package/engine/object-data/auxiliary/item-class.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/order-type.d.ts +939 -0
- package/engine/object-data/auxiliary/order-type.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/aura-of-blight.d.ts +13 -0
- package/engine/object-data/entry/ability-type/aura-of-blight.lua +39 -0
- 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/barrage.d.ts +12 -0
- package/engine/object-data/entry/ability-type/barrage.lua +52 -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.lua +2 -2
- package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.d.ts +23 -0
- package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.lua +112 -0
- package/engine/object-data/entry/ability-type/blank-passive.d.ts +4 -0
- package/engine/object-data/entry/ability-type/blank-passive.lua +27 -7
- package/engine/object-data/entry/ability-type/breath-of-fire.d.ts +11 -0
- package/engine/object-data/entry/ability-type/breath-of-fire.lua +27 -0
- package/engine/object-data/entry/ability-type/channel.d.ts +2 -2
- package/engine/object-data/entry/ability-type/channel.lua +3 -3
- 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/exhume-corpses.d.ts +14 -0
- package/engine/object-data/entry/ability-type/exhume-corpses.lua +40 -0
- package/engine/object-data/entry/ability-type/firebolt.d.ts +7 -0
- package/engine/object-data/entry/ability-type/firebolt.lua +13 -0
- package/engine/object-data/entry/ability-type/flame-strike.d.ts +25 -0
- package/engine/object-data/entry/ability-type/flame-strike.lua +92 -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/healing-ward-aura.d.ts +13 -0
- package/engine/object-data/entry/ability-type/healing-ward-aura.lua +39 -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/item-life-regeneration.d.ts +10 -0
- package/engine/object-data/entry/ability-type/item-life-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/life-drain.d.ts +37 -0
- package/engine/object-data/entry/ability-type/life-drain.lua +144 -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/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/rain-of-fire.d.ts +7 -0
- package/engine/object-data/entry/ability-type/rain-of-fire.lua +13 -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/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-burn.d.ts +22 -0
- package/engine/object-data/entry/ability-type/soul-burn.lua +79 -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 +33 -8
- package/engine/object-data/entry/ability-type.lua +259 -47
- package/engine/object-data/entry/buff-type/applicable.lua +122 -111
- 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 +6 -2
- package/engine/object-data/entry/destructible-type.lua +26 -0
- package/engine/object-data/entry/item-type.d.ts +18 -3
- package/engine/object-data/entry/item-type.lua +84 -0
- package/engine/object-data/entry/lightning-type.d.ts +6 -8
- package/engine/object-data/entry/lightning-type.lua +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +2 -2
- package/engine/object-data/entry/unit-type.d.ts +57 -2
- package/engine/object-data/entry/unit-type.lua +412 -64
- package/engine/object-data/entry/upgrade.d.ts +2 -2
- package/engine/object-data/entry.d.ts +6 -1
- package/engine/object-data/entry.lua +8 -0
- package/engine/object-field/ability.lua +2 -2
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field.d.ts +1 -1
- package/engine/object-field.lua +9 -7
- package/engine/random.lua +1 -1
- package/engine/standard/entries/ability-type.d.ts +3102 -7
- package/engine/standard/entries/ability-type.lua +0 -6
- package/engine/standard/entries/buff-type.d.ts +45 -0
- package/engine/standard/entries/buff-type.lua +43 -0
- package/engine/standard/entries/item-type.d.ts +1299 -0
- package/engine/standard/entries/item-type.lua +2 -0
- package/engine/standard/entries/lightning-type.d.ts +42 -15
- package/engine/standard/entries/lightning-type.lua +0 -14
- 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/unit.d.ts +5 -1
- package/engine/unit.lua +5 -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/network.lua +25 -1
- package/objutil/buff.lua +1 -1
- package/objutil/object.lua +1 -1
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -23
- package/utility/arrays.d.ts +7 -1
- package/utility/arrays.lua +17 -0
- package/utility/linked-map.d.ts +2 -1
- package/utility/linked-map.lua +6 -0
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +6 -0
- package/utility/random.d.ts +102 -0
- package/utility/random.lua +273 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/engine/internal/unit/item.lua +0 -78
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/unit-ability-level-natives.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
|
@@ -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
|
),
|
|
@@ -22,19 +22,19 @@ local targetAttribute = attribute()
|
|
|
22
22
|
local impactDelayAttribute = attribute()
|
|
23
23
|
local passedTimeAttribute = attribute()
|
|
24
24
|
local instantOrderIds = luaSetOf(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
852086,
|
|
26
|
+
852100,
|
|
27
|
+
852090,
|
|
28
|
+
852177,
|
|
29
|
+
852002,
|
|
30
|
+
852003,
|
|
31
|
+
852004,
|
|
32
|
+
852005,
|
|
33
|
+
852006,
|
|
34
|
+
852007,
|
|
35
|
+
852087,
|
|
36
|
+
852091,
|
|
37
|
+
852178
|
|
38
38
|
)
|
|
39
39
|
---
|
|
40
40
|
-- @internal For use by internal systems only.
|
|
@@ -162,7 +162,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
162
162
|
isVisibleTo(player: Player): boolean;
|
|
163
163
|
isInvisibleTo(player: Player): boolean;
|
|
164
164
|
isInRangeOf(x: number, y: number, range: number): boolean;
|
|
165
|
-
isInRangeOf(
|
|
165
|
+
isInRangeOf(widget: Widget, range: number): boolean;
|
|
166
166
|
isAllyOf(unit: Unit): boolean;
|
|
167
167
|
isEnemyOf(unit: Unit): boolean;
|
|
168
168
|
playAnimation(...parameters: [animation: number] | [animation: string, rarity?: jraritycontrol]): void;
|
|
@@ -321,7 +321,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
321
321
|
static readonly constructionStartEvent: UnitTriggerEvent<[]>;
|
|
322
322
|
static readonly onUpgradeFinish: UnitTriggerEvent<[]>;
|
|
323
323
|
static readonly onSpellEffect: EventDispatcher<[Unit, number], [Unit]>;
|
|
324
|
-
static readonly onTargetCast: EventDispatcher<[Unit, number,
|
|
324
|
+
static readonly onTargetCast: EventDispatcher<[Unit, number, Destructable | Unit | Item], [Unit, Destructable | Unit | Item]>;
|
|
325
325
|
static readonly onCastPrepare: AbilityEventDispatcher<[]>;
|
|
326
326
|
static readonly onCast: AbilityEventDispatcher<[]>;
|
|
327
327
|
static readonly onPointCastPrepare: AbilityEventDispatcher<[number, number]>;
|
|
@@ -348,15 +348,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
348
348
|
static itemDroppedEvent: UnitTriggerEvent<[Item]>;
|
|
349
349
|
static itemPickedUpEvent: UnitTriggerEvent<[Item]>;
|
|
350
350
|
static itemUsedEvent: UnitTriggerEvent<[Item]>;
|
|
351
|
-
static itemStackedEvent: UnitTriggerEvent<[target: Item, source: Item]>;
|
|
352
351
|
static get itemChargesChangedEvent(): Event<[unit: Unit, item: Item]>;
|
|
353
|
-
static get itemUseOrderEvent(): Event<[unit: Unit, item: Item]>;
|
|
354
|
-
static get itemMoveOrderEvent(): Event<[
|
|
355
|
-
unit: Unit,
|
|
356
|
-
item: Item,
|
|
357
|
-
slotFrom: 0 | 1 | 2 | 3 | 4 | 5,
|
|
358
|
-
slotTo: 0 | 1 | 2 | 3 | 4 | 5
|
|
359
|
-
]>;
|
|
360
352
|
static get onCreate(): EventDispatcher<[Unit], [Unit]>;
|
|
361
353
|
static get destroyEvent(): EventDispatcher<[Unit], [Unit]>;
|
|
362
354
|
getField(field: junitintegerfield | junitrealfield): number;
|
package/engine/internal/unit.lua
CHANGED
|
@@ -7,10 +7,10 @@ local __TS__Class = ____lualib.__TS__Class
|
|
|
7
7
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
8
8
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
9
9
|
local __TS__ArraySetLength = ____lualib.__TS__ArraySetLength
|
|
10
|
+
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
10
11
|
local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
|
|
11
12
|
local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
|
|
12
13
|
local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
|
|
13
|
-
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
14
14
|
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
15
15
|
local Set = ____lualib.Set
|
|
16
16
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
@@ -47,12 +47,10 @@ local checkNotNull = ____preconditions.checkNotNull
|
|
|
47
47
|
local ____constants = require("engine.constants")
|
|
48
48
|
local HEALTH_REGENERATION_RATE_BONUS_PER_STRENGTH_POINT = ____constants.HEALTH_REGENERATION_RATE_BONUS_PER_STRENGTH_POINT
|
|
49
49
|
local MANA_REGENERATION_RATE_BONUS_PER_INTELLIGENCE_POINT = ____constants.MANA_REGENERATION_RATE_BONUS_PER_INTELLIGENCE_POINT
|
|
50
|
-
local ____arrays = require("utility.arrays")
|
|
51
|
-
local forEach = ____arrays.forEach
|
|
52
|
-
local ____math = require("math")
|
|
53
|
-
local min = ____math.min
|
|
54
50
|
local ____ignore_2Devents_2Ditems = require("engine.internal.unit.ignore-events-items")
|
|
55
|
-
local
|
|
51
|
+
local isItemIgnoredInEvents = ____ignore_2Devents_2Ditems.isItemIgnoredInEvents
|
|
52
|
+
local ____owner_2Dcache = require("engine.internal.item.owner-cache")
|
|
53
|
+
local ownerByItem = ____owner_2Dcache.ownerByItem
|
|
56
54
|
local ____attack_2Dtype = require("engine.object-data.auxiliary.attack-type")
|
|
57
55
|
local attackTypeToNative = ____attack_2Dtype.attackTypeToNative
|
|
58
56
|
local nativeToAttackType = ____attack_2Dtype.nativeToAttackType
|
|
@@ -592,8 +590,6 @@ __TS__SetDescriptor(
|
|
|
592
590
|
},
|
|
593
591
|
true
|
|
594
592
|
)
|
|
595
|
-
local unitInventorySize = UnitInventorySize
|
|
596
|
-
local unitItemInSlot = UnitItemInSlot
|
|
597
593
|
local getItemAbility = BlzGetItemAbility
|
|
598
594
|
local getUnitAbility = BlzGetUnitAbility
|
|
599
595
|
local getUnitAbilityByIndex = BlzGetUnitAbilityByIndex
|
|
@@ -611,8 +607,8 @@ local function retrieveAbility(unit, ability, abilityId)
|
|
|
611
607
|
____exports.Unit:of(unit)
|
|
612
608
|
)
|
|
613
609
|
end
|
|
614
|
-
for i = 0,
|
|
615
|
-
local item =
|
|
610
|
+
for i = 0, UnitInventorySize(unit) - 1 do
|
|
611
|
+
local item = UnitItemInSlot(unit, i)
|
|
616
612
|
if getItemAbility(item, abilityId) == ability then
|
|
617
613
|
return ItemAbility:of(
|
|
618
614
|
ability,
|
|
@@ -778,7 +774,9 @@ function Unit.prototype.onDestroy(self)
|
|
|
778
774
|
end
|
|
779
775
|
local eventsToDestroy = self._eventsToDestroy
|
|
780
776
|
if eventsToDestroy ~= nil then
|
|
781
|
-
|
|
777
|
+
for ____, event in ipairs(eventsToDestroy) do
|
|
778
|
+
event:destroy()
|
|
779
|
+
end
|
|
782
780
|
end
|
|
783
781
|
if getUnitAbilityLevel(handle, leaveDetectAbilityId) > 0 then
|
|
784
782
|
unitRemoveAbility(handle, leaveDetectAbilityId)
|
|
@@ -848,13 +846,19 @@ function Unit.prototype.isInvisibleTo(self, player)
|
|
|
848
846
|
return isUnitInvisible(self.handle, player.handle)
|
|
849
847
|
end
|
|
850
848
|
function Unit.prototype.isInRangeOf(self, x, y, range)
|
|
851
|
-
local
|
|
849
|
+
local ____temp_4
|
|
852
850
|
if type(x) == "number" then
|
|
853
|
-
|
|
851
|
+
____temp_4 = isUnitInRangeXY(self.handle, x, y, range)
|
|
854
852
|
else
|
|
855
|
-
____temp_3
|
|
853
|
+
local ____temp_3
|
|
854
|
+
if __TS__InstanceOf(x, ____exports.Unit) then
|
|
855
|
+
____temp_3 = isUnitInRange(self.handle, x.handle, y)
|
|
856
|
+
else
|
|
857
|
+
____temp_3 = isUnitInRangeXY(self.handle, x.x, x.y, range)
|
|
858
|
+
end
|
|
859
|
+
____temp_4 = ____temp_3
|
|
856
860
|
end
|
|
857
|
-
return
|
|
861
|
+
return ____temp_4
|
|
858
862
|
end
|
|
859
863
|
function Unit.prototype.isAllyOf(self, unit)
|
|
860
864
|
return isUnitAlly(
|
|
@@ -912,14 +916,14 @@ function Unit.prototype.kill(self)
|
|
|
912
916
|
killUnit(self.handle)
|
|
913
917
|
end
|
|
914
918
|
function Unit.prototype.revive(self, x, y, doEffect)
|
|
915
|
-
local
|
|
916
|
-
local
|
|
917
|
-
local
|
|
918
|
-
if
|
|
919
|
-
|
|
919
|
+
local ____ReviveHero_7 = ReviveHero
|
|
920
|
+
local ____array_6 = __TS__SparseArrayNew(self.handle, x, y)
|
|
921
|
+
local ____doEffect_5 = doEffect
|
|
922
|
+
if ____doEffect_5 == nil then
|
|
923
|
+
____doEffect_5 = false
|
|
920
924
|
end
|
|
921
|
-
__TS__SparseArrayPush(
|
|
922
|
-
|
|
925
|
+
__TS__SparseArrayPush(____array_6, ____doEffect_5)
|
|
926
|
+
____ReviveHero_7(__TS__SparseArraySpread(____array_6))
|
|
923
927
|
end
|
|
924
928
|
function Unit.prototype.healTarget(self, target, amount)
|
|
925
929
|
if __TS__InstanceOf(target, ____exports.Unit) and target:hasAbility(fourCC("BIhm")) then
|
|
@@ -959,7 +963,7 @@ function Unit.prototype.dropItemSlot(self, item, slot)
|
|
|
959
963
|
return UnitDropItemSlot(self.handle, item.handle, slot)
|
|
960
964
|
end
|
|
961
965
|
function Unit.prototype.itemInSlot(self, slot)
|
|
962
|
-
return Item:of(
|
|
966
|
+
return Item:of(UnitItemInSlot(self.handle, slot))
|
|
963
967
|
end
|
|
964
968
|
function Unit.prototype.addAbility(self, abilityId)
|
|
965
969
|
local ability = UnitAbility:of(
|
|
@@ -995,6 +999,9 @@ function Unit.prototype.removeAbility(self, abilityTypeId)
|
|
|
995
999
|
if abilities[i].typeId == abilityTypeId then
|
|
996
1000
|
local ability = abilities[i]
|
|
997
1001
|
tremove(abilities, i)
|
|
1002
|
+
if ability.state == 2 then
|
|
1003
|
+
break
|
|
1004
|
+
end
|
|
998
1005
|
ability:destroy()
|
|
999
1006
|
return true
|
|
1000
1007
|
end
|
|
@@ -1317,7 +1324,7 @@ __TS__SetDescriptor(
|
|
|
1317
1324
|
Unit.prototype,
|
|
1318
1325
|
"isStunned",
|
|
1319
1326
|
{get = function(self)
|
|
1320
|
-
return getUnitCurrentOrder(self.handle) ==
|
|
1327
|
+
return getUnitCurrentOrder(self.handle) == 851973
|
|
1321
1328
|
end},
|
|
1322
1329
|
true
|
|
1323
1330
|
)
|
|
@@ -1493,13 +1500,13 @@ __TS__SetDescriptor(
|
|
|
1493
1500
|
end,
|
|
1494
1501
|
set = function(self, isTeamGlowVisible)
|
|
1495
1502
|
BlzShowUnitTeamGlow(self.handle, isTeamGlowVisible)
|
|
1496
|
-
local
|
|
1503
|
+
local ____temp_8
|
|
1497
1504
|
if not isTeamGlowVisible then
|
|
1498
|
-
|
|
1505
|
+
____temp_8 = true
|
|
1499
1506
|
else
|
|
1500
|
-
|
|
1507
|
+
____temp_8 = nil
|
|
1501
1508
|
end
|
|
1502
|
-
self[107] =
|
|
1509
|
+
self[107] = ____temp_8
|
|
1503
1510
|
end
|
|
1504
1511
|
},
|
|
1505
1512
|
true
|
|
@@ -1879,7 +1886,7 @@ __TS__SetDescriptor(
|
|
|
1879
1886
|
Unit.prototype,
|
|
1880
1887
|
"pathingCollisionRange",
|
|
1881
1888
|
{get = function(self)
|
|
1882
|
-
return 16 * (min(
|
|
1889
|
+
return 16 * (math.min(
|
|
1883
1890
|
getUnitCollisionSize(self.handle) // 16,
|
|
1884
1891
|
3
|
|
1885
1892
|
) + 1)
|
|
@@ -2146,7 +2153,7 @@ Unit.onResurrect = __TS__New(
|
|
|
2146
2153
|
____exports.Unit.deathEvent:addListener(function(unit)
|
|
2147
2154
|
dead[unit] = true
|
|
2148
2155
|
end)
|
|
2149
|
-
____exports.Unit.onImmediateOrder[
|
|
2156
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2150
2157
|
if dead[unit] and not IsUnitType(unit.handle, UNIT_TYPE_DEAD) then
|
|
2151
2158
|
dead[unit] = false
|
|
2152
2159
|
invoke(event, unit)
|
|
@@ -2163,7 +2170,7 @@ Unit.morphEvent = __TS__New(
|
|
|
2163
2170
|
invoke(event, unit)
|
|
2164
2171
|
end
|
|
2165
2172
|
end
|
|
2166
|
-
____exports.Unit.onImmediateOrder[
|
|
2173
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2167
2174
|
if getUnitAbilityLevel(unit.handle, morphDetectAbilityId) == 0 then
|
|
2168
2175
|
Timer:run(ifNotLeft, unit)
|
|
2169
2176
|
end
|
|
@@ -2204,25 +2211,25 @@ Unit.onTargetCast = dispatchId(__TS__New(
|
|
|
2204
2211
|
InitializingEvent,
|
|
2205
2212
|
function(event)
|
|
2206
2213
|
local function listener(unit, id)
|
|
2207
|
-
local
|
|
2214
|
+
local ____GetSpellTargetUnit_result_11
|
|
2208
2215
|
if GetSpellTargetUnit() then
|
|
2209
|
-
|
|
2216
|
+
____GetSpellTargetUnit_result_11 = ____exports.Unit:of(GetSpellTargetUnit())
|
|
2210
2217
|
else
|
|
2211
|
-
local
|
|
2218
|
+
local ____GetSpellTargetItem_result_10
|
|
2212
2219
|
if GetSpellTargetItem() then
|
|
2213
|
-
|
|
2220
|
+
____GetSpellTargetItem_result_10 = Item:of(GetSpellTargetItem())
|
|
2214
2221
|
else
|
|
2215
|
-
local
|
|
2222
|
+
local ____GetSpellTargetDestructable_result_9
|
|
2216
2223
|
if GetSpellTargetDestructable() then
|
|
2217
|
-
|
|
2224
|
+
____GetSpellTargetDestructable_result_9 = Destructable:of(GetSpellTargetDestructable())
|
|
2218
2225
|
else
|
|
2219
|
-
|
|
2226
|
+
____GetSpellTargetDestructable_result_9 = nil
|
|
2220
2227
|
end
|
|
2221
|
-
|
|
2228
|
+
____GetSpellTargetItem_result_10 = ____GetSpellTargetDestructable_result_9
|
|
2222
2229
|
end
|
|
2223
|
-
|
|
2230
|
+
____GetSpellTargetUnit_result_11 = ____GetSpellTargetItem_result_10
|
|
2224
2231
|
end
|
|
2225
|
-
local target =
|
|
2232
|
+
local target = ____GetSpellTargetUnit_result_11
|
|
2226
2233
|
if target then
|
|
2227
2234
|
invoke(event, unit, id, target)
|
|
2228
2235
|
end
|
|
@@ -2630,7 +2637,7 @@ Unit.itemDroppedEvent = __TS__New(
|
|
|
2630
2637
|
function()
|
|
2631
2638
|
local unit = getTriggerUnit()
|
|
2632
2639
|
local item = getManipulatedItem()
|
|
2633
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2640
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2634
2641
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2635
2642
|
end
|
|
2636
2643
|
return IgnoreEvent
|
|
@@ -2642,10 +2649,10 @@ Unit.itemPickedUpEvent = __TS__New(
|
|
|
2642
2649
|
function()
|
|
2643
2650
|
local unitHandle = getTriggerUnit()
|
|
2644
2651
|
local itemHandle = getManipulatedItem()
|
|
2645
|
-
if getUnitTypeId(unitHandle) ~= dummyUnitId and not (
|
|
2652
|
+
if getUnitTypeId(unitHandle) ~= dummyUnitId and not isItemIgnoredInEvents(itemHandle) then
|
|
2646
2653
|
local unit = ____exports.Unit:of(unitHandle)
|
|
2647
2654
|
local item = Item:of(itemHandle)
|
|
2648
|
-
if item
|
|
2655
|
+
if ownerByItem[item] ~= unit then
|
|
2649
2656
|
return unit, item
|
|
2650
2657
|
end
|
|
2651
2658
|
end
|
|
@@ -2658,17 +2665,12 @@ Unit.itemUsedEvent = __TS__New(
|
|
|
2658
2665
|
function()
|
|
2659
2666
|
local unit = getTriggerUnit()
|
|
2660
2667
|
local item = getManipulatedItem()
|
|
2661
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2668
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2662
2669
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2663
2670
|
end
|
|
2664
2671
|
return IgnoreEvent
|
|
2665
2672
|
end
|
|
2666
2673
|
)
|
|
2667
|
-
Unit.itemStackedEvent = __TS__New(
|
|
2668
|
-
____exports.UnitTriggerEvent,
|
|
2669
|
-
EVENT_PLAYER_UNIT_STACK_ITEM,
|
|
2670
|
-
function() return ____exports.Unit:of(getTriggerUnit()), Item:of(BlzGetStackingItemTarget()), Item:of(BlzGetStackingItemSource()) end
|
|
2671
|
-
)
|
|
2672
2674
|
__TS__ObjectDefineProperty(
|
|
2673
2675
|
Unit,
|
|
2674
2676
|
"itemChargesChangedEvent",
|
|
@@ -2684,51 +2686,6 @@ __TS__ObjectDefineProperty(
|
|
|
2684
2686
|
return event
|
|
2685
2687
|
end}
|
|
2686
2688
|
)
|
|
2687
|
-
__TS__ObjectDefineProperty(
|
|
2688
|
-
Unit,
|
|
2689
|
-
"itemUseOrderEvent",
|
|
2690
|
-
{get = function(self)
|
|
2691
|
-
local event = __TS__New(Event)
|
|
2692
|
-
for order = orderId("useslot0"), orderId("useslot5") do
|
|
2693
|
-
local slot = order - orderId("useslot0")
|
|
2694
|
-
local function listener(unit)
|
|
2695
|
-
local item = unit.items[slot + 1]
|
|
2696
|
-
if item ~= nil then
|
|
2697
|
-
invoke(event, unit, item)
|
|
2698
|
-
end
|
|
2699
|
-
end
|
|
2700
|
-
self.onImmediateOrder[order]:addListener(listener)
|
|
2701
|
-
self.onTargetOrder[order]:addListener(listener)
|
|
2702
|
-
self.onPointOrder[order]:addListener(listener)
|
|
2703
|
-
end
|
|
2704
|
-
rawset(self, "itemUseOrderEvent", event)
|
|
2705
|
-
return event
|
|
2706
|
-
end}
|
|
2707
|
-
)
|
|
2708
|
-
__TS__ObjectDefineProperty(
|
|
2709
|
-
Unit,
|
|
2710
|
-
"itemMoveOrderEvent",
|
|
2711
|
-
{get = function(self)
|
|
2712
|
-
local event = __TS__New(Event)
|
|
2713
|
-
for order = orderId("moveslot0"), orderId("moveslot5") do
|
|
2714
|
-
local slotTo = order - orderId("moveslot0")
|
|
2715
|
-
self.onTargetOrder[order]:addListener(function(unit, item)
|
|
2716
|
-
local slotFrom = unit.items:findSlot(item)
|
|
2717
|
-
if slotFrom ~= nil then
|
|
2718
|
-
invoke(
|
|
2719
|
-
event,
|
|
2720
|
-
unit,
|
|
2721
|
-
item,
|
|
2722
|
-
slotFrom,
|
|
2723
|
-
slotTo
|
|
2724
|
-
)
|
|
2725
|
-
end
|
|
2726
|
-
end)
|
|
2727
|
-
end
|
|
2728
|
-
rawset(self, "itemMoveOrderEvent", event)
|
|
2729
|
-
return event
|
|
2730
|
-
end}
|
|
2731
|
-
)
|
|
2732
2689
|
__TS__ObjectDefineProperty(
|
|
2733
2690
|
Unit,
|
|
2734
2691
|
"onCreate",
|
|
@@ -2775,11 +2732,7 @@ Unit.synchronize = synchronizer(
|
|
|
2775
2732
|
function(____, id) return fourCC(id) end
|
|
2776
2733
|
)
|
|
2777
2734
|
end)
|
|
2778
|
-
for ____, leaveOrderId in ipairs({
|
|
2779
|
-
orderId("undefend"),
|
|
2780
|
-
orderId("magicundefense"),
|
|
2781
|
-
orderId("unimmolation")
|
|
2782
|
-
}) do
|
|
2735
|
+
for ____, leaveOrderId in ipairs({852056, 852479, 852178}) do
|
|
2783
2736
|
____exports.Unit.onImmediateOrder[leaveOrderId]:addListener(function(unit)
|
|
2784
2737
|
local handle = unit.handle
|
|
2785
2738
|
for i = 1, #leaveAbilityIds do
|
package/engine/local-client.d.ts
CHANGED
|
@@ -9,15 +9,41 @@ export declare class LocalClient {
|
|
|
9
9
|
static readonly locale: string;
|
|
10
10
|
static get width(): number;
|
|
11
11
|
static get height(): number;
|
|
12
|
+
static get isSD(): boolean;
|
|
12
13
|
static get isHD(): boolean;
|
|
14
|
+
static get isDE(): boolean;
|
|
13
15
|
static get graphicsMode(): GraphicsMode;
|
|
14
16
|
static get isActive(): boolean;
|
|
17
|
+
static get isMinimized(): boolean;
|
|
15
18
|
static pingMinimap(x: number, y: number, duration: number, ...parameters: [] | [red: number, green: number, blue: number, flashy?: boolean] | [color: Color, flashy?: boolean]): void;
|
|
19
|
+
/** Local input state; do not use to branch synchronized game logic. */
|
|
20
|
+
static isKeyPressed(key: joskeytype): boolean;
|
|
21
|
+
/** Local input state. Uses the same modifier mask as Player key events. */
|
|
22
|
+
static isMetaKeyPressed(key: oskeymeta): boolean;
|
|
23
|
+
/** Local input state. */
|
|
24
|
+
static isMouseButtonPressed(button: jmousebuttontype): boolean;
|
|
25
|
+
static get mouseScreenX(): number;
|
|
26
|
+
static get mouseScreenY(): number;
|
|
27
|
+
static screenToFrameX(x: number): number;
|
|
28
|
+
static screenToFrameY(y: number): number;
|
|
29
|
+
static frameToScreenX(x: number): number;
|
|
30
|
+
static frameToScreenY(y: number): number;
|
|
31
|
+
static get mouseFrameX(): number;
|
|
32
|
+
static get mouseFrameY(): number;
|
|
16
33
|
static get mouseFocusUnit(): Async<Unit> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Local selection sampled every 1/64 second; undefined before the first tick. Among
|
|
36
|
+
* several selected units, the one the portrait shows, identified by its health and
|
|
37
|
+
* mana; units with identical values cannot be told apart.
|
|
38
|
+
*/
|
|
17
39
|
static get mainSelectedUnit(): Async<Unit> | undefined;
|
|
18
40
|
static get mainSelectedUnitChangeEvent(): Event<[
|
|
19
41
|
previousMainSelectedUnit: Unit | undefined,
|
|
20
42
|
newMainSelectedUnit: Unit | undefined
|
|
21
43
|
]>;
|
|
44
|
+
static get isInTargetingMode(): boolean;
|
|
45
|
+
static readonly targetingModeEnterEvent: Event<[]>;
|
|
46
|
+
static readonly targetingModeLeaveEvent: Event<[]>;
|
|
47
|
+
static readonly targetingModeStateChangeEvent: Event<[]>;
|
|
22
48
|
static readonly onDisconnect: TriggerEvent<[]>;
|
|
23
49
|
}
|