warscript 0.0.1-dev.404878c → 0.0.1-dev.4117d1e

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 (160) hide show
  1. package/attributes.d.ts +12 -0
  2. package/attributes.lua +16 -0
  3. package/binaryreader.d.ts +1 -0
  4. package/binaryreader.lua +3 -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 -1
  8. package/core/types/frame.lua +93 -1
  9. package/core/types/group.d.ts +0 -1
  10. package/core/types/handle.d.ts +2 -1
  11. package/core/types/handle.lua +5 -0
  12. package/core/types/image.d.ts +0 -1
  13. package/core/types/missile.d.ts +2 -2
  14. package/core/types/missile.lua +8 -2
  15. package/core/types/unit.lua +8 -0
  16. package/core/util.d.ts +1 -1
  17. package/core/util.lua +12 -0
  18. package/decl/index.d.ts +1 -0
  19. package/engine/ability.d.ts +1 -1
  20. package/engine/behavior.d.ts +10 -10
  21. package/engine/behavior.lua +6 -6
  22. package/engine/behaviour/ability/always-enabled.d.ts +7 -0
  23. package/engine/behaviour/ability/always-enabled.lua +31 -0
  24. package/engine/behaviour/ability/apply-buff.d.ts +3 -5
  25. package/engine/behaviour/ability/apply-unit-behavior.d.ts +13 -4
  26. package/engine/behaviour/ability/apply-unit-behavior.lua +31 -9
  27. package/engine/behaviour/ability/damage.d.ts +33 -11
  28. package/engine/behaviour/ability/damage.lua +89 -31
  29. package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
  30. package/engine/behaviour/ability/emulate-impact.lua +29 -0
  31. package/engine/behaviour/ability/heal.d.ts +33 -6
  32. package/engine/behaviour/ability/heal.lua +89 -10
  33. package/engine/behaviour/ability/instant-impact.d.ts +2 -2
  34. package/engine/behaviour/ability/instant-impact.lua +4 -15
  35. package/engine/behaviour/ability/on-command-impact.d.ts +8 -0
  36. package/engine/behaviour/ability/on-command-impact.lua +25 -0
  37. package/engine/behaviour/ability/remove-buffs.d.ts +16 -0
  38. package/engine/behaviour/ability/remove-buffs.lua +28 -0
  39. package/engine/behaviour/ability/restore-mana.d.ts +15 -0
  40. package/engine/behaviour/ability/restore-mana.lua +29 -0
  41. package/engine/behaviour/ability.d.ts +16 -2
  42. package/engine/behaviour/ability.lua +88 -12
  43. package/engine/behaviour/unit/stun-immunity.d.ts +0 -1
  44. package/engine/behaviour/unit.d.ts +8 -2
  45. package/engine/behaviour/unit.lua +27 -0
  46. package/engine/buff.d.ts +68 -21
  47. package/engine/buff.lua +276 -90
  48. package/engine/game-map.d.ts +7 -0
  49. package/engine/game-map.lua +32 -0
  50. package/engine/internal/ability.d.ts +17 -14
  51. package/engine/internal/ability.lua +79 -76
  52. package/engine/internal/item/ability.lua +81 -0
  53. package/engine/internal/item+owner.lua +2 -2
  54. package/engine/internal/mechanics/ability-duration.d.ts +1 -3
  55. package/engine/internal/mechanics/ability-duration.lua +2 -0
  56. package/engine/internal/mechanics/cast-ability.d.ts +2 -0
  57. package/engine/internal/mechanics/cast-ability.lua +86 -0
  58. package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
  59. package/engine/internal/misc/ability-disable-counter.lua +13 -0
  60. package/engine/internal/unit/ability.d.ts +10 -1
  61. package/engine/internal/unit/ability.lua +36 -14
  62. package/engine/internal/unit/bonus.d.ts +9 -8
  63. package/engine/internal/unit/bonus.lua +6 -1
  64. package/engine/internal/unit/detach-missiles.d.ts +7 -0
  65. package/engine/internal/unit/detach-missiles.lua +30 -0
  66. package/engine/internal/unit/item.d.ts +24 -0
  67. package/engine/internal/unit/item.lua +79 -0
  68. package/engine/internal/unit/main-selected.d.ts +13 -0
  69. package/engine/internal/unit/main-selected.lua +51 -0
  70. package/engine/internal/unit+ability.lua +2 -2
  71. package/engine/internal/unit+transport.lua +4 -10
  72. package/engine/internal/unit-missile-launch.lua +25 -6
  73. package/engine/internal/unit.d.ts +58 -16
  74. package/engine/internal/unit.lua +334 -122
  75. package/engine/internal/utility.lua +12 -0
  76. package/engine/local-client.d.ts +7 -2
  77. package/engine/local-client.lua +82 -0
  78. package/engine/object-data/auxiliary/attachment-preset.d.ts +0 -1
  79. package/engine/object-data/auxiliary/combat-classification.d.ts +0 -2
  80. package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
  81. package/engine/object-data/entry/ability-type/blank-configurable.d.ts +0 -1
  82. package/engine/object-data/entry/ability-type/blank-passive.d.ts +0 -1
  83. package/engine/object-data/entry/ability-type/blink.d.ts +10 -0
  84. package/engine/object-data/entry/ability-type/blink.lua +39 -0
  85. package/engine/object-data/entry/ability-type/channel.d.ts +0 -1
  86. package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
  87. package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
  88. package/engine/object-data/entry/ability-type/mine.lua +39 -0
  89. package/engine/object-data/entry/ability-type/spirit-touch.d.ts +2 -2
  90. package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
  91. package/engine/object-data/entry/ability-type.d.ts +1 -1
  92. package/engine/object-data/entry/ability-type.lua +9 -12
  93. package/engine/object-data/entry/buff-type/applicable.d.ts +0 -1
  94. package/engine/object-data/entry/buff-type/applicable.lua +27 -71
  95. package/engine/object-data/entry/buff-type/blank.d.ts +0 -1
  96. package/engine/object-data/entry/buff-type.d.ts +0 -1
  97. package/engine/object-data/entry/destructible-type.d.ts +0 -1
  98. package/engine/object-data/entry/item-type/blank.d.ts +0 -1
  99. package/engine/object-data/entry/item-type.d.ts +14 -1
  100. package/engine/object-data/entry/item-type.lua +91 -0
  101. package/engine/object-data/entry/lightning-type.d.ts +0 -1
  102. package/engine/object-data/entry/unit-type.d.ts +42 -2
  103. package/engine/object-data/entry/unit-type.lua +378 -50
  104. package/engine/object-data/entry/upgrade/blank.d.ts +0 -1
  105. package/engine/object-data/entry/upgrade.d.ts +0 -1
  106. package/engine/object-data/entry.d.ts +2 -3
  107. package/engine/object-data/utility/object-data-entry-id-generator.lua +7 -0
  108. package/engine/object-field/ability.d.ts +28 -6
  109. package/engine/object-field/ability.lua +57 -1
  110. package/engine/object-field/unit.d.ts +1 -0
  111. package/engine/object-field/unit.lua +3 -0
  112. package/engine/object-field.d.ts +6 -4
  113. package/engine/object-field.lua +38 -12
  114. package/engine/random.d.ts +1 -0
  115. package/engine/random.lua +9 -0
  116. package/engine/standard/entries/unit-type.d.ts +42 -1
  117. package/engine/standard/entries/unit-type.lua +42 -1
  118. package/engine/standard/fields/ability.d.ts +3 -1
  119. package/engine/standard/fields/ability.lua +3 -1
  120. package/engine/unit.d.ts +3 -0
  121. package/engine/unit.lua +12 -2
  122. package/event.d.ts +2 -3
  123. package/event.lua +9 -5
  124. package/exception.d.ts +2 -0
  125. package/exception.lua +4 -0
  126. package/global/vec2.lua +1 -0
  127. package/index.d.ts +1 -0
  128. package/index.lua +1 -0
  129. package/lualib_bundle.lua +146 -42
  130. package/math/vec2.d.ts +2 -9
  131. package/math.d.ts +0 -2
  132. package/net/socket.d.ts +7 -1
  133. package/net/socket.lua +45 -4
  134. package/network.d.ts +1 -0
  135. package/network.lua +3 -2
  136. package/objutil/ability.d.ts +0 -1
  137. package/objutil/buff.d.ts +0 -1
  138. package/objutil/buff.lua +1 -1
  139. package/objutil/object.d.ts +0 -1
  140. package/objutil/unit.d.ts +0 -1
  141. package/package.json +13 -14
  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/string.d.ts +30 -0
  147. package/string.lua +14 -0
  148. package/util/stream.d.ts +0 -1
  149. package/utility/arrays.d.ts +12 -6
  150. package/utility/arrays.lua +38 -4
  151. package/utility/bit-set.d.ts +0 -2
  152. package/utility/lazy.d.ts +2 -0
  153. package/utility/lazy.lua +14 -0
  154. package/utility/linked-set.d.ts +12 -3
  155. package/utility/linked-set.lua +21 -2
  156. package/utility/lua-maps.d.ts +1 -2
  157. package/utility/lua-sets.d.ts +1 -2
  158. package/utility/types.d.ts +3 -2
  159. package/core/mapbounds.d.ts +0 -8
  160. package/core/mapbounds.lua +0 -12
