warscript 0.0.1-dev.fcc9d08 → 0.0.1-dev.fe0aeea

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 (63) hide show
  1. package/core/types/effect.d.ts +1 -3
  2. package/core/types/effect.lua +26 -29
  3. package/core/types/sound.d.ts +17 -25
  4. package/core/types/sound.lua +86 -46
  5. package/core/util.lua +6 -1
  6. package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
  7. package/engine/behaviour/ability/damage.d.ts +3 -0
  8. package/engine/behaviour/ability/damage.lua +2 -2
  9. package/engine/behaviour/ability.d.ts +5 -1
  10. package/engine/behaviour/ability.lua +18 -4
  11. package/engine/behaviour/unit.d.ts +2 -0
  12. package/engine/buff.d.ts +13 -8
  13. package/engine/buff.lua +81 -50
  14. package/engine/internal/mechanics/ability-duration.lua +1 -1
  15. package/engine/internal/unit.d.ts +6 -1
  16. package/engine/internal/unit.lua +8 -2
  17. package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
  18. package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
  19. package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
  20. package/engine/object-data/auxiliary/sound-eax.lua +2 -0
  21. package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
  22. package/engine/object-data/entry/ability-type/blank-configurable.lua +0 -9
  23. package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
  24. package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
  25. package/engine/object-data/entry/ability-type/curse.lua +2 -2
  26. package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
  27. package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
  28. package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
  29. package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
  30. package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
  31. package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
  32. package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
  33. package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
  34. package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
  35. package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
  36. package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
  37. package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
  38. package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
  39. package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
  40. package/engine/object-data/entry/ability-type/web.d.ts +12 -0
  41. package/engine/object-data/entry/ability-type/web.lua +52 -0
  42. package/engine/object-data/entry/ability-type.d.ts +19 -17
  43. package/engine/object-data/entry/ability-type.lua +74 -21
  44. package/engine/object-data/entry/buff-type/applicable.lua +4 -4
  45. package/engine/object-data/entry/buff-type.d.ts +1 -1
  46. package/engine/object-data/entry/buff-type.lua +2 -2
  47. package/engine/object-data/entry/destructible-type.d.ts +1 -1
  48. package/engine/object-data/entry/item-type.d.ts +1 -1
  49. package/engine/object-data/entry/item-type.lua +4 -4
  50. package/engine/object-data/entry/lightning-type.d.ts +1 -1
  51. package/engine/object-data/entry/sound-preset.d.ts +33 -0
  52. package/engine/object-data/entry/sound-preset.lua +140 -0
  53. package/engine/object-data/entry/unit-type.d.ts +1 -1
  54. package/engine/object-data/entry/unit-type.lua +11 -11
  55. package/engine/object-data/entry/upgrade.d.ts +1 -1
  56. package/engine/object-data/entry/upgrade.lua +4 -4
  57. package/engine/object-data/entry.d.ts +16 -14
  58. package/engine/object-data/entry.lua +60 -32
  59. package/engine/standard/entries/sound-preset.d.ts +10 -0
  60. package/engine/standard/entries/sound-preset.lua +10 -0
  61. package/objutil/unit.lua +2 -2
  62. package/package.json +2 -2
  63. package/utility/reflection.lua +11 -7
