warscript 0.0.1-dev.ee2345e → 0.0.1-dev.f9efacb

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 (117) hide show
  1. package/attributes.d.ts +0 -1
  2. package/binaryreader.d.ts +1 -0
  3. package/binaryreader.lua +3 -0
  4. package/core/types/frame.d.ts +8 -1
  5. package/core/types/frame.lua +93 -1
  6. package/core/types/group.d.ts +0 -1
  7. package/core/types/image.d.ts +0 -1
  8. package/core/types/missile.d.ts +2 -2
  9. package/core/types/missile.lua +8 -2
  10. package/core/types/unit.lua +8 -0
  11. package/core/util.d.ts +1 -1
  12. package/core/util.lua +6 -0
  13. package/decl/index.d.ts +1 -0
  14. package/engine/ability.d.ts +1 -1
  15. package/engine/behavior.d.ts +10 -10
  16. package/engine/behavior.lua +6 -6
  17. package/engine/behaviour/ability/apply-buff.d.ts +3 -5
  18. package/engine/behaviour/ability/apply-unit-behavior.d.ts +6 -1
  19. package/engine/behaviour/ability/damage.d.ts +33 -11
  20. package/engine/behaviour/ability/damage.lua +89 -31
  21. package/engine/behaviour/ability/heal.d.ts +33 -6
  22. package/engine/behaviour/ability/heal.lua +89 -10
  23. package/engine/behaviour/ability/instant-impact.lua +4 -0
  24. package/engine/behaviour/ability/restore-mana.d.ts +15 -0
  25. package/engine/behaviour/ability/restore-mana.lua +29 -0
  26. package/engine/behaviour/ability.d.ts +8 -1
  27. package/engine/behaviour/ability.lua +62 -0
  28. package/engine/behaviour/unit/stun-immunity.d.ts +0 -1
  29. package/engine/behaviour/unit.d.ts +8 -2
  30. package/engine/behaviour/unit.lua +27 -0
  31. package/engine/buff.d.ts +62 -20
  32. package/engine/buff.lua +247 -72
  33. package/engine/game-map.d.ts +7 -0
  34. package/engine/game-map.lua +32 -0
  35. package/engine/internal/ability.d.ts +3 -11
  36. package/engine/internal/ability.lua +9 -78
  37. package/engine/internal/item+owner.lua +2 -2
  38. package/engine/internal/unit/bonus.d.ts +9 -8
  39. package/engine/internal/unit/bonus.lua +6 -1
  40. package/engine/internal/unit/item.d.ts +24 -0
  41. package/engine/internal/unit/item.lua +84 -0
  42. package/engine/internal/unit/main-selected.d.ts +7 -0
  43. package/engine/internal/unit/main-selected.lua +40 -0
  44. package/engine/internal/unit+ability.lua +2 -2
  45. package/engine/internal/unit+transport.lua +4 -10
  46. package/engine/internal/unit-missile-launch.lua +25 -6
  47. package/engine/internal/unit.d.ts +57 -16
  48. package/engine/internal/unit.lua +313 -111
  49. package/engine/local-client.d.ts +7 -2
  50. package/engine/local-client.lua +82 -0
  51. package/engine/object-data/auxiliary/attachment-preset.d.ts +0 -1
  52. package/engine/object-data/auxiliary/combat-classification.d.ts +0 -2
  53. package/engine/object-data/entry/ability-type/blank-configurable.d.ts +0 -1
  54. package/engine/object-data/entry/ability-type/blank-passive.d.ts +0 -1
  55. package/engine/object-data/entry/ability-type/channel.d.ts +0 -1
  56. package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
  57. package/engine/object-data/entry/ability-type/mine.lua +39 -0
  58. package/engine/object-data/entry/ability-type/spirit-touch.d.ts +2 -2
  59. package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
  60. package/engine/object-data/entry/ability-type.d.ts +0 -1
  61. package/engine/object-data/entry/buff-type/applicable.d.ts +0 -1
  62. package/engine/object-data/entry/buff-type/blank.d.ts +0 -1
  63. package/engine/object-data/entry/buff-type.d.ts +0 -1
  64. package/engine/object-data/entry/destructible-type.d.ts +0 -1
  65. package/engine/object-data/entry/item-type/blank.d.ts +0 -1
  66. package/engine/object-data/entry/item-type.d.ts +12 -1
  67. package/engine/object-data/entry/item-type.lua +78 -0
  68. package/engine/object-data/entry/lightning-type.d.ts +0 -1
  69. package/engine/object-data/entry/unit-type.d.ts +37 -2
  70. package/engine/object-data/entry/unit-type.lua +333 -49
  71. package/engine/object-data/entry/upgrade/blank.d.ts +0 -1
  72. package/engine/object-data/entry/upgrade.d.ts +0 -1
  73. package/engine/object-data/entry.d.ts +2 -3
  74. package/engine/object-field/ability.d.ts +18 -1
  75. package/engine/object-field/ability.lua +51 -1
  76. package/engine/object-field.d.ts +0 -1
  77. package/engine/random.d.ts +1 -0
  78. package/engine/random.lua +9 -0
  79. package/engine/standard/entries/unit-type.d.ts +39 -1
  80. package/engine/standard/entries/unit-type.lua +39 -1
  81. package/engine/standard/fields/ability.d.ts +1 -1
  82. package/engine/standard/fields/ability.lua +1 -1
  83. package/engine/unit.d.ts +2 -0
  84. package/engine/unit.lua +11 -2
  85. package/event.d.ts +2 -3
  86. package/event.lua +9 -5
  87. package/index.d.ts +1 -0
  88. package/index.lua +1 -0
  89. package/lualib_bundle.lua +146 -42
  90. package/math/vec2.d.ts +2 -9
  91. package/math.d.ts +0 -2
  92. package/net/socket.d.ts +7 -1
  93. package/net/socket.lua +45 -4
  94. package/network.d.ts +1 -0
  95. package/network.lua +3 -2
  96. package/objutil/ability.d.ts +0 -1
  97. package/objutil/buff.d.ts +0 -1
  98. package/objutil/buff.lua +1 -1
  99. package/objutil/object.d.ts +0 -1
  100. package/objutil/unit.d.ts +0 -1
  101. package/package.json +13 -14
  102. package/patch-lua.d.ts +0 -0
  103. package/patch-lua.lua +10 -0
  104. package/property.d.ts +55 -0
  105. package/property.lua +374 -0
  106. package/string.d.ts +30 -0
  107. package/string.lua +14 -0
  108. package/util/stream.d.ts +0 -1
  109. package/utility/arrays.d.ts +3 -4
  110. package/utility/bit-set.d.ts +0 -2
  111. package/utility/linked-set.d.ts +11 -3
  112. package/utility/linked-set.lua +5 -2
  113. package/utility/lua-maps.d.ts +1 -2
  114. package/utility/lua-sets.d.ts +1 -2
  115. package/utility/types.d.ts +1 -0
  116. package/core/mapbounds.d.ts +0 -8
  117. package/core/mapbounds.lua +0 -12
