warscript 0.0.1-dev.9d56c5c → 0.0.1-dev.9e6f20e

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.
Files changed (316) hide show
  1. package/attributes.d.ts +6 -1
  2. package/attributes.lua +17 -1
  3. package/binaryreader.d.ts +1 -0
  4. package/binaryreader.lua +3 -0
  5. package/config.d.ts +5 -0
  6. package/config.lua +10 -0
  7. package/core/types/effect.d.ts +14 -6
  8. package/core/types/effect.lua +131 -35
  9. package/core/types/frame.d.ts +9 -1
  10. package/core/types/frame.lua +193 -23
  11. package/core/types/group.d.ts +0 -1
  12. package/core/types/handle.lua +6 -9
  13. package/core/types/image.d.ts +0 -1
  14. package/core/types/item.d.ts +1 -0
  15. package/core/types/item.lua +1 -0
  16. package/core/types/missile.d.ts +2 -2
  17. package/core/types/missile.lua +8 -2
  18. package/core/types/player.d.ts +17 -1
  19. package/core/types/player.lua +70 -24
  20. package/core/types/playerCamera.d.ts +2 -0
  21. package/core/types/playerCamera.lua +123 -5
  22. package/core/types/sound.d.ts +17 -24
  23. package/core/types/sound.lua +100 -25
  24. package/core/types/tileCell.d.ts +11 -1
  25. package/core/types/tileCell.lua +97 -0
  26. package/core/types/timer.d.ts +9 -8
  27. package/core/types/timer.lua +45 -23
  28. package/core/types/unit.lua +8 -0
  29. package/core/util.d.ts +1 -1
  30. package/core/util.lua +18 -1
  31. package/decl/index.d.ts +1 -0
  32. package/decl/native.d.ts +846 -790
  33. package/destroyable.d.ts +1 -0
  34. package/destroyable.lua +9 -0
  35. package/engine/ability.d.ts +1 -1
  36. package/engine/behavior.d.ts +24 -11
  37. package/engine/behavior.lua +233 -73
  38. package/engine/behaviour/ability/always-enabled.d.ts +7 -0
  39. package/engine/behaviour/ability/always-enabled.lua +31 -0
  40. package/engine/behaviour/ability/apply-buff.d.ts +8 -5
  41. package/engine/behaviour/ability/apply-buff.lua +36 -4
  42. package/engine/behaviour/ability/apply-unit-behavior.d.ts +6 -1
  43. package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
  44. package/engine/behaviour/ability/damage.d.ts +42 -11
  45. package/engine/behaviour/ability/damage.lua +89 -37
  46. package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
  47. package/engine/behaviour/ability/emulate-impact.lua +44 -0
  48. package/engine/behaviour/ability/heal.d.ts +33 -6
  49. package/engine/behaviour/ability/heal.lua +89 -10
  50. package/engine/behaviour/ability/instant-impact.d.ts +2 -2
  51. package/engine/behaviour/ability/instant-impact.lua +4 -19
  52. package/engine/behaviour/ability/on-command-impact.d.ts +8 -0
  53. package/engine/behaviour/ability/on-command-impact.lua +25 -0
  54. package/engine/behaviour/ability/remove-buffs.d.ts +25 -0
  55. package/engine/behaviour/ability/remove-buffs.lua +49 -0
  56. package/engine/behaviour/ability/restore-mana.d.ts +15 -0
  57. package/engine/behaviour/ability/restore-mana.lua +29 -0
  58. package/engine/behaviour/ability.d.ts +35 -7
  59. package/engine/behaviour/ability.lua +183 -27
  60. package/engine/behaviour/unit/stun-immunity.d.ts +12 -7
  61. package/engine/behaviour/unit/stun-immunity.lua +57 -31
  62. package/engine/behaviour/unit.d.ts +48 -4
  63. package/engine/behaviour/unit.lua +292 -2
  64. package/engine/buff.d.ts +160 -53
  65. package/engine/buff.lua +711 -269
  66. package/engine/game-map.d.ts +7 -0
  67. package/engine/game-map.lua +32 -0
  68. package/engine/internal/ability.d.ts +23 -14
  69. package/engine/internal/ability.lua +129 -85
  70. package/engine/internal/item/ability.lua +162 -4
  71. package/engine/internal/item/fields.d.ts +12 -0
  72. package/engine/internal/item/fields.lua +33 -0
  73. package/engine/internal/item+owner.lua +12 -6
  74. package/engine/internal/item.d.ts +18 -18
  75. package/engine/internal/item.lua +208 -94
  76. package/engine/internal/mechanics/ability-duration.lua +1 -1
  77. package/engine/internal/mechanics/cast-ability.lua +6 -3
  78. package/engine/internal/misc/ability-disable-counter.lua +13 -0
  79. package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
  80. package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
  81. package/engine/internal/misc/frame-coordinates.d.ts +2 -0
  82. package/engine/internal/misc/frame-coordinates.lua +21 -0
  83. package/engine/internal/misc/get-terrain-z.d.ts +2 -0
  84. package/engine/internal/misc/get-terrain-z.lua +11 -0
  85. package/engine/internal/misc/player-local-handle.d.ts +2 -0
  86. package/engine/internal/misc/player-local-handle.lua +5 -0
  87. package/engine/internal/object-data/armor-bonus.d.ts +2 -0
  88. package/engine/internal/object-data/attribute-bonus.lua +2 -2
  89. package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
  90. package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
  91. package/engine/internal/object-data/evasion-probability.d.ts +2 -0
  92. package/engine/internal/object-data/evasion-probability.lua +16 -0
  93. package/engine/internal/object-data/health-bonus.d.ts +2 -0
  94. package/engine/internal/object-data/health-bonus.lua +16 -0
  95. package/engine/internal/object-data/mana-bonus.d.ts +2 -0
  96. package/engine/internal/object-data/mana-bonus.lua +16 -0
  97. package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
  98. package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
  99. package/engine/internal/unit/ability.d.ts +45 -1
  100. package/engine/internal/unit/ability.lua +142 -19
  101. package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
  102. package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
  103. package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
  104. package/engine/internal/unit/add-item-to-slot.lua +52 -0
  105. package/engine/internal/unit/allowed-targets.d.ts +1 -1
  106. package/engine/internal/unit/allowed-targets.lua +9 -1
  107. package/engine/internal/unit/attributes.d.ts +17 -0
  108. package/engine/internal/unit/attributes.lua +46 -0
  109. package/engine/internal/unit/bonus.d.ts +17 -8
  110. package/engine/internal/unit/bonus.lua +56 -4
  111. package/engine/internal/unit/buff.d.ts +2 -2
  112. package/engine/internal/unit/buff.lua +32 -17
  113. package/engine/internal/unit/fly-height.d.ts +7 -0
  114. package/engine/internal/unit/fly-height.lua +20 -0
  115. package/engine/internal/unit/ignore-events-items.d.ts +2 -0
  116. package/engine/internal/unit/ignore-events-items.lua +5 -0
  117. package/engine/internal/unit/interrupts.d.ts +12 -0
  118. package/engine/internal/unit/interrupts.lua +28 -0
  119. package/engine/internal/unit/item.d.ts +24 -0
  120. package/engine/internal/unit/item.lua +78 -0
  121. package/engine/internal/unit/main-selected.d.ts +13 -0
  122. package/engine/internal/unit/main-selected.lua +36 -0
  123. package/engine/internal/unit/order.d.ts +20 -0
  124. package/engine/internal/unit/order.lua +136 -0
  125. package/engine/internal/unit/pseudo-passive-abilities.d.ts +2 -0
  126. package/engine/internal/unit/pseudo-passive-abilities.lua +11 -0
  127. package/engine/internal/unit/range-event.d.ts +12 -0
  128. package/engine/internal/unit/range-event.lua +90 -0
  129. package/engine/internal/unit/scale.d.ts +7 -0
  130. package/engine/internal/unit/scale.lua +20 -0
  131. package/engine/internal/unit+ability.lua +12 -3
  132. package/engine/internal/unit+bonus.lua +3 -3
  133. package/engine/internal/unit+damage.d.ts +2 -11
  134. package/engine/internal/unit+damage.lua +10 -14
  135. package/engine/internal/unit+spellSteal.lua +1 -2
  136. package/engine/internal/unit+transport.lua +4 -10
  137. package/engine/internal/unit-missile-launch.lua +70 -13
  138. package/engine/internal/unit.d.ts +65 -32
  139. package/engine/internal/unit.lua +503 -290
  140. package/engine/internal/utility.lua +12 -0
  141. package/engine/lightning.d.ts +12 -5
  142. package/engine/lightning.lua +48 -14
  143. package/engine/local-client.d.ts +14 -2
  144. package/engine/local-client.lua +168 -1
  145. package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
  146. package/engine/object-data/auxiliary/animation-name.lua +16 -0
  147. package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
  148. package/engine/object-data/auxiliary/armor-type.lua +46 -0
  149. package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -3
  150. package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
  151. package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
  152. package/engine/object-data/auxiliary/attack-type.lua +42 -0
  153. package/engine/object-data/auxiliary/combat-classification.d.ts +0 -2
  154. package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
  155. package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
  156. package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
  157. package/engine/object-data/auxiliary/movement-type.lua +22 -0
  158. package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
  159. package/engine/object-data/auxiliary/sound-eax.lua +2 -0
  160. package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
  161. package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
  162. package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
  163. package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
  164. package/engine/object-data/entry/ability-type/{armor-increase.d.ts → armor-bonus.d.ts} +3 -3
  165. package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
  166. package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
  167. package/engine/object-data/entry/ability-type/berserk.lua +13 -0
  168. package/engine/object-data/entry/ability-type/blank-configurable.d.ts +3 -1
  169. package/engine/object-data/entry/ability-type/blank-configurable.lua +42 -1
  170. package/engine/object-data/entry/ability-type/blank-passive.d.ts +0 -1
  171. package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
  172. package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
  173. package/engine/object-data/entry/ability-type/channel.d.ts +0 -1
  174. package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
  175. package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
  176. package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
  177. package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
  178. package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
  179. package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
  180. package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
  181. package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
  182. package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
  183. package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
  184. package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
  185. package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
  186. package/engine/object-data/entry/ability-type/mine.lua +39 -0
  187. package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
  188. package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
  189. package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
  190. package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
  191. package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
  192. package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
  193. package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
  194. package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
  195. package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
  196. package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
  197. package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
  198. package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
  199. package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
  200. package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
  201. package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
  202. package/engine/object-data/entry/ability-type/web.d.ts +12 -0
  203. package/engine/object-data/entry/ability-type/web.lua +52 -0
  204. package/engine/object-data/entry/ability-type.d.ts +21 -18
  205. package/engine/object-data/entry/ability-type.lua +177 -40
  206. package/engine/object-data/entry/buff-type/applicable.d.ts +0 -1
  207. package/engine/object-data/entry/buff-type/applicable.lua +122 -137
  208. package/engine/object-data/entry/buff-type/blank.d.ts +0 -1
  209. package/engine/object-data/entry/buff-type.d.ts +6 -13
  210. package/engine/object-data/entry/buff-type.lua +13 -29
  211. package/engine/object-data/entry/destructible-type.d.ts +28 -3
  212. package/engine/object-data/entry/destructible-type.lua +155 -0
  213. package/engine/object-data/entry/item-type/blank.d.ts +0 -1
  214. package/engine/object-data/entry/item-type.d.ts +15 -2
  215. package/engine/object-data/entry/item-type.lua +93 -2
  216. package/engine/object-data/entry/lightning-type.d.ts +1 -2
  217. package/engine/object-data/entry/sound-preset.d.ts +33 -0
  218. package/engine/object-data/entry/sound-preset.lua +140 -0
  219. package/engine/object-data/entry/unit-type.d.ts +25 -6
  220. package/engine/object-data/entry/unit-type.lua +258 -93
  221. package/engine/object-data/entry/upgrade/blank.d.ts +0 -1
  222. package/engine/object-data/entry/upgrade.d.ts +1 -2
  223. package/engine/object-data/entry/upgrade.lua +4 -4
  224. package/engine/object-data/entry.d.ts +18 -17
  225. package/engine/object-data/entry.lua +60 -32
  226. package/engine/object-data/utility/object-data-entry-id-generator.lua +7 -0
  227. package/engine/object-field/ability.d.ts +28 -5
  228. package/engine/object-field/ability.lua +61 -7
  229. package/engine/object-field/item.d.ts +22 -0
  230. package/engine/object-field/item.lua +118 -0
  231. package/engine/object-field/unit.d.ts +72 -3
  232. package/engine/object-field/unit.lua +268 -7
  233. package/engine/object-field.d.ts +26 -8
  234. package/engine/object-field.lua +362 -117
  235. package/engine/random.d.ts +11 -0
  236. package/engine/random.lua +30 -0
  237. package/engine/standard/entries/buff-type.d.ts +3 -0
  238. package/engine/standard/entries/buff-type.lua +3 -0
  239. package/engine/standard/entries/sound-preset.d.ts +10 -0
  240. package/engine/standard/entries/sound-preset.lua +10 -0
  241. package/engine/standard/entries/unit-type.d.ts +18 -0
  242. package/engine/standard/entries/unit-type.lua +18 -0
  243. package/engine/standard/fields/ability.d.ts +5 -3
  244. package/engine/standard/fields/ability.lua +5 -3
  245. package/engine/standard/fields/item.d.ts +4 -0
  246. package/engine/standard/fields/item.lua +6 -0
  247. package/engine/standard/fields/unit.d.ts +12 -0
  248. package/engine/standard/fields/unit.lua +20 -0
  249. package/engine/synchronization.d.ts +11 -0
  250. package/engine/synchronization.lua +77 -0
  251. package/engine/text-tag.d.ts +36 -2
  252. package/engine/text-tag.lua +250 -10
  253. package/engine/unit.d.ts +9 -0
  254. package/engine/unit.lua +18 -2
  255. package/event.d.ts +3 -4
  256. package/event.lua +9 -5
  257. package/index.d.ts +1 -0
  258. package/index.lua +1 -0
  259. package/lualib_bundle.lua +147 -43
  260. package/math/vec2.d.ts +2 -9
  261. package/math.d.ts +2 -2
  262. package/math.lua +14 -0
  263. package/net/socket.d.ts +7 -1
  264. package/net/socket.lua +45 -4
  265. package/network.d.ts +1 -0
  266. package/network.lua +28 -3
  267. package/objutil/ability.d.ts +0 -1
  268. package/objutil/buff.d.ts +0 -1
  269. package/objutil/buff.lua +12 -11
  270. package/objutil/object.d.ts +0 -1
  271. package/objutil/object.lua +1 -1
  272. package/objutil/unit.d.ts +0 -1
  273. package/objutil/unit.lua +8 -0
  274. package/operation.d.ts +8 -1
  275. package/operation.lua +38 -18
  276. package/package.json +13 -13
  277. package/patch-lua.d.ts +0 -0
  278. package/patch-lua.lua +25 -0
  279. package/patch-lualib.lua +1 -1
  280. package/property.d.ts +55 -0
  281. package/property.lua +374 -0
  282. package/string.d.ts +16 -0
  283. package/string.lua +5 -0
  284. package/util/stream.d.ts +0 -1
  285. package/utility/arrays.d.ts +13 -5
  286. package/utility/arrays.lua +45 -3
  287. package/utility/bit-set.d.ts +0 -2
  288. package/utility/callback-array.d.ts +17 -0
  289. package/utility/callback-array.lua +61 -0
  290. package/utility/functions.d.ts +8 -0
  291. package/utility/functions.lua +13 -0
  292. package/utility/lazy.d.ts +2 -0
  293. package/utility/lazy.lua +14 -0
  294. package/utility/linked-map.d.ts +35 -0
  295. package/utility/linked-map.lua +107 -0
  296. package/utility/linked-set.d.ts +16 -4
  297. package/utility/linked-set.lua +54 -3
  298. package/utility/lua-maps.d.ts +16 -4
  299. package/utility/lua-maps.lua +53 -2
  300. package/utility/lua-sets.d.ts +3 -2
  301. package/utility/lua-sets.lua +7 -0
  302. package/utility/random.d.ts +102 -0
  303. package/utility/random.lua +273 -0
  304. package/utility/records.lua +20 -1
  305. package/utility/reflection.lua +11 -7
  306. package/utility/types.d.ts +4 -0
  307. package/utility/unordered-map.d.ts +27 -0
  308. package/utility/unordered-map.lua +99 -0
  309. package/core/mapbounds.d.ts +0 -8
  310. package/core/mapbounds.lua +0 -12
  311. package/core/types/order.d.ts +0 -25
  312. package/core/types/order.lua +0 -55
  313. /package/engine/internal/{object-data/armor-increase.d.ts → misc/ability-disable-counter.d.ts} +0 -0
  314. /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
  315. /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
  316. /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
