warscript 0.0.1-dev.c8d6bc0 → 0.0.1-dev.c946175

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 (72) hide show
  1. package/attributes.d.ts +0 -1
  2. package/core/types/frame.d.ts +0 -1
  3. package/core/types/group.d.ts +0 -1
  4. package/core/types/image.d.ts +0 -1
  5. package/core/types/missile.d.ts +2 -2
  6. package/core/types/missile.lua +8 -2
  7. package/core/types/unit.lua +8 -0
  8. package/decl/index.d.ts +1 -0
  9. package/engine/ability.d.ts +1 -1
  10. package/engine/behavior.d.ts +10 -10
  11. package/engine/behaviour/ability/apply-unit-behavior.d.ts +6 -1
  12. package/engine/behaviour/ability/instant-impact.lua +4 -0
  13. package/engine/behaviour/ability.d.ts +8 -1
  14. package/engine/behaviour/ability.lua +62 -0
  15. package/engine/behaviour/unit/stun-immunity.d.ts +0 -1
  16. package/engine/behaviour/unit.d.ts +3 -2
  17. package/engine/behaviour/unit.lua +7 -0
  18. package/engine/buff.d.ts +2 -2
  19. package/engine/buff.lua +8 -10
  20. package/engine/internal/unit/bonus.d.ts +5 -6
  21. package/engine/internal/unit-missile-launch.lua +1 -1
  22. package/engine/internal/unit.d.ts +37 -10
  23. package/engine/internal/unit.lua +244 -82
  24. package/engine/object-data/auxiliary/attachment-preset.d.ts +0 -1
  25. package/engine/object-data/auxiliary/combat-classification.d.ts +0 -2
  26. package/engine/object-data/entry/ability-type/blank-configurable.d.ts +0 -1
  27. package/engine/object-data/entry/ability-type/blank-passive.d.ts +0 -1
  28. package/engine/object-data/entry/ability-type/channel.d.ts +0 -1
  29. package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
  30. package/engine/object-data/entry/ability-type/mine.lua +39 -0
  31. package/engine/object-data/entry/ability-type/spirit-touch.d.ts +2 -2
  32. package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
  33. package/engine/object-data/entry/ability-type.d.ts +0 -1
  34. package/engine/object-data/entry/buff-type/applicable.d.ts +0 -1
  35. package/engine/object-data/entry/buff-type/blank.d.ts +0 -1
  36. package/engine/object-data/entry/buff-type.d.ts +0 -1
  37. package/engine/object-data/entry/destructible-type.d.ts +0 -1
  38. package/engine/object-data/entry/item-type/blank.d.ts +0 -1
  39. package/engine/object-data/entry/item-type.d.ts +0 -1
  40. package/engine/object-data/entry/lightning-type.d.ts +0 -1
  41. package/engine/object-data/entry/unit-type.d.ts +21 -2
  42. package/engine/object-data/entry/unit-type.lua +223 -49
  43. package/engine/object-data/entry/upgrade/blank.d.ts +0 -1
  44. package/engine/object-data/entry/upgrade.d.ts +0 -1
  45. package/engine/object-data/entry.d.ts +2 -3
  46. package/engine/object-field/ability.d.ts +1 -1
  47. package/engine/object-field.d.ts +0 -1
  48. package/engine/random.d.ts +1 -0
  49. package/engine/random.lua +9 -0
  50. package/engine/standard/entries/unit-type.d.ts +39 -1
  51. package/engine/standard/entries/unit-type.lua +39 -1
  52. package/engine/standard/fields/ability.d.ts +1 -1
  53. package/engine/standard/fields/ability.lua +1 -1
  54. package/engine/unit.lua +9 -2
  55. package/event.d.ts +2 -3
  56. package/event.lua +9 -5
  57. package/lualib_bundle.lua +139 -40
  58. package/math/vec2.d.ts +2 -9
  59. package/math.d.ts +0 -2
  60. package/objutil/ability.d.ts +0 -1
  61. package/objutil/buff.d.ts +0 -1
  62. package/objutil/object.d.ts +0 -1
  63. package/objutil/unit.d.ts +0 -1
  64. package/package.json +13 -13
  65. package/string.d.ts +30 -0
  66. package/string.lua +14 -0
  67. package/util/stream.d.ts +0 -1
  68. package/utility/arrays.d.ts +3 -4
  69. package/utility/bit-set.d.ts +0 -2
  70. package/utility/linked-set.d.ts +1 -2
  71. package/utility/lua-maps.d.ts +1 -2
  72. package/utility/lua-sets.d.ts +1 -2
