warscript 0.0.1-dev.ba37a78 → 0.0.1-dev.bb34489

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/attributes.d.ts +12 -0
  2. package/attributes.lua +16 -0
  3. package/core/types/frame.d.ts +0 -1
  4. package/core/types/group.d.ts +0 -1
  5. package/core/types/handle.d.ts +2 -1
  6. package/core/types/handle.lua +5 -2
  7. package/core/types/image.d.ts +0 -1
  8. package/core/types/missile.d.ts +2 -2
  9. package/core/types/missile.lua +8 -2
  10. package/core/types/unit.lua +8 -0
  11. package/decl/index.d.ts +1 -0
  12. package/engine/ability.d.ts +1 -1
  13. package/engine/behavior.d.ts +10 -10
  14. package/engine/behaviour/ability/apply-unit-behavior.d.ts +5 -1
  15. package/engine/behaviour/ability/instant-impact.lua +4 -0
  16. package/engine/behaviour/ability.d.ts +8 -1
  17. package/engine/behaviour/ability.lua +62 -0
  18. package/engine/behaviour/unit/stun-immunity.d.ts +0 -1
  19. package/engine/behaviour/unit.d.ts +3 -2
  20. package/engine/behaviour/unit.lua +7 -0
  21. package/engine/buff.d.ts +2 -2
  22. package/engine/buff.lua +8 -10
  23. package/engine/internal/unit/bonus.d.ts +5 -6
  24. package/engine/internal/unit-missile-launch.lua +1 -1
  25. package/engine/internal/unit.d.ts +37 -10
  26. package/engine/internal/unit.lua +241 -90
  27. package/engine/object-data/auxiliary/attachment-preset.d.ts +0 -1
  28. package/engine/object-data/auxiliary/combat-classification.d.ts +0 -2
  29. package/engine/object-data/entry/ability-type/blank-configurable.d.ts +0 -1
  30. package/engine/object-data/entry/ability-type/blank-passive.d.ts +0 -1
  31. package/engine/object-data/entry/ability-type/channel.d.ts +0 -1
  32. package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
  33. package/engine/object-data/entry/ability-type/mine.lua +39 -0
  34. package/engine/object-data/entry/ability-type/spirit-touch.d.ts +2 -2
  35. package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
  36. package/engine/object-data/entry/ability-type.d.ts +0 -1
  37. package/engine/object-data/entry/buff-type/applicable.d.ts +0 -1
  38. package/engine/object-data/entry/buff-type/blank.d.ts +0 -1
  39. package/engine/object-data/entry/buff-type.d.ts +0 -1
  40. package/engine/object-data/entry/destructible-type.d.ts +0 -1
  41. package/engine/object-data/entry/item-type/blank.d.ts +0 -1
  42. package/engine/object-data/entry/item-type.d.ts +0 -1
  43. package/engine/object-data/entry/lightning-type.d.ts +0 -1
  44. package/engine/object-data/entry/unit-type.d.ts +42 -2
  45. package/engine/object-data/entry/unit-type.lua +378 -50
  46. package/engine/object-data/entry/upgrade/blank.d.ts +0 -1
  47. package/engine/object-data/entry/upgrade.d.ts +0 -1
  48. package/engine/object-data/entry.d.ts +2 -3
  49. package/engine/object-field/ability.d.ts +1 -1
  50. package/engine/object-field.d.ts +0 -1
  51. package/engine/random.d.ts +1 -0
  52. package/engine/random.lua +9 -0
  53. package/engine/standard/entries/unit-type.d.ts +42 -1
  54. package/engine/standard/entries/unit-type.lua +42 -1
  55. package/engine/standard/fields/ability.d.ts +1 -1
  56. package/engine/standard/fields/ability.lua +1 -1
  57. package/engine/unit.lua +9 -2
  58. package/event.d.ts +2 -3
  59. package/event.lua +9 -5
  60. package/lualib_bundle.lua +139 -40
  61. package/math/vec2.d.ts +2 -9
  62. package/math.d.ts +0 -2
  63. package/objutil/ability.d.ts +0 -1
  64. package/objutil/buff.d.ts +0 -1
  65. package/objutil/object.d.ts +0 -1
  66. package/objutil/unit.d.ts +0 -1
  67. package/package.json +13 -14
  68. package/string.d.ts +30 -0
  69. package/string.lua +14 -0
  70. package/util/stream.d.ts +0 -1
  71. package/utility/arrays.d.ts +3 -4
  72. package/utility/bit-set.d.ts +0 -2
  73. package/utility/linked-set.d.ts +1 -2
  74. package/utility/lua-maps.d.ts +1 -2
  75. package/utility/lua-sets.d.ts +1 -2
  76. package/utility/types.d.ts +2 -2