@@ -1,9 +1,9 @@
1
1
  local ____exports = {}
2
2
  local ____unit = require("engine.internal.unit")
3
3
  local Unit = ____unit.Unit
4
- local ____armor_2Dincrease = require("engine.internal.object-data.armor-increase")
5
- local ARMOR_BONUS_DUMMY_ABILITY_FIELD = ____armor_2Dincrease.ARMOR_BONUS_DUMMY_ABILITY_FIELD
6
- local ARMOR_BONUS_DUMMY_ABILITY_TYPE_ID = ____armor_2Dincrease.ARMOR_BONUS_DUMMY_ABILITY_TYPE_ID
4
+ local ____armor_2Dbonus = require("engine.internal.object-data.armor-bonus")
5
+ local ARMOR_BONUS_DUMMY_ABILITY_FIELD = ____armor_2Dbonus.ARMOR_BONUS_DUMMY_ABILITY_FIELD
6
+ local ARMOR_BONUS_DUMMY_ABILITY_TYPE_ID = ____armor_2Dbonus.ARMOR_BONUS_DUMMY_ABILITY_TYPE_ID
7
7
  local ____utility = require("engine.internal.utility")
8
8
  local addInternalAbility = ____utility.addInternalAbility
9
9
  local ____arrays = require("utility.arrays")