package/engine/random.lua CHANGED
@@ -1,9 +1,18 @@
1
1
  local ____exports = {}
2
2
  local ____math = require("math")
3
3
  local MAXIMUM_INTEGER = ____math.MAXIMUM_INTEGER
4
+ local PI = ____math.PI
4
5
  local getRandomInt = GetRandomInt
5
6
  local getRandomReal = GetRandomReal
7
+ local cos = math.cos
8
+ local sin = math.sin
9
+ local sqrt = math.sqrt
6
10
  ____exports.randomAngle = function() return getRandomReal(0, 360) end
7
11
  ____exports.randomInteger = function(m, n) return n ~= nil and getRandomInt(m, n) or getRandomInt(0, m or MAXIMUM_INTEGER) end
8
12
  ____exports.randomFloat = function(m, n) return n ~= nil and getRandomReal(m, n) or getRandomReal(0, m or MAXIMUM_INTEGER) end
13
+ ____exports.randomXY = function(centerX, centerY, range)
14
+ local r = range * sqrt(getRandomReal(0, 1))
15
+ local t = getRandomReal(0, 1) * 2 * PI
16
+ return centerX + r * cos(t), centerY + r * sin(t)
17
+ end
9
18
  return ____exports
@@ -9,11 +9,33 @@ export declare const RIFLEMAN_UNIT_TYPE_ID: StandardUnitTypeId;
9
9
  export declare const SIEGE_ENGINE_UNIT_TYPE_ID: StandardUnitTypeId;
10
10
  export declare const SORCERESS_UNIT_TYPE_ID: StandardUnitTypeId;
11
11
  export declare const SPELLBREAKER_UNIT_TYPE_ID: StandardUnitTypeId;
12
- export declare const PALADIN_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
13
12
  export declare const ARCHMAGE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
13
+ export declare const BLOOD_MAGE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
14
+ export declare const MOUNTAIN_KING_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
15
+ export declare const PALADIN_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
16
+ export declare const ARCHER_HIGH_ELF_UNIT_TYPE_ID: StandardUnitTypeId;
14
17
  export declare const CAPTAIN_UNIT_TYPE_ID: StandardUnitTypeId;
18
+ export declare const SWORDSMAN_UNIT_TYPE_ID: StandardUnitTypeId;
19
+ export declare const ADMIRAL_PROUDMOORE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
20
+ export declare const ANASTERIAN_SUNSTRIDER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
21
+ export declare const ANTONIDAS_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
22
+ export declare const ANTONIDAS_GHOST_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
15
23
  export declare const ARTHAS_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
16
24
  export declare const ARTHAS_WITH_FROSTMOURNE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
25
+ export declare const DAGREN_THE_ORCSLAYER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
26
+ export declare const HALAHK_THE_LIFEBRINGER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
27
+ export declare const JAINA_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
28
+ export declare const JENNALLA_DEEMSPRING_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
29
+ export declare const KAEL_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
30
+ export declare const KELEN_THE_SEEKER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
31
+ export declare const LORD_GARITHOS_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
32
+ export declare const LORD_NICHOLAS_BUZAN_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
33
+ export declare const MAGROTH_THE_DEFENDER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
34
+ export declare const MURADIN_BRONZEBEARD_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
35
+ export declare const SIR_GREGORY_EDMUNSON_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
36
+ export declare const SYLVANAS_WINDRUNNER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
37
+ export declare const THALORIEN_DAWNSEEKER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
38
+ export declare const UTHER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
17
39
  export declare const BATRIDER_UNIT_TYPE_ID: StandardUnitTypeId;
18
40
  export declare const DEMOLISHER_UNIT_TYPE_ID: StandardUnitTypeId;
19
41
  export declare const GRUNT_UNIT_TYPE_ID: StandardUnitTypeId;
@@ -25,7 +47,22 @@ export declare const SPIRIT_WALKER_UNIT_TYPE_ID: StandardUnitTypeId;
25
47
  export declare const TAUREN_UNIT_TYPE_ID: StandardUnitTypeId;
26
48
  export declare const WIND_RIDER_UNIT_TYPE_ID: StandardUnitTypeId;
27
49
  export declare const WITCH_DOCTOR_UNIT_TYPE_ID: StandardUnitTypeId;
