warscript 0.0.1-dev.9b0216a → 0.0.1-dev.9bcb501
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.d.ts +6 -0
- package/attributes.lua +17 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/dummy.lua +4 -2
- package/core/types/effect.d.ts +12 -4
- package/core/types/effect.lua +67 -104
- package/core/types/frame.d.ts +16 -2
- package/core/types/frame.lua +141 -77
- 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 -25
- package/core/types/sound.lua +113 -33
- package/core/types/tileCell.d.ts +18 -3
- package/core/types/tileCell.lua +108 -0
- package/core/types/timer.d.ts +9 -8
- package/core/types/timer.lua +45 -23
- package/core/types/unit.d.ts +5 -0
- package/core/types/unit.lua +5 -0
- package/core/util.d.ts +3 -1
- package/core/util.lua +115 -4
- package/decl/native.d.ts +1719 -964
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/ability-type-extended-tooltip.d.ts +8 -0
- package/engine/ability-type-extended-tooltip.lua +44 -0
- package/engine/behavior.d.ts +14 -1
- package/engine/behavior.lua +230 -70
- package/engine/behaviour/ability/apply-buff.d.ts +5 -0
- package/engine/behaviour/ability/apply-buff.lua +36 -4
- 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 +92 -4
- 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 +28 -6
- package/engine/behaviour/ability.lua +188 -27
- 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 -59
- package/engine/buff.lua +638 -307
- package/engine/index.d.ts +2 -1
- package/engine/internal/ability.d.ts +14 -1
- package/engine/internal/ability.lua +112 -42
- package/engine/internal/item/ability.lua +92 -15
- 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/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 +35 -0
- package/engine/internal/unit/ability.lua +114 -9
- 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 +19 -0
- package/engine/internal/unit/bonus.lua +130 -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.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/{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+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 +45 -34
- package/engine/internal/unit.lua +433 -327
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +52 -18
- package/engine/local-client.d.ts +28 -0
- package/engine/local-client.lua +324 -54
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +14 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +11 -3
- package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/equipment-slot.d.ts +12 -0
- package/engine/object-data/auxiliary/equipment-slot.lua +2 -0
- package/engine/object-data/auxiliary/equipment-type.d.ts +12 -0
- package/engine/object-data/auxiliary/equipment-type.lua +26 -0
- package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
- package/engine/object-data/auxiliary/item-class.d.ts +11 -0
- package/engine/object-data/auxiliary/item-class.lua +2 -0
- package/engine/object-data/auxiliary/item-tag.d.ts +12 -0
- package/engine/object-data/auxiliary/item-tag.lua +2 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -0
- package/engine/object-data/auxiliary/order-type.d.ts +939 -0
- package/engine/object-data/auxiliary/order-type.lua +2 -0
- package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/sound-set-name.d.ts +14 -3
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/entry/ability-type/apprehend.d.ts +22 -0
- package/engine/object-data/entry/ability-type/apprehend.lua +66 -0
- package/engine/object-data/entry/ability-type/armor-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
- package/engine/object-data/entry/ability-type/aura-of-blight.d.ts +13 -0
- package/engine/object-data/entry/ability-type/aura-of-blight.lua +39 -0
- package/engine/object-data/entry/ability-type/banshee.d.ts +8 -0
- package/engine/object-data/entry/ability-type/banshee.lua +13 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.lua +27 -0
- package/engine/object-data/entry/ability-type/banshees-wail.d.ts +31 -0
- package/engine/object-data/entry/ability-type/banshees-wail.lua +117 -0
- package/engine/object-data/entry/ability-type/barrage.d.ts +12 -0
- package/engine/object-data/entry/ability-type/barrage.lua +52 -0
- package/engine/object-data/entry/ability-type/battering-ram.d.ts +33 -0
- package/engine/object-data/entry/ability-type/battering-ram.lua +130 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +14 -3
- package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.d.ts +23 -0
- package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.lua +112 -0
- package/engine/object-data/entry/ability-type/blank-passive.d.ts +4 -0
- package/engine/object-data/entry/ability-type/blank-passive.lua +27 -7
- package/engine/object-data/entry/ability-type/breath-of-fire.d.ts +11 -0
- package/engine/object-data/entry/ability-type/breath-of-fire.lua +27 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- package/engine/object-data/entry/ability-type/channel.d.ts +2 -2
- package/engine/object-data/entry/ability-type/channel.lua +3 -3
- package/engine/object-data/entry/ability-type/cleansing-fire.d.ts +27 -0
- package/engine/object-data/entry/ability-type/cleansing-fire.lua +104 -0
- package/engine/object-data/entry/ability-type/consecration.d.ts +15 -0
- package/engine/object-data/entry/ability-type/consecration.lua +52 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.d.ts +12 -0
- package/engine/object-data/entry/ability-type/cooldown-reduction.lua +39 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.d.ts +18 -0
- package/engine/object-data/entry/ability-type/critical-strike-system.lua +65 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.d.ts +21 -0
- package/engine/object-data/entry/ability-type/deathseeker-arrows.lua +78 -0
- package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.d.ts +8 -0
- package/engine/object-data/entry/ability-type/equipment-inventory-interface.lua +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment-inventory.lua +27 -0
- package/engine/object-data/entry/ability-type/equipment.d.ts +13 -0
- package/engine/object-data/entry/ability-type/equipment.lua +27 -0
- package/engine/object-data/entry/ability-type/exhume-corpses.d.ts +14 -0
- package/engine/object-data/entry/ability-type/exhume-corpses.lua +40 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/firebolt.d.ts +7 -0
- package/engine/object-data/entry/ability-type/firebolt.lua +13 -0
- package/engine/object-data/entry/ability-type/flame-strike.d.ts +25 -0
- package/engine/object-data/entry/ability-type/flame-strike.lua +92 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.d.ts +8 -0
- package/engine/object-data/entry/ability-type/grant-talent-point.lua +13 -0
- package/engine/object-data/entry/ability-type/grim-conviction.d.ts +36 -0
- package/engine/object-data/entry/ability-type/grim-conviction.lua +131 -0
- package/engine/object-data/entry/ability-type/grit.d.ts +18 -0
- package/engine/object-data/entry/ability-type/grit.lua +65 -0
- package/engine/object-data/entry/ability-type/guiding-hand.d.ts +27 -0
- package/engine/object-data/entry/ability-type/guiding-hand.lua +104 -0
- package/engine/object-data/entry/ability-type/headsplitter.d.ts +27 -0
- package/engine/object-data/entry/ability-type/headsplitter.lua +104 -0
- package/engine/object-data/entry/ability-type/{armor-increase.d.ts → healing-modifier.d.ts} +4 -3
- package/engine/object-data/entry/ability-type/healing-modifier.lua +26 -0
- package/engine/object-data/entry/ability-type/healing-ward-aura.d.ts +13 -0
- package/engine/object-data/entry/ability-type/healing-ward-aura.lua +39 -0
- package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/heroic-slash.d.ts +18 -0
- package/engine/object-data/entry/ability-type/heroic-slash.lua +65 -0
- package/engine/object-data/entry/ability-type/holy-wrath.d.ts +30 -0
- package/engine/object-data/entry/ability-type/holy-wrath.lua +117 -0
- package/engine/object-data/entry/ability-type/inspire-courage.d.ts +18 -0
- package/engine/object-data/entry/ability-type/inspire-courage.lua +65 -0
- package/engine/object-data/entry/ability-type/item-life-regeneration.d.ts +10 -0
- package/engine/object-data/entry/ability-type/item-life-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/life-drain.d.ts +37 -0
- package/engine/object-data/entry/ability-type/life-drain.lua +144 -0
- package/engine/object-data/entry/ability-type/lights-mercy.d.ts +27 -0
- package/engine/object-data/entry/ability-type/lights-mercy.lua +104 -0
- package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.d.ts +12 -0
- package/engine/object-data/entry/ability-type/mana-efficiency.lua +39 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/mind-control.d.ts +21 -0
- package/engine/object-data/entry/ability-type/mind-control.lua +78 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.d.ts +21 -0
- package/engine/object-data/entry/ability-type/on-attack-cast-spell.lua +52 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.d.ts +19 -0
- package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.lua +65 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.d.ts +15 -0
- package/engine/object-data/entry/ability-type/on-hit-cast-spell.lua +26 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.d.ts +6 -0
- package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.lua +12 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/provoke.d.ts +21 -0
- package/engine/object-data/entry/ability-type/provoke.lua +66 -0
- package/engine/object-data/entry/ability-type/rain-of-fire.d.ts +7 -0
- package/engine/object-data/entry/ability-type/rain-of-fire.lua +13 -0
- package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.d.ts +9 -0
- package/engine/object-data/entry/ability-type/raise-the-banner.lua +26 -0
- package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
- package/engine/object-data/entry/ability-type/resolve.d.ts +12 -0
- package/engine/object-data/entry/ability-type/resolve.lua +39 -0
- package/engine/object-data/entry/ability-type/righteous-fury.d.ts +33 -0
- package/engine/object-data/entry/ability-type/righteous-fury.lua +130 -0
- package/engine/object-data/entry/ability-type/sacred-aura.d.ts +27 -0
- package/engine/object-data/entry/ability-type/sacred-aura.lua +104 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
- package/engine/object-data/entry/ability-type/soul-burn.d.ts +22 -0
- package/engine/object-data/entry/ability-type/soul-burn.lua +79 -0
- package/engine/object-data/entry/ability-type/soul-lantern.d.ts +30 -0
- package/engine/object-data/entry/ability-type/soul-lantern.lua +117 -0
- package/engine/object-data/entry/ability-type/spell-amp.d.ts +15 -0
- package/engine/object-data/entry/ability-type/spell-amp.lua +52 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-critical-strike.lua +39 -0
- package/engine/object-data/entry/ability-type/spell-vamp.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spell-vamp.lua +39 -0
- package/engine/object-data/entry/ability-type/stackable-evasion.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-evasion.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.d.ts +21 -0
- package/engine/object-data/entry/ability-type/stackable-hardened-skin.lua +78 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-life-steal.lua +26 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.lua +13 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.d.ts +9 -0
- package/engine/object-data/entry/ability-type/stackable-thorn-shield.lua +13 -0
- package/engine/object-data/entry/ability-type/stat-details.d.ts +12 -0
- package/engine/object-data/entry/ability-type/stat-details.lua +27 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type/surge-of-light.d.ts +33 -0
- package/engine/object-data/entry/ability-type/surge-of-light.lua +130 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.d.ts +57 -0
- package/engine/object-data/entry/ability-type/sweeping-strike.lua +234 -0
- package/engine/object-data/entry/ability-type/talents.d.ts +12 -0
- package/engine/object-data/entry/ability-type/talents.lua +27 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.d.ts +30 -0
- package/engine/object-data/entry/ability-type/unyielding-guard.lua +117 -0
- package/engine/object-data/entry/ability-type/valiant-charge.d.ts +27 -0
- package/engine/object-data/entry/ability-type/valiant-charge.lua +104 -0
- package/engine/object-data/entry/ability-type/warcry.d.ts +9 -0
- package/engine/object-data/entry/ability-type/warcry.lua +26 -0
- package/engine/object-data/entry/ability-type/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type/withering-fire.d.ts +21 -0
- package/engine/object-data/entry/ability-type/withering-fire.lua +78 -0
- package/engine/object-data/entry/ability-type.d.ts +50 -21
- package/engine/object-data/entry/ability-type.lua +384 -35
- package/engine/object-data/entry/buff-type/applicable.lua +131 -139
- package/engine/object-data/entry/buff-type.d.ts +10 -12
- package/engine/object-data/entry/buff-type.lua +39 -29
- package/engine/object-data/entry/destructible-type.d.ts +32 -2
- package/engine/object-data/entry/destructible-type.lua +181 -0
- package/engine/object-data/entry/item-type.d.ts +18 -3
- package/engine/object-data/entry/item-type.lua +88 -4
- package/engine/object-data/entry/lightning-type.d.ts +6 -8
- package/engine/object-data/entry/lightning-type.lua +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -0
- package/engine/object-data/entry/unit-type.d.ts +81 -6
- package/engine/object-data/entry/unit-type.lua +606 -93
- package/engine/object-data/entry/upgrade.d.ts +2 -2
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +21 -14
- package/engine/object-data/entry.lua +68 -32
- package/engine/object-field/ability.d.ts +8 -5
- package/engine/object-field/ability.lua +10 -6
- 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 +362 -117
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +21 -0
- package/engine/standard/entries/ability-type.d.ts +3102 -7
- package/engine/standard/entries/ability-type.lua +0 -6
- package/engine/standard/entries/buff-type.d.ts +48 -0
- package/engine/standard/entries/buff-type.lua +46 -0
- package/engine/standard/entries/item-type.d.ts +1299 -0
- package/engine/standard/entries/item-type.lua +2 -0
- package/engine/standard/entries/lightning-type.d.ts +42 -15
- package/engine/standard/entries/lightning-type.lua +0 -14
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/engine/standard/entries/unit-type.d.ts +5 -0
- package/engine/standard/entries/unit-type.lua +5 -0
- package/engine/standard/fields/ability.d.ts +4 -4
- package/engine/standard/fields/ability.lua +4 -4
- package/engine/standard/fields/item.d.ts +4 -0
- package/engine/standard/fields/item.lua +6 -0
- package/engine/standard/fields/unit.d.ts +12 -0
- package/engine/standard/fields/unit.lua +20 -0
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +250 -10
- package/engine/unit.d.ts +12 -1
- package/engine/unit.lua +12 -1
- package/event.d.ts +1 -1
- package/lualib_bundle.lua +1 -1
- package/math.d.ts +2 -0
- package/math.lua +14 -0
- package/net/socket.lua +1 -1
- package/network.lua +25 -1
- package/objutil/buff.lua +12 -11
- package/objutil/object.lua +1 -1
- package/objutil/unit.lua +8 -0
- package/operation.d.ts +8 -1
- package/operation.lua +38 -18
- package/package.json +3 -23
- package/patch-lua.lua +15 -0
- package/patch-lualib.lua +1 -1
- package/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 -79
- /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
package/core/types/frame.lua
CHANGED
|
@@ -15,13 +15,34 @@ local Event = ____event.Event
|
|
|
15
15
|
local TriggerEvent = ____event.TriggerEvent
|
|
16
16
|
local ____timer = require("core.types.timer")
|
|
17
17
|
local Timer = ____timer.Timer
|
|
18
|
+
local ____frame_2Dcoordinates = require("engine.internal.misc.frame-coordinates")
|
|
19
|
+
local FRAME_MAX_Y = ____frame_2Dcoordinates.FRAME_MAX_Y
|
|
20
|
+
local FRAME_MIN_Y = ____frame_2Dcoordinates.FRAME_MIN_Y
|
|
21
|
+
local getFrameMinXMaxX = ____frame_2Dcoordinates.getFrameMinXMaxX
|
|
22
|
+
local ____playerCamera = require("core.types.playerCamera")
|
|
23
|
+
local frameCoordinatesToWorld = ____playerCamera.frameCoordinatesToWorld
|
|
24
|
+
local ____lua_2Dsets = require("utility.lua-sets")
|
|
25
|
+
local mutableLuaSet = ____lua_2Dsets.mutableLuaSet
|
|
26
|
+
local ____socket = require("net.socket")
|
|
27
|
+
local Socket = ____socket.Socket
|
|
28
|
+
local ____lua_2Dmaps = require("utility.lua-maps")
|
|
29
|
+
local getOrPut = ____lua_2Dmaps.getOrPut
|
|
30
|
+
local luaMapInvert = ____lua_2Dmaps.luaMapInvert
|
|
31
|
+
local luaMapOf = ____lua_2Dmaps.luaMapOf
|
|
32
|
+
local mutableLuaMap = ____lua_2Dmaps.mutableLuaMap
|
|
18
33
|
local frameClick = BlzFrameClick
|
|
19
34
|
local frameGetEnable = BlzFrameGetEnable
|
|
20
35
|
local frameIsVisible = BlzFrameIsVisible
|
|
21
36
|
local frameSetEnable = BlzFrameSetEnable
|
|
22
37
|
local frameSetScale = BlzFrameSetScale
|
|
23
|
-
local
|
|
24
|
-
local
|
|
38
|
+
local getHandleId = GetHandleId
|
|
39
|
+
local getLocalClientHeight = BlzGetLocalClientHeight
|
|
40
|
+
local getMouseScreenPosX = BlzGetMouseScreenPosX
|
|
41
|
+
local getMouseScreenPosY = BlzGetMouseScreenPosY
|
|
42
|
+
local getOriginFrame = BlzGetOriginFrame
|
|
43
|
+
local location = Location
|
|
44
|
+
local pixelToFrameX = BlzPixelToFrameX
|
|
45
|
+
local pixelToFrameY = BlzPixelToFrameY
|
|
25
46
|
local ____rawget = _G.rawget
|
|
26
47
|
local rawset = _G.rawset
|
|
27
48
|
local invoke = Event.invoke
|
|
@@ -123,6 +144,79 @@ do
|
|
|
123
144
|
FramePoint.BOTTOM_RIGHT = FRAMEPOINT_BOTTOMRIGHT
|
|
124
145
|
end
|
|
125
146
|
local tooltipByFrame = setmetatable({}, {__mode = "k"})
|
|
147
|
+
local isMouseInsideLocallyByFrame = mutableLuaMap()
|
|
148
|
+
local mouseEnterLocalEventByFrame = mutableLuaMap()
|
|
149
|
+
local mouseLeaveLocalEventByFrame = mutableLuaMap()
|
|
150
|
+
local isLocalMouseTrackingStarted = false
|
|
151
|
+
--- Reused across ticks to avoid per-tick allocations: only the first `leftFrameCount` /
|
|
152
|
+
-- `enteredFrameCount` entries are meaningful, stale entries beyond them are never read and are
|
|
153
|
+
-- kept collectable by the weak values mode.
|
|
154
|
+
local leftFrames = setmetatable({}, {__mode = "v"})
|
|
155
|
+
local enteredFrames = setmetatable({}, {__mode = "v"})
|
|
156
|
+
--- All frames share a single poll which invokes every mouse leave event before any mouse enter
|
|
157
|
+
-- event within the same tick. With a poll per event, the invocation order would depend on the
|
|
158
|
+
-- event creation order instead, breaking listeners relying on the natural "leave the old frame,
|
|
159
|
+
-- then enter the new frame" order.
|
|
160
|
+
local function startLocalMouseTracking()
|
|
161
|
+
if isLocalMouseTrackingStarted then
|
|
162
|
+
return
|
|
163
|
+
end
|
|
164
|
+
isLocalMouseTrackingStarted = true
|
|
165
|
+
Timer.onPeriod[1 / 64]:addListener(function()
|
|
166
|
+
local leftFrameCount = 0
|
|
167
|
+
local enteredFrameCount = 0
|
|
168
|
+
for frame, wasMouseInside in pairs(isMouseInsideLocallyByFrame) do
|
|
169
|
+
local tooltip = tooltipByFrame[frame]
|
|
170
|
+
local isMouseInside = tooltip ~= nil and tooltip.visible
|
|
171
|
+
if isMouseInside ~= wasMouseInside then
|
|
172
|
+
isMouseInsideLocallyByFrame[frame] = isMouseInside
|
|
173
|
+
if isMouseInside then
|
|
174
|
+
enteredFrames[enteredFrameCount + 1] = frame
|
|
175
|
+
enteredFrameCount = enteredFrameCount + 1
|
|
176
|
+
else
|
|
177
|
+
leftFrames[leftFrameCount + 1] = frame
|
|
178
|
+
leftFrameCount = leftFrameCount + 1
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
for i = 1, leftFrameCount do
|
|
183
|
+
local event = mouseLeaveLocalEventByFrame[leftFrames[i]]
|
|
184
|
+
if event ~= nil then
|
|
185
|
+
Event.invoke(event)
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
for i = 1, enteredFrameCount do
|
|
189
|
+
local event = mouseEnterLocalEventByFrame[enteredFrames[i]]
|
|
190
|
+
if event ~= nil then
|
|
191
|
+
Event.invoke(event)
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
end)
|
|
195
|
+
end
|
|
196
|
+
local keyByAsyncInitOriginFrameType = luaMapOf(ORIGIN_FRAME_PORTRAIT_HP_TEXT, "hp", ORIGIN_FRAME_PORTRAIT_MANA_TEXT, "mana")
|
|
197
|
+
local asyncInitOriginFrameTypeByKey = luaMapInvert(keyByAsyncInitOriginFrameType)
|
|
198
|
+
local seenAsyncInitOriginFrameTypes = mutableLuaSet()
|
|
199
|
+
local seenAsyncInitOriginFrameTypesSocket = __TS__New(Socket)
|
|
200
|
+
local seenPlayersByAsyncInitOriginFrameType = mutableLuaMap()
|
|
201
|
+
seenAsyncInitOriginFrameTypesSocket.onMessage:addListener(function(player, key)
|
|
202
|
+
local asyncInitOriginFrameType = asyncInitOriginFrameTypeByKey[key]
|
|
203
|
+
if asyncInitOriginFrameType ~= nil then
|
|
204
|
+
getOrPut(seenPlayersByAsyncInitOriginFrameType, asyncInitOriginFrameType, mutableLuaSet)[player] = true
|
|
205
|
+
end
|
|
206
|
+
end)
|
|
207
|
+
local function haveAllPlayersSeenAsyncInitOriginFrameType(frame)
|
|
208
|
+
local players = seenPlayersByAsyncInitOriginFrameType[frame]
|
|
209
|
+
if players == nil then
|
|
210
|
+
return false
|
|
211
|
+
end
|
|
212
|
+
for ____, player in ipairs(Player.all) do
|
|
213
|
+
if player.isUser and player.isPlaying and not (players[player] ~= nil) then
|
|
214
|
+
return false
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
keyByAsyncInitOriginFrameType[frame] = nil
|
|
218
|
+
return true
|
|
219
|
+
end
|
|
126
220
|
____exports.Frame = __TS__Class()
|
|
127
221
|
local Frame = ____exports.Frame
|
|
128
222
|
Frame.name = "Frame"
|
|
@@ -155,6 +249,18 @@ function Frame.prototype.getEvent(self, eventType, c)
|
|
|
155
249
|
end
|
|
156
250
|
return self.events[eventId]
|
|
157
251
|
end
|
|
252
|
+
function Frame.prototype.trackMouseLocally(self)
|
|
253
|
+
if not (tooltipByFrame[self] ~= nil) then
|
|
254
|
+
____exports.Frame.SIMPLE_FRAME_TEST_CHILD.parent = self
|
|
255
|
+
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)
|
|
256
|
+
____exports.Frame.SIMPLE_FRAME_TEST_CHILD.parent = ____exports.Frame.CONSOLE_UI
|
|
257
|
+
self:setTooltip(tooltip)
|
|
258
|
+
end
|
|
259
|
+
if not (isMouseInsideLocallyByFrame[self] ~= nil) then
|
|
260
|
+
isMouseInsideLocallyByFrame[self] = false
|
|
261
|
+
startLocalMouseTracking()
|
|
262
|
+
end
|
|
263
|
+
end
|
|
158
264
|
function Frame.prototype.hide(self)
|
|
159
265
|
self.hideCounter = self.hideCounter + 1
|
|
160
266
|
if self.hideCounter > 0 then
|
|
@@ -301,7 +407,17 @@ function Frame.byOrigin(self, frameType, index)
|
|
|
301
407
|
if index == nil then
|
|
302
408
|
index = 0
|
|
303
409
|
end
|
|
304
|
-
|
|
410
|
+
local frame = getOriginFrame(frameType, index)
|
|
411
|
+
local asyncInitOriginFrameTypeKey = keyByAsyncInitOriginFrameType[frameType]
|
|
412
|
+
if index == 0 and asyncInitOriginFrameTypeKey ~= nil and not haveAllPlayersSeenAsyncInitOriginFrameType(frameType) then
|
|
413
|
+
if getHandleId(frame) == 0 or seenAsyncInitOriginFrameTypes[frameType] ~= nil then
|
|
414
|
+
location(0, 0)
|
|
415
|
+
else
|
|
416
|
+
seenAsyncInitOriginFrameTypes[frameType] = true
|
|
417
|
+
seenAsyncInitOriginFrameTypesSocket:send(asyncInitOriginFrameTypeKey)
|
|
418
|
+
end
|
|
419
|
+
end
|
|
420
|
+
return self:of(frame)
|
|
305
421
|
end
|
|
306
422
|
Frame.GAME_UI = ____exports.Frame:byOrigin(ORIGIN_FRAME_GAME_UI)
|
|
307
423
|
Frame.CONSOLE_UI = ____exports.Frame:byOrigin(ORIGIN_FRAME_SIMPLE_UI_PARENT)
|
|
@@ -344,27 +460,21 @@ __TS__ObjectDefineProperty(
|
|
|
344
460
|
Frame,
|
|
345
461
|
"minX",
|
|
346
462
|
{get = function(self)
|
|
347
|
-
local
|
|
348
|
-
|
|
349
|
-
local width4by3 = (w - h / 600 * 800) / 2
|
|
350
|
-
local pxtodpi = 0.6 / h
|
|
351
|
-
return -width4by3 * pxtodpi
|
|
463
|
+
local minX = getFrameMinXMaxX()
|
|
464
|
+
return minX
|
|
352
465
|
end}
|
|
353
466
|
)
|
|
354
467
|
__TS__ObjectDefineProperty(
|
|
355
468
|
Frame,
|
|
356
469
|
"maxX",
|
|
357
470
|
{get = function(self)
|
|
358
|
-
local
|
|
359
|
-
|
|
360
|
-
local width4by3 = (w - h / 600 * 800) / 2
|
|
361
|
-
local pxtodpi = 0.6 / h
|
|
362
|
-
return (-width4by3 + w) * pxtodpi
|
|
471
|
+
local ____, maxX = getFrameMinXMaxX()
|
|
472
|
+
return maxX
|
|
363
473
|
end}
|
|
364
474
|
)
|
|
365
475
|
Frame.centerX = 0.4
|
|
366
|
-
Frame.minY =
|
|
367
|
-
Frame.maxY =
|
|
476
|
+
Frame.minY = FRAME_MIN_Y
|
|
477
|
+
Frame.maxY = FRAME_MAX_Y
|
|
368
478
|
Frame.centerY = 0.3
|
|
369
479
|
__TS__SetDescriptor(
|
|
370
480
|
Frame.prototype,
|
|
@@ -626,24 +736,8 @@ __TS__SetDescriptor(
|
|
|
626
736
|
"mouseEnterLocalEvent",
|
|
627
737
|
{get = function(self)
|
|
628
738
|
local event = __TS__New(Event)
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
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)
|
|
632
|
-
____exports.Frame.SIMPLE_FRAME_TEST_CHILD.parent = ____exports.Frame.CONSOLE_UI
|
|
633
|
-
self:setTooltip(tooltip)
|
|
634
|
-
end
|
|
635
|
-
local isMouseInside = false
|
|
636
|
-
Timer.onPeriod[1 / 64]:addListener(function()
|
|
637
|
-
local tooltip = tooltipByFrame[self]
|
|
638
|
-
if tooltip and tooltip.visible then
|
|
639
|
-
if not isMouseInside then
|
|
640
|
-
isMouseInside = true
|
|
641
|
-
Event.invoke(event)
|
|
642
|
-
end
|
|
643
|
-
else
|
|
644
|
-
isMouseInside = false
|
|
645
|
-
end
|
|
646
|
-
end)
|
|
739
|
+
self:trackMouseLocally()
|
|
740
|
+
mouseEnterLocalEventByFrame[self] = event
|
|
647
741
|
rawset(self, "mouseEnterLocalEvent", event)
|
|
648
742
|
return event
|
|
649
743
|
end},
|
|
@@ -654,24 +748,8 @@ __TS__SetDescriptor(
|
|
|
654
748
|
"mouseLeaveLocalEvent",
|
|
655
749
|
{get = function(self)
|
|
656
750
|
local event = __TS__New(Event)
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
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)
|
|
660
|
-
____exports.Frame.SIMPLE_FRAME_TEST_CHILD.parent = ____exports.Frame.CONSOLE_UI
|
|
661
|
-
self:setTooltip(tooltip)
|
|
662
|
-
end
|
|
663
|
-
local isMouseInside = false
|
|
664
|
-
Timer.onPeriod[1 / 64]:addListener(function()
|
|
665
|
-
local tooltip = tooltipByFrame[self]
|
|
666
|
-
if tooltip and tooltip.visible then
|
|
667
|
-
isMouseInside = true
|
|
668
|
-
else
|
|
669
|
-
if isMouseInside then
|
|
670
|
-
isMouseInside = false
|
|
671
|
-
Event.invoke(event)
|
|
672
|
-
end
|
|
673
|
-
end
|
|
674
|
-
end)
|
|
751
|
+
self:trackMouseLocally()
|
|
752
|
+
mouseLeaveLocalEventByFrame[self] = event
|
|
675
753
|
rawset(self, "mouseLeaveLocalEvent", event)
|
|
676
754
|
return event
|
|
677
755
|
end},
|
|
@@ -912,7 +990,7 @@ __TS__ObjectDefineProperty(
|
|
|
912
990
|
)
|
|
913
991
|
__TS__ObjectDefineProperty(
|
|
914
992
|
Frame,
|
|
915
|
-
"
|
|
993
|
+
"mouseMoveEvent",
|
|
916
994
|
{get = function(self)
|
|
917
995
|
local event = __TS__New(
|
|
918
996
|
TriggerEvent,
|
|
@@ -926,46 +1004,32 @@ __TS__ObjectDefineProperty(
|
|
|
926
1004
|
) end,
|
|
927
1005
|
function() return Player:of(GetTriggerPlayer()), BlzGetTriggerPlayerMouseX(), BlzGetTriggerPlayerMouseY() end
|
|
928
1006
|
)
|
|
929
|
-
rawset(____exports.Frame, "
|
|
1007
|
+
rawset(____exports.Frame, "mouseMoveEvent", event)
|
|
930
1008
|
return event
|
|
931
1009
|
end}
|
|
932
1010
|
)
|
|
933
1011
|
__TS__ObjectDefineProperty(
|
|
934
1012
|
Frame,
|
|
935
|
-
"
|
|
1013
|
+
"mouseMoveLocalEvent",
|
|
936
1014
|
{get = function(self)
|
|
937
|
-
local invoke = Event.invoke
|
|
938
1015
|
local event = __TS__New(Event)
|
|
939
|
-
local
|
|
940
|
-
local
|
|
941
|
-
local syncCamX = getCameraTargetPositionX()
|
|
942
|
-
local syncCamY = getCameraTargetPositionY()
|
|
943
|
-
local lastX = syncX
|
|
944
|
-
local lastY = syncY
|
|
945
|
-
self.onMouseMove:addListener(function(player, x, y)
|
|
946
|
-
if player.isLocal then
|
|
947
|
-
syncX = x
|
|
948
|
-
syncY = y
|
|
949
|
-
syncCamX = getCameraTargetPositionX()
|
|
950
|
-
syncCamY = getCameraTargetPositionY()
|
|
951
|
-
lastX = x
|
|
952
|
-
lastY = y
|
|
953
|
-
invoke(event, x, y)
|
|
954
|
-
end
|
|
955
|
-
end)
|
|
1016
|
+
local lastX = 0
|
|
1017
|
+
local lastY = 0
|
|
956
1018
|
Timer.onPeriod[1 / 64]:addListener(function()
|
|
957
|
-
if
|
|
1019
|
+
if getLocalClientHeight() == 0 then
|
|
958
1020
|
return
|
|
959
1021
|
end
|
|
960
|
-
local x
|
|
961
|
-
|
|
962
|
-
|
|
1022
|
+
local x, y, ____, isDefinite = frameCoordinatesToWorld(
|
|
1023
|
+
pixelToFrameX(getMouseScreenPosX()),
|
|
1024
|
+
pixelToFrameY(getMouseScreenPosY())
|
|
1025
|
+
)
|
|
1026
|
+
if isDefinite and (x ~= lastX or y ~= lastY) then
|
|
963
1027
|
lastX = x
|
|
964
1028
|
lastY = y
|
|
965
1029
|
invoke(event, x, y)
|
|
966
1030
|
end
|
|
967
1031
|
end)
|
|
968
|
-
rawset(____exports.Frame, "
|
|
1032
|
+
rawset(____exports.Frame, "mouseMoveLocalEvent", event)
|
|
969
1033
|
return event
|
|
970
1034
|
end}
|
|
971
1035
|
)
|
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/item.d.ts
CHANGED
package/core/types/item.lua
CHANGED
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 = {}
|
|
@@ -56,15 +57,15 @@ function Missile.launch(self, config, source, target, onArrival, ...)
|
|
|
56
57
|
local data = MISSILE_DATA_BY_UNIT_TYPE_ID[source.typeId]
|
|
57
58
|
local launchX = data.launchOffsetX
|
|
58
59
|
local launchY = data.launchOffsetY
|
|
59
|
-
local projectileVisOffsetX = data.launchVisualOffsetX
|
|
60
|
-
local projectileVisOffsetY = data.launchVisualOffsetY
|
|
61
60
|
local angle = rad(source.facing - 90)
|
|
62
61
|
local s = sin(angle)
|
|
63
62
|
local c = cos(angle)
|
|
64
63
|
offsetX = offsetX + (c * launchX - s * launchY)
|
|
65
64
|
offsetY = offsetY + (s * launchX + c * launchY)
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
local projectileVisOffsetX = data.launchVisualOffsetX
|
|
66
|
+
local projectileVisOffsetY = data.launchVisualOffsetY
|
|
67
|
+
visualOffsetX = visualOffsetX + (c * projectileVisOffsetY - s * projectileVisOffsetX)
|
|
68
|
+
visualOffsetY = visualOffsetY + (s * projectileVisOffsetY + c * projectileVisOffsetX)
|
|
68
69
|
visualOffsetZ = visualOffsetZ + data.launchOffsetZ
|
|
69
70
|
end
|
|
70
71
|
local ____opt_7 = config.targetOffset
|
|
@@ -101,8 +102,8 @@ function Missile.launch(self, config, source, target, onArrival, ...)
|
|
|
101
102
|
if config.scale then
|
|
102
103
|
setSpecialEffectScale(effect, config.scale)
|
|
103
104
|
end
|
|
104
|
-
local acceleration = (config.acceleration or 0)
|
|
105
|
-
local speed = config.speed
|
|
105
|
+
local acceleration = (config.acceleration or 0) * UPDATE_PERIOD * UPDATE_PERIOD
|
|
106
|
+
local speed = config.speed * UPDATE_PERIOD + acceleration / 2
|
|
106
107
|
local arcVAcceleration = 0
|
|
107
108
|
local arcVSpeed = 0
|
|
108
109
|
if config.arc then
|
|
@@ -226,7 +227,7 @@ function Missile.prototype.destroy(self)
|
|
|
226
227
|
previous[self] = nil
|
|
227
228
|
next[self] = nil
|
|
228
229
|
end
|
|
229
|
-
Timer.onPeriod[
|
|
230
|
+
Timer.onPeriod[UPDATE_PERIOD]:addListener(function()
|
|
230
231
|
local missile = head
|
|
231
232
|
while missile do
|
|
232
233
|
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 {};
|