warscript 0.0.1-dev.ba37a78 → 0.0.1-dev.c16baee

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 -84
  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,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"
@@ -578,10 +706,6 @@ function Unit.prototype.onDestroy(self)
578
706
  if eventsToDestroy ~= nil then
579
707
  forEach(eventsToDestroy, "destroy")
580
708
  end
581
- if getUnitAbilityLevel(handle, leaveDetectAbilityId) > 0 then
582
- unitRemoveAbility(handle, leaveDetectAbilityId)
583
- removeUnit(handle)
584
- end
585
709
  return Handle.prototype.onDestroy(self)
586
710
  end
587
711
  function Unit.prototype.addAttackHandler(self, condition, action)
@@ -674,6 +798,10 @@ end
674
798
  function Unit.prototype.queueAnimation(self, animation)
675
799
  queueUnitAnimation(self.handle, animation)
676
800
  end
801
+ function Unit.prototype.delayHealthChecks(self)
802
+ self[102] = (self[102] or 0) + 1
803
+ Timer:run(delayHealthChecksCallback, self)
804
+ end
677
805
  function Unit.prototype.setPosition(self, x, y)
678
806
  setUnitPosition(self.handle, x, y)
679
807
  end
@@ -687,8 +815,15 @@ end
687
815
  function Unit.prototype.kill(self)
688
816
  killUnit(self.handle)
689
817
  end
690
- function Unit.prototype.revive(self, pos, doEffect)
691
- ReviveHero(self.handle, pos.x, pos.y, doEffect)
818
+ function Unit.prototype.revive(self, x, y, doEffect)
819
+ local ____ReviveHero_4 = ReviveHero
820
+ local ____array_3 = __TS__SparseArrayNew(self.handle, x, y)
821
+ local ____doEffect_2 = doEffect
822
+ if ____doEffect_2 == nil then
823
+ ____doEffect_2 = false
824
+ end
825
+ __TS__SparseArrayPush(____array_3, ____doEffect_2)
826
+ ____ReviveHero_4(__TS__SparseArraySpread(____array_3))
692
827
  end
693
828
  function Unit.prototype.healTarget(self, target, amount)
694
829
  if __TS__InstanceOf(target, ____exports.Unit) and target:hasAbility(fourCC("BIhm")) then
@@ -784,6 +919,9 @@ end
784
919
  function Unit.prototype.hideAbility(self, abilityId, flag)
785
920
  BlzUnitHideAbility(self.handle, abilityId, flag)
786
921
  end
922
+ function Unit.prototype.getAbilityRemainingCooldown(self, abilityId)
923
+ return BlzGetUnitAbilityCooldownRemaining(self.handle, abilityId)
924
+ end
787
925
  function Unit.prototype.startAbilityCooldown(self, abilityId, cooldown)
788
926
  BlzStartUnitAbilityCooldown(self.handle, abilityId, cooldown)
789
927
  end
@@ -1071,12 +1209,27 @@ __TS__SetDescriptor(
1071
1209
  Unit.prototype,
1072
1210
  "weapons",
1073
1211
  {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
1212
+ return {self.firstWeapon, self.secondWeapon}
1213
+ end},
1214
+ true
1215
+ )
1216
+ __TS__SetDescriptor(
1217
+ Unit.prototype,
1218
+ "firstWeapon",
1219
+ {get = function(self)
1220
+ local weapon = __TS__New(____exports.UnitWeapon, self, 0)
1221
+ rawset(self, "firstWeapon", weapon)
1222
+ return weapon
1223
+ end},
1224
+ true
1225
+ )
1226
+ __TS__SetDescriptor(
1227
+ Unit.prototype,
1228
+ "secondWeapon",
1229
+ {get = function(self)
1230
+ local weapon = __TS__New(____exports.UnitWeapon, self, 1)
1231
+ rawset(self, "secondWeapon", weapon)
1232
+ return weapon
1080
1233
  end},
1081
1234
  true
1082
1235
  )