@@ -5,9 +5,12 @@ local __TS__ArrayMap = ____lualib.__TS__ArrayMap
5
5
  local __TS__New = ____lualib.__TS__New
6
6
  local __TS__Class = ____lualib.__TS__Class
7
7
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
8
+ local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
8
9
  local __TS__ArraySetLength = ____lualib.__TS__ArraySetLength
10
+ local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
11
+ local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
12
+ local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
9
13
  local __TS__InstanceOf = ____lualib.__TS__InstanceOf
10
- local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
11
14
  local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
12
15
  local Set = ____lualib.Set
13
16
  local __TS__Spread = ____lualib.__TS__Spread
@@ -92,6 +95,10 @@ local isUnitInRangeXY = IsUnitInRangeXY
92
95
  local isUnitInRange = IsUnitInRange
93
96
  local setResourceAmount = SetResourceAmount
94
97
  local getResourceAmount = GetResourceAmount
98
+ local getUnitWeaponRealField = BlzGetUnitWeaponRealField
99
+ local setUnitWeaponRealField = BlzSetUnitWeaponRealField
100
+ local getUnitWeaponStringField = BlzGetUnitWeaponStringField
101
+ local setUnitWeaponStringField = BlzSetUnitWeaponStringField
95
102
  local getUnitAbilityLevel = GetUnitAbilityLevel
96
103
  local unitDisableAbility = BlzUnitDisableAbility
97
104
  local unitInterruptAttack = BlzUnitInterruptAttack
@@ -275,9 +282,8 @@ function UnitTriggerEvent.prototype.____constructor(self, eventType, c)
275
282
  end
276
283
  local function dispatch(event, idGetter, argsGetter)
277
284
  local initialized = false
