warscript 0.0.1-dev.5fb7641 → 0.0.1-dev.605ee7b

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 (171) hide show
  1. package/attributes.d.ts +1 -0
  2. package/attributes.lua +9 -0
  3. package/core/types/frame.d.ts +1 -0
  4. package/core/types/frame.lua +136 -58
  5. package/core/types/handle.lua +6 -9
  6. package/core/types/item.d.ts +1 -0
  7. package/core/types/item.lua +1 -0
  8. package/core/types/player.d.ts +17 -1
  9. package/core/types/player.lua +70 -24
  10. package/core/types/playerCamera.d.ts +2 -0
  11. package/core/types/playerCamera.lua +123 -5
  12. package/core/types/sound.lua +1 -1
  13. package/core/types/tileCell.d.ts +11 -1
  14. package/core/types/tileCell.lua +97 -0
  15. package/core/types/timer.d.ts +3 -1
  16. package/core/types/timer.lua +27 -2
  17. package/decl/native.d.ts +6 -4
  18. package/destroyable.d.ts +1 -0
  19. package/destroyable.lua +9 -0
  20. package/engine/behavior.d.ts +14 -1
  21. package/engine/behavior.lua +230 -70
  22. package/engine/behaviour/ability/apply-buff.lua +5 -5
  23. package/engine/behaviour/ability/damage.d.ts +3 -0
  24. package/engine/behaviour/ability/damage.lua +8 -2
  25. package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
  26. package/engine/behaviour/ability/emulate-impact.lua +7 -5
  27. package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
  28. package/engine/behaviour/ability/remove-buffs.lua +21 -0
  29. package/engine/behaviour/ability/restore-mana.d.ts +1 -1
  30. package/engine/behaviour/ability/restore-mana.lua +6 -6
  31. package/engine/behaviour/ability.d.ts +11 -6
  32. package/engine/behaviour/ability.lua +37 -16
  33. package/engine/behaviour/unit/stun-immunity.d.ts +12 -6
  34. package/engine/behaviour/unit/stun-immunity.lua +57 -31
  35. package/engine/behaviour/unit.d.ts +26 -5
  36. package/engine/behaviour/unit.lua +180 -27
  37. package/engine/buff.d.ts +67 -22
  38. package/engine/buff.lua +371 -182
  39. package/engine/internal/ability.d.ts +3 -1
  40. package/engine/internal/ability.lua +49 -26
  41. package/engine/internal/item/ability.lua +51 -1
  42. package/engine/internal/item/fields.d.ts +12 -0
  43. package/engine/internal/item/fields.lua +33 -0
  44. package/engine/internal/item+owner.lua +12 -6
  45. package/engine/internal/item.d.ts +11 -14
  46. package/engine/internal/item.lua +81 -70
  47. package/engine/internal/mechanics/cast-ability.lua +6 -3
  48. package/engine/internal/misc/frame-coordinates.lua +21 -0
  49. package/engine/internal/misc/get-terrain-z.d.ts +2 -0
  50. package/engine/internal/misc/get-terrain-z.lua +11 -0
  51. package/engine/internal/misc/player-local-handle.d.ts +2 -0
  52. package/engine/internal/misc/player-local-handle.lua +5 -0
  53. package/engine/internal/object-data/armor-bonus.d.ts +2 -0
  54. package/engine/internal/object-data/attribute-bonus.lua +2 -2
  55. package/engine/internal/object-data/health-bonus.d.ts +2 -0
  56. package/engine/internal/object-data/health-bonus.lua +16 -0
  57. package/engine/internal/object-data/mana-bonus.d.ts +2 -0
  58. package/engine/internal/object-data/mana-bonus.lua +16 -0
  59. package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
  60. package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
  61. package/engine/internal/unit/ability.d.ts +35 -5
  62. package/engine/internal/unit/ability.lua +111 -24
  63. package/engine/internal/unit/attributes.d.ts +17 -0
  64. package/engine/internal/unit/attributes.lua +46 -0
  65. package/engine/internal/unit/bonus.d.ts +6 -0
  66. package/engine/internal/unit/bonus.lua +33 -3
  67. package/engine/internal/unit/fly-height.d.ts +7 -0
  68. package/engine/internal/unit/fly-height.lua +20 -0
  69. package/engine/internal/unit/interrupts.d.ts +12 -0
  70. package/engine/internal/unit/interrupts.lua +28 -0
  71. package/engine/internal/unit/main-selected.lua +12 -27
  72. package/engine/internal/unit/order.d.ts +20 -0
  73. package/engine/internal/unit/order.lua +136 -0
  74. package/engine/internal/unit/pseudo-passive-abilities.d.ts +2 -0
  75. package/engine/internal/unit/pseudo-passive-abilities.lua +11 -0
  76. package/engine/internal/unit/range-event.d.ts +12 -0
  77. package/engine/internal/unit/range-event.lua +90 -0
  78. package/engine/internal/unit/scale.d.ts +7 -0
  79. package/engine/internal/unit/scale.lua +20 -0
  80. package/engine/internal/unit+ability.lua +10 -1
  81. package/engine/internal/unit+bonus.lua +3 -3
  82. package/engine/internal/unit-missile-launch.lua +52 -14
  83. package/engine/internal/unit.d.ts +20 -24
  84. package/engine/internal/unit.lua +232 -240
  85. package/engine/local-client.d.ts +7 -0
  86. package/engine/local-client.lua +86 -1
  87. package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
  88. package/engine/object-data/auxiliary/armor-type.lua +46 -0
  89. package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
  90. package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
  91. package/engine/object-data/auxiliary/unit-attribute.lua +1 -1
  92. package/engine/object-data/entry/ability-type/{armor-increase.d.ts → armor-bonus.d.ts} +3 -3
  93. package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
  94. package/engine/object-data/entry/ability-type/blank-configurable.d.ts +3 -0
  95. package/engine/object-data/entry/ability-type/blank-configurable.lua +30 -0
  96. package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
  97. package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
  98. package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
  99. package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
  100. package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
  101. package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
  102. package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
  103. package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
  104. package/engine/object-data/entry/ability-type.d.ts +2 -0
  105. package/engine/object-data/entry/ability-type.lua +89 -8
  106. package/engine/object-data/entry/buff-type/applicable.lua +113 -109
  107. package/engine/object-data/entry/destructible-type.d.ts +27 -1
  108. package/engine/object-data/entry/destructible-type.lua +155 -0
  109. package/engine/object-data/entry/unit-type.d.ts +15 -2
  110. package/engine/object-data/entry/unit-type.lua +135 -33
  111. package/engine/object-field/ability.d.ts +3 -3
  112. package/engine/object-field/ability.lua +9 -8
  113. package/engine/object-field/item.d.ts +22 -0
  114. package/engine/object-field/item.lua +118 -0
  115. package/engine/object-field/unit.d.ts +31 -5
  116. package/engine/object-field/unit.lua +95 -0
  117. package/engine/object-field.d.ts +12 -4
  118. package/engine/object-field.lua +274 -127
  119. package/engine/random.d.ts +10 -0
  120. package/engine/random.lua +21 -0
  121. package/engine/standard/fields/ability.d.ts +2 -2
  122. package/engine/standard/fields/ability.lua +2 -2
  123. package/engine/standard/fields/item.d.ts +4 -0
  124. package/engine/standard/fields/item.lua +6 -0
  125. package/engine/standard/fields/unit.d.ts +12 -0
  126. package/engine/standard/fields/unit.lua +20 -0
  127. package/engine/synchronization.d.ts +11 -0
  128. package/engine/synchronization.lua +77 -0
  129. package/engine/text-tag.d.ts +26 -3
  130. package/engine/text-tag.lua +217 -11
  131. package/engine/unit.d.ts +6 -0
  132. package/engine/unit.lua +6 -0
  133. package/event.d.ts +1 -1
  134. package/lualib_bundle.lua +1 -1
  135. package/math.d.ts +2 -0
  136. package/math.lua +14 -0
  137. package/net/socket.lua +1 -1
  138. package/network.lua +25 -1
  139. package/objutil/buff.lua +10 -8
  140. package/objutil/object.lua +1 -1
  141. package/operation.d.ts +8 -1
  142. package/operation.lua +38 -18
  143. package/package.json +5 -5
  144. package/patch-lua.lua +15 -0
  145. package/patch-lualib.lua +1 -1
  146. package/utility/arrays.d.ts +1 -0
  147. package/utility/arrays.lua +8 -0
  148. package/utility/callback-array.d.ts +17 -0
  149. package/utility/callback-array.lua +61 -0
  150. package/utility/functions.d.ts +7 -0
  151. package/utility/functions.lua +12 -0
  152. package/utility/linked-map.d.ts +35 -0
  153. package/utility/linked-map.lua +107 -0
  154. package/utility/linked-set.d.ts +4 -1
  155. package/utility/linked-set.lua +46 -1
  156. package/utility/lua-maps.d.ts +11 -2
  157. package/utility/lua-maps.lua +33 -2
  158. package/utility/lua-sets.d.ts +1 -0
  159. package/utility/lua-sets.lua +4 -0
  160. package/utility/random.d.ts +102 -0
  161. package/utility/random.lua +273 -0
  162. package/utility/records.lua +20 -1
  163. package/utility/types.d.ts +3 -0
  164. package/utility/unordered-map.d.ts +27 -0
  165. package/utility/unordered-map.lua +99 -0
  166. package/core/types/order.d.ts +0 -26
  167. package/core/types/order.lua +0 -65
  168. /package/engine/internal/{object-data/armor-increase.d.ts → misc/frame-coordinates.d.ts} +0 -0
  169. /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
  170. /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
  171. /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
