warscript 0.0.1-dev.4721022 → 0.0.1-dev.4cfb266

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 (76) 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 +85 -44
  5. package/core/types/timer.d.ts +6 -7
  6. package/core/types/timer.lua +18 -21
  7. package/decl/native.d.ts +840 -786
  8. package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
  9. package/engine/behaviour/ability/damage.d.ts +2 -1
  10. package/engine/behaviour/ability/emulate-impact.lua +7 -0
  11. package/engine/behaviour/ability.d.ts +4 -1
  12. package/engine/behaviour/ability.lua +6 -4
  13. package/engine/behaviour/unit.d.ts +2 -0
  14. package/engine/buff.d.ts +13 -8
  15. package/engine/buff.lua +81 -50
  16. package/engine/internal/item.d.ts +2 -1
  17. package/engine/internal/mechanics/ability-duration.lua +1 -1
  18. package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
  19. package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
  20. package/engine/internal/unit+damage.d.ts +2 -11
  21. package/engine/internal/unit+damage.lua +10 -14
  22. package/engine/internal/unit+spellSteal.lua +1 -2
  23. package/engine/internal/unit.d.ts +16 -2
  24. package/engine/internal/unit.lua +81 -32
  25. package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
  26. package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
  27. package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
  28. package/engine/object-data/auxiliary/attack-type.lua +42 -0
  29. package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
  30. package/engine/object-data/auxiliary/movement-type.lua +22 -0
  31. package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
  32. package/engine/object-data/auxiliary/sound-eax.lua +2 -0
  33. package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
  34. package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
  35. package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
  36. package/engine/object-data/entry/ability-type/berserk.lua +13 -0
  37. package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
  38. package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
  39. package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
  40. package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
  41. package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
  42. package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
  43. package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
  44. package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
  45. package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
  46. package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
  47. package/engine/object-data/entry/ability-type/web.d.ts +12 -0
  48. package/engine/object-data/entry/ability-type/web.lua +52 -0
  49. package/engine/object-data/entry/ability-type.d.ts +11 -11
  50. package/engine/object-data/entry/ability-type.lua +31 -10
  51. package/engine/object-data/entry/buff-type/applicable.lua +5 -0
  52. package/engine/object-data/entry/buff-type.d.ts +5 -11
  53. package/engine/object-data/entry/buff-type.lua +11 -27
  54. package/engine/object-data/entry/sound-preset.d.ts +17 -0
  55. package/engine/object-data/entry/sound-preset.lua +104 -0
  56. package/engine/object-data/entry/unit-type.d.ts +2 -2
  57. package/engine/object-data/entry/unit-type.lua +94 -84
  58. package/engine/object-field/ability.d.ts +1 -1
  59. package/engine/object-field/unit.d.ts +46 -3
  60. package/engine/object-field/unit.lua +173 -7
  61. package/engine/object-field.d.ts +9 -1
  62. package/engine/object-field.lua +158 -76
  63. package/engine/standard/entries/buff-type.d.ts +3 -0
  64. package/engine/standard/entries/buff-type.lua +3 -0
  65. package/objutil/buff.lua +1 -2
  66. package/package.json +2 -2
  67. package/utility/arrays.d.ts +1 -0
  68. package/utility/arrays.lua +3 -0
  69. package/utility/functions.d.ts +1 -0
  70. package/utility/functions.lua +1 -0
  71. package/utility/linked-set.d.ts +1 -0
  72. package/utility/linked-set.lua +3 -0
  73. package/utility/lua-maps.d.ts +3 -0
  74. package/utility/lua-maps.lua +16 -0
  75. package/utility/lua-sets.d.ts +1 -0
  76. package/utility/lua-sets.lua +3 -0
@@ -53,11 +53,17 @@ local ____math = require("math")
53
53
  local min = ____math.min
54
54
  local ____ignore_2Devents_2Ditems = require("engine.internal.unit.ignore-events-items")
55
55
  local ignoreEventsItems = ____ignore_2Devents_2Ditems.ignoreEventsItems
56
+ local ____attack_2Dtype = require("engine.object-data.auxiliary.attack-type")
57
+ local attackTypeToNative = ____attack_2Dtype.attackTypeToNative
58
+ local nativeToAttackType = ____attack_2Dtype.nativeToAttackType
59
+ local ____damage_2Dmetadata_2Dby_2Dtarget = require("engine.internal.misc.damage-metadata-by-target")
60
+ local damageMetadataByTarget = ____damage_2Dmetadata_2Dby_2Dtarget.damageMetadataByTarget
56
61
  local match = string.match