278
- local x = {}
279
285
  return setmetatable(
280
- x,
286
+ {},
281
287
  {
282
288
  __index = function(self, id)
283
289
  if type(id) ~= "number" then
@@ -387,51 +393,158 @@ local getters = {
387
393
  return BlzGetUnitArmor(unit)
388
394
  end
389
395
  }
390
- local weaponGetters = {
391
- index = function(self, handle, index)
392
- return index
393
- end,
394
- cooldown = function(self, handle, index)
395
- return BlzGetUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, index)
396
- end,
397
- projectileArc = function(self, handle, index)
398
- return BlzGetUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_ARC, index)
399
- end,
400
- projectileArt = function(self, handle, index)
401
- return BlzGetUnitWeaponStringField(handle, UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, index)
402
- end,
403
- projectileSpeed = function(self, handle, index)
404
- return BlzGetUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_SPEED, index)
405
- end,
406
- attackPoint = function(self, handle, index)
407
- return BlzGetUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_DAMAGE_POINT, index)
408
- end
409
- }
410
- local weaponSetters = {
411
- cooldown = function(self, handle, index, value)
412
- assert(BlzSetUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, index, value))
413
- end,
414
- projectileArc = function(self, handle, index, value)
415
- assert(BlzSetUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_ARC, index, value))
416
- end,
417
- projectileArt = function(self, handle, index, value)
418
- assert(BlzSetUnitWeaponStringField(handle, UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, index, value))
419
- end,
420
- projectileSpeed = function(self, handle, index, value)
421
- assert(BlzSetUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_SPEED, index, value))
422
- end,
423
- attackPoint = function(self, handle, index, value)
424
- assert(BlzSetUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_DAMAGE_POINT, index, value))
425
- end
426
- }
427
- local weaponMetatable = {
428
- __index = function(self, key)
429
- return weaponGetters[key](weaponGetters, self.h, self.i)
430
- end,
431
- __newindex = function(self, key, value)
432
- weaponSetters[key](weaponSetters, self.h, self.i, value)
433
- end
434
- }
396
+ ____exports.UnitWeapon = __TS__Class()
397
+ local UnitWeapon = ____exports.UnitWeapon
398
+ UnitWeapon.name = "UnitWeapon"
399
+ function UnitWeapon.prototype.____constructor(self, unit, index)
400
+ self.unit = unit
401
+ self.index = index
402
+ end
403
+ __TS__SetDescriptor(
404
+ UnitWeapon.prototype,
405
+ "cooldown",
406
+ {
407
+ get = function(self)
408
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, self.index)
409
+ end,
410
+ set = function(self, cooldown)
411
+ setUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, self.index, cooldown)
412
+ end
413
+ },
414
+ true
415
+ )
416
+ __TS__SetDescriptor(
417
+ UnitWeapon.prototype,
418
+ "damage",
419
+ {
420
+ get = function(self)
421
+ local minimumDamage = self.damageBase + self.damageDiceCount
422
+ local maximumDamage = self.damageBase + self.damageDiceCount * self.damageDiceSideCount
423
+ return {minimumDamage, maximumDamage}
424
+ end,
425
+ set = function(self, ____bindingPattern0)
426
+ local maximumDamage
427
+ local minimumDamage
428
+ minimumDamage = ____bindingPattern0[1]
429
+ maximumDamage = ____bindingPattern0[2]
430
+ self.damageBase = minimumDamage - 1
431
+ self.damageDiceCount = 1
432
+ self.damageDiceSideCount = maximumDamage - minimumDamage + 1
433
+ end
434
+ },
435
+ true
436
+ )
437
+ __TS__SetDescriptor(
438
+ UnitWeapon.prototype,
439
+ "damageBase",
440
+ {
441
+ get = function(self)
442
+ return BlzGetUnitBaseDamage(self.unit.handle, self.index)
443
+ end,
444
+ set = function(self, damageBase)
445
+ BlzSetUnitBaseDamage(self.unit.handle, self.index, damageBase)
446
+ end
447
+ },
448
+ true
449
+ )
450
+ __TS__SetDescriptor(
451
+ UnitWeapon.prototype,
452
+ "damageDiceCount",
453
+ {
454
+ get = function(self)
455
+ return BlzGetUnitDiceNumber(self.unit.handle, self.index)
456
+ end,
457
+ set = function(self, damageDiceCount)
458
+ BlzSetUnitDiceNumber(self.unit.handle, self.index, damageDiceCount)
459
+ end
460
+ },
461
+ true
462
+ )
463
+ __TS__SetDescriptor(
464
+ UnitWeapon.prototype,
465
+ "damageDiceSideCount",
466
+ {
467
+ get = function(self)
468
+ return BlzGetUnitDiceSides(self.unit.handle, self.index)
469
+ end,
470
+ set = function(self, damageDiceSideCount)
471
+ BlzSetUnitDiceSides(self.unit.handle, self.index, damageDiceSideCount)
472
+ end
473
+ },
474
+ true
475
+ )
476
+ __TS__SetDescriptor(
477
+ UnitWeapon.prototype,
478
+ "range",
479
+ {
480
+ get = function(self)
481
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_RANGE, self.index)
482
+ end,
483
+ set = function(self, range)
484
+ local handle = self.unit.handle
485
+ local index = self.index
486
+ setUnitWeaponRealField(
487
+ handle,
488
+ UNIT_WEAPON_RF_ATTACK_RANGE,
489
+ index + 1,
490
+ getUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_RANGE, index + 1) + (range - getUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_RANGE, index))
491
+ )
492
+ end
493
+ },
494
+ true
495
+ )
496
+ __TS__SetDescriptor(
497
+ UnitWeapon.prototype,
498
+ "impactDelay",
499
+ {
500
+ get = function(self)
501
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_DAMAGE_POINT, self.index)
502
+ end,
503
+ set = function(self, impactDelay)
504
+ setUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_DAMAGE_POINT, self.index, impactDelay)
505
+ end
506
+ },
507
+ true
508
+ )
509
+ __TS__SetDescriptor(
510
+ UnitWeapon.prototype,
511
+ "missileArc",
512
+ {
513
+ get = function(self)
514
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_ARC, self.index)
515
+ end,
516
+ set = function(self, missileArc)
517
+ setUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_ARC, self.index, missileArc)
518
+ end
519
+ },
520
+ true
521
+ )
522
+ __TS__SetDescriptor(
523
+ UnitWeapon.prototype,
524
+ "missileModelPath",
525
+ {
526
+ get = function(self)
527
+ return getUnitWeaponStringField(self.unit.handle, UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, self.index)
528
+ end,
529
+ set = function(self, missileModelPath)
530
+ setUnitWeaponStringField(self.unit.handle, UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, self.index, missileModelPath)
531
+ end
532
+ },
533
+ true
534
+ )
535
+ __TS__SetDescriptor(
536
+ UnitWeapon.prototype,
537
+ "missileSpeed",
538
+ {
539
+ get = function(self)
540
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_SPEED, self.index)
541
+ end,
542
+ set = function(self, missileSpeed)
543
+ setUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_SPEED, self.index, missileSpeed)
544
+ end
545
+ },
546
+ true
547
+ )
435
548
  local unitInventorySize = UnitInventorySize