@@ -5,9 +5,11 @@ 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__ArraySetLength = ____lualib.__TS__ArraySetLength
9
- local __TS__InstanceOf = ____lualib.__TS__InstanceOf
10
8
  local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
9
+ local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
10
+ local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
11
+ local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
12
+ local __TS__InstanceOf = ____lualib.__TS__InstanceOf
11
13
  local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
12
14
  local Set = ____lualib.Set
13
15
  local __TS__Spread = ____lualib.__TS__Spread
@@ -92,6 +94,10 @@ local isUnitInRangeXY = IsUnitInRangeXY
92
94
  local isUnitInRange = IsUnitInRange
93
95
  local setResourceAmount = SetResourceAmount
94
96
  local getResourceAmount = GetResourceAmount
97
+ local getUnitWeaponRealField = BlzGetUnitWeaponRealField
98
+ local setUnitWeaponRealField = BlzSetUnitWeaponRealField
99
+ local getUnitWeaponStringField = BlzGetUnitWeaponStringField
100
+ local setUnitWeaponStringField = BlzSetUnitWeaponStringField
95
101
  local getUnitAbilityLevel = GetUnitAbilityLevel
96
102
  local unitDisableAbility = BlzUnitDisableAbility
97
103
  local unitInterruptAttack = BlzUnitInterruptAttack
@@ -275,9 +281,8 @@ function UnitTriggerEvent.prototype.____constructor(self, eventType, c)
275
281
  end
276
282
  local function dispatch(event, idGetter, argsGetter)
277
283
  local initialized = false