57
62
  local ____tostring = _G.tostring
58
63
  local setUnitAnimation = SetUnitAnimation
59
64
  local setUnitAnimationWithRarity = SetUnitAnimationWithRarity
60
65
  local setUnitAnimationByIndex = SetUnitAnimationByIndex
66
+ local resetUnitAnimation = ResetUnitAnimation
61
67
  local queueUnitAnimation = QueueUnitAnimation
62
68
  local getUnitIntegerField = BlzGetUnitIntegerField
63
69
  local getUnitRealField = BlzGetUnitRealField
@@ -80,7 +86,6 @@ local getHandleId = GetHandleId
80
86
  local getUnitCurrentOrder = GetUnitCurrentOrder
81
87
  local createUnit = CreateUnit
82
88
  local killUnit = KillUnit
83
- local setUnitExploded = SetUnitExploded
84
89
  local removeUnit = RemoveUnit
85
90
  local getUnitTypeId = GetUnitTypeId
86
91
  local isHeroUnitId = IsHeroUnitId
@@ -96,8 +101,6 @@ local getSpellTargetItem = GetSpellTargetItem
96
101
  local getSpellTargetDestructable = GetSpellTargetDestructable
97
102
  local isUnitInRangeXY = IsUnitInRangeXY
98
103
  local isUnitInRange = IsUnitInRange
99
- local setResourceAmount = SetResourceAmount
100
- local getResourceAmount = GetResourceAmount
101
104
  local getUnitWeaponRealField = BlzGetUnitWeaponRealField
102
105
  local setUnitWeaponRealField = BlzSetUnitWeaponRealField
103
106
  local getUnitWeaponStringField = BlzGetUnitWeaponStringField
@@ -128,8 +131,6 @@ local isUnitType = IsUnitType
128
131
  local isUnitAlly = IsUnitAlly
129
132
  local isUnitEnemy = IsUnitEnemy
130
133
  local getOwningPlayer = GetOwningPlayer
131
- local setUnitColor = SetUnitColor
132
- local showUnitTeamGlow = BlzShowUnitTeamGlow
133
134
  ____exports.UnitClassification = {}
134
135
  local UnitClassification = ____exports.UnitClassification
135
136
  do
@@ -357,7 +358,14 @@ local function damageEventPreventDeath(self, callback, ...)
357
358
  rawset(self, 1 + i, (select(i, ...)))
358
359
  end
359
360
  end
360
- local damageSetters = {amount = BlzSetEventDamage, attackType = BlzSetEventAttackType, damageType = BlzSetEventDamageType, weaponType = BlzSetEventWeaponType}
361
+ local damageSetters = {
362
+ amount = BlzSetEventDamage,
363
+ attackType = function(attackType)
364
+ return BlzSetEventAttackType(attackTypeToNative(attackType))
365
+ end,
366
+ damageType = BlzSetEventDamageType,
367
+ weaponType = BlzSetEventWeaponType
368
+ }
361
369
  local jlimitopByOperator = {
362
370
  [0] = LESS_THAN_OR_EQUAL,
363
371
  [1] = LESS_THAN_OR_EQUAL,
@@ -639,7 +647,8 @@ local function delayHealthChecksCallback(unit)
639
647
  end
640
648
  end
641
649
  local nextSyncId = 1
642
- local unitBySyncId = setmetatable({}, {__mode = "k"})
650
+ local unitBySyncId = setmetatable({}, {__mode = "v"})
651
+ local damagingEventByTarget = setmetatable({}, {__mode = "k"})
643
652
  ____exports.Unit = __TS__Class()
644
653
  local Unit = ____exports.Unit
645
654
  Unit.name = "Unit"
@@ -680,6 +689,8 @@ function Unit.prototype.getEvent(self, event, collector)
680
689
  end
681
690
  function Unit.prototype.onDestroy(self)
682
691
  local handle = self.handle
692
+ self[107] = getUnitX(handle)
693
+ self[108] = getUnitY(handle)
683
694
  if not self._owner then
684
695
  self._owner = Player:of(getOwningPlayer(handle))
685
696
  end
@@ -795,6 +806,9 @@ function Unit.prototype.playAnimation(self, animation, rarity)
795
806
  setUnitAnimation(self.handle, animation)
796
807
  end
797
808
  end
809
+ function Unit.prototype.resetAnimation(self)
810
+ resetUnitAnimation(self.handle)
811
+ end
798
812
  function Unit.prototype.queueAnimation(self, animation)
799
813
  queueUnitAnimation(self.handle, animation)
800
814
  end
@@ -809,7 +823,7 @@ function Unit.prototype.isSelected(self, player)
809
823
  return IsUnitSelected(self.handle, player.handle)
810
824
  end
811
825
  function Unit.prototype.explode(self)
812
- setUnitExploded(self.handle, true)
826
+ SetUnitExploded(self.handle, true)
813
827
  killUnit(self.handle)
814
828
  end
815
829
  function Unit.prototype.kill(self)
@@ -1286,6 +1300,19 @@ __TS__SetDescriptor(
1286
1300
  },
1287
1301
  true
1288
1302
  )