436
549
  local unitItemInSlot = UnitItemInSlot
437
550
  local getItemAbility = BlzGetItemAbility
@@ -442,8 +555,6 @@ local getAbilityName = GetAbilityName
442
555
  local unitAddAbility = UnitAddAbility
443
556
  local getUnitGoldCost = GetUnitGoldCost
444
557
  local getUnitLumberCost = GetUnitWoodCost
445
- local unitMakeAbilityPermanent = UnitMakeAbilityPermanent
446
- local unitAddItem = UnitAddItem
447
558
  local unitRemoveAbility = UnitRemoveAbility
448
559
  local function retrieveAbility(unit, ability, abilityId)
449
560
  if ability == nil then
@@ -520,6 +631,23 @@ for ____, player in ipairs(Player.all) do
520
631
  ShowUnit(dummy, false)
521
632
  dummies[player] = dummy
522
633
  end
634
+ local function delayHealthChecksCallback(unit)
635
+ local counter = (unit[102] or 0) - 1
636
+ if counter ~= 0 then
637
+ unit[102] = counter
638
+ return
639
+ end
640
+ unit[102] = nil
641
+ local healthBonus = unit[103]
642
+ if healthBonus ~= nil then
643
+ unit[103] = nil
644
+ local handle = unit.handle
645
+ BlzSetUnitMaxHP(
646
+ handle,
647
+ BlzGetUnitMaxHP(handle) - healthBonus
648
+ )
649
+ end
650
+ end
523
651
  ____exports.Unit = __TS__Class()
524
652
  local Unit = ____exports.Unit
525
653
  Unit.name = "Unit"
@@ -674,6 +802,10 @@ end
674
802
  function Unit.prototype.queueAnimation(self, animation)
675
803
  queueUnitAnimation(self.handle, animation)
676
804
  end
805
+ function Unit.prototype.delayHealthChecks(self)
806
+ self[102] = (self[102] or 0) + 1
807
+ Timer:run(delayHealthChecksCallback, self)
808
+ end
677
809
  function Unit.prototype.setPosition(self, x, y)
678
810
  setUnitPosition(self.handle, x, y)
679
811
  end
@@ -687,8 +819,15 @@ end
687
819
  function Unit.prototype.kill(self)
688
820
  killUnit(self.handle)
689
821
  end
