warscript 0.0.1-dev.ea69747 → 0.0.1-dev.fa6dee5

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 (95) hide show
  1. package/attributes.d.ts +12 -0
  2. package/attributes.lua +16 -0
  3. package/core/types/frame.d.ts +0 -1
  4. package/core/types/group.d.ts +0 -1
  5. package/core/types/handle.d.ts +2 -1
  6. package/core/types/handle.lua +5 -0
  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.lua +1 -1
  12. package/engine/ability.d.ts +1 -1
  13. package/engine/behavior.d.ts +6 -6
  14. package/engine/behaviour/ability/apply-unit-behavior.d.ts +13 -4
  15. package/engine/behaviour/ability/apply-unit-behavior.lua +31 -9
  16. package/engine/behaviour/ability/instant-impact.lua +4 -0
  17. package/engine/behaviour/ability.d.ts +8 -1
  18. package/engine/behaviour/ability.lua +62 -0
  19. package/engine/behaviour/unit/stun-immunity.d.ts +0 -1
  20. package/engine/buff.d.ts +2 -2
  21. package/engine/internal/ability.d.ts +1 -1
  22. package/engine/internal/mechanics/ability-duration.d.ts +1 -3
  23. package/engine/internal/mechanics/ability-duration.lua +2 -0
  24. package/engine/internal/mechanics/cast-ability.d.ts +2 -0
  25. package/engine/internal/mechanics/cast-ability.lua +86 -0
  26. package/engine/internal/unit/bonus.d.ts +5 -6
  27. package/engine/internal/unit/detach-missiles.d.ts +7 -0
  28. package/engine/internal/unit/detach-missiles.lua +30 -0
  29. package/engine/internal/unit-missile-launch.lua +1 -1
  30. package/engine/internal/unit.d.ts +36 -9
  31. package/engine/internal/unit.lua +215 -63
  32. package/engine/object-data/auxiliary/attachment-preset.d.ts +0 -1
  33. package/engine/object-data/auxiliary/combat-classification.d.ts +0 -2
  34. package/engine/object-data/entry/ability-type/blank-configurable.d.ts +0 -1
  35. package/engine/object-data/entry/ability-type/blank-passive.d.ts +0 -1
  36. package/engine/object-data/entry/ability-type/blink.d.ts +10 -0
  37. package/engine/object-data/entry/ability-type/blink.lua +39 -0
  38. package/engine/object-data/entry/ability-type/channel.d.ts +0 -1
  39. package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
  40. package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
  41. package/engine/object-data/entry/ability-type/mine.lua +39 -0
  42. package/engine/object-data/entry/ability-type/spirit-touch.d.ts +2 -2
  43. package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
  44. package/engine/object-data/entry/ability-type.d.ts +1 -1
  45. package/engine/object-data/entry/ability-type.lua +1 -0
  46. package/engine/object-data/entry/buff-type/applicable.d.ts +0 -1
  47. package/engine/object-data/entry/buff-type/applicable.lua +27 -71
  48. package/engine/object-data/entry/buff-type/blank.d.ts +0 -1
  49. package/engine/object-data/entry/buff-type.d.ts +0 -1
  50. package/engine/object-data/entry/destructible-type.d.ts +0 -1
  51. package/engine/object-data/entry/item-type/blank.d.ts +0 -1
  52. package/engine/object-data/entry/item-type.d.ts +0 -1
  53. package/engine/object-data/entry/lightning-type.d.ts +0 -1
  54. package/engine/object-data/entry/unit-type.d.ts +42 -2
  55. package/engine/object-data/entry/unit-type.lua +378 -50
  56. package/engine/object-data/entry/upgrade/blank.d.ts +0 -1
  57. package/engine/object-data/entry/upgrade.d.ts +0 -1
  58. package/engine/object-data/entry.d.ts +2 -3
  59. package/engine/object-field/ability.d.ts +8 -6
  60. package/engine/object-field/ability.lua +6 -0
  61. package/engine/object-field/unit.d.ts +1 -0
  62. package/engine/object-field/unit.lua +3 -0
  63. package/engine/object-field.d.ts +6 -4
  64. package/engine/object-field.lua +38 -12
  65. package/engine/random.d.ts +1 -0
  66. package/engine/random.lua +9 -0
  67. package/engine/standard/entries/unit-type.d.ts +42 -1
  68. package/engine/standard/entries/unit-type.lua +42 -1
  69. package/engine/standard/fields/ability.d.ts +1 -1
  70. package/engine/standard/fields/ability.lua +1 -1
  71. package/engine/unit.d.ts +1 -0
  72. package/engine/unit.lua +10 -2
  73. package/event.d.ts +0 -1
  74. package/exception.d.ts +2 -0
  75. package/exception.lua +4 -0
  76. package/global/vec2.lua +1 -0
  77. package/lualib_bundle.lua +139 -40
  78. package/math/vec2.d.ts +2 -9
  79. package/math.d.ts +0 -2
  80. package/objutil/ability.d.ts +0 -1
  81. package/objutil/buff.d.ts +0 -1
  82. package/objutil/object.d.ts +0 -1
  83. package/objutil/unit.d.ts +0 -1
  84. package/package.json +13 -14
  85. package/string.d.ts +30 -0
  86. package/string.lua +14 -0
  87. package/util/stream.d.ts +0 -1
  88. package/utility/arrays.d.ts +4 -5
  89. package/utility/arrays.lua +4 -1
  90. package/utility/bit-set.d.ts +0 -2
  91. package/utility/linked-set.d.ts +21 -8
  92. package/utility/linked-set.lua +16 -0
  93. package/utility/lua-maps.d.ts +1 -2
  94. package/utility/lua-sets.d.ts +1 -2
  95. package/utility/types.d.ts +2 -2