278
- local x = {}
279
284
  return setmetatable(
280
- x,
285
+ {},
281
286
  {
282
287
  __index = function(self, id)
283
288
  if type(id) ~= "number" then
@@ -387,51 +392,158 @@ local getters = {
387
392
  return BlzGetUnitArmor(unit)
388
393
  end
389
394
  }
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
- }
395
+ ____exports.UnitWeapon = __TS__Class()
396
+ local UnitWeapon = ____exports.UnitWeapon
397
+ UnitWeapon.name = "UnitWeapon"
398
+ function UnitWeapon.prototype.____constructor(self, unit, index)
399
+ self.unit = unit
400
+ self.index = index
401
+ end
402
+ __TS__SetDescriptor(
403
+ UnitWeapon.prototype,
404
+ "cooldown",
405
+ {
406
+ get = function(self)
407
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, self.index)
408
+ end,
409
+ set = function(self, cooldown)
410
+ setUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, self.index, cooldown)
411
+ end
412
+ },
413
+ true
414
+ )
415
+ __TS__SetDescriptor(
416
+ UnitWeapon.prototype,
417
+ "damage",
418
+ {
419
+ get = function(self)
420
+ local minimumDamage = self.damageBase + self.damageDiceCount
421
+ local maximumDamage = self.damageBase + self.damageDiceCount * self.damageDiceSideCount
422
+ return {minimumDamage, maximumDamage}
423
+ end,
424
+ set = function(self, ____bindingPattern0)
425
+ local maximumDamage
426
+ local minimumDamage
427
+ minimumDamage = ____bindingPattern0[1]
428
+ maximumDamage = ____bindingPattern0[2]
429
+ self.damageBase = minimumDamage - 1
430
+ self.damageDiceCount = 1
431
+ self.damageDiceSideCount = maximumDamage - minimumDamage + 1
432
+ end
433
+ },
434
+ true
435
+ )
436
+ __TS__SetDescriptor(
437
+ UnitWeapon.prototype,
438
+ "damageBase",
439
+ {
440
+ get = function(self)
441
+ return BlzGetUnitBaseDamage(self.unit.handle, self.index)
442
+ end,
443
+ set = function(self, damageBase)
444
+ BlzSetUnitBaseDamage(self.unit.handle, self.index, damageBase)
445
+ end
446
+ },
447
+ true
448
+ )
449
+ __TS__SetDescriptor(
450
+ UnitWeapon.prototype,
451
+ "damageDiceCount",
452
+ {
453
+ get = function(self)
454
+ return BlzGetUnitDiceNumber(self.unit.handle, self.index)
455
+ end,
456
+ set = function(self, damageDiceCount)
457
+ BlzSetUnitDiceNumber(self.unit.handle, self.index, damageDiceCount)
458
+ end
459
+ },
460
+ true
461
+ )
462
+ __TS__SetDescriptor(
463
+ UnitWeapon.prototype,
464
+ "damageDiceSideCount",
465
+ {
466
+ get = function(self)
467
+ return BlzGetUnitDiceSides(self.unit.handle, self.index)
468
+ end,
469
+ set = function(self, damageDiceSideCount)
470
+ BlzSetUnitDiceSides(self.unit.handle, self.index, damageDiceSideCount)
471
+ end
472
+ },
473
+ true
474
+ )
475
+ __TS__SetDescriptor(
476
+ UnitWeapon.prototype,
477
+ "range",
478
+ {
479
+ get = function(self)
480
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_RANGE, self.index)
481
+ end,
482
+ set = function(self, range)
483
+ local handle = self.unit.handle
484
+ local index = self.index
485
+ setUnitWeaponRealField(
486
+ handle,
487
+ UNIT_WEAPON_RF_ATTACK_RANGE,
488
+ index + 1,
489
+ getUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_RANGE, index + 1) + (range - getUnitWeaponRealField(handle, UNIT_WEAPON_RF_ATTACK_RANGE, index))
490
+ )
491
+ end
492
+ },
493
+ true
494
+ )
495
+ __TS__SetDescriptor(
496
+ UnitWeapon.prototype,
497
+ "impactDelay",
498
+ {
499
+ get = function(self)
500
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_DAMAGE_POINT, self.index)
501
+ end,
502
+ set = function(self, impactDelay)
503
+ setUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_DAMAGE_POINT, self.index, impactDelay)
504
+ end
505
+ },
506
+ true
507
+ )
508
+ __TS__SetDescriptor(
509
+ UnitWeapon.prototype,
510
+ "missileArc",
511
+ {
512
+ get = function(self)
513
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_ARC, self.index)
514
+ end,
515
+ set = function(self, missileArc)
516
+ setUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_ARC, self.index, missileArc)
517
+ end
518
+ },
519
+ true
520
+ )
521
+ __TS__SetDescriptor(
522
+ UnitWeapon.prototype,
523
+ "missileModelPath",
524
+ {
525
+ get = function(self)
526
+ return getUnitWeaponStringField(self.unit.handle, UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, self.index)
527
+ end,
528
+ set = function(self, missileModelPath)
529
+ setUnitWeaponStringField(self.unit.handle, UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART, self.index, missileModelPath)
530
+ end
531
+ },
532
+ true
533
+ )
534
+ __TS__SetDescriptor(
535
+ UnitWeapon.prototype,
536
+ "missileSpeed",
537
+ {
538
+ get = function(self)
539
+ return getUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_SPEED, self.index)
540
+ end,
541
+ set = function(self, missileSpeed)
542
+ setUnitWeaponRealField(self.unit.handle, UNIT_WEAPON_RF_ATTACK_PROJECTILE_SPEED, self.index, missileSpeed)
543
+ end
544
+ },
545
+ true
546
+ )
435
547
  local unitInventorySize = UnitInventorySize
436
548
  local unitItemInSlot = UnitItemInSlot
