warscript 0.0.1-dev.e7b1f67 → 0.0.1-dev.ea10f2b

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 (155) hide show
  1. package/binaryreader.d.ts +1 -0
  2. package/binaryreader.lua +3 -0
  3. package/config.d.ts +5 -0
  4. package/config.lua +10 -0
  5. package/core/types/effect.d.ts +13 -3
  6. package/core/types/effect.lua +116 -17
  7. package/core/types/frame.d.ts +8 -0
  8. package/core/types/frame.lua +93 -1
  9. package/core/types/sound.d.ts +17 -24
  10. package/core/types/sound.lua +94 -24
  11. package/core/util.d.ts +1 -1
  12. package/core/util.lua +18 -1
  13. package/engine/behavior.d.ts +6 -6
  14. package/engine/behavior.lua +6 -6
  15. package/engine/behaviour/ability/always-enabled.d.ts +7 -0
  16. package/engine/behaviour/ability/always-enabled.lua +31 -0
  17. package/engine/behaviour/ability/apply-buff.d.ts +8 -5
  18. package/engine/behaviour/ability/apply-buff.lua +32 -0
  19. package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
  20. package/engine/behaviour/ability/damage.d.ts +36 -11
  21. package/engine/behaviour/ability/damage.lua +90 -32
  22. package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
  23. package/engine/behaviour/ability/emulate-impact.lua +28 -0
  24. package/engine/behaviour/ability/heal.d.ts +33 -6
  25. package/engine/behaviour/ability/heal.lua +89 -10
  26. package/engine/behaviour/ability/instant-impact.d.ts +2 -2
  27. package/engine/behaviour/ability/instant-impact.lua +4 -19
  28. package/engine/behaviour/ability/on-command-impact.d.ts +8 -0
  29. package/engine/behaviour/ability/on-command-impact.lua +25 -0
  30. package/engine/behaviour/ability/remove-buffs.d.ts +16 -0
  31. package/engine/behaviour/ability/remove-buffs.lua +28 -0
  32. package/engine/behaviour/ability/restore-mana.d.ts +15 -0
  33. package/engine/behaviour/ability/restore-mana.lua +29 -0
  34. package/engine/behaviour/ability.d.ts +20 -4
  35. package/engine/behaviour/ability.lua +111 -38
  36. package/engine/behaviour/unit.d.ts +7 -0
  37. package/engine/behaviour/unit.lua +20 -0
  38. package/engine/buff.d.ts +101 -39
  39. package/engine/buff.lua +458 -203
  40. package/engine/game-map.d.ts +7 -0
  41. package/engine/game-map.lua +32 -0
  42. package/engine/internal/ability.d.ts +16 -13
  43. package/engine/internal/ability.lua +80 -76
  44. package/engine/internal/item/ability.lua +106 -0
  45. package/engine/internal/item+owner.lua +2 -2
  46. package/engine/internal/item.d.ts +2 -2
  47. package/engine/internal/item.lua +56 -25
  48. package/engine/internal/mechanics/ability-duration.lua +1 -1
  49. package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
  50. package/engine/internal/misc/ability-disable-counter.lua +13 -0
  51. package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
  52. package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
  53. package/engine/internal/object-data/evasion-probability.d.ts +2 -0
  54. package/engine/internal/object-data/evasion-probability.lua +16 -0
  55. package/engine/internal/unit/ability.d.ts +10 -1
  56. package/engine/internal/unit/ability.lua +36 -14
  57. package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
  58. package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
  59. package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
  60. package/engine/internal/unit/add-item-to-slot.lua +52 -0
  61. package/engine/internal/unit/bonus.d.ts +6 -2
  62. package/engine/internal/unit/bonus.lua +23 -1
  63. package/engine/internal/unit/ignore-events-items.d.ts +2 -0
  64. package/engine/internal/unit/ignore-events-items.lua +5 -0
  65. package/engine/internal/unit/item.d.ts +24 -0
  66. package/engine/internal/unit/item.lua +78 -0
  67. package/engine/internal/unit/main-selected.d.ts +13 -0
  68. package/engine/internal/unit/main-selected.lua +51 -0
  69. package/engine/internal/unit+ability.lua +2 -2
  70. package/engine/internal/unit+transport.lua +4 -10
  71. package/engine/internal/unit-missile-launch.lua +24 -5
  72. package/engine/internal/unit.d.ts +32 -11
  73. package/engine/internal/unit.lua +183 -88
  74. package/engine/internal/utility.lua +12 -0
  75. package/engine/lightning.d.ts +12 -5
  76. package/engine/lightning.lua +48 -14
  77. package/engine/local-client.d.ts +7 -2
  78. package/engine/local-client.lua +82 -0
  79. package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
  80. package/engine/object-data/auxiliary/animation-name.lua +16 -0
  81. package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
  82. package/engine/object-data/auxiliary/sound-eax.lua +2 -0
  83. package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
  84. package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
  85. package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
  86. package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
  87. package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
  88. package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
  89. package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
  90. package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
  91. package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
  92. package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
  93. package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
  94. package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
  95. package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
  96. package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
  97. package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
  98. package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
  99. package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
  100. package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
  101. package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
  102. package/engine/object-data/entry/ability-type/web.d.ts +12 -0
  103. package/engine/object-data/entry/ability-type/web.lua +52 -0
  104. package/engine/object-data/entry/ability-type.d.ts +8 -6
  105. package/engine/object-data/entry/ability-type.lua +62 -27
  106. package/engine/object-data/entry/buff-type/applicable.lua +13 -37
  107. package/engine/object-data/entry/buff-type.d.ts +1 -1
  108. package/engine/object-data/entry/buff-type.lua +2 -2
  109. package/engine/object-data/entry/destructible-type.d.ts +1 -1
  110. package/engine/object-data/entry/item-type.d.ts +15 -1
  111. package/engine/object-data/entry/item-type.lua +93 -2
  112. package/engine/object-data/entry/lightning-type.d.ts +1 -1
  113. package/engine/object-data/entry/sound-preset.d.ts +33 -0
  114. package/engine/object-data/entry/sound-preset.lua +140 -0
  115. package/engine/object-data/entry/unit-type.d.ts +8 -1
  116. package/engine/object-data/entry/unit-type.lua +61 -8
  117. package/engine/object-data/entry/upgrade.d.ts +1 -1
  118. package/engine/object-data/entry/upgrade.lua +4 -4
  119. package/engine/object-data/entry.d.ts +16 -14
  120. package/engine/object-data/entry.lua +60 -32
  121. package/engine/object-data/utility/object-data-entry-id-generator.lua +7 -0
  122. package/engine/object-field/ability.d.ts +26 -3
  123. package/engine/object-field/ability.lua +54 -1
  124. package/engine/object-field.d.ts +2 -2
  125. package/engine/object-field.lua +4 -0
  126. package/engine/standard/entries/sound-preset.d.ts +10 -0
  127. package/engine/standard/entries/sound-preset.lua +10 -0
  128. package/engine/standard/fields/ability.d.ts +2 -0
  129. package/engine/standard/fields/ability.lua +2 -0
  130. package/engine/unit.d.ts +3 -0
  131. package/engine/unit.lua +3 -0
  132. package/index.d.ts +1 -0
  133. package/index.lua +1 -0
  134. package/lualib_bundle.lua +7 -2
  135. package/net/socket.d.ts +7 -1
  136. package/net/socket.lua +45 -4
  137. package/network.d.ts +1 -0
  138. package/network.lua +3 -2
  139. package/objutil/buff.lua +1 -1
  140. package/objutil/unit.lua +8 -0
  141. package/package.json +2 -2
  142. package/patch-lua.d.ts +0 -0
  143. package/patch-lua.lua +10 -0
  144. package/property.d.ts +55 -0
  145. package/property.lua +374 -0
  146. package/utility/arrays.d.ts +8 -1
  147. package/utility/arrays.lua +34 -3
  148. package/utility/lazy.d.ts +2 -0
  149. package/utility/lazy.lua +14 -0
  150. package/utility/linked-set.d.ts +11 -2
  151. package/utility/linked-set.lua +5 -2
  152. package/utility/reflection.lua +11 -7
  153. package/utility/types.d.ts +1 -0
  154. package/core/mapbounds.d.ts +0 -8
  155. package/core/mapbounds.lua +0 -12