1303
+ __TS__SetDescriptor(
1304
+ Unit.prototype,
1305
+ "primaryAttribute",
1306
+ {
1307
+ get = function(self)
1308
+ return getUnitIntegerField(self.handle, UNIT_IF_PRIMARY_ATTRIBUTE)
1309
+ end,
1310
+ set = function(self, primaryAttribute)
1311
+ setUnitIntegerField(self.handle, UNIT_IF_PRIMARY_ATTRIBUTE, primaryAttribute)
1312
+ end
1313
+ },
1314
+ true
1315
+ )
1289
1316
  __TS__SetDescriptor(
1290
1317
  Unit.prototype,
1291
1318
  "strengthBase",
@@ -1410,7 +1437,7 @@ __TS__SetDescriptor(
1410
1437
  return not self[106]
1411
1438
  end,
1412
1439
  set = function(self, isTeamGlowVisible)
1413
- showUnitTeamGlow(self.handle, isTeamGlowVisible)
1440
+ BlzShowUnitTeamGlow(self.handle, isTeamGlowVisible)
1414
1441
  local ____temp_6
1415
1442
  if not isTeamGlowVisible then
1416
1443
  ____temp_6 = true
@@ -1426,9 +1453,9 @@ __TS__SetDescriptor(
1426
1453
  Unit.prototype,
1427
1454
  "color",
1428
1455
  {set = function(self, color)
1429
- setUnitColor(self.handle, color.handle)
1456
+ SetUnitColor(self.handle, color.handle)
1430
1457
  if self[106] then
1431
- showUnitTeamGlow(self.handle, false)
1458
+ BlzShowUnitTeamGlow(self.handle, false)
1432
1459
  end
1433
1460
  end},
1434
1461
  true
@@ -1597,7 +1624,7 @@ __TS__SetDescriptor(
1597
1624
  "x",
1598
1625
  {
1599
1626
  get = function(self)
1600
- return getUnitX(self.handle)
1627
+ return self[107] or getUnitX(self.handle)
1601
1628
  end,
1602
1629
  set = function(self, v)
1603
1630
  SetUnitX(self.handle, v)
@@ -1610,7 +1637,7 @@ __TS__SetDescriptor(
1610
1637
  "y",
1611
1638
  {
1612
1639
  get = function(self)
1613
- return getUnitY(self.handle)
1640
+ return self[108] or getUnitY(self.handle)
1614
1641
  end,
1615
1642
  set = function(self, v)
1616
1643
  SetUnitY(self.handle, v)
@@ -1696,10 +1723,10 @@ __TS__SetDescriptor(
1696
1723
  "gold",
1697
1724
  {
1698
1725
  get = function(self)
1699
- return getResourceAmount(self.handle)
1726
+ return GetResourceAmount(self.handle)
1700
1727
  end,
1701
1728
  set = function(self, gold)
1702
- setResourceAmount(self.handle, gold)
1729
+ SetResourceAmount(self.handle, gold)
1703
1730
  end
1704
1731
  },
1705
1732
  true
@@ -1827,6 +1854,19 @@ __TS__SetDescriptor(
1827
1854
  end},
1828
1855
  true
1829
1856
  )
1857
+ __TS__SetDescriptor(
1858
+ Unit.prototype,
1859
+ "movementType",
1860
+ {
1861
+ get = function(self)
1862
+ return getUnitIntegerField(self.handle, UNIT_IF_MOVE_TYPE)
1863
+ end,
1864
+ set = function(self, movementType)
1865
+ setUnitIntegerField(self.handle, UNIT_IF_MOVE_TYPE, movementType)
1866
+ end
1867
+ },
1868
+ true
1869
+ )
1830
1870
  __TS__SetDescriptor(
1831
1871
  Unit.prototype,
1832
1872
  "pathing",
@@ -2369,13 +2409,18 @@ Unit.onDamaging = (function()
2369
2409
  if source and source.typeId == dummyUnitId then
2370
2410
  source = nil
2371
2411
  end
2372
- local target = BlzGetEventDamageTarget()
2412
+ local target = ____exports.Unit:of(BlzGetEventDamageTarget())
2413
+ local metadata = damageMetadataByTarget[target]
2414
+ damageMetadataByTarget[target] = nil
2373
2415
  local data = {
2374
2416
  amount = GetEventDamage(),
2375
- attackType = BlzGetEventAttackType(),
2417
+ attackType = nativeToAttackType(BlzGetEventAttackType()),
2376
2418
  damageType = BlzGetEventDamageType(),
2377
2419
  weaponType = BlzGetEventWeaponType(),
2378
- isAttack = BlzGetEventIsAttack()
2420
+ metadata = metadata,
2421
+ isAttack = BlzGetEventIsAttack(),
2422
+ originalAmount = GetEventDamage(),
2423
+ originalMetadata = metadata
2379
2424
  }
2380
2425
  if data.isAttack and source then
2381
2426
  local weapon = BlzGetUnitWeaponBooleanField(source.handle, UNIT_WEAPON_BF_ATTACKS_ENABLED, 1) and (BlzGetUnitWeaponBooleanField(source.handle, UNIT_WEAPON_BF_ATTACKS_ENABLED, 0) and -1 or 1) or 0
@@ -2389,18 +2434,22 @@ Unit.onDamaging = (function()
2389
2434
  invoke(
2390
2435
  event,
2391
2436
  source,
2392
- ____exports.Unit:of(target),
2437
+ target,
2393
2438
  setmetatable(
2394
2439
  {},
2395
2440
  {
2396
2441
  __index = data,
2397
2442
  __newindex = function(self, key, value)
2398
- damageSetters[key](value)
2443
+ local damageSetter = damageSetters[key]
2444
+ if damageSetter ~= nil then
2445
+ damageSetter(value)
2446
+ end
2399
2447
  data[key] = value
2400
2448
  end
2401
2449
  }
2402
2450
  )
2403
2451
  )
2452
+ damagingEventByTarget[target] = data
2404
2453
  return
2405
2454
  end
2406
2455
  BlzSetEventDamage(0)
@@ -2408,7 +2457,7 @@ Unit.onDamaging = (function()
2408
2457
  BlzSetEventDamageType(DAMAGE_TYPE_UNKNOWN)
2409
2458
  BlzSetEventWeaponType(WEAPON_TYPE_WHOKNOWS)
2410
2459
  local sourceOwner = source.owner.handle
2411
- local targetOwner = GetOwningPlayer(target)
2460
+ local targetOwner = target.owner.handle
2412
2461
  if not GetPlayerAlliance(sourceOwner, targetOwner, ALLIANCE_PASSIVE) then
2413
2462
  SetPlayerAlliance(sourceOwner, targetOwner, ALLIANCE_PASSIVE, true)
2414
2463
  Timer:run(function()
@@ -2424,23 +2473,19 @@ Unit.onDamaging = (function()
2424
2473
  for ____, ____value in ipairs(source._attackHandlers) do
2425
2474
  local condition = ____value[1]
2426
2475
  local action = ____value[2]
2427
- if condition(
2428
- source,
2429
- ____exports.Unit:of(target),
2430
- data
2431
- ) then
2476
+ if condition(source, target, data) then
2432
2477
  action(
2433
2478
  source,
2434
- ____exports.Unit:of(target),
2479
+ target,
2435
2480
  setmetatable(
2436
2481
  {fire = function()
2437
2482
  UnitDamageTarget(
2438
2483
  source.handle,
2439
- target,
2484
+ target.handle,
2440
2485
  data.amount,
2441
2486
  true,
2442
2487
  true,
2443
- data.attackType,
2488
+ attackTypeToNative(data.attackType),
2444
2489
  data.damageType,
2445
2490
  data.weaponType
2446
2491
  )
@@ -2467,13 +2512,18 @@ Unit.onDamage = __TS__New(
2467
2512
  if source and source.typeId == dummyUnitId then
2468
2513
  source = nil
2469
2514
  end
2515
+ local target = ____exports.Unit:of(BlzGetEventDamageTarget())
2516
+ local damagingEvent = damagingEventByTarget[target]
2517
+ damagingEventByTarget[target] = nil
2470
2518
  local data = {
2471
2519
  amount = GetEventDamage(),
2472
- attackType = BlzGetEventAttackType(),
2520
+ attackType = nativeToAttackType(BlzGetEventAttackType()),
2473
2521
  damageType = BlzGetEventDamageType(),
2474
2522
  weaponType = BlzGetEventWeaponType(),
2523
+ metadata = damagingEvent and damagingEvent.metadata,
2475
2524
  isAttack = BlzGetEventIsAttack(),
2476
- originalAmount = GetEventDamage(),
2525
+ originalAmount = damagingEvent and damagingEvent.originalAmount or GetEventDamage(),
2526
+ originalMetadata = damagingEvent and damagingEvent.originalMetadata,
2477
2527
  preventDeath = damageEventPreventDeath
2478
2528
  }
2479
2529
  local evData = setmetatable(
@@ -2486,7 +2536,6 @@ Unit.onDamage = __TS__New(
2486
2536
  end
2487
2537
  }
2488
2538
  )
2489
- local target = ____exports.Unit:of(BlzGetEventDamageTarget())
2490
2539
  invoke(event, source, target, evData)
2491
2540
  if evData[0] ~= nil and target.health - evData.amount < 0.405 then
2492
2541
  local bonusHealth = math.ceil(evData.amount)
@@ -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 ({}))
@@ -1,11 +1,10 @@
1
1
  /** @noSelfInFile */
2
2
  export declare const enum AttackType {
3
- NONE = "unknown",
4
- NORMAL = "normal",
5
- PIERCE = "pierce",
6
- SIEGE = "siege",
7
- SPELL = "spells",
8
- CHAOS = "chaos",
9
- MAGIC = "magic",
10
- HERO = "hero"
3
+ SPELL = 0,
4
+ NORMAL = 1,
5
+ PIERCE = 2,
6
+ SIEGE = 3,
7
+ MAGIC = 4,
8
+ CHAOS = 5,
9
+ HERO = 6
11
10
  }
@@ -1,2 +1,44 @@
1
1
  local ____exports = {}
2
+ local ____records = require("utility.records")
3
+ local invertRecord = ____records.invertRecord
4
+ local stringByAttackType = {
5
+ [1] = "normal",
6
+ [2] = "pierce",
7
+ [3] = "siege",
8
+ [0] = "spells",
9
+ [5] = "chaos",
10
+ [4] = "magic",
11
+ [6] = "hero"
12
+ }
13
+ local attackTypeByString = invertRecord(stringByAttackType)
14
+ local nativeByAttackType = {
15
+ [1] = ATTACK_TYPE_MELEE,
16
+ [2] = ATTACK_TYPE_PIERCE,
17
+ [3] = ATTACK_TYPE_SIEGE,
18
+ [0] = ATTACK_TYPE_NORMAL,
19
+ [5] = ATTACK_TYPE_CHAOS,
20
+ [4] = ATTACK_TYPE_MAGIC,
21
+ [6] = ATTACK_TYPE_HERO
22
+ }
23
+ local attackTypeByNative = invertRecord(nativeByAttackType)
24
+ ---
25
+ -- @internal For use by internal systems only.
26
+ ____exports.attackTypeToString = function(attackType)
27
+ return attackType ~= nil and stringByAttackType[attackType] or "unknown"
28
+ end
29
+ ---
30
+ -- @internal For use by internal systems only.
31
+ ____exports.stringToAttackType = function(____string)
32
+ return attackTypeByString[____string]
33
+ end
34
+ ---
35
+ -- @internal For use by internal systems only.
36
+ ____exports.attackTypeToNative = function(attackType)
37
+ return nativeByAttackType[attackType]
38
+ end
39
+ ---
40
+ -- @internal For use by internal systems only.
41
+ ____exports.nativeToAttackType = function(attackType)
42
+ return attackTypeByNative[attackType]
43
+ end
2
44
  return ____exports
@@ -1,10 +1,10 @@
1
1
  /** @noSelfInFile */
2
2
  export declare const enum MovementType {
3
- NONE = "",
4
- FLOAT = "float",
5
- FLY = "fly",
6
- FOOT = "foot",
7
- HORSE = "horse",
8
- HOVER = "hover",
9
- AMPHIBIOUS = "amph"
3
+ NONE = 0,
4
+ FOOT = 1,
5
+ FLY = 2,
6
+ HORSE = 4,
7
+ HOVER = 8,
8
+ FLOAT = 16,
9
+ AMPHIBIOUS = 32
10
10
  }
@@ -1,2 +1,24 @@
1
1
  local ____exports = {}
2
+ local ____records = require("utility.records")
3
+ local invertRecord = ____records.invertRecord
4
+ local stringByMovementType = {
5
+ [0] = "",
6
+ [16] = "float",
7
+ [2] = "fly",
8
+ [1] = "foot",
9
+ [4] = "horse",
10
+ [8] = "hover",
11
+ [32] = "amph"
12
+ }
13
+ local movementTypeByString = invertRecord(stringByMovementType)
14
+ ---
15
+ -- @internal For use by internal systems only.
16
+ ____exports.movementTypeToString = function(movementType)
17
+ return stringByMovementType[movementType]
18
+ end
19
+ ---
20
+ -- @internal For use by internal systems only.
21
+ ____exports.stringToMovementType = function(____string)
22
+ return movementTypeByString[____string] or 0
23
+ end
2
24
  return ____exports
@@ -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
@@ -0,0 +1,6 @@
1
+ /** @noSelfInFile */
2
+ export declare enum UnitAttribute {
3
+ STRENGTH = 1,
4
+ INTELLIGENCE = 2,
5
+ AGILITY = 3
6
+ }
@@ -0,0 +1,9 @@
1
+ local ____exports = {}
2
+ ____exports.UnitAttribute = UnitAttribute or ({})
3
+ ____exports.UnitAttribute.STRENGTH = 1
4
+ ____exports.UnitAttribute[____exports.UnitAttribute.STRENGTH] = "STRENGTH"
5
+ ____exports.UnitAttribute.INTELLIGENCE = 2
6
+ ____exports.UnitAttribute[____exports.UnitAttribute.INTELLIGENCE] = "INTELLIGENCE"
7
+ ____exports.UnitAttribute.AGILITY = 3
8
+ ____exports.UnitAttribute[____exports.UnitAttribute.AGILITY] = "AGILITY"
9
+ return ____exports
@@ -7,4 +7,6 @@ export declare class BerserkAbilityType extends AbilityType {
7
7
  set movementSpeedIncreaseFactor(movementSpeedIncreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
8
8
  get attackSpeedIncreaseFactor(): number[];
9
9
  set attackSpeedIncreaseFactor(attackSpeedIncreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
10
+ get receivedDamageIncreaseFactor(): number[];
11
+ set receivedDamageIncreaseFactor(receivedDamageIncreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
10
12
  }
@@ -36,4 +36,17 @@ __TS__SetDescriptor(
36
36
  },
37
37
  true
38
38
  )
39
+ __TS__SetDescriptor(
40
+ BerserkAbilityType.prototype,
41
+ "receivedDamageIncreaseFactor",
42
+ {
43
+ get = function(self)
44
+ return self:getNumberLevelField("bsk3")
45
+ end,
46
+ set = function(self, receivedDamageIncreaseFactor)
47
+ self:setNumberLevelField("bsk3", receivedDamageIncreaseFactor)
48
+ end
49
+ },
50
+ true
51
+ )
39
52
  return ____exports
@@ -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
@@ -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
@@ -0,0 +1,10 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityType, AbilityTypeId } from "../ability-type";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ export declare class PhaseShiftAbilityType extends AbilityType {
5
+ static readonly BASE_ID: AbilityTypeId;
6
+ get movementSpeedDecreaseFactor(): number[];
7
+ set movementSpeedDecreaseFactor(movementSpeedDecreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
8
+ get attackSpeedDecreaseFactor(): number[];
9
+ set attackSpeedDecreaseFactor(attackSpeedDecreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
10
+ }