437
549
  local getItemAbility = BlzGetItemAbility
@@ -442,8 +554,6 @@ local getAbilityName = GetAbilityName
442
554
  local unitAddAbility = UnitAddAbility
443
555
  local getUnitGoldCost = GetUnitGoldCost
444
556
  local getUnitLumberCost = GetUnitWoodCost
445
- local unitMakeAbilityPermanent = UnitMakeAbilityPermanent
446
- local unitAddItem = UnitAddItem
447
557
  local unitRemoveAbility = UnitRemoveAbility
448
558
  local function retrieveAbility(unit, ability, abilityId)
449
559
  if ability == nil then
@@ -520,6 +630,23 @@ for ____, player in ipairs(Player.all) do
520
630
  ShowUnit(dummy, false)
521
631
  dummies[player] = dummy
522
632
  end
633
+ local function delayHealthChecksCallback(unit)
634
+ local counter = (unit[102] or 0) - 1
635
+ if counter ~= 0 then
636
+ unit[102] = counter
637
+ return
638
+ end
639
+ unit[102] = nil
640
+ local healthBonus = unit[103]
641
+ if healthBonus ~= nil then
642
+ unit[103] = nil
643
+ local handle = unit.handle
644
+ BlzSetUnitMaxHP(
645
+ handle,
646
+ BlzGetUnitMaxHP(handle) - healthBonus
647
+ )
648
+ end
649
+ end
523
650
  ____exports.Unit = __TS__Class()
524
651
  local Unit = ____exports.Unit
525
652
  Unit.name = "Unit"
@@ -559,11 +686,6 @@ function Unit.prototype.onDestroy(self)
559
686
  if not self._owner then
560
687
  self._owner = Player:of(getOwningPlayer(handle))
561
688
  end
562
- local abilities = self.abilities
563
- for ____, ability in ipairs(abilities) do
564
- ability:destroy()
565
- end
566
- __TS__ArraySetLength(abilities, 0)
567
689
  for ____, player in ipairs(Player.all) do
568
690
  if self:isSelected(player) then
569
691
  Event.invoke(____exports.Unit.onDeselect, self, player)
@@ -578,10 +700,6 @@ function Unit.prototype.onDestroy(self)
578
700
  if eventsToDestroy ~= nil then
579
701
  forEach(eventsToDestroy, "destroy")
580
702
  end
581
- if getUnitAbilityLevel(handle, leaveDetectAbilityId) > 0 then
582
- unitRemoveAbility(handle, leaveDetectAbilityId)
583
- removeUnit(handle)
584
- end
585
703
  return Handle.prototype.onDestroy(self)
586
704
  end
587
705
  function Unit.prototype.addAttackHandler(self, condition, action)
@@ -674,6 +792,10 @@ end
674
792
  function Unit.prototype.queueAnimation(self, animation)
675
793
  queueUnitAnimation(self.handle, animation)
676
794
  end
795
+ function Unit.prototype.delayHealthChecks(self)
796
+ self[102] = (self[102] or 0) + 1
797
+ Timer:run(delayHealthChecksCallback, self)
798
+ end
677
799
  function Unit.prototype.setPosition(self, x, y)
678
800
  setUnitPosition(self.handle, x, y)
679
801
  end
@@ -687,8 +809,15 @@ end
687
809
  function Unit.prototype.kill(self)
688
810
  killUnit(self.handle)
689
811
  end
690
- function Unit.prototype.revive(self, pos, doEffect)
691
- ReviveHero(self.handle, pos.x, pos.y, doEffect)
812
+ function Unit.prototype.revive(self, x, y, doEffect)
813
+ local ____ReviveHero_4 = ReviveHero
814
+ local ____array_3 = __TS__SparseArrayNew(self.handle, x, y)
815
+ local ____doEffect_2 = doEffect
816
+ if ____doEffect_2 == nil then
817
+ ____doEffect_2 = false
818
+ end
819
+ __TS__SparseArrayPush(____array_3, ____doEffect_2)
820
+ ____ReviveHero_4(__TS__SparseArraySpread(____array_3))
692
821
  end
