warscript 0.0.1-dev.48e5280 → 0.0.1-dev.4b6e45a
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 +21 -2
- package/core/types/frame.lua +153 -78
- 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 +8 -7
- package/core/types/player.d.ts +2 -1
- package/core/types/player.lua +18 -13
- package/core/types/playerCamera.lua +1 -1
- 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 +8 -0
- 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 +79 -55
- package/engine/buff.lua +376 -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.d.ts +2 -0
- package/engine/internal/misc/unit-ability-level-natives.lua +12 -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/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 +11 -0
- package/engine/internal/unit/bonus.lua +80 -5
- 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/shared-vision-counter.d.ts +18 -0
- package/engine/internal/unit/shared-vision-counter.lua +31 -0
- package/engine/internal/unit+ability.d.ts +2 -1
- package/engine/internal/unit+ability.lua +73 -2
- 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 +96 -68
- package/engine/internal/unit-missile-launch.lua +13 -13
- package/engine/internal/unit.d.ts +5 -10
- package/engine/internal/unit.lua +67 -101
- package/engine/lightning.lua +4 -4
- 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/auxiliary/unit-weapon-type.d.ts +21 -0
- package/engine/object-data/auxiliary/unit-weapon-type.lua +2 -0
- 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/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/healing-modifier.d.ts +9 -0
- 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/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-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 +256 -48
- 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/text-tag.d.ts +13 -1
- package/engine/text-tag.lua +79 -42
- package/engine/unit.d.ts +6 -1
- package/engine/unit.lua +6 -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
|
@@ -34,74 +34,102 @@ local DEFAULT_VALUES = {
|
|
|
34
34
|
launchVisualOffsetY = ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y
|
|
35
35
|
}
|
|
36
36
|
local METATABLE = {__index = DEFAULT_VALUES}
|
|
37
|
+
local rawDataByUnitTypeId = postcompile(function()
|
|
38
|
+
return associate(
|
|
39
|
+
UnitType:getAll(),
|
|
40
|
+
function(unitType) return unitType.id end,
|
|
41
|
+
function(unitType)
|
|
42
|
+
return {
|
|
43
|
+
[0] = unitType.missileImpactOffsetZSD ~= ____exports.DEFAULT_MISSILE_IMPACT_OFFSET_Z and unitType.missileImpactOffsetZSD or nil,
|
|
44
|
+
[1] = unitType.missileImpactOffsetZHD ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZHD or nil,
|
|
45
|
+
[2] = unitType.missileImpactOffsetZDE ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZDE or nil,
|
|
46
|
+
[3] = unitType.missileLaunchOffsetX ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_X and unitType.missileLaunchOffsetX or nil,
|
|
47
|
+
[4] = unitType.missileLaunchOffsetY ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Y and unitType.missileLaunchOffsetY or nil,
|
|
48
|
+
[5] = unitType.missileLaunchOffsetZSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Z and unitType.missileLaunchOffsetZSD or nil,
|
|
49
|
+
[6] = unitType.missileLaunchOffsetZHD ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZHD or nil,
|
|
50
|
+
[7] = unitType.missileLaunchOffsetZDE ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZDE or nil,
|
|
51
|
+
[8] = unitType.missileLaunchVisualOffsetXSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_X and unitType.missileLaunchVisualOffsetXSD or nil,
|
|
52
|
+
[9] = unitType.missileLaunchVisualOffsetXHD ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXHD or nil,
|
|
53
|
+
[10] = unitType.missileLaunchVisualOffsetXDE ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXDE or nil,
|
|
54
|
+
[11] = unitType.missileLaunchVisualOffsetYSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y and unitType.missileLaunchVisualOffsetYSD or nil,
|
|
55
|
+
[12] = unitType.missileLaunchVisualOffsetYHD ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYHD or nil,
|
|
56
|
+
[13] = unitType.missileLaunchVisualOffsetYDE ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYDE or nil
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
)
|
|
60
|
+
end)
|
|
61
|
+
local function resolveData(data)
|
|
62
|
+
local ____setmetatable_10 = setmetatable
|
|
63
|
+
local ____LocalClient_isHD_1
|
|
64
|
+
if LocalClient.isHD then
|
|
65
|
+
____LocalClient_isHD_1 = data[1] or data[0]
|
|
66
|
+
else
|
|
67
|
+
local ____LocalClient_isDE_0
|
|
68
|
+
if LocalClient.isDE then
|
|
69
|
+
____LocalClient_isDE_0 = data[2] or data[0]
|
|
70
|
+
else
|
|
71
|
+
____LocalClient_isDE_0 = data[0]
|
|
72
|
+
end
|
|
73
|
+
____LocalClient_isHD_1 = ____LocalClient_isDE_0
|
|
74
|
+
end
|
|
75
|
+
local ____data__3_8 = data[3]
|
|
76
|
+
local ____data__4_9 = data[4]
|
|
77
|
+
local ____LocalClient_isHD_3
|
|
78
|
+
if LocalClient.isHD then
|
|
79
|
+
____LocalClient_isHD_3 = data[6] or data[5]
|
|
80
|
+
else
|
|
81
|
+
local ____LocalClient_isDE_2
|
|
82
|
+
if LocalClient.isDE then
|
|
83
|
+
____LocalClient_isDE_2 = data[7] or data[5]
|
|
84
|
+
else
|
|
85
|
+
____LocalClient_isDE_2 = data[5]
|
|
86
|
+
end
|
|
87
|
+
____LocalClient_isHD_3 = ____LocalClient_isDE_2
|
|
88
|
+
end
|
|
89
|
+
local ____LocalClient_isHD_5
|
|
90
|
+
if LocalClient.isHD then
|
|
91
|
+
____LocalClient_isHD_5 = data[9] or data[8]
|
|
92
|
+
else
|
|
93
|
+
local ____LocalClient_isDE_4
|
|
94
|
+
if LocalClient.isDE then
|
|
95
|
+
____LocalClient_isDE_4 = data[10] or data[8]
|
|
96
|
+
else
|
|
97
|
+
____LocalClient_isDE_4 = data[8]
|
|
98
|
+
end
|
|
99
|
+
____LocalClient_isHD_5 = ____LocalClient_isDE_4
|
|
100
|
+
end
|
|
101
|
+
local ____LocalClient_isHD_7
|
|
102
|
+
if LocalClient.isHD then
|
|
103
|
+
____LocalClient_isHD_7 = data[12] or data[11]
|
|
104
|
+
else
|
|
105
|
+
local ____LocalClient_isDE_6
|
|
106
|
+
if LocalClient.isDE then
|
|
107
|
+
____LocalClient_isDE_6 = data[13] or data[11]
|
|
108
|
+
else
|
|
109
|
+
____LocalClient_isDE_6 = data[11]
|
|
110
|
+
end
|
|
111
|
+
____LocalClient_isHD_7 = ____LocalClient_isDE_6
|
|
112
|
+
end
|
|
113
|
+
return ____setmetatable_10({
|
|
114
|
+
impactOffsetZ = ____LocalClient_isHD_1,
|
|
115
|
+
launchOffsetX = ____data__3_8,
|
|
116
|
+
launchOffsetY = ____data__4_9,
|
|
117
|
+
launchOffsetZ = ____LocalClient_isHD_3,
|
|
118
|
+
launchVisualOffsetX = ____LocalClient_isHD_5,
|
|
119
|
+
launchVisualOffsetY = ____LocalClient_isHD_7
|
|
120
|
+
}, METATABLE)
|
|
121
|
+
end
|
|
37
122
|
---
|
|
38
123
|
-- @internal For use by internal systems only.
|
|
39
|
-
____exports.MISSILE_DATA_BY_UNIT_TYPE_ID = (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
[0] = unitType.missileImpactOffsetZSD ~= ____exports.DEFAULT_MISSILE_IMPACT_OFFSET_Z and unitType.missileImpactOffsetZSD or nil,
|
|
51
|
-
[1] = unitType.missileImpactOffsetZHD ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZHD or nil,
|
|
52
|
-
[2] = unitType.missileLaunchOffsetX ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_X and unitType.missileLaunchOffsetX or nil,
|
|
53
|
-
[3] = unitType.missileLaunchOffsetY ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Y and unitType.missileLaunchOffsetY or nil,
|
|
54
|
-
[4] = unitType.missileLaunchOffsetZSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Z and unitType.missileLaunchOffsetZSD or nil,
|
|
55
|
-
[5] = unitType.missileLaunchOffsetZHD ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZHD or nil,
|
|
56
|
-
[6] = unitType.missileLaunchVisualOffsetXSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_X and unitType.missileLaunchVisualOffsetXSD or nil,
|
|
57
|
-
[7] = unitType.missileLaunchVisualOffsetXHD ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXHD or nil,
|
|
58
|
-
[8] = unitType.missileLaunchVisualOffsetYSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y and unitType.missileLaunchVisualOffsetYSD or nil,
|
|
59
|
-
[9] = unitType.missileLaunchVisualOffsetYHD ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYHD or nil
|
|
60
|
-
}
|
|
61
|
-
end
|
|
62
|
-
)
|
|
63
|
-
end),
|
|
64
|
-
function(data)
|
|
65
|
-
local ____setmetatable_6 = setmetatable
|
|
66
|
-
local ____LocalClient_isHD_0
|
|
67
|
-
if LocalClient.isHD then
|
|
68
|
-
____LocalClient_isHD_0 = data[1] or data[0]
|
|
69
|
-
else
|
|
70
|
-
____LocalClient_isHD_0 = data[0]
|
|
71
|
-
end
|
|
72
|
-
local ____data__2_4 = data[2]
|
|
73
|
-
local ____data__3_5 = data[3]
|
|
74
|
-
local ____LocalClient_isHD_1
|
|
75
|
-
if LocalClient.isHD then
|
|
76
|
-
____LocalClient_isHD_1 = data[5] or data[4]
|
|
77
|
-
else
|
|
78
|
-
____LocalClient_isHD_1 = data[4]
|
|
79
|
-
end
|
|
80
|
-
local ____LocalClient_isHD_2
|
|
81
|
-
if LocalClient.isHD then
|
|
82
|
-
____LocalClient_isHD_2 = data[7] or data[6]
|
|
83
|
-
else
|
|
84
|
-
____LocalClient_isHD_2 = data[6]
|
|
85
|
-
end
|
|
86
|
-
local ____LocalClient_isHD_3
|
|
87
|
-
if LocalClient.isHD then
|
|
88
|
-
____LocalClient_isHD_3 = data[9] or data[8]
|
|
89
|
-
else
|
|
90
|
-
____LocalClient_isHD_3 = data[8]
|
|
91
|
-
end
|
|
92
|
-
return ____setmetatable_6({
|
|
93
|
-
impactOffsetZ = ____LocalClient_isHD_0,
|
|
94
|
-
launchOffsetX = ____data__2_4,
|
|
95
|
-
launchOffsetY = ____data__3_5,
|
|
96
|
-
launchOffsetZ = ____LocalClient_isHD_1,
|
|
97
|
-
launchVisualOffsetX = ____LocalClient_isHD_2,
|
|
98
|
-
launchVisualOffsetY = ____LocalClient_isHD_3
|
|
99
|
-
}, METATABLE)
|
|
100
|
-
end
|
|
101
|
-
),
|
|
102
|
-
{__index = function(self)
|
|
103
|
-
return DEFAULT_VALUES
|
|
104
|
-
end}
|
|
105
|
-
)
|
|
106
|
-
end)()
|
|
124
|
+
____exports.MISSILE_DATA_BY_UNIT_TYPE_ID = setmetatable(
|
|
125
|
+
mapValues(rawDataByUnitTypeId, resolveData),
|
|
126
|
+
{__index = function(self)
|
|
127
|
+
return DEFAULT_VALUES
|
|
128
|
+
end}
|
|
129
|
+
)
|
|
130
|
+
warpack.afterMapInit(function()
|
|
131
|
+
for unitTypeId, data in pairs(rawDataByUnitTypeId) do
|
|
132
|
+
____exports.MISSILE_DATA_BY_UNIT_TYPE_ID[unitTypeId] = resolveData(data)
|
|
133
|
+
end
|
|
134
|
+
end)
|
|
107
135
|
return ____exports
|
|
@@ -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.
|
|
@@ -12,6 +12,7 @@ import { Widget } from "../../core/types/widget";
|
|
|
12
12
|
import type { UnitTypeId } from "../object-data/entry/unit-type";
|
|
13
13
|
import { CombatClassification, CombatClassifications } from "../object-data/auxiliary/combat-classification";
|
|
14
14
|
import { MovementType } from "../object-data/auxiliary/movement-type";
|
|
15
|
+
import { UnitWeaponType } from "../object-data/auxiliary/unit-weapon-type";
|
|
15
16
|
import { UnitAttribute } from "../object-data/auxiliary/unit-attribute";
|
|
16
17
|
import { AttackType } from "../object-data/auxiliary/attack-type";
|
|
17
18
|
import { AttributesHolder } from "../../attributes";
|
|
@@ -88,6 +89,8 @@ export declare class UnitWeapon {
|
|
|
88
89
|
set damage([minimumDamage, maximumDamage]: [number, number]);
|
|
89
90
|
get allowedTargetCombatClassifications(): CombatClassifications;
|
|
90
91
|
set allowedTargetCombatClassifications(allowedTargetCombatClassifications: CombatClassifications);
|
|
92
|
+
get type(): UnitWeaponType;
|
|
93
|
+
set type(type: UnitWeaponType);
|
|
91
94
|
get damageBase(): number;
|
|
92
95
|
set damageBase(damageBase: number);
|
|
93
96
|
get damageDiceCount(): number;
|
|
@@ -162,7 +165,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
162
165
|
isVisibleTo(player: Player): boolean;
|
|
163
166
|
isInvisibleTo(player: Player): boolean;
|
|
164
167
|
isInRangeOf(x: number, y: number, range: number): boolean;
|
|
165
|
-
isInRangeOf(
|
|
168
|
+
isInRangeOf(widget: Widget, range: number): boolean;
|
|
166
169
|
isAllyOf(unit: Unit): boolean;
|
|
167
170
|
isEnemyOf(unit: Unit): boolean;
|
|
168
171
|
playAnimation(...parameters: [animation: number] | [animation: string, rarity?: jraritycontrol]): void;
|
|
@@ -321,7 +324,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
321
324
|
static readonly constructionStartEvent: UnitTriggerEvent<[]>;
|
|
322
325
|
static readonly onUpgradeFinish: UnitTriggerEvent<[]>;
|
|
323
326
|
static readonly onSpellEffect: EventDispatcher<[Unit, number], [Unit]>;
|
|
324
|
-
static readonly onTargetCast: EventDispatcher<[Unit, number,
|
|
327
|
+
static readonly onTargetCast: EventDispatcher<[Unit, number, Destructable | Unit | Item], [Unit, Destructable | Unit | Item]>;
|
|
325
328
|
static readonly onCastPrepare: AbilityEventDispatcher<[]>;
|
|
326
329
|
static readonly onCast: AbilityEventDispatcher<[]>;
|
|
327
330
|
static readonly onPointCastPrepare: AbilityEventDispatcher<[number, number]>;
|
|
@@ -348,15 +351,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
348
351
|
static itemDroppedEvent: UnitTriggerEvent<[Item]>;
|
|
349
352
|
static itemPickedUpEvent: UnitTriggerEvent<[Item]>;
|
|
350
353
|
static itemUsedEvent: UnitTriggerEvent<[Item]>;
|
|
351
|
-
static itemStackedEvent: UnitTriggerEvent<[target: Item, source: Item]>;
|
|
352
354
|
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
355
|
static get onCreate(): EventDispatcher<[Unit], [Unit]>;
|
|
361
356
|
static get destroyEvent(): EventDispatcher<[Unit], [Unit]>;
|
|
362
357
|
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
|
|
@@ -481,6 +479,19 @@ __TS__SetDescriptor(
|
|
|
481
479
|
},
|
|
482
480
|
true
|
|
483
481
|
)
|
|
482
|
+
__TS__SetDescriptor(
|
|
483
|
+
UnitWeapon.prototype,
|
|
484
|
+
"type",
|
|
485
|
+
{
|
|
486
|
+
get = function(self)
|
|
487
|
+
return BlzGetUnitWeaponIntegerField(self.unit.handle, UNIT_WEAPON_IF_ATTACK_WEAPON_TYPE, self.index)
|
|
488
|
+
end,
|
|
489
|
+
set = function(self, ____type)
|
|
490
|
+
BlzSetUnitWeaponIntegerField(self.unit.handle, UNIT_WEAPON_IF_ATTACK_WEAPON_TYPE, self.index, ____type)
|
|
491
|
+
end
|
|
492
|
+
},
|
|
493
|
+
true
|
|
494
|
+
)
|
|
484
495
|
__TS__SetDescriptor(
|
|
485
496
|
UnitWeapon.prototype,
|
|
486
497
|
"damageBase",
|
|
@@ -592,8 +603,6 @@ __TS__SetDescriptor(
|
|
|
592
603
|
},
|
|
593
604
|
true
|
|
594
605
|
)
|
|
595
|
-
local unitInventorySize = UnitInventorySize
|
|
596
|
-
local unitItemInSlot = UnitItemInSlot
|
|
597
606
|
local getItemAbility = BlzGetItemAbility
|
|
598
607
|
local getUnitAbility = BlzGetUnitAbility
|
|
599
608
|
local getUnitAbilityByIndex = BlzGetUnitAbilityByIndex
|
|
@@ -611,8 +620,8 @@ local function retrieveAbility(unit, ability, abilityId)
|
|
|
611
620
|
____exports.Unit:of(unit)
|
|
612
621
|
)
|
|
613
622
|
end
|
|
614
|
-
for i = 0,
|
|
615
|
-
local item =
|
|
623
|
+
for i = 0, UnitInventorySize(unit) - 1 do
|
|
624
|
+
local item = UnitItemInSlot(unit, i)
|
|
616
625
|
if getItemAbility(item, abilityId) == ability then
|
|
617
626
|
return ItemAbility:of(
|
|
618
627
|
ability,
|
|
@@ -778,7 +787,9 @@ function Unit.prototype.onDestroy(self)
|
|
|
778
787
|
end
|
|
779
788
|
local eventsToDestroy = self._eventsToDestroy
|
|
780
789
|
if eventsToDestroy ~= nil then
|
|
781
|
-
|
|
790
|
+
for ____, event in ipairs(eventsToDestroy) do
|
|
791
|
+
event:destroy()
|
|
792
|
+
end
|
|
782
793
|
end
|
|
783
794
|
if getUnitAbilityLevel(handle, leaveDetectAbilityId) > 0 then
|
|
784
795
|
unitRemoveAbility(handle, leaveDetectAbilityId)
|
|
@@ -848,13 +859,19 @@ function Unit.prototype.isInvisibleTo(self, player)
|
|
|
848
859
|
return isUnitInvisible(self.handle, player.handle)
|
|
849
860
|
end
|
|
850
861
|
function Unit.prototype.isInRangeOf(self, x, y, range)
|
|
851
|
-
local
|
|
862
|
+
local ____temp_4
|
|
852
863
|
if type(x) == "number" then
|
|
853
|
-
|
|
864
|
+
____temp_4 = isUnitInRangeXY(self.handle, x, y, range)
|
|
854
865
|
else
|
|
855
|
-
____temp_3
|
|
866
|
+
local ____temp_3
|
|
867
|
+
if __TS__InstanceOf(x, ____exports.Unit) then
|
|
868
|
+
____temp_3 = isUnitInRange(self.handle, x.handle, y)
|
|
869
|
+
else
|
|
870
|
+
____temp_3 = isUnitInRangeXY(self.handle, x.x, x.y, range)
|
|
871
|
+
end
|
|
872
|
+
____temp_4 = ____temp_3
|
|
856
873
|
end
|
|
857
|
-
return
|
|
874
|
+
return ____temp_4
|
|
858
875
|
end
|
|
859
876
|
function Unit.prototype.isAllyOf(self, unit)
|
|
860
877
|
return isUnitAlly(
|
|
@@ -889,7 +906,7 @@ function Unit.prototype.chooseWeapon(self, target)
|
|
|
889
906
|
return firstWeapon
|
|
890
907
|
end
|
|
891
908
|
local secondWeapon = self.secondWeapon
|
|
892
|
-
if secondWeapon.isEnabled and target:isAllowedTarget(
|
|
909
|
+
if secondWeapon.isEnabled and target:isAllowedTarget(self, secondWeapon.allowedTargetCombatClassifications) then
|
|
893
910
|
return secondWeapon
|
|
894
911
|
end
|
|
895
912
|
return nil
|
|
@@ -912,14 +929,14 @@ function Unit.prototype.kill(self)
|
|
|
912
929
|
killUnit(self.handle)
|
|
913
930
|
end
|
|
914
931
|
function Unit.prototype.revive(self, x, y, doEffect)
|
|
915
|
-
local
|
|
916
|
-
local
|
|
917
|
-
local
|
|
918
|
-
if
|
|
919
|
-
|
|
932
|
+
local ____ReviveHero_7 = ReviveHero
|
|
933
|
+
local ____array_6 = __TS__SparseArrayNew(self.handle, x, y)
|
|
934
|
+
local ____doEffect_5 = doEffect
|
|
935
|
+
if ____doEffect_5 == nil then
|
|
936
|
+
____doEffect_5 = false
|
|
920
937
|
end
|
|
921
|
-
__TS__SparseArrayPush(
|
|
922
|
-
|
|
938
|
+
__TS__SparseArrayPush(____array_6, ____doEffect_5)
|
|
939
|
+
____ReviveHero_7(__TS__SparseArraySpread(____array_6))
|
|
923
940
|
end
|
|
924
941
|
function Unit.prototype.healTarget(self, target, amount)
|
|
925
942
|
if __TS__InstanceOf(target, ____exports.Unit) and target:hasAbility(fourCC("BIhm")) then
|
|
@@ -959,7 +976,7 @@ function Unit.prototype.dropItemSlot(self, item, slot)
|
|
|
959
976
|
return UnitDropItemSlot(self.handle, item.handle, slot)
|
|
960
977
|
end
|
|
961
978
|
function Unit.prototype.itemInSlot(self, slot)
|
|
962
|
-
return Item:of(
|
|
979
|
+
return Item:of(UnitItemInSlot(self.handle, slot))
|
|
963
980
|
end
|
|
964
981
|
function Unit.prototype.addAbility(self, abilityId)
|
|
965
982
|
local ability = UnitAbility:of(
|
|
@@ -995,6 +1012,9 @@ function Unit.prototype.removeAbility(self, abilityTypeId)
|
|
|
995
1012
|
if abilities[i].typeId == abilityTypeId then
|
|
996
1013
|
local ability = abilities[i]
|
|
997
1014
|
tremove(abilities, i)
|
|
1015
|
+
if ability.state == 2 then
|
|
1016
|
+
break
|
|
1017
|
+
end
|
|
998
1018
|
ability:destroy()
|
|
999
1019
|
return true
|
|
1000
1020
|
end
|
|
@@ -1317,7 +1337,7 @@ __TS__SetDescriptor(
|
|
|
1317
1337
|
Unit.prototype,
|
|
1318
1338
|
"isStunned",
|
|
1319
1339
|
{get = function(self)
|
|
1320
|
-
return getUnitCurrentOrder(self.handle) ==
|
|
1340
|
+
return getUnitCurrentOrder(self.handle) == 851973
|
|
1321
1341
|
end},
|
|
1322
1342
|
true
|
|
1323
1343
|
)
|
|
@@ -1493,13 +1513,13 @@ __TS__SetDescriptor(
|
|
|
1493
1513
|
end,
|
|
1494
1514
|
set = function(self, isTeamGlowVisible)
|
|
1495
1515
|
BlzShowUnitTeamGlow(self.handle, isTeamGlowVisible)
|
|
1496
|
-
local
|
|
1516
|
+
local ____temp_8
|
|
1497
1517
|
if not isTeamGlowVisible then
|
|
1498
|
-
|
|
1518
|
+
____temp_8 = true
|
|
1499
1519
|
else
|
|
1500
|
-
|
|
1520
|
+
____temp_8 = nil
|
|
1501
1521
|
end
|
|
1502
|
-
self[107] =
|
|
1522
|
+
self[107] = ____temp_8
|
|
1503
1523
|
end
|
|
1504
1524
|
},
|
|
1505
1525
|
true
|
|
@@ -1879,7 +1899,7 @@ __TS__SetDescriptor(
|
|
|
1879
1899
|
Unit.prototype,
|
|
1880
1900
|
"pathingCollisionRange",
|
|
1881
1901
|
{get = function(self)
|
|
1882
|
-
return 16 * (min(
|
|
1902
|
+
return 16 * (math.min(
|
|
1883
1903
|
getUnitCollisionSize(self.handle) // 16,
|
|
1884
1904
|
3
|
|
1885
1905
|
) + 1)
|
|
@@ -2146,7 +2166,7 @@ Unit.onResurrect = __TS__New(
|
|
|
2146
2166
|
____exports.Unit.deathEvent:addListener(function(unit)
|
|
2147
2167
|
dead[unit] = true
|
|
2148
2168
|
end)
|
|
2149
|
-
____exports.Unit.onImmediateOrder[
|
|
2169
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2150
2170
|
if dead[unit] and not IsUnitType(unit.handle, UNIT_TYPE_DEAD) then
|
|
2151
2171
|
dead[unit] = false
|
|
2152
2172
|
invoke(event, unit)
|
|
@@ -2163,7 +2183,7 @@ Unit.morphEvent = __TS__New(
|
|
|
2163
2183
|
invoke(event, unit)
|
|
2164
2184
|
end
|
|
2165
2185
|
end
|
|
2166
|
-
____exports.Unit.onImmediateOrder[
|
|
2186
|
+
____exports.Unit.onImmediateOrder[852056]:addListener(function(unit)
|
|
2167
2187
|
if getUnitAbilityLevel(unit.handle, morphDetectAbilityId) == 0 then
|
|
2168
2188
|
Timer:run(ifNotLeft, unit)
|
|
2169
2189
|
end
|
|
@@ -2204,25 +2224,25 @@ Unit.onTargetCast = dispatchId(__TS__New(
|
|
|
2204
2224
|
InitializingEvent,
|
|
2205
2225
|
function(event)
|
|
2206
2226
|
local function listener(unit, id)
|
|
2207
|
-
local
|
|
2227
|
+
local ____GetSpellTargetUnit_result_11
|
|
2208
2228
|
if GetSpellTargetUnit() then
|
|
2209
|
-
|
|
2229
|
+
____GetSpellTargetUnit_result_11 = ____exports.Unit:of(GetSpellTargetUnit())
|
|
2210
2230
|
else
|
|
2211
|
-
local
|
|
2231
|
+
local ____GetSpellTargetItem_result_10
|
|
2212
2232
|
if GetSpellTargetItem() then
|
|
2213
|
-
|
|
2233
|
+
____GetSpellTargetItem_result_10 = Item:of(GetSpellTargetItem())
|
|
2214
2234
|
else
|
|
2215
|
-
local
|
|
2235
|
+
local ____GetSpellTargetDestructable_result_9
|
|
2216
2236
|
if GetSpellTargetDestructable() then
|
|
2217
|
-
|
|
2237
|
+
____GetSpellTargetDestructable_result_9 = Destructable:of(GetSpellTargetDestructable())
|
|
2218
2238
|
else
|
|
2219
|
-
|
|
2239
|
+
____GetSpellTargetDestructable_result_9 = nil
|
|
2220
2240
|
end
|
|
2221
|
-
|
|
2241
|
+
____GetSpellTargetItem_result_10 = ____GetSpellTargetDestructable_result_9
|
|
2222
2242
|
end
|
|
2223
|
-
|
|
2243
|
+
____GetSpellTargetUnit_result_11 = ____GetSpellTargetItem_result_10
|
|
2224
2244
|
end
|
|
2225
|
-
local target =
|
|
2245
|
+
local target = ____GetSpellTargetUnit_result_11
|
|
2226
2246
|
if target then
|
|
2227
2247
|
invoke(event, unit, id, target)
|
|
2228
2248
|
end
|
|
@@ -2630,7 +2650,7 @@ Unit.itemDroppedEvent = __TS__New(
|
|
|
2630
2650
|
function()
|
|
2631
2651
|
local unit = getTriggerUnit()
|
|
2632
2652
|
local item = getManipulatedItem()
|
|
2633
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2653
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2634
2654
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2635
2655
|
end
|
|
2636
2656
|
return IgnoreEvent
|
|
@@ -2642,10 +2662,10 @@ Unit.itemPickedUpEvent = __TS__New(
|
|
|
2642
2662
|
function()
|
|
2643
2663
|
local unitHandle = getTriggerUnit()
|
|
2644
2664
|
local itemHandle = getManipulatedItem()
|
|
2645
|
-
if getUnitTypeId(unitHandle) ~= dummyUnitId and not (
|
|
2665
|
+
if getUnitTypeId(unitHandle) ~= dummyUnitId and not isItemIgnoredInEvents(itemHandle) then
|
|
2646
2666
|
local unit = ____exports.Unit:of(unitHandle)
|
|
2647
2667
|
local item = Item:of(itemHandle)
|
|
2648
|
-
if item
|
|
2668
|
+
if ownerByItem[item] ~= unit then
|
|
2649
2669
|
return unit, item
|
|
2650
2670
|
end
|
|
2651
2671
|
end
|
|
@@ -2658,17 +2678,12 @@ Unit.itemUsedEvent = __TS__New(
|
|
|
2658
2678
|
function()
|
|
2659
2679
|
local unit = getTriggerUnit()
|
|
2660
2680
|
local item = getManipulatedItem()
|
|
2661
|
-
if getUnitTypeId(unit) ~= dummyUnitId and not (
|
|
2681
|
+
if getUnitTypeId(unit) ~= dummyUnitId and not isItemIgnoredInEvents(item) then
|
|
2662
2682
|
return ____exports.Unit:of(unit), Item:of(item)
|
|
2663
2683
|
end
|
|
2664
2684
|
return IgnoreEvent
|
|
2665
2685
|
end
|
|
2666
2686
|
)
|
|
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
2687
|
__TS__ObjectDefineProperty(
|
|
2673
2688
|
Unit,
|
|
2674
2689
|
"itemChargesChangedEvent",
|
|
@@ -2684,51 +2699,6 @@ __TS__ObjectDefineProperty(
|
|
|
2684
2699
|
return event
|
|
2685
2700
|
end}
|
|
2686
2701
|
)
|
|
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
2702
|
__TS__ObjectDefineProperty(
|
|
2733
2703
|
Unit,
|
|
2734
2704
|
"onCreate",
|
|
@@ -2775,11 +2745,7 @@ Unit.synchronize = synchronizer(
|
|
|
2775
2745
|
function(____, id) return fourCC(id) end
|
|
2776
2746
|
)
|
|
2777
2747
|
end)
|
|
2778
|
-
for ____, leaveOrderId in ipairs({
|
|
2779
|
-
orderId("undefend"),
|
|
2780
|
-
orderId("magicundefense"),
|
|
2781
|
-
orderId("unimmolation")
|
|
2782
|
-
}) do
|
|
2748
|
+
for ____, leaveOrderId in ipairs({852056, 852479, 852178}) do
|
|
2783
2749
|
____exports.Unit.onImmediateOrder[leaveOrderId]:addListener(function(unit)
|
|
2784
2750
|
local handle = unit.handle
|
|
2785
2751
|
for i = 1, #leaveAbilityIds do
|
package/engine/lightning.lua
CHANGED
|
@@ -264,8 +264,8 @@ Timer.onPeriod[UPDATE_PERIOD]:addListener(function()
|
|
|
264
264
|
local sourceUnitFacing = rad(getUnitFacing(sourceUnit) - 90)
|
|
265
265
|
local sourceUnitFacingCos = cos(sourceUnitFacing)
|
|
266
266
|
local sourceUnitFacingSin = sin(sourceUnitFacing)
|
|
267
|
-
local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.
|
|
268
|
-
local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.
|
|
267
|
+
local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.launchVisualOffsetY + lightning[103]
|
|
268
|
+
local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.launchVisualOffsetX + lightning[104]
|
|
269
269
|
moveLightningEx(
|
|
270
270
|
lightning.handle,
|
|
271
271
|
lightning[100],
|
|
@@ -283,8 +283,8 @@ Timer.onPeriod[UPDATE_PERIOD]:addListener(function()
|
|
|
283
283
|
local sourceUnitFacing = rad(getUnitFacing(sourceUnit) - 90)
|
|
284
284
|
local sourceUnitFacingCos = cos(sourceUnitFacing)
|
|
285
285
|
local sourceUnitFacingSin = sin(sourceUnitFacing)
|
|
286
|
-
local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.
|
|
287
|
-
local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.
|
|
286
|
+
local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.launchVisualOffsetY + lightning[103]
|
|
287
|
+
local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.launchVisualOffsetX + lightning[104]
|
|
288
288
|
moveLightningEx(
|
|
289
289
|
lightning.handle,
|
|
290
290
|
lightning[100],
|
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
|
}
|