@@ -1,6 +1,5 @@
1
- /// <reference types="@typescript-to-lua/language-extensions" />
2
1
  /** @noSelfInFile */
3
2
  export declare const luaSetOf: <T extends AnyNotNil>(...elements: readonly T[]) => LuaSet<T>;
4
- export declare const luaSetOfNotNull: <T extends AnyNotNil>(...elements: readonly (T | null | undefined)[]) => LuaSet<T>;
3
+ export declare const luaSetOfNotNull: <T extends AnyNotNil>(...elements: readonly (T | undefined | null)[]) => LuaSet<T>;
5
4
  export declare const luaSetIntersection: <T extends AnyNotNil>(firstLuaSet: ReadonlyLuaSet<T>, secondLuaSet: ReadonlyLuaSet<T>) => LuaSet<T>;
6
5
  export declare const luaSetContainsAnyOf: <T extends AnyNotNil>(luaSet: ReadonlyLuaSet<T>, ...elements: readonly T[]) => boolean;
@@ -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
  };
@@ -12,14 +13,14 @@ export type ValueOf<T> = T[keyof T];
12
13
  export type EntryOf<T> = ValueOf<{
13
14
  [K in keyof T]: [K, T[K]];
14
15
  }>;
15
- export type MutableKeys<T extends object> = {
16
+ export type MutableKeys<T extends object> = keyof T & {
16
17
  [P in keyof T]-?: IfEquals<{
17
18
  [Q in P]: T[P];
18
19
  }, {
19
20
  -readonly [Q in P]: T[P];
20
21
  }, P>;
21
22
  }[keyof T];
22
- export type ReadonlyKeys<T extends object> = {
23
+ export type ReadonlyKeys<T extends object> = keyof T & {
23
24
  [P in keyof T]-?: IfEquals<{
24
25
  [Q in P]: T[P];
25
26
  }, {
@@ -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