@@ -21,10 +21,44 @@ local AUTO_ATTACK_DAMAGE_INCREASE_DUMMY_ABILITY_TYPE_ID = ____auto_2Dattack_2Dda
21
21
  local ____movement_2Dspeed_2Dincrease_2Dfactor = require("engine.internal.object-data.movement-speed-increase-factor")
22
22
  local MOVEMENT_SPEED_INCREASE_FACTOR_ABILITY_FIELD = ____movement_2Dspeed_2Dincrease_2Dfactor.MOVEMENT_SPEED_INCREASE_FACTOR_ABILITY_FIELD
23
23
  local MOVEMENT_SPEED_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID = ____movement_2Dspeed_2Dincrease_2Dfactor.MOVEMENT_SPEED_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID
24
+ local ____evasion_2Dprobability = require("engine.internal.object-data.evasion-probability")
25
+ local EVASION_PROBABILITY_ABILITY_FIELD = ____evasion_2Dprobability.EVASION_PROBABILITY_ABILITY_FIELD
26
+ local EVASION_PROBABILITY_DUMMY_ABILITY_TYPE_ID = ____evasion_2Dprobability.EVASION_PROBABILITY_DUMMY_ABILITY_TYPE_ID
27
+ local ____health_2Dbonus = require("engine.internal.object-data.health-bonus")
28
+ local HEALTH_BONUS_DUMMY_ABILITY_FIELD = ____health_2Dbonus.HEALTH_BONUS_DUMMY_ABILITY_FIELD
29
+ local HEALTH_BONUS_DUMMY_ABILITY_TYPE_ID = ____health_2Dbonus.HEALTH_BONUS_DUMMY_ABILITY_TYPE_ID
30
+ local ____mana_2Dbonus = require("engine.internal.object-data.mana-bonus")
31
+ local MANA_BONUS_DUMMY_ABILITY_FIELD = ____mana_2Dbonus.MANA_BONUS_DUMMY_ABILITY_FIELD
32
+ local MANA_BONUS_DUMMY_ABILITY_TYPE_ID = ____mana_2Dbonus.MANA_BONUS_DUMMY_ABILITY_TYPE_ID
33
+ local ____mana_2Dregeneration_2Drate_2Dincrease_2Dfactor = require("engine.internal.object-data.mana-regeneration-rate-increase-factor")
34
+ local MANA_REGENERATION_RATE_INCREASE_FACTOR_ABILITY_FIELD = ____mana_2Dregeneration_2Drate_2Dincrease_2Dfactor.MANA_REGENERATION_RATE_INCREASE_FACTOR_ABILITY_FIELD
35
+ local MANA_REGENERATION_RATE_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID = ____mana_2Dregeneration_2Drate_2Dincrease_2Dfactor.MANA_REGENERATION_RATE_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID
36
+ local damageFactorByUnit = {}
24
37
  local receivedDamageFactorByUnit = {}
