warscript 0.0.1-dev.46a1ede → 0.0.1-dev.4721022

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 (45) hide show
  1. package/config.d.ts +5 -0
  2. package/config.lua +10 -0
  3. package/core/types/sound.d.ts +1 -0
  4. package/core/types/sound.lua +36 -2
  5. package/core/util.lua +6 -1
  6. package/engine/behaviour/ability/damage.d.ts +3 -0
  7. package/engine/behaviour/ability/damage.lua +2 -2
  8. package/engine/behaviour/ability.d.ts +1 -0
  9. package/engine/behaviour/ability.lua +12 -0
  10. package/engine/buff.d.ts +4 -1
  11. package/engine/buff.lua +78 -68
  12. package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
  13. package/engine/object-data/auxiliary/animation-name.lua +16 -0
  14. package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
  15. package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
  16. package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
  17. package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
  18. package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
  19. package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
  20. package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
  21. package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
  22. package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
  23. package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
  24. package/engine/object-data/entry/ability-type.d.ts +8 -6
  25. package/engine/object-data/entry/ability-type.lua +54 -15
  26. package/engine/object-data/entry/buff-type/applicable.lua +13 -37
  27. package/engine/object-data/entry/buff-type.d.ts +1 -1
  28. package/engine/object-data/entry/buff-type.lua +2 -2
  29. package/engine/object-data/entry/destructible-type.d.ts +1 -1
  30. package/engine/object-data/entry/item-type.d.ts +1 -1
  31. package/engine/object-data/entry/item-type.lua +4 -4
  32. package/engine/object-data/entry/lightning-type.d.ts +1 -1
  33. package/engine/object-data/entry/sound-preset.d.ts +16 -0
  34. package/engine/object-data/entry/sound-preset.lua +36 -0
  35. package/engine/object-data/entry/unit-type.d.ts +8 -1
  36. package/engine/object-data/entry/unit-type.lua +61 -8
  37. package/engine/object-data/entry/upgrade.d.ts +1 -1
  38. package/engine/object-data/entry/upgrade.lua +4 -4
  39. package/engine/object-data/entry.d.ts +16 -14
  40. package/engine/object-data/entry.lua +60 -32
  41. package/engine/standard/entries/sound-preset.d.ts +10 -0
  42. package/engine/standard/entries/sound-preset.lua +10 -0
  43. package/objutil/unit.lua +8 -0
  44. package/package.json +2 -2
  45. package/utility/reflection.lua +11 -7