@@ -29,6 +29,9 @@ __TS__ClassExtends(UnitStringField, ____exports.UnitField)
29
29
  function UnitStringField.prototype.getNativeFieldById(self, id)
30
30
  return ConvertUnitStringField(id)
31
31
  end
32
+ function UnitStringField.prototype.hasNativeFieldValue(self)
33
+ return true
34
+ end
32
35
  function UnitStringField.prototype.getNativeFieldValue(self, instance)
33
36
  return instance:getField(self.nativeField)
34
37
  end
@@ -1,4 +1,3 @@
1
- /// <reference types="@typescript-to-lua/language-extensions" />
2
1
  /** @noSelfInFile */
3
2
  import { DispatchingEvent } from "../event";
4
3
  import { AbstractConstructor } from "../utility/types";
@@ -9,7 +8,6 @@ export type ObjectFieldId = number & {
9
8
  export type ObjectFieldConstructor<T extends ObjectFieldBase<any, any, any, any>> = OmitConstructor<typeof ObjectFieldBase> & (new (id: number) => T);
10
9
  export type ObjectFieldAbstractConstructor<T extends ObjectFieldBase<any, any, any, any>> = OmitConstructor<typeof ObjectFieldBase> & (abstract new (id: number) => T);
11
10
  declare abstract class ObjectFieldBase<ObjectDataEntryType extends ObjectDataEntry, InstanceType extends AnyNotNil, ValueType, NativeFieldType> {
12
- protected readonly valueByInstance: LuaMap<InstanceType, ValueType>;
13
11
  protected abstract readonly instanceClass: AbstractConstructor<InstanceType> | Function;
14
12
  supports(instance: AnyNotNil): instance is InstanceType & {
15
13
  readonly __oneSidedTypeGuard: unique symbol;
@@ -33,21 +31,23 @@ export type ObjectFieldValueChangeEvent<T extends ObjectField<any, any, any, any
33
31
  previousValue: ValueType,
34
32
  newValue: ValueType
35
33
  ]> : never;
36
- export type ReadonlyObjectFieldType<T extends ObjectField<any, any, any, any>> = Omit<T, "setValue" | "removeValue">;
34
+ export type ReadonlyObjectFieldType<T extends ObjectField<any, any, any, any>> = Omit<T, "setValue" | "removeValue" | "trySetValue">;
37
35
  type ReadonlyObjectFieldConstructor<T extends ObjectField> = OmitConstructor<typeof ObjectField> & (abstract new (...args: any[]) => ReadonlyObjectFieldType<T>);
38
36
  export declare abstract class ObjectField<ObjectDataEntryType extends ObjectDataEntry = ObjectDataEntry, InstanceType extends AnyNotNil = AnyNotNil, ValueType extends number | string | boolean = number | string | boolean, NativeFieldType = unknown> extends ObjectFieldBase<ObjectDataEntryType, InstanceType, ValueType, NativeFieldType> {
39
37
  protected abstract readonly defaultValue: ValueType;
38
+ protected abstract hasNativeFieldValue(instance: InstanceType): boolean;
40
39
  protected abstract getNativeFieldValue(instance: InstanceType): ValueType;
41
40
  protected abstract setNativeFieldValue(instance: InstanceType, value: ValueType): boolean;
42
41
  getValue(entry: ObjectDataEntryType | InstanceType): ValueType;
43
42
  setValue(entry: ObjectDataEntryType | InstanceType, value: ValueType): boolean;
44
43
  removeValue(entry: ObjectDataEntryType): boolean;
44
+ trySetValue(entry: ObjectDataEntryType | InstanceType, value: unknown): boolean;
45
45
  private invokeValueChangeEvent;
46
46
  private invokeValueChangeEventRecursive;
47
47
  protected static getOrCreateValueChangeEvent<T extends ObjectField, R extends ReadonlyObjectFieldType<T>>(this: ReadonlyObjectFieldConstructor<T>): ObjectFieldValueChangeEvent<R>;
48
48
  static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<ObjectField>>;
49
49
  }
50
- export type ReadonlyObjectLevelFieldType<T extends ObjectLevelField<any, any, any, any>> = Omit<T, "setValue">;
50
+ export type ReadonlyObjectLevelFieldType<T extends ObjectLevelField<any, any, any, any>> = Omit<T, "setValue" | "trySetValue">;
51
51
  export type ObjectLevelFieldValueChangeEvent<T extends ObjectLevelField<any, any, any, any> | ReadonlyObjectLevelFieldType<ObjectLevelField<any, any, any, any>>> = T extends ObjectLevelField<any, infer InstanceType, infer ValueType, any, any> ? DispatchingEvent<[
52
52
  instance: InstanceType,
53
53
  field: T,
@@ -71,11 +71,13 @@ export declare abstract class ObjectArrayField<ObjectDataEntryType extends Objec
71
71
  }
72
72
  export declare abstract class ObjectLevelField<ObjectDataEntryType extends ObjectDataEntry = ObjectDataEntry, InstanceType extends AnyNotNil = AnyNotNil, ValueType extends number | string | boolean = number | string | boolean, InputValueType extends ValueType = never, NativeFieldType = unknown> extends ObjectFieldBase<ObjectDataEntryType, InstanceType, ValueType[], NativeFieldType> {
73
73
  protected abstract readonly defaultValue: ValueType;
74
+ protected abstract hasNativeFieldValue(instance: InstanceType): boolean;
74
75
  protected abstract getNativeFieldValue(instance: InstanceType, level: number): ValueType;
75
76
  protected abstract setNativeFieldValue(instance: InstanceType, level: number, value: ValueType): boolean;
76
77
  protected abstract getLevelCount(entry: ObjectDataEntryType | InstanceType): number;
77
78
  getValue<LevelType extends [number] | []>(entry: ObjectDataEntryType | InstanceType, ...[level]: LevelType): LevelType extends [number] ? ValueType : ValueType[];
78
79
  setValue(entry: ObjectDataEntryType | InstanceType, ...[levelOrValue, value]: [value: ObjectDataEntryLevelFieldValueSupplier<InputValueType, ValueType>] | [level: number, value: InputValueType]): boolean;
80
+ trySetValue(entry: ObjectDataEntryType | InstanceType, levelOrValue: number | unknown, value?: unknown): boolean;
79
81
  private invokeValueChangeEvent;
80
82
  private invokeValueChangeEventRecursive;
81
83
  protected static getOrCreateValueChangeEvent<T extends ObjectLevelField, R extends ReadonlyObjectLevelFieldType<T>>(this: ReadonlyObjectLevelFieldConstructor<T>): ObjectLevelFieldValueChangeEvent<R>;
@@ -4,6 +4,7 @@ local __TS__Class = ____lualib.__TS__Class
4
4
  local __TS__InstanceOf = ____lualib.__TS__InstanceOf
5
5
  local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
6
6
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
7
+ local __TS__TypeOf = ____lualib.__TS__TypeOf
7
8
  local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
8
9
  local ____exports = {}
9
10
  local ____event = require("event")
@@ -131,13 +132,15 @@ function ObjectField.prototype.setValue(self, entry, value)
131
132
  return true
132
133
  end
133
134
  end
135
+ if not self:hasNativeFieldValue(entry) then
136
+ return false
137
+ end
134
138
  local previousValue = self:getNativeFieldValue(entry)
135
139
  if value ~= previousValue then
136
- if self:setNativeFieldValue(entry, value) then
137
- self:invokeValueChangeEvent(entry, self, previousValue, value)
138
- else
140
+ if not self:setNativeFieldValue(entry, value) then
139
141
  return false
140
142
  end
143
+ self:invokeValueChangeEvent(entry, self, previousValue, value)
141
144
  end
142
145
  return true
143
146
  end
@@ -155,6 +158,12 @@ function ObjectField.prototype.removeValue(self, entry)
155
158
  end
156
159
  return false
157
160
  end
161
+ function ObjectField.prototype.trySetValue(self, entry, value)
162
+ if __TS__TypeOf(value) ~= __TS__TypeOf(self.defaultValue) then
163
+ return false
164
+ end
165
+ return self:setValue(entry, value)
166
+ end
158
167
  function ObjectField.prototype.invokeValueChangeEvent(self, ...)
159
168
  self:invokeValueChangeEventRecursive(
160
169
  getClass(self),
@@ -383,22 +392,39 @@ function ObjectLevelField.prototype.setValue(self, entry, levelOrValue, value)
383
392
  return true
384
393
  end
385
394
  end
395
+ if not self:hasNativeFieldValue(entry) then
396
+ return false
397
+ end
386
398
  local previousValue = self:getNativeFieldValue(entry, level)
387
399
  if value ~= previousValue then
388
- if self:setNativeFieldValue(entry, level, value) then
389
- self:invokeValueChangeEvent(
390
- entry,
391
- self,
392
- level,
393
- previousValue,
394
- value
395
- )
396
- else
400
+ if not self:setNativeFieldValue(entry, level, value) then
397
401
  return false
398
402
  end
403
+ self:invokeValueChangeEvent(
404
+ entry,
405
+ self,
406
+ level,
407
+ previousValue,
408
+ value
409
+ )
399
410
  end
400
411
  return true
401
412
  end
413
+ function ObjectLevelField.prototype.trySetValue(self, entry, levelOrValue, value)
414
+ if value ~= nil then
415
+ if __TS__TypeOf(value) ~= __TS__TypeOf(self.defaultValue) then
416
+ return false
417
+ end
418
+ if type(levelOrValue) ~= "number" then
419
+ return false
420
+ end
421
+ return self:setValue(entry, levelOrValue, value)
422
+ end
423
+ if __TS__TypeOf(levelOrValue) ~= __TS__TypeOf(self.defaultValue) then
424
+ return false
425
+ end
426
+ return self:setValue(entry, levelOrValue)
427
+ end
402
428
  function ObjectLevelField.prototype.invokeValueChangeEvent(self, ...)
403
429
  self:invokeValueChangeEventRecursive(
404
430
  getClass(self),
@@ -8,3 +8,4 @@ export declare const randomFloat: {
8
8
  (upperBound?: number): number;
9
9
  (lowerBound: number, upperBound: number): number;
10
10
  };
11
+ export declare const randomXY: (centerX: number, centerY: number, range: number) => LuaMultiReturn<[x: number, y: number]>;
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,11 +47,29 @@ 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;
32
69
  export declare const DEATH_KNIGHT_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
70
+ export declare const ZOMBIE_UNIT_TYPE_ID: StandardUnitTypeId;
71
+ export declare const ZOMBIE_FEMALE_UNIT_TYPE_ID: StandardUnitTypeId;
72
+ export declare const ARTHAS_EVIL_HERO_UNIT_TYPE_ID: StandardHeroUnitTypeId;
33
73
  export declare const DIRE_MAMMOTH_UNIT_TYPE_ID: StandardUnitTypeId;
34
74
  export declare const ELDER_JUNGLE_STALKER_UNIT_TYPE_ID: StandardUnitTypeId;
35
75
  export declare const ENRAGED_ELEMENTAL_UNIT_TYPE_ID: StandardUnitTypeId;
@@ -58,6 +98,7 @@ export declare const WENDIGO_UNIT_TYPE_ID: StandardUnitTypeId;
58
98
  export declare const WENDIGO_SHAMAN_UNIT_TYPE_ID: StandardUnitTypeId;
59
99
  export declare const WILDKIN_UNIT_TYPE_ID: StandardUnitTypeId;
60
100
  export declare const WRAITH_UNIT_TYPE_ID: StandardUnitTypeId;
101
+ export declare const GOBLIN_LAND_MINE_UNIT_TYPE_ID: StandardUnitTypeId;
61
102
  export declare const CIRCLE_OF_POWER_UNIT_TYPE_ID: StandardUnitTypeId;
62
103
  export declare const CIRCLE_OF_POWER_MEDIUM_UNIT_TYPE_ID: StandardUnitTypeId;
63
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,11 +46,29 @@ ____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")
31
68
  ____exports.DEATH_KNIGHT_HERO_UNIT_TYPE_ID = fourCC("Udea")
69
+ ____exports.ZOMBIE_UNIT_TYPE_ID = fourCC("nzom")
70
+ ____exports.ZOMBIE_FEMALE_UNIT_TYPE_ID = fourCC("nzof")
71
+ ____exports.ARTHAS_EVIL_HERO_UNIT_TYPE_ID = fourCC("Uear")
32
72
  ____exports.DIRE_MAMMOTH_UNIT_TYPE_ID = fourCC("nmdr")
33
73
  ____exports.ELDER_JUNGLE_STALKER_UNIT_TYPE_ID = fourCC("njga")
34
74
  ____exports.ENRAGED_ELEMENTAL_UNIT_TYPE_ID = fourCC("nele")
@@ -57,6 +97,7 @@ ____exports.WENDIGO_UNIT_TYPE_ID = fourCC("nwen")
57
97
  ____exports.WENDIGO_SHAMAN_UNIT_TYPE_ID = fourCC("nwns")
58
98
  ____exports.WILDKIN_UNIT_TYPE_ID = fourCC("nowb")
59
99
  ____exports.WRAITH_UNIT_TYPE_ID = fourCC("ngh2")
100
+ ____exports.GOBLIN_LAND_MINE_UNIT_TYPE_ID = fourCC("nglm")
60
101
  ____exports.CIRCLE_OF_POWER_UNIT_TYPE_ID = fourCC("ncop")
61
102
  ____exports.CIRCLE_OF_POWER_MEDIUM_UNIT_TYPE_ID = fourCC("ncp2")
62
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
@@ -14,6 +14,7 @@ import "./internal/unit/missile";
14
14
  import "./internal/unit-missile-launch";
15
15
  import "./internal/unit/ghost-counter";
16
16
  import "./internal/unit/invulnerability-counter";
17
+ import "./internal/unit/detach-missiles";
17
18
  import "./internal/unit/band-aids/ancestral-spirit-cannibalize";
18
19
  export { Unit, DamagingEvent, DamageEvent } from "./internal/unit";
19
20
  export * from "./internal/unit+damage";
package/engine/unit.lua CHANGED
@@ -14,11 +14,11 @@ require("engine.internal.unit.missile")
14
14
  require("engine.internal.unit-missile-launch")
15
15
  require("engine.internal.unit.ghost-counter")
16
16
  require("engine.internal.unit.invulnerability-counter")
17
+ require("engine.internal.unit.detach-missiles")
17
18
  require("engine.internal.unit.band-aids.ancestral-spirit-cannibalize")
18
19
  do
19
20
  local ____unit = require("engine.internal.unit")
20
- local Unit = ____unit.Unit
21
- ____exports.Unit = Unit
21
+ ____exports.Unit = ____unit.Unit
22
22
  end
23
23
  do
24
24
  local ____export = require("engine.internal.unit+damage")
@@ -28,4 +28,12 @@ do
28
28
  end
29
29
  end
30
30
  end
31
+ do
32
+ local ____export = require("engine.internal.unit+rally")
33
+ for ____exportKey, ____exportValue in pairs(____export) do
34
+ if ____exportKey ~= "default" then
35
+ ____exports[____exportKey] = ____exportValue
36
+ end
37
+ end
38
+ end
31
39
  return ____exports
package/event.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="@typescript-to-lua/language-extensions" />
2
1
  /** @noSelfInFile */
3
2
  export type EventListener<T extends any[]> = (...args: T) => void;
4
3
  export declare const enum EventListenerPriority {
package/exception.d.ts CHANGED
@@ -15,3 +15,5 @@ export declare class IllegalStateException extends Exception {
15
15
  }
16
16
  export declare class CancellationException extends Exception {
17
17
  }
18
+ export declare class UnsupportedOperationException extends Exception {
19
+ }
package/exception.lua CHANGED
@@ -50,4 +50,8 @@ ____exports.CancellationException = __TS__Class()
50
50
  local CancellationException = ____exports.CancellationException
51
51
  CancellationException.name = "CancellationException"
52
52
  __TS__ClassExtends(CancellationException, ____exports.Exception)
53
+ ____exports.UnsupportedOperationException = __TS__Class()
54
+ local UnsupportedOperationException = ____exports.UnsupportedOperationException
55
+ UnsupportedOperationException.name = "UnsupportedOperationException"
56
+ __TS__ClassExtends(UnsupportedOperationException, ____exports.Exception)
53
57
  return ____exports
package/global/vec2.lua CHANGED
@@ -15,6 +15,7 @@ local abs = math.abs
15
15
 
16
16
  local location = Location and Location(0, 0)
17
17
  local moveLocation = MoveLocation
18
+ local getLocationZ = GetLocationZ
18
19
 
19
20
  local vec2 = {}
20
21