50
+ export declare const ARCHER_UNIT_TYPE_ID: StandardUnitTypeId;
51
+ export declare const CHIMAERA_UNIT_TYPE_ID: StandardUnitTypeId;
52
+ export declare const DRUID_OF_THE_CLAW_UNIT_TYPE_ID: StandardUnitTypeId;
53
+ export declare const DRUID_OF_THE_TALON_UNIT_TYPE_ID: StandardUnitTypeId;
54
+ export declare const DRYAD_UNIT_TYPE_ID: StandardUnitTypeId;
55
+ export declare const FAERIE_DRAGON_UNIT_TYPE_ID: StandardUnitTypeId;
56
+ export declare const GLAIVE_THROWER_UNIT_TYPE_ID: StandardUnitTypeId;
57
+ export declare const HIPPOGRYPH_UNIT_TYPE_ID: StandardUnitTypeId;
58
+ export declare const HIPPOGRYPH_RIDER_UNIT_TYPE_ID: StandardUnitTypeId;
59
+ export declare const HUNTRESS_UNIT_TYPE_ID: StandardUnitTypeId;
60
+ export declare const MOUNTAIN_GIANT_THROWER_UNIT_TYPE_ID: StandardUnitTypeId;
61
+ export declare const WISP_UNIT_TYPE_ID: StandardUnitTypeId;
28
62
  export declare const DEMON_HUNTER_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
63
+ export declare const KEEPER_OF_THE_GROVE_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
64
+ export declare const MOON_PRIESTESS_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
65
+ export declare const WARDEN_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
29
66
  export declare const DEMON_HUNTER_DEMON_FORM_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
30
67
  export declare const ABOMINATION_UNIT_TYPE_ID: StandardUnitTypeId;
31
68
  export declare const GHOUL_UNIT_TYPE_ID: StandardUnitTypeId;
@@ -61,6 +98,7 @@ export declare const WENDIGO_UNIT_TYPE_ID: StandardUnitTypeId;
61
98
  export declare const WENDIGO_SHAMAN_UNIT_TYPE_ID: StandardUnitTypeId;
62
99
  export declare const WILDKIN_UNIT_TYPE_ID: StandardUnitTypeId;
63
100
  export declare const WRAITH_UNIT_TYPE_ID: StandardUnitTypeId;
101
+ export declare const GOBLIN_LAND_MINE_UNIT_TYPE_ID: StandardUnitTypeId;
64
102
  export declare const CIRCLE_OF_POWER_UNIT_TYPE_ID: StandardUnitTypeId;
65
103
  export declare const CIRCLE_OF_POWER_MEDIUM_UNIT_TYPE_ID: StandardUnitTypeId;
66
104
  export declare const CIRCLE_OF_POWER_LARGE_UNIT_TYPE_ID: StandardUnitTypeId;
@@ -8,11 +8,33 @@ ____exports.RIFLEMAN_UNIT_TYPE_ID = fourCC("hrif")
8
8
  ____exports.SIEGE_ENGINE_UNIT_TYPE_ID = fourCC("hmtt")
9
9
  ____exports.SORCERESS_UNIT_TYPE_ID = fourCC("hsor")
10
10
  ____exports.SPELLBREAKER_UNIT_TYPE_ID = fourCC("hspt")
11
- ____exports.PALADIN_HERO_UNIT_TYPE_ID = fourCC("Hpal")
12
11
  ____exports.ARCHMAGE_HERO_UNIT_TYPE_ID = fourCC("Hamg")
12
+ ____exports.BLOOD_MAGE_HERO_UNIT_TYPE_ID = fourCC("Hblm")
13
+ ____exports.MOUNTAIN_KING_HERO_UNIT_TYPE_ID = fourCC("Hmkg")
14
+ ____exports.PALADIN_HERO_UNIT_TYPE_ID = fourCC("Hpal")
15
+ ____exports.ARCHER_HIGH_ELF_UNIT_TYPE_ID = fourCC("nhea")
13
16
  ____exports.CAPTAIN_UNIT_TYPE_ID = fourCC("hcth")
17
+ ____exports.SWORDSMAN_UNIT_TYPE_ID = fourCC("hhes")
18
+ ____exports.ADMIRAL_PROUDMOORE_HERO_UNIT_TYPE_ID = fourCC("Hapm")
19
+ ____exports.ANASTERIAN_SUNSTRIDER_HERO_UNIT_TYPE_ID = fourCC("Hssa")
20
+ ____exports.ANTONIDAS_HERO_UNIT_TYPE_ID = fourCC("Hant")
21
+ ____exports.ANTONIDAS_GHOST_HERO_UNIT_TYPE_ID = fourCC("Hgam")
14
22
  ____exports.ARTHAS_HERO_UNIT_TYPE_ID = fourCC("Hart")
15
23
  ____exports.ARTHAS_WITH_FROSTMOURNE_HERO_UNIT_TYPE_ID = fourCC("Harf")
24
+ ____exports.DAGREN_THE_ORCSLAYER_HERO_UNIT_TYPE_ID = fourCC("Hdgo")
25
+ ____exports.HALAHK_THE_LIFEBRINGER_HERO_UNIT_TYPE_ID = fourCC("Hhkl")
26
+ ____exports.JAINA_HERO_UNIT_TYPE_ID = fourCC("Hjai")
27
+ ____exports.JENNALLA_DEEMSPRING_HERO_UNIT_TYPE_ID = fourCC("Hjnd")
28
+ ____exports.KAEL_HERO_UNIT_TYPE_ID = fourCC("Hkal")
29
+ ____exports.KELEN_THE_SEEKER_HERO_UNIT_TYPE_ID = fourCC("Haah")
30
+ ____exports.LORD_GARITHOS_HERO_UNIT_TYPE_ID = fourCC("Hlgr")
31
+ ____exports.LORD_NICHOLAS_BUZAN_HERO_UNIT_TYPE_ID = fourCC("Hpb1")
32
+ ____exports.MAGROTH_THE_DEFENDER_HERO_UNIT_TYPE_ID = fourCC("Hmgd")
33
+ ____exports.MURADIN_BRONZEBEARD_HERO_UNIT_TYPE_ID = fourCC("Hmbr")
34
+ ____exports.SIR_GREGORY_EDMUNSON_HERO_UNIT_TYPE_ID = fourCC("Hpb2")
35
+ ____exports.SYLVANAS_WINDRUNNER_HERO_UNIT_TYPE_ID = fourCC("Hvwd")
36
+ ____exports.THALORIEN_DAWNSEEKER_HERO_UNIT_TYPE_ID = fourCC("Hddt")
37
+ ____exports.UTHER_HERO_UNIT_TYPE_ID = fourCC("Huth")
16
38
  ____exports.BATRIDER_UNIT_TYPE_ID = fourCC("otbr")
