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,69 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { Widget } from "../../core/types/widget";
|
|
3
|
+
export type AttackType = jattacktype;
|
|
4
|
+
export declare namespace AttackType {
|
|
5
|
+
const SPELL: jattacktype;
|
|
6
|
+
const NORMAL: jattacktype;
|
|
7
|
+
const PIERCE: jattacktype;
|
|
8
|
+
const SIEGE: jattacktype;
|
|
9
|
+
const MAGIC: jattacktype;
|
|
10
|
+
const CHAOS: jattacktype;
|
|
11
|
+
const HERO: jattacktype;
|
|
12
|
+
}
|
|
13
|
+
export type DamageType = jdamagetype;
|
|
14
|
+
export declare namespace DamageType {
|
|
15
|
+
const UNKNOWN: jdamagetype;
|
|
16
|
+
const NORMAL: jdamagetype;
|
|
17
|
+
const ENHANCED: jdamagetype;
|
|
18
|
+
const FIRE: jdamagetype;
|
|
19
|
+
const COLD: jdamagetype;
|
|
20
|
+
const LIGHTNING: jdamagetype;
|
|
21
|
+
const POISON: jdamagetype;
|
|
22
|
+
const DISEASE: jdamagetype;
|
|
23
|
+
const DIVINE: jdamagetype;
|
|
24
|
+
const MAGIC: jdamagetype;
|
|
25
|
+
const SONIC: jdamagetype;
|
|
26
|
+
const ACID: jdamagetype;
|
|
27
|
+
const FORCE: jdamagetype;
|
|
28
|
+
const DEATH: jdamagetype;
|
|
29
|
+
const MIND: jdamagetype;
|
|
30
|
+
const PLANT: jdamagetype;
|
|
31
|
+
const DEFENSIVE: jdamagetype;
|
|
32
|
+
const DEMOLITION: jdamagetype;
|
|
33
|
+
const SLOW_POISON: jdamagetype;
|
|
34
|
+
const SPIRIT_LINK: jdamagetype;
|
|
35
|
+
const SHADOW_STRIKE: jdamagetype;
|
|
36
|
+
const UNIVERSAL: jdamagetype;
|
|
37
|
+
}
|
|
38
|
+
export type WeaponType = jweapontype;
|
|
39
|
+
export declare namespace WeaponType {
|
|
40
|
+
const UNKNOWN: jweapontype;
|
|
41
|
+
const METAL_LIGHT_CHOP: jweapontype;
|
|
42
|
+
const METAL_MEDIUM_CHOP: jweapontype;
|
|
43
|
+
const METAL_HEAVY_CHOP: jweapontype;
|
|
44
|
+
const METAL_LIGHT_SLICE: jweapontype;
|
|
45
|
+
const METAL_MEDIUM_SLICE: jweapontype;
|
|
46
|
+
const METAL_HEAVY_SLICE: jweapontype;
|
|
47
|
+
const METAL_MEDIUM_BASH: jweapontype;
|
|
48
|
+
const METAL_HEAVY_BASH: jweapontype;
|
|
49
|
+
const METAL_MEDIUM_STAB: jweapontype;
|
|
50
|
+
const METAL_HEAVY_STAB: jweapontype;
|
|
51
|
+
const WOOD_LIGHT_SLICE: jweapontype;
|
|
52
|
+
const WOOD_MEDIUM_SLICE: jweapontype;
|
|
53
|
+
const WOOD_HEAVY_SLICE: jweapontype;
|
|
54
|
+
const WOOD_LIGHT_BASH: jweapontype;
|
|
55
|
+
const WOOD_MEDIUM_BASH: jweapontype;
|
|
56
|
+
const WOOD_HEAVY_BASH: jweapontype;
|
|
57
|
+
const WOOD_LIGHT_STAB: jweapontype;
|
|
58
|
+
const WOOD_MEDIUM_STAB: jweapontype;
|
|
59
|
+
const CLAW_LIGHT_SLICE: jweapontype;
|
|
60
|
+
const CLAW_MEDIUM_SLICE: jweapontype;
|
|
61
|
+
const CLAW_HEAVY_SLICE: jweapontype;
|
|
62
|
+
const AXE_MEDIUM_CHOP: jweapontype;
|
|
63
|
+
const ROCK_HEAVY_BASH: jweapontype;
|
|
64
|
+
}
|
|
65
|
+
declare module "./unit" {
|
|
66
|
+
interface Unit {
|
|
67
|
+
damageTarget(target: Widget, amount: number, attack?: boolean, ranged?: boolean, attackType?: AttackType, damageType?: DamageType, weaponType?: WeaponType): boolean;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local ____unit = require("engine.internal.unit")
|
|
5
|
+
local Unit = ____unit.Unit
|
|
6
|
+
local ____player = require("core.types.player")
|
|
7
|
+
local Player = ____player.Player
|
|
8
|
+
local ____dummy = require("objutil.dummy")
|
|
9
|
+
local dummyUnitId = ____dummy.dummyUnitId
|
|
10
|
+
local createUnit = CreateUnit
|
|
11
|
+
local getOwningPlayer = GetOwningPlayer
|
|
12
|
+
local showUnit = ShowUnit
|
|
13
|
+
local unitDamageTarget = UnitDamageTarget
|
|
14
|
+
____exports.AttackType = {}
|
|
15
|
+
local AttackType = ____exports.AttackType
|
|
16
|
+
do
|
|
17
|
+
AttackType.SPELL = ATTACK_TYPE_NORMAL
|
|
18
|
+
AttackType.NORMAL = ATTACK_TYPE_MELEE
|
|
19
|
+
AttackType.PIERCE = ATTACK_TYPE_PIERCE
|
|
20
|
+
AttackType.SIEGE = ATTACK_TYPE_SIEGE
|
|
21
|
+
AttackType.MAGIC = ATTACK_TYPE_MAGIC
|
|
22
|
+
AttackType.CHAOS = ATTACK_TYPE_CHAOS
|
|
23
|
+
AttackType.HERO = ATTACK_TYPE_HERO
|
|
24
|
+
end
|
|
25
|
+
____exports.DamageType = {}
|
|
26
|
+
local DamageType = ____exports.DamageType
|
|
27
|
+
do
|
|
28
|
+
DamageType.UNKNOWN = DAMAGE_TYPE_UNKNOWN
|
|
29
|
+
DamageType.NORMAL = DAMAGE_TYPE_NORMAL
|
|
30
|
+
DamageType.ENHANCED = DAMAGE_TYPE_ENHANCED
|
|
31
|
+
DamageType.FIRE = DAMAGE_TYPE_FIRE
|
|
32
|
+
DamageType.COLD = DAMAGE_TYPE_COLD
|
|
33
|
+
DamageType.LIGHTNING = DAMAGE_TYPE_LIGHTNING
|
|
34
|
+
DamageType.POISON = DAMAGE_TYPE_POISON
|
|
35
|
+
DamageType.DISEASE = DAMAGE_TYPE_DISEASE
|
|
36
|
+
DamageType.DIVINE = DAMAGE_TYPE_DIVINE
|
|
37
|
+
DamageType.MAGIC = DAMAGE_TYPE_MAGIC
|
|
38
|
+
DamageType.SONIC = DAMAGE_TYPE_SONIC
|
|
39
|
+
DamageType.ACID = DAMAGE_TYPE_ACID
|
|
40
|
+
DamageType.FORCE = DAMAGE_TYPE_FORCE
|
|
41
|
+
DamageType.DEATH = DAMAGE_TYPE_DEATH
|
|
42
|
+
DamageType.MIND = DAMAGE_TYPE_MIND
|
|
43
|
+
DamageType.PLANT = DAMAGE_TYPE_PLANT
|
|
44
|
+
DamageType.DEFENSIVE = DAMAGE_TYPE_DEFENSIVE
|
|
45
|
+
DamageType.DEMOLITION = DAMAGE_TYPE_DEMOLITION
|
|
46
|
+
DamageType.SLOW_POISON = DAMAGE_TYPE_SLOW_POISON
|
|
47
|
+
DamageType.SPIRIT_LINK = DAMAGE_TYPE_SPIRIT_LINK
|
|
48
|
+
DamageType.SHADOW_STRIKE = DAMAGE_TYPE_SHADOW_STRIKE
|
|
49
|
+
DamageType.UNIVERSAL = DAMAGE_TYPE_UNIVERSAL
|
|
50
|
+
end
|
|
51
|
+
____exports.WeaponType = {}
|
|
52
|
+
local WeaponType = ____exports.WeaponType
|
|
53
|
+
do
|
|
54
|
+
WeaponType.UNKNOWN = WEAPON_TYPE_WHOKNOWS
|
|
55
|
+
WeaponType.METAL_LIGHT_CHOP = WEAPON_TYPE_METAL_LIGHT_CHOP
|
|
56
|
+
WeaponType.METAL_MEDIUM_CHOP = WEAPON_TYPE_METAL_MEDIUM_CHOP
|
|
57
|
+
WeaponType.METAL_HEAVY_CHOP = WEAPON_TYPE_METAL_HEAVY_CHOP
|
|
58
|
+
WeaponType.METAL_LIGHT_SLICE = WEAPON_TYPE_METAL_LIGHT_SLICE
|
|
59
|
+
WeaponType.METAL_MEDIUM_SLICE = WEAPON_TYPE_METAL_MEDIUM_SLICE
|
|
60
|
+
WeaponType.METAL_HEAVY_SLICE = WEAPON_TYPE_METAL_HEAVY_SLICE
|
|
61
|
+
WeaponType.METAL_MEDIUM_BASH = WEAPON_TYPE_METAL_MEDIUM_BASH
|
|
62
|
+
WeaponType.METAL_HEAVY_BASH = WEAPON_TYPE_METAL_HEAVY_BASH
|
|
63
|
+
WeaponType.METAL_MEDIUM_STAB = WEAPON_TYPE_METAL_MEDIUM_STAB
|
|
64
|
+
WeaponType.METAL_HEAVY_STAB = WEAPON_TYPE_METAL_HEAVY_STAB
|
|
65
|
+
WeaponType.WOOD_LIGHT_SLICE = WEAPON_TYPE_WOOD_LIGHT_SLICE
|
|
66
|
+
WeaponType.WOOD_MEDIUM_SLICE = WEAPON_TYPE_WOOD_MEDIUM_SLICE
|
|
67
|
+
WeaponType.WOOD_HEAVY_SLICE = WEAPON_TYPE_WOOD_HEAVY_SLICE
|
|
68
|
+
WeaponType.WOOD_LIGHT_BASH = WEAPON_TYPE_WOOD_LIGHT_BASH
|
|
69
|
+
WeaponType.WOOD_MEDIUM_BASH = WEAPON_TYPE_WOOD_MEDIUM_BASH
|
|
70
|
+
WeaponType.WOOD_HEAVY_BASH = WEAPON_TYPE_WOOD_HEAVY_BASH
|
|
71
|
+
WeaponType.WOOD_LIGHT_STAB = WEAPON_TYPE_WOOD_LIGHT_STAB
|
|
72
|
+
WeaponType.WOOD_MEDIUM_STAB = WEAPON_TYPE_WOOD_MEDIUM_STAB
|
|
73
|
+
WeaponType.CLAW_LIGHT_SLICE = WEAPON_TYPE_CLAW_LIGHT_SLICE
|
|
74
|
+
WeaponType.CLAW_MEDIUM_SLICE = WEAPON_TYPE_CLAW_MEDIUM_SLICE
|
|
75
|
+
WeaponType.CLAW_HEAVY_SLICE = WEAPON_TYPE_CLAW_HEAVY_SLICE
|
|
76
|
+
WeaponType.AXE_MEDIUM_CHOP = WEAPON_TYPE_AXE_MEDIUM_CHOP
|
|
77
|
+
WeaponType.ROCK_HEAVY_BASH = WEAPON_TYPE_ROCK_HEAVY_BASH
|
|
78
|
+
end
|
|
79
|
+
local dummies = {}
|
|
80
|
+
for ____, player in ipairs(Player.all) do
|
|
81
|
+
local dummy = assert(createUnit(
|
|
82
|
+
player.handle,
|
|
83
|
+
dummyUnitId,
|
|
84
|
+
0,
|
|
85
|
+
0,
|
|
86
|
+
270
|
|
87
|
+
))
|
|
88
|
+
showUnit(dummy, false)
|
|
89
|
+
dummies[player] = dummy
|
|
90
|
+
end
|
|
91
|
+
Unit.prototype.damageTarget = function(self, target, amount, attack, ranged, attackType, damageType, weaponType)
|
|
92
|
+
if attack == nil then
|
|
93
|
+
attack = false
|
|
94
|
+
end
|
|
95
|
+
if ranged == nil then
|
|
96
|
+
ranged = false
|
|
97
|
+
end
|
|
98
|
+
if attackType == nil then
|
|
99
|
+
attackType = ____exports.AttackType.SPELL
|
|
100
|
+
end
|
|
101
|
+
if damageType == nil then
|
|
102
|
+
damageType = ____exports.DamageType.MAGIC
|
|
103
|
+
end
|
|
104
|
+
if weaponType == nil then
|
|
105
|
+
weaponType = ____exports.WeaponType.UNKNOWN
|
|
106
|
+
end
|
|
107
|
+
local handle = self.handle
|
|
108
|
+
local targetHandle = target.handle
|
|
109
|
+
if not getOwningPlayer(handle) then
|
|
110
|
+
handle = dummies[__TS__InstanceOf(target, Unit) and target.owner or (self._owner or Player.neutralAggressive)]
|
|
111
|
+
end
|
|
112
|
+
return unitDamageTarget(
|
|
113
|
+
handle,
|
|
114
|
+
targetHandle,
|
|
115
|
+
amount,
|
|
116
|
+
attack,
|
|
117
|
+
ranged,
|
|
118
|
+
attackType,
|
|
119
|
+
damageType,
|
|
120
|
+
weaponType
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
return ____exports
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { Unit } from "./unit";
|
|
3
|
+
import { Destructable } from "../../core/types/destructable";
|
|
4
|
+
export type RallyPoint = Unit | Destructable | [x: number, y: number];
|
|
5
|
+
export type RallyRoute = ReadonlyArray<RallyPoint>;
|
|
6
|
+
declare module "./unit" {
|
|
7
|
+
interface Unit {
|
|
8
|
+
rallyRoute: RallyRoute;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
3
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local processPoint, processUnit, processDestructible
|
|
6
|
+
local ____unit = require("engine.internal.unit")
|
|
7
|
+
local Unit = ____unit.Unit
|
|
8
|
+
local ____destructable = require("core.types.destructable")
|
|
9
|
+
local Destructable = ____destructable.Destructable
|
|
10
|
+
local ____timer = require("core.types.timer")
|
|
11
|
+
local Timer = ____timer.Timer
|
|
12
|
+
local ____handle = require("core.types.handle")
|
|
13
|
+
local Handle = ____handle.Handle
|
|
14
|
+
local getLocationX = GetLocationX
|
|
15
|
+
local getLocationY = GetLocationY
|
|
16
|
+
local getHandleId = GetHandleId
|
|
17
|
+
local getUnitRallyDestructible = GetUnitRallyDestructable
|
|
18
|
+
local getUnitRallyPoint = GetUnitRallyPoint
|
|
19
|
+
local getUnitRallyUnit = GetUnitRallyUnit
|
|
20
|
+
local removeLocation = RemoveLocation
|
|
21
|
+
local issuePointOrderById = IssuePointOrderById
|
|
22
|
+
local issueTargetOrderById = IssueTargetOrderById
|
|
23
|
+
local queuePointOrderById = BlzQueuePointOrderById
|
|
24
|
+
local queueTargetOrderById = BlzQueueTargetOrderById
|
|
25
|
+
local rallyRouteByUnit = setmetatable({}, {__mode = "k"})
|
|
26
|
+
Unit.onPointOrder[orderId("setrally")]:addListener(function(unit, x, y)
|
|
27
|
+
processPoint(unit, x, y)
|
|
28
|
+
end)
|
|
29
|
+
Unit.onPointOrder[orderId("smart")]:addListener(function(unit, x, y)
|
|
30
|
+
if unit:hasAbility(fourCC("ARal")) then
|
|
31
|
+
processPoint(unit, x, y)
|
|
32
|
+
end
|
|
33
|
+
end)
|
|
34
|
+
Unit.onTargetOrder[orderId("setrally")]:addListener(function(unit, target)
|
|
35
|
+
if __TS__InstanceOf(target, Unit) then
|
|
36
|
+
processUnit(unit, target)
|
|
37
|
+
elseif __TS__InstanceOf(target, Destructable) then
|
|
38
|
+
processDestructible(unit, target)
|
|
39
|
+
end
|
|
40
|
+
end)
|
|
41
|
+
Unit.onTargetOrder[orderId("smart")]:addListener(function(unit, target)
|
|
42
|
+
if unit:hasAbility(fourCC("ARal")) then
|
|
43
|
+
if __TS__InstanceOf(target, Unit) then
|
|
44
|
+
processUnit(unit, target)
|
|
45
|
+
elseif __TS__InstanceOf(target, Destructable) then
|
|
46
|
+
processDestructible(unit, target)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end)
|
|
50
|
+
processPoint = function(unit, x, y)
|
|
51
|
+
Timer:run(function()
|
|
52
|
+
local rallyPoint = getUnitRallyPoint(unit.handle)
|
|
53
|
+
if rallyPoint == nil or x ~= getLocationX(rallyPoint) or y ~= getLocationY(rallyPoint) then
|
|
54
|
+
local rallyRoute = unit.rallyRoute
|
|
55
|
+
rallyRoute[#rallyRoute + 1] = {x, y}
|
|
56
|
+
else
|
|
57
|
+
rallyRouteByUnit[unit] = {{x, y}}
|
|
58
|
+
end
|
|
59
|
+
removeLocation(rallyPoint)
|
|
60
|
+
end)
|
|
61
|
+
end
|
|
62
|
+
processUnit = function(unit, rallyPoint)
|
|
63
|
+
Timer:run(function()
|
|
64
|
+
if getHandleId(rallyPoint.handle) ~= getHandleId(getUnitRallyUnit(unit.handle)) then
|
|
65
|
+
local rallyRoute = unit.rallyRoute
|
|
66
|
+
rallyRoute[#rallyRoute + 1] = rallyPoint
|
|
67
|
+
else
|
|
68
|
+
rallyRouteByUnit[unit] = {rallyPoint}
|
|
69
|
+
end
|
|
70
|
+
end)
|
|
71
|
+
end
|
|
72
|
+
processDestructible = function(unit, rallyPoint)
|
|
73
|
+
Timer:run(function()
|
|
74
|
+
if getHandleId(rallyPoint.handle) ~= getHandleId(getUnitRallyDestructible(unit.handle)) then
|
|
75
|
+
local rallyRoute = unit.rallyRoute
|
|
76
|
+
rallyRoute[#rallyRoute + 1] = rallyPoint
|
|
77
|
+
else
|
|
78
|
+
rallyRouteByUnit[unit] = {rallyPoint}
|
|
79
|
+
end
|
|
80
|
+
end)
|
|
81
|
+
end
|
|
82
|
+
__TS__ObjectDefineProperty(
|
|
83
|
+
Unit.prototype,
|
|
84
|
+
"rallyRoute",
|
|
85
|
+
{
|
|
86
|
+
get = function(self)
|
|
87
|
+
do
|
|
88
|
+
local rallyRoute = rallyRouteByUnit[self]
|
|
89
|
+
if rallyRoute ~= nil then
|
|
90
|
+
return rallyRoute
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
local handle = self.handle
|
|
94
|
+
local rallyPoint = getUnitRallyPoint(handle)
|
|
95
|
+
if rallyPoint ~= nil then
|
|
96
|
+
local x = getLocationX(rallyPoint)
|
|
97
|
+
local y = getLocationY(rallyPoint)
|
|
98
|
+
removeLocation(rallyPoint)
|
|
99
|
+
local rallyRoute = {{x, y}}
|
|
100
|
+
rallyRouteByUnit[self] = rallyRoute
|
|
101
|
+
return rallyRoute
|
|
102
|
+
end
|
|
103
|
+
local rallyUnit = getUnitRallyUnit(handle)
|
|
104
|
+
if rallyUnit ~= nil then
|
|
105
|
+
local rallyRoute = {Unit:of(rallyUnit)}
|
|
106
|
+
rallyRouteByUnit[self] = rallyRoute
|
|
107
|
+
return rallyRoute
|
|
108
|
+
end
|
|
109
|
+
local rallyDestructible = getUnitRallyDestructible(handle)
|
|
110
|
+
local rallyRoute = rallyDestructible ~= nil and ({Destructable:of(rallyDestructible)}) or ({})
|
|
111
|
+
rallyRouteByUnit[self] = rallyRoute
|
|
112
|
+
return rallyRoute
|
|
113
|
+
end,
|
|
114
|
+
set = function(self, rallyRoute)
|
|
115
|
+
local handle = self.handle
|
|
116
|
+
do
|
|
117
|
+
local rallyPoint = rallyRoute[1]
|
|
118
|
+
if __TS__InstanceOf(rallyPoint, Handle) then
|
|
119
|
+
issueTargetOrderById(
|
|
120
|
+
handle,
|
|
121
|
+
orderId("setrally"),
|
|
122
|
+
rallyPoint.handle
|
|
123
|
+
)
|
|
124
|
+
elseif rallyPoint ~= nil then
|
|
125
|
+
issuePointOrderById(
|
|
126
|
+
handle,
|
|
127
|
+
orderId("setrally"),
|
|
128
|
+
rallyPoint[1],
|
|
129
|
+
rallyPoint[2]
|
|
130
|
+
)
|
|
131
|
+
else
|
|
132
|
+
issueTargetOrderById(
|
|
133
|
+
handle,
|
|
134
|
+
orderId("setrally"),
|
|
135
|
+
handle
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
for i = 2, #rallyRoute do
|
|
140
|
+
local rallyPoint = rallyRoute[i]
|
|
141
|
+
if __TS__InstanceOf(rallyPoint, Handle) then
|
|
142
|
+
queueTargetOrderById(
|
|
143
|
+
handle,
|
|
144
|
+
orderId("setrally"),
|
|
145
|
+
rallyPoint.handle
|
|
146
|
+
)
|
|
147
|
+
else
|
|
148
|
+
queuePointOrderById(
|
|
149
|
+
handle,
|
|
150
|
+
orderId("setrally"),
|
|
151
|
+
rallyPoint[1],
|
|
152
|
+
rallyPoint[2]
|
|
153
|
+
)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
return ____exports
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__New = ____lualib.__TS__New
|
|
3
|
+
local Set = ____lualib.Set
|
|
4
|
+
local __TS__ArrayFrom = ____lualib.__TS__ArrayFrom
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local ____unit = require("engine.internal.unit")
|
|
7
|
+
local Unit = ____unit.Unit
|
|
8
|
+
local ____unit_2Bdamage = require("engine.internal.unit+damage")
|
|
9
|
+
local AttackType = ____unit_2Bdamage.AttackType
|
|
10
|
+
local DamageType = ____unit_2Bdamage.DamageType
|
|
11
|
+
local ____event = require("event")
|
|
12
|
+
local Event = ____event.Event
|
|
13
|
+
local onSpellSteal = __TS__New(Event)
|
|
14
|
+
rawset(Unit, "onSpellSteal", onSpellSteal)
|
|
15
|
+
local countByUnit = setmetatable({}, {__mode = "k"})
|
|
16
|
+
local function onSpellStealCastListener(caster, ability, target)
|
|
17
|
+
countByUnit[target] = (countByUnit[target] or 0) + 1
|
|
18
|
+
end
|
|
19
|
+
for ____, spellStealAbilityId in ipairs(postcompile(function()
|
|
20
|
+
local spellStealAbilityIds = __TS__New(Set)
|
|
21
|
+
if currentMap then
|
|
22
|
+
for ____, ability in pairs(currentMap.objects.ability.all) do
|
|
23
|
+
if "Asps" == (ability.parentId or ability.id) then
|
|
24
|
+
spellStealAbilityIds:add(fourCC(ability.id))
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
return __TS__ArrayFrom(spellStealAbilityIds)
|
|
29
|
+
end)) do
|
|
30
|
+
Unit.onUnitTargetCast[spellStealAbilityId]:addListener(onSpellStealCastListener)
|
|
31
|
+
end
|
|
32
|
+
local spellStealEventStack = {}
|
|
33
|
+
Unit.onDamaging:addListener(function(source, target, event)
|
|
34
|
+
if event.amount == 0 and source ~= nil then
|
|
35
|
+
local count = countByUnit[source] or 0
|
|
36
|
+
if count > 0 and event.attackType == AttackType.SPELL then
|
|
37
|
+
if event.damageType == DamageType.UNKNOWN then
|
|
38
|
+
spellStealEventStack[#spellStealEventStack + 1] = {
|
|
39
|
+
sourceBuffIds = source.buffIds,
|
|
40
|
+
sourceBuffCount = source:countBuffs()
|
|
41
|
+
}
|
|
42
|
+
elseif event.damageType == DamageType.NORMAL then
|
|
43
|
+
local spellStealEvent = table.remove(spellStealEventStack)
|
|
44
|
+
if spellStealEvent ~= nil then
|
|
45
|
+
if source:countBuffs() < spellStealEvent.sourceBuffCount then
|
|
46
|
+
for ____, sourceBuffId in ipairs(spellStealEvent.sourceBuffIds) do
|
|
47
|
+
if not source:hasAbility(sourceBuffId) and target:hasAbility(sourceBuffId) then
|
|
48
|
+
if count == 1 then
|
|
49
|
+
countByUnit[source] = nil
|
|
50
|
+
else
|
|
51
|
+
countByUnit[source] = count - 1
|
|
52
|
+
end
|
|
53
|
+
Event.invoke(onSpellSteal, source, target, sourceBuffId)
|
|
54
|
+
return
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
spellStealEventStack[#spellStealEventStack + 1] = spellStealEvent
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end)
|
|
64
|
+
return ____exports
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { Event } from "../../event";
|
|
3
|
+
declare module "./unit" {
|
|
4
|
+
interface Unit {
|
|
5
|
+
readonly transport?: Unit;
|
|
6
|
+
readonly cargo: ReadonlyArray<Unit>;
|
|
7
|
+
}
|
|
8
|
+
namespace Unit {
|
|
9
|
+
const onBoard: Event<[unit: Unit, transport: Unit]>;
|
|
10
|
+
const onDeboard: Event<[unit: Unit, transport: Unit]>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__New = ____lualib.__TS__New
|
|
3
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local ____unit = require("engine.internal.unit")
|
|
6
|
+
local Unit = ____unit.Unit
|
|
7
|
+
local ____event = require("event")
|
|
8
|
+
local Event = ____event.Event
|
|
9
|
+
local ____mapbounds = require("core.mapbounds")
|
|
10
|
+
local boundMax = ____mapbounds.boundMax
|
|
11
|
+
local boundRegion = ____mapbounds.boundRegion
|
|
12
|
+
local eventInvoke = Event.invoke
|
|
13
|
+
local tableRemove = table.remove
|
|
14
|
+
local ____assert = _G.assert
|
|
15
|
+
local rawset = _G.rawset
|
|
16
|
+
local condition = Condition
|
|
17
|
+
local createTrigger = CreateTrigger
|
|
18
|
+
local getTransportUnit = GetTransportUnit
|
|
19
|
+
local getTriggerUnit = GetTriggerUnit
|
|
20
|
+
local isUnitLoaded = IsUnitLoaded
|
|
21
|
+
local triggerAddCondition = TriggerAddCondition
|
|
22
|
+
local triggerRegisterAnyUnitEventBJ = TriggerRegisterAnyUnitEventBJ
|
|
23
|
+
local unitAlive = UnitAlive
|
|
24
|
+
local transportByUnit = setmetatable({}, {__mode = "kv"})
|
|
25
|
+
local cargoByUnit = setmetatable(
|
|
26
|
+
{},
|
|
27
|
+
{
|
|
28
|
+
__mode = "k",
|
|
29
|
+
__index = function(self, unit)
|
|
30
|
+
local cargo = {}
|
|
31
|
+
rawset(self, unit, cargo)
|
|
32
|
+
return cargo
|
|
33
|
+
end
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
local onBoardEvent = __TS__New(Event)
|
|
37
|
+
local onDeboardEvent = __TS__New(Event)
|
|
38
|
+
local function deboard(unit)
|
|
39
|
+
local transport = ____assert(transportByUnit[unit])
|
|
40
|
+
local cargo = cargoByUnit[transport]
|
|
41
|
+
for i = 1, #cargo do
|
|
42
|
+
if cargo[i] == unit then
|
|
43
|
+
tableRemove(cargo, i)
|
|
44
|
+
break
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
transportByUnit[unit] = nil
|
|
48
|
+
eventInvoke(onDeboardEvent, unit, transport)
|
|
49
|
+
end
|
|
50
|
+
local boardTrigger = createTrigger()
|
|
51
|
+
triggerRegisterAnyUnitEventBJ(boardTrigger, EVENT_PLAYER_UNIT_LOADED)
|
|
52
|
+
triggerAddCondition(
|
|
53
|
+
boardTrigger,
|
|
54
|
+
condition(function()
|
|
55
|
+
local handle = getTriggerUnit()
|
|
56
|
+
local unit = Unit:of(handle)
|
|
57
|
+
if transportByUnit[unit] ~= nil then
|
|
58
|
+
deboard(unit)
|
|
59
|
+
end
|
|
60
|
+
if not unitAlive(handle) then
|
|
61
|
+
unit.x = boundMax.x
|
|
62
|
+
unit.y = boundMax.y
|
|
63
|
+
end
|
|
64
|
+
local transport = Unit:of(getTransportUnit())
|
|
65
|
+
transportByUnit[unit] = transport
|
|
66
|
+
local cargo = cargoByUnit[transport]
|
|
67
|
+
cargo[#cargo + 1] = unit
|
|
68
|
+
eventInvoke(onBoardEvent, unit, transport)
|
|
69
|
+
end)
|
|
70
|
+
)
|
|
71
|
+
boundRegion.onUnitEnter:addListener(function(unit)
|
|
72
|
+
if transportByUnit[unit] ~= nil and not isUnitLoaded(unit.handle) then
|
|
73
|
+
deboard(unit)
|
|
74
|
+
end
|
|
75
|
+
end)
|
|
76
|
+
Unit.deathEvent:addListener(function(unit)
|
|
77
|
+
if transportByUnit[unit] ~= nil then
|
|
78
|
+
deboard(unit)
|
|
79
|
+
end
|
|
80
|
+
end)
|
|
81
|
+
Unit.onImmediateOrder:addListener(function(unit)
|
|
82
|
+
if transportByUnit[unit] ~= nil and not isUnitLoaded(unit.handle) then
|
|
83
|
+
deboard(unit)
|
|
84
|
+
end
|
|
85
|
+
end)
|
|
86
|
+
__TS__ObjectDefineProperty(
|
|
87
|
+
Unit.prototype,
|
|
88
|
+
"transport",
|
|
89
|
+
{get = function(self)
|
|
90
|
+
return transportByUnit[self]
|
|
91
|
+
end}
|
|
92
|
+
)
|
|
93
|
+
__TS__ObjectDefineProperty(
|
|
94
|
+
Unit.prototype,
|
|
95
|
+
"cargo",
|
|
96
|
+
{get = function(self)
|
|
97
|
+
return cargoByUnit[self]
|
|
98
|
+
end}
|
|
99
|
+
)
|
|
100
|
+
rawset(Unit, "onBoard", onBoardEvent)
|
|
101
|
+
rawset(Unit, "onDeboard", onDeboardEvent)
|
|
102
|
+
return ____exports
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____unit_2Dtype = require("engine.object-data.entry.unit-type")
|
|
3
|
+
local UnitType = ____unit_2Dtype.UnitType
|
|
4
|
+
local ____arrays = require("utility.arrays")
|
|
5
|
+
local associate = ____arrays.associate
|
|
6
|
+
local ____lua_2Dmaps = require("utility.lua-maps")
|
|
7
|
+
local mapValues = ____lua_2Dmaps.mapValues
|
|
8
|
+
local ____local_2Dclient = require("engine.local-client")
|
|
9
|
+
local LocalClient = ____local_2Dclient.LocalClient
|
|
10
|
+
---
|
|
11
|
+
-- @internal For use by internal systems only.
|
|
12
|
+
____exports.DEFAULT_MISSILE_IMPACT_OFFSET_Z = 60
|
|
13
|
+
---
|
|
14
|
+
-- @internal For use by internal systems only.
|
|
15
|
+
____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_X = 0
|
|
16
|
+
---
|
|
17
|
+
-- @internal For use by internal systems only.
|
|
18
|
+
____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Y = 0
|
|
19
|
+
---
|
|
20
|
+
-- @internal For use by internal systems only.
|
|
21
|
+
____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_X = 0
|
|
22
|
+
---
|
|
23
|
+
-- @internal For use by internal systems only.
|
|
24
|
+
____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y = 0
|
|
25
|
+
---
|
|
26
|
+
-- @internal For use by internal systems only.
|
|
27
|
+
____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Z = 60
|
|
28
|
+
local DEFAULT_VALUES = {
|
|
29
|
+
impactOffsetZ = ____exports.DEFAULT_MISSILE_IMPACT_OFFSET_Z,
|
|
30
|
+
launchOffsetX = ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_X,
|
|
31
|
+
launchOffsetY = ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Y,
|
|
32
|
+
launchOffsetZ = ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Z,
|
|
33
|
+
launchVisualOffsetX = ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_X,
|
|
34
|
+
launchVisualOffsetY = ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y
|
|
35
|
+
}
|
|
36
|
+
local METATABLE = {__index = DEFAULT_VALUES}
|
|
37
|
+
---
|
|
38
|
+
-- @internal For use by internal systems only.
|
|
39
|
+
____exports.MISSILE_DATA_BY_UNIT_TYPE_ID = (function()
|
|
40
|
+
return setmetatable(
|
|
41
|
+
mapValues(
|
|
42
|
+
postcompile(function()
|
|
43
|
+
return associate(
|
|
44
|
+
UnitType:getAll(),
|
|
45
|
+
function(unitType) return unitType.id end,
|
|
46
|
+
function(unitType)
|
|
47
|
+
local ____ = unitType.missileImpactOffsetZSD
|
|
48
|
+
local ____ = unitType.missileImpactOffsetZHD
|
|
49
|
+
return {
|
|
50
|
+
[0] = unitType.missileImpactOffsetZSD ~= ____exports.DEFAULT_MISSILE_IMPACT_OFFSET_Z and unitType.missileImpactOffsetZSD or nil,
|
|
51
|
+
[1] = unitType.missileImpactOffsetZHD ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZHD or nil,
|
|
52
|
+
[2] = unitType.missileLaunchOffsetX ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_X and unitType.missileLaunchOffsetX or nil,
|
|
53
|
+
[3] = unitType.missileLaunchOffsetY ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Y and unitType.missileLaunchOffsetY or nil,
|
|
54
|
+
[4] = unitType.missileLaunchOffsetZSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Z and unitType.missileLaunchOffsetZSD or nil,
|
|
55
|
+
[5] = unitType.missileLaunchOffsetZHD ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZHD or nil,
|
|
56
|
+
[6] = unitType.missileLaunchVisualOffsetXSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_X and unitType.missileLaunchVisualOffsetXSD or nil,
|
|
57
|
+
[7] = unitType.missileLaunchVisualOffsetXHD ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXHD or nil,
|
|
58
|
+
[8] = unitType.missileLaunchVisualOffsetYSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y and unitType.missileLaunchVisualOffsetYSD or nil,
|
|
59
|
+
[9] = unitType.missileLaunchVisualOffsetYHD ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYHD or nil
|
|
60
|
+
}
|
|
61
|
+
end
|
|
62
|
+
)
|
|
63
|
+
end),
|
|
64
|
+
function(data)
|
|
65
|
+
local ____setmetatable_6 = setmetatable
|
|
66
|
+
local ____LocalClient_isHD_0
|
|
67
|
+
if LocalClient.isHD then
|
|
68
|
+
____LocalClient_isHD_0 = data[1] or data[0]
|
|
69
|
+
else
|
|
70
|
+
____LocalClient_isHD_0 = data[0]
|
|
71
|
+
end
|
|
72
|
+
local ____data__2_4 = data[2]
|
|
73
|
+
local ____data__3_5 = data[3]
|
|
74
|
+
local ____LocalClient_isHD_1
|
|
75
|
+
if LocalClient.isHD then
|
|
76
|
+
____LocalClient_isHD_1 = data[5] or data[4]
|
|
77
|
+
else
|
|
78
|
+
____LocalClient_isHD_1 = data[4]
|
|
79
|
+
end
|
|
80
|
+
local ____LocalClient_isHD_2
|
|
81
|
+
if LocalClient.isHD then
|
|
82
|
+
____LocalClient_isHD_2 = data[7] or data[6]
|
|
83
|
+
else
|
|
84
|
+
____LocalClient_isHD_2 = data[6]
|
|
85
|
+
end
|
|
86
|
+
local ____LocalClient_isHD_3
|
|
87
|
+
if LocalClient.isHD then
|
|
88
|
+
____LocalClient_isHD_3 = data[9] or data[8]
|
|
89
|
+
else
|
|
90
|
+
____LocalClient_isHD_3 = data[8]
|
|
91
|
+
end
|
|
92
|
+
return ____setmetatable_6({
|
|
93
|
+
impactOffsetZ = ____LocalClient_isHD_0,
|
|
94
|
+
launchOffsetX = ____data__2_4,
|
|
95
|
+
launchOffsetY = ____data__3_5,
|
|
96
|
+
launchOffsetZ = ____LocalClient_isHD_1,
|
|
97
|
+
launchVisualOffsetX = ____LocalClient_isHD_2,
|
|
98
|
+
launchVisualOffsetY = ____LocalClient_isHD_3
|
|
99
|
+
}, METATABLE)
|
|
100
|
+
end
|
|
101
|
+
),
|
|
102
|
+
{__index = function(self)
|
|
103
|
+
return DEFAULT_VALUES
|
|
104
|
+
end}
|
|
105
|
+
)
|
|
106
|
+
end)()
|
|
107
|
+
return ____exports
|