package/config.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /** @noSelfInFile */
2
+ export declare class WarscriptConfig {
3
+ private constructor();
4
+ static AUTOMATICALLY_SET_UNIT_TYPE_PORTRAIT_MODEL_PATH: boolean;
5
+ }
package/config.lua ADDED
@@ -0,0 +1,10 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local ____exports = {}
4
+ ____exports.WarscriptConfig = __TS__Class()
5
+ local WarscriptConfig = ____exports.WarscriptConfig
6
+ WarscriptConfig.name = "WarscriptConfig"
7
+ function WarscriptConfig.prototype.____constructor(self)
8
+ end
9
+ WarscriptConfig.AUTOMATICALLY_SET_UNIT_TYPE_PORTRAIT_MODEL_PATH = true
10
+ return ____exports
@@ -64,6 +64,7 @@ export declare class Sound extends Handle<jsound, [fadeOut?: boolean]> {
64
64
  export declare class Sound3D extends Sound {
65
65
  static playAtPosition(fileName: string, preset: Sound3DPreset, x?: number, y?: number, z?: number): void;
66
66
  static playOnUnit(fileName: string, preset: Sound3DPreset, unit: Unit): void;
67
+ static playFromLabel(label: string, preset: Sound3DPreset, ...positionOrUnit: [Unit] | [number, number, number?]): void;
67
68
  static createAtPosition(fileName: string, preset: Sound3DPreset, x?: number, y?: number, z?: number): Sound3D;
68
69
  static createOnUnit(fileName: string, preset: Sound3DPreset, unit: Unit): Sound3D;
69
70
  }
@@ -6,14 +6,13 @@ local ____exports = {}
6
6
  local ____handle = require("core.types.handle")
7
7
  local Handle = ____handle.Handle
8
8
  local createSound = CreateSound
9
+ local createSoundFromLabel = CreateSoundFromLabel
9
10
  local setSoundPitch = SetSoundPitch
10
11
  local setSoundChannel = SetSoundChannel
11
12
  local setSoundPosition = SetSoundPosition
12
13
  local setSoundVolume = SetSoundVolume
13
14
  local setSoundDistances = SetSoundDistances
14
15
  local setSoundDistanceCutoff = SetSoundDistanceCutoff
15
- local setSoundConeAngles = SetSoundConeAngles
16
- local setSoundConeOrientation = SetSoundConeOrientation
17
16
  local startSound = StartSound
18
17
  local setSoundPlayPosition = SetSoundPlayPosition
19
18
  local stopSound = StopSound
@@ -153,6 +152,31 @@ local function createPreset3DSound(fileName, preset)
153
152
  setSoundDistanceCutoff(sound, preset.distanceCutoff or 1500)
154
153
  return sound
155
154
  end
155
+ local function createPreset3DSoundFromLabel(label, preset)
156
+ local ____label_7 = label
157
+ local ____preset_looping_5 = preset.looping
158
+ if ____preset_looping_5 == nil then
159
+ ____preset_looping_5 = false
160
+ end
161
+ local ____preset_stopWhenOutOfRange_6 = preset.stopWhenOutOfRange
162
+ if ____preset_stopWhenOutOfRange_6 == nil then
163
+ ____preset_stopWhenOutOfRange_6 = true
164
+ end
165
+ local sound = createSoundFromLabel(
166
+ ____label_7,
167
+ ____preset_looping_5,
168
+ true,
169
+ ____preset_stopWhenOutOfRange_6,
170
+ preset.fadeInRate or 12700,
171
+ preset.fadeOutRate or 12700
172
+ )
173
+ setSoundChannel(sound, preset.channel or ____exports.SoundChannel.General)
174
+ setSoundVolume(sound, preset.volume or 127)
175
+ setSoundPitch(sound, preset.pitch or 1)
176
+ setSoundDistances(sound, preset.minDistance or 600, preset.maxDistance or 8000)
177
+ setSoundDistanceCutoff(sound, preset.distanceCutoff or 1500)
178
+ return sound
179
+ end
156
180
  ____exports.Sound = __TS__Class()
157
181
  local Sound = ____exports.Sound
158
182
  Sound.name = "Sound"
@@ -225,6 +249,16 @@ function Sound3D.playOnUnit(self, fileName, preset, unit)
225
249
  startSound(sound)
226
250
  killSoundWhenDone(sound)
227
251
  end
252
+ function Sound3D.playFromLabel(self, label, preset, unitOrX, y, z)
253
+ local sound = createPreset3DSoundFromLabel(label, preset)
254
+ if type(unitOrX) ~= "number" then
255
+ attachSoundToUnit(sound, unitOrX.handle)
256
+ else
257
+ setSoundPosition(sound, unitOrX, y or 0, z or 0)
258
+ end
259
+ startSound(sound)
260
+ killSoundWhenDone(sound)
261
+ end
228
262
  function Sound3D.createAtPosition(self, fileName, preset, x, y, z)
229
263
  if x == nil then
230
264
  x = 0
package/core/util.lua CHANGED
@@ -1,3 +1,5 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__StringPadEnd = ____lualib.__TS__StringPadEnd
1
3
  local ____exports = {}
2
4
  local ns = {}
3
5
  do
@@ -14,7 +16,10 @@ do
14
16
  if type(id) == "number" then
15
17
  return id
16
18
  else
17
- local numid = string.unpack(">I4", id)
19
+ local numid = string.unpack(
20
+ ">I4",
21
+ __TS__StringPadEnd(id, 4, "\0")
22
+ )
18
23
  return numid
19
24
  end
20
25
  end
@@ -5,6 +5,7 @@ import { Unit } from "../../internal/unit";
5
5
  import { AbilityDependentValue } from "../../object-field/ability";
6
6
  import { Widget } from "../../../core/types/widget";
7
7
  import { AttackType, DamageType, WeaponType } from "../../internal/unit+damage";
8
+ import { CombatClassifications } from "../../object-data/auxiliary/combat-classification";
8
9
  export type DamageAbilityBehaviorParameters = {
9
10
  damagePerStrength?: AbilityDependentValue<number>;
10
11
  damagePerAgility?: AbilityDependentValue<number>;
@@ -15,6 +16,8 @@ export type DamageAbilityBehaviorParameters = {
15
16
  };
16
17
  export type DamageAreaAbilityBehaviorParameters = DamageAbilityBehaviorParameters & {
17
18
  maximumDamage?: AbilityDependentValue<number>;
19
+ areaOfEffect?: AbilityDependentValue<number>;
20
+ allowedTargetCombatClassifications?: AbilityDependentValue<CombatClassifications>;
18
21
  };
19
22
  declare abstract class DamageAbilityBehavior<T extends DamageAbilityBehaviorParameters = DamageAbilityBehaviorParameters> extends AbilityBehavior {
20
23
  protected readonly damage: AbilityDependentValue<number>;
@@ -82,10 +82,10 @@ function DamageAreaAbilityBehavior.prototype.damageArea(self, caster, x, y)
82
82
  local parameters = self.parameters
83
83
  local targets = Unit.getAllowedTargetsInCollisionRange(
84
84
  caster,
85
- self:resolveCurrentAbilityDependentValue(ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD),
85
+ self:resolveCurrentAbilityDependentValue(parameters and parameters.allowedTargetCombatClassifications or ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD),
86
86
  x,
87
87
  y,
88
- self:resolveCurrentAbilityDependentValue(AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD)
88
+ self:resolveCurrentAbilityDependentValue(parameters and parameters.areaOfEffect or AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD)
89
89
  )
90
90
  local damage = self:calculateDamage(caster)
91
91
  local maximumDamage = self:resolveCurrentAbilityDependentValue(parameters and parameters.maximumDamage or 0)
@@ -22,6 +22,7 @@ export declare abstract class AbilityBehavior<Parameters extends {
22
22
  protected subscribe<T extends boolean | number | string>(value: SubscribableAbilityDependentValue<T>): void;
23
23
  protected registerCommandEvent(orderTypeStringId?: string): void;
24
24
  get ability(): Ability;
25
+ get unit(): Unit | undefined;
25
26
  protected resolveCurrentAbilityDependentValue<T extends boolean | number | string>(value: AbilityDependentValue<T>): T;
26
27
  protected resolveCurrentAbilityDependentValue<T extends boolean | number | string>(value?: AbilityDependentValue<T>): T | undefined;
27
28
  protected flashCasterEffect(widget: Widget, ...parametersOrDuration: [parameters?: EffectParameters] | [duration?: number, parameters?: EffectParameters]): void;
@@ -237,6 +237,18 @@ __TS__SetDescriptor(
237
237
  end},
238
238
  true
239
239
  )
240
+ __TS__SetDescriptor(
241
+ AbilityBehavior.prototype,
242
+ "unit",
243
+ {get = function(self)
244
+ local owner = self.object.owner
245
+ if __TS__InstanceOf(owner, Unit) then
246
+ return owner
247
+ end
248
+ return owner.owner
249
+ end},
250
+ true
251
+ )
240
252
  AbilityBehavior.MissileLaunchConfig = ____class_2
241
253
  __TS__SetDescriptor(
242
254
  AbilityBehavior.prototype,
package/engine/buff.d.ts CHANGED
@@ -57,6 +57,7 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
57
57
  attackSpeedIncreaseFactor?: NumberParameterValueType;
58
58
  movementSpeedIncreaseFactor?: NumberParameterValueType;
59
59
  evasionProbability?: NumberParameterValueType;
60
+ missProbability?: NumberParameterValueType;
60
61
  damageFactor?: NumberParameterValueType;
61
62
  receivedDamageFactor?: NumberParameterValueType;
62
63
  receivedMagicDamageFactor?: NumberParameterValueType;
@@ -120,7 +121,8 @@ declare const enum BuffPropertyKey {
120
121
  DISABLES_AUTO_ATTACK = 137,
121
122
  PROVIDES_INVULNERABILITY = 138,
122
123
  KILLS_ON_EXPIRATION = 139,
123
- EXPLODES_ON_EXPIRATION = 140
124
+ EXPLODES_ON_EXPIRATION = 140,
125
+ MISS_PROBABILITY = 141
124
126
  }
125
127
  export declare const enum BuffTypeIdSelectionPolicy {
126
128
  LEAST_DURATION = 0
@@ -195,6 +197,7 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
195
197
  private readonly _level?;
196
198
  private readonly _spellStealPriority?;
197
199
  private readonly _learnLevelMinimum?;
200
+ private readonly [BuffPropertyKey.MISS_PROBABILITY]?;
198
201
  private _bonusIdByBonusType?;
199
202
  private readonly _abilityTypeIds?;
200
203
  private _behaviors?;
package/engine/buff.lua CHANGED
@@ -102,6 +102,7 @@ local buffParametersKeys = {
102
102
  attackSpeedIncreaseFactor = true,
103
103
  movementSpeedIncreaseFactor = true,
104
104
  evasionProbability = true,
105
+ missProbability = true,
105
106
  damageFactor = true,
106
107
  receivedDamageFactor = true,
107
108
  receivedMagicDamageFactor = true,
@@ -367,14 +368,19 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
367
368
  end
368
369
  self.polarity = resolveEnumValue(ability, level, polarity)
369
370
  self.resistanceType = resolveEnumValue(ability, level, resistanceType)
371
+ local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
372
+ if missProbability ~= nil then
373
+ missProbability = resolveNumberValue(ability, level, missProbability)
374
+ self[141] = missProbability
375
+ end
370
376
  local buffByTypeId = buffByTypeIdByUnit[_unit]
371
377
  if buffByTypeId == nil then
372
378
  buffByTypeId = {}
373
379
  buffByTypeIdByUnit[_unit] = buffByTypeId
374
380
  end
375
- local ____opt_13 = buffByTypeId[typeId]
376
- if ____opt_13 ~= nil then
377
- ____opt_13:destroy()
381
+ local ____opt_15 = buffByTypeId[typeId]
382
+ if ____opt_15 ~= nil then
383
+ ____opt_15:destroy()
378
384
  end
379
385
  local uniqueGroup = parameters and parameters.uniqueGroup or defaultParameters and defaultParameters.uniqueGroup
380
386
  if uniqueGroup ~= nil then
@@ -388,13 +394,16 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
388
394
  level,
389
395
  duration,
390
396
  spellStealPriority,
391
- learnLevelMinimum
397
+ learnLevelMinimum,
398
+ missProbability
392
399
  ) then
400
+ self[100] = 1
393
401
  UnitBehavior.prototype.destroy(self)
394
402
  error(unsuccessfulApplicationMarker, 0)
395
403
  end
396
404
  local handle = BlzGetUnitAbility(_unit.handle, typeId)
397
405
  if handle == nil then
406
+ self[100] = 1
398
407
  UnitBehavior.prototype.destroy(self)
399
408
  error(unsuccessfulApplicationMarker, 0)
400
409
  end
@@ -410,13 +419,13 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
410
419
  self[106] = BlzGetAbilityStringLevelField(self.handle, ABILITY_SLF_SPECIAL, 0)
411
420
  if parameters ~= nil or (next(defaultParameters)) ~= nil then
412
421
  for ____, buffBooleanParameter in ipairs(buffBooleanParameters) do
413
- local ____ability_22 = ability
414
- local ____level_23 = level
415
- local ____temp_21 = parameters and parameters[buffBooleanParameter]
416
- if ____temp_21 == nil then
417
- ____temp_21 = defaultParameters[buffBooleanParameter]
422
+ local ____ability_24 = ability
423
+ local ____level_25 = level
424
+ local ____temp_23 = parameters and parameters[buffBooleanParameter]
425
+ if ____temp_23 == nil then
426
+ ____temp_23 = defaultParameters[buffBooleanParameter]
418
427
  end
419
- if resolveBooleanValue(____ability_22, ____level_23, ____temp_21) then
428
+ if resolveBooleanValue(____ability_24, ____level_25, ____temp_23) then
420
429
  self[buffBooleanParameter] = true
421
430
  end
422
431
  end
@@ -497,8 +506,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
497
506
  self[100] = 1
498
507
  end
499
508
  function Buff.prototype.getUnitBonus(self, bonusType)
500
- local ____opt_36 = self._bonusIdByBonusType
501
- local bonusId = ____opt_36 and ____opt_36[bonusType]
509
+ local ____opt_38 = self._bonusIdByBonusType
510
+ local bonusId = ____opt_38 and ____opt_38[bonusType]
502
511
  return bonusId == nil and 0 or getUnitBonus(self._unit, bonusType, bonusId)
503
512
  end
504
513
  function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
@@ -514,45 +523,45 @@ function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrPa
514
523
  Effect:flash(self[105], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
515
524
  else
516
525
  local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
517
- local ____Effect_40 = Effect
518
- local ____Effect_flash_41 = Effect.flash
519
- local ____array_39 = __TS__SparseArrayNew(
526
+ local ____Effect_42 = Effect
527
+ local ____Effect_flash_43 = Effect.flash
528
+ local ____array_41 = __TS__SparseArrayNew(
520
529
  self[105],
521
530
  isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
522
531
  stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
523
532
  )
524
- local ____isWidgetProvided_38
533
+ local ____isWidgetProvided_40
525
534
  if isWidgetProvided then
526
- ____isWidgetProvided_38 = yOrParametersOrDuration
535
+ ____isWidgetProvided_40 = yOrParametersOrDuration
527
536
  else
528
- ____isWidgetProvided_38 = widgetOrXOrParametersOrDuration
537
+ ____isWidgetProvided_40 = widgetOrXOrParametersOrDuration
529
538
  end
530
- __TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
531
- ____Effect_flash_41(
532
- ____Effect_40,
533
- __TS__SparseArraySpread(____array_39)
539
+ __TS__SparseArrayPush(____array_41, ____isWidgetProvided_40)
540
+ ____Effect_flash_43(
541
+ ____Effect_42,
542
+ __TS__SparseArraySpread(____array_41)
534
543
  )
535
544
  end
536
545
  end
537
546
  function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
538
547
  local isWidgetProvided = type(widgetOrDuration) == "table"
539
- local ____Effect_44 = Effect
540
- local ____Effect_flash_45 = Effect.flash
541
- local ____array_43 = __TS__SparseArrayNew(
548
+ local ____Effect_46 = Effect
549
+ local ____Effect_flash_47 = Effect.flash
550
+ local ____array_45 = __TS__SparseArrayNew(
542
551
  self[106],
543
552
  isWidgetProvided and widgetOrDuration or self._unit,
544
553
  stringValueByBuffTypeIdByFieldId[fourCC("fspt")][self.typeId] or "origin"
545
554
  )
546
- local ____isWidgetProvided_42
555
+ local ____isWidgetProvided_44
547
556
  if isWidgetProvided then
548
- ____isWidgetProvided_42 = duration
557
+ ____isWidgetProvided_44 = duration
549
558
  else
550
- ____isWidgetProvided_42 = widgetOrDuration
559
+ ____isWidgetProvided_44 = widgetOrDuration
551
560
  end
552
- __TS__SparseArrayPush(____array_43, ____isWidgetProvided_42)
553
- ____Effect_flash_45(
554
- ____Effect_44,
555
- __TS__SparseArraySpread(____array_43)
561
+ __TS__SparseArrayPush(____array_45, ____isWidgetProvided_44)
562
+ ____Effect_flash_47(
563
+ ____Effect_46,
564
+ __TS__SparseArraySpread(____array_45)
556
565
  )
557
566
  end
558
567
  function Buff.prototype.onCreate(self)
@@ -631,8 +640,8 @@ function Buff.apply(self, ...)
631
640
  end
632
641
  end
633
642
  function Buff.getByTypeId(self, unit, typeId)
634
- local ____opt_46 = buffByTypeIdByUnit[unit]
635
- local buff = ____opt_46 and ____opt_46[typeId]
643
+ local ____opt_48 = buffByTypeIdByUnit[unit]
644
+ local buff = ____opt_48 and ____opt_48[typeId]
636
645
  if __TS__InstanceOf(buff, self) then
637
646
  return buff
638
647
  end
@@ -790,8 +799,8 @@ __TS__SetDescriptor(
790
799
  return
791
800
  end
792
801
  self[112] = damageInterval
793
- local ____opt_48 = self._timer
794
- local elapsed = ____opt_48 and ____opt_48.elapsed or 0
802
+ local ____opt_50 = self._timer
803
+ local elapsed = ____opt_50 and ____opt_50.elapsed or 0
795
804
  local timer = self[114]
796
805
  if timer == nil then
797
806
  timer = Timer:create()
@@ -870,8 +879,8 @@ __TS__SetDescriptor(
870
879
  return
871
880
  end
872
881
  self[117] = healingInterval
873
- local ____opt_50 = self._timer
874
- local elapsed = ____opt_50 and ____opt_50.elapsed or 0
882
+ local ____opt_52 = self._timer
883
+ local elapsed = ____opt_52 and ____opt_52.elapsed or 0
875
884
  local timer = self[119]
876
885
  if timer == nil then
877
886
  timer = Timer:create()
@@ -957,11 +966,11 @@ __TS__SetDescriptor(
957
966
  "stuns",
958
967
  {
959
968
  get = function(self)
960
- local ____self__135_52 = self[135]
961
- if ____self__135_52 == nil then
962
- ____self__135_52 = false
969
+ local ____self__135_54 = self[135]
970
+ if ____self__135_54 == nil then
971
+ ____self__135_54 = false
963
972
  end
964
- return ____self__135_52
973
+ return ____self__135_54
965
974
  end,
966
975
  set = function(self, stuns)
967
976
  if not stuns and self[135] then
@@ -986,11 +995,11 @@ __TS__SetDescriptor(
986
995
  "ignoresStunImmunity",
987
996
  {
988
997
  get = function(self)
989
- local ____self__136_53 = self[136]
990
- if ____self__136_53 == nil then
991
- ____self__136_53 = false
998
+ local ____self__136_55 = self[136]
999
+ if ____self__136_55 == nil then
1000
+ ____self__136_55 = false
992
1001
  end
993
- return ____self__136_53
1002
+ return ____self__136_55
994
1003
  end,
995
1004
  set = function(self, ignoresStunImmunity)
996
1005
  if not ignoresStunImmunity and self[136] then
@@ -1013,11 +1022,11 @@ __TS__SetDescriptor(
1013
1022
  "disablesAutoAttack",
1014
1023
  {
1015
1024
  get = function(self)
1016
- local ____self__137_54 = self[137]
1017
- if ____self__137_54 == nil then
1018
- ____self__137_54 = false
1025
+ local ____self__137_56 = self[137]
1026
+ if ____self__137_56 == nil then
1027
+ ____self__137_56 = false
1019
1028
  end
1020
- return ____self__137_54
1029
+ return ____self__137_56
1021
1030
  end,
1022
1031
  set = function(self, disablesAutoAttack)
1023
1032
  if not disablesAutoAttack and self[137] then
@@ -1036,11 +1045,11 @@ __TS__SetDescriptor(
1036
1045
  "providesInvulnerability",
1037
1046
  {
1038
1047
  get = function(self)
1039
- local ____self__138_55 = self[138]
1040
- if ____self__138_55 == nil then
1041
- ____self__138_55 = false
1048
+ local ____self__138_57 = self[138]
1049
+ if ____self__138_57 == nil then
1050
+ ____self__138_57 = false
1042
1051
  end
1043
- return ____self__138_55
1052
+ return ____self__138_57
1044
1053
  end,
1045
1054
  set = function(self, providesInvulnerability)
1046
1055
  if not providesInvulnerability and self[138] then
@@ -1059,11 +1068,11 @@ __TS__SetDescriptor(
1059
1068
  "killsOnExpiration",
1060
1069
  {
1061
1070
  get = function(self)
1062
- local ____self__139_56 = self[139]
1063
- if ____self__139_56 == nil then
1064
- ____self__139_56 = false
1071
+ local ____self__139_58 = self[139]
1072
+ if ____self__139_58 == nil then
1073
+ ____self__139_58 = false
1065
1074
  end
1066
- return ____self__139_56
1075
+ return ____self__139_58
1067
1076
  end,
1068
1077
  set = function(self, killsOnExpiration)
1069
1078
  if not killsOnExpiration and self[139] then
@@ -1080,11 +1089,11 @@ __TS__SetDescriptor(
1080
1089
  "explodesOnExpiration",
1081
1090
  {
1082
1091
  get = function(self)
1083
- local ____self__140_57 = self[140]
1084
- if ____self__140_57 == nil then
1085
- ____self__140_57 = false
1092
+ local ____self__140_59 = self[140]
1093
+ if ____self__140_59 == nil then
1094
+ ____self__140_59 = false
1086
1095
  end
1087
- return ____self__140_57
1096
+ return ____self__140_59
1088
1097
  end,
1089
1098
  set = function(self, killsOnExpiration)
1090
1099
  if not killsOnExpiration and self[140] then
@@ -1212,13 +1221,13 @@ __TS__SetDescriptor(
1212
1221
  "remainingDuration",
1213
1222
  {
1214
1223
  get = function(self)
1215
- local ____opt_58 = self._timer
1216
- return ____opt_58 and ____opt_58.remaining or 0
1224
+ local ____opt_60 = self._timer
1225
+ return ____opt_60 and ____opt_60.remaining or 0
1217
1226
  end,
1218
1227
  set = function(self, remainingDuration)
1219
- local ____remainingDuration_62 = remainingDuration
1220
- local ____opt_60 = self._timer
1221
- local remainingDurationDelta = ____remainingDuration_62 - (____opt_60 and ____opt_60.remaining or 0)
1228
+ local ____remainingDuration_64 = remainingDuration
1229
+ local ____opt_62 = self._timer
1230
+ local remainingDurationDelta = ____remainingDuration_64 - (____opt_62 and ____opt_62.remaining or 0)
1222
1231
  if remainingDurationDelta ~= 0 then
1223
1232
  self[103] = self[103] + remainingDurationDelta
1224
1233
  if remainingDuration <= 0 then
@@ -1232,7 +1241,8 @@ __TS__SetDescriptor(
1232
1241
  self._level,
1233
1242
  remainingDuration,
1234
1243
  self._spellStealPriority,
1235
- self._learnLevelMinimum
1244
+ self._learnLevelMinimum,
1245
+ self[141]
1236
1246
  ) then
1237
1247
  local timer = self._timer
1238
1248
  if timer == nil then
@@ -12,3 +12,4 @@ export declare const enum AnimationName {
12
12
  STAND = "stand",
13
13
  WALK = "walk"
14
14
  }
15
+ export declare const isAnimationName: (value: string) => value is AnimationName;
@@ -1,2 +1,18 @@
1
1
  local ____exports = {}
2
+ local animationNames = {
3
+ attack = true,
4
+ birth = true,
5
+ death = true,
6
+ decay = true,
7
+ dissipate = true,
8
+ morph = true,
9
+ portrait = true,
10
+ sleep = true,
11
+ spell = true,
12
+ stand = true,
13
+ walk = true
14
+ }
15
+ ____exports.isAnimationName = function(value)
16
+ return animationNames[value] ~= nil
17
+ end
2
18
  return ____exports
@@ -12,5 +12,5 @@ export type TechTreeDependency = {
12
12
  level: number;
13
13
  };
14
14
  export type TechTreeDependencyInput = TechTreeDependency | UnitTypeId | UpgradeId;
15
- export declare const extractTechTreeDependencyInputObjectDataEntryId: (techTreeDependencyInput: TechTreeDependencyInput) => ObjectDataEntryId;
15
+ export declare const extractTechTreeDependencyInputObjectDataEntryId: (techTreeDependencyInput: TechTreeDependencyInput) => ObjectDataEntryId & number;
16
16
  export declare const extractTechTreeDependencyInputLevel: (techTreeDependencyInput: TechTreeDependencyInput) => number;
@@ -6,6 +6,8 @@ local __TS__New = ____lualib.__TS__New
6
6
  local ____exports = {}
7
7
  local ____channel = require("engine.object-data.entry.ability-type.channel")
8
8
  local ChannelAbilityType = ____channel.ChannelAbilityType
9
+ local ____animation_2Dname = require("engine.object-data.auxiliary.animation-name")
10
+ local isAnimationName = ____animation_2Dname.isAnimationName
9
11
  local ____order_2Dtype_2Dstring_2Did_2Dfactory = require("engine.object-data.utility.order-type-string-id-factory")
10
12
  local orderTypeStringIdFactory = ____order_2Dtype_2Dstring_2Did_2Dfactory.orderTypeStringIdFactory
11
13
  local ____timer = require("core.types.timer")
@@ -211,7 +213,16 @@ for abilityTypeId, usesAttackAnimation in pairs(postcompile(function()
211
213
  for abilityTypeId, usesAttackAnimation in pairs(usesAttackAnimationByAbilityTypeId) do
212
214
  if usesAttackAnimation then
213
215
  local abilityType = checkNotNull(____exports.BlankConfigurableAbilityType:of(abilityTypeId))
214
- abilityType.channelingAnimation = {"attack"}
216
+ if isAnimationName(abilityType.channelingAnimation[1]) then
217
+ if abilityType.channelingAnimation[1] ~= "attack" then
218
+ abilityType.channelingAnimation = {"attack"}
219
+ end
220
+ else
221
+ abilityType.channelingAnimation = {
222
+ "attack",
223
+ table.unpack(abilityType.channelingAnimation)
224
+ }
225
+ end
215
226
  end
216
227
  end
217
228
  return usesAttackAnimationByAbilityTypeId
@@ -54,10 +54,10 @@ __TS__SetDescriptor(
54
54
  "plagueWardUnitTypeId",
55
55
  {
56
56
  get = function(self)
57
- return self:getObjectDataEntryIdLevelField("Aplu")
57
+ return self:getObjectDataEntryNumericIdLevelField("Aplu")
58
58
  end,
59
59
  set = function(self, plagueWardUnitTypeId)
60
- self:setObjectDataEntryIdLevelField("Aplu", plagueWardUnitTypeId)
60
+ self:setObjectDataEntryNumericIdLevelField("Aplu", plagueWardUnitTypeId)
61
61
  end
62
62
  },
63
63
  true
@@ -55,7 +55,7 @@ __TS__SetDescriptor(
55
55
  get = function(self)
56
56
  local abilityUpgrades = {}
57
57
  for i = 0, 3 do
58
- local abilityUpgrade = self:getObjectDataEntryIdsLevelField("Neg" .. tostring(3 + i))
58
+ local abilityUpgrade = self:getObjectDataEntryNumericIdsLevelField("Neg" .. tostring(3 + i))
59
59
  for level = 0, #abilityUpgrade - 1 do
60
60
  local levelAbilityUpgrade = abilityUpgrade[level + 1]
61
61
  if #levelAbilityUpgrade == 2 then
@@ -71,7 +71,7 @@ __TS__SetDescriptor(
71
71
  local ____opt_0 = abilityUpgrades[1]
72
72
  local isArray = __TS__ArrayIsArray(____opt_0 and ____opt_0[1])
73
73
  for i = 0, #abilityUpgrades - 1 do
74
- self:setObjectDataEntryIdsLevelField(
74
+ self:setObjectDataEntryNumericIdsLevelField(
75
75
  "Neg" .. tostring(3 + i),
76
76
  isArray and map(
77
77
  abilityUpgrades,
@@ -15,10 +15,10 @@ __TS__SetDescriptor(
15
15
  "summonedUnitTypeId",
16
16
  {
17
17
  get = function(self)
18
- return self:getObjectDataEntryIdLevelField("Osf1")
18
+ return self:getObjectDataEntryNumericIdLevelField("Osf1")
19
19
  end,
20
20
  set = function(self, summonedUnitTypeId)
21
- self:setObjectDataEntryIdLevelField("Osf1", summonedUnitTypeId)
21
+ self:setObjectDataEntryNumericIdLevelField("Osf1", summonedUnitTypeId)
22
22
  end
23
23
  },
24
24
  true
@@ -15,10 +15,10 @@ __TS__SetDescriptor(
15
15
  "normalFormUnitTypeId",
16
16
  {
17
17
  get = function(self)
18
- return self:getObjectDataEntryIdLevelField("Eme1")
18
+ return self:getObjectDataEntryNumericIdLevelField("Eme1")
19
19
  end,
20
20
  set = function(self, normalFormUnitTypeId)
21
- self:setObjectDataEntryIdLevelField("Eme1", normalFormUnitTypeId)
21
+ self:setObjectDataEntryNumericIdLevelField("Eme1", normalFormUnitTypeId)
22
22
  end
23
23
  },
24
24
  true
@@ -119,10 +119,10 @@ __TS__SetDescriptor(
119
119
  "alternateFormUnitTypeId",
120
120
  {
121
121
  get = function(self)
122
- return self:getObjectDataEntryIdLevelField("Emeu")
122
+ return self:getObjectDataEntryNumericIdLevelField("Emeu")
123
123
  end,
124
124
  set = function(self, alternateFormUnitTypeId)
125
- self:setObjectDataEntryIdLevelField("Emeu", alternateFormUnitTypeId)
125
+ self:setObjectDataEntryNumericIdLevelField("Emeu", alternateFormUnitTypeId)
126
126
  end
127
127
  },
128
128
  true
@@ -0,0 +1,17 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityType, AbilityTypeId } from "../ability-type";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ import { UnitTypeId } from "../unit-type";
5
+ export declare class RaiseDeadAbilityType extends AbilityType {
6
+ static readonly BASE_ID: AbilityTypeId;
7
+ get firstSummonedUnitCount(): number[];
8
+ set firstSummonedUnitCount(firstSummonedUnitCount: ObjectDataEntryLevelFieldValueSupplier<number>);
9
+ get secondSummonedUnitCount(): number[];
10
+ set secondSummonedUnitCount(secondSummonedUnitCount: ObjectDataEntryLevelFieldValueSupplier<number>);
11
+ get firstSummonedUnitTypeId(): UnitTypeId[];
12
+ set firstSummonedUnitTypeId(firstSummonedUnitTypeId: ObjectDataEntryLevelFieldValueSupplier<UnitTypeId>);
13
+ get secondSummonedUnitTypeId(): UnitTypeId[];
14
+ set secondSummonedUnitTypeId(secondSummonedUnitTypeId: ObjectDataEntryLevelFieldValueSupplier<UnitTypeId>);
15
+ get limitCheckUnitTypeId(): UnitTypeId[];
16
+ set limitCheckUnitTypeId(limitCheckUnitTypeId: ObjectDataEntryLevelFieldValueSupplier<UnitTypeId>);
17
+ }