warscript 0.0.1-dev.47f470c → 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/attributes.d.ts +6 -0
- package/attributes.lua +17 -1
- 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 +8 -7
- 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 -26
- package/core/types/sound.lua +105 -55
- 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 +13 -3
- 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 +130 -57
- package/engine/buff.lua +643 -294
- 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 +257 -82
- 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 +11 -11
- package/engine/internal/unit+damage.lua +43 -14
- 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 +65 -27
- package/engine/internal/unit.d.ts +47 -34
- package/engine/internal/unit.lua +413 -323
- package/engine/lightning.lua +4 -4
- package/engine/local-client.d.ts +28 -0
- package/engine/local-client.lua +324 -54
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/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/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- 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/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 +2 -11
- 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/curse.lua +2 -2
- 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/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/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/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/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 +376 -27
- package/engine/object-data/entry/buff-type/applicable.lua +124 -108
- package/engine/object-data/entry/buff-type.d.ts +10 -12
- package/engine/object-data/entry/buff-type.lua +37 -27
- 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 +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 +19 -3
- package/engine/object-data/entry/sound-preset.lua +105 -15
- package/engine/object-data/entry/unit-type.d.ts +74 -6
- package/engine/object-data/entry/unit-type.lua +560 -100
- package/engine/object-data/entry/upgrade.d.ts +2 -2
- package/engine/object-data/entry.d.ts +8 -3
- package/engine/object-data/entry.lua +22 -7
- 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/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 +2 -2
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -23
- package/patch-lua.lua +15 -0
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +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
|
@@ -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,81 @@ 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)
|
|
64
|
+
end
|
|
65
|
+
local function checkUnit(unit)
|
|
66
|
+
local passedTime = unit[passedTimeAttribute] + timerPeriod
|
|
67
|
+
local impactDelay = unit[impactDelayAttribute]
|
|
68
|
+
if passedTime >= impactDelay and ceil(passedTime / 0.02) >= ceil(impactDelay / 0.02) then
|
|
69
|
+
invokeEvent(unit)
|
|
70
|
+
else
|
|
71
|
+
unit[passedTimeAttribute] = passedTime
|
|
72
|
+
end
|
|
45
73
|
end
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
local timer = Timer:simple(attackPoint, timerCallback, source, target)
|
|
49
|
-
eventTimerByUnit[source] = timer
|
|
74
|
+
Timer.onPeriod[timerPeriod]:addListener(function()
|
|
75
|
+
units:forEach(checkUnit)
|
|
50
76
|
end)
|
|
77
|
+
Unit.autoAttackStartEvent:addListener(
|
|
78
|
+
999999,
|
|
79
|
+
function(source, target)
|
|
80
|
+
if source[targetAttribute] ~= nil then
|
|
81
|
+
invokeEvent(source)
|
|
82
|
+
end
|
|
83
|
+
source[targetAttribute] = target
|
|
84
|
+
source[impactDelayAttribute] = (source:chooseWeapon(target) or source.firstWeapon).impactDelay
|
|
85
|
+
source[passedTimeAttribute] = -timerPeriod
|
|
86
|
+
units:add(source)
|
|
87
|
+
end
|
|
88
|
+
)
|
|
51
89
|
return ____exports
|
|
@@ -11,6 +11,11 @@ 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 { UnitWeaponType } from "../object-data/auxiliary/unit-weapon-type";
|
|
16
|
+
import { UnitAttribute } from "../object-data/auxiliary/unit-attribute";
|
|
17
|
+
import { AttackType } from "../object-data/auxiliary/attack-type";
|
|
18
|
+
import { AttributesHolder } from "../../attributes";
|
|
14
19
|
export type UnitClassification = junittype;
|
|
15
20
|
export declare namespace UnitClassification {
|
|
16
21
|
const STRUCTURE: junittype;
|
|
@@ -19,6 +24,7 @@ export declare namespace UnitClassification {
|
|
|
19
24
|
const GROUND: junittype;
|
|
20
25
|
const SUMMONED: junittype;
|
|
21
26
|
const MECHANICAL: junittype;
|
|
27
|
+
const WORKER: junittype;
|
|
22
28
|
const ANCIENT: junittype;
|
|
23
29
|
const SUICIDAL: junittype;
|
|
24
30
|
const TAUREN: junittype;
|
|
@@ -36,15 +42,18 @@ type AbilityDispatcherTable<T extends any[] = []> = {
|
|
|
36
42
|
readonly [id: number]: Event<[Unit, Ability, ...T]>;
|
|
37
43
|
};
|
|
38
44
|
type AbilityEventDispatcher<T extends any[] = []> = Event<[Unit, Ability, ...T]> & AbilityDispatcherTable<T>;
|
|
39
|
-
export interface DamagingEvent {
|
|
45
|
+
export interface DamagingEvent extends AttributesHolder {
|
|
40
46
|
amount: number;
|
|
41
|
-
attackType:
|
|
47
|
+
attackType: AttackType;
|
|
42
48
|
damageType: jdamagetype;
|
|
43
49
|
weaponType: jweapontype;
|
|
50
|
+
metadata: unknown;
|
|
44
51
|
readonly isAttack: boolean;
|
|
45
52
|
readonly originalAmount: number;
|
|
53
|
+
readonly originalMetadata: unknown;
|
|
54
|
+
preventRetaliation(this: DamagingEvent): void;
|
|
46
55
|
}
|
|
47
|
-
export type DamageEvent = DamagingEvent & {
|
|
56
|
+
export type DamageEvent = Omit<DamagingEvent, "preventRetaliation"> & {
|
|
48
57
|
preventDeath<P extends any[]>(this: DamageEvent, callback: (this: void, ...parameters: P) => any, ...parameters: P): void;
|
|
49
58
|
};
|
|
50
59
|
export type AttackDamageEvent = DamagingEvent & {
|
|
@@ -72,10 +81,16 @@ export declare class UnitWeapon {
|
|
|
72
81
|
readonly unit: Unit;
|
|
73
82
|
readonly index: 0 | 1;
|
|
74
83
|
constructor(unit: Unit, index: 0 | 1);
|
|
84
|
+
get isEnabled(): boolean;
|
|
85
|
+
set isEnabled(isEnabled: boolean);
|
|
75
86
|
get cooldown(): number;
|
|
76
87
|
set cooldown(cooldown: number);
|
|
77
88
|
get damage(): [minimumDamage: number, maximumDamage: number];
|
|
78
89
|
set damage([minimumDamage, maximumDamage]: [number, number]);
|
|
90
|
+
get allowedTargetCombatClassifications(): CombatClassifications;
|
|
91
|
+
set allowedTargetCombatClassifications(allowedTargetCombatClassifications: CombatClassifications);
|
|
92
|
+
get type(): UnitWeaponType;
|
|
93
|
+
set type(type: UnitWeaponType);
|
|
79
94
|
get damageBase(): number;
|
|
80
95
|
set damageBase(damageBase: number);
|
|
81
96
|
get damageDiceCount(): number;
|
|
@@ -97,10 +112,13 @@ declare const enum UnitPropertyKey {
|
|
|
97
112
|
SYNC_ID = 100,
|
|
98
113
|
IS_PAUSED = 101,
|
|
99
114
|
STUN_COUNTER = 102,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
115
|
+
FORCE_STUN_COUNTER = 103,
|
|
116
|
+
DELAY_HEALTH_CHECKS_COUNTER = 104,
|
|
117
|
+
DELAY_HEALTH_CHECKS_HEALTH_BONUS = 105,
|
|
118
|
+
PREVENT_DEATH_HEALTH_BONUS = 106,
|
|
119
|
+
IS_TEAM_GLOW_HIDDEN = 107,
|
|
120
|
+
LAST_X = 108,
|
|
121
|
+
LAST_Y = 109
|
|
104
122
|
}
|
|
105
123
|
export type UnitSyncId = number & {
|
|
106
124
|
readonly __unitSyncId: unique symbol;
|
|
@@ -109,10 +127,13 @@ export declare class Unit extends Handle<junit> {
|
|
|
109
127
|
readonly syncId: UnitSyncId;
|
|
110
128
|
private [UnitPropertyKey.IS_PAUSED]?;
|
|
111
129
|
private [UnitPropertyKey.STUN_COUNTER]?;
|
|
130
|
+
private [UnitPropertyKey.FORCE_STUN_COUNTER]?;
|
|
112
131
|
private [UnitPropertyKey.DELAY_HEALTH_CHECKS_COUNTER]?;
|
|
113
132
|
private [UnitPropertyKey.DELAY_HEALTH_CHECKS_HEALTH_BONUS]?;
|
|
114
133
|
private [UnitPropertyKey.PREVENT_DEATH_HEALTH_BONUS]?;
|
|
115
134
|
private [UnitPropertyKey.IS_TEAM_GLOW_HIDDEN]?;
|
|
135
|
+
private [UnitPropertyKey.LAST_X]?;
|
|
136
|
+
private [UnitPropertyKey.LAST_Y]?;
|
|
116
137
|
private _owner?;
|
|
117
138
|
private _timeScale?;
|
|
118
139
|
private events?;
|
|
@@ -121,6 +142,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
121
142
|
private _fields?;
|
|
122
143
|
private getEvent;
|
|
123
144
|
constructor(handle: junit);
|
|
145
|
+
private saveData;
|
|
124
146
|
protected onDestroy(): HandleDestructor;
|
|
125
147
|
addAttackHandler(condition: AttackHandlerCondition, action: AttackHandlerAction): AttackHandler;
|
|
126
148
|
removeAttackHandler(handler: AttackHandler): boolean;
|
|
@@ -143,29 +165,26 @@ export declare class Unit extends Handle<junit> {
|
|
|
143
165
|
isVisibleTo(player: Player): boolean;
|
|
144
166
|
isInvisibleTo(player: Player): boolean;
|
|
145
167
|
isInRangeOf(x: number, y: number, range: number): boolean;
|
|
146
|
-
isInRangeOf(
|
|
168
|
+
isInRangeOf(widget: Widget, range: number): boolean;
|
|
147
169
|
isAllyOf(unit: Unit): boolean;
|
|
148
170
|
isEnemyOf(unit: Unit): boolean;
|
|
149
|
-
playAnimation(animation: string, rarity?: jraritycontrol): void;
|
|
150
|
-
|
|
171
|
+
playAnimation(...parameters: [animation: number] | [animation: string, rarity?: jraritycontrol]): void;
|
|
172
|
+
resetAnimation(): void;
|
|
151
173
|
queueAnimation(animation: string): void;
|
|
152
174
|
get weapons(): [UnitWeapon, UnitWeapon];
|
|
153
175
|
get firstWeapon(): UnitWeapon;
|
|
154
176
|
get secondWeapon(): UnitWeapon;
|
|
177
|
+
chooseWeapon(target: Unit): UnitWeapon | undefined;
|
|
155
178
|
get level(): number;
|
|
156
179
|
set level(v: number);
|
|
157
180
|
get xp(): number;
|
|
158
181
|
set xp(v: number);
|
|
159
|
-
get
|
|
160
|
-
set
|
|
182
|
+
get primaryAttribute(): UnitAttribute;
|
|
183
|
+
set primaryAttribute(primaryAttribute: UnitAttribute);
|
|
161
184
|
get strengthBonus(): number;
|
|
162
185
|
get strength(): number;
|
|
163
|
-
get agilityBase(): number;
|
|
164
|
-
set agilityBase(agilityBase: number);
|
|
165
186
|
get agilityBonus(): number;
|
|
166
187
|
get agility(): number;
|
|
167
|
-
get intelligenceBase(): number;
|
|
168
|
-
set intelligenceBase(intelligenceBase: number);
|
|
169
188
|
get intelligenceBonus(): number;
|
|
170
189
|
get intelligence(): number;
|
|
171
190
|
get name(): string;
|
|
@@ -199,8 +218,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
199
218
|
set facing(v: number);
|
|
200
219
|
get speed(): number;
|
|
201
220
|
set speed(v: number);
|
|
202
|
-
get flyHeight(): number;
|
|
203
|
-
set flyHeight(v: number);
|
|
204
221
|
get x(): number;
|
|
205
222
|
set x(v: number);
|
|
206
223
|
get y(): number;
|
|
@@ -224,12 +241,12 @@ export declare class Unit extends Handle<junit> {
|
|
|
224
241
|
get isInvulnerable(): boolean;
|
|
225
242
|
get vertexColor(): Color;
|
|
226
243
|
set vertexColor(v: Color);
|
|
227
|
-
get scale(): number;
|
|
228
|
-
set scale(v: number);
|
|
229
244
|
get timeScale(): number;
|
|
230
245
|
set timeScale(v: number);
|
|
231
246
|
get collisionSize(): number;
|
|
232
247
|
get pathingCollisionRange(): number;
|
|
248
|
+
get movementType(): MovementType;
|
|
249
|
+
set movementType(movementType: MovementType);
|
|
233
250
|
set pathing(v: boolean);
|
|
234
251
|
isSelected(player: Player): boolean;
|
|
235
252
|
explode(): void;
|
|
@@ -247,18 +264,17 @@ export declare class Unit extends Handle<junit> {
|
|
|
247
264
|
dropItemTarget(item: Item, target: Widget): boolean;
|
|
248
265
|
dropItemSlot(item: Item, slot: number): boolean;
|
|
249
266
|
itemInSlot(slot: number): Item | null;
|
|
250
|
-
addAbility(abilityId: number): UnitAbility |
|
|
267
|
+
addAbility(abilityId: number): UnitAbility | undefined;
|
|
251
268
|
makeAbilityPermanent(abilityId: number, permanent: true): boolean;
|
|
252
269
|
setAbilityLevel(abilityId: number, level: number): number;
|
|
253
270
|
getAbilityLevel(abilityId: number): number;
|
|
254
271
|
hasAbility(abilityId: number): boolean;
|
|
255
|
-
|
|
256
|
-
removeAbility(
|
|
272
|
+
getAbility(abilityId: number): UnitAbility | undefined;
|
|
273
|
+
removeAbility(abilityTypeId: number): boolean;
|
|
257
274
|
hideAbility(abilityId: number, flag: boolean): void;
|
|
258
275
|
getAbilityRemainingCooldown(abilityId: number): number;
|
|
259
276
|
startAbilityCooldown(abilityId: number, cooldown: number): void;
|
|
260
277
|
endAbilityCooldown(abilityId: number): void;
|
|
261
|
-
interruptAttack(): void;
|
|
262
278
|
interruptCast(abilityId: number): void;
|
|
263
279
|
getDistanceTo(target: Unit | Vec2): number;
|
|
264
280
|
getCollisionDistanceTo(...target: [Unit] | [targetX: number, targetY: number]): number;
|
|
@@ -272,14 +288,16 @@ export declare class Unit extends Handle<junit> {
|
|
|
272
288
|
unpauseEx(): void;
|
|
273
289
|
incrementStunCounter(): void;
|
|
274
290
|
decrementStunCounter(): void;
|
|
291
|
+
incrementForceStunCounter(): void;
|
|
292
|
+
decrementForceStunCounter(): void;
|
|
275
293
|
set waygateActive(v: boolean);
|
|
276
294
|
get waygateActive(): boolean;
|
|
277
295
|
set waygateDestination(v: Vec2);
|
|
278
296
|
get waygateDestination(): Vec2;
|
|
279
297
|
get abilities(): ReadonlyArray<UnitAbility>;
|
|
280
|
-
get onUnitInRange(): Record<number, Event<[Unit]>>;
|
|
281
298
|
get onManaEqual(): Record<number, Event<[Unit, number]>>;
|
|
282
299
|
get manaEvent(): Record<Operator, Record<number, Event<[Unit]>>>;
|
|
300
|
+
get targetAcquiredEvent(): Event;
|
|
283
301
|
get onSelect(): Event;
|
|
284
302
|
get onDeselect(): Event;
|
|
285
303
|
get onImmediateOrder(): Event<[number]>;
|
|
@@ -295,6 +313,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
295
313
|
static getInCollisionRange(x: number, y: number, range: number, predicate?: (unit: Unit) => boolean): Unit[];
|
|
296
314
|
static getInSector(pos: Vec2, range: number, offsetAngle: number, centralAngle: number): Unit[];
|
|
297
315
|
static getSelectionOf(player: Player, target?: Unit[]): Unit[];
|
|
316
|
+
static readonly levelChangedEvent: UnitTriggerEvent<[]>;
|
|
298
317
|
static readonly deathEvent: UnitTriggerEvent<[Unit]>;
|
|
299
318
|
static readonly onDecay: UnitTriggerEvent<[]>;
|
|
300
319
|
static readonly onResurrect: InitializingEvent<[Unit], void>;
|
|
@@ -305,7 +324,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
305
324
|
static readonly constructionStartEvent: UnitTriggerEvent<[]>;
|
|
306
325
|
static readonly onUpgradeFinish: UnitTriggerEvent<[]>;
|
|
307
326
|
static readonly onSpellEffect: EventDispatcher<[Unit, number], [Unit]>;
|
|
308
|
-
static readonly onTargetCast: EventDispatcher<[Unit, number,
|
|
327
|
+
static readonly onTargetCast: EventDispatcher<[Unit, number, Destructable | Unit | Item], [Unit, Destructable | Unit | Item]>;
|
|
309
328
|
static readonly onCastPrepare: AbilityEventDispatcher<[]>;
|
|
310
329
|
static readonly onCast: AbilityEventDispatcher<[]>;
|
|
311
330
|
static readonly onPointCastPrepare: AbilityEventDispatcher<[number, number]>;
|
|
@@ -332,14 +351,7 @@ export declare class Unit extends Handle<junit> {
|
|
|
332
351
|
static itemDroppedEvent: UnitTriggerEvent<[Item]>;
|
|
333
352
|
static itemPickedUpEvent: UnitTriggerEvent<[Item]>;
|
|
334
353
|
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
|
-
]>;
|
|
354
|
+
static get itemChargesChangedEvent(): Event<[unit: Unit, item: Item]>;
|
|
343
355
|
static get onCreate(): EventDispatcher<[Unit], [Unit]>;
|
|
344
356
|
static get destroyEvent(): EventDispatcher<[Unit], [Unit]>;
|
|
345
357
|
getField(field: junitintegerfield | junitrealfield): number;
|
|
@@ -351,5 +363,6 @@ export declare class Unit extends Handle<junit> {
|
|
|
351
363
|
setField(field: junitstringfield, value: string): boolean;
|
|
352
364
|
toString(): string;
|
|
353
365
|
static getBySyncId(syncId: UnitSyncId): Unit | undefined;
|
|
366
|
+
static synchronize: (player: Player, object: Unit | undefined) => Promise<Unit | undefined>;
|
|
354
367
|
}
|
|
355
368
|
export {};
|