warscript 0.0.1-dev.bb34489 → 0.0.1-dev.c03154e

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 (105) hide show
  1. package/binaryreader.d.ts +1 -0
  2. package/binaryreader.lua +3 -0
  3. package/core/types/effect.d.ts +13 -3
  4. package/core/types/effect.lua +116 -17
  5. package/core/types/frame.d.ts +8 -0
  6. package/core/types/frame.lua +93 -1
  7. package/core/types/handle.lua +2 -0
  8. package/core/util.d.ts +1 -1
  9. package/core/util.lua +12 -0
  10. package/engine/behavior.d.ts +2 -2
  11. package/engine/behavior.lua +6 -6
  12. package/engine/behaviour/ability/always-enabled.d.ts +7 -0
  13. package/engine/behaviour/ability/always-enabled.lua +31 -0
  14. package/engine/behaviour/ability/apply-buff.d.ts +3 -5
  15. package/engine/behaviour/ability/damage.d.ts +33 -11
  16. package/engine/behaviour/ability/damage.lua +89 -31
  17. package/engine/behaviour/ability/emulate-impact.d.ts +6 -0
  18. package/engine/behaviour/ability/emulate-impact.lua +28 -0
  19. package/engine/behaviour/ability/heal.d.ts +33 -6
  20. package/engine/behaviour/ability/heal.lua +89 -10
  21. package/engine/behaviour/ability/instant-impact.d.ts +2 -2
  22. package/engine/behaviour/ability/instant-impact.lua +4 -19
  23. package/engine/behaviour/ability/on-command-impact.d.ts +8 -0
  24. package/engine/behaviour/ability/on-command-impact.lua +25 -0
  25. package/engine/behaviour/ability/remove-buffs.d.ts +16 -0
  26. package/engine/behaviour/ability/remove-buffs.lua +28 -0
  27. package/engine/behaviour/ability/restore-mana.d.ts +15 -0
  28. package/engine/behaviour/ability/restore-mana.lua +29 -0
  29. package/engine/behaviour/ability.d.ts +14 -3
  30. package/engine/behaviour/ability.lua +79 -33
  31. package/engine/behaviour/unit.d.ts +5 -0
  32. package/engine/behaviour/unit.lua +20 -0
  33. package/engine/buff.d.ts +69 -19
  34. package/engine/buff.lua +283 -80
  35. package/engine/game-map.d.ts +7 -0
  36. package/engine/game-map.lua +32 -0
  37. package/engine/internal/ability.d.ts +16 -13
  38. package/engine/internal/ability.lua +80 -76
  39. package/engine/internal/item/ability.lua +106 -0
  40. package/engine/internal/item+owner.lua +2 -2
  41. package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
  42. package/engine/internal/misc/ability-disable-counter.lua +13 -0
  43. package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
  44. package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
  45. package/engine/internal/object-data/evasion-probability.d.ts +2 -0
  46. package/engine/internal/object-data/evasion-probability.lua +16 -0
  47. package/engine/internal/unit/ability.d.ts +10 -1
  48. package/engine/internal/unit/ability.lua +36 -14
  49. package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
  50. package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
  51. package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
  52. package/engine/internal/unit/add-item-to-slot.lua +50 -0
  53. package/engine/internal/unit/bonus.d.ts +6 -2
  54. package/engine/internal/unit/bonus.lua +23 -1
  55. package/engine/internal/unit/ignore-events-items.d.ts +2 -0
  56. package/engine/internal/unit/ignore-events-items.lua +5 -0
  57. package/engine/internal/unit/item.d.ts +24 -0
  58. package/engine/internal/unit/item.lua +78 -0
  59. package/engine/internal/unit/main-selected.d.ts +13 -0
  60. package/engine/internal/unit/main-selected.lua +51 -0
  61. package/engine/internal/unit+ability.lua +2 -2
  62. package/engine/internal/unit+transport.lua +4 -10
  63. package/engine/internal/unit-missile-launch.lua +24 -5
  64. package/engine/internal/unit.d.ts +26 -10
  65. package/engine/internal/unit.lua +179 -89
  66. package/engine/internal/utility.lua +12 -0
  67. package/engine/lightning.d.ts +8 -2
  68. package/engine/lightning.lua +27 -2
  69. package/engine/local-client.d.ts +7 -2
  70. package/engine/local-client.lua +82 -0
  71. package/engine/object-data/auxiliary/sound-preset-name.d.ts +5 -1
  72. package/engine/object-data/entry/ability-type.lua +8 -12
  73. package/engine/object-data/entry/item-type.d.ts +14 -0
  74. package/engine/object-data/entry/item-type.lua +91 -0
  75. package/engine/object-data/utility/object-data-entry-id-generator.lua +7 -0
  76. package/engine/object-field/ability.d.ts +26 -3
  77. package/engine/object-field/ability.lua +54 -1
  78. package/engine/object-field.d.ts +2 -2
  79. package/engine/object-field.lua +4 -0
  80. package/engine/standard/fields/ability.d.ts +2 -0
  81. package/engine/standard/fields/ability.lua +2 -0
  82. package/engine/unit.d.ts +3 -0
  83. package/engine/unit.lua +3 -0
  84. package/index.d.ts +1 -0
  85. package/index.lua +1 -0
  86. package/lualib_bundle.lua +7 -2
  87. package/net/socket.d.ts +7 -1
  88. package/net/socket.lua +45 -4
  89. package/network.d.ts +1 -0
  90. package/network.lua +3 -2
  91. package/objutil/buff.lua +1 -1
  92. package/package.json +2 -2
  93. package/patch-lua.d.ts +0 -0
  94. package/patch-lua.lua +10 -0
  95. package/property.d.ts +55 -0
  96. package/property.lua +374 -0
  97. package/utility/arrays.d.ts +8 -1
  98. package/utility/arrays.lua +34 -3
  99. package/utility/lazy.d.ts +2 -0
  100. package/utility/lazy.lua +14 -0
  101. package/utility/linked-set.d.ts +11 -2
  102. package/utility/linked-set.lua +5 -2
  103. package/utility/types.d.ts +1 -0
  104. package/core/mapbounds.d.ts +0 -8
  105. package/core/mapbounds.lua +0 -12