17
39
  ____exports.DEMOLISHER_UNIT_TYPE_ID = fourCC("ocat")
18
40
  ____exports.GRUNT_UNIT_TYPE_ID = fourCC("ogru")
@@ -24,7 +46,22 @@ ____exports.SPIRIT_WALKER_UNIT_TYPE_ID = fourCC("ospw")
24
46
  ____exports.TAUREN_UNIT_TYPE_ID = fourCC("otau")
25
47
  ____exports.WIND_RIDER_UNIT_TYPE_ID = fourCC("owyv")
26
48
  ____exports.WITCH_DOCTOR_UNIT_TYPE_ID = fourCC("odoc")
49
+ ____exports.ARCHER_UNIT_TYPE_ID = fourCC("earc")
50
+ ____exports.CHIMAERA_UNIT_TYPE_ID = fourCC("echm")
51
+ ____exports.DRUID_OF_THE_CLAW_UNIT_TYPE_ID = fourCC("edoc")
52
+ ____exports.DRUID_OF_THE_TALON_UNIT_TYPE_ID = fourCC("edot")
53
+ ____exports.DRYAD_UNIT_TYPE_ID = fourCC("edry")
54
+ ____exports.FAERIE_DRAGON_UNIT_TYPE_ID = fourCC("efdr")
55
+ ____exports.GLAIVE_THROWER_UNIT_TYPE_ID = fourCC("ebal")
56
+ ____exports.HIPPOGRYPH_UNIT_TYPE_ID = fourCC("ehip")
57
+ ____exports.HIPPOGRYPH_RIDER_UNIT_TYPE_ID = fourCC("ehpr")
58
+ ____exports.HUNTRESS_UNIT_TYPE_ID = fourCC("esen")
59
+ ____exports.MOUNTAIN_GIANT_THROWER_UNIT_TYPE_ID = fourCC("emtg")
60
+ ____exports.WISP_UNIT_TYPE_ID = fourCC("ewsp")
27
61
  ____exports.DEMON_HUNTER_HERO_UNIT_TYPE_ID = fourCC("Edem")
62
+ ____exports.KEEPER_OF_THE_GROVE_HERO_UNIT_TYPE_ID = fourCC("Ekee")
63
+ ____exports.MOON_PRIESTESS_HERO_UNIT_TYPE_ID = fourCC("Emoo")
64
+ ____exports.WARDEN_HERO_UNIT_TYPE_ID = fourCC("Ewar")
28
65
  ____exports.DEMON_HUNTER_DEMON_FORM_HERO_UNIT_TYPE_ID = fourCC("Edmm")
29
66
  ____exports.ABOMINATION_UNIT_TYPE_ID = fourCC("uabo")
30
67
  ____exports.GHOUL_UNIT_TYPE_ID = fourCC("ugho")
@@ -60,6 +97,7 @@ ____exports.WENDIGO_UNIT_TYPE_ID = fourCC("nwen")
60
97
  ____exports.WENDIGO_SHAMAN_UNIT_TYPE_ID = fourCC("nwns")
61
98
  ____exports.WILDKIN_UNIT_TYPE_ID = fourCC("nowb")
62
99
  ____exports.WRAITH_UNIT_TYPE_ID = fourCC("ngh2")
100
+ ____exports.GOBLIN_LAND_MINE_UNIT_TYPE_ID = fourCC("nglm")
63
101
  ____exports.CIRCLE_OF_POWER_UNIT_TYPE_ID = fourCC("ncop")
64
102
  ____exports.CIRCLE_OF_POWER_MEDIUM_UNIT_TYPE_ID = fourCC("ncp2")
65
103
  ____exports.CIRCLE_OF_POWER_LARGE_UNIT_TYPE_ID = fourCC("ncp3")
@@ -16,7 +16,7 @@ export declare const LEVEL_SKIP_REQUIREMENT_ABILITY_INTEGER_FIELD: AbilityIntege
16
16
  export declare const HERO_ABILITY_ABILITY_BOOLEAN_FIELD: AbilityBooleanField & symbol;
17
17
  export declare const ITEM_ABILITY_ABILITY_BOOLEAN_FIELD: AbilityBooleanField & symbol;
18
18
  export declare const CHECK_DEPENDENCIES_ABILITY_BOOLEAN_FIELD: AbilityBooleanField & symbol;
19
- export declare const ARF_MISSILE_ARC_ABILITY_FLOAT_FIELD: AbilityFloatField & symbol;
19
+ export declare const MISSILE_ARC_ABILITY_FLOAT_FIELD: AbilityFloatField & symbol;
20
20
  export declare const NAME_ABILITY_STRING_FIELD: AbilityStringField & symbol;
21
21
  export declare const ICON_ACTIVATED_ABILITY_STRING_FIELD: AbilityStringField & symbol;
22
22
  export declare const ICON_RESEARCH_ABILITY_STRING_FIELD: AbilityStringField & symbol;