@@ -5,21 +5,25 @@ local checkNotNull = ____preconditions.checkNotNull
5
5
  -- @internal For use by internal systems only.
6
6
  ____exports.implementReadonlyNumberIndexSupplier = function(clazz, supplier)
7
7
  local metatable = checkNotNull(getmetatable(clazz))
8
- local originalIndex = checkNotNull(metatable.__index)
8
+ local originalIndex = checkNotNull(rawget(metatable, "__index"))
9
9
  local memoizedValueByKey = {}
10
- metatable.__index = setmetatable(
11
- memoizedValueByKey,
12
- {__index = function(self, key)
10
+ rawset(
11
+ metatable,
12
+ "__index",
13
+ function(self, key)
13
14
  if type(key) == "number" then
14
- local value = supplier(key)
15
- memoizedValueByKey[key] = value
15
+ local value = memoizedValueByKey[key]
16
+ if value == nil then
17
+ value = supplier(key)
18
+ memoizedValueByKey[key] = value
19
+ end
16
20
  return value
17
21
  end
18
22
  if type(originalIndex) == "function" then
19
23
  return originalIndex(self, key)
20
24
  end
21
25
  return originalIndex[key]
22
- end}
26
+ end
23
27
  )
24
28
  end
25
29
  ____exports.getClass = function(object)
@@ -2,6 +2,7 @@
2
2
  export type AnyNonNullable = {};
3
3
  export type IsExactlyAny<T> = boolean extends (T extends never ? true : false) ? true : false;
4
4
  export type NonEmptyArray<T> = [T, ...T[]];
5
+ export type ReadonlyNonEmptyArray<T> = readonly [T, ...T[]];
5
6
  export type InvertRecordType<T extends Record<PropertyKey, PropertyKey | null | undefined>> = {
6
7
  [P in keyof T as NonNullable<T[P]>]: P;
7
8
  };
@@ -1,8 +0,0 @@
1
- /** @noSelfInFile */
2
- import { Rect } from "./types/rect";
3
- import { Region } from "./types/region";
4
- export declare const boundRect: Rect;
5
- export declare const boundRegion: Region;
6
- export declare const boundMin: Readonly<Vec2>;
7
- export declare const boundMax: Readonly<Vec2>;
8
- export declare const boundCenter: Readonly<Vec2>;
@@ -1,12 +0,0 @@
1
- local ____exports = {}
2
- local ____rect = require("core.types.rect")
3
- local Rect = ____rect.Rect
4
- local ____region = require("core.types.region")
5
- local Region = ____region.Region
6
- ____exports.boundRect = Rect:of(GetWorldBounds())
7
- ____exports.boundRegion = Region:create()
8
- ____exports.boundRegion:addRect(____exports.boundRect)
9
- ____exports.boundMin = vec2(____exports.boundRect.minX, ____exports.boundRect.minY)
10
- ____exports.boundMax = vec2(____exports.boundRect.maxX, ____exports.boundRect.maxY)
11
- ____exports.boundCenter = (____exports.boundMin + ____exports.boundMax) * 0.5
12
- return ____exports