690
- function Unit.prototype.revive(self, pos, doEffect)
691
- ReviveHero(self.handle, pos.x, pos.y, doEffect)
822
+ function Unit.prototype.revive(self, x, y, doEffect)
823
+ local ____ReviveHero_4 = ReviveHero
824
+ local ____array_3 = __TS__SparseArrayNew(self.handle, x, y)
825
+ local ____doEffect_2 = doEffect
826
+ if ____doEffect_2 == nil then
827
+ ____doEffect_2 = false
828
+ end
829
+ __TS__SparseArrayPush(____array_3, ____doEffect_2)
830
+ ____ReviveHero_4(__TS__SparseArraySpread(____array_3))
692
831
  end
693
832
  function Unit.prototype.healTarget(self, target, amount)
694
833
  if __TS__InstanceOf(target, ____exports.Unit) and target:hasAbility(fourCC("BIhm")) then
@@ -784,6 +923,9 @@ end
784
923
  function Unit.prototype.hideAbility(self, abilityId, flag)
785
924
  BlzUnitHideAbility(self.handle, abilityId, flag)
786
925
  end
926
+ function Unit.prototype.getAbilityRemainingCooldown(self, abilityId)
927
+ return BlzGetUnitAbilityCooldownRemaining(self.handle, abilityId)
928
+ end
787
929
  function Unit.prototype.startAbilityCooldown(self, abilityId, cooldown)
788
930
  BlzStartUnitAbilityCooldown(self.handle, abilityId, cooldown)
789
931
  end
@@ -1071,12 +1213,27 @@ __TS__SetDescriptor(
1071
1213
  Unit.prototype,
1072
1214
  "weapons",
1073
1215
  {get = function(self)
1074
- local weapons = {
1075
- setmetatable({h = self.handle, i = 0}, weaponMetatable),
1076
- setmetatable({h = self.handle, i = 1}, weaponMetatable)
1077
- }
1078
- rawset(self, "weapons", weapons)
1079
- return weapons
1216
+ return {self.firstWeapon, self.secondWeapon}
1217
+ end},
1218
+ true
1219
+ )
1220
+ __TS__SetDescriptor(
1221
+ Unit.prototype,
1222
+ "firstWeapon",
1223
+ {get = function(self)
1224
+ local weapon = __TS__New(____exports.UnitWeapon, self, 0)
1225
+ rawset(self, "firstWeapon", weapon)
1226
+ return weapon
1227
+ end},
1228
+ true
1229
+ )
1230
+ __TS__SetDescriptor(
1231
+ Unit.prototype,
1232
+ "secondWeapon",
1233
+ {get = function(self)
1234
+ local weapon = __TS__New(____exports.UnitWeapon, self, 1)
1235
+ rawset(self, "secondWeapon", weapon)
1236
+ return weapon
1080
1237
  end},
1081
1238
  true
1082
1239
  )