@@ -27,7 +27,7 @@ ____exports.LEVEL_SKIP_REQUIREMENT_ABILITY_INTEGER_FIELD = AbilityIntegerField:c
27
27
  ____exports.HERO_ABILITY_ABILITY_BOOLEAN_FIELD = AbilityBooleanField:create(fourCC("aher"))
28
28
  ____exports.ITEM_ABILITY_ABILITY_BOOLEAN_FIELD = AbilityBooleanField:create(fourCC("aite"))
29
29
  ____exports.CHECK_DEPENDENCIES_ABILITY_BOOLEAN_FIELD = AbilityBooleanField:create(fourCC("achd"))
30
- ____exports.ARF_MISSILE_ARC_ABILITY_FLOAT_FIELD = AbilityFloatField:create(fourCC("amac"))
30
+ ____exports.MISSILE_ARC_ABILITY_FLOAT_FIELD = AbilityFloatField:create(fourCC("amac"))
31
31
  ____exports.NAME_ABILITY_STRING_FIELD = AbilityStringField:create(fourCC("anam"))
32
32
  ____exports.ICON_ACTIVATED_ABILITY_STRING_FIELD = AbilityStringField:create(fourCC("auar"))
33
33
  ____exports.ICON_RESEARCH_ABILITY_STRING_FIELD = AbilityStringField:create(fourCC("arar"))
package/engine/unit.d.ts CHANGED
@@ -4,6 +4,7 @@ import "./internal/unit/ability";
4
4
  import "./internal/unit/allowed-targets";
5
5
  import "./internal/unit/buff";
6
6
  import "./internal/unit/expiration-timer";
7
+ import "./internal/unit/item";
7
8
  import "./internal/unit+ability";
8
9
  import "./internal/unit+damage";
9
10
  import "./internal/unit+rally";
@@ -15,6 +16,7 @@ import "./internal/unit-missile-launch";
15
16
  import "./internal/unit/ghost-counter";
16
17
  import "./internal/unit/invulnerability-counter";
17
18
  import "./internal/unit/detach-missiles";
19
+ import "./internal/unit/main-selected";
18
20
  import "./internal/unit/band-aids/ancestral-spirit-cannibalize";
19
21
  export { Unit, DamagingEvent, DamageEvent } from "./internal/unit";
20
22
  export * from "./internal/unit+damage";
package/engine/unit.lua CHANGED
@@ -4,6 +4,7 @@ require("engine.internal.unit.ability")
4
4
  require("engine.internal.unit.allowed-targets")
5
5
  require("engine.internal.unit.buff")
6
6
  require("engine.internal.unit.expiration-timer")
7
+ require("engine.internal.unit.item")
7
8
  require("engine.internal.unit+ability")
8
9
  require("engine.internal.unit+damage")
9
10
  require("engine.internal.unit+rally")
@@ -15,11 +16,11 @@ require("engine.internal.unit-missile-launch")
15
16
  require("engine.internal.unit.ghost-counter")
16
17
  require("engine.internal.unit.invulnerability-counter")
17
18
  require("engine.internal.unit.detach-missiles")
19
+ require("engine.internal.unit.main-selected")
18
20
  require("engine.internal.unit.band-aids.ancestral-spirit-cannibalize")
19
21
  do
20
22
  local ____unit = require("engine.internal.unit")
21
- local Unit = ____unit.Unit
22
- ____exports.Unit = Unit
23
+ ____exports.Unit = ____unit.Unit
23
24
  end
24
25
  do
25
26
  local ____export = require("engine.internal.unit+damage")
@@ -29,4 +30,12 @@ do
29
30
  end
30
31
  end
31
32
  end
33
+ do
34
+ local ____export = require("engine.internal.unit+rally")
35
+ for ____exportKey, ____exportValue in pairs(____export) do
36
+ if ____exportKey ~= "default" then
37
+ ____exports[____exportKey] = ____exportValue
38
+ end
39
+ end
40
+ end
32
41
  return ____exports
package/event.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- /// <reference types="@typescript-to-lua/language-extensions" />
2
1
  /** @noSelfInFile */
3
- export type EventListener<T extends any[]> = (...args: T) => void;
2
+ export type EventListener<T extends any[]> = (this: void, ...args: T) => void;
4
3
  export declare const enum EventListenerPriority {
5
4
  LOWEST = 0,
6
5
  LOW = 1,
@@ -38,7 +37,7 @@ export type EventDispatchTable<EventType extends Event<any>, KeyType extends num
38
37
  };
39
38
  export type DispatchingEvent<P extends any[], T extends Event<P> = Event<P>, S extends Event<P> = Event<P>> = T & EventDispatchTable<S>;
40
39
  export declare const createDispatchingEvent: {
41
- <T extends Event<any>, S extends Event<EventParameters<T>>>(underlyingEvent: T, extractKey: (...args: EventParameters<T>) => number, ...createEvent: [...(Event<any> extends S ? [(() => S)?] : [() => S])]): DispatchingEvent<EventParameters<T>, T>;
40
+ <T extends Event<any>, S extends Event<EventParameters<T>>>(underlyingEvent: T, extractKey: (this: void, ...args: EventParameters<T>) => number, invokeEvent?: (this: void, event: S, ...args: EventParameters<T>) => unknown, ...createEvent: [...(Event<any> extends S ? [((this: void) => S)?] : [(this: void) => S])]): DispatchingEvent<EventParameters<T>, T, S>;
42
41
  };
43
42
  export declare class DependentInitializingEvent<T extends any[], R extends any[]> extends InitializingEvent<R, EventListener<T>> {
44
43
  constructor(underlyingEvent: Event<T>, priority: EventListenerPriority, collector: (...args: T) => LuaMultiReturn<[false] | [true, ...R]>);
package/event.lua CHANGED
@@ -146,8 +146,13 @@ function TriggerEvent.prototype.____constructor(self, r, c)
146
146
  end
147
147
  )