693
822
  function Unit.prototype.healTarget(self, target, amount)
694
823
  if __TS__InstanceOf(target, ____exports.Unit) and target:hasAbility(fourCC("BIhm")) then
@@ -784,6 +913,9 @@ end
784
913
  function Unit.prototype.hideAbility(self, abilityId, flag)
785
914
  BlzUnitHideAbility(self.handle, abilityId, flag)
786
915
  end
916
+ function Unit.prototype.getAbilityRemainingCooldown(self, abilityId)
917
+ return BlzGetUnitAbilityCooldownRemaining(self.handle, abilityId)
918
+ end
787
919
  function Unit.prototype.startAbilityCooldown(self, abilityId, cooldown)
788
920
  BlzStartUnitAbilityCooldown(self.handle, abilityId, cooldown)
789
921
  end
@@ -1071,12 +1203,27 @@ __TS__SetDescriptor(
1071
1203
  Unit.prototype,
1072
1204
  "weapons",
1073
1205
  {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
1206
+ return {self.firstWeapon, self.secondWeapon}
1207
+ end},
1208
+ true
1209
+ )
1210
+ __TS__SetDescriptor(
1211
+ Unit.prototype,
1212
+ "firstWeapon",
1213
+ {get = function(self)
1214
+ local weapon = __TS__New(____exports.UnitWeapon, self, 0)
1215
+ rawset(self, "firstWeapon", weapon)
1216
+ return weapon
1217
+ end},
1218
+ true
1219
+ )
1220
+ __TS__SetDescriptor(
1221
+ Unit.prototype,
1222
+ "secondWeapon",
1223
+ {get = function(self)
1224
+ local weapon = __TS__New(____exports.UnitWeapon, self, 1)
1225
+ rawset(self, "secondWeapon", weapon)
1226
+ return weapon
1080
1227
  end},
1081
1228
  true
1082
1229
  )