@@ -1,65 +0,0 @@
1
- local ____lualib = require("lualib_bundle")
2
- local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
3
- local ____exports = {}
4
- local ____unit = require("core.types.unit")
5
- local Unit = ____unit.Unit
6
- local ____game = require("core.game")
7
- local elapsedTime = ____game.elapsedTime
8
- local getUnitCurrentOrder = GetUnitCurrentOrder
9
- local orders = setmetatable({}, {__mode = "k"})
10
- Unit.onImmediateOrder:addListener(function(unit, orderId)
11
- orders[unit] = {
12
- id = orderId,
13
- startX = unit.x,
14
- startY = unit.y,
15
- issueTime = elapsedTime(),
16
- type = "immediate"
17
- }
18
- end)
19
- Unit.onPointOrder:addListener(function(unit, orderId, x, y)
20
- orders[unit] = {
21
- id = orderId,
22
- startX = unit.x,
23
- startY = unit.y,
24
- issueTime = elapsedTime(),
25
- type = "point",
26
- targetX = x,
27
- targetY = y
28
- }
29
- end)
30
- Unit.onTargetOrder:addListener(function(unit, orderId, target)
31
- orders[unit] = {
32
- id = orderId,
33
- startX = unit.x,
34
- startY = unit.y,
35
- issueTime = elapsedTime(),
36
- type = "target",
37
- target = target
38
- }
39
- end)
40
- __TS__ObjectDefineProperty(
41
- Unit.prototype,
42
- "currentOrder",
43
- {get = function(self)
44
- local currentOrderId = getUnitCurrentOrder(self.handle)
45
- local lastOrder = orders[self]
46
- return lastOrder and (lastOrder.id == currentOrderId or currentOrderId == orderId("patrolAI") and lastOrder.id == orderId("patrol")) and lastOrder or ({id = 0, type = "immediate"})
47
- end}
48
- )
49
- __TS__ObjectDefineProperty(
50
- Unit.prototype,
51
- "lastOrder",
52
- {get = function(self)
53
- return orders[self] or ({id = 0, type = "immediate"})
54
- end}
55
- )
56
- Unit.prototype.issueOrder = function(self, order)
57
- if order.type == "immediate" then
58
- IssueImmediateOrderById(self.handle, order.id)
59
- elseif order.type == "point" then
60
- IssuePointOrderById(self.handle, order.id, order.targetX, order.targetY)
61
- else
62
- IssueTargetOrderById(self.handle, order.id, order.target.handle)
63
- end
64
- end
65
- return ____exports