warscript 0.0.1-dev.e196516 → 0.0.1-dev.e3899e3

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 (110) hide show
  1. package/attributes.d.ts +1 -0
  2. package/attributes.lua +9 -0
  3. package/core/types/frame.lua +24 -21
  4. package/core/types/player.d.ts +16 -0
  5. package/core/types/player.lua +60 -15
  6. package/core/types/playerCamera.d.ts +2 -0
  7. package/core/types/playerCamera.lua +123 -5
  8. package/core/types/tileCell.d.ts +11 -1
  9. package/core/types/tileCell.lua +97 -0
  10. package/core/types/timer.d.ts +3 -1
  11. package/core/types/timer.lua +27 -2
  12. package/decl/native.d.ts +6 -4
  13. package/destroyable.d.ts +1 -0
  14. package/destroyable.lua +9 -0
  15. package/engine/behavior.d.ts +14 -1
  16. package/engine/behavior.lua +230 -70
  17. package/engine/behaviour/ability/apply-buff.lua +5 -5
  18. package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
  19. package/engine/behaviour/ability/emulate-impact.lua +2 -1
  20. package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
  21. package/engine/behaviour/ability/remove-buffs.lua +21 -0
  22. package/engine/behaviour/ability/restore-mana.d.ts +1 -1
  23. package/engine/behaviour/ability/restore-mana.lua +6 -6
  24. package/engine/behaviour/ability.d.ts +2 -1
  25. package/engine/behaviour/ability.lua +9 -17
  26. package/engine/behaviour/unit/stun-immunity.d.ts +11 -5
  27. package/engine/behaviour/unit/stun-immunity.lua +53 -28
  28. package/engine/behaviour/unit.d.ts +26 -5
  29. package/engine/behaviour/unit.lua +170 -27
  30. package/engine/buff.d.ts +17 -6
  31. package/engine/buff.lua +160 -97
  32. package/engine/internal/ability.d.ts +3 -1
  33. package/engine/internal/ability.lua +34 -11
  34. package/engine/internal/item/ability.lua +51 -1
  35. package/engine/internal/item+owner.lua +12 -6
  36. package/engine/internal/item.d.ts +13 -15
  37. package/engine/internal/item.lua +63 -49
  38. package/engine/internal/misc/frame-coordinates.d.ts +2 -0
  39. package/engine/internal/misc/frame-coordinates.lua +21 -0
  40. package/engine/internal/misc/get-terrain-z.d.ts +2 -0
  41. package/engine/internal/misc/get-terrain-z.lua +11 -0
  42. package/engine/internal/misc/player-local-handle.d.ts +2 -0
  43. package/engine/internal/misc/player-local-handle.lua +5 -0
  44. package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
  45. package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
  46. package/engine/internal/unit/ability.d.ts +35 -5
  47. package/engine/internal/unit/ability.lua +96 -21
  48. package/engine/internal/unit/bonus.d.ts +2 -0
  49. package/engine/internal/unit/bonus.lua +10 -0
  50. package/engine/internal/unit/fly-height.d.ts +7 -0
  51. package/engine/internal/unit/fly-height.lua +20 -0
  52. package/engine/internal/unit/main-selected.lua +12 -27
  53. package/engine/internal/unit/order.d.ts +20 -0
  54. package/engine/internal/unit/order.lua +136 -0
  55. package/engine/internal/unit/scale.d.ts +7 -0
  56. package/engine/internal/unit/scale.lua +20 -0
  57. package/engine/internal/unit+ability.lua +10 -1
  58. package/engine/internal/unit-missile-launch.lua +45 -14
  59. package/engine/internal/unit.d.ts +19 -16
  60. package/engine/internal/unit.lua +170 -136
  61. package/engine/local-client.d.ts +2 -0
  62. package/engine/local-client.lua +30 -0
  63. package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
  64. package/engine/object-data/auxiliary/armor-type.lua +46 -0
  65. package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
  66. package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
  67. package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
  68. package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
  69. package/engine/object-data/entry/ability-type.lua +5 -4
  70. package/engine/object-data/entry/destructible-type.d.ts +27 -1
  71. package/engine/object-data/entry/destructible-type.lua +155 -0
  72. package/engine/object-data/entry/unit-type.d.ts +15 -2
  73. package/engine/object-data/entry/unit-type.lua +135 -33
  74. package/engine/object-field/ability.d.ts +3 -3
  75. package/engine/object-field/ability.lua +7 -6
  76. package/engine/object-field/unit.d.ts +31 -5
  77. package/engine/object-field/unit.lua +95 -0
  78. package/engine/object-field.d.ts +9 -3
  79. package/engine/object-field.lua +242 -119
  80. package/engine/random.d.ts +9 -0
  81. package/engine/random.lua +13 -0
  82. package/engine/standard/fields/ability.d.ts +2 -2
  83. package/engine/standard/fields/ability.lua +2 -2
  84. package/engine/standard/fields/unit.d.ts +7 -0
  85. package/engine/standard/fields/unit.lua +13 -0
  86. package/engine/synchronization.d.ts +11 -0
  87. package/engine/synchronization.lua +77 -0
  88. package/engine/text-tag.d.ts +26 -3
  89. package/engine/text-tag.lua +217 -11
  90. package/engine/unit.d.ts +3 -0
  91. package/engine/unit.lua +3 -0
  92. package/net/socket.lua +1 -1
  93. package/objutil/buff.lua +1 -1
  94. package/package.json +2 -2
  95. package/patch-lualib.lua +1 -1
  96. package/utility/arrays.d.ts +1 -0
  97. package/utility/arrays.lua +8 -0
  98. package/utility/callback-array.d.ts +17 -0
  99. package/utility/callback-array.lua +61 -0
  100. package/utility/functions.d.ts +7 -0
  101. package/utility/functions.lua +12 -0
  102. package/utility/linked-set.d.ts +1 -0
  103. package/utility/linked-set.lua +19 -1
  104. package/utility/lua-maps.d.ts +11 -2
  105. package/utility/lua-maps.lua +33 -2
  106. package/utility/lua-sets.d.ts +1 -0
  107. package/utility/lua-sets.lua +4 -0
  108. package/utility/types.d.ts +3 -0
  109. package/core/types/order.d.ts +0 -26
  110. package/core/types/order.lua +0 -65