@@ -1233,17 +1386,17 @@ __TS__SetDescriptor(
1233
1386
  "isTeamGlowVisible",
1234
1387
  {
1235
1388
  get = function(self)
1236
- return not self[103]
1389
+ return not self[105]
1237
1390
  end,
1238
1391
  set = function(self, isTeamGlowVisible)
1239
1392
  showUnitTeamGlow(self.handle, isTeamGlowVisible)
1240
- local ____temp_2
1393
+ local ____temp_5
1241
1394
  if not isTeamGlowVisible then
1242
- ____temp_2 = true
1395
+ ____temp_5 = true
1243
1396
  else
1244
- ____temp_2 = nil
1397
+ ____temp_5 = nil
1245
1398
  end
1246
- self[103] = ____temp_2
1399
+ self[105] = ____temp_5
1247
1400
  end
1248
1401
  },
1249
1402
  true
@@ -1253,7 +1406,7 @@ __TS__SetDescriptor(
1253
1406
  "color",
1254
1407
  {set = function(self, color)
1255
1408
  setUnitColor(self.handle, color.handle)
1256
- if self[103] then
1409
+ if self[105] then
1257
1410
  showUnitTeamGlow(self.handle, false)
1258
1411
  end
1259
1412
  end},
@@ -1277,10 +1430,14 @@ __TS__SetDescriptor(
1277
1430
  "maxHealth",
1278
1431
  {
1279
1432
  get = function(self)
1280
- return BlzGetUnitMaxHP(self.handle) - (self[102] or 0)
1433
+ return BlzGetUnitMaxHP(self.handle) - (self[103] or 0) - (self[104] or 0)
1281
1434
  end,
1282
1435
  set = function(self, maxHealth)
1283
- BlzSetUnitMaxHP(self.handle, maxHealth + (self[102] or 0))
1436
+ if maxHealth < 1 and self[102] ~= nil then
1437
+ self[103] = (self[103] or 0) + (1 - maxHealth)
1438
+ maxHealth = 1
1439
+ end
1440
+ BlzSetUnitMaxHP(self.handle, maxHealth + (self[104] or 0))
1284
1441
  end
1285
1442
  },
1286
1443
  true
@@ -1322,10 +1479,10 @@ __TS__SetDescriptor(
1322
1479
  "health",
1323
1480
  {
1324
1481
  get = function(self)
1325
- return GetWidgetLife(self.handle) - (self[102] or 0)
1482
+ return GetWidgetLife(self.handle) - (self[104] or 0)
1326
1483
  end,
1327
1484
  set = function(self, health)
1328
- SetWidgetLife(self.handle, health + (self[102] or 0))
1485
+ SetWidgetLife(self.handle, health + (self[104] or 0))
1329
1486
  end
1330
1487
  },
1331
1488
  true
@@ -1962,25 +2119,25 @@ Unit.onTargetCast = dispatchId(__TS__New(
1962
2119
  function(event)
1963
2120
  local invoke = Event.invoke
1964
2121
  local function listener(unit, id)
1965
- local ____GetSpellTargetUnit_result_5
2122
+ local ____GetSpellTargetUnit_result_8
1966
2123
  if GetSpellTargetUnit() then
1967
- ____GetSpellTargetUnit_result_5 = ____exports.Unit:of(GetSpellTargetUnit())
2124
+ ____GetSpellTargetUnit_result_8 = ____exports.Unit:of(GetSpellTargetUnit())
1968
2125
  else
1969
- local ____GetSpellTargetItem_result_4
2126
+ local ____GetSpellTargetItem_result_7
1970
2127
  if GetSpellTargetItem() then
1971
- ____GetSpellTargetItem_result_4 = Item:of(GetSpellTargetItem())
2128
+ ____GetSpellTargetItem_result_7 = Item:of(GetSpellTargetItem())
1972
2129
  else
1973
- local ____GetSpellTargetDestructable_result_3
2130
+ local ____GetSpellTargetDestructable_result_6
1974
2131
  if GetSpellTargetDestructable() then
1975
- ____GetSpellTargetDestructable_result_3 = Destructable:of(GetSpellTargetDestructable())
2132
+ ____GetSpellTargetDestructable_result_6 = Destructable:of(GetSpellTargetDestructable())
1976
2133
  else
1977
- ____GetSpellTargetDestructable_result_3 = nil
2134
+ ____GetSpellTargetDestructable_result_6 = nil
1978
2135
  end
1979
- ____GetSpellTargetItem_result_4 = ____GetSpellTargetDestructable_result_3
2136
+ ____GetSpellTargetItem_result_7 = ____GetSpellTargetDestructable_result_6
1980
2137
  end
1981
- ____GetSpellTargetUnit_result_5 = ____GetSpellTargetItem_result_4
2138
+ ____GetSpellTargetUnit_result_8 = ____GetSpellTargetItem_result_7
1982
2139
  end
1983
- local target = ____GetSpellTargetUnit_result_5
2140
+ local target = ____GetSpellTargetUnit_result_8
1984
2141
  if target then
1985
2142
  invoke(event, unit, id, target)
1986
2143
  end
@@ -2308,7 +2465,7 @@ Unit.onDamage = __TS__New(
2308
2465
  invoke(event, source, target, evData)
2309
2466
  if evData[0] ~= nil and target.health - evData.amount < 0.405 then
2310
2467
  local bonusHealth = math.ceil(evData.amount)
2311
- target[102] = (target[102] or 0) + bonusHealth
2468
+ target[104] = (target[104] or 0) + bonusHealth
2312
2469
  BlzSetUnitMaxHP(
2313
2470
  target.handle,
2314
2471
  BlzGetUnitMaxHP(target.handle) + bonusHealth
@@ -2322,7 +2479,7 @@ Unit.onDamage = __TS__New(
2322
2479
  evData[0],
2323
2480
  table.unpack(evData, 1 + 1, 1 + (evData[1] or 0))
2324
2481
  )
2325
- target[102] = (target[102] or 0) - bonusHealth
2482
+ target[104] = (target[104] or 0) - bonusHealth
2326
2483
  SetWidgetLife(
2327
2484
  target.handle,
2328
2485
  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";