warscript 0.0.1-dev.404878c
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/LICENSE +23 -0
- package/binaryreader.d.ts +20 -0
- package/binaryreader.lua +50 -0
- package/binarywriter.d.ts +21 -0
- package/binarywriter.lua +90 -0
- package/core/dummy.d.ts +22 -0
- package/core/dummy.lua +133 -0
- package/core/game.d.ts +3 -0
- package/core/game.lua +24 -0
- package/core/mapbounds.d.ts +8 -0
- package/core/mapbounds.lua +12 -0
- package/core/thread.d.ts +8 -0
- package/core/thread.lua +40 -0
- package/core/types/ability.d.ts +4 -0
- package/core/types/ability.lua +10 -0
- package/core/types/async.d.ts +3 -0
- package/core/types/async.lua +2 -0
- package/core/types/camera.d.ts +4 -0
- package/core/types/camera.lua +21 -0
- package/core/types/cameraField.d.ts +15 -0
- package/core/types/cameraField.lua +38 -0
- package/core/types/color.d.ts +16 -0
- package/core/types/color.lua +93 -0
- package/core/types/destructable.d.ts +31 -0
- package/core/types/destructable.lua +245 -0
- package/core/types/effect.d.ts +31 -0
- package/core/types/effect.lua +209 -0
- package/core/types/frame.d.ts +140 -0
- package/core/types/frame.lua +882 -0
- package/core/types/game.d.ts +8 -0
- package/core/types/game.lua +41 -0
- package/core/types/group.d.ts +22 -0
- package/core/types/group.lua +94 -0
- package/core/types/handle.d.ts +48 -0
- package/core/types/handle.lua +169 -0
- package/core/types/image.d.ts +30 -0
- package/core/types/image.lua +121 -0
- package/core/types/internal/ability+cooldownRemaining.d.ts +1 -0
- package/core/types/internal/ability+cooldownRemaining.lua +0 -0
- package/core/types/item.d.ts +4 -0
- package/core/types/item.lua +6 -0
- package/core/types/missile.d.ts +22 -0
- package/core/types/missile.lua +233 -0
- package/core/types/order.d.ts +25 -0
- package/core/types/order.lua +55 -0
- package/core/types/player.d.ts +71 -0
- package/core/types/player.lua +448 -0
- package/core/types/playerCamera.d.ts +32 -0
- package/core/types/playerCamera.lua +162 -0
- package/core/types/playerColor.d.ts +40 -0
- package/core/types/playerColor.lua +203 -0
- package/core/types/rect.d.ts +39 -0
- package/core/types/rect.lua +152 -0
- package/core/types/region.d.ts +14 -0
- package/core/types/region.lua +84 -0
- package/core/types/sound.d.ts +69 -0
- package/core/types/sound.lua +247 -0
- package/core/types/tileCell.d.ts +13 -0
- package/core/types/tileCell.lua +100 -0
- package/core/types/timer.d.ts +36 -0
- package/core/types/timer.lua +230 -0
- package/core/types/timerDialog.d.ts +19 -0
- package/core/types/timerDialog.lua +95 -0
- package/core/types/unit.d.ts +10 -0
- package/core/types/unit.lua +24 -0
- package/core/types/widget.d.ts +5 -0
- package/core/types/widget.lua +2 -0
- package/core/util.d.ts +62 -0
- package/core/util.lua +464 -0
- package/core/vecmath/common.d.ts +18 -0
- package/core/vecmath/common.lua +29 -0
- package/core/vecmath/mat2.d.ts +73 -0
- package/core/vecmath/mat2.lua +261 -0
- package/core/vecmath/vec3.d.ts +47 -0
- package/core/vecmath/vec3.lua +350 -0
- package/core/vecmath/vec4.d.ts +54 -0
- package/core/vecmath/vec4.lua +400 -0
- package/crypto/ecc.d.ts +6 -0
- package/crypto/ecc.lua +1734 -0
- package/decl/index.d.ts +116 -0
- package/decl/native.d.ts +8198 -0
- package/destroyable.d.ts +20 -0
- package/destroyable.lua +31 -0
- package/engine/ability.d.ts +5 -0
- package/engine/ability.lua +7 -0
- package/engine/behavior.d.ts +28 -0
- package/engine/behavior.lua +181 -0
- package/engine/behaviour/ability/apply-buff.d.ts +38 -0
- package/engine/behaviour/ability/apply-buff.lua +126 -0
- package/engine/behaviour/ability/apply-unit-behavior.d.ts +12 -0
- package/engine/behaviour/ability/apply-unit-behavior.lua +36 -0
- package/engine/behaviour/ability/damage.d.ts +25 -0
- package/engine/behaviour/ability/damage.lua +75 -0
- package/engine/behaviour/ability/heal.d.ts +16 -0
- package/engine/behaviour/ability/heal.lua +35 -0
- package/engine/behaviour/ability/instant-impact.d.ts +6 -0
- package/engine/behaviour/ability/instant-impact.lua +25 -0
- package/engine/behaviour/ability.d.ts +40 -0
- package/engine/behaviour/ability.lua +175 -0
- package/engine/behaviour/unit/stun-immunity.d.ts +19 -0
- package/engine/behaviour/unit/stun-immunity.lua +67 -0
- package/engine/behaviour/unit.d.ts +20 -0
- package/engine/behaviour/unit.lua +75 -0
- package/engine/buff.d.ts +221 -0
- package/engine/buff.lua +1093 -0
- package/engine/constants.d.ts +7 -0
- package/engine/constants.lua +8 -0
- package/engine/index.d.ts +5 -0
- package/engine/index.lua +2 -0
- package/engine/internal/ability.d.ts +91 -0
- package/engine/internal/ability.lua +531 -0
- package/engine/internal/item/ability.d.ts +2 -0
- package/engine/internal/item/ability.lua +48 -0
- package/engine/internal/item+owner.d.ts +7 -0
- package/engine/internal/item+owner.lua +22 -0
- package/engine/internal/item.d.ts +86 -0
- package/engine/internal/item.lua +580 -0
- package/engine/internal/mechanics/ability-duration.d.ts +4 -0
- package/engine/internal/mechanics/ability-duration.lua +11 -0
- package/engine/internal/mechanics/area-damage.d.ts +2 -0
- package/engine/internal/mechanics/area-damage.lua +33 -0
- package/engine/internal/misc/dummy-units.d.ts +2 -0
- package/engine/internal/misc/dummy-units.lua +14 -0
- package/engine/internal/object-data/armor-increase.d.ts +2 -0
- package/engine/internal/object-data/armor-increase.lua +19 -0
- package/engine/internal/object-data/attribute-bonus.d.ts +2 -0
- package/engine/internal/object-data/attribute-bonus.lua +15 -0
- package/engine/internal/object-data/auto-attack-damage-increase.d.ts +2 -0
- package/engine/internal/object-data/auto-attack-damage-increase.lua +17 -0
- package/engine/internal/object-data/auto-attack-speed-increase.d.ts +2 -0
- package/engine/internal/object-data/auto-attack-speed-increase.lua +14 -0
- package/engine/internal/object-data/dummy-inventory.d.ts +2 -0
- package/engine/internal/object-data/dummy-inventory.lua +16 -0
- package/engine/internal/object-data/dummy-item.d.ts +2 -0
- package/engine/internal/object-data/dummy-item.lua +10 -0
- package/engine/internal/object-data/ghost-visible.d.ts +2 -0
- package/engine/internal/object-data/ghost-visible.lua +15 -0
- package/engine/internal/object-data/invulnerable.d.ts +2 -0
- package/engine/internal/object-data/invulnerable.lua +11 -0
- package/engine/internal/object-data/movement-speed-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/movement-speed-increase-factor.lua +18 -0
- package/engine/internal/unit/ability.d.ts +143 -0
- package/engine/internal/unit/ability.lua +369 -0
- package/engine/internal/unit/allowed-targets.d.ts +17 -0
- package/engine/internal/unit/allowed-targets.lua +19 -0
- package/engine/internal/unit/band-aids/ancestral-spirit-cannibalize.d.ts +2 -0
- package/engine/internal/unit/band-aids/ancestral-spirit-cannibalize.lua +21 -0
- package/engine/internal/unit/bonus.d.ts +41 -0
- package/engine/internal/unit/bonus.lua +188 -0
- package/engine/internal/unit/buff.d.ts +38 -0
- package/engine/internal/unit/buff.lua +81 -0
- package/engine/internal/unit/expiration-timer.d.ts +22 -0
- package/engine/internal/unit/expiration-timer.lua +44 -0
- package/engine/internal/unit/ghost-counter.d.ts +12 -0
- package/engine/internal/unit/ghost-counter.lua +26 -0
- package/engine/internal/unit/invulnerability-counter.d.ts +12 -0
- package/engine/internal/unit/invulnerability-counter.lua +26 -0
- package/engine/internal/unit/missile.d.ts +42 -0
- package/engine/internal/unit/missile.lua +70 -0
- package/engine/internal/unit/movement-speed.d.ts +18 -0
- package/engine/internal/unit/movement-speed.lua +42 -0
- package/engine/internal/unit/summon-event.d.ts +12 -0
- package/engine/internal/unit/summon-event.lua +50 -0
- package/engine/internal/unit+ability.d.ts +9 -0
- package/engine/internal/unit+ability.lua +59 -0
- package/engine/internal/unit+bonus.d.ts +8 -0
- package/engine/internal/unit+bonus.lua +40 -0
- package/engine/internal/unit+damage.d.ts +69 -0
- package/engine/internal/unit+damage.lua +123 -0
- package/engine/internal/unit+rally.d.ts +10 -0
- package/engine/internal/unit+rally.lua +159 -0
- package/engine/internal/unit+spellSteal.d.ts +7 -0
- package/engine/internal/unit+spellSteal.lua +64 -0
- package/engine/internal/unit+transport.d.ts +12 -0
- package/engine/internal/unit+transport.lua +102 -0
- package/engine/internal/unit-missile-data.d.ts +2 -0
- package/engine/internal/unit-missile-data.lua +107 -0
- package/engine/internal/unit-missile-launch.d.ts +7 -0
- package/engine/internal/unit-missile-launch.lua +32 -0
- package/engine/internal/unit.d.ts +312 -0
- package/engine/internal/unit.lua +2430 -0
- package/engine/internal/utility.d.ts +2 -0
- package/engine/internal/utility.lua +13 -0
- package/engine/lightning.d.ts +51 -0
- package/engine/lightning.lua +303 -0
- package/engine/local-client.d.ts +16 -0
- package/engine/local-client.lua +86 -0
- package/engine/object-data/auxiliary/animation-name.d.ts +14 -0
- package/engine/object-data/auxiliary/animation-name.lua +2 -0
- package/engine/object-data/auxiliary/animation-qualifier.d.ts +53 -0
- package/engine/object-data/auxiliary/animation-qualifier.lua +2 -0
- package/engine/object-data/auxiliary/armor-sound-type.d.ts +8 -0
- package/engine/object-data/auxiliary/armor-sound-type.lua +2 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +15 -0
- package/engine/object-data/auxiliary/attachment-preset.lua +29 -0
- package/engine/object-data/auxiliary/attack-type.d.ts +11 -0
- package/engine/object-data/auxiliary/attack-type.lua +2 -0
- package/engine/object-data/auxiliary/buff-polarity.d.ts +6 -0
- package/engine/object-data/auxiliary/buff-polarity.lua +2 -0
- package/engine/object-data/auxiliary/buff-resistance-type.d.ts +6 -0
- package/engine/object-data/auxiliary/buff-resistance-type.lua +2 -0
- package/engine/object-data/auxiliary/combat-classification.d.ts +46 -0
- package/engine/object-data/auxiliary/combat-classification.lua +206 -0
- package/engine/object-data/auxiliary/detection-type.d.ts +7 -0
- package/engine/object-data/auxiliary/detection-type.lua +2 -0
- package/engine/object-data/auxiliary/model-node-name.d.ts +12 -0
- package/engine/object-data/auxiliary/model-node-name.lua +2 -0
- package/engine/object-data/auxiliary/model-node-qualifier.d.ts +21 -0
- package/engine/object-data/auxiliary/model-node-qualifier.lua +2 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +10 -0
- package/engine/object-data/auxiliary/movement-type.lua +2 -0
- package/engine/object-data/auxiliary/race.d.ts +14 -0
- package/engine/object-data/auxiliary/race.lua +2 -0
- package/engine/object-data/auxiliary/sound-preset-name.d.ts +8 -0
- package/engine/object-data/auxiliary/sound-preset-name.lua +2 -0
- package/engine/object-data/auxiliary/sound-set-name.d.ts +35 -0
- package/engine/object-data/auxiliary/sound-set-name.lua +2 -0
- package/engine/object-data/auxiliary/targeting-type.d.ts +8 -0
- package/engine/object-data/auxiliary/targeting-type.lua +2 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +16 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.lua +8 -0
- package/engine/object-data/auxiliary/unit-classification.d.ts +19 -0
- package/engine/object-data/auxiliary/unit-classification.lua +50 -0
- package/engine/object-data/auxiliary/weapon-sound-type.d.ts +17 -0
- package/engine/object-data/auxiliary/weapon-sound-type.lua +2 -0
- package/engine/object-data/entry/ability-type/armor-increase.d.ts +8 -0
- package/engine/object-data/entry/ability-type/armor-increase.lua +26 -0
- package/engine/object-data/entry/ability-type/attribute-increase.d.ts +12 -0
- package/engine/object-data/entry/ability-type/attribute-increase.lua +52 -0
- package/engine/object-data/entry/ability-type/auto-attack-damage-increase.d.ts +8 -0
- package/engine/object-data/entry/ability-type/auto-attack-damage-increase.lua +26 -0
- package/engine/object-data/entry/ability-type/auto-attack-heal-reduction-effect.d.ts +12 -0
- package/engine/object-data/entry/ability-type/auto-attack-heal-reduction-effect.lua +52 -0
- package/engine/object-data/entry/ability-type/auto-attack-speed-increase.d.ts +8 -0
- package/engine/object-data/entry/ability-type/auto-attack-speed-increase.lua +26 -0
- package/engine/object-data/entry/ability-type/bash.d.ts +16 -0
- package/engine/object-data/entry/ability-type/bash.lua +78 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +10 -0
- package/engine/object-data/entry/ability-type/berserk.lua +39 -0
- package/engine/object-data/entry/ability-type/blank-configurable.d.ts +21 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +249 -0
- package/engine/object-data/entry/ability-type/blank-passive.d.ts +7 -0
- package/engine/object-data/entry/ability-type/blank-passive.lua +28 -0
- package/engine/object-data/entry/ability-type/blizzard.d.ts +16 -0
- package/engine/object-data/entry/ability-type/blizzard.lua +78 -0
- package/engine/object-data/entry/ability-type/blood-lust.d.ts +12 -0
- package/engine/object-data/entry/ability-type/blood-lust.lua +52 -0
- package/engine/object-data/entry/ability-type/chain-lightning.d.ts +12 -0
- package/engine/object-data/entry/ability-type/chain-lightning.lua +52 -0
- package/engine/object-data/entry/ability-type/channel.d.ts +48 -0
- package/engine/object-data/entry/ability-type/channel.lua +140 -0
- package/engine/object-data/entry/ability-type/charge-gold-and-lumber.d.ts +14 -0
- package/engine/object-data/entry/ability-type/charge-gold-and-lumber.lua +65 -0
- package/engine/object-data/entry/ability-type/cleaving-attack.d.ts +8 -0
- package/engine/object-data/entry/ability-type/cleaving-attack.lua +26 -0
- package/engine/object-data/entry/ability-type/cluster-rockets.d.ts +18 -0
- package/engine/object-data/entry/ability-type/cluster-rockets.lua +91 -0
- package/engine/object-data/entry/ability-type/cripple.d.ts +12 -0
- package/engine/object-data/entry/ability-type/cripple.lua +52 -0
- package/engine/object-data/entry/ability-type/critical-strike.d.ts +18 -0
- package/engine/object-data/entry/ability-type/critical-strike.lua +91 -0
- package/engine/object-data/entry/ability-type/curse.d.ts +8 -0
- package/engine/object-data/entry/ability-type/curse.lua +26 -0
- package/engine/object-data/entry/ability-type/dark-summoning.d.ts +10 -0
- package/engine/object-data/entry/ability-type/dark-summoning.lua +39 -0
- package/engine/object-data/entry/ability-type/death-coil.d.ts +8 -0
- package/engine/object-data/entry/ability-type/death-coil.lua +26 -0
- package/engine/object-data/entry/ability-type/disease-cloud.d.ts +15 -0
- package/engine/object-data/entry/ability-type/disease-cloud.lua +65 -0
- package/engine/object-data/entry/ability-type/divine-shield.d.ts +5 -0
- package/engine/object-data/entry/ability-type/divine-shield.lua +12 -0
- package/engine/object-data/entry/ability-type/endurance-aura.d.ts +10 -0
- package/engine/object-data/entry/ability-type/endurance-aura.lua +39 -0
- package/engine/object-data/entry/ability-type/engineering-upgrade.d.ts +13 -0
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +88 -0
- package/engine/object-data/entry/ability-type/evasion.d.ts +8 -0
- package/engine/object-data/entry/ability-type/evasion.lua +26 -0
- package/engine/object-data/entry/ability-type/faerie-fire.d.ts +10 -0
- package/engine/object-data/entry/ability-type/faerie-fire.lua +39 -0
- package/engine/object-data/entry/ability-type/far-sight.d.ts +9 -0
- package/engine/object-data/entry/ability-type/far-sight.lua +26 -0
- package/engine/object-data/entry/ability-type/feral-spirit.d.ts +11 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +39 -0
- package/engine/object-data/entry/ability-type/frenzy.d.ts +12 -0
- package/engine/object-data/entry/ability-type/frenzy.lua +52 -0
- package/engine/object-data/entry/ability-type/frost-nova.d.ts +12 -0
- package/engine/object-data/entry/ability-type/frost-nova.lua +52 -0
- package/engine/object-data/entry/ability-type/ghost-visible.d.ts +10 -0
- package/engine/object-data/entry/ability-type/ghost-visible.lua +39 -0
- package/engine/object-data/entry/ability-type/gold-mine.d.ts +12 -0
- package/engine/object-data/entry/ability-type/gold-mine.lua +52 -0
- package/engine/object-data/entry/ability-type/heal.d.ts +8 -0
- package/engine/object-data/entry/ability-type/heal.lua +26 -0
- package/engine/object-data/entry/ability-type/healing-salve.d.ts +22 -0
- package/engine/object-data/entry/ability-type/healing-salve.lua +78 -0
- package/engine/object-data/entry/ability-type/healing-spray.d.ts +18 -0
- package/engine/object-data/entry/ability-type/healing-spray.lua +91 -0
- package/engine/object-data/entry/ability-type/healing-wave.d.ts +12 -0
- package/engine/object-data/entry/ability-type/healing-wave.lua +52 -0
- package/engine/object-data/entry/ability-type/holy-light.d.ts +8 -0
- package/engine/object-data/entry/ability-type/holy-light.lua +26 -0
- package/engine/object-data/entry/ability-type/incinerate.d.ts +18 -0
- package/engine/object-data/entry/ability-type/incinerate.lua +91 -0
- package/engine/object-data/entry/ability-type/inner-fire.d.ts +14 -0
- package/engine/object-data/entry/ability-type/inner-fire.lua +65 -0
- package/engine/object-data/entry/ability-type/inventory.d.ts +16 -0
- package/engine/object-data/entry/ability-type/inventory.lua +78 -0
- package/engine/object-data/entry/ability-type/invulnerable.d.ts +5 -0
- package/engine/object-data/entry/ability-type/invulnerable.lua +12 -0
- package/engine/object-data/entry/ability-type/lightning-shield.d.ts +8 -0
- package/engine/object-data/entry/ability-type/lightning-shield.lua +26 -0
- package/engine/object-data/entry/ability-type/movement-speed-increase.d.ts +8 -0
- package/engine/object-data/entry/ability-type/movement-speed-increase.lua +26 -0
- package/engine/object-data/entry/ability-type/permanent-immolation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-immolation.lua +26 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.d.ts +25 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +130 -0
- package/engine/object-data/entry/ability-type/recall.d.ts +10 -0
- package/engine/object-data/entry/ability-type/recall.lua +39 -0
- package/engine/object-data/entry/ability-type/rejuvenation.d.ts +20 -0
- package/engine/object-data/entry/ability-type/rejuvenation.lua +65 -0
- package/engine/object-data/entry/ability-type/searing-arrows.d.ts +8 -0
- package/engine/object-data/entry/ability-type/searing-arrows.lua +26 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +10 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +39 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +12 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +52 -0
- package/engine/object-data/entry/ability-type/slow.d.ts +12 -0
- package/engine/object-data/entry/ability-type/slow.lua +52 -0
- package/engine/object-data/entry/ability-type/spell-damage-reduction.d.ts +10 -0
- package/engine/object-data/entry/ability-type/spell-damage-reduction.lua +39 -0
- package/engine/object-data/entry/ability-type/spiked-carapace.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spiked-carapace.lua +52 -0
- package/engine/object-data/entry/ability-type/spirit-touch.d.ts +14 -0
- package/engine/object-data/entry/ability-type/spirit-touch.lua +65 -0
- package/engine/object-data/entry/ability-type/storm-bolt.d.ts +8 -0
- package/engine/object-data/entry/ability-type/storm-bolt.lua +26 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.d.ts +11 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +39 -0
- package/engine/object-data/entry/ability-type/summon-water-elemental.d.ts +11 -0
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +39 -0
- package/engine/object-data/entry/ability-type.d.ts +148 -0
- package/engine/object-data/entry/ability-type.lua +1058 -0
- package/engine/object-data/entry/buff-type/applicable.d.ts +16 -0
- package/engine/object-data/entry/buff-type/applicable.lua +377 -0
- package/engine/object-data/entry/buff-type/blank.d.ts +8 -0
- package/engine/object-data/entry/buff-type/blank.lua +17 -0
- package/engine/object-data/entry/buff-type.d.ts +64 -0
- package/engine/object-data/entry/buff-type.lua +316 -0
- package/engine/object-data/entry/destructible-type.d.ts +21 -0
- package/engine/object-data/entry/destructible-type.lua +83 -0
- package/engine/object-data/entry/item-type/blank.d.ts +8 -0
- package/engine/object-data/entry/item-type/blank.lua +21 -0
- package/engine/object-data/entry/item-type.d.ts +49 -0
- package/engine/object-data/entry/item-type.lua +259 -0
- package/engine/object-data/entry/lightning-type.d.ts +37 -0
- package/engine/object-data/entry/lightning-type.lua +191 -0
- package/engine/object-data/entry/unit-type/blank.d.ts +6 -0
- package/engine/object-data/entry/unit-type/blank.lua +13 -0
- package/engine/object-data/entry/unit-type.d.ts +218 -0
- package/engine/object-data/entry/unit-type.lua +1306 -0
- package/engine/object-data/entry/upgrade/blank.d.ts +8 -0
- package/engine/object-data/entry/upgrade/blank.lua +22 -0
- package/engine/object-data/entry/upgrade.d.ts +59 -0
- package/engine/object-data/entry/upgrade.lua +238 -0
- package/engine/object-data/entry.d.ts +80 -0
- package/engine/object-data/entry.lua +634 -0
- package/engine/object-data/utility/object-data-entry-id-generator.d.ts +6 -0
- package/engine/object-data/utility/object-data-entry-id-generator.lua +63 -0
- package/engine/object-data/utility/order-type-string-id-factory.d.ts +9 -0
- package/engine/object-data/utility/order-type-string-id-factory.lua +368 -0
- package/engine/object-field/ability.d.ts +115 -0
- package/engine/object-field/ability.lua +471 -0
- package/engine/object-field/unit.d.ts +15 -0
- package/engine/object-field/unit.lua +49 -0
- package/engine/object-field.d.ts +84 -0
- package/engine/object-field.lua +444 -0
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +9 -0
- package/engine/standard/entries/ability-type.d.ts +8 -0
- package/engine/standard/entries/ability-type.lua +8 -0
- package/engine/standard/entries/lightning-type.d.ts +16 -0
- package/engine/standard/entries/lightning-type.lua +16 -0
- package/engine/standard/entries/unit-type.d.ts +63 -0
- package/engine/standard/entries/unit-type.lua +63 -0
- package/engine/standard/entries/upgrade.d.ts +92 -0
- package/engine/standard/entries/upgrade.lua +92 -0
- package/engine/standard/fields/ability.d.ts +737 -0
- package/engine/standard/fields/ability.lua +749 -0
- package/engine/standard/pathing-textures.d.ts +6 -0
- package/engine/standard/pathing-textures.lua +7 -0
- package/engine/text-tag.d.ts +25 -0
- package/engine/text-tag.lua +109 -0
- package/engine/unit.d.ts +20 -0
- package/engine/unit.lua +31 -0
- package/event.d.ts +53 -0
- package/event.lua +269 -0
- package/exception.d.ts +17 -0
- package/exception.lua +53 -0
- package/file.d.ts +4 -0
- package/file.lua +42 -0
- package/global/math.d.ts +21 -0
- package/global/math.lua +72 -0
- package/global/vec2.d.ts +66 -0
- package/global/vec2.lua +159 -0
- package/index.d.ts +8 -0
- package/index.lua +9 -0
- package/lualib_bundle.lua +2629 -0
- package/math/vec2.d.ts +18 -0
- package/math/vec2.lua +42 -0
- package/math.d.ts +39 -0
- package/math.lua +91 -0
- package/net/signal.d.ts +11 -0
- package/net/signal.lua +56 -0
- package/net/socket.d.ts +9 -0
- package/net/socket.lua +26 -0
- package/network.d.ts +31 -0
- package/network.lua +194 -0
- package/objutil/ability.d.ts +710 -0
- package/objutil/ability.lua +3781 -0
- package/objutil/buff.d.ts +110 -0
- package/objutil/buff.lua +769 -0
- package/objutil/dummy.d.ts +2 -0
- package/objutil/dummy.lua +49 -0
- package/objutil/idgen.d.ts +9 -0
- package/objutil/idgen.lua +92 -0
- package/objutil/item.d.ts +38 -0
- package/objutil/item.lua +254 -0
- package/objutil/object.d.ts +43 -0
- package/objutil/object.lua +213 -0
- package/objutil/unit.d.ts +134 -0
- package/objutil/unit.lua +913 -0
- package/objutil/upgrade.d.ts +22 -0
- package/objutil/upgrade.lua +127 -0
- package/operation.d.ts +35 -0
- package/operation.lua +179 -0
- package/package.json +47 -0
- package/patch-lualib.d.ts +2 -0
- package/patch-lualib.lua +67 -0
- package/patch-natives.d.ts +11 -0
- package/patch-natives.lua +14 -0
- package/string.d.ts +106 -0
- package/string.lua +34 -0
- package/time/dayOfWeek.d.ts +97 -0
- package/time/dayOfWeek.lua +53 -0
- package/time/localDate.d.ts +145 -0
- package/time/localDate.lua +236 -0
- package/time/localDateTime.d.ts +133 -0
- package/time/localDateTime.lua +154 -0
- package/time/localTime.d.ts +87 -0
- package/time/localTime.lua +91 -0
- package/time/month.d.ts +146 -0
- package/time/month.lua +129 -0
- package/time/year.d.ts +117 -0
- package/time/year.lua +81 -0
- package/types.d.ts +13 -0
- package/types.lua +0 -0
- package/util/objectPool.d.ts +6 -0
- package/util/objectPool.lua +28 -0
- package/util/stream.d.ts +29 -0
- package/util/stream.lua +453 -0
- package/util/stringBuilder.d.ts +8 -0
- package/util/stringBuilder.lua +25 -0
- package/utility/arrays.d.ts +57 -0
- package/utility/arrays.lua +369 -0
- package/utility/base64.d.ts +23 -0
- package/utility/base64.lua +177 -0
- package/utility/bit-set.d.ts +18 -0
- package/utility/bit-set.lua +12 -0
- package/utility/functions.d.ts +5 -0
- package/utility/functions.lua +90 -0
- package/utility/json.d.ts +2 -0
- package/utility/json.lua +400 -0
- package/utility/linked-set.d.ts +49 -0
- package/utility/linked-set.lua +181 -0
- package/utility/lua-maps.d.ts +6 -0
- package/utility/lua-maps.lua +25 -0
- package/utility/lua-sets.d.ts +6 -0
- package/utility/lua-sets.lua +37 -0
- package/utility/lzw.d.ts +2 -0
- package/utility/lzw.lua +161 -0
- package/utility/observable-array.d.ts +17 -0
- package/utility/observable-array.lua +30 -0
- package/utility/preconditions.d.ts +23 -0
- package/utility/preconditions.lua +58 -0
- package/utility/records.d.ts +3 -0
- package/utility/records.lua +9 -0
- package/utility/reflection.d.ts +4 -0
- package/utility/reflection.lua +31 -0
- package/utility/strings.d.ts +2 -0
- package/utility/strings.lua +44 -0
- package/utility/types.d.ts +39 -0
- package/utility/types.lua +2 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local getUnitAbility = BlzGetUnitAbility
|
|
3
|
+
local unitAddAbility = UnitAddAbility
|
|
4
|
+
local unitMakeAbilityPermanent = UnitMakeAbilityPermanent
|
|
5
|
+
---
|
|
6
|
+
-- @internal For use by internal systems only.
|
|
7
|
+
____exports.addInternalAbility = function(unit, abilityTypeId)
|
|
8
|
+
if unitAddAbility(unit, abilityTypeId) then
|
|
9
|
+
unitMakeAbilityPermanent(unit, true, abilityTypeId)
|
|
10
|
+
end
|
|
11
|
+
return getUnitAbility(unit, abilityTypeId)
|
|
12
|
+
end
|
|
13
|
+
return ____exports
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { LightningTypeId } from "./object-data/entry/lightning-type";
|
|
3
|
+
import { Handle, HandleDestructor } from "../core/types/handle";
|
|
4
|
+
import { Unit } from "../core/types/unit";
|
|
5
|
+
declare const enum LightningPropertyKey {
|
|
6
|
+
CHECK_VISIBILITY = 100,
|
|
7
|
+
SOURCE_UNIT = 101,
|
|
8
|
+
TARGET_UNIT = 102,
|
|
9
|
+
SOURCE_X = 103,
|
|
10
|
+
SOURCE_Y = 104,
|
|
11
|
+
SOURCE_Z = 105,
|
|
12
|
+
TARGET_X = 106,
|
|
13
|
+
TARGET_Y = 107,
|
|
14
|
+
TARGET_Z = 108,
|
|
15
|
+
DURATION = 109
|
|
16
|
+
}
|
|
17
|
+
export type LightningConstructor<T extends Lightning> = typeof Lightning & (new (handle: jlightning, typeId: LightningTypeId) => T);
|
|
18
|
+
export declare class Lightning extends Handle<jlightning> {
|
|
19
|
+
readonly typeId: LightningTypeId;
|
|
20
|
+
private [LightningPropertyKey.CHECK_VISIBILITY]?;
|
|
21
|
+
private [LightningPropertyKey.SOURCE_UNIT]?;
|
|
22
|
+
private [LightningPropertyKey.TARGET_UNIT]?;
|
|
23
|
+
private [LightningPropertyKey.SOURCE_X]?;
|
|
24
|
+
private [LightningPropertyKey.SOURCE_Y]?;
|
|
25
|
+
private [LightningPropertyKey.SOURCE_Z]?;
|
|
26
|
+
private [LightningPropertyKey.TARGET_X]?;
|
|
27
|
+
private [LightningPropertyKey.TARGET_Y]?;
|
|
28
|
+
private [LightningPropertyKey.TARGET_Z]?;
|
|
29
|
+
private [LightningPropertyKey.DURATION]?;
|
|
30
|
+
constructor(handle: jlightning, typeId: LightningTypeId);
|
|
31
|
+
protected onDestroy(): HandleDestructor;
|
|
32
|
+
static create<T extends Lightning>(this: LightningConstructor<T>, typeId: LightningTypeId, ...parameters: [
|
|
33
|
+
...checkVisibility: [boolean] | [],
|
|
34
|
+
...sourceAndTarget: [sourceX: number, sourceY: number, targetX: number, targetY: number] | [
|
|
35
|
+
sourceX: number,
|
|
36
|
+
sourceY: number,
|
|
37
|
+
sourceZ: number,
|
|
38
|
+
targetX: number,
|
|
39
|
+
targetY: number,
|
|
40
|
+
targetZ: number
|
|
41
|
+
] | [
|
|
42
|
+
source: Unit,
|
|
43
|
+
...target: [targetX: number, targetY: number, ...targetZ: [number] | []] | [Unit]
|
|
44
|
+
] | [
|
|
45
|
+
...source: [sourceX: number, sourceY: number, ...sourceZ: [number] | []] | [Unit],
|
|
46
|
+
target: Unit
|
|
47
|
+
]
|
|
48
|
+
]): T;
|
|
49
|
+
static flash(...parameters: [...parameters: Parameters<(typeof Lightning)["create"]>, duration: number]): void;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local ____handle = require("core.types.handle")
|
|
6
|
+
local Handle = ____handle.Handle
|
|
7
|
+
local ____timer = require("core.types.timer")
|
|
8
|
+
local Timer = ____timer.Timer
|
|
9
|
+
local ____functions = require("utility.functions")
|
|
10
|
+
local forwardByN = ____functions.forwardByN
|
|
11
|
+
local ____unit_2Dmissile_2Ddata = require("engine.internal.unit-missile-data")
|
|
12
|
+
local MISSILE_DATA_BY_UNIT_TYPE_ID = ____unit_2Dmissile_2Ddata.MISSILE_DATA_BY_UNIT_TYPE_ID
|
|
13
|
+
local ____type = _G.type
|
|
14
|
+
local select = _G.select
|
|
15
|
+
local cos = math.cos
|
|
16
|
+
local rad = math.rad
|
|
17
|
+
local sin = math.sin
|
|
18
|
+
local addLightning = AddLightning
|
|
19
|
+
local addLightningEx = AddLightningEx
|
|
20
|
+
local moveLightningEx = MoveLightningEx
|
|
21
|
+
local destroyLightning = DestroyLightning
|
|
22
|
+
local getUnitFacing = GetUnitFacing
|
|
23
|
+
local getUnitTypeId = GetUnitTypeId
|
|
24
|
+
local getUnitX = GetUnitX
|
|
25
|
+
local getUnitY = GetUnitY
|
|
26
|
+
local getUnitZ = BlzGetUnitZ
|
|
27
|
+
local getUnitFlyHeight = GetUnitFlyHeight
|
|
28
|
+
local getLocationZ = GetLocationZ
|
|
29
|
+
local moveLocation = MoveLocation
|
|
30
|
+
local location = Location(0, 0)
|
|
31
|
+
local unitToUnitLightnings = setmetatable({}, {__mode = "k"})
|
|
32
|
+
local unitToPointLightnings = setmetatable({}, {__mode = "k"})
|
|
33
|
+
local pointToUnitLightnings = setmetatable({}, {__mode = "k"})
|
|
34
|
+
local temporaryLightnings = {}
|
|
35
|
+
local temporaryLightningsCount = 0
|
|
36
|
+
____exports.Lightning = __TS__Class()
|
|
37
|
+
local Lightning = ____exports.Lightning
|
|
38
|
+
Lightning.name = "Lightning"
|
|
39
|
+
__TS__ClassExtends(Lightning, Handle)
|
|
40
|
+
function Lightning.prototype.____constructor(self, handle, typeId)
|
|
41
|
+
Handle.prototype.____constructor(self, handle)
|
|
42
|
+
self.typeId = typeId
|
|
43
|
+
end
|
|
44
|
+
function Lightning.prototype.onDestroy(self)
|
|
45
|
+
unitToUnitLightnings[self] = nil
|
|
46
|
+
unitToPointLightnings[self] = nil
|
|
47
|
+
pointToUnitLightnings[self] = nil
|
|
48
|
+
destroyLightning(self.handle)
|
|
49
|
+
return Handle.prototype.onDestroy(self)
|
|
50
|
+
end
|
|
51
|
+
function Lightning.create(self, typeId, checkVisibility, sourceXOrSourceUnit, sourceYOrTargetXOrTargetUnit, sourceZOrTargetXOrTargetUnitOrTargetY, targetXOrTargetUnitOrTargetYOrTargetZ, targetY, targetZ)
|
|
52
|
+
if type(checkVisibility) ~= "boolean" then
|
|
53
|
+
return self:create(
|
|
54
|
+
typeId,
|
|
55
|
+
true,
|
|
56
|
+
checkVisibility,
|
|
57
|
+
sourceXOrSourceUnit,
|
|
58
|
+
sourceYOrTargetXOrTargetUnit,
|
|
59
|
+
sourceZOrTargetXOrTargetUnitOrTargetY,
|
|
60
|
+
targetXOrTargetUnitOrTargetYOrTargetZ,
|
|
61
|
+
targetY
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
if targetZ ~= nil then
|
|
65
|
+
return self:of(
|
|
66
|
+
addLightningEx(
|
|
67
|
+
util.id2s(typeId),
|
|
68
|
+
checkVisibility,
|
|
69
|
+
sourceXOrSourceUnit,
|
|
70
|
+
sourceYOrTargetXOrTargetUnit,
|
|
71
|
+
sourceZOrTargetXOrTargetUnitOrTargetY,
|
|
72
|
+
targetXOrTargetUnitOrTargetYOrTargetZ,
|
|
73
|
+
targetY,
|
|
74
|
+
targetZ
|
|
75
|
+
),
|
|
76
|
+
typeId
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
if targetXOrTargetUnitOrTargetYOrTargetZ ~= nil then
|
|
80
|
+
if ____type(targetXOrTargetUnitOrTargetYOrTargetZ) == "number" then
|
|
81
|
+
if ____type(sourceXOrSourceUnit) == "number" then
|
|
82
|
+
return self:of(
|
|
83
|
+
addLightning(
|
|
84
|
+
util.id2s(typeId),
|
|
85
|
+
checkVisibility,
|
|
86
|
+
sourceXOrSourceUnit,
|
|
87
|
+
sourceYOrTargetXOrTargetUnit,
|
|
88
|
+
sourceZOrTargetXOrTargetUnitOrTargetY,
|
|
89
|
+
targetXOrTargetUnitOrTargetYOrTargetZ
|
|
90
|
+
),
|
|
91
|
+
typeId
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
local unit = sourceXOrSourceUnit.handle
|
|
95
|
+
local lightning = self:of(
|
|
96
|
+
addLightningEx(
|
|
97
|
+
util.id2s(typeId),
|
|
98
|
+
checkVisibility,
|
|
99
|
+
getUnitX(unit),
|
|
100
|
+
getUnitY(unit),
|
|
101
|
+
getUnitZ(unit),
|
|
102
|
+
sourceYOrTargetXOrTargetUnit,
|
|
103
|
+
sourceZOrTargetXOrTargetUnitOrTargetY,
|
|
104
|
+
targetXOrTargetUnitOrTargetYOrTargetZ
|
|
105
|
+
),
|
|
106
|
+
typeId
|
|
107
|
+
)
|
|
108
|
+
lightning[100] = checkVisibility
|
|
109
|
+
lightning[101] = unit
|
|
110
|
+
lightning[103] = 0
|
|
111
|
+
lightning[104] = 0
|
|
112
|
+
lightning[105] = 0
|
|
113
|
+
lightning[106] = sourceYOrTargetXOrTargetUnit
|
|
114
|
+
lightning[107] = sourceZOrTargetXOrTargetUnitOrTargetY
|
|
115
|
+
lightning[108] = targetXOrTargetUnitOrTargetYOrTargetZ
|
|
116
|
+
unitToPointLightnings[lightning] = true
|
|
117
|
+
return lightning
|
|
118
|
+
end
|
|
119
|
+
local unit = targetXOrTargetUnitOrTargetYOrTargetZ.handle
|
|
120
|
+
local lightning = self:of(
|
|
121
|
+
addLightningEx(
|
|
122
|
+
util.id2s(typeId),
|
|
123
|
+
checkVisibility,
|
|
124
|
+
sourceXOrSourceUnit,
|
|
125
|
+
sourceYOrTargetXOrTargetUnit,
|
|
126
|
+
sourceZOrTargetXOrTargetUnitOrTargetY,
|
|
127
|
+
getUnitX(unit),
|
|
128
|
+
getUnitY(unit),
|
|
129
|
+
getUnitZ(unit)
|
|
130
|
+
),
|
|
131
|
+
typeId
|
|
132
|
+
)
|
|
133
|
+
lightning[100] = checkVisibility
|
|
134
|
+
lightning[103] = sourceXOrSourceUnit
|
|
135
|
+
lightning[104] = sourceYOrTargetXOrTargetUnit
|
|
136
|
+
lightning[105] = sourceZOrTargetXOrTargetUnitOrTargetY
|
|
137
|
+
lightning[102] = unit
|
|
138
|
+
lightning[106] = 0
|
|
139
|
+
lightning[107] = 0
|
|
140
|
+
lightning[108] = 0
|
|
141
|
+
pointToUnitLightnings[lightning] = true
|
|
142
|
+
return lightning
|
|
143
|
+
end
|
|
144
|
+
if sourceZOrTargetXOrTargetUnitOrTargetY then
|
|
145
|
+
if ____type(sourceZOrTargetXOrTargetUnitOrTargetY) == "number" then
|
|
146
|
+
local unit = sourceXOrSourceUnit.handle
|
|
147
|
+
moveLocation(location, sourceYOrTargetXOrTargetUnit, sourceZOrTargetXOrTargetUnitOrTargetY)
|
|
148
|
+
local z = getLocationZ(location)
|
|
149
|
+
local lightning = self:of(
|
|
150
|
+
addLightningEx(
|
|
151
|
+
util.id2s(typeId),
|
|
152
|
+
checkVisibility,
|
|
153
|
+
getUnitX(unit),
|
|
154
|
+
getUnitY(unit),
|
|
155
|
+
getUnitZ(unit),
|
|
156
|
+
sourceYOrTargetXOrTargetUnit,
|
|
157
|
+
sourceZOrTargetXOrTargetUnitOrTargetY,
|
|
158
|
+
z
|
|
159
|
+
),
|
|
160
|
+
typeId
|
|
161
|
+
)
|
|
162
|
+
lightning[100] = checkVisibility
|
|
163
|
+
lightning[101] = unit
|
|
164
|
+
lightning[103] = 0
|
|
165
|
+
lightning[104] = 0
|
|
166
|
+
lightning[105] = 0
|
|
167
|
+
lightning[106] = sourceYOrTargetXOrTargetUnit
|
|
168
|
+
lightning[107] = sourceZOrTargetXOrTargetUnitOrTargetY
|
|
169
|
+
lightning[108] = z
|
|
170
|
+
unitToPointLightnings[lightning] = true
|
|
171
|
+
return lightning
|
|
172
|
+
end
|
|
173
|
+
local unit = sourceZOrTargetXOrTargetUnitOrTargetY.handle
|
|
174
|
+
moveLocation(location, sourceXOrSourceUnit, sourceYOrTargetXOrTargetUnit)
|
|
175
|
+
local z = getLocationZ(location)
|
|
176
|
+
local lightning = self:of(
|
|
177
|
+
addLightningEx(
|
|
178
|
+
util.id2s(typeId),
|
|
179
|
+
checkVisibility,
|
|
180
|
+
sourceXOrSourceUnit,
|
|
181
|
+
sourceYOrTargetXOrTargetUnit,
|
|
182
|
+
z,
|
|
183
|
+
getUnitX(unit),
|
|
184
|
+
getUnitY(unit),
|
|
185
|
+
getUnitZ(unit)
|
|
186
|
+
),
|
|
187
|
+
typeId
|
|
188
|
+
)
|
|
189
|
+
lightning[100] = checkVisibility
|
|
190
|
+
lightning[103] = sourceXOrSourceUnit
|
|
191
|
+
lightning[104] = sourceYOrTargetXOrTargetUnit
|
|
192
|
+
lightning[105] = z
|
|
193
|
+
lightning[102] = unit
|
|
194
|
+
lightning[106] = 0
|
|
195
|
+
lightning[107] = 0
|
|
196
|
+
lightning[108] = 0
|
|
197
|
+
pointToUnitLightnings[lightning] = true
|
|
198
|
+
return lightning
|
|
199
|
+
end
|
|
200
|
+
local sourceUnit = sourceXOrSourceUnit.handle
|
|
201
|
+
local targetUnit = sourceYOrTargetXOrTargetUnit.handle
|
|
202
|
+
local lightning = self:of(
|
|
203
|
+
addLightningEx(
|
|
204
|
+
util.id2s(typeId),
|
|
205
|
+
checkVisibility,
|
|
206
|
+
getUnitX(sourceUnit),
|
|
207
|
+
getUnitY(sourceUnit),
|
|
208
|
+
getUnitZ(sourceUnit) + getUnitFlyHeight(sourceUnit),
|
|
209
|
+
getUnitX(targetUnit),
|
|
210
|
+
getUnitY(targetUnit),
|
|
211
|
+
getUnitZ(targetUnit) + getUnitFlyHeight(targetUnit)
|
|
212
|
+
),
|
|
213
|
+
typeId
|
|
214
|
+
)
|
|
215
|
+
lightning[100] = checkVisibility
|
|
216
|
+
lightning[101] = sourceUnit
|
|
217
|
+
lightning[103] = 0
|
|
218
|
+
lightning[104] = 0
|
|
219
|
+
lightning[105] = 0
|
|
220
|
+
lightning[102] = targetUnit
|
|
221
|
+
lightning[106] = 0
|
|
222
|
+
lightning[107] = 0
|
|
223
|
+
lightning[108] = 0
|
|
224
|
+
unitToUnitLightnings[lightning] = true
|
|
225
|
+
return lightning
|
|
226
|
+
end
|
|
227
|
+
function Lightning.flash(self, ...)
|
|
228
|
+
local parametersToForwardCount = select("#", ...) - 1
|
|
229
|
+
local lightning = forwardByN[parametersToForwardCount](____exports.Lightning.create, self, ...)
|
|
230
|
+
local duration = select(-1, ...)
|
|
231
|
+
lightning[109] = duration
|
|
232
|
+
temporaryLightningsCount = temporaryLightningsCount + 1
|
|
233
|
+
temporaryLightnings[temporaryLightningsCount] = lightning
|
|
234
|
+
end
|
|
235
|
+
local UPDATE_PERIOD = 1 / 64
|
|
236
|
+
Timer.onPeriod[UPDATE_PERIOD]:addListener(function()
|
|
237
|
+
for lightning in pairs(unitToUnitLightnings) do
|
|
238
|
+
local sourceUnit, targetUnit = lightning[101], lightning[102]
|
|
239
|
+
local sourceUnitMissileData = MISSILE_DATA_BY_UNIT_TYPE_ID[getUnitTypeId(sourceUnit)]
|
|
240
|
+
local sourceUnitFacing = rad(getUnitFacing(sourceUnit) - 90)
|
|
241
|
+
local sourceUnitFacingCos = cos(sourceUnitFacing)
|
|
242
|
+
local sourceUnitFacingSin = sin(sourceUnitFacing)
|
|
243
|
+
local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.launchVisualOffsetX + lightning[103]
|
|
244
|
+
local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.launchVisualOffsetY + lightning[104]
|
|
245
|
+
moveLightningEx(
|
|
246
|
+
lightning.handle,
|
|
247
|
+
lightning[100],
|
|
248
|
+
getUnitX(sourceUnit) + sourceUnitFacingCos * sourceUnitOffsetX - sourceUnitFacingSin * sourceUnitOffsetY,
|
|
249
|
+
getUnitY(sourceUnit) + sourceUnitFacingSin * sourceUnitOffsetX + sourceUnitFacingCos * sourceUnitOffsetY,
|
|
250
|
+
getUnitZ(sourceUnit) + getUnitFlyHeight(sourceUnit) + sourceUnitMissileData.launchOffsetZ + lightning[105],
|
|
251
|
+
getUnitX(targetUnit) + lightning[106],
|
|
252
|
+
getUnitY(targetUnit) + lightning[107],
|
|
253
|
+
getUnitZ(targetUnit) + getUnitFlyHeight(targetUnit) + MISSILE_DATA_BY_UNIT_TYPE_ID[getUnitTypeId(targetUnit)].impactOffsetZ + lightning[108]
|
|
254
|
+
)
|
|
255
|
+
end
|
|
256
|
+
for lightning in pairs(unitToPointLightnings) do
|
|
257
|
+
local sourceUnit = lightning[101]
|
|
258
|
+
local sourceUnitMissileData = MISSILE_DATA_BY_UNIT_TYPE_ID[getUnitTypeId(sourceUnit)]
|
|
259
|
+
local sourceUnitFacing = rad(getUnitFacing(sourceUnit) - 90)
|
|
260
|
+
local sourceUnitFacingCos = cos(sourceUnitFacing)
|
|
261
|
+
local sourceUnitFacingSin = sin(sourceUnitFacing)
|
|
262
|
+
local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.launchVisualOffsetX + lightning[103]
|
|
263
|
+
local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.launchVisualOffsetY + lightning[104]
|
|
264
|
+
moveLightningEx(
|
|
265
|
+
lightning.handle,
|
|
266
|
+
lightning[100],
|
|
267
|
+
getUnitX(sourceUnit) + sourceUnitFacingCos * sourceUnitOffsetX - sourceUnitFacingSin * sourceUnitOffsetY,
|
|
268
|
+
getUnitY(sourceUnit) + sourceUnitFacingSin * sourceUnitOffsetX + sourceUnitFacingCos * sourceUnitOffsetY,
|
|
269
|
+
getUnitZ(sourceUnit) + getUnitFlyHeight(sourceUnit) + lightning[105],
|
|
270
|
+
lightning[106],
|
|
271
|
+
lightning[107],
|
|
272
|
+
lightning[108]
|
|
273
|
+
)
|
|
274
|
+
end
|
|
275
|
+
for lightning in pairs(pointToUnitLightnings) do
|
|
276
|
+
local targetUnit = lightning[102]
|
|
277
|
+
moveLightningEx(
|
|
278
|
+
lightning.handle,
|
|
279
|
+
lightning[100],
|
|
280
|
+
lightning[103],
|
|
281
|
+
lightning[104],
|
|
282
|
+
lightning[105],
|
|
283
|
+
getUnitX(targetUnit) + lightning[106],
|
|
284
|
+
getUnitY(targetUnit) + lightning[107],
|
|
285
|
+
getUnitZ(targetUnit) + getUnitFlyHeight(targetUnit) + MISSILE_DATA_BY_UNIT_TYPE_ID[getUnitTypeId(targetUnit)].impactOffsetZ + lightning[108]
|
|
286
|
+
)
|
|
287
|
+
end
|
|
288
|
+
local i = 1
|
|
289
|
+
while i <= temporaryLightningsCount do
|
|
290
|
+
local lightning = temporaryLightnings[i]
|
|
291
|
+
local duration = lightning[109]
|
|
292
|
+
if duration <= 0 then
|
|
293
|
+
lightning:destroy()
|
|
294
|
+
temporaryLightnings[i] = temporaryLightnings[temporaryLightningsCount]
|
|
295
|
+
temporaryLightnings[temporaryLightningsCount] = nil
|
|
296
|
+
temporaryLightningsCount = temporaryLightningsCount - 1
|
|
297
|
+
else
|
|
298
|
+
lightning[109] = duration - UPDATE_PERIOD
|
|
299
|
+
i = i + 1
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
end)
|
|
303
|
+
return ____exports
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { Unit } from "../core/types/unit";
|
|
3
|
+
import { Async } from "../core/types/async";
|
|
4
|
+
import { TriggerEvent } from "../event";
|
|
5
|
+
import { GraphicsMode } from "./index";
|
|
6
|
+
export declare class LocalClient {
|
|
7
|
+
private constructor();
|
|
8
|
+
static readonly locale: string;
|
|
9
|
+
static get width(): number;
|
|
10
|
+
static get height(): number;
|
|
11
|
+
static get isHD(): boolean;
|
|
12
|
+
static get graphicsMode(): GraphicsMode;
|
|
13
|
+
static get isActive(): boolean;
|
|
14
|
+
static get mouseFocusUnit(): Async<Unit>;
|
|
15
|
+
static readonly onDisconnect: TriggerEvent<[]>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
4
|
+
local __TS__New = ____lualib.__TS__New
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local ____unit = require("core.types.unit")
|
|
7
|
+
local Unit = ____unit.Unit
|
|
8
|
+
local ____event = require("event")
|
|
9
|
+
local TriggerEvent = ____event.TriggerEvent
|
|
10
|
+
local loadTOCFile = BlzLoadTOCFile
|
|
11
|
+
local getLocalClientWidth = BlzGetLocalClientWidth
|
|
12
|
+
local getLocalClientHeight = BlzGetLocalClientHeight
|
|
13
|
+
local isLocalClientActive = BlzIsLocalClientActive
|
|
14
|
+
local getMouseFocusUnit = BlzGetMouseFocusUnit
|
|
15
|
+
local getLocale = BlzGetLocale
|
|
16
|
+
local tocPath = "_warscript\\IsHD.toc"
|
|
17
|
+
compiletime(function()
|
|
18
|
+
if currentMap then
|
|
19
|
+
local fdfPath = "_warscript\\IsHD.fdf"
|
|
20
|
+
currentMap:addFileString("_HD.w3mod\\" .. fdfPath, "\r\n")
|
|
21
|
+
currentMap:addFileString("_HD.w3mod\\" .. tocPath, fdfPath .. "\r\n")
|
|
22
|
+
end
|
|
23
|
+
end)
|
|
24
|
+
____exports.LocalClient = __TS__Class()
|
|
25
|
+
local LocalClient = ____exports.LocalClient
|
|
26
|
+
LocalClient.name = "LocalClient"
|
|
27
|
+
function LocalClient.prototype.____constructor(self)
|
|
28
|
+
end
|
|
29
|
+
LocalClient.locale = getLocale()
|
|
30
|
+
__TS__ObjectDefineProperty(
|
|
31
|
+
LocalClient,
|
|
32
|
+
"width",
|
|
33
|
+
{get = function(self)
|
|
34
|
+
return getLocalClientWidth()
|
|
35
|
+
end}
|
|
36
|
+
)
|
|
37
|
+
__TS__ObjectDefineProperty(
|
|
38
|
+
LocalClient,
|
|
39
|
+
"height",
|
|
40
|
+
{get = function(self)
|
|
41
|
+
return getLocalClientHeight()
|
|
42
|
+
end}
|
|
43
|
+
)
|
|
44
|
+
__TS__ObjectDefineProperty(
|
|
45
|
+
LocalClient,
|
|
46
|
+
"isHD",
|
|
47
|
+
{get = function(self)
|
|
48
|
+
return false
|
|
49
|
+
end}
|
|
50
|
+
)
|
|
51
|
+
__TS__ObjectDefineProperty(
|
|
52
|
+
LocalClient,
|
|
53
|
+
"graphicsMode",
|
|
54
|
+
{get = function(self)
|
|
55
|
+
return self.isHD and 1 or 0
|
|
56
|
+
end}
|
|
57
|
+
)
|
|
58
|
+
__TS__ObjectDefineProperty(
|
|
59
|
+
LocalClient,
|
|
60
|
+
"isActive",
|
|
61
|
+
{get = function(self)
|
|
62
|
+
return isLocalClientActive()
|
|
63
|
+
end}
|
|
64
|
+
)
|
|
65
|
+
__TS__ObjectDefineProperty(
|
|
66
|
+
LocalClient,
|
|
67
|
+
"mouseFocusUnit",
|
|
68
|
+
{get = function(self)
|
|
69
|
+
return Unit:of(getMouseFocusUnit())
|
|
70
|
+
end}
|
|
71
|
+
)
|
|
72
|
+
LocalClient.onDisconnect = __TS__New(
|
|
73
|
+
TriggerEvent,
|
|
74
|
+
function(trigger)
|
|
75
|
+
TriggerRegisterGameStateEvent(trigger, GAME_STATE_DISCONNECTED, NOT_EQUAL, 0)
|
|
76
|
+
end,
|
|
77
|
+
function() return end
|
|
78
|
+
)
|
|
79
|
+
warpack.afterMapInit(function()
|
|
80
|
+
rawset(
|
|
81
|
+
____exports.LocalClient,
|
|
82
|
+
"isHD",
|
|
83
|
+
loadTOCFile(tocPath)
|
|
84
|
+
)
|
|
85
|
+
end)
|
|
86
|
+
return ____exports
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
export declare const enum AnimationName {
|
|
3
|
+
ATTACK = "attack",
|
|
4
|
+
BIRTH = "birth",
|
|
5
|
+
DEATH = "death",
|
|
6
|
+
DECAY = "decay",
|
|
7
|
+
DISSIPATE = "dissipate",
|
|
8
|
+
MORPH = "morph",
|
|
9
|
+
PORTRAIT = "portrait",
|
|
10
|
+
SLEEP = "sleep",
|
|
11
|
+
SPELL = "spell",
|
|
12
|
+
STAND = "stand",
|
|
13
|
+
WALK = "walk"
|
|
14
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
export declare const enum AnimationQualifier {
|
|
3
|
+
ALTERNATE = "alternate",
|
|
4
|
+
ALTERNATE_EX = "alternateex",
|
|
5
|
+
CHAIN = "chain",
|
|
6
|
+
CHANNEL = "channel",
|
|
7
|
+
COMPLETE = "complete",
|
|
8
|
+
CRITICAL = "critical",
|
|
9
|
+
DEFEND = "defend",
|
|
10
|
+
DRAIN = "drain",
|
|
11
|
+
EAT_TREE = "eattree",
|
|
12
|
+
FAST = "fast",
|
|
13
|
+
FILL = "fill",
|
|
14
|
+
FLAIL = "flail",
|
|
15
|
+
FLESH = "flesh",
|
|
16
|
+
FIFTH = "fifth",
|
|
17
|
+
FIRE = "fire",
|
|
18
|
+
FIRST = "first",
|
|
19
|
+
FIVE = "five",
|
|
20
|
+
FOUR = "four",
|
|
21
|
+
FOURTH = "fourth",
|
|
22
|
+
GOLD = "gold",
|
|
23
|
+
HIT = "hit",
|
|
24
|
+
LARGE = "large",
|
|
25
|
+
LEFT = "left",
|
|
26
|
+
LIGHT = "light",
|
|
27
|
+
LOOPING = "looping",
|
|
28
|
+
LUMBER = "lumber",
|
|
29
|
+
MEDIUM = "medium",
|
|
30
|
+
MODERATE = "moderate",
|
|
31
|
+
OFF = "off",
|
|
32
|
+
ONE = "one",
|
|
33
|
+
PUKE = "puke",
|
|
34
|
+
READY = "ready",
|
|
35
|
+
RIGHT = "right",
|
|
36
|
+
SECOND = "second",
|
|
37
|
+
SEVERE = "severe",
|
|
38
|
+
SLAM = "slam",
|
|
39
|
+
SMALL = "small",
|
|
40
|
+
SPIKED = "spiked",
|
|
41
|
+
SPIN = "spin",
|
|
42
|
+
SWIM = "swim",
|
|
43
|
+
TALK = "talk",
|
|
44
|
+
THIRD = "third",
|
|
45
|
+
THREE = "three",
|
|
46
|
+
THROW = "throw",
|
|
47
|
+
TWO = "two",
|
|
48
|
+
TURN = "turn",
|
|
49
|
+
VICTORY = "victory",
|
|
50
|
+
WORK = "work",
|
|
51
|
+
WOUNDED = "wounded",
|
|
52
|
+
UPGRADE = "upgrade"
|
|
53
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
|
+
/** @noSelfInFile */
|
|
3
|
+
import { ModelNodeName } from "./model-node-name";
|
|
4
|
+
import { ModelNodeQualifier } from "./model-node-qualifier";
|
|
5
|
+
import { Optional } from "../../../utility/types";
|
|
6
|
+
export type AttachmentPreset = {
|
|
7
|
+
modelPath: string;
|
|
8
|
+
nodeName: ModelNodeName;
|
|
9
|
+
nodeQualifiers: ModelNodeQualifier[];
|
|
10
|
+
};
|
|
11
|
+
export type AttachmentPresetInput = Optional<AttachmentPreset, "nodeQualifiers"> | string;
|
|
12
|
+
export declare const toAttachmentPreset: (attachmentPresetInput: AttachmentPresetInput) => AttachmentPreset;
|
|
13
|
+
export declare const extractAttachmentPresetInputModelPath: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
|
|
14
|
+
export declare const extractAttachmentPresetInputNodeFQN: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
|
|
15
|
+
export declare const splitAttachmentNodeFQN: (attachmentNodeFQN: string) => LuaMultiReturn<[attachmentNodeName: ModelNodeName, attachmentNodeQualifiers: ModelNodeQualifier[]]>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__StringSplit = ____lualib.__TS__StringSplit
|
|
3
|
+
local __TS__ArraySlice = ____lualib.__TS__ArraySlice
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
____exports.toAttachmentPreset = function(attachmentPresetInput)
|
|
6
|
+
return type(attachmentPresetInput) == "string" and ({modelPath = attachmentPresetInput, nodeName = "origin", nodeQualifiers = {}}) or ({modelPath = attachmentPresetInput.modelPath, nodeName = attachmentPresetInput.nodeName, nodeQualifiers = attachmentPresetInput.nodeQualifiers or ({})})
|
|
7
|
+
end
|
|
8
|
+
____exports.extractAttachmentPresetInputModelPath = function(attachmentPresetInput)
|
|
9
|
+
return type(attachmentPresetInput) == "string" and attachmentPresetInput or (attachmentPresetInput and attachmentPresetInput.modelPath or "")
|
|
10
|
+
end
|
|
11
|
+
____exports.extractAttachmentPresetInputNodeFQN = function(attachmentPresetInput)
|
|
12
|
+
if type(attachmentPresetInput) == "string" or attachmentPresetInput == nil then
|
|
13
|
+
return ""
|
|
14
|
+
end
|
|
15
|
+
return table.concat(
|
|
16
|
+
{
|
|
17
|
+
attachmentPresetInput.nodeName,
|
|
18
|
+
table.unpack(attachmentPresetInput.nodeQualifiers or ({}))
|
|
19
|
+
},
|
|
20
|
+
","
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
____exports.splitAttachmentNodeFQN = function(attachmentNodeFQN)
|
|
24
|
+
local ____TS__StringSplit_result_2 = __TS__StringSplit(attachmentNodeFQN, ",")
|
|
25
|
+
local attachmentNodeName = ____TS__StringSplit_result_2[1]
|
|
26
|
+
local attachmentNodeQualifiers = __TS__ArraySlice(____TS__StringSplit_result_2, 1)
|
|
27
|
+
return attachmentNodeName == "" and "origin" or attachmentNodeName, attachmentNodeQualifiers
|
|
28
|
+
end
|
|
29
|
+
return ____exports
|