warscript 0.0.1-dev.2af030d → 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 -1
- package/attributes.lua +17 -1
- package/binaryreader.d.ts +1 -0
- package/binaryreader.lua +3 -0
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/dummy.lua +4 -2
- package/core/types/effect.d.ts +24 -6
- package/core/types/effect.lua +169 -107
- package/core/types/frame.d.ts +29 -3
- package/core/types/frame.lua +222 -52
- package/core/types/group.d.ts +0 -1
- package/core/types/handle.lua +9 -9
- package/core/types/image.d.ts +0 -1
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- package/core/types/missile.d.ts +2 -2
- package/core/types/missile.lua +14 -13
- 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 +13 -0
- package/core/util.d.ts +3 -1
- package/core/util.lua +127 -4
- package/decl/index.d.ts +1 -0
- 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/ability.d.ts +1 -1
- package/engine/behavior.d.ts +24 -11
- package/engine/behavior.lua +233 -73
- package/engine/behaviour/ability/always-enabled.d.ts +7 -0
- package/engine/behaviour/ability/always-enabled.lua +31 -0
- package/engine/behaviour/ability/apply-buff.d.ts +8 -5
- package/engine/behaviour/ability/apply-buff.lua +36 -4
- package/engine/behaviour/ability/apply-unit-behavior.d.ts +6 -1
- package/engine/behaviour/ability/apply-unit-behavior.lua +6 -0
- package/engine/behaviour/ability/damage.d.ts +44 -11
- package/engine/behaviour/ability/damage.lua +89 -39
- package/engine/behaviour/ability/emulate-impact.d.ts +20 -0
- package/engine/behaviour/ability/emulate-impact.lua +117 -0
- package/engine/behaviour/ability/heal.d.ts +33 -6
- package/engine/behaviour/ability/heal.lua +89 -10
- package/engine/behaviour/ability/instant-impact.d.ts +14 -3
- package/engine/behaviour/ability/instant-impact.lua +20 -16
- package/engine/behaviour/ability/on-command-impact.d.ts +9 -0
- package/engine/behaviour/ability/on-command-impact.lua +26 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +25 -0
- package/engine/behaviour/ability/remove-buffs.lua +49 -0
- package/engine/behaviour/ability/restore-mana.d.ts +15 -0
- package/engine/behaviour/ability/restore-mana.lua +29 -0
- package/engine/behaviour/ability.d.ts +43 -7
- package/engine/behaviour/ability.lua +264 -27
- package/engine/behaviour/unit/stun-immunity.d.ts +12 -7
- package/engine/behaviour/unit/stun-immunity.lua +57 -31
- package/engine/behaviour/unit.d.ts +49 -4
- package/engine/behaviour/unit.lua +293 -2
- package/engine/buff.d.ts +189 -59
- package/engine/buff.lua +852 -281
- package/engine/game-map.d.ts +7 -0
- package/engine/game-map.lua +32 -0
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +30 -14
- package/engine/internal/ability.lua +177 -104
- package/engine/internal/item/ability.lua +162 -4
- 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 +34 -18
- package/engine/internal/item.lua +308 -102
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- package/engine/internal/misc/ability-disable-counter.lua +13 -0
- package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
- 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/auto-attack-speed-increase.d.ts +1 -1
- package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
- package/engine/internal/object-data/evasion-probability.d.ts +2 -0
- package/engine/internal/object-data/evasion-probability.lua +16 -0
- 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 +45 -1
- package/engine/internal/unit/ability.lua +144 -17
- package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +12 -0
- package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot.lua +93 -0
- 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 +28 -8
- package/engine/internal/unit/bonus.lua +136 -9
- 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.d.ts +2 -0
- package/engine/internal/unit/ignore-events-items.lua +14 -0
- package/engine/internal/unit/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/inventory.d.ts +28 -0
- 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.d.ts +13 -0
- package/engine/internal/unit/main-selected.lua +36 -0
- 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 +85 -5
- 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+transport.lua +4 -10
- package/engine/internal/unit-missile-data.lua +96 -68
- package/engine/internal/unit-missile-launch.lua +74 -13
- package/engine/internal/unit.d.ts +67 -35
- package/engine/internal/unit.lua +508 -308
- package/engine/internal/utility.lua +12 -0
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +52 -18
- package/engine/local-client.d.ts +35 -2
- package/engine/local-client.lua +367 -15
- 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 -3
- 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/combat-classification.d.ts +0 -2
- 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-preset-name.d.ts +5 -1
- 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.d.ts +0 -1
- 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 -1
- 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 -3
- 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/mine.d.ts +10 -0
- package/engine/object-data/entry/ability-type/mine.lua +39 -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/spirit-touch.d.ts +2 -2
- package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
- 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 -22
- package/engine/object-data/entry/ability-type.lua +392 -47
- package/engine/object-data/entry/buff-type/applicable.d.ts +0 -1
- package/engine/object-data/entry/buff-type/applicable.lua +131 -139
- package/engine/object-data/entry/buff-type/blank.d.ts +0 -1
- package/engine/object-data/entry/buff-type.d.ts +10 -13
- package/engine/object-data/entry/buff-type.lua +39 -29
- package/engine/object-data/entry/destructible-type.d.ts +32 -3
- package/engine/object-data/entry/destructible-type.lua +181 -0
- package/engine/object-data/entry/item-type/blank.d.ts +0 -1
- package/engine/object-data/entry/item-type.d.ts +32 -4
- package/engine/object-data/entry/item-type.lua +177 -2
- package/engine/object-data/entry/lightning-type.d.ts +6 -9
- 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 -7
- package/engine/object-data/entry/unit-type.lua +619 -99
- package/engine/object-data/entry/upgrade/blank.d.ts +0 -1
- package/engine/object-data/entry/upgrade.d.ts +2 -3
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +23 -17
- package/engine/object-data/entry.lua +68 -32
- package/engine/object-data/utility/object-data-entry-id-generator.lua +7 -0
- package/engine/object-field/ability.d.ts +28 -5
- package/engine/object-field/ability.lua +61 -7
- 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 -8
- package/engine/object-field.lua +362 -117
- package/engine/random.d.ts +11 -0
- package/engine/random.lua +30 -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 +23 -0
- package/engine/standard/entries/unit-type.lua +23 -0
- package/engine/standard/fields/ability.d.ts +7 -5
- package/engine/standard/fields/ability.lua +7 -5
- 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 +14 -0
- package/engine/unit.lua +23 -2
- package/event.d.ts +3 -4
- package/event.lua +9 -5
- package/index.d.ts +1 -0
- package/index.lua +1 -0
- package/lualib_bundle.lua +147 -43
- package/math/vec2.d.ts +2 -9
- package/math.d.ts +2 -2
- package/math.lua +14 -0
- package/net/socket.d.ts +7 -1
- package/net/socket.lua +45 -4
- package/network.d.ts +1 -0
- package/network.lua +28 -3
- package/objutil/ability.d.ts +0 -1
- package/objutil/buff.d.ts +0 -1
- package/objutil/buff.lua +13 -12
- package/objutil/object.d.ts +0 -1
- package/objutil/object.lua +1 -1
- package/objutil/unit.d.ts +0 -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.d.ts +0 -0
- package/patch-lua.lua +25 -0
- package/patch-lualib.lua +1 -1
- package/patch-natives.lua +3 -0
- package/property.d.ts +55 -0
- package/property.lua +374 -0
- package/string.d.ts +16 -0
- package/string.lua +5 -0
- package/util/stream.d.ts +0 -1
- package/utility/arrays.d.ts +20 -6
- package/utility/arrays.lua +62 -3
- package/utility/bit-set.d.ts +0 -2
- 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/lazy.d.ts +2 -0
- package/utility/lazy.lua +14 -0
- package/utility/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +16 -4
- package/utility/linked-set.lua +54 -3
- package/utility/lua-maps.d.ts +16 -4
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +3 -2
- 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 +4 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/core/mapbounds.d.ts +0 -8
- package/core/mapbounds.lua +0 -12
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/ability-disable-counter.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
package/core/types/frame.lua
CHANGED
|
@@ -12,16 +12,38 @@ local ____player = require("core.types.player")
|
|
|
12
12
|
local Player = ____player.Player
|
|
13
13
|
local ____event = require("event")
|
|
14
14
|
local Event = ____event.Event
|
|
15
|
+
local InitializingEvent = ____event.InitializingEvent
|
|
15
16
|
local TriggerEvent = ____event.TriggerEvent
|
|
16
17
|
local ____timer = require("core.types.timer")
|
|
17
18
|
local Timer = ____timer.Timer
|
|
19
|
+
local ____frame_2Dcoordinates = require("engine.internal.misc.frame-coordinates")
|
|
20
|
+
local FRAME_MAX_Y = ____frame_2Dcoordinates.FRAME_MAX_Y
|
|
21
|
+
local FRAME_MIN_Y = ____frame_2Dcoordinates.FRAME_MIN_Y
|
|
22
|
+
local getFrameMinXMaxX = ____frame_2Dcoordinates.getFrameMinXMaxX
|
|
23
|
+
local ____playerCamera = require("core.types.playerCamera")
|
|
24
|
+
local frameCoordinatesToWorld = ____playerCamera.frameCoordinatesToWorld
|
|
25
|
+
local ____lua_2Dsets = require("utility.lua-sets")
|
|
26
|
+
local mutableLuaSet = ____lua_2Dsets.mutableLuaSet
|
|
27
|
+
local ____socket = require("net.socket")
|
|
28
|
+
local Socket = ____socket.Socket
|
|
29
|
+
local ____lua_2Dmaps = require("utility.lua-maps")
|
|
30
|
+
local getOrPut = ____lua_2Dmaps.getOrPut
|
|
31
|
+
local luaMapInvert = ____lua_2Dmaps.luaMapInvert
|
|
32
|
+
local luaMapOf = ____lua_2Dmaps.luaMapOf
|
|
33
|
+
local mutableLuaMap = ____lua_2Dmaps.mutableLuaMap
|
|
18
34
|
local frameClick = BlzFrameClick
|
|
19
35
|
local frameGetEnable = BlzFrameGetEnable
|
|
20
36
|
local frameIsVisible = BlzFrameIsVisible
|
|
21
37
|
local frameSetEnable = BlzFrameSetEnable
|
|
22
38
|
local frameSetScale = BlzFrameSetScale
|
|
23
|
-
local
|
|
24
|
-
local
|
|
39
|
+
local getHandleId = GetHandleId
|
|
40
|
+
local getLocalClientHeight = BlzGetLocalClientHeight
|
|
41
|
+
local getMouseScreenPosX = BlzGetMouseScreenPosX
|
|
42
|
+
local getMouseScreenPosY = BlzGetMouseScreenPosY
|
|
43
|
+
local getOriginFrame = BlzGetOriginFrame
|
|
44
|
+
local location = Location
|
|
45
|
+
local pixelToFrameX = BlzPixelToFrameX
|
|
46
|
+
local pixelToFrameY = BlzPixelToFrameY
|
|
25
47
|
local ____rawget = _G.rawget
|
|
26
48
|
local rawset = _G.rawset
|
|
27
49
|
local invoke = Event.invoke
|
|
@@ -62,8 +84,10 @@ local function updateBorders()
|
|
|
62
84
|
local width4by3 = (w - h / 600 * 800) / 2
|
|
63
85
|
local pxtodpi = 0.6 / h
|
|
64
86
|
BlzFrameSetAbsPoint(leftBorder, FRAMEPOINT_TOPLEFT, -width4by3 * pxtodpi, 0.6)
|
|
87
|
+
BlzFrameSetScale(leftBorder, 1)
|
|
65
88
|
BlzFrameSetSize(leftBorder, 0.001, 0.6)
|
|
66
89
|
BlzFrameSetAbsPoint(rightBorder, FRAMEPOINT_TOPRIGHT, (-width4by3 + w) * pxtodpi, 0.6)
|
|
90
|
+
BlzFrameSetScale(rightBorder, 1)
|
|
67
91
|
BlzFrameSetSize(rightBorder, 0.001, 0.6)
|
|
68
92
|
end
|
|
69
93
|
local worldFrame = BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0)
|
|
@@ -107,6 +131,37 @@ Timer.onPeriod[1 / 64]:addListener(function()
|
|
|
107
131
|
frameClick(isMouseOnWorld and dummyButtonOn or dummyButtonOff)
|
|
108
132
|
end
|
|
109
133
|
end)
|
|
134
|
+
--- The poll is registered synchronously at module load and runs only while the event has
|
|
135
|
+
-- listeners. Initializing and deinitializing the event only toggle this flag — they create no
|
|
136
|
+
-- handles and add no timer listeners — so subscribing and unsubscribing are async-safe.
|
|
137
|
+
local isMouseMoveLocalPollActive = false
|
|
138
|
+
local lastMouseMoveLocalX = 0
|
|
139
|
+
local lastMouseMoveLocalY = 0
|
|
140
|
+
local mouseMoveLocalEvent = __TS__New(
|
|
141
|
+
InitializingEvent,
|
|
142
|
+
function()
|
|
143
|
+
isMouseMoveLocalPollActive = true
|
|
144
|
+
lastMouseMoveLocalX = 0 / 0
|
|
145
|
+
lastMouseMoveLocalY = 0 / 0
|
|
146
|
+
end,
|
|
147
|
+
function()
|
|
148
|
+
isMouseMoveLocalPollActive = false
|
|
149
|
+
end
|
|
150
|
+
)
|
|
151
|
+
Timer.onPeriod[1 / 64]:addListener(function()
|
|
152
|
+
if not isMouseMoveLocalPollActive or getLocalClientHeight() == 0 then
|
|
153
|
+
return
|
|
154
|
+
end
|
|
155
|
+
local x, y, ____, isDefinite = frameCoordinatesToWorld(
|
|
156
|
+
pixelToFrameX(getMouseScreenPosX()),
|
|
157
|
+
pixelToFrameY(getMouseScreenPosY())
|
|
158
|
+
)
|
|
159
|
+
if isDefinite and (x ~= lastMouseMoveLocalX or y ~= lastMouseMoveLocalY) then
|
|
160
|
+
lastMouseMoveLocalX = x
|
|
161
|
+
lastMouseMoveLocalY = y
|
|
162
|
+
invoke(mouseMoveLocalEvent, x, y)
|
|
163
|
+
end
|
|
164
|
+
end)
|
|
110
165
|
____exports.FramePoint = {}
|
|
111
166
|
local FramePoint = ____exports.FramePoint
|
|
112
167
|
do
|
|
@@ -120,6 +175,80 @@ do
|
|
|
120
175
|
FramePoint.BOTTOM = FRAMEPOINT_BOTTOM
|
|
121
176
|
FramePoint.BOTTOM_RIGHT = FRAMEPOINT_BOTTOMRIGHT
|
|
122
177
|
end
|
|
178
|
+
local tooltipByFrame = setmetatable({}, {__mode = "k"})
|
|
179
|
+
local isMouseInsideLocallyByFrame = mutableLuaMap()
|
|
180
|
+
local mouseEnterLocalEventByFrame = mutableLuaMap()
|
|
181
|
+
local mouseLeaveLocalEventByFrame = mutableLuaMap()
|
|
182
|
+
local isLocalMouseTrackingStarted = false
|
|
183
|
+
--- Reused across ticks to avoid per-tick allocations: only the first `leftFrameCount` /
|
|
184
|
+
-- `enteredFrameCount` entries are meaningful, stale entries beyond them are never read and are
|
|
185
|
+
-- kept collectable by the weak values mode.
|
|
186
|
+
local leftFrames = setmetatable({}, {__mode = "v"})
|
|
187
|
+
local enteredFrames = setmetatable({}, {__mode = "v"})
|
|
188
|
+
--- All frames share a single poll which invokes every mouse leave event before any mouse enter
|
|
189
|
+
-- event within the same tick. With a poll per event, the invocation order would depend on the
|
|
190
|
+
-- event creation order instead, breaking listeners relying on the natural "leave the old frame,
|
|
191
|
+
-- then enter the new frame" order.
|
|
192
|
+
local function startLocalMouseTracking()
|
|
193
|
+
if isLocalMouseTrackingStarted then
|
|
194
|
+
return
|
|
195
|
+
end
|
|
196
|
+
isLocalMouseTrackingStarted = true
|
|
197
|
+
Timer.onPeriod[1 / 64]:addListener(function()
|
|
198
|
+
local leftFrameCount = 0
|
|
199
|
+
local enteredFrameCount = 0
|
|
200
|
+
for frame, wasMouseInside in pairs(isMouseInsideLocallyByFrame) do
|
|
201
|
+
local tooltip = tooltipByFrame[frame]
|
|
202
|
+
local isMouseInside = tooltip ~= nil and tooltip.visible
|
|
203
|
+
if isMouseInside ~= wasMouseInside then
|
|
204
|
+
isMouseInsideLocallyByFrame[frame] = isMouseInside
|
|
205
|
+
if isMouseInside then
|
|
206
|
+
enteredFrames[enteredFrameCount + 1] = frame
|
|
207
|
+
enteredFrameCount = enteredFrameCount + 1
|
|
208
|
+
else
|
|
209
|
+
leftFrames[leftFrameCount + 1] = frame
|
|
210
|
+
leftFrameCount = leftFrameCount + 1
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
for i = 1, leftFrameCount do
|
|
215
|
+
local event = mouseLeaveLocalEventByFrame[leftFrames[i]]
|
|
216
|
+
if event ~= nil then
|
|
217
|
+
Event.invoke(event)
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
for i = 1, enteredFrameCount do
|
|
221
|
+
local event = mouseEnterLocalEventByFrame[enteredFrames[i]]
|
|
222
|
+
if event ~= nil then
|
|
223
|
+
Event.invoke(event)
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end)
|
|
227
|
+
end
|
|
228
|
+
local keyByAsyncInitOriginFrameType = luaMapOf(ORIGIN_FRAME_PORTRAIT_HP_TEXT, "hp", ORIGIN_FRAME_PORTRAIT_MANA_TEXT, "mana")
|
|
229
|
+
local asyncInitOriginFrameTypeByKey = luaMapInvert(keyByAsyncInitOriginFrameType)
|
|
230
|
+
local seenAsyncInitOriginFrameTypes = mutableLuaSet()
|
|
231
|
+
local seenAsyncInitOriginFrameTypesSocket = __TS__New(Socket)
|
|
232
|
+
local seenPlayersByAsyncInitOriginFrameType = mutableLuaMap()
|
|
233
|
+
seenAsyncInitOriginFrameTypesSocket.onMessage:addListener(function(player, key)
|
|
234
|
+
local asyncInitOriginFrameType = asyncInitOriginFrameTypeByKey[key]
|
|
235
|
+
if asyncInitOriginFrameType ~= nil then
|
|
236
|
+
getOrPut(seenPlayersByAsyncInitOriginFrameType, asyncInitOriginFrameType, mutableLuaSet)[player] = true
|
|
237
|
+
end
|
|
238
|
+
end)
|
|
239
|
+
local function haveAllPlayersSeenAsyncInitOriginFrameType(frame)
|
|
240
|
+
local players = seenPlayersByAsyncInitOriginFrameType[frame]
|
|
241
|
+
if players == nil then
|
|
242
|
+
return false
|
|
243
|
+
end
|
|
244
|
+
for ____, player in ipairs(Player.all) do
|
|
245
|
+
if player.isUser and player.isPlaying and not (players[player] ~= nil) then
|
|
246
|
+
return false
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
keyByAsyncInitOriginFrameType[frame] = nil
|
|
250
|
+
return true
|
|
251
|
+
end
|
|
123
252
|
____exports.Frame = __TS__Class()
|
|
124
253
|
local Frame = ____exports.Frame
|
|
125
254
|
Frame.name = "Frame"
|
|
@@ -152,6 +281,18 @@ function Frame.prototype.getEvent(self, eventType, c)
|
|
|
152
281
|
end
|
|
153
282
|
return self.events[eventId]
|
|
154
283
|
end
|
|
284
|
+
function Frame.prototype.trackMouseLocally(self)
|
|
285
|
+
if not (tooltipByFrame[self] ~= nil) then
|
|
286
|
+
____exports.Frame.SIMPLE_FRAME_TEST_CHILD.parent = self
|
|
287
|
+
local tooltip = ____exports.Frame.SIMPLE_FRAME_TEST_CHILD.parent == self and ____exports.Frame:createByType("SIMPLEFRAME", "", ____exports.Frame.CONSOLE_UI) or ____exports.Frame:createByType("FRAME", "", ____exports.Frame.GAME_UI)
|
|
288
|
+
____exports.Frame.SIMPLE_FRAME_TEST_CHILD.parent = ____exports.Frame.CONSOLE_UI
|
|
289
|
+
self:setTooltip(tooltip)
|
|
290
|
+
end
|
|
291
|
+
if not (isMouseInsideLocallyByFrame[self] ~= nil) then
|
|
292
|
+
isMouseInsideLocallyByFrame[self] = false
|
|
293
|
+
startLocalMouseTracking()
|
|
294
|
+
end
|
|
295
|
+
end
|
|
155
296
|
function Frame.prototype.hide(self)
|
|
156
297
|
self.hideCounter = self.hideCounter + 1
|
|
157
298
|
if self.hideCounter > 0 then
|
|
@@ -240,6 +381,7 @@ function Frame.prototype.setTextColor(self, color)
|
|
|
240
381
|
end
|
|
241
382
|
function Frame.prototype.setTooltip(self, tooltip)
|
|
242
383
|
BlzFrameSetTooltip(self.handle, tooltip.handle)
|
|
384
|
+
tooltipByFrame[self] = tooltip
|
|
243
385
|
end
|
|
244
386
|
function Frame.prototype.setMinMaxValue(self, minValue, maxValue)
|
|
245
387
|
BlzFrameSetMinMaxValue(self.handle, minValue, maxValue)
|
|
@@ -267,7 +409,16 @@ function Frame.createSimple(self, name, parent, createContext)
|
|
|
267
409
|
))
|
|
268
410
|
end
|
|
269
411
|
function Frame.create(self, name, parent, priority, createContext)
|
|
270
|
-
|
|
412
|
+
if parent == ____exports.Frame.CONSOLE_UI_BACKDROP then
|
|
413
|
+
local helper = ____exports.Frame.CONSOLE_UI_BACKDROP_UI_SCALE_HELPER_CHILD.handle
|
|
414
|
+
BlzFrameSetScale(helper, 1)
|
|
415
|
+
local frame = BlzCreateFrame(name, helper, priority or 0, createContext or 0)
|
|
416
|
+
BlzFrameSetScale(helper, ____exports.Frame.uiScale)
|
|
417
|
+
BlzFrameSetParent(frame, ____exports.Frame.CONSOLE_UI_BACKDROP.handle)
|
|
418
|
+
return self:of(frame)
|
|
419
|
+
else
|
|
420
|
+
return self:of(BlzCreateFrame(name, parent.handle, priority or 0, createContext or 0))
|
|
421
|
+
end
|
|
271
422
|
end
|
|
272
423
|
function Frame.createByType(self, typeName, name, parent, inherits, createContext)
|
|
273
424
|
return self:of(BlzCreateFrameByType(
|
|
@@ -288,14 +439,35 @@ function Frame.byOrigin(self, frameType, index)
|
|
|
288
439
|
if index == nil then
|
|
289
440
|
index = 0
|
|
290
441
|
end
|
|
291
|
-
|
|
442
|
+
local frame = getOriginFrame(frameType, index)
|
|
443
|
+
local asyncInitOriginFrameTypeKey = keyByAsyncInitOriginFrameType[frameType]
|
|
444
|
+
if index == 0 and asyncInitOriginFrameTypeKey ~= nil and not haveAllPlayersSeenAsyncInitOriginFrameType(frameType) then
|
|
445
|
+
if getHandleId(frame) == 0 or seenAsyncInitOriginFrameTypes[frameType] ~= nil then
|
|
446
|
+
location(0, 0)
|
|
447
|
+
else
|
|
448
|
+
seenAsyncInitOriginFrameTypes[frameType] = true
|
|
449
|
+
seenAsyncInitOriginFrameTypesSocket:send(asyncInitOriginFrameTypeKey)
|
|
450
|
+
end
|
|
451
|
+
end
|
|
452
|
+
return self:of(frame)
|
|
292
453
|
end
|
|
293
454
|
Frame.GAME_UI = ____exports.Frame:byOrigin(ORIGIN_FRAME_GAME_UI)
|
|
294
455
|
Frame.CONSOLE_UI = ____exports.Frame:byOrigin(ORIGIN_FRAME_SIMPLE_UI_PARENT)
|
|
295
456
|
Frame.CONSOLE_UI_BACKDROP = ____exports.Frame:byName("ConsoleUIBackdrop")
|
|
457
|
+
Frame.CONSOLE_UI_BACKDROP_UI_SCALE_HELPER_CHILD = ____exports.Frame:createByType("FRAME", "ConsoleUIBackdropUIScaleHelperChild", ____exports.Frame.CONSOLE_UI_BACKDROP)
|
|
458
|
+
Frame.CONSOLE_TOP_BAR = ____exports.Frame:byName("ConsoleTopBar")
|
|
459
|
+
Frame.CONSOLE_BOTTOM_BAR = ____exports.Frame:byName("ConsoleBottomBar")
|
|
296
460
|
Frame.WORLD = ____exports.Frame:byOrigin(ORIGIN_FRAME_WORLD_FRAME)
|
|
297
461
|
Frame.CHAT = ____exports.Frame:byOrigin(ORIGIN_FRAME_CHAT_MSG)
|
|
298
462
|
Frame.TIME_OF_DAY_CLOCK = ____exports.Frame.GAME_UI:getChild(5):getChild(0)
|
|
463
|
+
Frame.SIMPLE_FRAME_TEST_CHILD = ____exports.Frame:createByType("SIMPLEFRAME", "SimpleFrameTestParent", ____exports.Frame.CONSOLE_UI)
|
|
464
|
+
__TS__ObjectDefineProperty(
|
|
465
|
+
Frame,
|
|
466
|
+
"uiScale",
|
|
467
|
+
{get = function(self)
|
|
468
|
+
return ____exports.Frame.CONSOLE_BOTTOM_BAR.width / 0.8
|
|
469
|
+
end}
|
|
470
|
+
)
|
|
299
471
|
__TS__ObjectDefineProperty(
|
|
300
472
|
Frame,
|
|
301
473
|
"leftBorder",
|
|
@@ -320,27 +492,21 @@ __TS__ObjectDefineProperty(
|
|
|
320
492
|
Frame,
|
|
321
493
|
"minX",
|
|
322
494
|
{get = function(self)
|
|
323
|
-
local
|
|
324
|
-
|
|
325
|
-
local width4by3 = (w - h / 600 * 800) / 2
|
|
326
|
-
local pxtodpi = 0.6 / h
|
|
327
|
-
return -width4by3 * pxtodpi
|
|
495
|
+
local minX = getFrameMinXMaxX()
|
|
496
|
+
return minX
|
|
328
497
|
end}
|
|
329
498
|
)
|
|
330
499
|
__TS__ObjectDefineProperty(
|
|
331
500
|
Frame,
|
|
332
501
|
"maxX",
|
|
333
502
|
{get = function(self)
|
|
334
|
-
local
|
|
335
|
-
|
|
336
|
-
local width4by3 = (w - h / 600 * 800) / 2
|
|
337
|
-
local pxtodpi = 0.6 / h
|
|
338
|
-
return (-width4by3 + w) * pxtodpi
|
|
503
|
+
local ____, maxX = getFrameMinXMaxX()
|
|
504
|
+
return maxX
|
|
339
505
|
end}
|
|
340
506
|
)
|
|
341
507
|
Frame.centerX = 0.4
|
|
342
|
-
Frame.minY =
|
|
343
|
-
Frame.maxY =
|
|
508
|
+
Frame.minY = FRAME_MIN_Y
|
|
509
|
+
Frame.maxY = FRAME_MAX_Y
|
|
344
510
|
Frame.centerY = 0.3
|
|
345
511
|
__TS__SetDescriptor(
|
|
346
512
|
Frame.prototype,
|
|
@@ -597,6 +763,30 @@ __TS__SetDescriptor(
|
|
|
597
763
|
end},
|
|
598
764
|
true
|
|
599
765
|
)
|
|
766
|
+
__TS__SetDescriptor(
|
|
767
|
+
Frame.prototype,
|
|
768
|
+
"mouseEnterLocalEvent",
|
|
769
|
+
{get = function(self)
|
|
770
|
+
local event = __TS__New(Event)
|
|
771
|
+
self:trackMouseLocally()
|
|
772
|
+
mouseEnterLocalEventByFrame[self] = event
|
|
773
|
+
rawset(self, "mouseEnterLocalEvent", event)
|
|
774
|
+
return event
|
|
775
|
+
end},
|
|
776
|
+
true
|
|
777
|
+
)
|
|
778
|
+
__TS__SetDescriptor(
|
|
779
|
+
Frame.prototype,
|
|
780
|
+
"mouseLeaveLocalEvent",
|
|
781
|
+
{get = function(self)
|
|
782
|
+
local event = __TS__New(Event)
|
|
783
|
+
self:trackMouseLocally()
|
|
784
|
+
mouseLeaveLocalEventByFrame[self] = event
|
|
785
|
+
rawset(self, "mouseLeaveLocalEvent", event)
|
|
786
|
+
return event
|
|
787
|
+
end},
|
|
788
|
+
true
|
|
789
|
+
)
|
|
600
790
|
__TS__SetDescriptor(
|
|
601
791
|
Frame.prototype,
|
|
602
792
|
"popupMenuItemChangeEvent",
|
|
@@ -699,6 +889,18 @@ __TS__SetDescriptor(
|
|
|
699
889
|
end},
|
|
700
890
|
true
|
|
701
891
|
)
|
|
892
|
+
__TS__SetDescriptor(
|
|
893
|
+
Frame.prototype,
|
|
894
|
+
"children",
|
|
895
|
+
{get = function(self)
|
|
896
|
+
local children = {}
|
|
897
|
+
for i = 0, self:getChildrenCount() - 1 do
|
|
898
|
+
children[i + 1] = self:getChild(i)
|
|
899
|
+
end
|
|
900
|
+
return children
|
|
901
|
+
end},
|
|
902
|
+
true
|
|
903
|
+
)
|
|
702
904
|
__TS__ObjectDefineProperty(
|
|
703
905
|
Frame,
|
|
704
906
|
"onKeyPress",
|
|
@@ -820,7 +1022,7 @@ __TS__ObjectDefineProperty(
|
|
|
820
1022
|
)
|
|
821
1023
|
__TS__ObjectDefineProperty(
|
|
822
1024
|
Frame,
|
|
823
|
-
"
|
|
1025
|
+
"mouseMoveEvent",
|
|
824
1026
|
{get = function(self)
|
|
825
1027
|
local event = __TS__New(
|
|
826
1028
|
TriggerEvent,
|
|
@@ -834,47 +1036,15 @@ __TS__ObjectDefineProperty(
|
|
|
834
1036
|
) end,
|
|
835
1037
|
function() return Player:of(GetTriggerPlayer()), BlzGetTriggerPlayerMouseX(), BlzGetTriggerPlayerMouseY() end
|
|
836
1038
|
)
|
|
837
|
-
rawset(____exports.Frame, "
|
|
1039
|
+
rawset(____exports.Frame, "mouseMoveEvent", event)
|
|
838
1040
|
return event
|
|
839
1041
|
end}
|
|
840
1042
|
)
|
|
841
1043
|
__TS__ObjectDefineProperty(
|
|
842
1044
|
Frame,
|
|
843
|
-
"
|
|
1045
|
+
"mouseMoveLocalEvent",
|
|
844
1046
|
{get = function(self)
|
|
845
|
-
|
|
846
|
-
local event = __TS__New(Event)
|
|
847
|
-
local syncX = 0
|
|
848
|
-
local syncY = 0
|
|
849
|
-
local syncCamX = getCameraTargetPositionX()
|
|
850
|
-
local syncCamY = getCameraTargetPositionY()
|
|
851
|
-
local lastX = syncX
|
|
852
|
-
local lastY = syncY
|
|
853
|
-
self.onMouseMove:addListener(function(player, x, y)
|
|
854
|
-
if player.isLocal then
|
|
855
|
-
syncX = x
|
|
856
|
-
syncY = y
|
|
857
|
-
syncCamX = getCameraTargetPositionX()
|
|
858
|
-
syncCamY = getCameraTargetPositionY()
|
|
859
|
-
lastX = x
|
|
860
|
-
lastY = y
|
|
861
|
-
invoke(event, x, y)
|
|
862
|
-
end
|
|
863
|
-
end)
|
|
864
|
-
Timer.onPeriod[1 / 64]:addListener(function()
|
|
865
|
-
if syncX == 0 and syncY == 0 then
|
|
866
|
-
return
|
|
867
|
-
end
|
|
868
|
-
local x = syncX + (getCameraTargetPositionX() - syncCamX)
|
|
869
|
-
local y = syncY + (getCameraTargetPositionY() - syncCamY)
|
|
870
|
-
if x ~= lastX or y ~= lastY then
|
|
871
|
-
lastX = x
|
|
872
|
-
lastY = y
|
|
873
|
-
invoke(event, x, y)
|
|
874
|
-
end
|
|
875
|
-
end)
|
|
876
|
-
rawset(____exports.Frame, "onMouseMoveLocal", event)
|
|
877
|
-
return event
|
|
1047
|
+
return mouseMoveLocalEvent
|
|
878
1048
|
end}
|
|
879
1049
|
)
|
|
880
1050
|
leftBorderFrame = ____exports.Frame:of(leftBorder)
|
package/core/types/group.d.ts
CHANGED
package/core/types/handle.lua
CHANGED
|
@@ -15,6 +15,8 @@ local ____exception = require("exception")
|
|
|
15
15
|
local IllegalStateException = ____exception.IllegalStateException
|
|
16
16
|
local ____attributes = require("attributes")
|
|
17
17
|
local AttributesHolder = ____attributes.AttributesHolder
|
|
18
|
+
local ____preconditions = require("utility.preconditions")
|
|
19
|
+
local checkNotNull = ____preconditions.checkNotNull
|
|
18
20
|
local getHandleId = GetHandleId
|
|
19
21
|
local onCreateEventByHandleConstructor = {}
|
|
20
22
|
local onDestroyEventByHandleConstructor = {}
|
|
@@ -58,6 +60,9 @@ function Handle.invokeOnCreateEvent(self, clazz, handle)
|
|
|
58
60
|
Event.invoke(onCreateEvent, handle)
|
|
59
61
|
end
|
|
60
62
|
end
|
|
63
|
+
function Handle.isWrapped(self, handle)
|
|
64
|
+
return self.memoized[getHandleId(handle)] ~= nil
|
|
65
|
+
end
|
|
61
66
|
function Handle.prototype.__tostring(self)
|
|
62
67
|
return (self.constructor.name .. "@") .. tostring(getHandleId(self.handle))
|
|
63
68
|
end
|
|
@@ -66,17 +71,12 @@ function Handle.prototype.onDestroy(self, ...)
|
|
|
66
71
|
return nil
|
|
67
72
|
end
|
|
68
73
|
function Handle.prototype.destroy(self, ...)
|
|
74
|
+
if self[0] == 2 or self[0] == 3 then
|
|
75
|
+
return nil
|
|
76
|
+
end
|
|
69
77
|
local clazz = self.constructor
|
|
70
78
|
local id = getHandleId(self.handle)
|
|
71
|
-
|
|
72
|
-
error(
|
|
73
|
-
__TS__New(
|
|
74
|
-
IllegalStateException,
|
|
75
|
-
"Double-destroy run for handle " .. tostring(id)
|
|
76
|
-
),
|
|
77
|
-
0
|
|
78
|
-
)
|
|
79
|
-
end
|
|
79
|
+
checkNotNull(clazz.memoized[id])
|
|
80
80
|
self[0] = 2
|
|
81
81
|
if self.onDestroyEvent then
|
|
82
82
|
Event.invoke(self.onDestroyEvent)
|
package/core/types/image.d.ts
CHANGED
package/core/types/item.d.ts
CHANGED
package/core/types/item.lua
CHANGED
package/core/types/missile.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare class Missile implements Destroyable {
|
|
|
5
5
|
readonly retarget: (this: void, target: Unit | Vec2) => void;
|
|
6
6
|
private readonly update;
|
|
7
7
|
protected constructor(effect: jeffect, retarget: (this: void, target: Unit | Vec2) => void, update: (this: Missile) => boolean);
|
|
8
|
-
static launch(config: Readonly<{
|
|
8
|
+
static launch<T extends any[]>(config: Readonly<{
|
|
9
9
|
art: string;
|
|
10
10
|
scale?: number;
|
|
11
11
|
acceleration?: number;
|
|
@@ -15,7 +15,7 @@ export declare class Missile implements Destroyable {
|
|
|
15
15
|
maxSpeed?: number;
|
|
16
16
|
sourceOffset?: Vec2;
|
|
17
17
|
targetOffset?: Vec2;
|
|
18
|
-
}>, source: Unit | Vec2, target: Unit | Vec2, onArrival: (missile: Missile, success: boolean) => void): Missile;
|
|
18
|
+
}>, source: Unit | Vec2, target: Unit | Vec2, onArrival: (missile: Missile, success: boolean, ...parameters: T) => void, ...parameters: T): Missile;
|
|
19
19
|
destroy(): void;
|
|
20
20
|
}
|
|
21
21
|
export declare namespace Missile {
|
package/core/types/missile.lua
CHANGED
|
@@ -25,6 +25,7 @@ local getHandleId = GetHandleId
|
|
|
25
25
|
local getUnitX = GetUnitX
|
|
26
26
|
local getUnitY = GetUnitY
|
|
27
27
|
local safeCall = warpack.safeCall
|
|
28
|
+
local UPDATE_PERIOD = 1 / 64
|
|
28
29
|
local head
|
|
29
30
|
local next = {}
|
|
30
31
|
local previous = {}
|
|
@@ -41,13 +42,12 @@ function Missile.prototype.____constructor(self, effect, retarget, update)
|
|
|
41
42
|
end
|
|
42
43
|
head = self
|
|
43
44
|
end
|
|
44
|
-
function Missile.launch(self, config, source, target, onArrival)
|
|
45
|
+
function Missile.launch(self, config, source, target, onArrival, ...)
|
|
46
|
+
local parameters = {...}
|
|
45
47
|
local ____opt_0 = config.sourceOffset
|
|
46
48
|
local offsetX = ____opt_0 and ____opt_0.x or 0
|
|
47
49
|
local ____opt_2 = config.sourceOffset
|
|
48
50
|
local offsetY = ____opt_2 and ____opt_2.y or 0
|
|
49
|
-
local visualOffsetX = 0
|
|
50
|
-
local visualOffsetY = 0
|
|
51
51
|
local ____temp_6 = source.z or terrainZ(source)
|
|
52
52
|
local ____opt_4 = config.sourceOffset
|
|
53
53
|
local visualOffsetZ = ____temp_6 + (____opt_4 and ____opt_4.z or 0)
|
|
@@ -55,15 +55,11 @@ function Missile.launch(self, config, source, target, onArrival)
|
|
|
55
55
|
local data = MISSILE_DATA_BY_UNIT_TYPE_ID[source.typeId]
|
|
56
56
|
local launchX = data.launchOffsetX
|
|
57
57
|
local launchY = data.launchOffsetY
|
|
58
|
-
local projectileVisOffsetX = data.launchVisualOffsetX
|
|
59
|
-
local projectileVisOffsetY = data.launchVisualOffsetY
|
|
60
58
|
local angle = rad(source.facing - 90)
|
|
61
59
|
local s = sin(angle)
|
|
62
60
|
local c = cos(angle)
|
|
63
61
|
offsetX = offsetX + (c * launchX - s * launchY)
|
|
64
62
|
offsetY = offsetY + (s * launchX + c * launchY)
|
|
65
|
-
visualOffsetX = visualOffsetX + (c * projectileVisOffsetX - s * projectileVisOffsetY)
|
|
66
|
-
visualOffsetY = visualOffsetY + (s * projectileVisOffsetX + c * projectileVisOffsetY)
|
|
67
63
|
visualOffsetZ = visualOffsetZ + data.launchOffsetZ
|
|
68
64
|
end
|
|
69
65
|
local ____opt_7 = config.targetOffset
|
|
@@ -81,8 +77,8 @@ function Missile.launch(self, config, source, target, onArrival)
|
|
|
81
77
|
local retarget = false
|
|
82
78
|
local positionX = source.x + offsetX
|
|
83
79
|
local positionY = source.y + offsetY
|
|
84
|
-
local visualPositionX = positionX
|
|
85
|
-
local visualPositionY = positionY
|
|
80
|
+
local visualPositionX = positionX
|
|
81
|
+
local visualPositionY = positionY
|
|
86
82
|
local visualPositionZ = visualOffsetZ
|
|
87
83
|
local visualPositionArcX = visualPositionX
|
|
88
84
|
local visualPositionArcY = visualPositionY
|
|
@@ -100,8 +96,8 @@ function Missile.launch(self, config, source, target, onArrival)
|
|
|
100
96
|
if config.scale then
|
|
101
97
|
setSpecialEffectScale(effect, config.scale)
|
|
102
98
|
end
|
|
103
|
-
local acceleration = (config.acceleration or 0)
|
|
104
|
-
local speed = config.speed
|
|
99
|
+
local acceleration = (config.acceleration or 0) * UPDATE_PERIOD * UPDATE_PERIOD
|
|
100
|
+
local speed = config.speed * UPDATE_PERIOD + acceleration / 2
|
|
105
101
|
local arcVAcceleration = 0
|
|
106
102
|
local arcVSpeed = 0
|
|
107
103
|
if config.arc then
|
|
@@ -142,7 +138,12 @@ function Missile.launch(self, config, source, target, onArrival)
|
|
|
142
138
|
visualPositionArcY = currentVisualTargetY
|
|
143
139
|
visualPositionArcZ = currentVisualTargetZ
|
|
144
140
|
retarget = false
|
|
145
|
-
safeCall(
|
|
141
|
+
safeCall(
|
|
142
|
+
onArrival,
|
|
143
|
+
self,
|
|
144
|
+
true,
|
|
145
|
+
table.unpack(parameters)
|
|
146
|
+
)
|
|
146
147
|
return not retarget
|
|
147
148
|
end
|
|
148
149
|
if arcVSpeed ~= 0 and (currentTargetX ~= initialTargetX or currentTargetY ~= initialTargetY) then
|
|
@@ -220,7 +221,7 @@ function Missile.prototype.destroy(self)
|
|
|
220
221
|
previous[self] = nil
|
|
221
222
|
next[self] = nil
|
|
222
223
|
end
|
|
223
|
-
Timer.onPeriod[
|
|
224
|
+
Timer.onPeriod[UPDATE_PERIOD]:addListener(function()
|
|
224
225
|
local missile = head
|
|
225
226
|
while missile do
|
|
226
227
|
local nextMissile = next[missile]
|
package/core/types/player.d.ts
CHANGED
|
@@ -7,6 +7,18 @@ import { UpgradeId } from "../../engine/object-data/entry/upgrade";
|
|
|
7
7
|
interface Unit {
|
|
8
8
|
handle: junit;
|
|
9
9
|
}
|
|
10
|
+
export declare const enum PlayerAllianceType {
|
|
11
|
+
PASSIVE = 0,
|
|
12
|
+
RESCUABLE = 1,
|
|
13
|
+
HELP_REQUEST = 2,
|
|
14
|
+
HELP_RESPONSE = 3,
|
|
15
|
+
SHARED_XP = 4,
|
|
16
|
+
SHARED_SPELLS = 5,
|
|
17
|
+
SHARED_VISION = 6,
|
|
18
|
+
SHARED_VISION_FORCED = 7,
|
|
19
|
+
SHARED_CONTROL = 8,
|
|
20
|
+
SHARED_ADVANCED_CONTROL = 9
|
|
21
|
+
}
|
|
10
22
|
export declare class Player extends Handle<jplayer> {
|
|
11
23
|
static readonly all: Player[];
|
|
12
24
|
static readonly local: Player;
|
|
@@ -16,6 +28,7 @@ export declare class Player extends Handle<jplayer> {
|
|
|
16
28
|
static readonly neutralExtra: Player;
|
|
17
29
|
private static events;
|
|
18
30
|
readonly id: number;
|
|
31
|
+
readonly slotState: jplayerslotstate;
|
|
19
32
|
constructor(handle: jplayer);
|
|
20
33
|
onDestroy(): HandleDestructor;
|
|
21
34
|
toString(): string;
|
|
@@ -33,15 +46,17 @@ export declare class Player extends Handle<jplayer> {
|
|
|
33
46
|
get isUser(): boolean;
|
|
34
47
|
get isPlaying(): boolean;
|
|
35
48
|
get controller(): jmapcontrol;
|
|
36
|
-
get slotState(): jplayerslotstate;
|
|
37
49
|
clearSelection(): void;
|
|
38
50
|
selectSingle(unit: Unit): void;
|
|
39
51
|
select(unit: Unit): void;
|
|
40
52
|
deselect(unit: Unit): void;
|
|
53
|
+
setRaceSkin(racePreference: jracepreference): void;
|
|
41
54
|
forceUIKey(key: string): void;
|
|
42
55
|
forceUICancel(): void;
|
|
43
56
|
isAllyOf(other: Player): boolean;
|
|
44
57
|
isEnemyOf(other: Player): boolean;
|
|
58
|
+
setAlliance(other: Player, type: PlayerAllianceType, value: boolean): void;
|
|
59
|
+
getAlliance(other: Player, type: PlayerAllianceType): boolean;
|
|
45
60
|
setAbilityAvailable(abilityId: number, available: boolean): void;
|
|
46
61
|
getMaximumUpgradeLevel(upgradeId: UpgradeId): number;
|
|
47
62
|
setMaximumUpgradeLevel(upgradeId: UpgradeId, maximumLevel: number): void;
|
|
@@ -50,6 +65,7 @@ export declare class Player extends Handle<jplayer> {
|
|
|
50
65
|
setUpgradeLevel(upgradeId: UpgradeId, level: number): void;
|
|
51
66
|
private static getEvent;
|
|
52
67
|
private static getMouseEvent;
|
|
68
|
+
static get allianceChangedEvent(): Readonly<Record<PlayerAllianceType, Event<[Player]>>>;
|
|
53
69
|
static get onLeave(): Event<[Player]>;
|
|
54
70
|
static get onMouseDown(): Event<[Player, jmousebuttontype]>;
|
|
55
71
|
static get onMouseUp(): Event<[Player, jmousebuttontype]>;
|
|
@@ -66,6 +82,7 @@ export declare class Player extends Handle<jplayer> {
|
|
|
66
82
|
};
|
|
67
83
|
};
|
|
68
84
|
static get onChat(): Event<[player: Player, message: string]>;
|
|
85
|
+
static readonly colorChangedEvent: Event<[Player]>;
|
|
69
86
|
static byId(id: number): Player | undefined;
|
|
70
87
|
}
|
|
71
88
|
export {};
|