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,93 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local floor = math.floor
|
|
7
|
+
local min = math.min
|
|
8
|
+
local max = math.max
|
|
9
|
+
local format = string.format
|
|
10
|
+
local pack = string.pack
|
|
11
|
+
local cache = {}
|
|
12
|
+
____exports.Color = __TS__Class()
|
|
13
|
+
local Color = ____exports.Color
|
|
14
|
+
Color.name = "Color"
|
|
15
|
+
function Color.prototype.____constructor(self, r, g, b, a, key)
|
|
16
|
+
self.r = r
|
|
17
|
+
self.g = g
|
|
18
|
+
self.b = b
|
|
19
|
+
self.a = a
|
|
20
|
+
cache[key] = self
|
|
21
|
+
end
|
|
22
|
+
function Color.prototype.__tostring(self)
|
|
23
|
+
return ((((((("color(" .. tostring(self.r)) .. ", ") .. tostring(self.g)) .. ", ") .. tostring(self.b)) .. ", ") .. tostring(self.a)) .. ")"
|
|
24
|
+
end
|
|
25
|
+
function Color.lerp(self, lhs, rhs, t)
|
|
26
|
+
return ____exports.Color:of(lhs.r * (1 - t) + rhs.r * t, lhs.g * (1 - t) + rhs.g * t, lhs.b * (1 - t) + rhs.b * t, lhs.a * (1 - t) + rhs.a * t)
|
|
27
|
+
end
|
|
28
|
+
function Color.of(self, red, green, blue, alpha)
|
|
29
|
+
red = max(
|
|
30
|
+
0,
|
|
31
|
+
min(
|
|
32
|
+
floor(red + 0.5),
|
|
33
|
+
255
|
|
34
|
+
)
|
|
35
|
+
)
|
|
36
|
+
green = max(
|
|
37
|
+
0,
|
|
38
|
+
min(
|
|
39
|
+
floor(green + 0.5),
|
|
40
|
+
255
|
|
41
|
+
)
|
|
42
|
+
)
|
|
43
|
+
blue = max(
|
|
44
|
+
0,
|
|
45
|
+
min(
|
|
46
|
+
floor(blue + 0.5),
|
|
47
|
+
255
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
alpha = max(
|
|
51
|
+
0,
|
|
52
|
+
min(
|
|
53
|
+
floor(alpha or 255 + 0.5),
|
|
54
|
+
255
|
|
55
|
+
)
|
|
56
|
+
)
|
|
57
|
+
local key = pack(
|
|
58
|
+
"=BBBB",
|
|
59
|
+
red,
|
|
60
|
+
green,
|
|
61
|
+
blue,
|
|
62
|
+
alpha
|
|
63
|
+
)
|
|
64
|
+
return cache[key] or __TS__New(
|
|
65
|
+
____exports.Color,
|
|
66
|
+
red,
|
|
67
|
+
green,
|
|
68
|
+
blue,
|
|
69
|
+
alpha,
|
|
70
|
+
key
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
Color.white = ____exports.Color:of(255, 255, 255, 255)
|
|
74
|
+
Color.black = ____exports.Color:of(0, 0, 0, 255)
|
|
75
|
+
Color.gold = ____exports.Color:of(255, 204, 0, 255)
|
|
76
|
+
Color.silver = ____exports.Color:of(195, 219, 255, 255)
|
|
77
|
+
__TS__SetDescriptor(
|
|
78
|
+
Color.prototype,
|
|
79
|
+
"hexCode",
|
|
80
|
+
{get = function(self)
|
|
81
|
+
local code = format(
|
|
82
|
+
"%02x%02x%02x%02x",
|
|
83
|
+
self.a,
|
|
84
|
+
self.r,
|
|
85
|
+
self.g,
|
|
86
|
+
self.b
|
|
87
|
+
)
|
|
88
|
+
rawset(self, "hexCode", code)
|
|
89
|
+
return code
|
|
90
|
+
end},
|
|
91
|
+
true
|
|
92
|
+
)
|
|
93
|
+
return ____exports
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { Handle, HandleDestructor } from "./handle";
|
|
3
|
+
import { Event, TriggerEvent } from "../../event";
|
|
4
|
+
import { ReadonlyRect } from "./rect";
|
|
5
|
+
export declare class Destructable extends Handle<jdestructable> {
|
|
6
|
+
protected onDestroy(): HandleDestructor;
|
|
7
|
+
get typeId(): number;
|
|
8
|
+
get name(): string;
|
|
9
|
+
get x(): number;
|
|
10
|
+
get y(): number;
|
|
11
|
+
get position(): Vec2;
|
|
12
|
+
get isInvulnerable(): boolean;
|
|
13
|
+
set isInvulnerable(isInvulnerable: boolean);
|
|
14
|
+
get maxHealth(): number;
|
|
15
|
+
set maxHealth(v: number);
|
|
16
|
+
get health(): number;
|
|
17
|
+
set health(v: number);
|
|
18
|
+
static create(id: number, x: number, y: number, facing: number, scale: number, variation: number): Destructable | null;
|
|
19
|
+
static createZ(id: number, x: number, y: number, z: number, facing: number, scale: number, variation: number): Destructable | null;
|
|
20
|
+
static getInRange(x: number, y: number, range: number): Destructable[];
|
|
21
|
+
static getInRect(rect: ReadonlyRect): Destructable[];
|
|
22
|
+
static get onCreate(): Event<[Destructable]>;
|
|
23
|
+
static get onDestroy(): Event<[Destructable]>;
|
|
24
|
+
static readonly onDeath: TriggerEvent<[Destructable]>;
|
|
25
|
+
setAnimation(animation: string): void;
|
|
26
|
+
queueAnimation(animation: string): void;
|
|
27
|
+
restore(): void;
|
|
28
|
+
kill(): void;
|
|
29
|
+
get isAlive(): boolean;
|
|
30
|
+
get isDead(): boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
6
|
+
local __TS__New = ____lualib.__TS__New
|
|
7
|
+
local ____exports = {}
|
|
8
|
+
local ____handle = require("core.types.handle")
|
|
9
|
+
local Handle = ____handle.Handle
|
|
10
|
+
local ____event = require("event")
|
|
11
|
+
local TriggerEvent = ____event.TriggerEvent
|
|
12
|
+
local ____rect = require("core.types.rect")
|
|
13
|
+
local Rect = ____rect.Rect
|
|
14
|
+
local setRect = SetRect
|
|
15
|
+
local getEnumDestructable = GetEnumDestructable
|
|
16
|
+
local createDestructable = CreateDestructable
|
|
17
|
+
local createDestructableZ = CreateDestructableZ
|
|
18
|
+
local removeDestructable = RemoveDestructable
|
|
19
|
+
local killDestructable = KillDestructable
|
|
20
|
+
local setDestructableInvulnerable = SetDestructableInvulnerable
|
|
21
|
+
local isDestructableInvulnerable = IsDestructableInvulnerable
|
|
22
|
+
local enumDestructablesInRect = EnumDestructablesInRect
|
|
23
|
+
local getDestructableTypeId = GetDestructableTypeId
|
|
24
|
+
local getDestructableX = GetDestructableX
|
|
25
|
+
local getDestructableY = GetDestructableY
|
|
26
|
+
local setDestructableLife = SetDestructableLife
|
|
27
|
+
local getDestructableLife = GetDestructableLife
|
|
28
|
+
local setDestructableMaxLife = SetDestructableMaxLife
|
|
29
|
+
local getDestructableMaxLife = GetDestructableMaxLife
|
|
30
|
+
local destructableRestoreLife = DestructableRestoreLife
|
|
31
|
+
local queueDestructableAnimation = QueueDestructableAnimation
|
|
32
|
+
local setDestructableAnimation = SetDestructableAnimation
|
|
33
|
+
local getDestructableName = GetDestructableName
|
|
34
|
+
local enumRect = Rect:create(0, 0, 0, 0).handle
|
|
35
|
+
____exports.Destructable = __TS__Class()
|
|
36
|
+
local Destructable = ____exports.Destructable
|
|
37
|
+
Destructable.name = "Destructable"
|
|
38
|
+
__TS__ClassExtends(Destructable, Handle)
|
|
39
|
+
function Destructable.prototype.onDestroy(self)
|
|
40
|
+
killDestructable(self.handle)
|
|
41
|
+
removeDestructable(self.handle)
|
|
42
|
+
return Handle.prototype.onDestroy(self)
|
|
43
|
+
end
|
|
44
|
+
function Destructable.create(self, id, x, y, facing, scale, variation)
|
|
45
|
+
return ____exports.Destructable:of(createDestructable(
|
|
46
|
+
id,
|
|
47
|
+
x,
|
|
48
|
+
y,
|
|
49
|
+
facing,
|
|
50
|
+
scale,
|
|
51
|
+
variation
|
|
52
|
+
))
|
|
53
|
+
end
|
|
54
|
+
function Destructable.createZ(self, id, x, y, z, facing, scale, variation)
|
|
55
|
+
return ____exports.Destructable:of(createDestructableZ(
|
|
56
|
+
id,
|
|
57
|
+
x,
|
|
58
|
+
y,
|
|
59
|
+
z,
|
|
60
|
+
facing,
|
|
61
|
+
scale,
|
|
62
|
+
variation
|
|
63
|
+
))
|
|
64
|
+
end
|
|
65
|
+
function Destructable.getInRange(self, x, y, range)
|
|
66
|
+
local collection = {}
|
|
67
|
+
setRect(
|
|
68
|
+
enumRect,
|
|
69
|
+
x - range,
|
|
70
|
+
y - range,
|
|
71
|
+
x + range,
|
|
72
|
+
y + range
|
|
73
|
+
)
|
|
74
|
+
enumDestructablesInRect(
|
|
75
|
+
enumRect,
|
|
76
|
+
nil,
|
|
77
|
+
function()
|
|
78
|
+
collection[#collection + 1] = ____exports.Destructable:of(getEnumDestructable())
|
|
79
|
+
end
|
|
80
|
+
)
|
|
81
|
+
return collection
|
|
82
|
+
end
|
|
83
|
+
function Destructable.getInRect(self, rect)
|
|
84
|
+
local collection = {}
|
|
85
|
+
enumDestructablesInRect(
|
|
86
|
+
rect.handle,
|
|
87
|
+
nil,
|
|
88
|
+
function()
|
|
89
|
+
collection[#collection + 1] = ____exports.Destructable:of(getEnumDestructable())
|
|
90
|
+
end
|
|
91
|
+
)
|
|
92
|
+
return collection
|
|
93
|
+
end
|
|
94
|
+
function Destructable.prototype.setAnimation(self, animation)
|
|
95
|
+
setDestructableAnimation(self.handle, animation)
|
|
96
|
+
end
|
|
97
|
+
function Destructable.prototype.queueAnimation(self, animation)
|
|
98
|
+
queueDestructableAnimation(self.handle, animation)
|
|
99
|
+
end
|
|
100
|
+
function Destructable.prototype.restore(self)
|
|
101
|
+
destructableRestoreLife(
|
|
102
|
+
self.handle,
|
|
103
|
+
getDestructableMaxLife(self.handle),
|
|
104
|
+
true
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
function Destructable.prototype.kill(self)
|
|
108
|
+
killDestructable(self.handle)
|
|
109
|
+
end
|
|
110
|
+
__TS__SetDescriptor(
|
|
111
|
+
Destructable.prototype,
|
|
112
|
+
"typeId",
|
|
113
|
+
{get = function(self)
|
|
114
|
+
local typeId = getDestructableTypeId(self.handle)
|
|
115
|
+
rawset(self, "typeId", typeId)
|
|
116
|
+
return typeId
|
|
117
|
+
end},
|
|
118
|
+
true
|
|
119
|
+
)
|
|
120
|
+
__TS__SetDescriptor(
|
|
121
|
+
Destructable.prototype,
|
|
122
|
+
"name",
|
|
123
|
+
{get = function(self)
|
|
124
|
+
return getDestructableName(self.handle)
|
|
125
|
+
end},
|
|
126
|
+
true
|
|
127
|
+
)
|
|
128
|
+
__TS__SetDescriptor(
|
|
129
|
+
Destructable.prototype,
|
|
130
|
+
"x",
|
|
131
|
+
{get = function(self)
|
|
132
|
+
return getDestructableX(self.handle)
|
|
133
|
+
end},
|
|
134
|
+
true
|
|
135
|
+
)
|
|
136
|
+
__TS__SetDescriptor(
|
|
137
|
+
Destructable.prototype,
|
|
138
|
+
"y",
|
|
139
|
+
{get = function(self)
|
|
140
|
+
return getDestructableY(self.handle)
|
|
141
|
+
end},
|
|
142
|
+
true
|
|
143
|
+
)
|
|
144
|
+
__TS__SetDescriptor(
|
|
145
|
+
Destructable.prototype,
|
|
146
|
+
"position",
|
|
147
|
+
{get = function(self)
|
|
148
|
+
return vec2(
|
|
149
|
+
getDestructableX(self.handle),
|
|
150
|
+
getDestructableY(self.handle)
|
|
151
|
+
)
|
|
152
|
+
end},
|
|
153
|
+
true
|
|
154
|
+
)
|
|
155
|
+
__TS__SetDescriptor(
|
|
156
|
+
Destructable.prototype,
|
|
157
|
+
"isInvulnerable",
|
|
158
|
+
{
|
|
159
|
+
get = function(self)
|
|
160
|
+
return isDestructableInvulnerable(self.handle)
|
|
161
|
+
end,
|
|
162
|
+
set = function(self, isInvulnerable)
|
|
163
|
+
setDestructableInvulnerable(self.handle, isInvulnerable)
|
|
164
|
+
end
|
|
165
|
+
},
|
|
166
|
+
true
|
|
167
|
+
)
|
|
168
|
+
__TS__SetDescriptor(
|
|
169
|
+
Destructable.prototype,
|
|
170
|
+
"maxHealth",
|
|
171
|
+
{
|
|
172
|
+
get = function(self)
|
|
173
|
+
return getDestructableMaxLife(self.handle)
|
|
174
|
+
end,
|
|
175
|
+
set = function(self, v)
|
|
176
|
+
setDestructableMaxLife(self.handle, v)
|
|
177
|
+
end
|
|
178
|
+
},
|
|
179
|
+
true
|
|
180
|
+
)
|
|
181
|
+
__TS__SetDescriptor(
|
|
182
|
+
Destructable.prototype,
|
|
183
|
+
"health",
|
|
184
|
+
{
|
|
185
|
+
get = function(self)
|
|
186
|
+
return getDestructableLife(self.handle)
|
|
187
|
+
end,
|
|
188
|
+
set = function(self, v)
|
|
189
|
+
setDestructableLife(self.handle, v)
|
|
190
|
+
end
|
|
191
|
+
},
|
|
192
|
+
true
|
|
193
|
+
)
|
|
194
|
+
__TS__ObjectDefineProperty(
|
|
195
|
+
Destructable,
|
|
196
|
+
"onCreate",
|
|
197
|
+
{get = function(self)
|
|
198
|
+
return self.onCreateEvent
|
|
199
|
+
end}
|
|
200
|
+
)
|
|
201
|
+
__TS__ObjectDefineProperty(
|
|
202
|
+
Destructable,
|
|
203
|
+
"onDestroy",
|
|
204
|
+
{get = function(self)
|
|
205
|
+
return self.onDestroyEvent
|
|
206
|
+
end}
|
|
207
|
+
)
|
|
208
|
+
Destructable.onDeath = __TS__New(
|
|
209
|
+
TriggerEvent,
|
|
210
|
+
function(trigger)
|
|
211
|
+
local rect = GetWorldBounds()
|
|
212
|
+
enumDestructablesInRect(
|
|
213
|
+
rect,
|
|
214
|
+
nil,
|
|
215
|
+
function()
|
|
216
|
+
TriggerRegisterDeathEvent(
|
|
217
|
+
trigger,
|
|
218
|
+
getEnumDestructable()
|
|
219
|
+
)
|
|
220
|
+
end
|
|
221
|
+
)
|
|
222
|
+
RemoveRect(rect)
|
|
223
|
+
____exports.Destructable.onCreate:addListener(function(destructable)
|
|
224
|
+
TriggerRegisterDeathEvent(trigger, destructable.handle)
|
|
225
|
+
end)
|
|
226
|
+
end,
|
|
227
|
+
function() return ____exports.Destructable:of(GetDyingDestructable()) end
|
|
228
|
+
)
|
|
229
|
+
__TS__SetDescriptor(
|
|
230
|
+
Destructable.prototype,
|
|
231
|
+
"isAlive",
|
|
232
|
+
{get = function(self)
|
|
233
|
+
return getDestructableLife(self.handle) > 0
|
|
234
|
+
end},
|
|
235
|
+
true
|
|
236
|
+
)
|
|
237
|
+
__TS__SetDescriptor(
|
|
238
|
+
Destructable.prototype,
|
|
239
|
+
"isDead",
|
|
240
|
+
{get = function(self)
|
|
241
|
+
return getDestructableLife(self.handle) <= 0
|
|
242
|
+
end},
|
|
243
|
+
true
|
|
244
|
+
)
|
|
245
|
+
return ____exports
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { Handle, HandleDestructor } from "./handle";
|
|
3
|
+
import { Widget } from "./widget";
|
|
4
|
+
import { PlayerColor } from "./playerColor";
|
|
5
|
+
declare const enum EffectPropertyKey {
|
|
6
|
+
COLOR = 100,
|
|
7
|
+
PITCH = 101
|
|
8
|
+
}
|
|
9
|
+
export type EffectParameters = {
|
|
10
|
+
readonly scale?: number;
|
|
11
|
+
readonly color?: PlayerColor;
|
|
12
|
+
};
|
|
13
|
+
export declare class Effect extends Handle<jeffect> {
|
|
14
|
+
private [EffectPropertyKey.COLOR]?;
|
|
15
|
+
private [EffectPropertyKey.PITCH]?;
|
|
16
|
+
protected onDestroy(): HandleDestructor;
|
|
17
|
+
get color(): PlayerColor;
|
|
18
|
+
set color(color: PlayerColor);
|
|
19
|
+
get scale(): number;
|
|
20
|
+
set scale(scale: number);
|
|
21
|
+
get pitch(): number;
|
|
22
|
+
set pitch(pitch: number);
|
|
23
|
+
static create<T extends Effect>(this: typeof Effect & (new (handle: jeffect) => T), model: string, pos: Vec2): T;
|
|
24
|
+
static createTarget<T extends Effect>(this: typeof Effect & (new (handle: jeffect) => T), model: string, target: Widget, attachPoint: string): T;
|
|
25
|
+
static flash(modelPath: string, ...args: [
|
|
26
|
+
...pointOrWidget: [x: number, y: number] | [widget: Widget, attachmentPoint: string],
|
|
27
|
+
...parametersOrDuration: [parameters?: EffectParameters] | [duration?: number, parameters?: EffectParameters]
|
|
28
|
+
]): void;
|
|
29
|
+
static flashTarget(model: string, target: Widget, attachPoint: string, duration?: number): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local dummyPlayer
|
|
7
|
+
local ____handle = require("core.types.handle")
|
|
8
|
+
local Handle = ____handle.Handle
|
|
9
|
+
local ____playerColor = require("core.types.playerColor")
|
|
10
|
+
local PlayerColor = ____playerColor.PlayerColor
|
|
11
|
+
local ____player = require("core.types.player")
|
|
12
|
+
local Player = ____player.Player
|
|
13
|
+
local ____timer = require("core.types.timer")
|
|
14
|
+
local Timer = ____timer.Timer
|
|
15
|
+
local ____pairs = _G.pairs
|
|
16
|
+
local select = _G.select
|
|
17
|
+
local mathRad = math.rad
|
|
18
|
+
local addSpecialEffect = AddSpecialEffect
|
|
19
|
+
local addSpecialEffectTarget = AddSpecialEffectTarget
|
|
20
|
+
local destroyEffect = DestroyEffect
|
|
21
|
+
local getSpecialEffectScale = BlzGetSpecialEffectScale
|
|
22
|
+
local playSpecialEffect = BlzPlaySpecialEffect
|
|
23
|
+
local setSpecialEffectScale = BlzSetSpecialEffectScale
|
|
24
|
+
local setSpecialEffectPitch = BlzSetSpecialEffectPitch
|
|
25
|
+
local setSpecialEffectColorByPlayer = BlzSetSpecialEffectColorByPlayer
|
|
26
|
+
local specialEffectAddSubAnimation = BlzSpecialEffectAddSubAnimation
|
|
27
|
+
local specialEffectClearSubAnimations = BlzSpecialEffectClearSubAnimations
|
|
28
|
+
local specialEffectRemoveSubAnimation = BlzSpecialEffectRemoveSubAnimation
|
|
29
|
+
local animTypeByAnimationName = {
|
|
30
|
+
attack = ANIM_TYPE_ATTACK,
|
|
31
|
+
birth = ANIM_TYPE_BIRTH,
|
|
32
|
+
death = ANIM_TYPE_DEATH,
|
|
33
|
+
decay = ANIM_TYPE_DECAY,
|
|
34
|
+
dissipate = ANIM_TYPE_DISSIPATE,
|
|
35
|
+
morph = ANIM_TYPE_MORPH,
|
|
36
|
+
portrait = ANIM_TYPE_PORTRAIT,
|
|
37
|
+
sleep = ANIM_TYPE_SLEEP,
|
|
38
|
+
spell = ANIM_TYPE_SPELL,
|
|
39
|
+
stand = ANIM_TYPE_STAND,
|
|
40
|
+
walk = ANIM_TYPE_WALK
|
|
41
|
+
}
|
|
42
|
+
local subAnimTypeByAnimationQualifier = {
|
|
43
|
+
alternate = SUBANIM_TYPE_ROOTED,
|
|
44
|
+
alternateex = SUBANIM_TYPE_ALTERNATE_EX,
|
|
45
|
+
chain = SUBANIM_TYPE_CHAINLIGHTNING,
|
|
46
|
+
channel = SUBANIM_TYPE_CHANNEL,
|
|
47
|
+
complete = SUBANIM_TYPE_COMPLETE,
|
|
48
|
+
critical = SUBANIM_TYPE_CRITICAL,
|
|
49
|
+
defend = SUBANIM_TYPE_DEFEND,
|
|
50
|
+
drain = SUBANIM_TYPE_DRAIN,
|
|
51
|
+
eattree = SUBANIM_TYPE_EATTREE,
|
|
52
|
+
fast = SUBANIM_TYPE_FAST,
|
|
53
|
+
fill = SUBANIM_TYPE_FILL,
|
|
54
|
+
flail = SUBANIM_TYPE_FLAIL,
|
|
55
|
+
flesh = SUBANIM_TYPE_FLESH,
|
|
56
|
+
fifth = SUBANIM_TYPE_FIFTH,
|
|
57
|
+
fire = SUBANIM_TYPE_FIRE,
|
|
58
|
+
first = SUBANIM_TYPE_FIRST,
|
|
59
|
+
five = SUBANIM_TYPE_FIVE,
|
|
60
|
+
four = SUBANIM_TYPE_FOUR,
|
|
61
|
+
fourth = SUBANIM_TYPE_FOURTH,
|
|
62
|
+
gold = SUBANIM_TYPE_GOLD,
|
|
63
|
+
hit = SUBANIM_TYPE_HIT,
|
|
64
|
+
large = SUBANIM_TYPE_LARGE,
|
|
65
|
+
left = SUBANIM_TYPE_LEFT,
|
|
66
|
+
light = SUBANIM_TYPE_LIGHT,
|
|
67
|
+
looping = SUBANIM_TYPE_LOOPING,
|
|
68
|
+
lumber = SUBANIM_TYPE_LUMBER,
|
|
69
|
+
medium = SUBANIM_TYPE_MEDIUM,
|
|
70
|
+
moderate = SUBANIM_TYPE_MODERATE,
|
|
71
|
+
off = SUBANIM_TYPE_OFF,
|
|
72
|
+
one = SUBANIM_TYPE_ONE,
|
|
73
|
+
puke = SUBANIM_TYPE_PUKE,
|
|
74
|
+
ready = SUBANIM_TYPE_READY,
|
|
75
|
+
right = SUBANIM_TYPE_RIGHT,
|
|
76
|
+
second = SUBANIM_TYPE_SECOND,
|
|
77
|
+
severe = SUBANIM_TYPE_SEVERE,
|
|
78
|
+
slam = SUBANIM_TYPE_SLAM,
|
|
79
|
+
small = SUBANIM_TYPE_SMALL,
|
|
80
|
+
spiked = SUBANIM_TYPE_SPIKED,
|
|
81
|
+
spin = SUBANIM_TYPE_SPIN,
|
|
82
|
+
swim = SUBANIM_TYPE_SWIM,
|
|
83
|
+
talk = SUBANIM_TYPE_TALK,
|
|
84
|
+
third = SUBANIM_TYPE_THIRD,
|
|
85
|
+
three = SUBANIM_TYPE_THREE,
|
|
86
|
+
throw = SUBANIM_TYPE_THROW,
|
|
87
|
+
two = SUBANIM_TYPE_TWO,
|
|
88
|
+
turn = SUBANIM_TYPE_TURN,
|
|
89
|
+
victory = SUBANIM_TYPE_VICTORY,
|
|
90
|
+
work = SUBANIM_TYPE_WORK,
|
|
91
|
+
wounded = SUBANIM_TYPE_WOUNDED,
|
|
92
|
+
upgrade = SUBANIM_TYPE_UPGRADE
|
|
93
|
+
}
|
|
94
|
+
local function setSpecialEffectColor(effect, color)
|
|
95
|
+
local dummyColor = dummyPlayer.color
|
|
96
|
+
dummyPlayer.color = color
|
|
97
|
+
setSpecialEffectColorByPlayer(effect, dummyPlayer.handle)
|
|
98
|
+
dummyPlayer.color = dummyColor
|
|
99
|
+
end
|
|
100
|
+
local setters = {scale = setSpecialEffectScale, color = setSpecialEffectColor}
|
|
101
|
+
dummyPlayer = Player.neutralExtra
|
|
102
|
+
local temporaryEffects = {}
|
|
103
|
+
local temporaryEffectsDurations = {}
|
|
104
|
+
local temporaryEffectsCount = 0
|
|
105
|
+
local period = 1 / 32
|
|
106
|
+
Timer.onPeriod[period]:addListener(function()
|
|
107
|
+
local i = 1
|
|
108
|
+
while i <= temporaryEffectsCount do
|
|
109
|
+
local duration = temporaryEffectsDurations[i]
|
|
110
|
+
if duration <= 0 then
|
|
111
|
+
destroyEffect(temporaryEffects[i])
|
|
112
|
+
temporaryEffects[i] = temporaryEffects[temporaryEffectsCount]
|
|
113
|
+
temporaryEffectsCount = temporaryEffectsCount - 1
|
|
114
|
+
else
|
|
115
|
+
temporaryEffectsDurations[i] = duration - period
|
|
116
|
+
i = i + 1
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end)
|
|
120
|
+
____exports.Effect = __TS__Class()
|
|
121
|
+
local Effect = ____exports.Effect
|
|
122
|
+
Effect.name = "Effect"
|
|
123
|
+
__TS__ClassExtends(Effect, Handle)
|
|
124
|
+
function Effect.prototype.onDestroy(self)
|
|
125
|
+
destroyEffect(self.handle)
|
|
126
|
+
return Handle.prototype.onDestroy(self)
|
|
127
|
+
end
|
|
128
|
+
function Effect.create(self, model, pos)
|
|
129
|
+
return self:of(addSpecialEffect(model, pos.x, pos.y))
|
|
130
|
+
end
|
|
131
|
+
function Effect.createTarget(self, model, target, attachPoint)
|
|
132
|
+
return self:of(addSpecialEffectTarget(model, target.handle, attachPoint))
|
|
133
|
+
end
|
|
134
|
+
function Effect.flash(self, modelPath, xOrWidget, yOrOrAttachmentPoint, parametersOrDuration, parameters)
|
|
135
|
+
if type(parametersOrDuration) ~= "number" then
|
|
136
|
+
parameters = parametersOrDuration
|
|
137
|
+
parametersOrDuration = nil
|
|
138
|
+
end
|
|
139
|
+
local effect = type(xOrWidget) == "number" and addSpecialEffect(modelPath, xOrWidget, yOrOrAttachmentPoint) or addSpecialEffectTarget(modelPath, xOrWidget.handle, yOrOrAttachmentPoint)
|
|
140
|
+
if parameters ~= nil then
|
|
141
|
+
for key, value in ____pairs(parameters) do
|
|
142
|
+
setters[key](effect, value)
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
if parametersOrDuration ~= nil and parametersOrDuration > 0 then
|
|
146
|
+
temporaryEffectsCount = temporaryEffectsCount + 1
|
|
147
|
+
temporaryEffects[temporaryEffectsCount] = effect
|
|
148
|
+
temporaryEffectsDurations[temporaryEffectsCount] = parametersOrDuration
|
|
149
|
+
return
|
|
150
|
+
end
|
|
151
|
+
destroyEffect(effect)
|
|
152
|
+
end
|
|
153
|
+
function Effect.flashTarget(self, model, target, attachPoint, duration)
|
|
154
|
+
local effect = addSpecialEffectTarget(model, target.handle, attachPoint)
|
|
155
|
+
if effect ~= nil then
|
|
156
|
+
if duration and duration > 0 then
|
|
157
|
+
temporaryEffectsCount = temporaryEffectsCount + 1
|
|
158
|
+
temporaryEffects[temporaryEffectsCount] = effect
|
|
159
|
+
temporaryEffectsDurations[temporaryEffectsCount] = duration
|
|
160
|
+
else
|
|
161
|
+
destroyEffect(effect)
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
__TS__SetDescriptor(
|
|
166
|
+
Effect.prototype,
|
|
167
|
+
"color",
|
|
168
|
+
{
|
|
169
|
+
get = function(self)
|
|
170
|
+
return self[100] or PlayerColor.black
|
|
171
|
+
end,
|
|
172
|
+
set = function(self, color)
|
|
173
|
+
setSpecialEffectColor(self.handle, color)
|
|
174
|
+
self[100] = color
|
|
175
|
+
end
|
|
176
|
+
},
|
|
177
|
+
true
|
|
178
|
+
)
|
|
179
|
+
__TS__SetDescriptor(
|
|
180
|
+
Effect.prototype,
|
|
181
|
+
"scale",
|
|
182
|
+
{
|
|
183
|
+
get = function(self)
|
|
184
|
+
return getSpecialEffectScale(self.handle)
|
|
185
|
+
end,
|
|
186
|
+
set = function(self, scale)
|
|
187
|
+
setSpecialEffectScale(self.handle, scale)
|
|
188
|
+
end
|
|
189
|
+
},
|
|
190
|
+
true
|
|
191
|
+
)
|
|
192
|
+
__TS__SetDescriptor(
|
|
193
|
+
Effect.prototype,
|
|
194
|
+
"pitch",
|
|
195
|
+
{
|
|
196
|
+
get = function(self)
|
|
197
|
+
return self[101] or 0
|
|
198
|
+
end,
|
|
199
|
+
set = function(self, pitch)
|
|
200
|
+
setSpecialEffectPitch(
|
|
201
|
+
self.handle,
|
|
202
|
+
-mathRad(pitch)
|
|
203
|
+
)
|
|
204
|
+
self[101] = pitch
|
|
205
|
+
end
|
|
206
|
+
},
|
|
207
|
+
true
|
|
208
|
+
)
|
|
209
|
+
return ____exports
|