38
+ local function atLeastOnceProbability(array)
39
+ local oppositeEventProbability = 1
40
+ for i = 1, #array do
41
+ oppositeEventProbability = oppositeEventProbability * (1 - array[i])
42
+ end
43
+ return 1 - oppositeEventProbability
44
+ end
25
45
  ____exports.UnitBonusType = {}
26
46
  local UnitBonusType = ____exports.UnitBonusType
27
47
  do
48
+ UnitBonusType.HEALTH = {
49
+ abilityTypeId = HEALTH_BONUS_DUMMY_ABILITY_TYPE_ID,
50
+ field = HEALTH_BONUS_DUMMY_ABILITY_FIELD,
51
+ integer = true,
52
+ reduce = sum,
53
+ initialValue = 0
54
+ }
55
+ UnitBonusType.MANA = {
56
+ abilityTypeId = MANA_BONUS_DUMMY_ABILITY_TYPE_ID,
57
+ field = MANA_BONUS_DUMMY_ABILITY_FIELD,
58
+ integer = true,
59
+ reduce = sum,
60
+ initialValue = 0
61
+ }
28
62
  UnitBonusType.ARMOR = {
29
63
  abilityTypeId = ARMOR_BONUS_DUMMY_ABILITY_TYPE_ID,
30
64
  field = ARMOR_BONUS_DUMMY_ABILITY_FIELD,
@@ -46,14 +80,29 @@ do
46
80
  reduce = sum,
47
81
  initialValue = 0
48
82
  }
