warscript 0.0.1-dev.2ae9956 → 0.0.1-dev.2b3f95e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.d.ts +6 -0
- package/attributes.lua +17 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/dummy.lua +4 -2
- package/core/types/effect.d.ts +12 -4
- package/core/types/effect.lua +67 -104
- package/core/types/frame.d.ts +21 -2
- package/core/types/frame.lua +165 -87
- 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 +6 -11
- package/core/types/player.d.ts +18 -1
- package/core/types/player.lua +76 -26
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/playerColor.lua +4 -3
- package/core/types/sound.d.ts +18 -25
- package/core/types/sound.lua +113 -33
- package/core/types/tileCell.d.ts +18 -3
- package/core/types/tileCell.lua +108 -0
- package/core/types/timer.d.ts +9 -8
- package/core/types/timer.lua +45 -23
- 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 +115 -4
- package/decl/native.d.ts +1719 -964
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/ability-type-extended-tooltip.d.ts +8 -0
- package/engine/ability-type-extended-tooltip.lua +44 -0
- package/engine/behavior.d.ts +14 -1
- package/engine/behavior.lua +230 -70
- package/engine/behaviour/ability/apply-buff.lua +5 -5
- package/engine/behaviour/ability/apply-unit-behavior.lua +6 -0
- package/engine/behaviour/ability/damage.d.ts +15 -4
- package/engine/behaviour/ability/damage.lua +41 -49
- package/engine/behaviour/ability/emulate-impact.d.ts +15 -1
- package/engine/behaviour/ability/emulate-impact.lua +96 -7
- 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/remove-buffs.d.ts +9 -0
- package/engine/behaviour/ability/remove-buffs.lua +21 -0
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.d.ts +23 -6
- package/engine/behaviour/ability.lua +145 -29
- package/engine/behaviour/unit/stun-immunity.d.ts +12 -6
- package/engine/behaviour/unit/stun-immunity.lua +57 -31
- package/engine/behaviour/unit.d.ts +41 -2
- package/engine/behaviour/unit.lua +270 -6
- package/engine/buff.d.ts +138 -60
- package/engine/buff.lua +675 -310
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +14 -1
- package/engine/internal/ability.lua +113 -44
- package/engine/internal/item/ability.lua +63 -11
- 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 +37 -8
- package/engine/internal/item.d.ts +32 -16
- package/engine/internal/item.lua +259 -84
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- package/engine/internal/misc/frame-coordinates.d.ts +2 -0
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/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/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/mana-regeneration-rate-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
- package/engine/internal/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.d.ts +35 -0
- package/engine/internal/unit/ability.lua +114 -9
- 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/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/appearance.d.ts +15 -0
- package/engine/internal/unit/appearance.lua +85 -0
- package/engine/internal/unit/attributes.d.ts +17 -0
- package/engine/internal/unit/attributes.lua +46 -0
- package/engine/internal/unit/bonus.d.ts +17 -0
- package/engine/internal/unit/bonus.lua +113 -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/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/ignore-events-items.lua +10 -1
- package/engine/internal/unit/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/{item.d.ts → inventory.d.ts} +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/main-selected.lua +12 -27
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit/range-event.d.ts +12 -0
- package/engine/internal/unit/range-event.lua +90 -0
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -0
- package/engine/internal/unit/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 +83 -3
- package/engine/internal/unit+bonus.lua +3 -3
- package/engine/internal/unit+damage.d.ts +12 -38
- package/engine/internal/unit+damage.lua +48 -45
- package/engine/internal/unit+rally.lua +9 -31
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit-missile-data.lua +96 -68
- package/engine/internal/unit-missile-launch.lua +69 -27
- package/engine/internal/unit.d.ts +51 -35
- package/engine/internal/unit.lua +434 -326
- package/engine/lightning.d.ts +4 -3
- package/engine/lightning.lua +25 -16
- package/engine/local-client.d.ts +28 -0
- package/engine/local-client.lua +324 -54
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +14 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +11 -3
- package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/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/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -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/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -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-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/sound-set-name.d.ts +14 -3
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/auxiliary/weapon-sound-type.d.ts +20 -14
- package/engine/object-data/auxiliary/weapon-sound-type.lua +58 -0
- package/engine/object-data/auxiliary/weapon-type.d.ts +25 -0
- package/engine/object-data/auxiliary/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/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/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +14 -3
- 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/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- package/engine/object-data/entry/ability-type/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/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/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/feral-spirit.lua +2 -2
- 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/mana-regeneration.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/mind-control.d.ts +21 -0
- package/engine/object-data/entry/ability-type/mind-control.lua +78 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.d.ts +21 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.lua +52 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.d.ts +19 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.lua +65 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.d.ts +15 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.lua +26 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.d.ts +6 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.lua +12 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/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-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.d.ts +9 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.lua +26 -0
- package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
- package/engine/object-data/entry/ability-type/resolve.d.ts +12 -0
- package/engine/object-data/entry/ability-type/resolve.lua +39 -0
- package/engine/object-data/entry/ability-type/righteous-fury.d.ts +33 -0
- package/engine/object-data/entry/ability-type/righteous-fury.lua +130 -0
- package/engine/object-data/entry/ability-type/sacred-aura.d.ts +27 -0
- package/engine/object-data/entry/ability-type/sacred-aura.lua +104 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
- package/engine/object-data/entry/ability-type/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/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type/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/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -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 +50 -21
- package/engine/object-data/entry/ability-type.lua +384 -35
- package/engine/object-data/entry/buff-type/applicable.lua +131 -139
- package/engine/object-data/entry/buff-type.d.ts +10 -12
- package/engine/object-data/entry/buff-type.lua +39 -29
- package/engine/object-data/entry/destructible-type.d.ts +32 -2
- package/engine/object-data/entry/destructible-type.lua +181 -0
- package/engine/object-data/entry/item-type.d.ts +18 -3
- package/engine/object-data/entry/item-type.lua +88 -4
- 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 +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -0
- package/engine/object-data/entry/unit-type.d.ts +81 -6
- package/engine/object-data/entry/unit-type.lua +619 -99
- package/engine/object-data/entry/upgrade.d.ts +2 -2
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +21 -14
- package/engine/object-data/entry.lua +68 -32
- package/engine/object-field/ability.d.ts +4 -4
- package/engine/object-field/ability.lua +9 -8
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field/unit.d.ts +72 -3
- package/engine/object-field/unit.lua +268 -7
- package/engine/object-field.d.ts +26 -7
- package/engine/object-field.lua +360 -119
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +21 -0
- package/engine/standard/entries/ability-type.d.ts +3102 -7
- package/engine/standard/entries/ability-type.lua +0 -6
- package/engine/standard/entries/buff-type.d.ts +48 -0
- package/engine/standard/entries/buff-type.lua +46 -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/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/engine/standard/entries/unit-type.d.ts +5 -0
- package/engine/standard/entries/unit-type.lua +5 -0
- package/engine/standard/fields/ability.d.ts +4 -4
- package/engine/standard/fields/ability.lua +4 -4
- package/engine/standard/fields/item.d.ts +4 -0
- package/engine/standard/fields/item.lua +6 -0
- package/engine/standard/fields/unit.d.ts +12 -0
- package/engine/standard/fields/unit.lua +20 -0
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +48 -2
- package/engine/text-tag.lua +287 -10
- package/engine/unit.d.ts +12 -1
- package/engine/unit.lua +12 -1
- package/event.d.ts +1 -1
- package/lualib_bundle.lua +1 -1
- package/math.d.ts +2 -0
- package/math.lua +14 -0
- package/net/socket.lua +1 -1
- package/network.lua +25 -1
- package/objutil/buff.lua +12 -11
- package/objutil/object.lua +1 -1
- package/objutil/unit.lua +8 -0
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -23
- package/patch-lua.lua +15 -0
- package/patch-lualib.lua +1 -1
- package/patch-natives.lua +3 -0
- package/utility/arrays.d.ts +9 -1
- package/utility/arrays.lua +28 -0
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +8 -0
- package/utility/functions.lua +13 -0
- package/utility/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +5 -1
- package/utility/linked-set.lua +49 -1
- package/utility/lua-maps.d.ts +15 -2
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +2 -0
- package/utility/lua-sets.lua +7 -0
- package/utility/random.d.ts +102 -0
- package/utility/random.lua +273 -0
- package/utility/records.lua +20 -1
- package/utility/reflection.lua +11 -7
- package/utility/types.d.ts +3 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
- package/engine/internal/unit/item.lua +0 -78
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/damage-metadata-by-target.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
|
@@ -23,22 +23,22 @@ local issueTargetOrderById = IssueTargetOrderById
|
|
|
23
23
|
local queuePointOrderById = BlzQueuePointOrderById
|
|
24
24
|
local queueTargetOrderById = BlzQueueTargetOrderById
|
|
25
25
|
local rallyRouteByUnit = setmetatable({}, {__mode = "k"})
|
|
26
|
-
Unit.onPointOrder[
|
|
26
|
+
Unit.onPointOrder[851980]:addListener(function(unit, x, y)
|
|
27
27
|
processPoint(unit, x, y)
|
|
28
28
|
end)
|
|
29
|
-
Unit.onPointOrder[
|
|
29
|
+
Unit.onPointOrder[851971]:addListener(function(unit, x, y)
|
|
30
30
|
if unit:hasAbility(fourCC("ARal")) then
|
|
31
31
|
processPoint(unit, x, y)
|
|
32
32
|
end
|
|
33
33
|
end)
|
|
34
|
-
Unit.onTargetOrder[
|
|
34
|
+
Unit.onTargetOrder[851980]:addListener(function(unit, target)
|
|
35
35
|
if __TS__InstanceOf(target, Unit) then
|
|
36
36
|
processUnit(unit, target)
|
|
37
37
|
elseif __TS__InstanceOf(target, Destructable) then
|
|
38
38
|
processDestructible(unit, target)
|
|
39
39
|
end
|
|
40
40
|
end)
|
|
41
|
-
Unit.onTargetOrder[
|
|
41
|
+
Unit.onTargetOrder[851971]:addListener(function(unit, target)
|
|
42
42
|
if unit:hasAbility(fourCC("ARal")) then
|
|
43
43
|
if __TS__InstanceOf(target, Unit) then
|
|
44
44
|
processUnit(unit, target)
|
|
@@ -116,41 +116,19 @@ __TS__ObjectDefineProperty(
|
|
|
116
116
|
do
|
|
117
117
|
local rallyPoint = rallyRoute[1]
|
|
118
118
|
if __TS__InstanceOf(rallyPoint, Handle) then
|
|
119
|
-
issueTargetOrderById(
|
|
120
|
-
handle,
|
|
121
|
-
orderId("setrally"),
|
|
122
|
-
rallyPoint.handle
|
|
123
|
-
)
|
|
119
|
+
issueTargetOrderById(handle, 851980, rallyPoint.handle)
|
|
124
120
|
elseif rallyPoint ~= nil then
|
|
125
|
-
issuePointOrderById(
|
|
126
|
-
handle,
|
|
127
|
-
orderId("setrally"),
|
|
128
|
-
rallyPoint[1],
|
|
129
|
-
rallyPoint[2]
|
|
130
|
-
)
|
|
121
|
+
issuePointOrderById(handle, 851980, rallyPoint[1], rallyPoint[2])
|
|
131
122
|
else
|
|
132
|
-
issueTargetOrderById(
|
|
133
|
-
handle,
|
|
134
|
-
orderId("setrally"),
|
|
135
|
-
handle
|
|
136
|
-
)
|
|
123
|
+
issueTargetOrderById(handle, 851980, handle)
|
|
137
124
|
end
|
|
138
125
|
end
|
|
139
126
|
for i = 2, #rallyRoute do
|
|
140
127
|
local rallyPoint = rallyRoute[i]
|
|
141
128
|
if __TS__InstanceOf(rallyPoint, Handle) then
|
|
142
|
-
queueTargetOrderById(
|
|
143
|
-
handle,
|
|
144
|
-
orderId("setrally"),
|
|
145
|
-
rallyPoint.handle
|
|
146
|
-
)
|
|
129
|
+
queueTargetOrderById(handle, 851980, rallyPoint.handle)
|
|
147
130
|
else
|
|
148
|
-
queuePointOrderById(
|
|
149
|
-
handle,
|
|
150
|
-
orderId("setrally"),
|
|
151
|
-
rallyPoint[1],
|
|
152
|
-
rallyPoint[2]
|
|
153
|
-
)
|
|
131
|
+
queuePointOrderById(handle, 851980, rallyPoint[1], rallyPoint[2])
|
|
154
132
|
end
|
|
155
133
|
end
|
|
156
134
|
end
|
|
@@ -6,7 +6,6 @@ local ____exports = {}
|
|
|
6
6
|
local ____unit = require("engine.internal.unit")
|
|
7
7
|
local Unit = ____unit.Unit
|
|
8
8
|
local ____unit_2Bdamage = require("engine.internal.unit+damage")
|
|
9
|
-
local AttackType = ____unit_2Bdamage.AttackType
|
|
10
9
|
local DamageType = ____unit_2Bdamage.DamageType
|
|
11
10
|
local ____event = require("event")
|
|
12
11
|
local Event = ____event.Event
|
|
@@ -33,7 +32,7 @@ local spellStealEventStack = {}
|
|
|
33
32
|
Unit.onDamaging:addListener(function(source, target, event)
|
|
34
33
|
if event.amount == 0 and source ~= nil then
|
|
35
34
|
local count = countByUnit[source] or 0
|
|
36
|
-
if count > 0 and event.attackType ==
|
|
35
|
+
if count > 0 and event.attackType == 0 then
|
|
37
36
|
if event.damageType == DamageType.UNKNOWN then
|
|
38
37
|
spellStealEventStack[#spellStealEventStack + 1] = {
|
|
39
38
|
sourceBuffIds = source.buffIds,
|
|
@@ -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
|
|
@@ -9,43 +9,85 @@ local ____timer = require("core.types.timer")
|
|
|
9
9
|
local Timer = ____timer.Timer
|
|
10
10
|
local ____lua_2Dsets = require("utility.lua-sets")
|
|
11
11
|
local luaSetOf = ____lua_2Dsets.luaSetOf
|
|
12
|
+
local ____attributes = require("attributes")
|
|
13
|
+
local attribute = ____attributes.attribute
|
|
14
|
+
local ____linked_2Dset = require("utility.linked-set")
|
|
15
|
+
local LinkedSet = ____linked_2Dset.LinkedSet
|
|
16
|
+
local ____math = require("math")
|
|
17
|
+
local ceil = ____math.ceil
|
|
12
18
|
local autoAttackFinishEvent = __TS__New(Event)
|
|
13
19
|
rawset(Unit, "autoAttackFinishEvent", autoAttackFinishEvent)
|
|
14
|
-
local
|
|
20
|
+
local units = __TS__New(LinkedSet)
|
|
21
|
+
local targetAttribute = attribute()
|
|
22
|
+
local impactDelayAttribute = attribute()
|
|
23
|
+
local passedTimeAttribute = attribute()
|
|
15
24
|
local instantOrderIds = luaSetOf(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
29
38
|
)
|
|
30
|
-
|
|
39
|
+
---
|
|
40
|
+
-- @internal For use by internal systems only.
|
|
41
|
+
____exports.resetAutoAttackTimer = function(unit)
|
|
42
|
+
if units:remove(unit) then
|
|
43
|
+
unit[targetAttribute] = nil
|
|
44
|
+
unit[impactDelayAttribute] = nil
|
|
45
|
+
unit[passedTimeAttribute] = nil
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
local function reset(unit, orderId)
|
|
31
49
|
if not (instantOrderIds[orderId] ~= nil) then
|
|
32
|
-
|
|
33
|
-
if eventTimer then
|
|
34
|
-
eventTimer:destroy()
|
|
35
|
-
eventTimerByUnit[source] = nil
|
|
36
|
-
end
|
|
50
|
+
____exports.resetAutoAttackTimer(unit)
|
|
37
51
|
end
|
|
38
52
|
end
|
|
39
53
|
Unit.onImmediateOrder:addListener(reset)
|
|
40
54
|
Unit.onPointOrder:addListener(reset)
|
|
41
55
|
Unit.onTargetOrder:addListener(reset)
|
|
42
|
-
local
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
local timerPeriod = 1 / 64
|
|
57
|
+
local function invokeEvent(unit)
|
|
58
|
+
units:remove(unit)
|
|
59
|
+
local target = unit[targetAttribute]
|
|
60
|
+
unit[targetAttribute] = nil
|
|
61
|
+
unit[impactDelayAttribute] = nil
|
|
62
|
+
unit[passedTimeAttribute] = nil
|
|
63
|
+
Event.invoke(autoAttackFinishEvent, unit, target)
|
|
45
64
|
end
|
|
46
|
-
|
|
47
|
-
local
|
|
48
|
-
|
|
49
|
-
|
|
65
|
+
local function checkUnit(unit)
|
|
66
|
+
local passedTime = unit[passedTimeAttribute]
|
|
67
|
+
if passedTime == nil then
|
|
68
|
+
return
|
|
69
|
+
end
|
|
70
|
+
passedTime = passedTime + timerPeriod
|
|
71
|
+
local impactDelay = unit[impactDelayAttribute]
|
|
72
|
+
if passedTime >= impactDelay and ceil(passedTime / 0.02) >= ceil(impactDelay / 0.02) then
|
|
73
|
+
invokeEvent(unit)
|
|
74
|
+
else
|
|
75
|
+
unit[passedTimeAttribute] = passedTime
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
Timer.onPeriod[timerPeriod]:addListener(function()
|
|
79
|
+
units:forEach(checkUnit)
|
|
50
80
|
end)
|
|
81
|
+
Unit.autoAttackStartEvent:addListener(
|
|
82
|
+
999999,
|
|
83
|
+
function(source, target)
|
|
84
|
+
if source[targetAttribute] ~= nil then
|
|
85
|
+
invokeEvent(source)
|
|
86
|
+
end
|
|
87
|
+
source[targetAttribute] = target
|
|
88
|
+
source[impactDelayAttribute] = (source:chooseWeapon(target) or source.firstWeapon).impactDelay
|
|
89
|
+
source[passedTimeAttribute] = -timerPeriod
|
|
90
|
+
units:add(source)
|
|
91
|
+
end
|
|
92
|
+
)
|
|
51
93
|
return ____exports
|
|
@@ -11,6 +11,12 @@ import { Ability, UnitAbility } from "./ability";
|
|
|
11
11
|
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
|
+
import { MovementType } from "../object-data/auxiliary/movement-type";
|
|
15
|
+
import { WeaponType } from "../object-data/auxiliary/weapon-type";
|
|
16
|
+
import { WeaponSoundType } from "../object-data/auxiliary/weapon-sound-type";
|
|
17
|
+
import { UnitAttribute } from "../object-data/auxiliary/unit-attribute";
|
|
18
|
+
import { AttackType } from "../object-data/auxiliary/attack-type";
|
|
19
|
+
import { AttributesHolder } from "../../attributes";
|
|
14
20
|
export type UnitClassification = junittype;
|
|
15
21
|
export declare namespace UnitClassification {
|
|
16
22
|
const STRUCTURE: junittype;
|
|
@@ -19,6 +25,7 @@ export declare namespace UnitClassification {
|
|
|
19
25
|
const GROUND: junittype;
|
|
20
26
|
const SUMMONED: junittype;
|
|
21
27
|
const MECHANICAL: junittype;
|
|
28
|
+
const WORKER: junittype;
|
|
22
29
|
const ANCIENT: junittype;
|
|
23
30
|
const SUICIDAL: junittype;
|
|
24
31
|
const TAUREN: junittype;
|
|
@@ -36,15 +43,18 @@ type AbilityDispatcherTable<T extends any[] = []> = {
|
|
|
36
43
|
readonly [id: number]: Event<[Unit, Ability, ...T]>;
|
|
37
44
|
};
|
|
38
45
|
type AbilityEventDispatcher<T extends any[] = []> = Event<[Unit, Ability, ...T]> & AbilityDispatcherTable<T>;
|
|
39
|
-
export interface DamagingEvent {
|
|
46
|
+
export interface DamagingEvent extends AttributesHolder {
|
|
40
47
|
amount: number;
|
|
41
|
-
attackType:
|
|
48
|
+
attackType: AttackType;
|
|
42
49
|
damageType: jdamagetype;
|
|
43
|
-
|
|
50
|
+
weaponSoundType: WeaponSoundType;
|
|
51
|
+
metadata: unknown;
|
|
44
52
|
readonly isAttack: boolean;
|
|
45
53
|
readonly originalAmount: number;
|
|
54
|
+
readonly originalMetadata: unknown;
|
|
55
|
+
preventRetaliation(this: DamagingEvent): void;
|
|
46
56
|
}
|
|
47
|
-
export type DamageEvent = DamagingEvent & {
|
|
57
|
+
export type DamageEvent = Omit<DamagingEvent, "preventRetaliation"> & {
|
|
48
58
|
preventDeath<P extends any[]>(this: DamageEvent, callback: (this: void, ...parameters: P) => any, ...parameters: P): void;
|
|
49
59
|
};
|
|
50
60
|
export type AttackDamageEvent = DamagingEvent & {
|
|
@@ -72,10 +82,18 @@ export declare class UnitWeapon {
|
|
|
72
82
|
readonly unit: Unit;
|
|
73
83
|
readonly index: 0 | 1;
|
|
74
84
|
constructor(unit: Unit, index: 0 | 1);
|
|
85
|
+
get isEnabled(): boolean;
|
|
86
|
+
set isEnabled(isEnabled: boolean);
|
|
75
87
|
get cooldown(): number;
|
|
76
88
|
set cooldown(cooldown: number);
|
|
77
89
|
get damage(): [minimumDamage: number, maximumDamage: number];
|
|
78
90
|
set damage([minimumDamage, maximumDamage]: [number, number]);
|
|
91
|
+
get allowedTargetCombatClassifications(): CombatClassifications;
|
|
92
|
+
set allowedTargetCombatClassifications(allowedTargetCombatClassifications: CombatClassifications);
|
|
93
|
+
get type(): WeaponType;
|
|
94
|
+
set type(type: WeaponType);
|
|
95
|
+
get soundType(): WeaponSoundType;
|
|
96
|
+
set soundType(soundType: WeaponSoundType);
|
|
79
97
|
get damageBase(): number;
|
|
80
98
|
set damageBase(damageBase: number);
|
|
81
99
|
get damageDiceCount(): number;
|
|
@@ -97,10 +115,13 @@ declare const enum UnitPropertyKey {
|
|
|
97
115
|
SYNC_ID = 100,
|
|
98
116
|
IS_PAUSED = 101,
|
|
99
117
|
STUN_COUNTER = 102,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
118
|
+
FORCE_STUN_COUNTER = 103,
|
|
119
|
+
DELAY_HEALTH_CHECKS_COUNTER = 104,
|
|
120
|
+
DELAY_HEALTH_CHECKS_HEALTH_BONUS = 105,
|
|
121
|
+
PREVENT_DEATH_HEALTH_BONUS = 106,
|
|
122
|
+
IS_TEAM_GLOW_HIDDEN = 107,
|
|
123
|
+
LAST_X = 108,
|
|
124
|
+
LAST_Y = 109
|
|
104
125
|
}
|
|
105
126
|
export type UnitSyncId = number & {
|
|
106
127
|
readonly __unitSyncId: unique symbol;
|
|
@@ -109,10 +130,13 @@ export declare class Unit extends Handle<junit> {
|
|
|
109
130
|
readonly syncId: UnitSyncId;
|
|
110
131
|
private [UnitPropertyKey.IS_PAUSED]?;
|
|
111
132
|
private [UnitPropertyKey.STUN_COUNTER]?;
|
|
133
|
+
private [UnitPropertyKey.FORCE_STUN_COUNTER]?;
|
|
112
134
|
private [UnitPropertyKey.DELAY_HEALTH_CHECKS_COUNTER]?;
|
|
113
135
|
private [UnitPropertyKey.DELAY_HEALTH_CHECKS_HEALTH_BONUS]?;
|
|
114
136
|
private [UnitPropertyKey.PREVENT_DEATH_HEALTH_BONUS]?;
|
|
115
137
|
private [UnitPropertyKey.IS_TEAM_GLOW_HIDDEN]?;
|
|
138
|
+
private [UnitPropertyKey.LAST_X]?;
|
|
139
|
+
private [UnitPropertyKey.LAST_Y]?;
|
|
116
140
|
private _owner?;
|
|
117
141
|
private _timeScale?;
|
|
118
142
|
private events?;
|
|
@@ -121,6 +145,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
121
145
|
private _fields?;
|
|
122
146
|
private getEvent;
|
|
123
147
|
constructor(handle: junit);
|
|
148
|
+
private saveData;
|
|
124
149
|
protected onDestroy(): HandleDestructor;
|
|
125
150
|
addAttackHandler(condition: AttackHandlerCondition, action: AttackHandlerAction): AttackHandler;
|
|
126
151
|
removeAttackHandler(handler: AttackHandler): boolean;
|
|
@@ -143,29 +168,26 @@ export declare class Unit extends Handle<junit> {
|
|
|
143
168
|
isVisibleTo(player: Player): boolean;
|
|
144
169
|
isInvisibleTo(player: Player): boolean;
|
|
145
170
|
isInRangeOf(x: number, y: number, range: number): boolean;
|
|
146
|
-
isInRangeOf(
|
|
171
|
+
isInRangeOf(widget: Widget, range: number): boolean;
|
|
147
172
|
isAllyOf(unit: Unit): boolean;
|
|
148
173
|
isEnemyOf(unit: Unit): boolean;
|
|
149
|
-
playAnimation(animation: string, rarity?: jraritycontrol): void;
|
|
150
|
-
|
|
174
|
+
playAnimation(...parameters: [animation: number] | [animation: string, rarity?: jraritycontrol]): void;
|
|
175
|
+
resetAnimation(): void;
|
|
151
176
|
queueAnimation(animation: string): void;
|
|
152
177
|
get weapons(): [UnitWeapon, UnitWeapon];
|
|
153
178
|
get firstWeapon(): UnitWeapon;
|
|
154
179
|
get secondWeapon(): UnitWeapon;
|
|
180
|
+
chooseWeapon(target: Unit): UnitWeapon | undefined;
|
|
155
181
|
get level(): number;
|
|
156
182
|
set level(v: number);
|
|
157
183
|
get xp(): number;
|
|
158
184
|
set xp(v: number);
|
|
159
|
-
get
|
|
160
|
-
set
|
|
185
|
+
get primaryAttribute(): UnitAttribute;
|
|
186
|
+
set primaryAttribute(primaryAttribute: UnitAttribute);
|
|
161
187
|
get strengthBonus(): number;
|
|
162
188
|
get strength(): number;
|
|
163
|
-
get agilityBase(): number;
|
|
164
|
-
set agilityBase(agilityBase: number);
|
|
165
189
|
get agilityBonus(): number;
|
|
166
190
|
get agility(): number;
|
|
167
|
-
get intelligenceBase(): number;
|
|
168
|
-
set intelligenceBase(intelligenceBase: number);
|
|
169
191
|
get intelligenceBonus(): number;
|
|
170
192
|
get intelligence(): number;
|
|
171
193
|
get name(): string;
|
|
@@ -199,8 +221,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
199
221
|
set facing(v: number);
|
|
200
222
|
get speed(): number;
|
|
201
223
|
set speed(v: number);
|
|
202
|
-
get flyHeight(): number;
|
|
203
|
-
set flyHeight(v: number);
|
|
204
224
|
get x(): number;
|
|
205
225
|
set x(v: number);
|
|
206
226
|
get y(): number;
|
|
@@ -224,12 +244,12 @@ export declare class Unit extends Handle<junit> {
|
|
|
224
244
|
get isInvulnerable(): boolean;
|
|
225
245
|
get vertexColor(): Color;
|
|
226
246
|
set vertexColor(v: Color);
|
|
227
|
-
get scale(): number;
|
|
228
|
-
set scale(v: number);
|
|
229
247
|
get timeScale(): number;
|
|
230
248
|
set timeScale(v: number);
|
|
231
249
|
get collisionSize(): number;
|
|
232
250
|
get pathingCollisionRange(): number;
|
|
251
|
+
get movementType(): MovementType;
|
|
252
|
+
set movementType(movementType: MovementType);
|
|
233
253
|
set pathing(v: boolean);
|
|
234
254
|
isSelected(player: Player): boolean;
|
|
235
255
|
explode(): void;
|
|
@@ -247,18 +267,17 @@ export declare class Unit extends Handle<junit> {
|
|
|
247
267
|
dropItemTarget(item: Item, target: Widget): boolean;
|
|
248
268
|
dropItemSlot(item: Item, slot: number): boolean;
|
|
249
269
|
itemInSlot(slot: number): Item | null;
|
|
250
|
-
addAbility(abilityId: number): UnitAbility |
|
|
270
|
+
addAbility(abilityId: number): UnitAbility | undefined;
|
|
251
271
|
makeAbilityPermanent(abilityId: number, permanent: true): boolean;
|
|
252
272
|
setAbilityLevel(abilityId: number, level: number): number;
|
|
253
273
|
getAbilityLevel(abilityId: number): number;
|
|
254
274
|
hasAbility(abilityId: number): boolean;
|
|
255
|
-
|
|
256
|
-
removeAbility(
|
|
275
|
+
getAbility(abilityId: number): UnitAbility | undefined;
|
|
276
|
+
removeAbility(abilityTypeId: number): boolean;
|
|
257
277
|
hideAbility(abilityId: number, flag: boolean): void;
|
|
258
278
|
getAbilityRemainingCooldown(abilityId: number): number;
|
|
259
279
|
startAbilityCooldown(abilityId: number, cooldown: number): void;
|
|
260
280
|
endAbilityCooldown(abilityId: number): void;
|
|
261
|
-
interruptAttack(): void;
|
|
262
281
|
interruptCast(abilityId: number): void;
|
|
263
282
|
getDistanceTo(target: Unit | Vec2): number;
|
|
264
283
|
getCollisionDistanceTo(...target: [Unit] | [targetX: number, targetY: number]): number;
|
|
@@ -272,14 +291,16 @@ export declare class Unit extends Handle<junit> {
|
|
|
272
291
|
unpauseEx(): void;
|
|
273
292
|
incrementStunCounter(): void;
|
|
274
293
|
decrementStunCounter(): void;
|
|
294
|
+
incrementForceStunCounter(): void;
|
|
295
|
+
decrementForceStunCounter(): void;
|
|
275
296
|
set waygateActive(v: boolean);
|
|
276
297
|
get waygateActive(): boolean;
|
|
277
298
|
set waygateDestination(v: Vec2);
|
|
278
299
|
get waygateDestination(): Vec2;
|
|
279
300
|
get abilities(): ReadonlyArray<UnitAbility>;
|
|
280
|
-
get onUnitInRange(): Record<number, Event<[Unit]>>;
|
|
281
301
|
get onManaEqual(): Record<number, Event<[Unit, number]>>;
|
|
282
302
|
get manaEvent(): Record<Operator, Record<number, Event<[Unit]>>>;
|
|
303
|
+
get targetAcquiredEvent(): Event;
|
|
283
304
|
get onSelect(): Event;
|
|
284
305
|
get onDeselect(): Event;
|
|
285
306
|
get onImmediateOrder(): Event<[number]>;
|
|
@@ -295,6 +316,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
295
316
|
static getInCollisionRange(x: number, y: number, range: number, predicate?: (unit: Unit) => boolean): Unit[];
|
|
296
317
|
static getInSector(pos: Vec2, range: number, offsetAngle: number, centralAngle: number): Unit[];
|
|
297
318
|
static getSelectionOf(player: Player, target?: Unit[]): Unit[];
|
|
319
|
+
static readonly levelChangedEvent: UnitTriggerEvent<[]>;
|
|
298
320
|
static readonly deathEvent: UnitTriggerEvent<[Unit]>;
|
|
299
321
|
static readonly onDecay: UnitTriggerEvent<[]>;
|
|
300
322
|
static readonly onResurrect: InitializingEvent<[Unit], void>;
|
|
@@ -305,7 +327,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
305
327
|
static readonly constructionStartEvent: UnitTriggerEvent<[]>;
|
|
306
328
|
static readonly onUpgradeFinish: UnitTriggerEvent<[]>;
|
|
307
329
|
static readonly onSpellEffect: EventDispatcher<[Unit, number], [Unit]>;
|
|
308
|
-
static readonly onTargetCast: EventDispatcher<[Unit, number,
|
|
330
|
+
static readonly onTargetCast: EventDispatcher<[Unit, number, Destructable | Unit | Item], [Unit, Destructable | Unit | Item]>;
|
|
309
331
|
static readonly onCastPrepare: AbilityEventDispatcher<[]>;
|
|
310
332
|
static readonly onCast: AbilityEventDispatcher<[]>;
|
|
311
333
|
static readonly onPointCastPrepare: AbilityEventDispatcher<[number, number]>;
|
|
@@ -332,14 +354,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
332
354
|
static itemDroppedEvent: UnitTriggerEvent<[Item]>;
|
|
333
355
|
static itemPickedUpEvent: UnitTriggerEvent<[Item]>;
|
|
334
356
|
static itemUsedEvent: UnitTriggerEvent<[Item]>;
|
|
335
|
-
static
|
|
336
|
-
static get itemUseOrderEvent(): Event<[unit: Unit, item: Item]>;
|
|
337
|
-
static get itemMoveOrderEvent(): Event<[
|
|
338
|
-
unit: Unit,
|
|
339
|
-
item: Item,
|
|
340
|
-
slotFrom: 0 | 1 | 2 | 3 | 4 | 5,
|
|
341
|
-
slotTo: 0 | 1 | 2 | 3 | 4 | 5
|
|
342
|
-
]>;
|
|
357
|
+
static get itemChargesChangedEvent(): Event<[unit: Unit, item: Item]>;
|
|
343
358
|
static get onCreate(): EventDispatcher<[Unit], [Unit]>;
|
|
344
359
|
static get destroyEvent(): EventDispatcher<[Unit], [Unit]>;
|
|
345
360
|
getField(field: junitintegerfield | junitrealfield): number;
|
|
@@ -351,5 +366,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
351
366
|
setField(field: junitstringfield, value: string): boolean;
|
|
352
367
|
toString(): string;
|
|
353
368
|
static getBySyncId(syncId: UnitSyncId): Unit | undefined;
|
|
369
|
+
static synchronize: (player: Player, object: Unit | undefined) => Promise<Unit | undefined>;
|
|
354
370
|
}
|
|
355
371
|
export {};
|