package/engine/buff.lua CHANGED
@@ -46,6 +46,10 @@ local ____arrays = require("utility.arrays")
46
46
  local forEach = ____arrays.forEach
47
47
  local ____ability_2Dduration = require("engine.internal.mechanics.ability-duration")
48
48
  local getAbilityDuration = ____ability_2Dduration.getAbilityDuration
49
+ local ____item = require("engine.internal.item")
50
+ local Item = ____item.Item
51
+ local ____destructable = require("core.types.destructable")
52
+ local Destructable = ____destructable.Destructable
49
53
  local getUnitAbility = BlzGetUnitAbility
50
54
  local stringValueByBuffTypeIdByFieldId = postcompile(function()
51
55
  local stringValueByBuffTypeIdByFieldId = {}
@@ -94,6 +98,8 @@ local buffParametersKeys = {
94
98
  armorIncreaseFactor = true,
95
99
  attackSpeedIncreaseFactor = true,
96
100
  movementSpeedIncreaseFactor = true,
101
+ evasionProbability = true,
102
+ damageFactor = true,
97
103
  receivedDamageFactor = true,
98
104
  receivedMagicDamageFactor = true,
99
105
  durationIncreaseOnAutoAttack = true,
@@ -107,8 +113,26 @@ local buffParametersKeys = {
107
113
  disablesAutoAttack = true,
108
114
  destroysOnDamage = true,
109
115
  maximumAutoAttackCount = true,
110
- uniqueGroup = true
116
+ maximumDamageDealtEventCount = true,
117
+ maximumDamageReceivedEventCount = true,
118
+ uniqueGroup = true,
119
+ damageOnExpiration = true,
120
+ healingOnExpiration = true,
121
+ killsOnExpiration = true,
122
+ explodesOnExpiration = true
111
123
  }
124
+ local function resolveEnumValue(ability, level, value)
125
+ if value == nil or type(value) == "number" then
126
+ return value
127
+ end
128
+ if ability == nil then
129
+ error(
130
+ __TS__New(IllegalArgumentException),
131
+ 0
132
+ )
133
+ end
134
+ return value:getValue(ability, level or ability.level)
135
+ end
112
136
  local function resolveNumberValue(ability, level, value)
113
137
  if value == nil or type(value) == "number" then
114
138
  return value
@@ -145,20 +169,33 @@ local function resolveAndSetNumberValue(buff, property, ability, level, value, d
145
169
  buff[property] = resolvedValue
146
170
  end
147
171
  end
148
- local buffBooleanParameters = {"stuns", "ignoresStunImmunity", "disablesAutoAttack", "providesInvulnerability"}
172
+ local buffBooleanParameters = {
173
+ "stuns",
174
+ "ignoresStunImmunity",
175
+ "disablesAutoAttack",
176
+ "providesInvulnerability",
177
+ "killsOnExpiration",
178
+ "explodesOnExpiration"
179
+ }
149
180
  local buffNumberParameters = {
150
181
  "durationIncreaseOnAutoAttack",
151
182
  "attackSpeedIncreaseFactor",
152
183
  "movementSpeedIncreaseFactor",
184
+ "evasionProbability",
153
185
  "armorIncrease",
186
+ "damageFactor",
154
187
  "receivedDamageFactor",
155
188
  "maximumAutoAttackCount",
189
+ "maximumDamageDealtEventCount",
190
+ "maximumDamageReceivedEventCount",
156
191
  "damageInterval",
157
192
  "damagePerInterval",
158
193
  "damageOverDuration",
159
194
  "healingInterval",
160
195
  "healingPerInterval",
161
- "healingOverDuration"
196
+ "healingOverDuration",
197
+ "damageOnExpiration",
198
+ "healingOnExpiration"
162
199
  }
163
200
  local unsuccessfulApplicationMarker = {}
164
201
  local function selectBuffTypeIdWithLeastDuration(buffTypeIds, unit)
@@ -207,6 +244,7 @@ local function expireBuff(buff)
207
244
  end
208
245
  end
209
246
  Timer:run(destroyBuff, buff)
247
+ buff:onExpiration()
210
248
  end
211
249
  local function buffDamageIntervalInitialTimerCallback(buff)
212
250
  buffDamageIntervalTimerCallback(buff)
@@ -296,8 +334,6 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
296
334
  end
297
335
  end
298
336
  self.typeId = typeId
299
- self.polarity = polarity
300
- self.resistanceType = resistanceType
301
337
  if not __TS__InstanceOf(ability, Ability) then
302
338
  parameters = ability
303
339
  ability = nil
@@ -324,6 +360,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
324
360
  learnLevelMinimum = learnLevelMinimum or ability:getField(ABILITY_IF_REQUIRED_LEVEL)
325
361
  duration = duration or getAbilityDuration(ability, _unit)
326
362
  end
363
+ self.polarity = resolveEnumValue(ability, level, polarity)
364
+ self.resistanceType = resolveEnumValue(ability, level, resistanceType)
327
365
  local buffByTypeId = buffByTypeIdByUnit[_unit]
328
366
  if buffByTypeId == nil then
329
367
  buffByTypeId = {}
@@ -340,8 +378,8 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
340
378
  if not internalApplyBuff(
341
379
  _unit,
342
380
  typeId,
343
- polarity,
344
- resistanceType,
381
+ self.polarity,
382
+ self.resistanceType,
345
383
  level,
346
384
  duration,
347
385
  spellStealPriority,
@@ -450,6 +488,7 @@ function Buff.prototype.____constructor(self, _unit, typeIdOrTypeIds, polarityOr
450
488
  timer:start(duration, false, expireBuff, self)
451
489
  self._timer = timer
452
490
  end
491
+ self:onCreate()
453
492
  end
454
493
  function Buff.prototype.getUnitBonus(self, bonusType)
455
494
  local ____opt_36 = self._bonusIdByBonusType
@@ -464,26 +503,30 @@ function Buff.prototype.addOrUpdateOrRemoveUnitBonus(self, bonusType, value)
464
503
  end
465
504
  bonusIdByBonusType[bonusType] = addOrUpdateOrRemoveUnitBonus(self._unit, bonusType, bonusIdByBonusType[bonusType], value)
466
505
  end
467
- function Buff.prototype.flashEffect(self, widgetOrDuration, duration)
468
- local isWidgetProvided = type(widgetOrDuration) == "table"
469
- local ____Effect_40 = Effect
470
- local ____Effect_flash_41 = Effect.flash
471
- local ____array_39 = __TS__SparseArrayNew(
472
- self[104],
473
- isWidgetProvided and widgetOrDuration or self._unit,
474
- stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
475
- )
476
- local ____isWidgetProvided_38
477
- if isWidgetProvided then
478
- ____isWidgetProvided_38 = duration
506
+ function Buff.prototype.flashEffect(self, widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
507
+ if type(widgetOrXOrParametersOrDuration) == "number" and type(yOrParametersOrDuration) == "number" then
508
+ Effect:flash(self[104], widgetOrXOrParametersOrDuration, yOrParametersOrDuration, parametersOrDuration)
479
509
  else
480
- ____isWidgetProvided_38 = widgetOrDuration
510
+ local isWidgetProvided = __TS__InstanceOf(widgetOrXOrParametersOrDuration, Unit) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Item) or __TS__InstanceOf(widgetOrXOrParametersOrDuration, Destructable)
511
+ local ____Effect_40 = Effect
512
+ local ____Effect_flash_41 = Effect.flash
513
+ local ____array_39 = __TS__SparseArrayNew(
514
+ self[104],
515
+ isWidgetProvided and widgetOrXOrParametersOrDuration or self._unit,
516
+ stringValueByBuffTypeIdByFieldId[fourCC("feft")][self.typeId] or "origin"
517
+ )
518
+ local ____isWidgetProvided_38
519
+ if isWidgetProvided then
520
+ ____isWidgetProvided_38 = yOrParametersOrDuration
521
+ else
522
+ ____isWidgetProvided_38 = widgetOrXOrParametersOrDuration
523
+ end
524
+ __TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
525
+ ____Effect_flash_41(
526
+ ____Effect_40,
527
+ __TS__SparseArraySpread(____array_39)
528
+ )
481
529
  end
482
- __TS__SparseArrayPush(____array_39, ____isWidgetProvided_38)
483
- ____Effect_flash_41(
484
- ____Effect_40,
485
- __TS__SparseArraySpread(____array_39)
486
- )
487
530
  end
488
531
  function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
489
532
  local isWidgetProvided = type(widgetOrDuration) == "table"
@@ -506,6 +549,8 @@ function Buff.prototype.flashSpecialEffect(self, widgetOrDuration, duration)
506
549
  __TS__SparseArraySpread(____array_43)
507
550
  )
508
551
  end
552
+ function Buff.prototype.onCreate(self)
553
+ end
509
554
  function Buff.prototype.onDestroy(self)
510
555
  local unit = self._unit
511
556
  if getUnitAbility(unit.handle, self.typeId) == self.handle then
@@ -530,11 +575,11 @@ function Buff.prototype.onDestroy(self)
530
575
  behavior:destroy()
531
576
  end
532
577
  end
533
- if self[130] then
578
+ if self[136] then
534
579
  unit:decrementDisableAutoAttackCounter()
535
580
  end
536
- if self[128] then
537
- if self[129] then
581
+ if self[134] then
582
+ if self[135] then
538
583
  unit:decrementStunCounter()
539
584
  end
540
585
  unit:decrementStunCounter()
@@ -583,20 +628,34 @@ function Buff.getByTypeId(self, unit, typeId)
583
628
  end
584
629
  return nil
585
630
  end
586
- function Buff.prototype.onDeath(self, source)
631
+ function Buff.prototype.onExpiration(self)
587
632
  local unit = self.unit
588
633
  if self[119] ~= nil then
634
+ (self[101] or unit):damageTarget(unit, self[119] or 0)
635
+ end
636
+ if self[120] ~= nil then
637
+ (self[101] or unit):healTarget(unit, self[119] or 0)
638
+ end
639
+ if self[139] then
640
+ unit:explode()
641
+ elseif self[138] then
642
+ unit:kill()
643
+ end
644
+ end
645
+ function Buff.prototype.onDeath(self, source)
646
+ local unit = self.unit
647
+ if self[121] ~= nil then
589
648
  damageArea(
590
649
  self[101] or unit,
591
- self[119],
650
+ self[121],
592
651
  unit.x,
593
652
  unit.y,
594
- self[121] or 0,
595
- self[120] or 0,
596
653
  self[123] or 0,
597
654
  self[122] or 0,
598
655
  self[125] or 0,
599
- self[124] or 0
656
+ self[124] or 0,
657
+ self[127] or 0,
658
+ self[126] or 0
600
659
  )
601
660
  end
602
661
  end
@@ -618,9 +677,25 @@ function Buff.prototype.onDamageDealt(self, target, event)
618
677
  end
619
678
  self.remainingDuration = remainingDuration
620
679
  end
621
- local autoAttackCount = (self[126] or 0) + 1
622
- self[126] = autoAttackCount
623
- if autoAttackCount == self[127] then
680
+ local autoAttackCount = (self[128] or 0) + 1
681
+ self[128] = autoAttackCount
682
+ if autoAttackCount == self[129] then
683
+ self:destroy()
684
+ end
685
+ end
686
+ if event.originalAmount ~= 0 then
687
+ local damageDealtEventCount = (self[130] or 0) + 1
688
+ self[130] = damageDealtEventCount
689
+ if damageDealtEventCount == self[131] then
690
+ self:destroy()
691
+ end
692
+ end
693
+ end
694
+ function Buff.prototype.onDamageReceived(self, source, event)
695
+ if event.originalAmount ~= 0 then
696
+ local damageReceivedEventCount = (self[132] or 0) + 1
697
+ self[132] = damageReceivedEventCount
698
+ if damageReceivedEventCount == self[133] then
624
699
  self:destroy()
625
700
  end
626
701
  end
@@ -802,6 +877,45 @@ __TS__SetDescriptor(
802
877
  },
803
878
  true
804
879
  )
880
+ __TS__SetDescriptor(
881
+ Buff.prototype,
882
+ "damageOnExpiration",
883
+ {
884
+ get = function(self)
885
+ return self[119] or 0
886
+ end,
887
+ set = function(self, damageOnExpiration)
888
+ self[119] = damageOnExpiration ~= 0 and damageOnExpiration or nil
889
+ end
890
+ },
891
+ true
892
+ )
893
+ __TS__SetDescriptor(
894
+ Buff.prototype,
895
+ "healingOnExpiration",
896
+ {
897
+ get = function(self)
898
+ return self[120] or 0
899
+ end,
900
+ set = function(self, healingOnExpiration)
901
+ self[120] = healingOnExpiration ~= 0 and healingOnExpiration or nil
902
+ end
903
+ },
904
+ true
905
+ )
906
+ __TS__SetDescriptor(
907
+ Buff.prototype,
908
+ "damageFactor",
909
+ {
910
+ get = function(self)
911
+ return self:getUnitBonus(UnitBonusType.DAMAGE_FACTOR)
912
+ end,
913
+ set = function(self, damageFactor)
914
+ self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.DAMAGE_FACTOR, damageFactor)
915
+ end
916
+ },
917
+ true
918
+ )
805
919
  __TS__SetDescriptor(
806
920
  Buff.prototype,
807
921
  "receivedDamageFactor",
@@ -833,25 +947,25 @@ __TS__SetDescriptor(
833
947
  "stuns",
834
948
  {
835
949
  get = function(self)
836
- local ____self__128_52 = self[128]
837
- if ____self__128_52 == nil then
838
- ____self__128_52 = false
950
+ local ____self__134_52 = self[134]
951
+ if ____self__134_52 == nil then
952
+ ____self__134_52 = false
839
953
  end
840
- return ____self__128_52
954
+ return ____self__134_52
841
955
  end,
842
956
  set = function(self, stuns)
843
- if not stuns and self[128] then
844
- if self[129] then
957
+ if not stuns and self[134] then
958
+ if self[135] then
845
959
  self.object:decrementStunCounter()
846
960
  end
847
961
  self.object:decrementStunCounter()
848
- self[128] = nil
849
- elseif stuns and not self[128] then
850
- if self[129] then
962
+ self[134] = nil
963
+ elseif stuns and not self[134] then
964
+ if self[135] then
851
965
  self.object:incrementStunCounter()
852
966
  end
853
967
  self.object:incrementStunCounter()
854
- self[128] = true
968
+ self[134] = true
855
969
  end
856
970
  end
857
971
  },
@@ -862,23 +976,23 @@ __TS__SetDescriptor(
862
976
  "ignoresStunImmunity",
863
977
  {
864
978
  get = function(self)
865
- local ____self__129_53 = self[129]
866
- if ____self__129_53 == nil then
867
- ____self__129_53 = false
979
+ local ____self__135_53 = self[135]
980
+ if ____self__135_53 == nil then
981
+ ____self__135_53 = false
868
982
  end
869
- return ____self__129_53
983
+ return ____self__135_53
870
984
  end,
871
985
  set = function(self, ignoresStunImmunity)
872
- if not ignoresStunImmunity and self[129] then
873
- if self[128] then
986
+ if not ignoresStunImmunity and self[135] then
987
+ if self[134] then
874
988
  self.object:decrementStunCounter()
875
989
  end
876
- self[129] = nil
877
- elseif ignoresStunImmunity and not self[129] then
878
- if self[128] then
990
+ self[135] = nil
991
+ elseif ignoresStunImmunity and not self[135] then
992
+ if self[134] then
879
993
  self.object:incrementStunCounter()
880
994
  end
881
- self[129] = true
995
+ self[135] = true
882
996
  end
883
997
  end
884
998
  },
@@ -889,19 +1003,19 @@ __TS__SetDescriptor(
889
1003
  "disablesAutoAttack",
890
1004
  {
891
1005
  get = function(self)
892
- local ____self__130_54 = self[130]
893
- if ____self__130_54 == nil then
894
- ____self__130_54 = false
1006
+ local ____self__136_54 = self[136]
1007
+ if ____self__136_54 == nil then
1008
+ ____self__136_54 = false
895
1009
  end
896
- return ____self__130_54
1010
+ return ____self__136_54
897
1011
  end,
898
1012
  set = function(self, disablesAutoAttack)
899
- if not disablesAutoAttack and self[130] then
1013
+ if not disablesAutoAttack and self[136] then
900
1014
  self.object:decrementDisableAutoAttackCounter()
901
- self[130] = nil
902
- elseif disablesAutoAttack and not self[130] then
1015
+ self[136] = nil
1016
+ elseif disablesAutoAttack and not self[136] then
903
1017
  self.object:incrementDisableAutoAttackCounter()
904
- self[130] = true
1018
+ self[136] = true
905
1019
  end
906
1020
  end
907
1021
  },
@@ -912,19 +1026,95 @@ __TS__SetDescriptor(
912
1026
  "providesInvulnerability",
913
1027
  {
914
1028
  get = function(self)
915
- local ____self__131_55 = self[131]
916
- if ____self__131_55 == nil then
917
- ____self__131_55 = false
1029
+ local ____self__137_55 = self[137]
1030
+ if ____self__137_55 == nil then
1031
+ ____self__137_55 = false
918
1032
  end
919
- return ____self__131_55
1033
+ return ____self__137_55
920
1034
  end,
921
1035
  set = function(self, providesInvulnerability)
922
- if not providesInvulnerability and self[131] then
1036
+ if not providesInvulnerability and self[137] then
923
1037
  self.object:decrementInvulnerabilityCounter()
924
- self[131] = nil
925
- elseif providesInvulnerability and not self[131] then
1038
+ self[137] = nil
1039
+ elseif providesInvulnerability and not self[137] then
926
1040
  self.object:incrementInvulnerabilityCounter()
927
- self[131] = true
1041
+ self[137] = true
1042
+ end
1043
+ end
1044
+ },
1045
+ true
1046
+ )
1047
+ __TS__SetDescriptor(
1048
+ Buff.prototype,
1049
+ "killsOnExpiration",
1050
+ {
1051
+ get = function(self)
1052
+ local ____self__138_56 = self[138]
1053
+ if ____self__138_56 == nil then
1054
+ ____self__138_56 = false
1055
+ end
1056
+ return ____self__138_56
1057
+ end,
1058
+ set = function(self, killsOnExpiration)
1059
+ if not killsOnExpiration and self[138] then
1060
+ self[138] = nil
1061
+ elseif killsOnExpiration and not self[138] then
1062
+ self[138] = true
1063
+ end
1064
+ end
1065
+ },
1066
+ true
1067
+ )
1068
+ __TS__SetDescriptor(
1069
+ Buff.prototype,
1070
+ "explodesOnExpiration",
1071
+ {
1072
+ get = function(self)
1073
+ local ____self__139_57 = self[139]
1074
+ if ____self__139_57 == nil then
1075
+ ____self__139_57 = false
1076
+ end
1077
+ return ____self__139_57
1078
+ end,
1079
+ set = function(self, killsOnExpiration)
1080
+ if not killsOnExpiration and self[139] then
1081
+ self[139] = nil
1082
+ elseif killsOnExpiration and not self[139] then
1083
+ self[139] = true
1084
+ end
1085
+ end
1086
+ },
1087
+ true
1088
+ )
1089
+ __TS__SetDescriptor(
1090
+ Buff.prototype,
1091
+ "maximumDamageDealtEventCount",
1092
+ {
1093
+ get = function(self)
1094
+ return self[131] or 0
1095
+ end,
1096
+ set = function(self, maximumDamageDealtEventCount)
1097
+ if maximumDamageDealtEventCount == 0 then
1098
+ self[131] = nil
1099
+ else
1100
+ self[131] = maximumDamageDealtEventCount
1101
+ end
1102
+ end
1103
+ },
1104
+ true
1105
+ )
1106
+ __TS__SetDescriptor(
1107
+ Buff.prototype,
1108
+ "maximumDamageReceivedEventCount",
1109
+ {
1110
+ get = function(self)
1111
+ return self[133] or 0
1112
+ end,
1113
+ set = function(self, maximumDamageReceivedEventCount)
1114
+ if maximumDamageReceivedEventCount == 0 then
1115
+ self[133] = nil
1116
+ else
1117
+ self[133] = maximumDamageReceivedEventCount
928
1118
  end
929
1119
  end
930
1120
  },
@@ -935,13 +1125,13 @@ __TS__SetDescriptor(
935
1125
  "maximumAutoAttackCount",
936
1126
  {
937
1127
  get = function(self)
938
- return self[127] or 0
1128
+ return self[129] or 0
939
1129
  end,
940
1130
  set = function(self, maximumAutoAttackCount)
941
1131
  if maximumAutoAttackCount == 0 then
942
- self[127] = nil
1132
+ self[129] = nil
943
1133
  else
944
- self[127] = maximumAutoAttackCount
1134
+ self[129] = maximumAutoAttackCount
945
1135
  end
946
1136
  end
947
1137
  },
@@ -986,6 +1176,19 @@ __TS__SetDescriptor(
986
1176
  },
987
1177
  true
988
1178
  )
1179
+ __TS__SetDescriptor(
1180
+ Buff.prototype,
1181
+ "evasionProbability",
1182
+ {
1183
+ get = function(self)
1184
+ return self:getUnitBonus(UnitBonusType.EVASION_PROBABILITY)
1185
+ end,
1186
+ set = function(self, evasionProbability)
1187
+ self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.EVASION_PROBABILITY, evasionProbability)
1188
+ end
1189
+ },
1190
+ true
1191
+ )
989
1192
  __TS__SetDescriptor(
990
1193
  Buff.prototype,
991
1194
  "duration",
@@ -999,13 +1202,13 @@ __TS__SetDescriptor(
999
1202
  "remainingDuration",
1000
1203
  {
1001
1204
  get = function(self)
1002
- local ____opt_56 = self._timer
1003
- return ____opt_56 and ____opt_56.remaining or 0
1205
+ local ____opt_58 = self._timer
1206
+ return ____opt_58 and ____opt_58.remaining or 0
1004
1207
  end,
1005
1208
  set = function(self, remainingDuration)
1006
- local ____remainingDuration_60 = remainingDuration
1007
- local ____opt_58 = self._timer
1008
- local remainingDurationDelta = ____remainingDuration_60 - (____opt_58 and ____opt_58.remaining or 0)
1209
+ local ____remainingDuration_62 = remainingDuration
1210
+ local ____opt_60 = self._timer
1211
+ local remainingDurationDelta = ____remainingDuration_62 - (____opt_60 and ____opt_60.remaining or 0)
1009
1212
  if remainingDurationDelta ~= 0 then
1010
1213
  self[102] = self[102] + remainingDurationDelta
1011
1214
  if remainingDuration <= 0 then
@@ -0,0 +1,7 @@
1
+ /** @noSelfInFile */
2
+ import { Rect } from "../core/types/rect";
3
+ import { Region } from "../core/types/region";
4
+ export declare class GameMap {
5
+ static get worldBoundsRect(): Rect;
6
+ static get worldBoundsRegion(): Region;
7
+ }
@@ -0,0 +1,32 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
4
+ local ____exports = {}
5
+ local ____rect = require("core.types.rect")
6
+ local Rect = ____rect.Rect
7
+ local ____region = require("core.types.region")
8
+ local Region = ____region.Region
9
+ ____exports.GameMap = __TS__Class()
10
+ local GameMap = ____exports.GameMap
11
+ GameMap.name = "GameMap"
12
+ function GameMap.prototype.____constructor(self)
13
+ end
14
+ __TS__ObjectDefineProperty(
15
+ GameMap,
16
+ "worldBoundsRect",
17
+ {get = function(self)
18
+ local rect = Rect:of(GetWorldBounds())
19
+ rawset(self, "worldBoundsRect", rect)
20
+ return rect
21
+ end}
22
+ )
23
+ __TS__ObjectDefineProperty(
24
+ GameMap,
25
+ "worldBoundsRegion",
26
+ {get = function(self)
27
+ local region = Region:create(self.worldBoundsRect)
28
+ rawset(self, "worldBoundsRegion", region)
29
+ return region
30
+ end}
31
+ )
32
+ return ____exports
@@ -4,14 +4,6 @@ import { Event } from "../../event";
4
4
  import type { Item } from "../../core/types/item";
5
5
  import type { Unit } from "./unit";
6
6
  import type { AbilityTypeId } from "../object-data/entry/ability-type";
7
- interface Fields<K, V> {
8
- set(field: K, value: V): boolean;
9
- get(field: K): V;
10
- has(field: K): boolean;
11
- }
12
- interface AbilityLevel {
13
- realFields: Fields<jabilityreallevelfield, number>;
14
- }
15
7
  export type jabilityfield = jabilityintegerfield | jabilityrealfield | jabilitybooleanfield | jabilitystringfield | jabilityintegerlevelfield | jabilityreallevelfield | jabilitybooleanlevelfield | jabilitystringlevelfield;
16
8
  export declare class AbilitySnapshot {
17
9
  }
@@ -20,7 +12,8 @@ export declare abstract class Ability extends Handle<jability> {
20
12
  protected constructor(handle: jability, typeId: number);
21
13
  toString(): string;
22
14
  get parentTypeId(): number;
23
- get orderId(): number;
15
+ get orderTypeStringId(): string;
16
+ get orderTypeId(): number;
24
17
  abstract readonly owner: Unit | Item;
25
18
  getSnapshot(): AbilitySnapshot;
26
19
  hasField(field: jabilityfield | number): boolean;
@@ -40,9 +33,11 @@ export declare abstract class Ability extends Handle<jability> {
40
33
  setField(field: jabilityintegerlevelfield | jabilityreallevelfield, level: number, value: number): boolean;
41
34
  setField(field: jabilitybooleanlevelfield, level: number, value: boolean): boolean;
42
35
  setField(field: jabilitystringlevelfield, level: number, value: string): boolean;
43
- get realFields(): Fields<jabilityrealfield, number>;
44
- get levels(): readonly AbilityLevel[];
36
+ get levelCount(): number;
45
37
  abstract get level(): number;
38
+ abstract get cooldownRemaining(): number;
39
+ abstract set cooldownRemaining(cooldownRemaining: number);
40
+ abstract interruptCast(): void;
46
41
  static get onCreate(): Event<[Ability]>;
47
42
  static get destroyEvent(): Event<[Ability]>;
48
43
  }
@@ -53,15 +48,21 @@ export declare class UnrecognizedAbility extends Ability {
53
48
  readonly owner: Unit;
54
49
  constructor(typeId: number, owner: Unit);
55
50
  get level(): number;
51
+ get cooldownRemaining(): number;
52
+ set cooldownRemaining(_: number);
53
+ interruptCast(): void;
56
54
  }
57
55
  export declare class UnitAbility extends Ability {
58
56
  readonly owner: Unit;
59
57
  private readonly u;
60
58
  constructor(handle: jability, typeId: number, owner: Unit);
59
+ incrementHideCounter(): void;
60
+ decrementHideCounter(): void;
61
61
  get level(): number;
62
62
  set level(v: number);
63
63
  get cooldownRemaining(): number;
64
- set cooldownRemaining(v: number);
64
+ set cooldownRemaining(cooldownRemaining: number);
65
+ interruptCast(): void;
65
66
  static get onCreate(): Event<[UnitAbility]>;
66
67
  static get onDestroy(): Event<[UnitAbility]>;
67
68
  }
@@ -85,7 +86,9 @@ export declare class ItemAbility extends Ability {
85
86
  setField(field: jabilitybooleanlevelfield, level: number, value: boolean): boolean;
86
87
  setField(field: jabilitystringlevelfield, level: number, value: string): boolean;
87
88
  get level(): number;
89
+ get cooldownRemaining(): number;
90
+ set cooldownRemaining(cooldownRemaining: number);
91
+ interruptCast(): void;
88
92
  static get onCreate(): Event<[ItemAbility]>;
89
93
  static get onDestroy(): Event<[ItemAbility]>;
90
94
  }
91
- export {};