49
- UnitBonusType.DAMAGE = {
83
+ UnitBonusType.AUTO_ATTACK_DAMAGE = {
50
84
  abilityTypeId = AUTO_ATTACK_DAMAGE_INCREASE_DUMMY_ABILITY_TYPE_ID,
51
85
  field = AUTO_ATTACK_DAMAGE_INCREASE_ABILITY_FIELD,
52
86
  integer = false,
53
87
  reduce = sum,
54
88
  initialValue = 0
55
89
  }
90
+ UnitBonusType.DAMAGE_FACTOR = {reduce = product, valueByUnit = damageFactorByUnit, initialValue = 1}
56
91
  UnitBonusType.RECEIVED_DAMAGE_FACTOR = {reduce = product, valueByUnit = receivedDamageFactorByUnit, initialValue = 1}
92
+ UnitBonusType.EVASION_PROBABILITY = {
93
+ abilityTypeId = EVASION_PROBABILITY_DUMMY_ABILITY_TYPE_ID,
94
+ field = EVASION_PROBABILITY_ABILITY_FIELD,
95
+ integer = false,
96
+ reduce = atLeastOnceProbability,
97
+ initialValue = 0
98
+ }
99
+ UnitBonusType.MANA_REGENERATION_RATE_FACTOR = {
100
+ abilityTypeId = MANA_REGENERATION_RATE_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID,
101
+ field = MANA_REGENERATION_RATE_INCREASE_FACTOR_ABILITY_FIELD,
102
+ integer = false,
103
+ reduce = sum,
104
+ initialValue = 0
105
+ }
57
106
  end
58
107
  local bonusesByUnitByBonusType = {}
59
108
  local nextId = 1
@@ -180,6 +229,9 @@ end
180
229
  Unit.onDamage:addListener(
181
230
  4,
182
231
  function(source, target, event)
232
+ if source ~= nil and damageFactorByUnit[source] ~= nil then
233
+ event.amount = event.amount * damageFactorByUnit[source]
234
+ end
183
235
  if receivedDamageFactorByUnit[target] ~= nil then
184
236
  event.amount = event.amount * receivedDamageFactorByUnit[target]
185
237
  end
@@ -32,7 +32,7 @@ declare module "../unit" {
32
32
  * @param includeAuras Whether to remove aura buffs. Default `true`.
33
33
  * @param autoDispel Unknown. Default `false`.
34
34
  */
35
- removeBuffs(polarity?: BuffPolarity, resistanceType?: BuffResistanceType, includeExpirationTimers?: boolean, includeAuras?: boolean, autoDispel?: boolean): void;
36
- removeBuffs(buffTypeIds: number[]): void;
35
+ removeBuffs(polarity?: BuffPolarity, resistanceType?: BuffResistanceType, includeExpirationTimers?: boolean, includeAuras?: boolean, autoDispel?: boolean): number;
36
+ removeBuffs(buffTypeIds: number[]): number;
37
37
  }
38
38
  }
@@ -1,7 +1,3 @@
1
- local ____lualib = require("lualib_bundle")
2
- local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
3
- local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
4
- local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
5
1
  local ____exports = {}
6
2
  local ____buff = require("engine.buff")
7
3
  local checkBuff = ____buff.checkBuff
@@ -46,36 +42,55 @@ Unit.prototype.countBuffs = function(self, polarity, resistanceType, includeExpi
46
42
  )
47
43
  end
48
44
  Unit.prototype.removeBuffs = function(self, polarityOrBuffTypeIds, resistanceType, includeExpirationTimers, includeAuras, autoDispel)
45
+ local handle = self.handle
46
+ local cnt
49
47
  if type(polarityOrBuffTypeIds) == "table" then
50
- local handle = self.handle
48
+ cnt = 0
51
49
  for i = 1, #polarityOrBuffTypeIds do
52
- unitRemoveAbility(handle, polarityOrBuffTypeIds[i])
50
+ cnt = cnt + (unitRemoveAbility(handle, polarityOrBuffTypeIds[i]) and 1 or 0)
53
51
  end
54
52
  else
55
- local ____array_3 = __TS__SparseArrayNew(
56
- self.handle,
57
- (polarityOrBuffTypeIds or 3) & 1 ~= 0,
58
- (polarityOrBuffTypeIds or 3) & 2 ~= 0,
59
- (resistanceType or 0) & 1 ~= 0,
60
- (resistanceType or 0) & 2 ~= 0
61
- )
53
+ local positive = (polarityOrBuffTypeIds or 3) & 1 ~= 0
54
+ local negative = (polarityOrBuffTypeIds or 3) & 2 ~= 0
55
+ local magic = (resistanceType or 0) & 1 ~= 0
56
+ local physical = (resistanceType or 0) & 2 ~= 0
62
57
  local ____includeExpirationTimers_0 = includeExpirationTimers
63
58
  if ____includeExpirationTimers_0 == nil then
64
59
  ____includeExpirationTimers_0 = true
65
60
  end
66
- __TS__SparseArrayPush(____array_3, ____includeExpirationTimers_0)
61
+ includeExpirationTimers = ____includeExpirationTimers_0
67
62
  local ____includeAuras_1 = includeAuras
68
63
  if ____includeAuras_1 == nil then
69
64
  ____includeAuras_1 = true
70
65
  end
71
- __TS__SparseArrayPush(____array_3, ____includeAuras_1)
66
+ includeAuras = ____includeAuras_1
72
67
  local ____autoDispel_2 = autoDispel
73
68
  if ____autoDispel_2 == nil then
74
69
  ____autoDispel_2 = false
75
70
  end
76
- __TS__SparseArrayPush(____array_3, ____autoDispel_2)
77
- unitRemoveBuffsEx(__TS__SparseArraySpread(____array_3))
71
+ autoDispel = ____autoDispel_2
72
+ cnt = unitCountBuffsEx(
73
+ handle,
74
+ positive,
75
+ negative,
76
+ magic,
77
+ physical,
78
+ includeExpirationTimers,
79
+ includeAuras,
80
+ autoDispel
81
+ )
82
+ unitRemoveBuffsEx(
83
+ handle,
84
+ positive,
85
+ negative,
86
+ magic,
87
+ physical,
88
+ includeExpirationTimers,
89
+ includeAuras,
90
+ autoDispel
91
+ )
78
92
  end
79
93
  checkBuffs(self)
94
+ return cnt
80
95
  end
81
96
  return ____exports
@@ -0,0 +1,7 @@
1
+ /** @noSelfInFile */
2
+ declare module "../unit" {
3
+ interface Unit {
4
+ flyHeight: number;
5
+ }
6
+ }
7
+ export {};
@@ -0,0 +1,20 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
3
+ local ____exports = {}
4
+ local ____unit = require("engine.internal.unit")
5
+ local Unit = ____unit.Unit
6
+ local ____unit = require("engine.standard.fields.unit")
7
+ local FLY_HEIGHT_UNIT_FIELD = ____unit.FLY_HEIGHT_UNIT_FIELD
8
+ __TS__ObjectDefineProperty(
9
+ Unit.prototype,
10
+ "flyHeight",
11
+ {
12
+ get = function(self)
13
+ return FLY_HEIGHT_UNIT_FIELD:getValue(self)
14
+ end,
15
+ set = function(self, value)
16
+ FLY_HEIGHT_UNIT_FIELD:setValue(self, value)
17
+ end
18
+ }
19
+ )
20
+ return ____exports
@@ -0,0 +1,2 @@
1
+ /** @noSelfInFile */
2
+ export {};
@@ -0,0 +1,5 @@
1
+ local ____exports = {}
2
+ ---
3
+ -- @internal For use by internal systems only.
4
+ ____exports.ignoreEventsItems = {}
5
+ return ____exports
@@ -0,0 +1,12 @@
1
+ /** @noSelfInFile */
2
+ declare module "../unit" {
3
+ interface Unit {
4
+ interruptAttack(this: Unit): void;
5
+ }
6
+ }
7
+ declare module "../unit" {
8
+ interface Unit {
9
+ interruptMovement(this: Unit): void;
10
+ }
11
+ }
12
+ export {};
@@ -0,0 +1,28 @@
1
+ local ____exports = {}
2
+ local ____unit = require("engine.internal.unit")
3
+ local Unit = ____unit.Unit
4
+ local ____unit_2Dmissile_2Dlaunch = require("engine.internal.unit-missile-launch")
5
+ local resetAutoAttackTimer = ____unit_2Dmissile_2Dlaunch.resetAutoAttackTimer
6
+ local unitDisableAbility = BlzUnitDisableAbility
7
+ local unitInterruptAttack = BlzUnitInterruptAttack
8
+ Unit.prototype.interruptAttack = function(self)
9
+ unitInterruptAttack(self.handle)
10
+ resetAutoAttackTimer(self)
11
+ end
12
+ Unit.prototype.interruptMovement = function(self)
13
+ local handle = self.handle
14
+ unitDisableAbility(
15
+ handle,
16
+ fourCC("Amov"),
17
+ true,
18
+ false
19
+ )
20
+ unitDisableAbility(
21
+ handle,
22
+ fourCC("Amov"),
23
+ false,
24
+ false
25
+ )
26
+ resetAutoAttackTimer(self)
27
+ end
28
+ return ____exports
@@ -0,0 +1,24 @@
1
+ /** @noSelfInFile */
2
+ import { Item } from "../item";
3
+ export interface UnitItems extends ReadonlyArray<Item | undefined> {
4
+ readonly length: 0 | 1 | 2 | 3 | 4 | 5 | 6;
5
+ [0]: Item | undefined;
6
+ [1]: Item | undefined;
7
+ [2]: Item | undefined;
8
+ [3]: Item | undefined;
9
+ [4]: Item | undefined;
10
+ [5]: Item | undefined;
11
+ }
12
+ export declare class UnitItems {
13
+ constructor(handle: junit);
14
+ findSlot(item: Item): 0 | 1 | 2 | 3 | 4 | 5 | undefined;
15
+ protected __newindex(slot: number, item: Item | undefined): void;
16
+ protected __index(key: string | number): unknown;
17
+ protected __len(): number;
18
+ protected __ipairs(): LuaIterator<LuaMultiReturn<[number, Item | undefined]>, junit>;
19
+ }
20
+ declare module "../unit" {
21
+ interface Unit {
22
+ readonly items: UnitItems;
23
+ }
24
+ }
@@ -0,0 +1,78 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__New = ____lualib.__TS__New
4
+ local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
5
+ local ____exports = {}
6
+ local ____item = require("engine.internal.item")
7
+ local Item = ____item.Item
8
+ local ____unit = require("engine.internal.unit")
9
+ local Unit = ____unit.Unit
10
+ local ____utility = require("engine.internal.utility")
11
+ local findUnitItemSlot = ____utility.findUnitItemSlot
12
+ local ____add_2Ditem_2Dto_2Dslot = require("engine.internal.unit.add-item-to-slot")
13
+ local unitAddItemToSlot = ____add_2Ditem_2Dto_2Dslot.unitAddItemToSlot
14
+ local rawset = _G.rawset
15
+ local ____type = _G.type
16
+ local isItemPowerup = IsItemPowerup
17
+ local setItemBooleanField = BlzSetItemBooleanField
18
+ local unitInventorySize = UnitInventorySize
19
+ local unitItemInSlot = UnitItemInSlot
20
+ local unitRemoveItemFromSlot = UnitRemoveItemFromSlot
21
+ local handleByUnitItems = setmetatable({}, {__mode = "k"})
22
+ local function unitItemsNext(handle, index)
23
+ local slot = index & 7
24
+ if index >> 3 == slot then
25
+ return nil, nil
26
+ end
27
+ return index + 1, Item:of(unitItemInSlot(handle, slot))
28
+ end
29
+ ____exports.UnitItems = __TS__Class()
30
+ local UnitItems = ____exports.UnitItems
31
+ UnitItems.name = "UnitItems"
32
+ function UnitItems.prototype.____constructor(self, handle)
33
+ handleByUnitItems[self] = handle
34
+ end
35
+ function UnitItems.prototype.findSlot(self, item)
36
+ return findUnitItemSlot(handleByUnitItems[self], item.handle)
37
+ end
38
+ function UnitItems.prototype.__newindex(self, slot, item)
39
+ local handle = handleByUnitItems[self]
40
+ if slot < 1 or slot > unitInventorySize(handle) then
41
+ return
42
+ end
43
+ unitRemoveItemFromSlot(handle, slot - 1)
44
+ if item ~= nil then
45
+ local itemHandle = item.handle
46
+ local isPowerup = isItemPowerup(itemHandle)
47
+ if isPowerup then
48
+ setItemBooleanField(itemHandle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, false)
49
+ end
50
+ unitAddItemToSlot(handle, itemHandle, slot - 1)
51
+ if isPowerup then
52
+ setItemBooleanField(itemHandle, ITEM_BF_USE_AUTOMATICALLY_WHEN_ACQUIRED, true)
53
+ end
54
+ end
55
+ end
56
+ function UnitItems.prototype.__index(self, key)
57
+ if ____type(key) == "number" then
58
+ return Item:of(unitItemInSlot(handleByUnitItems[self], key - 1))
59
+ end
60
+ return rawget(____exports.UnitItems.prototype, key)
61
+ end
62
+ function UnitItems.prototype.__len(self)
63
+ return unitInventorySize(handleByUnitItems[self])
64
+ end
65
+ function UnitItems.prototype.__ipairs(self)
66
+ local handle = handleByUnitItems[self]
67
+ return unitItemsNext, handle, unitInventorySize(handle) << 3
68
+ end
69
+ __TS__ObjectDefineProperty(
70
+ Unit.prototype,
71
+ "items",
72
+ {get = function(self)
73
+ local items = __TS__New(____exports.UnitItems, self.handle)
74
+ rawset(self, "items", items)
75
+ return items
76
+ end}
77
+ )
78
+ return ____exports
@@ -0,0 +1,13 @@
1
+ /** @noSelfInFile */
2
+ import { Player } from "../../../core/types/player";
3
+ import { Event } from "../../../event";
4
+ declare module "../unit" {
5
+ namespace Unit {
6
+ const mainSelectedUnitChangeEvent: Event<[Player]>;
7
+ }
8
+ }
9
+ declare module "../unit" {
10
+ namespace Unit {
11
+ const getMainSelectedOf: (player: Player) => Unit | undefined;
12
+ }
13
+ }
@@ -0,0 +1,36 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__New = ____lualib.__TS__New
3
+ local ____exports = {}
4
+ local ____local_2Dclient = require("engine.local-client")
5
+ local LocalClient = ____local_2Dclient.LocalClient
6
+ local ____unit = require("engine.internal.unit")
7
+ local Unit = ____unit.Unit
8
+ local ____event = require("event")
9
+ local Event = ____event.Event
10
+ local ____synchronization = require("engine.synchronization")
11
+ local ObjectBus = ____synchronization.ObjectBus
12
+ local mainSelectedUnitChangeEvent = __TS__New(Event)
13
+ rawset(Unit, "mainSelectedUnitChangeEvent", mainSelectedUnitChangeEvent)
14
+ local mainSelectedUnitByPlayer = {}
15
+ local unitBus = __TS__New(
16
+ ObjectBus,
17
+ function(unit) return unit.syncId end,
18
+ function(syncId) return Unit:getBySyncId(syncId) end
19
+ )
20
+ LocalClient.mainSelectedUnitChangeEvent:addListener(function()
21
+ unitBus:send(LocalClient.mainSelectedUnit)
22
+ end)
23
+ unitBus.event:addListener(function(player, unit)
24
+ if unit ~= mainSelectedUnitByPlayer[player] then
25
+ mainSelectedUnitByPlayer[player] = unit
26
+ Event.invoke(mainSelectedUnitChangeEvent, player)
27
+ end
28
+ end)
29
+ rawset(
30
+ Unit,
31
+ "getMainSelectedOf",
32
+ function(player)
33
+ return mainSelectedUnitByPlayer[player]
34
+ end
35
+ )
36
+ return ____exports
@@ -0,0 +1,20 @@
1
+ /** @noSelfInFile */
2
+ import { Widget } from "../../../core/types/widget";
3
+ export declare const enum OrderType {
4
+ IMMEDIATE = 0,
5
+ POINT = 1,
6
+ TARGET = 2
7
+ }
8
+ declare module "../unit" {
9
+ interface Unit {
10
+ readonly currentOrderType: OrderType;
11
+ readonly currentOrderId: number;
12
+ readonly currentOrderStartTime: number;
13
+ readonly currentOrderStartX: number;
14
+ readonly currentOrderStartY: number;
15
+ readonly currentOrderTargetX: number;
16
+ readonly currentOrderTargetY: number;
17
+ readonly currentOrderTarget?: Widget;
18
+ issueOrder(...order: [orderType: OrderType.IMMEDIATE, orderId: number] | [orderType: OrderType.POINT, orderId: number, x: number, y: number] | [orderType: OrderType.TARGET, orderId: number, target: Widget]): boolean;
19
+ }
20
+ }
@@ -0,0 +1,136 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
3
+ local ____exports = {}
4
+ local ____attributes = require("attributes")
5
+ local attribute = ____attributes.attribute
6
+ local ____unit = require("engine.internal.unit")
7
+ local Unit = ____unit.Unit
8
+ local ____game = require("core.game")
9
+ local elapsedTime = ____game.elapsedTime
10
+ local getUnitCurrentOrder = GetUnitCurrentOrder
11
+ local issueImmediateOrderById = IssueImmediateOrderById
12
+ local issuePointOrderById = IssuePointOrderById
13
+ local issueTargetOrderById = IssueTargetOrderById
14
+ local unitLastOrderTypeAttribute = attribute()
15
+ local unitLastOrderIdAttribute = attribute()
16
+ local unitLastOrderStartTimeAttribute = attribute()
17
+ local unitLastOrderStartXAttribute = attribute()
18
+ local unitLastOrderStartYAttribute = attribute()
19
+ local unitLastOrderTargetXAttribute = attribute()
20
+ local unitLastOrderTargetYAttribute = attribute()
21
+ local unitLastOrderTargetAttribute = attribute()
22
+ Unit.onImmediateOrder:addListener(
23
+ 4,
24
+ function(unit, orderId)
25
+ unit[unitLastOrderTypeAttribute] = 0
26
+ unit[unitLastOrderIdAttribute] = orderId
27
+ unit[unitLastOrderStartTimeAttribute] = elapsedTime()
28
+ unit[unitLastOrderStartXAttribute] = unit.x
29
+ unit[unitLastOrderStartYAttribute] = unit.y
30
+ unit[unitLastOrderTargetXAttribute] = nil
31
+ unit[unitLastOrderTargetYAttribute] = nil
32
+ unit[unitLastOrderTargetAttribute] = nil
33
+ end
34
+ )
35
+ Unit.onPointOrder:addListener(
36
+ 4,
37
+ function(unit, orderId, x, y)
38
+ unit[unitLastOrderTypeAttribute] = 1
39
+ unit[unitLastOrderIdAttribute] = orderId
40
+ unit[unitLastOrderStartTimeAttribute] = elapsedTime()
41
+ unit[unitLastOrderStartXAttribute] = unit.x
42
+ unit[unitLastOrderStartYAttribute] = unit.y
43
+ unit[unitLastOrderTargetXAttribute] = x
44
+ unit[unitLastOrderTargetYAttribute] = y
45
+ unit[unitLastOrderTargetAttribute] = nil
46
+ end
47
+ )
48
+ Unit.onTargetOrder:addListener(
49
+ 4,
50
+ function(unit, orderId, target)
51
+ unit[unitLastOrderTypeAttribute] = 2
52
+ unit[unitLastOrderIdAttribute] = orderId
53
+ unit[unitLastOrderStartTimeAttribute] = elapsedTime()
54
+ unit[unitLastOrderStartXAttribute] = unit.x
55
+ unit[unitLastOrderStartYAttribute] = unit.y
56
+ unit[unitLastOrderTargetXAttribute] = target.x
57
+ unit[unitLastOrderTargetYAttribute] = target.y
58
+ unit[unitLastOrderTargetAttribute] = target
59
+ end
60
+ )
61
+ local function toUndefinedIfCurrentOrderDoesNotMatchLast(unit, value)
62
+ local currentOrderId = getUnitCurrentOrder(unit.handle)
63
+ local lastOrderId = unit[unitLastOrderIdAttribute]
64
+ local ____temp_0
65
+ if currentOrderId == lastOrderId or currentOrderId == orderId("patrolAI") and lastOrderId == orderId("patrol") then
66
+ ____temp_0 = value
67
+ else
68
+ ____temp_0 = nil
69
+ end
70
+ return ____temp_0
71
+ end
72
+ __TS__ObjectDefineProperty(
73
+ Unit.prototype,
74
+ "currentOrderType",
75
+ {get = function(self)
76
+ return toUndefinedIfCurrentOrderDoesNotMatchLast(self, self[unitLastOrderTypeAttribute]) or 0
77
+ end}
78
+ )
79
+ __TS__ObjectDefineProperty(
80
+ Unit.prototype,
81
+ "currentOrderId",
82
+ {get = function(self)
83
+ return toUndefinedIfCurrentOrderDoesNotMatchLast(self, self[unitLastOrderIdAttribute]) or 0
84
+ end}
85
+ )
86
+ __TS__ObjectDefineProperty(
87
+ Unit.prototype,
88
+ "currentOrderStartTime",
89
+ {get = function(self)
90
+ return toUndefinedIfCurrentOrderDoesNotMatchLast(self, self[unitLastOrderStartTimeAttribute]) or 0
91
+ end}
92
+ )
93
+ __TS__ObjectDefineProperty(
94
+ Unit.prototype,
95
+ "currentOrderStartX",
96
+ {get = function(self)
97
+ return toUndefinedIfCurrentOrderDoesNotMatchLast(self, self[unitLastOrderStartXAttribute]) or 0
98
+ end}
99
+ )
100
+ __TS__ObjectDefineProperty(
101
+ Unit.prototype,
102
+ "currentOrderStartY",
103
+ {get = function(self)
104
+ return toUndefinedIfCurrentOrderDoesNotMatchLast(self, self[unitLastOrderStartYAttribute]) or 0
105
+ end}
106
+ )
107
+ __TS__ObjectDefineProperty(
108
+ Unit.prototype,
109
+ "currentOrderTargetX",
110
+ {get = function(self)
111
+ return toUndefinedIfCurrentOrderDoesNotMatchLast(self, self[unitLastOrderTargetXAttribute]) or 0
112
+ end}
113
+ )
114
+ __TS__ObjectDefineProperty(
115
+ Unit.prototype,
116
+ "currentOrderTargetY",
117
+ {get = function(self)
118
+ return toUndefinedIfCurrentOrderDoesNotMatchLast(self, self[unitLastOrderTargetYAttribute]) or 0
119
+ end}
120
+ )
121
+ __TS__ObjectDefineProperty(
122
+ Unit.prototype,
123
+ "currentOrderTarget",
124
+ {get = function(self)
125
+ return toUndefinedIfCurrentOrderDoesNotMatchLast(self, self[unitLastOrderTargetAttribute])
126
+ end}
127
+ )
128
+ local issueOrderByType = {
129
+ [0] = issueImmediateOrderById,
130
+ [1] = issuePointOrderById,
131
+ [2] = function(unitHandle, orderId, widget) return issueTargetOrderById(unitHandle, orderId, widget.handle) end
132
+ }
133
+ Unit.prototype.issueOrder = function(self, orderType, orderId, xOrTarget, y)
134
+ return issueOrderByType[orderType](self.handle, orderId, xOrTarget, y)
135
+ end
136
+ return ____exports
@@ -0,0 +1,2 @@
1
+ /** @noSelfInFile */
2
+ export {};
@@ -0,0 +1,11 @@
1
+ local ____exports = {}
2
+ ---
3
+ -- @internal For use by internal systems only.
4
+ ____exports.compiletimePseudoPassiveAbilityTypeIds = {}
5
+ ---
6
+ -- @internal For use by internal systems only.
7
+ ____exports.pseudoPassiveAbilityTypeIds = postcompile(function() return ____exports.compiletimePseudoPassiveAbilityTypeIds end)
8
+ ---
9
+ -- @internal For use by internal systems only.
10
+ ____exports.pseudoPassiveAbilityOrderTypeStringId = "channel"
11
+ return ____exports
@@ -0,0 +1,12 @@
1
+ /** @noSelfInFile */
2
+ import { Event } from "../../../event";
3
+ declare module "../unit" {
4
+ interface Unit {
5
+ readonly unitInRangeEvent: Record<number, Event<[unit: Unit, range: number, unitInRange: Unit]>>;
6
+ }
7
+ }
8
+ declare module "../unit" {
9
+ interface Unit {
10
+ readonly unitOutOfRangeEvent: Record<number, Event<[unit: Unit, range: number, unitOutOfRange: Unit]>>;
11
+ }
12
+ }