@@ -1233,17 +1390,17 @@ __TS__SetDescriptor(
1233
1390
  "isTeamGlowVisible",
1234
1391
  {
1235
1392
  get = function(self)
1236
- return not self[103]
1393
+ return not self[105]
1237
1394
  end,
1238
1395
  set = function(self, isTeamGlowVisible)
1239
1396
  showUnitTeamGlow(self.handle, isTeamGlowVisible)
1240
- local ____temp_2
1397
+ local ____temp_5
1241
1398
  if not isTeamGlowVisible then
1242
- ____temp_2 = true
1399
+ ____temp_5 = true
1243
1400
  else
1244
- ____temp_2 = nil
1401
+ ____temp_5 = nil
1245
1402
  end
1246
- self[103] = ____temp_2
1403
+ self[105] = ____temp_5
1247
1404
  end
1248
1405
  },
1249
1406
  true
@@ -1253,7 +1410,7 @@ __TS__SetDescriptor(
1253
1410
  "color",
1254
1411
  {set = function(self, color)
1255
1412
  setUnitColor(self.handle, color.handle)
1256
- if self[103] then
1413
+ if self[105] then
1257
1414
  showUnitTeamGlow(self.handle, false)
1258
1415
  end
1259
1416
  end},
@@ -1277,10 +1434,14 @@ __TS__SetDescriptor(
1277
1434
  "maxHealth",
1278
1435
  {
1279
1436
  get = function(self)
1280
- return BlzGetUnitMaxHP(self.handle) - (self[102] or 0)
1437
+ return BlzGetUnitMaxHP(self.handle) - (self[103] or 0) - (self[104] or 0)
1281
1438
  end,
1282
1439
  set = function(self, maxHealth)
1283
- BlzSetUnitMaxHP(self.handle, maxHealth + (self[102] or 0))
1440
+ if maxHealth < 1 and self[102] ~= nil then
1441
+ self[103] = (self[103] or 0) + (1 - maxHealth)
1442
+ maxHealth = 1
1443
+ end
1444
+ BlzSetUnitMaxHP(self.handle, maxHealth + (self[104] or 0))
1284
1445
  end
1285
1446
  },
1286
1447
  true
@@ -1322,10 +1483,10 @@ __TS__SetDescriptor(
1322
1483
  "health",
1323
1484
  {
1324
1485
  get = function(self)
1325
- return GetWidgetLife(self.handle) - (self[102] or 0)
1486
+ return GetWidgetLife(self.handle) - (self[104] or 0)
1326
1487
  end,
1327
1488
  set = function(self, health)
1328
- SetWidgetLife(self.handle, health + (self[102] or 0))
1489
+ SetWidgetLife(self.handle, health + (self[104] or 0))
1329
1490
  end
1330
1491
  },
1331
1492
  true
@@ -1920,8 +2081,9 @@ Unit.morphEvent = __TS__New(
1920
2081
  InitializingEvent,
1921
2082
  function(event)
1922
2083
  ____exports.Unit.onImmediateOrder[orderId("undefend")]:addListener(function(unit)
1923
- if getUnitAbilityLevel(unit.handle, morphDetectAbilityId) == 0 then
1924
- assert(unitAddAbility(unit.handle, morphDetectAbilityId))
2084
+ local handle = unit.handle
2085
+ if getUnitAbilityLevel(handle, morphDetectAbilityId) == 0 and getUnitAbilityLevel(handle, leaveDetectAbilityId) ~= 0 then
2086
+ assert(unitAddAbility(handle, morphDetectAbilityId))
1925
2087
  Timer:run(Event.invoke, event, unit)
1926
2088
  end
1927
2089
  end)
@@ -1962,25 +2124,25 @@ Unit.onTargetCast = dispatchId(__TS__New(
1962
2124
  function(event)
1963
2125
  local invoke = Event.invoke
1964
2126
  local function listener(unit, id)
1965
- local ____GetSpellTargetUnit_result_5
2127
+ local ____GetSpellTargetUnit_result_8
1966
2128
  if GetSpellTargetUnit() then
1967
- ____GetSpellTargetUnit_result_5 = ____exports.Unit:of(GetSpellTargetUnit())
2129
+ ____GetSpellTargetUnit_result_8 = ____exports.Unit:of(GetSpellTargetUnit())
1968
2130
  else
1969
- local ____GetSpellTargetItem_result_4
2131
+ local ____GetSpellTargetItem_result_7
1970
2132
  if GetSpellTargetItem() then
1971
- ____GetSpellTargetItem_result_4 = Item:of(GetSpellTargetItem())
2133
+ ____GetSpellTargetItem_result_7 = Item:of(GetSpellTargetItem())
1972
2134
  else
1973
- local ____GetSpellTargetDestructable_result_3
2135
+ local ____GetSpellTargetDestructable_result_6
1974
2136
  if GetSpellTargetDestructable() then
1975
- ____GetSpellTargetDestructable_result_3 = Destructable:of(GetSpellTargetDestructable())
2137
+ ____GetSpellTargetDestructable_result_6 = Destructable:of(GetSpellTargetDestructable())
1976
2138
  else
1977
- ____GetSpellTargetDestructable_result_3 = nil
2139
+ ____GetSpellTargetDestructable_result_6 = nil
1978
2140
  end
1979
- ____GetSpellTargetItem_result_4 = ____GetSpellTargetDestructable_result_3
2141
+ ____GetSpellTargetItem_result_7 = ____GetSpellTargetDestructable_result_6
1980
2142
  end
1981
- ____GetSpellTargetUnit_result_5 = ____GetSpellTargetItem_result_4
2143
+ ____GetSpellTargetUnit_result_8 = ____GetSpellTargetItem_result_7
1982
2144
  end
1983
- local target = ____GetSpellTargetUnit_result_5
2145
+ local target = ____GetSpellTargetUnit_result_8
1984
2146
  if target then
1985
2147
  invoke(event, unit, id, target)
1986
2148
  end
@@ -2308,7 +2470,7 @@ Unit.onDamage = __TS__New(
2308
2470
  invoke(event, source, target, evData)
2309
2471
  if evData[0] ~= nil and target.health - evData.amount < 0.405 then
2310
2472
  local bonusHealth = math.ceil(evData.amount)
2311
- target[102] = (target[102] or 0) + bonusHealth
2473
+ target[104] = (target[104] or 0) + bonusHealth
2312
2474
  BlzSetUnitMaxHP(
2313
2475
  target.handle,
2314
2476
  BlzGetUnitMaxHP(target.handle) + bonusHealth
@@ -2322,7 +2484,7 @@ Unit.onDamage = __TS__New(
2322
2484
  evData[0],
2323
2485
  table.unpack(evData, 1 + 1, 1 + (evData[1] or 0))
2324
2486
  )
2325
- target[102] = (target[102] or 0) - bonusHealth
2487
+ target[104] = (target[104] or 0) - bonusHealth
2326
2488
  SetWidgetLife(
2327
2489
  target.handle,
2328
2490
  GetWidgetLife(target.handle) - bonusHealth
@@ -1,4 +1,3 @@
1
- /// <reference types="@typescript-to-lua/language-extensions" />
2
1
  /** @noSelfInFile */
3
2
  import { ModelNodeName } from "./model-node-name";
4
3
  import { ModelNodeQualifier } from "./model-node-qualifier";
@@ -1,5 +1,3 @@
1
- /// <reference types="@warscript/language-extensions" />
2
- /// <reference types="@typescript-to-lua/language-extensions" />
3
1
  /** @noSelfInFile */
4
2
  export declare const enum CombatClassification {
5
3
  NONE = 1,// 2^0
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { ChannelAbilityType, ChannelAbilityTypeTargetingType } from "./channel";
4
3
  import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { DiseaseCloudAbilityType } from "./disease-cloud";
4
3
  export declare class BlankPassiveAbilityType extends DiseaseCloudAbilityType {
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { AbilityType, AbilityTypeId } from "../ability-type";
4
3
  import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
@@ -0,0 +1,10 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityType, AbilityTypeId } from "../ability-type";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ export declare class MineAbilityType extends AbilityType {
5
+ static readonly BASE_ID: AbilityTypeId;
6
+ get activationDelay(): number[];
7
+ set activationDelay(activationDelay: ObjectDataEntryLevelFieldValueSupplier<number>);
8
+ get invisibilityDelay(): number[];
9
+ set invisibilityDelay(invisibilityDelay: ObjectDataEntryLevelFieldValueSupplier<number>);
10
+ }
@@ -0,0 +1,39 @@
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.MineAbilityType = __TS__Class()
9
+ local MineAbilityType = ____exports.MineAbilityType
10
+ MineAbilityType.name = "MineAbilityType"
11
+ __TS__ClassExtends(MineAbilityType, AbilityType)
12
+ MineAbilityType.BASE_ID = fourCC("Amin")
13
+ __TS__SetDescriptor(
14
+ MineAbilityType.prototype,
15
+ "activationDelay",
16
+ {
17
+ get = function(self)
18
+ return self:getNumberLevelField("Min1")
19
+ end,
20
+ set = function(self, activationDelay)
21
+ self:setNumberLevelField("Min1", activationDelay)
22
+ end
23
+ },
24
+ true
25
+ )
26
+ __TS__SetDescriptor(
27
+ MineAbilityType.prototype,
28
+ "invisibilityDelay",
29
+ {
30
+ get = function(self)
31
+ return self:getNumberLevelField("Min2")
32
+ end,
33
+ set = function(self, invisibilityDelay)
34
+ self:setNumberLevelField("Min2", invisibilityDelay)
35
+ end
36
+ },
37
+ true
38
+ )
39
+ return ____exports
@@ -7,8 +7,8 @@ export declare class SpiritTouchAbilityType extends AbilityType {
7
7
  set manaGain(manaGain: ObjectDataEntryLevelFieldValueSupplier<number>);
8
8
  get manaRequirement(): number[];
9
9
  set manaRequirement(manaRequirement: ObjectDataEntryLevelFieldValueSupplier<number>);
10
- get maximumTargetCount(): number[];
11
- set maximumTargetCount(maximumTargetCount: ObjectDataEntryLevelFieldValueSupplier<number>);
12
10
  get maximumManaCostFactor(): number[];
13
11
  set maximumManaCostFactor(maximumManaCostFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
12
+ get maximumTargetCount(): number[];
13
+ set maximumTargetCount(maximumTargetCount: ObjectDataEntryLevelFieldValueSupplier<number>);
14
14
  }
@@ -38,26 +38,26 @@ __TS__SetDescriptor(
38
38
  )
39
39
  __TS__SetDescriptor(
40
40
  SpiritTouchAbilityType.prototype,
41
- "maximumTargetCount",
41
+ "maximumManaCostFactor",
42
42
  {
43
43
  get = function(self)
44
44
  return self:getNumberLevelField("Rpb5")
45
45
  end,
46
- set = function(self, maximumTargetCount)
47
- self:setNumberLevelField("Rpb5", maximumTargetCount)
46
+ set = function(self, maximumManaCostFactor)
47
+ self:setNumberLevelField("Rpb5", maximumManaCostFactor)
48
48
  end
49
49
  },
50
50
  true
51
51
  )
52
52
  __TS__SetDescriptor(
53
53
  SpiritTouchAbilityType.prototype,
54
- "maximumManaCostFactor",
54
+ "maximumTargetCount",
55
55
  {
56
56
  get = function(self)
57
57
  return self:getNumberLevelField("Rpb6")
58
58
  end,
59
- set = function(self, maximumManaCostFactor)
60
- self:setNumberLevelField("Rpb6", maximumManaCostFactor)
59
+ set = function(self, maximumTargetCount)
60
+ self:setNumberLevelField("Rpb6", maximumTargetCount)
61
61
  end
62
62
  },
63
63
  true
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import "../../internal/unit/ability";
4
3
  import { TupleOf } from "../../../utility/types";
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { BuffPolarity } from "../../auxiliary/buff-polarity";
4
3
  import { BuffResistanceType } from "../../auxiliary/buff-resistance-type";
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { BuffType, BuffTypeId } from "../buff-type";
4
3
  export declare class BlankBuffType extends BuffType {
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { TupleOf } from "../../../utility/types";
4
3
  import { AttachmentPreset, AttachmentPresetInput } from "../auxiliary/attachment-preset";
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { ArmorSoundType } from "../auxiliary/armor-sound-type";
4
3
  import { CombatClassifications } from "../auxiliary/combat-classification";
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { ItemType, ItemTypeId } from "../item-type";
4
3
  export declare class BlankItemType extends ItemType {
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { ArmorSoundType } from "../auxiliary/armor-sound-type";
4
3
  import { ObjectDataEntry, ObjectDataEntryId } from "../entry";
@@ -1,4 +1,3 @@
1
- /// <reference types="warpack-types/warpack" />
2
1
  /** @noSelfInFile */
3
2
  import { ObjectDataEntry, ObjectDataEntryConstructor, ObjectDataEntryId } from "../entry";
4
3
  import { Color } from "../../../core/types/color";