package/engine/buff.lua CHANGED
@@ -109,6 +109,7 @@ local buffParametersKeys = {
109
109
  durationIncreaseOnAutoAttack = true,
110
110
  maximumDuration = true,
111
111
  maximumRemainingDuration = true,
112
+ turnsIntoGhost = true,
112
113
  stuns = true,
113
114
  ignoresStunImmunity = true,
114
115
  providesStunImmunity = true,
@@ -174,6 +175,7 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
174
175
  end
175
176
  end
176
177
  local buffBooleanParameters = {
178
+ "turnsIntoGhost",
177
179
  "stuns",
178
180
  "ignoresStunImmunity",
179
181
  "disablesAutoAttack",
@@ -321,7 +323,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
321
323
  typeId = selectBuffTypeIdWithLeastDuration(typeIdOrTypeIds, _unit)
322
324
  polarity = resistanceTypeOrPolarity
323
325
  resistanceType = abilityOrParametersOrResistanceType
324
- if __TS__InstanceOf(parametersOrAbility, Ability) then
326
+ if __TS__InstanceOf(parametersOrAbility, Ability) or parametersOrAbility == nil then
325
327
  ability = parametersOrAbility
326
328
  else
327
329
  ability = nil
@@ -331,7 +333,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
331
333
  typeId = typeIdOrTypeIds
332
334
  polarity = polarityOrTypeIdSelectionPolicy
333
335
  resistanceType = resistanceTypeOrPolarity
334
- if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) then
336
+ if __TS__InstanceOf(abilityOrParametersOrResistanceType, Ability) or abilityOrParametersOrResistanceType == nil then
335
337
  ability = abilityOrParametersOrResistanceType
336
338
  parameters = parametersOrAbility
337
339
  else
@@ -340,7 +342,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
340
342
  end
341
343
  end
342
344
  self.typeId = typeId
343
- if not __TS__InstanceOf(ability, Ability) then
345
+ if not (__TS__InstanceOf(ability, Ability) or ability == nil) then
344
346
  parameters = ability
345
347
  ability = nil
346
348
  end
@@ -371,7 +373,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
371
373
  local missProbability = parameters and parameters.missProbability or defaultParameters.missProbability
372
374
  if missProbability ~= nil then
373
375
  missProbability = resolveNumberValue(ability, level, missProbability)
374
- self[141] = missProbability
376
+ self[142] = missProbability
375
377
  end
376
378
  local buffByTypeId = buffByTypeIdByUnit[_unit]
377
379
  if buffByTypeId == nil then
@@ -592,15 +594,21 @@ function Buff.prototype.onDestroy(self)
592
594
  behavior:destroy()
593
595
  end
594
596
  end
595
- if self[137] then
597
+ if self[139] then
598
+ unit:decrementInvulnerabilityCounter()
599
+ end
600
+ if self[138] then
596
601
  unit:decrementDisableAutoAttackCounter()
597
602
  end
598
- if self[135] then
599
- if self[136] then
603
+ if self[136] then
604
+ if self[137] then
600
605
  unit:decrementStunCounter()
601
606
  end
602
607
  unit:decrementStunCounter()
603
608
  end
609
+ if self[135] then
610
+ unit:decrementGhostCounter()
611
+ end
604
612
  if self._abilityTypeIds ~= nil then
605
613
  for abilityTypeId in pairs(self._abilityTypeIds) do
606
614
  unit:removeAbility(abilityTypeId)
@@ -655,9 +663,9 @@ function Buff.prototype.onExpiration(self)
655
663
  if self[121] ~= nil then
656
664
  (self[102] or unit):healTarget(unit, self[120] or 0)
657
665
  end
658
- if self[140] then
666
+ if self[141] then
659
667
  unit:explode()
660
- elseif self[139] then
668
+ elseif self[140] then
661
669
  unit:kill()
662
670
  end
663
671
  end
@@ -963,7 +971,7 @@ __TS__SetDescriptor(
963
971
  )
964
972
  __TS__SetDescriptor(
965
973
  Buff.prototype,
966
- "stuns",
974
+ "turnsIntoGhost",
967
975
  {
968
976
  get = function(self)
969
977
  local ____self__135_54 = self[135]
@@ -972,18 +980,12 @@ __TS__SetDescriptor(
972
980
  end
973
981
  return ____self__135_54
974
982
  end,
975
- set = function(self, stuns)
976
- if not stuns and self[135] then
977
- if self[136] then
978
- self.object:decrementStunCounter()
979
- end
980
- self.object:decrementStunCounter()
983
+ set = function(self, turnsIntoGhost)
984
+ if not turnsIntoGhost and self[135] then
985
+ self.object:decrementGhostCounter()
981
986
  self[135] = nil
982
- elseif stuns and not self[135] then
983
- if self[136] then
984
- self.object:incrementStunCounter()
985
- end
986
- self.object:incrementStunCounter()
987
+ elseif turnsIntoGhost and not self[135] then
988
+ self.object:incrementGhostCounter()
987
989
  self[135] = true
988
990
  end
989
991
  end
@@ -992,7 +994,7 @@ __TS__SetDescriptor(
992
994
  )
993
995
  __TS__SetDescriptor(
994
996
  Buff.prototype,
995
- "ignoresStunImmunity",
997
+ "stuns",
996
998
  {
997
999
  get = function(self)
998
1000
  local ____self__136_55 = self[136]
@@ -1001,16 +1003,18 @@ __TS__SetDescriptor(
1001
1003
  end
1002
1004
  return ____self__136_55
1003
1005
  end,
1004
- set = function(self, ignoresStunImmunity)
1005
- if not ignoresStunImmunity and self[136] then
1006
- if self[135] then
1006
+ set = function(self, stuns)
1007
+ if not stuns and self[136] then
1008
+ if self[137] then
1007
1009
  self.object:decrementStunCounter()
1008
1010
  end
1011
+ self.object:decrementStunCounter()
1009
1012
  self[136] = nil
1010
- elseif ignoresStunImmunity and not self[136] then
1011
- if self[135] then
1013
+ elseif stuns and not self[136] then
1014
+ if self[137] then
1012
1015
  self.object:incrementStunCounter()
1013
1016
  end
1017
+ self.object:incrementStunCounter()
1014
1018
  self[136] = true
1015
1019
  end
1016
1020
  end
@@ -1019,7 +1023,7 @@ __TS__SetDescriptor(
1019
1023
  )
1020
1024
  __TS__SetDescriptor(
1021
1025
  Buff.prototype,
1022
- "disablesAutoAttack",
1026
+ "ignoresStunImmunity",
1023
1027
  {
1024
1028
  get = function(self)
1025
1029
  local ____self__137_56 = self[137]
@@ -1028,12 +1032,16 @@ __TS__SetDescriptor(
1028
1032
  end
1029
1033
  return ____self__137_56
1030
1034
  end,
1031
- set = function(self, disablesAutoAttack)
1032
- if not disablesAutoAttack and self[137] then
1033
- self.object:decrementDisableAutoAttackCounter()
1035
+ set = function(self, ignoresStunImmunity)
1036
+ if not ignoresStunImmunity and self[137] then
1037
+ if self[136] then
1038
+ self.object:decrementStunCounter()
1039
+ end
1034
1040
  self[137] = nil
1035
- elseif disablesAutoAttack and not self[137] then
1036
- self.object:incrementDisableAutoAttackCounter()
1041
+ elseif ignoresStunImmunity and not self[137] then
1042
+ if self[136] then
1043
+ self.object:incrementStunCounter()
1044
+ end
1037
1045
  self[137] = true
1038
1046
  end
1039
1047
  end
@@ -1042,7 +1050,7 @@ __TS__SetDescriptor(
1042
1050
  )
1043
1051
  __TS__SetDescriptor(
1044
1052
  Buff.prototype,
1045
- "providesInvulnerability",
1053
+ "disablesAutoAttack",
1046
1054
  {
1047
1055
  get = function(self)
1048
1056
  local ____self__138_57 = self[138]
@@ -1051,12 +1059,12 @@ __TS__SetDescriptor(
1051
1059
  end
1052
1060
  return ____self__138_57
1053
1061
  end,
1054
- set = function(self, providesInvulnerability)
1055
- if not providesInvulnerability and self[138] then
1056
- self.object:decrementInvulnerabilityCounter()
1062
+ set = function(self, disablesAutoAttack)
1063
+ if not disablesAutoAttack and self[138] then
1064
+ self.object:decrementDisableAutoAttackCounter()
1057
1065
  self[138] = nil
1058
- elseif providesInvulnerability and not self[138] then
1059
- self.object:incrementInvulnerabilityCounter()
1066
+ elseif disablesAutoAttack and not self[138] then
1067
+ self.object:incrementDisableAutoAttackCounter()
1060
1068
  self[138] = true
1061
1069
  end
1062
1070
  end
@@ -1065,7 +1073,7 @@ __TS__SetDescriptor(
1065
1073
  )
1066
1074
  __TS__SetDescriptor(
1067
1075
  Buff.prototype,
1068
- "killsOnExpiration",
1076
+ "providesInvulnerability",
1069
1077
  {
1070
1078
  get = function(self)
1071
1079
  local ____self__139_58 = self[139]
@@ -1074,10 +1082,12 @@ __TS__SetDescriptor(
1074
1082
  end
1075
1083
  return ____self__139_58
1076
1084
  end,
1077
- set = function(self, killsOnExpiration)
1078
- if not killsOnExpiration and self[139] then
1085
+ set = function(self, providesInvulnerability)
1086
+ if not providesInvulnerability and self[139] then
1087
+ self.object:decrementInvulnerabilityCounter()
1079
1088
  self[139] = nil
1080
- elseif killsOnExpiration and not self[139] then
1089
+ elseif providesInvulnerability and not self[139] then
1090
+ self.object:incrementInvulnerabilityCounter()
1081
1091
  self[139] = true
1082
1092
  end
1083
1093
  end
@@ -1086,7 +1096,7 @@ __TS__SetDescriptor(
1086
1096
  )
1087
1097
  __TS__SetDescriptor(
1088
1098
  Buff.prototype,
1089
- "explodesOnExpiration",
1099
+ "killsOnExpiration",
1090
1100
  {
1091
1101
  get = function(self)
1092
1102
  local ____self__140_59 = self[140]
@@ -1105,6 +1115,27 @@ __TS__SetDescriptor(
1105
1115
  },
1106
1116
  true
1107
1117
  )
1118
+ __TS__SetDescriptor(
1119
+ Buff.prototype,
1120
+ "explodesOnExpiration",
1121
+ {
1122
+ get = function(self)
1123
+ local ____self__141_60 = self[141]
1124
+ if ____self__141_60 == nil then
1125
+ ____self__141_60 = false
1126
+ end
1127
+ return ____self__141_60
1128
+ end,
1129
+ set = function(self, killsOnExpiration)
1130
+ if not killsOnExpiration and self[141] then
1131
+ self[141] = nil
1132
+ elseif killsOnExpiration and not self[141] then
1133
+ self[141] = true
1134
+ end
1135
+ end
1136
+ },
1137
+ true
1138
+ )
1108
1139
  __TS__SetDescriptor(
1109
1140
  Buff.prototype,
1110
1141
  "maximumDamageDealtEventCount",
@@ -1221,13 +1252,13 @@ __TS__SetDescriptor(
1221
1252
  "remainingDuration",
1222
1253
  {
1223
1254
  get = function(self)
1224
- local ____opt_60 = self._timer
1225
- return ____opt_60 and ____opt_60.remaining or 0
1255
+ local ____opt_61 = self._timer
1256
+ return ____opt_61 and ____opt_61.remaining or 0
1226
1257
  end,
1227
1258
  set = function(self, remainingDuration)
1228
- local ____remainingDuration_64 = remainingDuration
1229
- local ____opt_62 = self._timer
1230
- local remainingDurationDelta = ____remainingDuration_64 - (____opt_62 and ____opt_62.remaining or 0)
1259
+ local ____remainingDuration_65 = remainingDuration
1260
+ local ____opt_63 = self._timer
1261
+ local remainingDurationDelta = ____remainingDuration_65 - (____opt_63 and ____opt_63.remaining or 0)
1231
1262
  if remainingDurationDelta ~= 0 then
1232
1263
  self[103] = self[103] + remainingDurationDelta
1233
1264
  if remainingDuration <= 0 then
@@ -1242,7 +1273,7 @@ __TS__SetDescriptor(
1242
1273
  remainingDuration,
1243
1274
  self._spellStealPriority,
1244
1275
  self._learnLevelMinimum,
1245
- self[141]
1276
+ self[142]
1246
1277
  ) then
1247
1278
  local timer = self._timer
1248
1279
  if timer == nil then
@@ -8,6 +8,6 @@ local DURATION_NORMAL_ABILITY_FLOAT_LEVEL_FIELD = ____ability.DURATION_NORMAL_AB
8
8
  -- @internal For use by internal systems only.
9
9
  ____exports.getAbilityDuration = function(ability, target)
10
10
  local level = ability.level
11
- return target ~= nil and target:hasClassification(UnitClassification.RESISTANT) and DURATION_HERO_ABILITY_FLOAT_LEVEL_FIELD:getValue(ability, level) or DURATION_NORMAL_ABILITY_FLOAT_LEVEL_FIELD:getValue(ability, level)
11
+ return target ~= nil and (target.isHero or target:getField(UNIT_IF_LEVEL) >= 6 or target:hasClassification(UnitClassification.RESISTANT)) and DURATION_HERO_ABILITY_FLOAT_LEVEL_FIELD:getValue(ability, level) or DURATION_NORMAL_ABILITY_FLOAT_LEVEL_FIELD:getValue(ability, level)
12
12
  end
13
13
  return ____exports
@@ -100,7 +100,9 @@ declare const enum UnitPropertyKey {
100
100
  DELAY_HEALTH_CHECKS_COUNTER = 103,
101
101
  DELAY_HEALTH_CHECKS_HEALTH_BONUS = 104,
102
102
  PREVENT_DEATH_HEALTH_BONUS = 105,
103
- IS_TEAM_GLOW_HIDDEN = 106
103
+ IS_TEAM_GLOW_HIDDEN = 106,
104
+ LAST_X = 107,
105
+ LAST_Y = 108
104
106
  }
105
107
  export type UnitSyncId = number & {
106
108
  readonly __unitSyncId: unique symbol;
@@ -113,6 +115,8 @@ export declare class Unit extends Handle<junit> {
113
115
  private [UnitPropertyKey.DELAY_HEALTH_CHECKS_HEALTH_BONUS]?;
114
116
  private [UnitPropertyKey.PREVENT_DEATH_HEALTH_BONUS]?;
115
117
  private [UnitPropertyKey.IS_TEAM_GLOW_HIDDEN]?;
118
+ private [UnitPropertyKey.LAST_X]?;
119
+ private [UnitPropertyKey.LAST_Y]?;
116
120
  private _owner?;
117
121
  private _timeScale?;
118
122
  private events?;
@@ -148,6 +152,7 @@ export declare class Unit extends Handle<junit> {
148
152
  isEnemyOf(unit: Unit): boolean;
149
153
  playAnimation(animation: string, rarity?: jraritycontrol): void;
150
154
  playAnimation(animation: number): void;
155
+ resetAnimation(): void;
151
156
  queueAnimation(animation: string): void;
152
157
  get weapons(): [UnitWeapon, UnitWeapon];
153
158
  get firstWeapon(): UnitWeapon;
@@ -58,6 +58,7 @@ local ____tostring = _G.tostring
58
58
  local setUnitAnimation = SetUnitAnimation
59
59
  local setUnitAnimationWithRarity = SetUnitAnimationWithRarity
60
60
  local setUnitAnimationByIndex = SetUnitAnimationByIndex
61
+ local resetUnitAnimation = ResetUnitAnimation
61
62
  local queueUnitAnimation = QueueUnitAnimation
62
63
  local getUnitIntegerField = BlzGetUnitIntegerField
63
64
  local getUnitRealField = BlzGetUnitRealField
@@ -680,6 +681,8 @@ function Unit.prototype.getEvent(self, event, collector)
680
681
  end
681
682
  function Unit.prototype.onDestroy(self)
682
683
  local handle = self.handle
684
+ self[107] = getUnitX(handle)
685
+ self[108] = getUnitY(handle)
683
686
  if not self._owner then
684
687
  self._owner = Player:of(getOwningPlayer(handle))
685
688
  end
@@ -795,6 +798,9 @@ function Unit.prototype.playAnimation(self, animation, rarity)
795
798
  setUnitAnimation(self.handle, animation)
796
799
  end
797
800
  end
801
+ function Unit.prototype.resetAnimation(self)
802
+ resetUnitAnimation(self.handle)
803
+ end
798
804
  function Unit.prototype.queueAnimation(self, animation)
799
805
  queueUnitAnimation(self.handle, animation)
800
806
  end
@@ -1597,7 +1603,7 @@ __TS__SetDescriptor(
1597
1603
  "x",
1598
1604
  {
1599
1605
  get = function(self)
1600
- return getUnitX(self.handle)
1606
+ return self[107] or getUnitX(self.handle)
1601
1607
  end,
1602
1608
  set = function(self, v)
1603
1609
  SetUnitX(self.handle, v)
@@ -1610,7 +1616,7 @@ __TS__SetDescriptor(
1610
1616
  "y",
1611
1617
  {
1612
1618
  get = function(self)
1613
- return getUnitY(self.handle)
1619
+ return self[108] or getUnitY(self.handle)
1614
1620
  end,
1615
1621
  set = function(self, v)
1616
1622
  SetUnitY(self.handle, v)
@@ -2,13 +2,18 @@
2
2
  import { ModelNodeName } from "./model-node-name";
3
3
  import { ModelNodeQualifier } from "./model-node-qualifier";
4
4
  import { Optional } from "../../../utility/types";
5
+ import { EffectParameters } from "../../../core/types/effect";
5
6
  export type AttachmentPreset = {
6
7
  modelPath: string;
7
8
  nodeName: ModelNodeName;
8
9
  nodeQualifiers: ModelNodeQualifier[];
9
10
  };
10
- export type AttachmentPresetInput = Optional<AttachmentPreset, "nodeQualifiers"> | string;
11
- export declare const toAttachmentPreset: (attachmentPresetInput: AttachmentPresetInput) => AttachmentPreset;
11
+ export type EffectPresetWithParameters = AttachmentPreset & {
12
+ parameters?: EffectParameters;
13
+ };
14
+ export type AttachmentPresetInput<T extends AttachmentPreset = AttachmentPreset> = Optional<T, "nodeName" | "nodeQualifiers"> | string;
15
+ export type EffectPresetWithParametersInput = AttachmentPresetInput<EffectPresetWithParameters>;
16
+ export declare const toEffectPreset: (effectPresetInput: EffectPresetWithParametersInput) => EffectPresetWithParameters;
12
17
  export declare const extractAttachmentPresetInputModelPath: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
13
18
  export declare const extractAttachmentPresetInputNodeFQN: (attachmentPresetInput: AttachmentPresetInput | undefined) => string;
14
19
  export declare const splitAttachmentNodeFQN: (attachmentNodeFQN: string) => LuaMultiReturn<[attachmentNodeName: ModelNodeName, attachmentNodeQualifiers: ModelNodeQualifier[]]>;
@@ -1,9 +1,10 @@
1
1
  local ____lualib = require("lualib_bundle")
2
+ local __TS__ArrayJoin = ____lualib.__TS__ArrayJoin
2
3
  local __TS__StringSplit = ____lualib.__TS__StringSplit
3
4
  local __TS__ArraySlice = ____lualib.__TS__ArraySlice
4
5
  local ____exports = {}
5
- ____exports.toAttachmentPreset = function(attachmentPresetInput)
6
- return type(attachmentPresetInput) == "string" and ({modelPath = attachmentPresetInput, nodeName = "origin", nodeQualifiers = {}}) or ({modelPath = attachmentPresetInput.modelPath, nodeName = attachmentPresetInput.nodeName, nodeQualifiers = attachmentPresetInput.nodeQualifiers or ({})})
6
+ ____exports.toEffectPreset = function(effectPresetInput)
7
+ return type(effectPresetInput) == "string" and ({modelPath = effectPresetInput, nodeName = "origin", nodeQualifiers = {}}) or ({modelPath = effectPresetInput.modelPath, nodeName = effectPresetInput.nodeName or "origin", nodeQualifiers = effectPresetInput.nodeQualifiers or ({}), parameters = effectPresetInput.parameters})
7
8
  end
8
9
  ____exports.extractAttachmentPresetInputModelPath = function(attachmentPresetInput)
9
10
  return type(attachmentPresetInput) == "string" and attachmentPresetInput or (attachmentPresetInput and attachmentPresetInput.modelPath or "")
@@ -12,7 +13,7 @@ ____exports.extractAttachmentPresetInputNodeFQN = function(attachmentPresetInput
12
13
  if type(attachmentPresetInput) == "string" or attachmentPresetInput == nil then
13
14
  return ""
14
15
  end
15
- return table.concat(
16
+ return __TS__ArrayJoin(
16
17
  {
17
18
  attachmentPresetInput.nodeName,
18
19
  table.unpack(attachmentPresetInput.nodeQualifiers or ({}))
@@ -0,0 +1,10 @@
1
+ /** @noSelfInFile */
2
+ export declare const enum SoundEax {
3
+ DEFAULT = "DefaultEAXON",
4
+ ACKNOWLEDGEMENTS = "HeroAcksEAX",
5
+ ENVIRONMENT = "DoodadsEAX",
6
+ DRUMS = "KotoDrumsEAX",
7
+ ATTACKS = "CombatSoundsEAX",
8
+ ABILITIES = "SpellsEAX",
9
+ MISSILES = "MissilesEAX"
10
+ }
@@ -0,0 +1,2 @@
1
+ local ____exports = {}
2
+ 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;
@@ -23,9 +23,6 @@ local ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD = ____ability.A
23
23
  local AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD = ____ability.AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD
24
24
  local ____linked_2Dset = require("utility.linked-set")
25
25
  local LinkedSet = ____linked_2Dset.LinkedSet
26
- local ____sound = require("core.types.sound")
27
- local Sound3D = ____sound.Sound3D
28
- local SoundPreset = ____sound.SoundPreset
29
26
  local isChannelingAbilityTypeIds = {}
30
27
  local usesAttackAnimationByAbilityTypeId = {}
31
28
  ____exports.BlankConfigurableAbilityType = __TS__Class()
@@ -230,12 +227,6 @@ for abilityTypeId, usesAttackAnimation in pairs(postcompile(function()
230
227
  end
231
228
  return usesAttackAnimationByAbilityTypeId
232
229
  end)) do
233
- Unit.abilityCastingFinishEvent[abilityTypeId]:addListener(function(caster, ability)
234
- local effectSound = ability:getField(ABILITY_SF_EFFECT_SOUND)
235
- if effectSound ~= "" then
236
- Sound3D:playFromLabel(effectSound, SoundPreset.Ability, caster)
237
- end
238
- end)
239
230
  if usesAttackAnimation then
240
231
  Unit.abilityCastingStartEvent[abilityTypeId]:addListener(
241
232
  4,
@@ -0,0 +1,14 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityType, AbilityTypeId } from "../ability-type";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ export declare class CarrionSwarmAbilityType extends AbilityType {
5
+ static readonly BASE_ID: AbilityTypeId;
6
+ get damagePerTarget(): number[];
7
+ set damagePerTarget(damagePerTarget: ObjectDataEntryLevelFieldValueSupplier<number>);
8
+ get maximumTotalDamage(): number[];
9
+ set maximumTotalDamage(maximumTotalDamage: ObjectDataEntryLevelFieldValueSupplier<number>);
10
+ get distance(): number[];
11
+ set distance(distance: ObjectDataEntryLevelFieldValueSupplier<number>);
12
+ get finalAreaOfEffect(): number[];
13
+ set finalAreaOfEffect(finalAreaOfEffect: ObjectDataEntryLevelFieldValueSupplier<number>);
14
+ }
@@ -0,0 +1,65 @@
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.CarrionSwarmAbilityType = __TS__Class()
9
+ local CarrionSwarmAbilityType = ____exports.CarrionSwarmAbilityType
10
+ CarrionSwarmAbilityType.name = "CarrionSwarmAbilityType"
11
+ __TS__ClassExtends(CarrionSwarmAbilityType, AbilityType)
12
+ CarrionSwarmAbilityType.BASE_ID = fourCC("AUcs")
13
+ __TS__SetDescriptor(
14
+ CarrionSwarmAbilityType.prototype,
15
+ "damagePerTarget",
16
+ {
17
+ get = function(self)
18
+ return self:getNumberLevelField("Ucs1")
19
+ end,
20
+ set = function(self, damagePerTarget)
21
+ self:setNumberLevelField("Ucs1", damagePerTarget)
22
+ end
23
+ },
24
+ true
25
+ )
26
+ __TS__SetDescriptor(
27
+ CarrionSwarmAbilityType.prototype,
28
+ "maximumTotalDamage",
29
+ {
30
+ get = function(self)
31
+ return self:getNumberLevelField("Ucs2")
32
+ end,
33
+ set = function(self, maximumTotalDamage)
34
+ self:setNumberLevelField("Ucs2", maximumTotalDamage)
35
+ end
36
+ },
37
+ true
38
+ )
39
+ __TS__SetDescriptor(
40
+ CarrionSwarmAbilityType.prototype,
41
+ "distance",
42
+ {
43
+ get = function(self)
44
+ return self:getNumberLevelField("Ucs3")
45
+ end,
46
+ set = function(self, distance)
47
+ self:setNumberLevelField("Ucs3", distance)
48
+ end
49
+ },
50
+ true
51
+ )
52
+ __TS__SetDescriptor(
53
+ CarrionSwarmAbilityType.prototype,
54
+ "finalAreaOfEffect",
55
+ {
56
+ get = function(self)
57
+ return self:getNumberLevelField("Ucs4")
58
+ end,
59
+ set = function(self, finalAreaOfEffect)
60
+ self:setNumberLevelField("Ucs4", finalAreaOfEffect)
61
+ end
62
+ },
63
+ true
64
+ )
65
+ return ____exports
@@ -15,10 +15,10 @@ __TS__SetDescriptor(
15
15
  "missProbability",
16
16
  {
17
17
  get = function(self)
18
- return self:getNumberLevelField("Crs1")
18
+ return self:getNumberLevelField("Crs")
19
19
  end,
20
20
  set = function(self, missProbability)
21
- self:setNumberLevelField("Crs1", missProbability)
21
+ self:setNumberLevelField("Crs", missProbability)
22
22
  end
23
23
  },
24
24
  true
@@ -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,
@@ -0,0 +1,12 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityType, AbilityTypeId } from "../ability-type";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ export declare class EnsnareAbilityType extends AbilityType {
5
+ static readonly BASE_ID: AbilityTypeId;
6
+ get airUnitLoweringDuration(): number[];
7
+ set airUnitLoweringDuration(airUnitLoweringDuration: ObjectDataEntryLevelFieldValueSupplier<number>);
8
+ get airUnitHeight(): number[];
9
+ set airUnitHeight(airUnitHeight: ObjectDataEntryLevelFieldValueSupplier<number>);
10
+ get meleeAttackRange(): number[];
11
+ set meleeAttackRange(meleeAttackRange: ObjectDataEntryLevelFieldValueSupplier<number>);
12
+ }
@@ -0,0 +1,52 @@
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.EnsnareAbilityType = __TS__Class()
9
+ local EnsnareAbilityType = ____exports.EnsnareAbilityType
10
+ EnsnareAbilityType.name = "EnsnareAbilityType"
11
+ __TS__ClassExtends(EnsnareAbilityType, AbilityType)
12
+ EnsnareAbilityType.BASE_ID = fourCC("Aens")
13
+ __TS__SetDescriptor(
14
+ EnsnareAbilityType.prototype,
15
+ "airUnitLoweringDuration",
16
+ {
17
+ get = function(self)
18
+ return self:getNumberLevelField("Ens1")
19
+ end,
20
+ set = function(self, airUnitLoweringDuration)
21
+ self:setNumberLevelField("Ens1", airUnitLoweringDuration)
22
+ end
23
+ },
24
+ true
25
+ )
26
+ __TS__SetDescriptor(
27
+ EnsnareAbilityType.prototype,
28
+ "airUnitHeight",
29
+ {
30
+ get = function(self)
31
+ return self:getNumberLevelField("Ens2")
32
+ end,
33
+ set = function(self, airUnitHeight)
34
+ self:setNumberLevelField("Ens2", airUnitHeight)
35
+ end
36
+ },
37
+ true
38
+ )
39
+ __TS__SetDescriptor(
40
+ EnsnareAbilityType.prototype,
41
+ "meleeAttackRange",
42
+ {
43
+ get = function(self)
44
+ return self:getNumberLevelField("Ens3")
45
+ end,
46
+ set = function(self, meleeAttackRange)
47
+ self:setNumberLevelField("Ens3", meleeAttackRange)
48
+ end
49
+ },
50
+ true
51
+ )
52
+ return ____exports