148
148
  end
149
- ____exports.createDispatchingEvent = function(underlyingEvent, extractKey, createEvent)
150
- local actualCreateEvent = createEvent or (function() return __TS__New(____exports.Event) end)
149
+ ____exports.createDispatchingEvent = function(underlyingEvent, extractKey, invokeEvent, createEvent)
150
+ if invokeEvent == nil then
151
+ invokeEvent = ____exports.Event.invoke
152
+ end
153
+ if createEvent == nil then
154
+ createEvent = function() return __TS__New(____exports.Event) end
155
+ end
151
156
  local initialized = false
152
157
  return setmetatable(
153
158
  {},
@@ -157,17 +162,16 @@ ____exports.createDispatchingEvent = function(underlyingEvent, extractKey, creat
157
162
  return underlyingEvent[id]
158
163
  end
159
164
  if not initialized then
160
- local invoke = ____exports.Event.invoke
161
165
  underlyingEvent:addListener(function(...)
162
166
  local key = extractKey(...)
163
167
  local event = rawget(self, key)
164
168
  if event then
165
- invoke(event, ...)
169
+ invokeEvent(event, ...)
166
170
  end
167
171
  end)
168
172
  initialized = true
169
173
  end
170
- local event = actualCreateEvent()
174
+ local event = createEvent()
171
175
  rawset(self, id, event)
172
176
  return event
173
177
  end,
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /** @noSelfInFile */
2
2
  import "./types";
3
+ import "./patch-lua";
3
4
  import "./patch-lualib";
4
5
  import "./patch-natives";
5
6
  import "./global/math";
package/index.lua CHANGED
@@ -1,5 +1,6 @@
1
1
  local ____exports = {}
2
2
  require("types")
3
+ require("patch-lua")
3
4
  require("patch-lualib")
4
5
  require("patch-natives")
5
6
  require("global.math")
package/lualib_bundle.lua CHANGED
@@ -193,8 +193,14 @@ do
193
193
  result[#result + 1] = v
194
194
  end
195
195
  else
196
- for i, v in arrayLikeIterator(arrayLike) do
197
- result[#result + 1] = mapFn(thisArg, v, i - 1)
196
+ local i = 0
197
+ for ____, v in arrayLikeIterator(arrayLike) do
198
+ local ____mapFn_3 = mapFn
199
+ local ____thisArg_1 = thisArg
200
+ local ____v_2 = v
201
+ local ____i_0 = i
202
+ i = ____i_0 + 1
203
+ result[#result + 1] = ____mapFn_3(____thisArg_1, ____v_2, ____i_0)
198
204
  end
199
205
  end
200
206
  return result
@@ -773,10 +779,11 @@ end
773
779
 
774
780
  local __TS__AsyncAwaiter, __TS__Await
775
781
  do
776
- local cocreate = coroutine.create
777
- local coresume = coroutine.resume
778
- local costatus = coroutine.status
779
- local coyield = coroutine.yield
782
+ local ____coroutine = _G.coroutine or ({})
783
+ local cocreate = ____coroutine.create
784
+ local coresume = ____coroutine.resume
785
+ local costatus = ____coroutine.status
786
+ local coyield = ____coroutine.yield
780
787
  function __TS__AsyncAwaiter(generator)
781
788
  return __TS__New(
782
789
  __TS__Promise,
@@ -1087,6 +1094,11 @@ do
1087
1094
  end
1088
1095
  if __TS__StringIncludes(_VERSION, "Lua 5.0") then
1089
1096
  return debug.traceback(("[Level " .. tostring(level)) .. "]")
1097
+ elseif _VERSION == "Lua 5.1" then
1098
+ return string.sub(
1099
+ debug.traceback("", level),
1100
+ 2
1101
+ )
1090
1102
  else
1091
1103
  return debug.traceback(nil, level)
1092
1104
  end
@@ -1095,7 +1107,7 @@ do
1095
1107
  return function(self)
1096
1108
  local description = getDescription(self)
1097
1109
  local caller = debug.getinfo(3, "f")
1098
- local isClassicLua = __TS__StringIncludes(_VERSION, "Lua 5.0") or _VERSION == "Lua 5.1"
1110
+ local isClassicLua = __TS__StringIncludes(_VERSION, "Lua 5.0")
1099
1111
  if isClassicLua or caller and caller.func ~= error then
1100
1112
  return description
1101
1113
  else
@@ -1119,7 +1131,7 @@ do
1119
1131
  end
1120
1132
  self.message = message
1121
1133
  self.name = "Error"
1122
- self.stack = getErrorStack(nil, self.constructor.new)
1134
+ self.stack = getErrorStack(nil, __TS__New)
1123
1135
  local metatable = getmetatable(self)
1124
1136
  if metatable and not metatable.__errorToStringPatched then
1125
1137
  metatable.__errorToStringPatched = true
@@ -1417,19 +1429,51 @@ do
1417
1429
  Map[Symbol.species] = Map
1418
1430
  end
1419
1431
 
1432
+ local function __TS__MapGroupBy(items, keySelector)
1433
+ local result = __TS__New(Map)
1434
+ local i = 0
1435
+ for ____, item in __TS__Iterator(items) do
1436
+ local key = keySelector(nil, item, i)
1437
+ if result:has(key) then
1438
+ local ____temp_0 = result:get(key)
1439
+ ____temp_0[#____temp_0 + 1] = item
1440
+ else
1441
+ result:set(key, {item})
1442
+ end
1443
+ i = i + 1
1444
+ end
1445
+ return result
1446
+ end
1447
+
1420
1448
  local __TS__Match = string.match
1421
1449
 
1422
1450
  local __TS__MathAtan2 = math.atan2 or math.atan
1423
1451
 
1424
1452
  local __TS__MathModf = math.modf
1425
1453
 
1454
+ local function __TS__NumberIsNaN(value)
1455
+ return value ~= value
1456
+ end
1457
+
1426
1458
  local function __TS__MathSign(val)
1427
- if val > 0 then
1428
- return 1
1429
- elseif val < 0 then
1459
+ if __TS__NumberIsNaN(val) or val == 0 then
1460
+ return val
1461
+ end
1462
+ if val < 0 then
1430
1463
  return -1
1431
1464
  end
1432
- return 0
1465
+ return 1
1466
+ end
1467
+
1468
+ local function __TS__NumberIsFinite(value)
1469
+ return type(value) == "number" and value == value and value ~= math.huge and value ~= -math.huge
1470
+ end
1471
+
1472
+ local function __TS__MathTrunc(val)
1473
+ if not __TS__NumberIsFinite(val) or val == 0 then
1474
+ return val
1475
+ end
1476
+ return val > 0 and math.floor(val) or math.ceil(val)
1433
1477
  end
1434
1478
 
1435
1479
  local function __TS__Number(value)
@@ -1459,18 +1503,10 @@ local function __TS__Number(value)
1459
1503
  end
1460
1504
  end
1461
1505
 
1462
- local function __TS__NumberIsFinite(value)
1463
- return type(value) == "number" and value == value and value ~= math.huge and value ~= -math.huge
1464
- end
1465
-
1466
1506
  local function __TS__NumberIsInteger(value)
1467
1507
  return __TS__NumberIsFinite(value) and math.floor(value) == value
1468
1508
  end
1469
1509
 
1470
- local function __TS__NumberIsNaN(value)
1471
- return value ~= value
1472
- end
1473
-
1474
1510
  local function __TS__StringSubstring(self, start, ____end)
1475
1511
  if ____end ~= ____end then
1476
1512
  ____end = 0
@@ -1603,23 +1639,17 @@ local function __TS__ObjectDefineProperty(target, key, desc)
1603
1639
  local valueExists = value ~= nil
1604
1640
  local ____desc_set_4 = desc.set
1605
1641
  local ____desc_get_5 = desc.get
1606
- local ____temp_0
1607
- if desc.configurable ~= nil then
1608
- ____temp_0 = desc.configurable
1609
- else
1610
- ____temp_0 = valueExists
1642
+ local ____desc_configurable_0 = desc.configurable
1643
+ if ____desc_configurable_0 == nil then
1644
+ ____desc_configurable_0 = valueExists
1611
1645
  end
1612
- local ____temp_1
1613
- if desc.enumerable ~= nil then
1614
- ____temp_1 = desc.enumerable
1615
- else
1616
- ____temp_1 = valueExists
1646
+ local ____desc_enumerable_1 = desc.enumerable
1647
+ if ____desc_enumerable_1 == nil then
1648
+ ____desc_enumerable_1 = valueExists
1617
1649
  end
1618
- local ____temp_2
1619
- if desc.writable ~= nil then
1620
- ____temp_2 = desc.writable
1621
- else
1622
- ____temp_2 = valueExists
1650
+ local ____desc_writable_2 = desc.writable
1651
+ if ____desc_writable_2 == nil then
1652
+ ____desc_writable_2 = valueExists
1623
1653
  end
1624
1654
  local ____temp_3
1625
1655
  if desc.value ~= nil then
@@ -1630,9 +1660,9 @@ local function __TS__ObjectDefineProperty(target, key, desc)
1630
1660
  descriptor = {
1631
1661
  set = ____desc_set_4,
1632
1662
  get = ____desc_get_5,
1633
- configurable = ____temp_0,
1634
- enumerable = ____temp_1,
1635
- writable = ____temp_2,
1663
+ configurable = ____desc_configurable_0,
1664
+ enumerable = ____desc_enumerable_1,
1665
+ writable = ____desc_writable_2,
1636
1666
  value = ____temp_3
1637
1667
  }
1638
1668
  end
@@ -1671,6 +1701,22 @@ local function __TS__ObjectFromEntries(entries)
1671
1701
  return obj
1672
1702
  end
1673
1703
 
1704
+ local function __TS__ObjectGroupBy(items, keySelector)
1705
+ local result = {}
1706
+ local i = 0
1707
+ for ____, item in __TS__Iterator(items) do
1708
+ local key = keySelector(nil, item, i)
1709
+ if result[key] ~= nil then
1710
+ local ____result_key_0 = result[key]
1711
+ ____result_key_0[#____result_key_0 + 1] = item
1712
+ else
1713
+ result[key] = {item}
1714
+ end
1715
+ i = i + 1
1716
+ end
1717
+ return result
1718
+ end
1719
+
1674
1720
  local function __TS__ObjectKeys(obj)
1675
1721
  local result = {}
1676
1722
  local len = 0
@@ -1994,6 +2040,64 @@ do
1994
2040
  end
1995
2041
  }
1996
2042
  end
2043
+ function Set.prototype.union(self, other)
2044
+ local result = __TS__New(Set, self)
2045
+ for ____, item in __TS__Iterator(other) do
2046
+ result:add(item)
2047
+ end
2048
+ return result
2049
+ end
2050
+ function Set.prototype.intersection(self, other)
2051
+ local result = __TS__New(Set)
2052
+ for ____, item in __TS__Iterator(self) do
2053
+ if other:has(item) then
2054
+ result:add(item)
2055
+ end
2056
+ end
2057
+ return result
2058
+ end
2059
+ function Set.prototype.difference(self, other)
2060
+ local result = __TS__New(Set, self)
2061
+ for ____, item in __TS__Iterator(other) do
2062
+ result:delete(item)
2063
+ end
2064
+ return result
2065
+ end
2066
+ function Set.prototype.symmetricDifference(self, other)
2067
+ local result = __TS__New(Set, self)
2068
+ for ____, item in __TS__Iterator(other) do
2069
+ if self:has(item) then
2070
+ result:delete(item)
2071
+ else
2072
+ result:add(item)
2073
+ end
2074
+ end
2075
+ return result
2076
+ end
2077
+ function Set.prototype.isSubsetOf(self, other)
2078
+ for ____, item in __TS__Iterator(self) do
2079
+ if not other:has(item) then
2080
+ return false
2081
+ end
2082
+ end
2083
+ return true
2084
+ end
2085
+ function Set.prototype.isSupersetOf(self, other)
2086
+ for ____, item in __TS__Iterator(other) do
2087
+ if not self:has(item) then
2088
+ return false
2089
+ end
2090
+ end
2091
+ return true
2092
+ end
2093
+ function Set.prototype.isDisjointFrom(self, other)
2094
+ for ____, item in __TS__Iterator(self) do
2095
+ if other:has(item) then
2096
+ return false
2097
+ end
2098
+ end
2099
+ return true
2100
+ end
1997
2101
  Set[Symbol.species] = Set
1998
2102
  end
1999
2103
 
@@ -2443,10 +2547,7 @@ local function __TS__Using(self, cb, ...)
2443
2547
  local args = {...}
2444
2548
  local thrownError
2445
2549
  local ok, result = xpcall(
2446
- function() return cb(
2447
- nil,
2448
- __TS__Unpack(args)
2449
- ) end,
2550
+ function() return cb(__TS__Unpack(args)) end,
2450
2551
  function(err)
2451
2552
  thrownError = err
2452
2553
  return thrownError
@@ -2563,10 +2664,12 @@ return {
2563
2664
  __TS__Iterator = __TS__Iterator,
2564
2665
  __TS__LuaIteratorSpread = __TS__LuaIteratorSpread,
2565
2666
  Map = Map,
2667
+ __TS__MapGroupBy = __TS__MapGroupBy,
2566
2668
  __TS__Match = __TS__Match,
2567
2669
  __TS__MathAtan2 = __TS__MathAtan2,
2568
2670
  __TS__MathModf = __TS__MathModf,
2569
2671
  __TS__MathSign = __TS__MathSign,
2672
+ __TS__MathTrunc = __TS__MathTrunc,
2570
2673
  __TS__New = __TS__New,
2571
2674
  __TS__Number = __TS__Number,
2572
2675
  __TS__NumberIsFinite = __TS__NumberIsFinite,
@@ -2582,6 +2685,7 @@ return {
2582
2685
  __TS__ObjectFromEntries = __TS__ObjectFromEntries,
2583
2686
  __TS__ObjectGetOwnPropertyDescriptor = __TS__ObjectGetOwnPropertyDescriptor,
2584
2687
  __TS__ObjectGetOwnPropertyDescriptors = __TS__ObjectGetOwnPropertyDescriptors,
2688
+ __TS__ObjectGroupBy = __TS__ObjectGroupBy,
2585
2689
  __TS__ObjectKeys = __TS__ObjectKeys,
2586
2690
  __TS__ObjectRest = __TS__ObjectRest,
2587
2691
  __TS__ObjectValues = __TS__ObjectValues,
package/math/vec2.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="@typescript-to-lua/language-extensions" />
2
1
  /** @noSelfInFile */
3
2
  /** Gets the height of the terrain at the position specified by the vector. */
4
3
  export declare const getTerrainZ: (x: number, y: number) => number;
@@ -7,12 +6,6 @@ export declare const angleBetweenPoints: (x1: number, y1: number, x2: number, y2
7
6
  /** Returns the distance between a and b. */
8
7
  export declare const distance: (x1: number, y1: number, x2: number, y2: number) => number;
9
8
  /** Moves a point current towards target. */
10
- export declare const moveTowards: (x1: number, y1: number, x2: number, y2: number, distance: number) => LuaMultiReturn<[
11
- number,
12
- number
13
- ]>;
9
+ export declare const moveTowards: (x1: number, y1: number, x2: number, y2: number, distance: number) => LuaMultiReturn<[number, number]>;
14
10
  /** Gets a polar offset from this vector. Angle should be specified in degrees. */
15
- export declare const polarOffset: (x: number, y: number, angle: number, distance: number) => LuaMultiReturn<[
16
- number,
17
- number
18
- ]>;
11
+ export declare const polarOffset: (x: number, y: number, angle: number, distance: number) => LuaMultiReturn<[number, number]>;
package/math.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="lua-types/5.3" />
2
- /// <reference types="lua-types/5.3" />
3
1
  /** @noSelfInFile */
4
2
  export declare const MINIMUM_POSITIVE_NORMALIZED_FLOAT: number;
5
3
  export declare const MINIMUM_POSITIVE_FLOAT: number;
package/net/socket.d.ts CHANGED
@@ -1,9 +1,15 @@
1
1
  /** @noSelfInFile */
2
2
  import { Event } from "../event";
3
3
  import { Player } from "../core/types/player";
4
+ declare const enum SocketPropertyKey {
5
+ ID = 0,
6
+ CHUNK_ID = 1
7
+ }
4
8
  export declare class Socket {
5
- private readonly id;
9
+ private readonly [SocketPropertyKey.ID];
10
+ private readonly [SocketPropertyKey.CHUNK_ID];
6
11
  readonly onMessage: Event<[Player, string]>;
7
12
  constructor();
8
13
  send(data: string): void;
9
14
  }
15
+ export {};