warscript 0.0.1-dev.8c7ee30 → 0.0.1-dev.8d8d605
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/binaryreader.d.ts +1 -0
- package/binaryreader.lua +3 -0
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/types/effect.d.ts +14 -6
- package/core/types/effect.lua +131 -35
- package/core/types/frame.d.ts +9 -0
- package/core/types/frame.lua +193 -23
- package/core/types/handle.lua +11 -9
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- 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 +11 -1
- package/core/types/tileCell.lua +97 -0
- package/core/types/timer.d.ts +9 -8
- package/core/types/timer.lua +45 -23
- package/core/types/unit.d.ts +4 -0
- package/core/types/unit.lua +4 -0
- package/core/util.d.ts +1 -1
- package/core/util.lua +18 -1
- package/decl/native.d.ts +1718 -964
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/behavior.d.ts +16 -3
- 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.lua +1 -0
- package/engine/behaviour/ability/damage.d.ts +42 -11
- package/engine/behaviour/ability/damage.lua +88 -39
- package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
- package/engine/behaviour/ability/emulate-impact.lua +44 -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 +2 -2
- package/engine/behaviour/ability/instant-impact.lua +4 -19
- package/engine/behaviour/ability/on-command-impact.d.ts +8 -0
- package/engine/behaviour/ability/on-command-impact.lua +25 -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 +29 -7
- package/engine/behaviour/ability.lua +148 -43
- 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 +46 -2
- package/engine/behaviour/unit.lua +290 -6
- package/engine/buff.d.ts +166 -57
- package/engine/buff.lua +766 -274
- 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 +27 -14
- package/engine/internal/ability.lua +164 -101
- 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.d.ts +1 -0
- package/engine/internal/item+owner.lua +19 -6
- package/engine/internal/item.d.ts +30 -18
- package/engine/internal/item.lua +292 -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/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/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/unit/ability.d.ts +45 -1
- package/engine/internal/unit/ability.lua +142 -19
- package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
- package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot.lua +52 -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/bag.d.ts +18 -0
- package/engine/internal/unit/bag.lua +63 -0
- package/engine/internal/unit/bonus.d.ts +12 -2
- package/engine/internal/unit/bonus.lua +56 -4
- package/engine/internal/unit/buff.d.ts +2 -2
- package/engine/internal/unit/buff.lua +34 -19
- package/engine/internal/unit/equipment.d.ts +36 -0
- package/engine/internal/unit/equipment.lua +169 -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 +5 -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 +24 -0
- package/engine/internal/unit/inventory.lua +77 -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/pseudo-passive-abilities.d.ts +2 -0
- package/engine/internal/unit/pseudo-passive-abilities.lua +11 -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.lua +12 -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+spellSteal.lua +1 -2
- package/engine/internal/unit+transport.lua +4 -10
- package/engine/internal/unit-missile-data.lua +58 -32
- package/engine/internal/unit-missile-launch.lua +70 -13
- package/engine/internal/unit.d.ts +63 -30
- package/engine/internal/unit.lua +509 -291
- package/engine/internal/utility.lua +12 -0
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +48 -14
- package/engine/local-client.d.ts +34 -2
- package/engine/local-client.lua +386 -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 +7 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +4 -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 +13 -0
- package/engine/object-data/auxiliary/equipment-type.lua +2 -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-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/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/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/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/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 +3 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +42 -1
- 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/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/feral-spirit.lua +2 -2
- 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/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/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/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-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 +30 -19
- package/engine/object-data/entry/ability-type.lua +230 -40
- package/engine/object-data/entry/buff-type/applicable.lua +122 -137
- 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 +26 -3
- package/engine/object-data/entry/item-type.lua +145 -2
- package/engine/object-data/entry/lightning-type.d.ts +2 -2
- 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 +71 -6
- package/engine/object-data/entry/unit-type.lua +592 -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 +19 -14
- package/engine/object-data/entry.lua +60 -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 -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 +3 -0
- package/engine/standard/entries/buff-type.lua +3 -0
- package/engine/standard/entries/item-type.d.ts +1299 -0
- package/engine/standard/entries/item-type.lua +2 -0
- 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 -2
- package/engine/standard/fields/ability.lua +4 -2
- 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 -0
- package/engine/unit.lua +12 -0
- package/event.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.lua +1 -0
- package/lualib_bundle.lua +8 -3
- package/math.d.ts +2 -0
- 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/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.d.ts +0 -0
- package/patch-lua.lua +25 -0
- package/patch-lualib.lua +1 -1
- package/property.d.ts +55 -0
- package/property.lua +374 -0
- package/utility/arrays.d.ts +10 -1
- package/utility/arrays.lua +45 -3
- 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 -3
- package/utility/linked-set.lua +54 -3
- 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 +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/engine/local-client.lua
CHANGED
|
@@ -1,31 +1,242 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__New = ____lualib.__TS__New
|
|
2
3
|
local __TS__Class = ____lualib.__TS__Class
|
|
4
|
+
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
3
5
|
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
4
|
-
local __TS__New = ____lualib.__TS__New
|
|
5
6
|
local ____exports = {}
|
|
7
|
+
local actualizeTargetingModeState
|
|
6
8
|
local ____unit = require("core.types.unit")
|
|
7
9
|
local Unit = ____unit.Unit
|
|
8
10
|
local ____event = require("event")
|
|
11
|
+
local Event = ____event.Event
|
|
9
12
|
local TriggerEvent = ____event.TriggerEvent
|
|
10
|
-
local
|
|
11
|
-
local
|
|
13
|
+
local ____frame = require("core.types.frame")
|
|
14
|
+
local Frame = ____frame.Frame
|
|
15
|
+
local ____player = require("core.types.player")
|
|
16
|
+
local Player = ____player.Player
|
|
17
|
+
local ____timer = require("core.types.timer")
|
|
18
|
+
local Timer = ____timer.Timer
|
|
19
|
+
local ____color = require("core.types.color")
|
|
20
|
+
local Color = ____color.Color
|
|
21
|
+
local ____arrays = require("utility.arrays")
|
|
22
|
+
local array = ____arrays.array
|
|
23
|
+
local ____socket = require("net.socket")
|
|
24
|
+
local Socket = ____socket.Socket
|
|
25
|
+
local frameGetChild = BlzFrameGetChild
|
|
26
|
+
local frameGetChildrenCount = BlzFrameGetChildrenCount
|
|
27
|
+
local frameGetParent = BlzFrameGetParent
|
|
28
|
+
local frameToPixelX = BlzFrameToPixelX
|
|
29
|
+
local frameToPixelY = BlzFrameToPixelY
|
|
30
|
+
local getFrameByName = BlzGetFrameByName
|
|
31
|
+
local getHandleId = GetHandleId
|
|
12
32
|
local getLocalClientHeight = BlzGetLocalClientHeight
|
|
13
|
-
local
|
|
14
|
-
local getMouseFocusUnit = BlzGetMouseFocusUnit
|
|
33
|
+
local getLocalClientWidth = BlzGetLocalClientWidth
|
|
15
34
|
local getLocale = BlzGetLocale
|
|
16
|
-
local
|
|
35
|
+
local getMouseFocusUnit = BlzGetMouseFocusUnit
|
|
36
|
+
local getMouseScreenPosX = BlzGetMouseScreenPosX
|
|
37
|
+
local getMouseScreenPosY = BlzGetMouseScreenPosY
|
|
38
|
+
local getUnitRealField = BlzGetUnitRealField
|
|
39
|
+
local getUnitTypeId = GetUnitTypeId
|
|
40
|
+
local isHeroUnitId = IsHeroUnitId
|
|
41
|
+
local isKeyPressed = BlzIsKeyPressed
|
|
42
|
+
local isLocalClientActive = BlzIsLocalClientActive
|
|
43
|
+
local isMetaKeyPressed = BlzIsMetaKeyPressed
|
|
44
|
+
local isMouseButtonPressed = BlzIsMouseButtonPressed
|
|
45
|
+
local loadTOCFile = BlzLoadTOCFile
|
|
46
|
+
local location = Location
|
|
47
|
+
local pingMinimap = PingMinimap
|
|
48
|
+
local pingMinimapEx = PingMinimapEx
|
|
49
|
+
local pixelToFrameX = BlzPixelToFrameX
|
|
50
|
+
local pixelToFrameY = BlzPixelToFrameY
|
|
51
|
+
local tableSort = table.sort
|
|
52
|
+
local hdTocPath = "_warscript\\IsHD.toc"
|
|
53
|
+
local deTocPath = "_warscript\\IsDE.toc"
|
|
17
54
|
compiletime(function()
|
|
18
55
|
if currentMap then
|
|
19
|
-
local
|
|
20
|
-
currentMap:addFileString("_HD.w3mod\\" ..
|
|
21
|
-
currentMap:addFileString("_HD.w3mod\\" ..
|
|
56
|
+
local hdFdfPath = "_warscript\\IsHD.fdf"
|
|
57
|
+
currentMap:addFileString("_HD.w3mod\\" .. hdFdfPath, "\r\n")
|
|
58
|
+
currentMap:addFileString("_HD.w3mod\\" .. hdTocPath, hdFdfPath .. "\r\n")
|
|
59
|
+
local deFdfPath = "_warscript\\IsDE.fdf"
|
|
60
|
+
currentMap:addFileString("_DE.w3mod\\" .. deFdfPath, "\r\n")
|
|
61
|
+
currentMap:addFileString("_DE.w3mod\\" .. deTocPath, deFdfPath .. "\r\n")
|
|
22
62
|
end
|
|
23
63
|
end)
|
|
64
|
+
local SELECTION_DETAIL_FRAME_NAME = "SimpleInfoPanelUnitDetail"
|
|
65
|
+
local SELECTION_GROUP_PANEL_INDEX = 5
|
|
66
|
+
local SELECTION_BUTTON_ICON_INDEX = 1
|
|
67
|
+
--- The detail panel, its parent, the group panel and the button grid.
|
|
68
|
+
local SELECTION_LAYOUT_ROOT_HANDLE_COUNT = 4
|
|
69
|
+
local SELECTION_LAYOUT_MAX_BUTTON_COUNT = 24
|
|
70
|
+
--- The root frames plus a button and its icon per slot of the largest layout.
|
|
71
|
+
local SELECTION_LAYOUT_MAX_HANDLE_COUNT = SELECTION_LAYOUT_ROOT_HANDLE_COUNT + 2 * SELECTION_LAYOUT_MAX_BUTTON_COUNT
|
|
72
|
+
--- Registration attempts for one local selection before giving up on its layout.
|
|
73
|
+
local SELECTION_LAYOUT_MAX_REQUEST_COUNT = 4
|
|
74
|
+
local function getSelectionButtons()
|
|
75
|
+
return Frame:byName(SELECTION_DETAIL_FRAME_NAME).parent:getChild(SELECTION_GROUP_PANEL_INDEX):getChild(0)
|
|
76
|
+
end
|
|
77
|
+
local function getMainSelectedUnitIndex(selectionButtons, buttonCount)
|
|
78
|
+
local mainSelectedUnitIndex
|
|
79
|
+
local maxButtonWidth = 0
|
|
80
|
+
for i = 0, buttonCount - 1 do
|
|
81
|
+
local width = selectionButtons:getChild(i):getChild(SELECTION_BUTTON_ICON_INDEX).width
|
|
82
|
+
if width > maxButtonWidth then
|
|
83
|
+
maxButtonWidth = width
|
|
84
|
+
mainSelectedUnitIndex = i
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
return mainSelectedUnitIndex
|
|
88
|
+
end
|
|
89
|
+
local function getChildIfPresent(parent, index)
|
|
90
|
+
if parent == nil or index >= frameGetChildrenCount(parent) then
|
|
91
|
+
return nil
|
|
92
|
+
end
|
|
93
|
+
return frameGetChild(parent, index)
|
|
94
|
+
end
|
|
95
|
+
local function padSelectionLayoutFrames(registeredCount)
|
|
96
|
+
do
|
|
97
|
+
local i = registeredCount
|
|
98
|
+
while i < SELECTION_LAYOUT_MAX_HANDLE_COUNT do
|
|
99
|
+
location(0, 0)
|
|
100
|
+
i = i + 1
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
--- Wraps every frame of the group selection layout currently shown on this client, in the
|
|
105
|
+
-- order `actualizeMainSelectedUnit` later walks them. Game-owned frames receive a JASS handle
|
|
106
|
+
-- id the first time a script retrieves them, and the game builds the layout's buttons anew
|
|
107
|
+
-- whenever the selection changes, so this must run in a tick every client shares and register
|
|
108
|
+
-- the same number of handles everywhere: every frame reached for the first time counts, and
|
|
109
|
+
-- the remainder up to SELECTION_LAYOUT_MAX_HANDLE_COUNT is padded with locations, the way
|
|
110
|
+
-- `Frame.byOrigin` balances origin frames that appear asynchronously.
|
|
111
|
+
--
|
|
112
|
+
-- Returns the number of buttons found, or undefined when the layout was not fully reachable.
|
|
113
|
+
local function registerShownSelectionLayoutFrames()
|
|
114
|
+
local registeredCount = 0
|
|
115
|
+
local function register(handle)
|
|
116
|
+
if handle == nil or getHandleId(handle) == 0 then
|
|
117
|
+
return nil
|
|
118
|
+
end
|
|
119
|
+
if not Frame:isWrapped(handle) then
|
|
120
|
+
registeredCount = registeredCount + 1
|
|
121
|
+
end
|
|
122
|
+
Frame:of(handle)
|
|
123
|
+
return handle
|
|
124
|
+
end
|
|
125
|
+
local detail = register(getFrameByName(SELECTION_DETAIL_FRAME_NAME, 0))
|
|
126
|
+
local container = register(detail ~= nil and frameGetParent(detail) or nil)
|
|
127
|
+
local groupPanel = register(getChildIfPresent(container, SELECTION_GROUP_PANEL_INDEX))
|
|
128
|
+
local grid = register(getChildIfPresent(groupPanel, 0))
|
|
129
|
+
local buttonCount
|
|
130
|
+
if grid ~= nil then
|
|
131
|
+
local count = frameGetChildrenCount(grid)
|
|
132
|
+
if count <= SELECTION_LAYOUT_MAX_BUTTON_COUNT then
|
|
133
|
+
buttonCount = count
|
|
134
|
+
for i = 0, count - 1 do
|
|
135
|
+
local button = register(getChildIfPresent(grid, i))
|
|
136
|
+
if register(getChildIfPresent(button, SELECTION_BUTTON_ICON_INDEX)) == nil then
|
|
137
|
+
buttonCount = nil
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
padSelectionLayoutFrames(registeredCount)
|
|
143
|
+
return buttonCount
|
|
144
|
+
end
|
|
145
|
+
local function getExpectedSelectionLayoutButtonCount(selectionCount)
|
|
146
|
+
return selectionCount <= 12 and 12 or SELECTION_LAYOUT_MAX_BUTTON_COUNT
|
|
147
|
+
end
|
|
148
|
+
local selectionLayoutSocket = __TS__New(Socket)
|
|
149
|
+
local localSelectionSignature = 0
|
|
150
|
+
local localSelectionEpoch = 0
|
|
151
|
+
local localSelectionCount = 0
|
|
152
|
+
local registeredSelectionEpoch = 0
|
|
153
|
+
local registeredSelectionButtonCount = 0
|
|
154
|
+
local selectionLayoutRequestCount = 0
|
|
155
|
+
local selectionLayoutRequestPending = false
|
|
156
|
+
selectionLayoutSocket.onMessage:addListener(function(player)
|
|
157
|
+
if player ~= Player["local"] then
|
|
158
|
+
padSelectionLayoutFrames(0)
|
|
159
|
+
return
|
|
160
|
+
end
|
|
161
|
+
selectionLayoutRequestPending = false
|
|
162
|
+
local buttonCount = registerShownSelectionLayoutFrames()
|
|
163
|
+
if buttonCount ~= nil and localSelectionCount > 1 and buttonCount == getExpectedSelectionLayoutButtonCount(localSelectionCount) then
|
|
164
|
+
registeredSelectionEpoch = localSelectionEpoch
|
|
165
|
+
registeredSelectionButtonCount = buttonCount
|
|
166
|
+
end
|
|
167
|
+
end)
|
|
168
|
+
local localSelectedUnits = {}
|
|
169
|
+
local indexByLocalSelectedUnit = {}
|
|
170
|
+
local function compareUnitsSelectionPriority(a, b)
|
|
171
|
+
local aHandle = a.handle
|
|
172
|
+
local bHandle = b.handle
|
|
173
|
+
local priorityDelta = getUnitRealField(bHandle, UNIT_RF_PRIORITY) - getUnitRealField(aHandle, UNIT_RF_PRIORITY)
|
|
174
|
+
if priorityDelta ~= 0 then
|
|
175
|
+
return priorityDelta < 0
|
|
176
|
+
end
|
|
177
|
+
local aTypeId = getUnitTypeId(aHandle)
|
|
178
|
+
local bTypeId = getUnitTypeId(bHandle)
|
|
179
|
+
local orderDelta = (isHeroUnitId(aTypeId) and getHandleId(aHandle) or aTypeId) - (isHeroUnitId(bTypeId) and getHandleId(bHandle) or bTypeId)
|
|
180
|
+
return (orderDelta ~= 0 and orderDelta or indexByLocalSelectedUnit[a] - indexByLocalSelectedUnit[b]) < 0
|
|
181
|
+
end
|
|
182
|
+
local mainSelectedUnitChangeEvent
|
|
183
|
+
local previousMainSelectedUnit
|
|
184
|
+
local currentMainSelectedUnit
|
|
185
|
+
local lastTargetingModeState = false
|
|
186
|
+
local targetingModeEnterEvent = __TS__New(Event)
|
|
187
|
+
local targetingModeLeaveEvent = __TS__New(Event)
|
|
188
|
+
local targetingModeStateChangeEvent = __TS__New(Event)
|
|
24
189
|
____exports.LocalClient = __TS__Class()
|
|
25
190
|
local LocalClient = ____exports.LocalClient
|
|
26
191
|
LocalClient.name = "LocalClient"
|
|
27
192
|
function LocalClient.prototype.____constructor(self)
|
|
28
193
|
end
|
|
194
|
+
function LocalClient.pingMinimap(self, x, y, duration, redOrColor, greenOrFlashy, blue, flashy)
|
|
195
|
+
if redOrColor == nil then
|
|
196
|
+
pingMinimap(x, y, duration)
|
|
197
|
+
elseif __TS__InstanceOf(redOrColor, Color) then
|
|
198
|
+
pingMinimapEx(
|
|
199
|
+
x,
|
|
200
|
+
y,
|
|
201
|
+
duration,
|
|
202
|
+
redOrColor.r,
|
|
203
|
+
redOrColor.g,
|
|
204
|
+
redOrColor.b,
|
|
205
|
+
greenOrFlashy or false
|
|
206
|
+
)
|
|
207
|
+
else
|
|
208
|
+
pingMinimapEx(
|
|
209
|
+
x,
|
|
210
|
+
y,
|
|
211
|
+
duration,
|
|
212
|
+
redOrColor,
|
|
213
|
+
greenOrFlashy,
|
|
214
|
+
blue,
|
|
215
|
+
flashy or false
|
|
216
|
+
)
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
function LocalClient.isKeyPressed(self, key)
|
|
220
|
+
return isKeyPressed(key)
|
|
221
|
+
end
|
|
222
|
+
function LocalClient.isMetaKeyPressed(self, key)
|
|
223
|
+
return isMetaKeyPressed(key)
|
|
224
|
+
end
|
|
225
|
+
function LocalClient.isMouseButtonPressed(self, button)
|
|
226
|
+
return isMouseButtonPressed(button)
|
|
227
|
+
end
|
|
228
|
+
function LocalClient.screenToFrameX(self, x)
|
|
229
|
+
return pixelToFrameX(x)
|
|
230
|
+
end
|
|
231
|
+
function LocalClient.screenToFrameY(self, y)
|
|
232
|
+
return pixelToFrameY(y)
|
|
233
|
+
end
|
|
234
|
+
function LocalClient.frameToScreenX(self, x)
|
|
235
|
+
return frameToPixelX(x)
|
|
236
|
+
end
|
|
237
|
+
function LocalClient.frameToScreenY(self, y)
|
|
238
|
+
return frameToPixelY(y)
|
|
239
|
+
end
|
|
29
240
|
LocalClient.locale = getLocale()
|
|
30
241
|
__TS__ObjectDefineProperty(
|
|
31
242
|
LocalClient,
|
|
@@ -41,6 +252,13 @@ __TS__ObjectDefineProperty(
|
|
|
41
252
|
return getLocalClientHeight()
|
|
42
253
|
end}
|
|
43
254
|
)
|
|
255
|
+
__TS__ObjectDefineProperty(
|
|
256
|
+
LocalClient,
|
|
257
|
+
"isSD",
|
|
258
|
+
{get = function(self)
|
|
259
|
+
return true
|
|
260
|
+
end}
|
|
261
|
+
)
|
|
44
262
|
__TS__ObjectDefineProperty(
|
|
45
263
|
LocalClient,
|
|
46
264
|
"isHD",
|
|
@@ -48,11 +266,18 @@ __TS__ObjectDefineProperty(
|
|
|
48
266
|
return false
|
|
49
267
|
end}
|
|
50
268
|
)
|
|
269
|
+
__TS__ObjectDefineProperty(
|
|
270
|
+
LocalClient,
|
|
271
|
+
"isDE",
|
|
272
|
+
{get = function(self)
|
|
273
|
+
return false
|
|
274
|
+
end}
|
|
275
|
+
)
|
|
51
276
|
__TS__ObjectDefineProperty(
|
|
52
277
|
LocalClient,
|
|
53
278
|
"graphicsMode",
|
|
54
279
|
{get = function(self)
|
|
55
|
-
return
|
|
280
|
+
return 0
|
|
56
281
|
end}
|
|
57
282
|
)
|
|
58
283
|
__TS__ObjectDefineProperty(
|
|
@@ -62,6 +287,41 @@ __TS__ObjectDefineProperty(
|
|
|
62
287
|
return isLocalClientActive()
|
|
63
288
|
end}
|
|
64
289
|
)
|
|
290
|
+
__TS__ObjectDefineProperty(
|
|
291
|
+
LocalClient,
|
|
292
|
+
"isMinimized",
|
|
293
|
+
{get = function(self)
|
|
294
|
+
return getLocalClientHeight() == 0
|
|
295
|
+
end}
|
|
296
|
+
)
|
|
297
|
+
__TS__ObjectDefineProperty(
|
|
298
|
+
LocalClient,
|
|
299
|
+
"mouseScreenX",
|
|
300
|
+
{get = function(self)
|
|
301
|
+
return getMouseScreenPosX()
|
|
302
|
+
end}
|
|
303
|
+
)
|
|
304
|
+
__TS__ObjectDefineProperty(
|
|
305
|
+
LocalClient,
|
|
306
|
+
"mouseScreenY",
|
|
307
|
+
{get = function(self)
|
|
308
|
+
return getMouseScreenPosY()
|
|
309
|
+
end}
|
|
310
|
+
)
|
|
311
|
+
__TS__ObjectDefineProperty(
|
|
312
|
+
LocalClient,
|
|
313
|
+
"mouseFrameX",
|
|
314
|
+
{get = function(self)
|
|
315
|
+
return pixelToFrameX(getMouseScreenPosX())
|
|
316
|
+
end}
|
|
317
|
+
)
|
|
318
|
+
__TS__ObjectDefineProperty(
|
|
319
|
+
LocalClient,
|
|
320
|
+
"mouseFrameY",
|
|
321
|
+
{get = function(self)
|
|
322
|
+
return pixelToFrameY(getMouseScreenPosY())
|
|
323
|
+
end}
|
|
324
|
+
)
|
|
65
325
|
__TS__ObjectDefineProperty(
|
|
66
326
|
LocalClient,
|
|
67
327
|
"mouseFocusUnit",
|
|
@@ -69,6 +329,33 @@ __TS__ObjectDefineProperty(
|
|
|
69
329
|
return Unit:of(getMouseFocusUnit())
|
|
70
330
|
end}
|
|
71
331
|
)
|
|
332
|
+
__TS__ObjectDefineProperty(
|
|
333
|
+
LocalClient,
|
|
334
|
+
"mainSelectedUnit",
|
|
335
|
+
{get = function(self)
|
|
336
|
+
return currentMainSelectedUnit
|
|
337
|
+
end}
|
|
338
|
+
)
|
|
339
|
+
__TS__ObjectDefineProperty(
|
|
340
|
+
LocalClient,
|
|
341
|
+
"mainSelectedUnitChangeEvent",
|
|
342
|
+
{get = function(self)
|
|
343
|
+
if mainSelectedUnitChangeEvent == nil then
|
|
344
|
+
mainSelectedUnitChangeEvent = __TS__New(Event)
|
|
345
|
+
end
|
|
346
|
+
return mainSelectedUnitChangeEvent
|
|
347
|
+
end}
|
|
348
|
+
)
|
|
349
|
+
__TS__ObjectDefineProperty(
|
|
350
|
+
LocalClient,
|
|
351
|
+
"isInTargetingMode",
|
|
352
|
+
{get = function(self)
|
|
353
|
+
return actualizeTargetingModeState()
|
|
354
|
+
end}
|
|
355
|
+
)
|
|
356
|
+
LocalClient.targetingModeEnterEvent = targetingModeEnterEvent
|
|
357
|
+
LocalClient.targetingModeLeaveEvent = targetingModeLeaveEvent
|
|
358
|
+
LocalClient.targetingModeStateChangeEvent = targetingModeStateChangeEvent
|
|
72
359
|
LocalClient.onDisconnect = __TS__New(
|
|
73
360
|
TriggerEvent,
|
|
74
361
|
function(trigger)
|
|
@@ -76,11 +363,95 @@ LocalClient.onDisconnect = __TS__New(
|
|
|
76
363
|
end,
|
|
77
364
|
function() return end
|
|
78
365
|
)
|
|
366
|
+
local function actualizeMainSelectedUnit()
|
|
367
|
+
Unit:getSelectionOf(Player["local"], localSelectedUnits)
|
|
368
|
+
local selectionCount = #localSelectedUnits
|
|
369
|
+
local signature = selectionCount
|
|
370
|
+
for i = 1, selectionCount do
|
|
371
|
+
indexByLocalSelectedUnit[localSelectedUnits[i]] = i
|
|
372
|
+
signature = signature + getHandleId(localSelectedUnits[i].handle)
|
|
373
|
+
end
|
|
374
|
+
if signature ~= localSelectionSignature then
|
|
375
|
+
localSelectionSignature = signature
|
|
376
|
+
localSelectionEpoch = localSelectionEpoch + 1
|
|
377
|
+
selectionLayoutRequestCount = 0
|
|
378
|
+
end
|
|
379
|
+
localSelectionCount = selectionCount
|
|
380
|
+
tableSort(localSelectedUnits, compareUnitsSelectionPriority)
|
|
381
|
+
local mainSelectedUnitIndex
|
|
382
|
+
if selectionCount > 1 then
|
|
383
|
+
local registered = registeredSelectionEpoch == localSelectionEpoch
|
|
384
|
+
if registered then
|
|
385
|
+
local selectionButtons = getSelectionButtons()
|
|
386
|
+
if selectionButtons:getChildrenCount() == registeredSelectionButtonCount then
|
|
387
|
+
mainSelectedUnitIndex = getMainSelectedUnitIndex(selectionButtons, registeredSelectionButtonCount)
|
|
388
|
+
else
|
|
389
|
+
registered = false
|
|
390
|
+
registeredSelectionEpoch = 0
|
|
391
|
+
selectionLayoutRequestCount = 0
|
|
392
|
+
end
|
|
393
|
+
end
|
|
394
|
+
if not registered and not selectionLayoutRequestPending and selectionLayoutRequestCount < SELECTION_LAYOUT_MAX_REQUEST_COUNT then
|
|
395
|
+
selectionLayoutRequestPending = true
|
|
396
|
+
selectionLayoutRequestCount = selectionLayoutRequestCount + 1
|
|
397
|
+
selectionLayoutSocket:send("")
|
|
398
|
+
end
|
|
399
|
+
end
|
|
400
|
+
local mainSelectedUnit
|
|
401
|
+
if selectionCount <= 1 then
|
|
402
|
+
mainSelectedUnit = localSelectedUnits[1]
|
|
403
|
+
elseif registeredSelectionEpoch == localSelectionEpoch then
|
|
404
|
+
mainSelectedUnit = localSelectedUnits[(mainSelectedUnitIndex or 0) + 1]
|
|
405
|
+
end
|
|
406
|
+
for i = 1, selectionCount do
|
|
407
|
+
indexByLocalSelectedUnit[localSelectedUnits[i]] = nil
|
|
408
|
+
localSelectedUnits[i] = nil
|
|
409
|
+
end
|
|
410
|
+
currentMainSelectedUnit = mainSelectedUnit
|
|
411
|
+
if mainSelectedUnitChangeEvent ~= nil and mainSelectedUnit ~= previousMainSelectedUnit then
|
|
412
|
+
local previousPreviousMainSelectedUnit = previousMainSelectedUnit
|
|
413
|
+
previousMainSelectedUnit = mainSelectedUnit
|
|
414
|
+
Event.invoke(mainSelectedUnitChangeEvent, previousPreviousMainSelectedUnit, previousMainSelectedUnit)
|
|
415
|
+
end
|
|
416
|
+
end
|
|
417
|
+
local commandButtons = array(
|
|
418
|
+
12,
|
|
419
|
+
function(i) return Frame:byOrigin(ORIGIN_FRAME_COMMAND_BUTTON, i) end
|
|
420
|
+
)
|
|
421
|
+
local function getTargetingModeState()
|
|
422
|
+
for i = 0, 10 do
|
|
423
|
+
if commandButtons[i + 1].visible then
|
|
424
|
+
return false
|
|
425
|
+
end
|
|
426
|
+
end
|
|
427
|
+
return commandButtons[12].visible
|
|
428
|
+
end
|
|
429
|
+
actualizeTargetingModeState = function()
|
|
430
|
+
if getTargetingModeState() then
|
|
431
|
+
if not lastTargetingModeState then
|
|
432
|
+
lastTargetingModeState = true
|
|
433
|
+
Event.invoke(targetingModeEnterEvent)
|
|
434
|
+
Event.invoke(targetingModeStateChangeEvent)
|
|
435
|
+
end
|
|
436
|
+
return true
|
|
437
|
+
end
|
|
438
|
+
if lastTargetingModeState then
|
|
439
|
+
lastTargetingModeState = false
|
|
440
|
+
Event.invoke(targetingModeLeaveEvent)
|
|
441
|
+
Event.invoke(targetingModeStateChangeEvent)
|
|
442
|
+
end
|
|
443
|
+
return false
|
|
444
|
+
end
|
|
445
|
+
Timer.onPeriod[1 / 64]:addListener(function()
|
|
446
|
+
actualizeMainSelectedUnit()
|
|
447
|
+
actualizeTargetingModeState()
|
|
448
|
+
end)
|
|
79
449
|
warpack.afterMapInit(function()
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
)
|
|
450
|
+
local isDE = loadTOCFile(deTocPath)
|
|
451
|
+
local isHD = not isDE and loadTOCFile(hdTocPath)
|
|
452
|
+
rawset(____exports.LocalClient, "isDE", isDE)
|
|
453
|
+
rawset(____exports.LocalClient, "isHD", isHD)
|
|
454
|
+
rawset(____exports.LocalClient, "isSD", not isDE and not isHD)
|
|
455
|
+
rawset(____exports.LocalClient, "graphicsMode", isDE and 2 or (isHD and 1 or 0))
|
|
85
456
|
end)
|
|
86
457
|
return ____exports
|
|
@@ -1,2 +1,18 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
+
local animationNames = {
|
|
3
|
+
attack = true,
|
|
4
|
+
birth = true,
|
|
5
|
+
death = true,
|
|
6
|
+
decay = true,
|
|
7
|
+
dissipate = true,
|
|
8
|
+
morph = true,
|
|
9
|
+
portrait = true,
|
|
10
|
+
sleep = true,
|
|
11
|
+
spell = true,
|
|
12
|
+
stand = true,
|
|
13
|
+
walk = true
|
|
14
|
+
}
|
|
15
|
+
____exports.isAnimationName = function(value)
|
|
16
|
+
return animationNames[value] ~= nil
|
|
17
|
+
end
|
|
2
18
|
return ____exports
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____records = require("utility.records")
|
|
3
|
+
local invertRecord = ____records.invertRecord
|
|
4
|
+
local stringByArmorType = {
|
|
5
|
+
[0] = "small",
|
|
6
|
+
[1] = "medium",
|
|
7
|
+
[2] = "large",
|
|
8
|
+
[3] = "fort",
|
|
9
|
+
[4] = "normal",
|
|
10
|
+
[5] = "hero",
|
|
11
|
+
[6] = "divine",
|
|
12
|
+
[7] = "none"
|
|
13
|
+
}
|
|
14
|
+
local armorTypeByString = invertRecord(stringByArmorType)
|
|
15
|
+
local nativeByArmorType = {
|
|
16
|
+
[0] = DEFENSE_TYPE_LIGHT,
|
|
17
|
+
[1] = DEFENSE_TYPE_MEDIUM,
|
|
18
|
+
[2] = DEFENSE_TYPE_LARGE,
|
|
19
|
+
[3] = DEFENSE_TYPE_FORT,
|
|
20
|
+
[4] = DEFENSE_TYPE_NORMAL,
|
|
21
|
+
[5] = DEFENSE_TYPE_HERO,
|
|
22
|
+
[6] = DEFENSE_TYPE_DIVINE,
|
|
23
|
+
[7] = DEFENSE_TYPE_NONE
|
|
24
|
+
}
|
|
25
|
+
local armorTypeByNative = invertRecord(nativeByArmorType)
|
|
26
|
+
---
|
|
27
|
+
-- @internal For use by internal systems only.
|
|
28
|
+
____exports.armorTypeToString = function(armorType)
|
|
29
|
+
return stringByArmorType[armorType]
|
|
30
|
+
end
|
|
31
|
+
---
|
|
32
|
+
-- @internal For use by internal systems only.
|
|
33
|
+
____exports.stringToArmorType = function(____string)
|
|
34
|
+
return armorTypeByString[____string] or 7
|
|
35
|
+
end
|
|
36
|
+
---
|
|
37
|
+
-- @internal For use by internal systems only.
|
|
38
|
+
____exports.armorTypeToNative = function(armorType)
|
|
39
|
+
return nativeByArmorType[armorType]
|
|
40
|
+
end
|
|
41
|
+
---
|
|
42
|
+
-- @internal For use by internal systems only.
|
|
43
|
+
____exports.nativeToArmorType = function(armorType)
|
|
44
|
+
return armorTypeByNative[armorType]
|
|
45
|
+
end
|
|
46
|
+
return ____exports
|
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
import { ModelNodeName } from "./model-node-name";
|
|
3
3
|
import { ModelNodeQualifier } from "./model-node-qualifier";
|
|
4
4
|
import { Optional } from "../../../utility/types";
|
|
5
|
+
import { EffectParameters } from "../../../core/types/effect";
|
|
5
6
|
export type AttachmentPreset = {
|
|
6
7
|
modelPath: string;
|
|
7
8
|
nodeName: ModelNodeName;
|
|
8
9
|
nodeQualifiers: ModelNodeQualifier[];
|
|
9
10
|
};
|
|
10
|
-
export type
|
|
11
|
-
|
|
11
|
+
export type EffectPresetWithParameters = AttachmentPreset & {
|
|
12
|
+
parameters?: EffectParameters;
|
|
13
|
+
};
|
|
14
|
+
export type AttachmentPresetInput<T extends AttachmentPreset = AttachmentPreset> = Optional<T, "nodeName" | "nodeQualifiers"> | string;
|
|
15
|
+
export type EffectPresetWithParametersInput = AttachmentPresetInput<EffectPresetWithParameters>;
|
|
16
|
+
export declare const toEffectPreset: (effectPresetInput: EffectPresetWithParametersInput) => EffectPresetWithParameters;
|
|
12
17
|
export declare const extractAttachmentPresetInputModelPath: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
|
|
13
18
|
export declare const extractAttachmentPresetInputNodeFQN: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
|
|
14
19
|
export declare const splitAttachmentNodeFQN: (attachmentNodeFQN: string) => LuaMultiReturn<[attachmentNodeName: ModelNodeName, attachmentNodeQualifiers: ModelNodeQualifier[]]>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArrayJoin = ____lualib.__TS__ArrayJoin
|
|
2
3
|
local __TS__StringSplit = ____lualib.__TS__StringSplit
|
|
3
4
|
local __TS__ArraySlice = ____lualib.__TS__ArraySlice
|
|
4
5
|
local ____exports = {}
|
|
5
|
-
____exports.
|
|
6
|
-
return type(
|
|
6
|
+
____exports.toEffectPreset = function(effectPresetInput)
|
|
7
|
+
return type(effectPresetInput) == "string" and ({modelPath = effectPresetInput, nodeName = "origin", nodeQualifiers = {}}) or ({modelPath = effectPresetInput.modelPath, nodeName = effectPresetInput.nodeName or "origin", nodeQualifiers = effectPresetInput.nodeQualifiers or ({}), parameters = effectPresetInput.parameters})
|
|
7
8
|
end
|
|
8
9
|
____exports.extractAttachmentPresetInputModelPath = function(attachmentPresetInput)
|
|
9
10
|
return type(attachmentPresetInput) == "string" and attachmentPresetInput or (attachmentPresetInput and attachmentPresetInput.modelPath or "")
|
|
@@ -12,7 +13,7 @@ ____exports.extractAttachmentPresetInputNodeFQN = function(attachmentPresetInput
|
|
|
12
13
|
if type(attachmentPresetInput) == "string" or attachmentPresetInput == nil then
|
|
13
14
|
return ""
|
|
14
15
|
end
|
|
15
|
-
return
|
|
16
|
+
return __TS__ArrayJoin(
|
|
16
17
|
{
|
|
17
18
|
attachmentPresetInput.nodeName,
|
|
18
19
|
table.unpack(attachmentPresetInput.nodeQualifiers or ({}))
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
export declare const enum AttackType {
|
|
3
|
-
|
|
4
|
-
NORMAL =
|
|
5
|
-
PIERCE =
|
|
6
|
-
SIEGE =
|
|
7
|
-
|
|
8
|
-
CHAOS =
|
|
9
|
-
|
|
10
|
-
HERO = "hero"
|
|
3
|
+
SPELL = 0,
|
|
4
|
+
NORMAL = 1,
|
|
5
|
+
PIERCE = 2,
|
|
6
|
+
SIEGE = 3,
|
|
7
|
+
MAGIC = 4,
|
|
8
|
+
CHAOS = 5,
|
|
9
|
+
HERO = 6
|
|
11
10
|
}
|
|
@@ -1,2 +1,44 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
+
local ____records = require("utility.records")
|
|
3
|
+
local invertRecord = ____records.invertRecord
|
|
4
|
+
local stringByAttackType = {
|
|
5
|
+
[1] = "normal",
|
|
6
|
+
[2] = "pierce",
|
|
7
|
+
[3] = "siege",
|
|
8
|
+
[0] = "spells",
|
|
9
|
+
[5] = "chaos",
|
|
10
|
+
[4] = "magic",
|
|
11
|
+
[6] = "hero"
|
|
12
|
+
}
|
|
13
|
+
local attackTypeByString = invertRecord(stringByAttackType)
|
|
14
|
+
local nativeByAttackType = {
|
|
15
|
+
[1] = ATTACK_TYPE_MELEE,
|
|
16
|
+
[2] = ATTACK_TYPE_PIERCE,
|
|
17
|
+
[3] = ATTACK_TYPE_SIEGE,
|
|
18
|
+
[0] = ATTACK_TYPE_NORMAL,
|
|
19
|
+
[5] = ATTACK_TYPE_CHAOS,
|
|
20
|
+
[4] = ATTACK_TYPE_MAGIC,
|
|
21
|
+
[6] = ATTACK_TYPE_HERO
|
|
22
|
+
}
|
|
23
|
+
local attackTypeByNative = invertRecord(nativeByAttackType)
|
|
24
|
+
---
|
|
25
|
+
-- @internal For use by internal systems only.
|
|
26
|
+
____exports.attackTypeToString = function(attackType)
|
|
27
|
+
return attackType ~= nil and stringByAttackType[attackType] or "unknown"
|
|
28
|
+
end
|
|
29
|
+
---
|
|
30
|
+
-- @internal For use by internal systems only.
|
|
31
|
+
____exports.stringToAttackType = function(____string)
|
|
32
|
+
return attackTypeByString[____string]
|
|
33
|
+
end
|
|
34
|
+
---
|
|
35
|
+
-- @internal For use by internal systems only.
|
|
36
|
+
____exports.attackTypeToNative = function(attackType)
|
|
37
|
+
return nativeByAttackType[attackType]
|
|
38
|
+
end
|
|
39
|
+
---
|
|
40
|
+
-- @internal For use by internal systems only.
|
|
41
|
+
____exports.nativeToAttackType = function(attackType)
|
|
42
|
+
return attackTypeByNative[attackType]
|
|
43
|
+
end
|
|
2
44
|
return ____exports
|