@@ -1233,17 +1380,17 @@ __TS__SetDescriptor(
1233
1380
  "isTeamGlowVisible",
1234
1381
  {
1235
1382
  get = function(self)
1236
- return not self[103]
1383
+ return not self[105]
1237
1384
  end,
1238
1385
  set = function(self, isTeamGlowVisible)
1239
1386
  showUnitTeamGlow(self.handle, isTeamGlowVisible)
1240
- local ____temp_2
1387
+ local ____temp_5
1241
1388
  if not isTeamGlowVisible then
1242
- ____temp_2 = true
1389
+ ____temp_5 = true
1243
1390
  else
1244
- ____temp_2 = nil
1391
+ ____temp_5 = nil
1245
1392
  end
1246
- self[103] = ____temp_2
1393
+ self[105] = ____temp_5
1247
1394
  end
1248
1395
  },
1249
1396
  true
@@ -1253,7 +1400,7 @@ __TS__SetDescriptor(
1253
1400
  "color",
1254
1401
  {set = function(self, color)
1255
1402
  setUnitColor(self.handle, color.handle)
1256
- if self[103] then
1403
+ if self[105] then
1257
1404
  showUnitTeamGlow(self.handle, false)
1258
1405
  end
1259
1406
  end},
@@ -1277,10 +1424,14 @@ __TS__SetDescriptor(
1277
1424
  "maxHealth",
1278
1425
  {
1279
1426
  get = function(self)
1280
- return BlzGetUnitMaxHP(self.handle) - (self[102] or 0)
1427
+ return BlzGetUnitMaxHP(self.handle) - (self[103] or 0) - (self[104] or 0)
1281
1428
  end,
1282
1429
  set = function(self, maxHealth)
1283
- BlzSetUnitMaxHP(self.handle, maxHealth + (self[102] or 0))
1430
+ if maxHealth < 1 and self[102] ~= nil then
1431
+ self[103] = (self[103] or 0) + (1 - maxHealth)
1432
+ maxHealth = 1
1433
+ end
1434
+ BlzSetUnitMaxHP(self.handle, maxHealth + (self[104] or 0))
1284
1435
  end
1285
1436
  },
1286
1437
  true
@@ -1322,10 +1473,10 @@ __TS__SetDescriptor(
1322
1473
  "health",
1323
1474
  {
1324
1475
  get = function(self)
1325
- return GetWidgetLife(self.handle) - (self[102] or 0)
1476
+ return GetWidgetLife(self.handle) - (self[104] or 0)
1326
1477
  end,
1327
1478
  set = function(self, health)
1328
- SetWidgetLife(self.handle, health + (self[102] or 0))
1479
+ SetWidgetLife(self.handle, health + (self[104] or 0))
1329
1480
  end
1330
1481
  },
1331
1482
  true
@@ -1962,25 +2113,25 @@ Unit.onTargetCast = dispatchId(__TS__New(
1962
2113
  function(event)
1963
2114
  local invoke = Event.invoke
1964
2115
  local function listener(unit, id)
1965
- local ____GetSpellTargetUnit_result_5
2116
+ local ____GetSpellTargetUnit_result_8
1966
2117
  if GetSpellTargetUnit() then
1967
- ____GetSpellTargetUnit_result_5 = ____exports.Unit:of(GetSpellTargetUnit())
2118
+ ____GetSpellTargetUnit_result_8 = ____exports.Unit:of(GetSpellTargetUnit())
1968
2119
  else
1969
- local ____GetSpellTargetItem_result_4
2120
+ local ____GetSpellTargetItem_result_7
1970
2121
  if GetSpellTargetItem() then
1971
- ____GetSpellTargetItem_result_4 = Item:of(GetSpellTargetItem())
2122
+ ____GetSpellTargetItem_result_7 = Item:of(GetSpellTargetItem())
1972
2123
  else
1973
- local ____GetSpellTargetDestructable_result_3
2124
+ local ____GetSpellTargetDestructable_result_6
1974
2125
  if GetSpellTargetDestructable() then
1975
- ____GetSpellTargetDestructable_result_3 = Destructable:of(GetSpellTargetDestructable())
2126
+ ____GetSpellTargetDestructable_result_6 = Destructable:of(GetSpellTargetDestructable())
1976
2127
  else
1977
- ____GetSpellTargetDestructable_result_3 = nil
2128
+ ____GetSpellTargetDestructable_result_6 = nil
1978
2129
  end
1979
- ____GetSpellTargetItem_result_4 = ____GetSpellTargetDestructable_result_3
2130
+ ____GetSpellTargetItem_result_7 = ____GetSpellTargetDestructable_result_6
1980
2131
  end
1981
- ____GetSpellTargetUnit_result_5 = ____GetSpellTargetItem_result_4
2132
+ ____GetSpellTargetUnit_result_8 = ____GetSpellTargetItem_result_7
1982
2133
  end
1983
- local target = ____GetSpellTargetUnit_result_5
2134
+ local target = ____GetSpellTargetUnit_result_8
1984
2135
  if target then
1985
2136
  invoke(event, unit, id, target)
1986
2137
  end
@@ -2308,7 +2459,7 @@ Unit.onDamage = __TS__New(
2308
2459
  invoke(event, source, target, evData)
2309
2460
  if evData[0] ~= nil and target.health - evData.amount < 0.405 then
2310
2461
  local bonusHealth = math.ceil(evData.amount)
2311
- target[102] = (target[102] or 0) + bonusHealth
2462
+ target[104] = (target[104] or 0) + bonusHealth
2312
2463
  BlzSetUnitMaxHP(
2313
2464
  target.handle,
2314
2465
  BlzGetUnitMaxHP(target.handle) + bonusHealth
@@ -2322,7 +2473,7 @@ Unit.onDamage = __TS__New(
2322
2473
  evData[0],
2323
2474
  table.unpack(evData, 1 + 1, 1 + (evData[1] or 0))
2324
2475
  )
2325
- target[102] = (target[102] or 0) - bonusHealth
2476
+ target[104] = (target[104] or 0) - bonusHealth
2326
2477
  SetWidgetLife(
2327
2478
  target.handle,
2328
2479
  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";