@@ -0,0 +1,46 @@
1
+ local ____exports = {}
2
+ local ____records = require("utility.records")
3
+ local invertRecord = ____records.invertRecord
4
+ local stringByArmorType = {
5
+ [0] = "small",
6
+ [1] = "medium",
7
+ [2] = "large",
8
+ [3] = "fort",
9
+ [4] = "normal",
10
+ [5] = "hero",
11
+ [6] = "divine",
12
+ [7] = "none"
13
+ }
14
+ local armorTypeByString = invertRecord(stringByArmorType)
15
+ local nativeByArmorType = {
16
+ [0] = DEFENSE_TYPE_LIGHT,
17
+ [1] = DEFENSE_TYPE_MEDIUM,
18
+ [2] = DEFENSE_TYPE_LARGE,
19
+ [3] = DEFENSE_TYPE_FORT,
20
+ [4] = DEFENSE_TYPE_NORMAL,
21
+ [5] = DEFENSE_TYPE_HERO,
22
+ [6] = DEFENSE_TYPE_DIVINE,
23
+ [7] = DEFENSE_TYPE_NONE
24
+ }
25
+ local armorTypeByNative = invertRecord(nativeByArmorType)
26
+ ---
27
+ -- @internal For use by internal systems only.
28
+ ____exports.armorTypeToString = function(armorType)
29
+ return stringByArmorType[armorType]
30
+ end
31
+ ---
32
+ -- @internal For use by internal systems only.
33
+ ____exports.stringToArmorType = function(____string)
34
+ return armorTypeByString[____string] or 7
35
+ end
36
+ ---
37
+ -- @internal For use by internal systems only.
38
+ ____exports.armorTypeToNative = function(armorType)
39
+ return nativeByArmorType[armorType]
40
+ end
41
+ ---
42
+ -- @internal For use by internal systems only.
43
+ ____exports.nativeToArmorType = function(armorType)
44
+ return armorTypeByNative[armorType]
45
+ end
46
+ return ____exports
@@ -0,0 +1,8 @@
1
+ /** @noSelfInFile */
2
+ export declare const enum HealthRegenerationType {
3
+ NONE = 0,
4
+ ALWAYS = 1,
5
+ BLIGHT = 2,
6
+ DAY = 3,
7
+ NIGHT = 4
8
+ }
@@ -0,0 +1,2 @@
1
+ local ____exports = {}
2
+ return ____exports
@@ -0,0 +1,8 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityType, AbilityTypeId } from "../ability-type";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ export declare class ManaRegenerationAbilityType extends AbilityType {
5
+ static readonly BASE_ID: AbilityTypeId;
6
+ get manaRegenerationRateIncreaseFactor(): number[];
7
+ set manaRegenerationRateIncreaseFactor(manaRegenerationRateIncreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
8
+ }
@@ -0,0 +1,26 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
+ local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
5
+ local ____exports = {}
6
+ local ____ability_2Dtype = require("engine.object-data.entry.ability-type")
7
+ local AbilityType = ____ability_2Dtype.AbilityType
8
+ ____exports.ManaRegenerationAbilityType = __TS__Class()
9
+ local ManaRegenerationAbilityType = ____exports.ManaRegenerationAbilityType
10
+ ManaRegenerationAbilityType.name = "ManaRegenerationAbilityType"
11
+ __TS__ClassExtends(ManaRegenerationAbilityType, AbilityType)
12
+ ManaRegenerationAbilityType.BASE_ID = fourCC("AIrm")
13
+ __TS__SetDescriptor(
14
+ ManaRegenerationAbilityType.prototype,
15
+ "manaRegenerationRateIncreaseFactor",
16
+ {
17
+ get = function(self)
18
+ return self:getNumberLevelField("Imrp")
19
+ end,
20
+ set = function(self, manaRegenerationRateIncreaseFactor)
21
+ self:setNumberLevelField("Imrp", manaRegenerationRateIncreaseFactor)
22
+ end
23
+ },
24
+ true
25
+ )
26
+ return ____exports
@@ -38,6 +38,8 @@ local ____sound = require("core.types.sound")
38
38
  local isSoundLabelCustom = ____sound.isSoundLabelCustom
39
39
  local Sound3D = ____sound.Sound3D
40
40
  local SoundSettings = ____sound.SoundSettings
41
+ local ____lua_2Dsets = require("utility.lua-sets")
42
+ local luaSetOf = ____lua_2Dsets.luaSetOf
41
43
  local castAnimationFQNByAbilityTypeId = {}
42
44
  local isButtonVisibleFalseAbilityTypes = {}
43
45
  local casterCastingEffectPresetsByAbilityTypeId = {}
@@ -979,9 +981,7 @@ for abilityTypeId, animationFQN in pairs(postcompile(function() return castAnima
979
981
  4,
980
982
  function(caster, ability)
981
983
  if ability:getField(ABILITY_RLF_CASTING_TIME) ~= 0 then
982
- Timer:run(function()
983
- caster:playAnimation(animationFQN)
984
- end)
984
+ Timer:run(caster, "playAnimation", animationFQN)
985
985
  end
986
986
  end
987
987
  )
@@ -1006,9 +1006,10 @@ for abilityTypeId, soundPresetId in pairs(postcompile(function() return targetEf
1006
1006
  )
1007
1007
  end
1008
1008
  end
1009
+ local unsupportedEffectSoundAbilityTypeIds = luaSetOf(fourCC("AAns"))
1009
1010
  Unit.abilityChannelingStartEvent:addListener(function(caster, ability)
1010
1011
  local soundPresetId = ability:getField(ABILITY_SF_EFFECT_SOUND)
1011
- if isSoundLabelCustom(soundPresetId) then
1012
+ if isSoundLabelCustom(soundPresetId) or soundPresetId ~= "" and unsupportedEffectSoundAbilityTypeIds[ability.parentTypeId] ~= nil then
1012
1013
  Sound3D:playFromLabel(soundPresetId, SoundSettings.Ability, caster)
1013
1014
  end
1014
1015
  end)
@@ -1,14 +1,30 @@
1
1
  /** @noSelfInFile */
2
2
  import { ArmorSoundType } from "../auxiliary/armor-sound-type";
3
3
  import { CombatClassifications } from "../auxiliary/combat-classification";
4
- import { ObjectDataEntry, ObjectDataEntryId } from "../entry";
4
+ import { ObjectDataEntry, ObjectDataEntryConstructor, ObjectDataEntryId } from "../entry";
5
5
  export type DestructibleTypeId = ObjectDataEntryId & number & {
6
6
  readonly __destructibleTypeId: unique symbol;
7
7
  };
8
+ export type StandardDestructibleTypeId = DestructibleTypeId & {
9
+ readonly __standardDestructibleTypeId: unique symbol;
10
+ };
8
11
  export declare abstract class DestructibleType extends ObjectDataEntry<DestructibleTypeId> {
12
+ static readonly [id: StandardDestructibleTypeId]: ObjectDataEntryConstructor<DestructibleType>;
9
13
  private static readonly idGenerator;
10
14
  protected static generateId(): number;
11
15
  protected static getObjectData(map: WarMap): WarObjects;
16
+ get fixedFacing(): number;
17
+ set fixedFacing(fixedFacing: number);
18
+ get flyOverHeight(): number;
19
+ set flyOverHeight(flyOverHeight: number);
20
+ get modelPath(): string;
21
+ set modelPath(modelPath: string);
22
+ get modelPathSD(): string;
23
+ set modelPathSD(modelPathSD: string);
24
+ get modelPathHD(): string;
25
+ set modelPathHD(modelPathHD: string);
26
+ get occlusionHeight(): number;
27
+ set occlusionHeight(occlusionHeight: number);
12
28
  get armorSoundType(): ArmorSoundType;
13
29
  set armorSoundType(armorSoundType: ArmorSoundType);
14
30
  get armorSoundTypeSD(): ArmorSoundType;
@@ -17,4 +33,14 @@ export declare abstract class DestructibleType extends ObjectDataEntry<Destructi
17
33
  set armorSoundTypeHD(armorSoundTypeHD: ArmorSoundType);
18
34
  get combatClassifications(): CombatClassifications;
19
35
  set combatClassifications(combatClassifications: CombatClassifications);
36
+ get cliffHeight(): number;
37
+ set cliffHeight(cliffHeight: number);
38
+ get isWalkable(): boolean;
39
+ set isWalkable(isWalkable: boolean);
40
+ get pathingTexturePath(): string;
41
+ set pathingTexturePath(pathingTexturePath: string);
42
+ get deadPathingTexturePath(): string;
43
+ set deadPathingTexturePath(deadPathingTexturePath: string);
44
+ get name(): string;
45
+ set name(name: string);
20
46
  }
@@ -11,6 +11,8 @@ local ____entry = require("engine.object-data.entry")
11
11
  local ObjectDataEntry = ____entry.ObjectDataEntry
12
12
  local ____object_2Ddata_2Dentry_2Did_2Dgenerator = require("engine.object-data.utility.object-data-entry-id-generator")
13
13
  local ObjectDataEntryIdGenerator = ____object_2Ddata_2Dentry_2Did_2Dgenerator.ObjectDataEntryIdGenerator
14
+ local ____reflection = require("utility.reflection")
15
+ local implementReadonlyNumberIndexSupplier = ____reflection.implementReadonlyNumberIndexSupplier
14
16
  ____exports.DestructibleType = __TS__Class()
15
17
  local DestructibleType = ____exports.DestructibleType
16
18
  DestructibleType.name = "DestructibleType"
@@ -25,6 +27,84 @@ DestructibleType.idGenerator = __TS__New(
25
27
  ObjectDataEntryIdGenerator,
26
28
  fourCC("D000")
27
29
  )
30
+ __TS__SetDescriptor(
31
+ DestructibleType.prototype,
32
+ "fixedFacing",
33
+ {
34
+ get = function(self)
35
+ return self:getNumberField("bfxr")
36
+ end,
37
+ set = function(self, fixedFacing)
38
+ self:setNumberField("bfxr", fixedFacing)
39
+ end
40
+ },
41
+ true
42
+ )
43
+ __TS__SetDescriptor(
44
+ DestructibleType.prototype,
45
+ "flyOverHeight",
46
+ {
47
+ get = function(self)
48
+ return self:getNumberField("bflh")
49
+ end,
50
+ set = function(self, flyOverHeight)
51
+ self:setNumberField("bflh", flyOverHeight)
52
+ end
53
+ },
54
+ true
55
+ )
56
+ __TS__SetDescriptor(
57
+ DestructibleType.prototype,
58
+ "modelPath",
59
+ {
60
+ get = function(self)
61
+ return self:getStringField("bfil")
62
+ end,
63
+ set = function(self, modelPath)
64
+ self:setStringField("bfil", modelPath)
65
+ end
66
+ },
67
+ true
68
+ )
69
+ __TS__SetDescriptor(
70
+ DestructibleType.prototype,
71
+ "modelPathSD",
72
+ {
73
+ get = function(self)
74
+ return self:getStringField("bfil:sd")
75
+ end,
76
+ set = function(self, modelPathSD)
77
+ self:setStringField("bfil:sd", modelPathSD)
78
+ end
79
+ },
80
+ true
81
+ )
82
+ __TS__SetDescriptor(
83
+ DestructibleType.prototype,
84
+ "modelPathHD",
85
+ {
86
+ get = function(self)
87
+ return self:getStringField("bfil:hd")
88
+ end,
89
+ set = function(self, modelPathHD)
90
+ self:setStringField("bfil:hd", modelPathHD)
91
+ end
92
+ },
93
+ true
94
+ )
95
+ __TS__SetDescriptor(
96
+ DestructibleType.prototype,
97
+ "occlusionHeight",
98
+ {
99
+ get = function(self)
100
+ return self:getNumberField("boch")
101
+ end,
102
+ set = function(self, occlusionHeight)
103
+ self:setNumberField("boch", occlusionHeight)
104
+ end
105
+ },
106
+ true
107
+ )
28
108
  __TS__SetDescriptor(
29
109
  DestructibleType.prototype,
30
110
  "armorSoundType",
@@ -80,4 +160,79 @@ __TS__SetDescriptor(
80
160
  },
81
161
  true
82
162
  )
163
+ __TS__SetDescriptor(
164
+ DestructibleType.prototype,
165
+ "cliffHeight",
166
+ {
167
+ get = function(self)
168
+ return self:getNumberField("bclh")
169
+ end,
170
+ set = function(self, cliffHeight)
171
+ self:setNumberField("bclh", cliffHeight)
172
+ end
173
+ },
174
+ true
175
+ )
176
+ __TS__SetDescriptor(
177
+ DestructibleType.prototype,
178
+ "isWalkable",
179
+ {
180
+ get = function(self)
181
+ return self:getBooleanField("bwal")
182
+ end,
183
+ set = function(self, isWalkable)
184
+ self:setBooleanField("bwal", isWalkable)
185
+ end
186
+ },
187
+ true
188
+ )
189
+ __TS__SetDescriptor(
190
+ DestructibleType.prototype,
191
+ "pathingTexturePath",
192
+ {
193
+ get = function(self)
194
+ return self:getStringField("bptx")
195
+ end,
196
+ set = function(self, pathingTexturePath)
197
+ self:setStringField("bptx", pathingTexturePath)
198
+ end
199
+ },
200
+ true
201
+ )
202
+ __TS__SetDescriptor(
203
+ DestructibleType.prototype,
204
+ "deadPathingTexturePath",
205
+ {
206
+ get = function(self)
207
+ return self:getStringField("bptd")
208
+ end,
209
+ set = function(self, deadPathingTexturePath)
210
+ self:setStringField("bptd", deadPathingTexturePath)
211
+ end
212
+ },
213
+ true
214
+ )
215
+ __TS__SetDescriptor(
216
+ DestructibleType.prototype,
217
+ "name",
218
+ {
219
+ get = function(self)
220
+ return self:getStringField("bnam")
221
+ end,
222
+ set = function(self, name)
223
+ self:setStringField("bnam", name)
224
+ end
225
+ },
226
+ true
227
+ )
228
+ implementReadonlyNumberIndexSupplier(
229
+ ____exports.DestructibleType,
230
+ function(id)
231
+ local ____class_0 = __TS__Class()
232
+ ____class_0.name = ____class_0.name
233
+ __TS__ClassExtends(____class_0, ____exports.DestructibleType)
234
+ ____class_0.BASE_ID = id
235
+ return ____class_0
236
+ end
237
+ )
83
238
  return ____exports
@@ -13,6 +13,7 @@ import type { AbilityTypeId } from "./ability-type";
13
13
  import type { UpgradeId } from "./upgrade";
14
14
  import { AnimationQualifier } from "../auxiliary/animation-qualifier";
15
15
  import { AttackType } from "../auxiliary/attack-type";
16
+ import { ArmorType } from "../auxiliary/armor-type";
16
17
  export type UnitTypeId = ObjectDataEntryId & number & {
17
18
  readonly __unitTypeId: unique symbol;
18
19
  };
@@ -41,6 +42,10 @@ export declare class UnitTypeWeapon {
41
42
  set impactDelay(impactDelay: number);
42
43
  get missileModelPath(): string;
43
44
  set missileModelPath(missileModelPath: string);
45
+ get missileModelPathSD(): string;
46
+ set missileModelPathSD(missileModelPathSD: string);
47
+ get missileModelPathHD(): string;
48
+ set missileModelPathHD(missileModelPathHD: string);
44
49
  get range(): number;
45
50
  set range(range: number);
46
51
  get soundType(): WeaponSoundType;
@@ -144,6 +149,8 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
144
149
  set runSpeedSD(runSpeedSD: number);
145
150
  get runSpeedHD(): number;
146
151
  set runSpeedHD(runSpeedHD: number);
152
+ get selectionCircleHeight(): number;
153
+ set selectionCircleHeight(height: number);
147
154
  get selectionCircleScale(): number;
148
155
  set selectionCircleScale(selectionCircleScale: number);
149
156
  get selectionCircleScaleSD(): number;
@@ -182,16 +189,20 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
182
189
  set walkSpeedSD(walkSpeedSD: number);
183
190
  get walkSpeedHD(): number;
184
191
  set walkSpeedHD(walkSpeedHD: number);
192
+ get armor(): number;
193
+ set armor(armor: number);
185
194
  get armorSoundType(): ArmorSoundType;
186
195
  set armorSoundType(armorSoundType: ArmorSoundType);
187
196
  get armorSoundTypeSD(): ArmorSoundType;
188
197
  set armorSoundTypeSD(armorSoundTypeSD: ArmorSoundType);
189
198
  get armorSoundTypeHD(): ArmorSoundType;
190
199
  set armorSoundTypeHD(armorSoundTypeHD: ArmorSoundType);
200
+ get armorType(): ArmorType;
201
+ set armorType(armorType: ArmorType);
191
202
  get combatClassifications(): CombatClassifications;
192
203
  set combatClassifications(combatClassifications: CombatClassifications);
193
- get unitClassifications(): UnitClassifications;
194
- set unitClassifications(unitClassifications: UnitClassifications);
204
+ get classifications(): UnitClassifications;
205
+ set classifications(unitClassifications: UnitClassifications);
195
206
  get weapons(): TupleOf<UnitTypeWeapon, 2>;
196
207
  get firstWeapon(): UnitTypeWeapon;
197
208
  get secondWeapon(): UnitTypeWeapon;
@@ -225,6 +236,8 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
225
236
  set goldCost(goldCost: number);
226
237
  get healthRegenerationRate(): number;
227
238
  set healthRegenerationRate(healthRegenerationRate: number);
239
+ get level(): number;
240
+ set level(level: number);
228
241
  get manaRegenerationRate(): number;
229
242
  set manaRegenerationRate(manaRegenerationRate: number);
230
243
  get maximumHealth(): number;
@@ -27,6 +27,9 @@ local attackTypeToString = ____attack_2Dtype.attackTypeToString
27
27
  local stringToAttackType = ____attack_2Dtype.stringToAttackType
28
28
  local ____config = require("config")
29
29
  local WarscriptConfig = ____config.WarscriptConfig
30
+ local ____armor_2Dtype = require("engine.object-data.auxiliary.armor-type")
31
+ local armorTypeToString = ____armor_2Dtype.armorTypeToString
32
+ local stringToArmorType = ____armor_2Dtype.stringToArmorType
30
33
  local getOrCreateUnitTypeWeapons
31
34
  ____exports.UnitTypeWeapon = __TS__Class()
32
35
  local UnitTypeWeapon = ____exports.UnitTypeWeapon
@@ -235,21 +238,21 @@ __TS__SetDescriptor(
235
238
  )
236
239
  __TS__SetDescriptor(
237
240
  UnitTypeWeapon.prototype,
238
- "range",
241
+ "missileModelPathSD",
239
242
  {
240
243
  get = function(self)
241
244
  local ____self_17 = self.unitType
242
- return ____self_17.getNumberField(
245
+ return ____self_17.getStringField(
243
246
  ____self_17,
244
- ("ua" .. tostring(self.index)) .. "r"
247
+ ("ua" .. tostring(self.index)) .. "m:sd"
245
248
  )
246
249
  end,
247
- set = function(self, range)
250
+ set = function(self, missileModelPathSD)
248
251
  local ____self_18 = self.unitType
249
- ____self_18.setNumberField(
252
+ ____self_18.setStringField(
250
253
  ____self_18,
251
- ("ua" .. tostring(self.index)) .. "r",
252
- range
254
+ ("ua" .. tostring(self.index)) .. "m:sd",
255
+ missileModelPathSD
253
256
  )
254
257
  end
255
258
  },
@@ -257,21 +260,21 @@ __TS__SetDescriptor(
257
260
  )
258
261
  __TS__SetDescriptor(
259
262
  UnitTypeWeapon.prototype,
260
- "soundType",
263
+ "missileModelPathHD",
261
264
  {
262
265
  get = function(self)
263
266
  local ____self_19 = self.unitType
264
267
  return ____self_19.getStringField(
265
268
  ____self_19,
266
- "ucs" .. tostring(self.index)
269
+ ("ua" .. tostring(self.index)) .. "m:hd"
267
270
  )
268
271
  end,
269
- set = function(self, soundType)
272
+ set = function(self, missileModelPathHD)
270
273
  local ____self_20 = self.unitType
271
274
  ____self_20.setStringField(
272
275
  ____self_20,
273
- "ucs" .. tostring(self.index),
274
- soundType
276
+ ("ua" .. tostring(self.index)) .. "m:hd",
277
+ missileModelPathHD
275
278
  )
276
279
  end
277
280
  },
@@ -279,21 +282,21 @@ __TS__SetDescriptor(
279
282
  )
280
283
  __TS__SetDescriptor(
281
284
  UnitTypeWeapon.prototype,
282
- "soundTypeSD",
285
+ "range",
283
286
  {
284
287
  get = function(self)
285
288
  local ____self_21 = self.unitType
286
- return ____self_21.getStringField(
289
+ return ____self_21.getNumberField(
287
290
  ____self_21,
288
- ("ucs" .. tostring(self.index)) .. ":sd"
291
+ ("ua" .. tostring(self.index)) .. "r"
289
292
  )
290
293
  end,
291
- set = function(self, soundTypeSD)
294
+ set = function(self, range)
292
295
  local ____self_22 = self.unitType
293
- ____self_22.setStringField(
296
+ ____self_22.setNumberField(
294
297
  ____self_22,
295
- ("ucs" .. tostring(self.index)) .. ":sd",
296
- soundTypeSD
298
+ ("ua" .. tostring(self.index)) .. "r",
299
+ range
297
300
  )
298
301
  end
299
302
  },
@@ -301,19 +304,63 @@ __TS__SetDescriptor(
301
304
  )
302
305
  __TS__SetDescriptor(
303
306
  UnitTypeWeapon.prototype,
304
- "soundTypeHD",
307
+ "soundType",
305
308
  {
306
309
  get = function(self)
307
310
  local ____self_23 = self.unitType
308
311
  return ____self_23.getStringField(
309
312
  ____self_23,
310
- ("ucs" .. tostring(self.index)) .. ":hd"
313
+ "ucs" .. tostring(self.index)
311
314
  )
312
315
  end,
313
- set = function(self, soundTypeHD)
316
+ set = function(self, soundType)
314
317
  local ____self_24 = self.unitType
315
318
  ____self_24.setStringField(
316
319
  ____self_24,
320
+ "ucs" .. tostring(self.index),
321
+ soundType
322
+ )
323
+ end
324
+ },
325
+ true
326
+ )
327
+ __TS__SetDescriptor(
328
+ UnitTypeWeapon.prototype,
329
+ "soundTypeSD",
330
+ {
331
+ get = function(self)
332
+ local ____self_25 = self.unitType
333
+ return ____self_25.getStringField(
334
+ ____self_25,
335
+ ("ucs" .. tostring(self.index)) .. ":sd"
336
+ )
337
+ end,
338
+ set = function(self, soundTypeSD)
339
+ local ____self_26 = self.unitType
340
+ ____self_26.setStringField(
341
+ ____self_26,
342
+ ("ucs" .. tostring(self.index)) .. ":sd",
343
+ soundTypeSD
344
+ )
345
+ end
346
+ },
347
+ true
348
+ )
349
+ __TS__SetDescriptor(
350
+ UnitTypeWeapon.prototype,
351
+ "soundTypeHD",
352
+ {
353
+ get = function(self)
354
+ local ____self_27 = self.unitType
355
+ return ____self_27.getStringField(
356
+ ____self_27,
357
+ ("ucs" .. tostring(self.index)) .. ":hd"
358
+ )
359
+ end,
360
+ set = function(self, soundTypeHD)
361
+ local ____self_28 = self.unitType
362
+ ____self_28.setStringField(
363
+ ____self_28,
317
364
  ("ucs" .. tostring(self.index)) .. ":hd",
318
365
  soundTypeHD
319
366
  )
@@ -936,6 +983,19 @@ __TS__SetDescriptor(
936
983
  },
937
984
  true
938
985
  )
986
+ __TS__SetDescriptor(
987
+ UnitType.prototype,
988
+ "selectionCircleHeight",
989
+ {
990
+ get = function(self)
991
+ return self:getNumberField("uslz")
992
+ end,
993
+ set = function(self, height)
994
+ self:setNumberField("uslz", height)
995
+ end
996
+ },
997
+ true
998
+ )
939
999
  __TS__SetDescriptor(
940
1000
  UnitType.prototype,
941
1001
  "selectionCircleScale",
@@ -1183,6 +1243,19 @@ __TS__SetDescriptor(
1183
1243
  },
1184
1244
  true
1185
1245
  )
1246
+ __TS__SetDescriptor(
1247
+ UnitType.prototype,
1248
+ "armor",
1249
+ {
1250
+ get = function(self)
1251
+ return self:getNumberField("udef")
1252
+ end,
1253
+ set = function(self, armor)
1254
+ self:setNumberField("udef", armor)
1255
+ end
1256
+ },
1257
+ true
1258
+ )
1186
1259
  __TS__SetDescriptor(
1187
1260
  UnitType.prototype,
1188
1261
  "armorSoundType",
@@ -1222,6 +1295,22 @@ __TS__SetDescriptor(
1222
1295
  },
1223
1296
  true
1224
1297
  )
1298
+ __TS__SetDescriptor(
1299
+ UnitType.prototype,
1300
+ "armorType",
1301
+ {
1302
+ get = function(self)
1303
+ return stringToArmorType(self:getStringField("udty"))
1304
+ end,
1305
+ set = function(self, armorType)
1306
+ self:setStringField(
1307
+ "udty",
1308
+ armorTypeToString(armorType)
1309
+ )
1310
+ end
1311
+ },
1312
+ true
1313
+ )
1225
1314
  __TS__SetDescriptor(
1226
1315
  UnitType.prototype,
1227
1316
  "combatClassifications",
@@ -1240,7 +1329,7 @@ __TS__SetDescriptor(
1240
1329
  )
1241
1330
  __TS__SetDescriptor(
1242
1331
  UnitType.prototype,
1243
- "unitClassifications",
1332
+ "classifications",
1244
1333
  {
1245
1334
  get = function(self)
1246
1335
  return stringArrayToUnitClassifications(self:getStringsField("utyp"))
@@ -1476,6 +1565,19 @@ __TS__SetDescriptor(
1476
1565
  },
1477
1566
  true
1478
1567
  )
1568
+ __TS__SetDescriptor(
1569
+ UnitType.prototype,
1570
+ "level",
1571
+ {
1572
+ get = function(self)
1573
+ return self:getNumberField("ulev")
1574
+ end,
1575
+ set = function(self, level)
1576
+ self:setNumberField("ulev", level)
1577
+ end
1578
+ },
1579
+ true
1580
+ )
1479
1581
  __TS__SetDescriptor(
1480
1582
  UnitType.prototype,
1481
1583
  "manaRegenerationRate",
@@ -1622,11 +1724,11 @@ __TS__SetDescriptor(
1622
1724
  implementReadonlyNumberIndexSupplier(
1623
1725
  ____exports.UnitType,
1624
1726
  function(id)
1625
- local ____class_25 = __TS__Class()
1626
- ____class_25.name = ____class_25.name
1627
- __TS__ClassExtends(____class_25, ____exports.UnitType)
1628
- ____class_25.BASE_ID = id
1629
- return ____class_25
1727
+ local ____class_29 = __TS__Class()
1728
+ ____class_29.name = ____class_29.name
1729
+ __TS__ClassExtends(____class_29, ____exports.UnitType)
1730
+ ____class_29.BASE_ID = id
1731
+ return ____class_29
1630
1732
  end
1631
1733
  )
1632
1734
  ____exports.HeroUnitType = __TS__Class()
@@ -1687,11 +1789,11 @@ __TS__SetDescriptor(
1687
1789
  implementReadonlyNumberIndexSupplier(
1688
1790
  ____exports.HeroUnitType,
1689
1791
  function(id)
1690
- local ____class_26 = __TS__Class()
1691
- ____class_26.name = ____class_26.name
1692
- __TS__ClassExtends(____class_26, ____exports.HeroUnitType)
1693
- ____class_26.BASE_ID = id
1694
- return ____class_26
1792
+ local ____class_30 = __TS__Class()
1793
+ ____class_30.name = ____class_30.name
1794
+ __TS__ClassExtends(____class_30, ____exports.HeroUnitType)
1795
+ ____class_30.BASE_ID = id
1796
+ return ____class_30
1695
1797
  end
1696
1798
  )
1697
1799
  return ____exports