warscript 0.0.1-dev.f48f7bb → 0.0.1-dev.f70428f

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 (186) hide show
  1. package/attributes.d.ts +6 -0
  2. package/attributes.lua +17 -1
  3. package/config.d.ts +5 -0
  4. package/config.lua +10 -0
  5. package/core/types/effect.d.ts +1 -3
  6. package/core/types/effect.lua +26 -29
  7. package/core/types/frame.lua +24 -21
  8. package/core/types/player.d.ts +15 -0
  9. package/core/types/player.lua +56 -14
  10. package/core/types/playerCamera.d.ts +2 -0
  11. package/core/types/playerCamera.lua +123 -5
  12. package/core/types/sound.d.ts +17 -24
  13. package/core/types/sound.lua +99 -24
  14. package/core/types/tileCell.d.ts +11 -1
  15. package/core/types/tileCell.lua +97 -0
  16. package/core/types/timer.d.ts +9 -8
  17. package/core/types/timer.lua +45 -23
  18. package/core/util.lua +6 -1
  19. package/decl/native.d.ts +846 -790
  20. package/engine/behavior.d.ts +12 -1
  21. package/engine/behavior.lua +172 -70
  22. package/engine/behaviour/ability/apply-buff.d.ts +5 -0
  23. package/engine/behaviour/ability/apply-buff.lua +32 -0
  24. package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
  25. package/engine/behaviour/ability/damage.d.ts +9 -3
  26. package/engine/behaviour/ability/damage.lua +26 -38
  27. package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
  28. package/engine/behaviour/ability/emulate-impact.lua +18 -3
  29. package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
  30. package/engine/behaviour/ability/remove-buffs.lua +21 -0
  31. package/engine/behaviour/ability/restore-mana.d.ts +1 -1
  32. package/engine/behaviour/ability/restore-mana.lua +6 -6
  33. package/engine/behaviour/ability.d.ts +7 -2
  34. package/engine/behaviour/ability.lua +42 -24
  35. package/engine/behaviour/unit/stun-immunity.d.ts +11 -5
  36. package/engine/behaviour/unit/stun-immunity.lua +53 -28
  37. package/engine/behaviour/unit.d.ts +36 -2
  38. package/engine/behaviour/unit.lua +192 -6
  39. package/engine/buff.d.ts +66 -44
  40. package/engine/buff.lua +330 -225
  41. package/engine/internal/ability.d.ts +7 -1
  42. package/engine/internal/ability.lua +49 -11
  43. package/engine/internal/item/ability.lua +66 -14
  44. package/engine/internal/item+owner.lua +12 -6
  45. package/engine/internal/item.d.ts +20 -19
  46. package/engine/internal/item.lua +191 -74
  47. package/engine/internal/mechanics/ability-duration.lua +1 -1
  48. package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
  49. package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
  50. package/engine/internal/misc/frame-coordinates.d.ts +2 -0
  51. package/engine/internal/misc/frame-coordinates.lua +21 -0
  52. package/engine/internal/misc/get-terrain-z.d.ts +2 -0
  53. package/engine/internal/misc/get-terrain-z.lua +11 -0
  54. package/engine/internal/misc/player-local-handle.d.ts +2 -0
  55. package/engine/internal/misc/player-local-handle.lua +5 -0
  56. package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
  57. package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
  58. package/engine/internal/object-data/evasion-probability.d.ts +2 -0
  59. package/engine/internal/object-data/evasion-probability.lua +16 -0
  60. package/engine/internal/unit/ability.d.ts +35 -0
  61. package/engine/internal/unit/ability.lua +98 -9
  62. package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
  63. package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
  64. package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
  65. package/engine/internal/unit/add-item-to-slot.lua +52 -0
  66. package/engine/internal/unit/allowed-targets.d.ts +1 -1
  67. package/engine/internal/unit/allowed-targets.lua +9 -1
  68. package/engine/internal/unit/bonus.d.ts +2 -0
  69. package/engine/internal/unit/bonus.lua +17 -0
  70. package/engine/internal/unit/fly-height.d.ts +7 -0
  71. package/engine/internal/unit/fly-height.lua +20 -0
  72. package/engine/internal/unit/item.lua +3 -48
  73. package/engine/internal/unit/main-selected.lua +12 -27
  74. package/engine/internal/unit/order.d.ts +20 -0
  75. package/engine/internal/unit/order.lua +136 -0
  76. package/engine/internal/unit/scale.d.ts +7 -0
  77. package/engine/internal/unit/scale.lua +20 -0
  78. package/engine/internal/unit+ability.lua +10 -1
  79. package/engine/internal/unit+damage.d.ts +2 -11
  80. package/engine/internal/unit+damage.lua +10 -14
  81. package/engine/internal/unit+spellSteal.lua +1 -2
  82. package/engine/internal/unit-missile-launch.lua +45 -14
  83. package/engine/internal/unit.d.ts +43 -17
  84. package/engine/internal/unit.lua +340 -165
  85. package/engine/lightning.d.ts +12 -5
  86. package/engine/lightning.lua +48 -14
  87. package/engine/local-client.d.ts +2 -0
  88. package/engine/local-client.lua +30 -0
  89. package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
  90. package/engine/object-data/auxiliary/animation-name.lua +16 -0
  91. package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
  92. package/engine/object-data/auxiliary/armor-type.lua +46 -0
  93. package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
  94. package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
  95. package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
  96. package/engine/object-data/auxiliary/attack-type.lua +42 -0
  97. package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
  98. package/engine/object-data/auxiliary/movement-type.lua +22 -0
  99. package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
  100. package/engine/object-data/auxiliary/sound-eax.lua +2 -0
  101. package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
  102. package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
  103. package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
  104. package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
  105. package/engine/object-data/entry/ability-type/berserk.lua +13 -0
  106. package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
  107. package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
  108. package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
  109. package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
  110. package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
  111. package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
  112. package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
  113. package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
  114. package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
  115. package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
  116. package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
  117. package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
  118. package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
  119. package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
  120. package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
  121. package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
  122. package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
  123. package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
  124. package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
  125. package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
  126. package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
  127. package/engine/object-data/entry/ability-type/web.d.ts +12 -0
  128. package/engine/object-data/entry/ability-type/web.lua +52 -0
  129. package/engine/object-data/entry/ability-type.d.ts +19 -17
  130. package/engine/object-data/entry/ability-type.lua +85 -24
  131. package/engine/object-data/entry/buff-type/applicable.lua +18 -37
  132. package/engine/object-data/entry/buff-type.d.ts +6 -12
  133. package/engine/object-data/entry/buff-type.lua +13 -29
  134. package/engine/object-data/entry/destructible-type.d.ts +1 -1
  135. package/engine/object-data/entry/item-type.d.ts +1 -1
  136. package/engine/object-data/entry/item-type.lua +4 -4
  137. package/engine/object-data/entry/lightning-type.d.ts +1 -1
  138. package/engine/object-data/entry/sound-preset.d.ts +33 -0
  139. package/engine/object-data/entry/sound-preset.lua +140 -0
  140. package/engine/object-data/entry/unit-type.d.ts +21 -5
  141. package/engine/object-data/entry/unit-type.lua +214 -93
  142. package/engine/object-data/entry/upgrade.d.ts +1 -1
  143. package/engine/object-data/entry/upgrade.lua +4 -4
  144. package/engine/object-data/entry.d.ts +16 -14
  145. package/engine/object-data/entry.lua +60 -32
  146. package/engine/object-field/ability.d.ts +4 -4
  147. package/engine/object-field/ability.lua +7 -6
  148. package/engine/object-field/unit.d.ts +69 -3
  149. package/engine/object-field/unit.lua +264 -7
  150. package/engine/object-field.d.ts +23 -6
  151. package/engine/object-field.lua +309 -126
  152. package/engine/random.d.ts +9 -0
  153. package/engine/random.lua +13 -0
  154. package/engine/standard/entries/buff-type.d.ts +3 -0
  155. package/engine/standard/entries/buff-type.lua +3 -0
  156. package/engine/standard/entries/sound-preset.d.ts +10 -0
  157. package/engine/standard/entries/sound-preset.lua +10 -0
  158. package/engine/standard/fields/unit.d.ts +6 -0
  159. package/engine/standard/fields/unit.lua +11 -0
  160. package/engine/synchronization.d.ts +11 -0
  161. package/engine/synchronization.lua +77 -0
  162. package/engine/text-tag.d.ts +36 -2
  163. package/engine/text-tag.lua +250 -10
  164. package/engine/unit.d.ts +4 -0
  165. package/engine/unit.lua +4 -0
  166. package/net/socket.lua +1 -1
  167. package/objutil/buff.lua +2 -3
  168. package/objutil/unit.lua +8 -0
  169. package/package.json +2 -2
  170. package/patch-lualib.lua +1 -1
  171. package/utility/arrays.d.ts +2 -0
  172. package/utility/arrays.lua +11 -0
  173. package/utility/callback-array.d.ts +17 -0
  174. package/utility/callback-array.lua +61 -0
  175. package/utility/functions.d.ts +8 -0
  176. package/utility/functions.lua +13 -0
  177. package/utility/linked-set.d.ts +2 -0
  178. package/utility/linked-set.lua +22 -1
  179. package/utility/lua-maps.d.ts +15 -2
  180. package/utility/lua-maps.lua +53 -2
  181. package/utility/lua-sets.d.ts +2 -0
  182. package/utility/lua-sets.lua +7 -0
  183. package/utility/reflection.lua +11 -7
  184. package/utility/types.d.ts +3 -0
  185. package/core/types/order.d.ts +0 -25
  186. package/core/types/order.lua +0 -55
@@ -7,10 +7,11 @@ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
7
7
  local __TS__InstanceOf = ____lualib.__TS__InstanceOf
8
8
  local __TS__ArrayMap = ____lualib.__TS__ArrayMap
9
9
  local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
10
+ local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
10
11
  local __TS__StringSplit = ____lualib.__TS__StringSplit
11
12
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
12
13
  local ____exports = {}
13
- local booleanToData, dataToBoolean, numberToData, dataToNumber, stringToData, dataToString, objectDataEntryIdToData, dataToObjectDataEntryId, booleansToData, dataToBooleans, numbersToData, dataToNumbers, stringsToData, dataToStrings, objectDataEntryIdsToData, dataToObjectDataEntryIds, isDataNotBlank
14
+ local booleanToData, dataToBoolean, numberToData, dataToNumber, stringToData, dataToString, objectDataEntryNumericIdToData, dataToObjectDataEntryNumericId, objectDataEntryIdToData, dataToObjectDataEntryId, booleansToData, dataToBooleans, numbersToData, dataToNumbers, stringsToData, dataToStrings, objectDataEntryNumericIdsToData, dataToObjectDataEntryNumericIds, isDataNotBlank
14
15
  local ____attachment_2Dpreset = require("engine.object-data.auxiliary.attachment-preset")
15
16
  local extractAttachmentPresetInputModelPath = ____attachment_2Dpreset.extractAttachmentPresetInputModelPath
16
17
  local extractAttachmentPresetInputNodeFQN = ____attachment_2Dpreset.extractAttachmentPresetInputNodeFQN
@@ -124,7 +125,7 @@ function ObjectDataEntry.getAllByBaseIds(self, baseIds)
124
125
  local constructor = self
125
126
  for id, object in pairs(constructor:getObjectData(currentMap).all) do
126
127
  if dataBaseIds[object.parentId or id] ~= nil then
127
- local objectDataEntry = self:of(dataToObjectDataEntryId(id))
128
+ local objectDataEntry = self:of(dataToObjectDataEntryId(id, self.idType))
128
129
  if objectDataEntry ~= nil and not objectDataEntry.isInternal then
129
130
  result[#result + 1] = objectDataEntry
130
131
  end
@@ -139,7 +140,7 @@ function ObjectDataEntry.getAll(self)
139
140
  local constructor = self
140
141
  local result = {}
141
142
  for id in pairs(constructor:getObjectData(currentMap).all) do
142
- local objectDataEntry = self:of(dataToObjectDataEntryId(id))
143
+ local objectDataEntry = self:of(dataToObjectDataEntryId(id, self.idType))
143
144
  if objectDataEntry ~= nil and not objectDataEntry.isInternal then
144
145
  result[#result + 1] = objectDataEntry
145
146
  end
@@ -156,9 +157,9 @@ function ObjectDataEntry.of(self, id)
156
157
  if object == nil then
157
158
  return nil
158
159
  end
159
- local objectDataEntry = objectDataEntryByObjectDataEntryId[dataToObjectDataEntryId(object.id)]
160
+ local objectDataEntry = objectDataEntryByObjectDataEntryId[dataToObjectDataEntryId(object.id, self.idType)]
160
161
  if objectDataEntry == nil then
161
- if not constructor.IS_SYNTHETIC and (self.BASE_ID == 0 or dataToObjectDataEntryId(object.parentId) == self.BASE_ID) then
162
+ if not constructor.IS_SYNTHETIC and (self.BASE_ID == 0 or dataToObjectDataEntryId(object.parentId, self.idType) == self.BASE_ID) then
162
163
  local AbstractObjectDataEntryView = __TS__Class()
163
164
  AbstractObjectDataEntryView.name = "AbstractObjectDataEntryView"
164
165
  __TS__ClassExtends(AbstractObjectDataEntryView, constructor)
@@ -231,13 +232,13 @@ function ObjectDataEntry.prototype.setStringField(self, field, value)
231
232
  stringToData(value)
232
233
  )
233
234
  end
234
- function ObjectDataEntry.prototype.getObjectDataEntryIdField(self, field)
235
- return dataToObjectDataEntryId(self.object:getField(field))
235
+ function ObjectDataEntry.prototype.getObjectDataEntryNumericIdField(self, field)
236
+ return dataToObjectDataEntryNumericId(self.object:getField(field))
236
237
  end
237
- function ObjectDataEntry.prototype.setObjectDataEntryIdField(self, field, value)
238
+ function ObjectDataEntry.prototype.setObjectDataEntryNumericIdField(self, field, value)
238
239
  self.object:setField(
239
240
  field,
240
- objectDataEntryIdToData(value)
241
+ objectDataEntryNumericIdToData(value)
241
242
  )
242
243
  end
243
244
  function ObjectDataEntry.prototype.getAttachmentPresetField(self, modelPathField, nodeFQNField)
@@ -285,13 +286,13 @@ function ObjectDataEntry.prototype.setStringsField(self, field, values)
285
286
  stringsToData(values)
286
287
  )
287
288
  end
288
- function ObjectDataEntry.prototype.getObjectDataEntryIdsField(self, field)
289
- return dataToObjectDataEntryIds(self.object:getField(field))
289
+ function ObjectDataEntry.prototype.getObjectDataEntryNumericIdsField(self, field)
290
+ return dataToObjectDataEntryNumericIds(self.object:getField(field))
290
291
  end
291
- function ObjectDataEntry.prototype.setObjectDataEntryIdsField(self, field, values)
292
+ function ObjectDataEntry.prototype.setObjectDataEntryNumericIdsField(self, field, values)
292
293
  self.object:setField(
293
294
  field,
294
- objectDataEntryIdsToData(values)
295
+ objectDataEntryNumericIdsToData(values)
295
296
  )
296
297
  end
297
298
  function ObjectDataEntry.prototype.getAttachmentPresetListField(self, modelPathListField, nodeFQNFields)
@@ -369,16 +370,16 @@ function ObjectDataEntry.prototype.setStringLevelField(self, field, values)
369
370
  stringToData
370
371
  )
371
372
  end
372
- function ObjectDataEntry.prototype.getObjectDataEntryIdLevelField(self, field)
373
- return self:getLevelField(field, dataToObjectDataEntryId)
373
+ function ObjectDataEntry.prototype.getObjectDataEntryNumericIdLevelField(self, field)
374
+ return self:getLevelField(field, dataToObjectDataEntryNumericId)
374
375
  end
375
- function ObjectDataEntry.prototype.setObjectDataEntryIdLevelField(self, field, values)
376
+ function ObjectDataEntry.prototype.setObjectDataEntryNumericIdLevelField(self, field, values)
376
377
  self:setLevelField(
377
378
  field,
378
379
  values,
379
380
  ____exports.extractObjectDataEntryLevelFieldValue,
380
- dataToObjectDataEntryId,
381
- objectDataEntryIdToData
381
+ dataToObjectDataEntryNumericId,
382
+ objectDataEntryNumericIdToData
382
383
  )
383
384
  end
384
385
  function ObjectDataEntry.prototype.getBooleansLevelField(self, field)
@@ -417,23 +418,26 @@ function ObjectDataEntry.prototype.setStringsLevelField(self, field, values)
417
418
  stringsToData
418
419
  )
419
420
  end
420
- function ObjectDataEntry.prototype.getObjectDataEntryIdsLevelField(self, field)
421
- return self:getLevelField(field, dataToObjectDataEntryIds)
421
+ function ObjectDataEntry.prototype.getObjectDataEntryNumericIdsLevelField(self, field)
422
+ return self:getLevelField(field, dataToObjectDataEntryNumericIds)
422
423
  end
423
- function ObjectDataEntry.prototype.setObjectDataEntryIdsLevelField(self, field, values)
424
+ function ObjectDataEntry.prototype.setObjectDataEntryNumericIdsLevelField(self, field, values)
424
425
  self:setLevelField(
425
426
  field,
426
427
  values,
427
428
  ____exports.extractObjectDataEntryLevelArrayFieldValue,
428
- dataToObjectDataEntryIds,
429
- objectDataEntryIdsToData
429
+ dataToObjectDataEntryNumericIds,
430
+ objectDataEntryNumericIdsToData
430
431
  )
431
432
  end
432
433
  function ObjectDataEntry.prototype.getLevelField(self, field, dataToValue)
433
434
  local values = {}
434
435
  local object = self.object
435
436
  for level = 1, tonumber(object:getField("levels")) or 1 do
436
- values[level] = dataToValue(object:getField((field .. "+") .. tostring(level)))
437
+ values[level] = dataToValue(
438
+ object:getField((field .. "+") .. tostring(level)),
439
+ "number"
440
+ )
437
441
  end
438
442
  return values
439
443
  end
@@ -473,6 +477,14 @@ function ObjectDataEntry.prototype.setLevelField(self, field, supplier, extracto
473
477
  end
474
478
  ObjectDataEntry.BASE_ID = 0
475
479
  ObjectDataEntry.IS_SYNTHETIC = false
480
+ __TS__SetDescriptor(
481
+ ObjectDataEntry.prototype,
482
+ "type",
483
+ {get = function(self)
484
+ return self.constructor
485
+ end},
486
+ true
487
+ )
476
488
  __TS__SetDescriptor(
477
489
  ObjectDataEntry.prototype,
478
490
  "isInternal",
@@ -491,11 +503,18 @@ __TS__SetDescriptor(
491
503
  },
492
504
  true
493
505
  )
506
+ __TS__ObjectDefineProperty(
507
+ ObjectDataEntry,
508
+ "idType",
509
+ {get = function(self)
510
+ return type(self.BASE_ID) == "number" and "number" or "string"
511
+ end}
512
+ )
494
513
  __TS__SetDescriptor(
495
514
  ObjectDataEntry.prototype,
496
515
  "id",
497
516
  {get = function(self)
498
- return dataToObjectDataEntryId(self.object.id)
517
+ return dataToObjectDataEntryId(self.object.id, self.type.idType)
499
518
  end},
500
519
  true
501
520
  )
@@ -503,7 +522,7 @@ __TS__SetDescriptor(
503
522
  ObjectDataEntry.prototype,
504
523
  "baseId",
505
524
  {get = function(self)
506
- return dataToObjectDataEntryId(self.object.parentId or self.object.id)
525
+ return dataToObjectDataEntryId(self.object.parentId or self.object.id, self.type.idType)
507
526
  end},
508
527
  true
509
528
  )
@@ -533,10 +552,10 @@ end
533
552
  dataToString = function(data)
534
553
  return tostring(data or "")
535
554
  end
536
- objectDataEntryIdToData = function(value)
555
+ objectDataEntryNumericIdToData = function(value)
537
556
  return value == 0 and "" or string.pack(">I4", value)
538
557
  end
539
- dataToObjectDataEntryId = function(data)
558
+ dataToObjectDataEntryNumericId = function(data)
540
559
  local dataString = dataToString(data)
541
560
  if isDataNotBlank(nil, dataString) then
542
561
  return (string.unpack(">I4", dataString))
@@ -544,6 +563,15 @@ dataToObjectDataEntryId = function(data)
544
563
  return 0
545
564
  end
546
565
  end
566
+ objectDataEntryIdToData = function(value)
567
+ return type(value) == "number" and objectDataEntryNumericIdToData(value) or value
568
+ end
569
+ dataToObjectDataEntryId = function(data, ____type)
570
+ if ____type == "number" then
571
+ return dataToObjectDataEntryNumericId(data)
572
+ end
573
+ return dataToString(data)
574
+ end
547
575
  booleansToData = function(value)
548
576
  return table.concat(
549
577
  __TS__ArrayMap(
@@ -607,16 +635,16 @@ dataToStrings = function(data)
607
635
  function(____, data) return dataToString(data) end
608
636
  )
609
637
  end
610
- objectDataEntryIdsToData = function(value)
638
+ objectDataEntryNumericIdsToData = function(value)
611
639
  return table.concat(
612
640
  __TS__ArrayMap(
613
641
  value,
614
- function(____, objectDataEntryId) return objectDataEntryIdToData(objectDataEntryId) end
642
+ function(____, objectDataEntryId) return objectDataEntryNumericIdToData(objectDataEntryId) end
615
643
  ),
616
644
  ","
617
645
  )
618
646
  end
619
- dataToObjectDataEntryIds = function(data)
647
+ dataToObjectDataEntryNumericIds = function(data)
620
648
  return __TS__ArrayMap(
621
649
  __TS__ArrayFilter(
622
650
  __TS__StringSplit(
@@ -625,7 +653,7 @@ dataToObjectDataEntryIds = function(data)
625
653
  ),
626
654
  isDataNotBlank
627
655
  ),
628
- function(____, data) return dataToObjectDataEntryId(data) end
656
+ function(____, data) return dataToObjectDataEntryNumericId(data) end
629
657
  )
630
658
  end
631
659
  isDataNotBlank = function(self, data)
@@ -12,7 +12,7 @@ import { ReadonlyNonEmptyLinkedSet } from "../../utility/linked-set";
12
12
  export declare abstract class AbilityField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType extends jabilityfield = jabilityfield> extends ObjectField<AbilityType, Ability, ValueType, NativeFieldType> {
13
13
  protected get instanceClass(): typeof Ability;
14
14
  protected getObjectDataEntryId(instance: Ability): AbilityTypeId;
15
- protected hasNativeFieldValue(instance: Ability): boolean;
15
+ protected hasNativeFieldValue(abilityTypeId: AbilityTypeId): boolean;
16
16
  static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<AbilityField>>;
17
17
  }
18
18
  export declare class AbilityBooleanField extends AbilityField<boolean, jabilitybooleanfield> {
@@ -48,7 +48,7 @@ export declare class AbilityStringField extends AbilityField<string, jabilitystr
48
48
  export declare abstract class AbilityArrayField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType extends jabilityfield = jabilityfield> extends ObjectArrayField<AbilityType, Ability, ValueType, NativeFieldType> {
49
49
  protected get instanceClass(): typeof Ability;
50
50
  protected getObjectDataEntryId(instance: Ability): AbilityTypeId;
51
- protected hasNativeFieldValue(instance: Ability): boolean;
51
+ protected hasNativeFieldValue(abilityTypeId: AbilityTypeId): boolean;
52
52
  }
53
53
  export declare class AbilityStringArrayField extends AbilityArrayField<string, jabilitystringlevelfield> {
54
54
  protected get defaultValue(): string;
@@ -68,7 +68,7 @@ export declare abstract class AbilityLevelField<ValueType extends number | strin
68
68
  protected get instanceClass(): typeof Ability;
69
69
  protected getLevelCount(entry: AbilityType | Ability): number;
70
70
  protected getObjectDataEntryId(instance: Ability): AbilityTypeId;
71
- protected hasNativeFieldValue(instance: Ability): boolean;
71
+ protected hasNativeFieldValue(abilityTypeId: AbilityTypeId): boolean;
72
72
  static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<ReadonlyObjectLevelFieldType<AbilityLevelField>>;
73
73
  }
74
74
  export declare class AbilityBooleanLevelField extends AbilityLevelField<boolean, boolean, jabilityintegerlevelfield> {
@@ -117,7 +117,7 @@ export declare abstract class AbilityEnumLevelField<T extends number> extends Ab
117
117
  protected getNativeFieldById(id: number): jabilityintegerlevelfield;
118
118
  protected getNativeFieldValue(instance: Ability, level: number): T;
119
119
  protected setNativeFieldValue(instance: Ability, level: number, value: T): boolean;
120
- static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<AbilityBooleanLevelField>;
120
+ static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<AbilityEnumLevelField<number>>;
121
121
  }
122
122
  export declare class AbilityBuffPolarityLevelField extends AbilityEnumLevelField<BuffPolarity> {
123
123
  protected values: ReadonlyNonEmptyLinkedSet<BuffPolarity>;
@@ -7,6 +7,7 @@ local __TS__InstanceOf = ____lualib.__TS__InstanceOf
7
7
  local ____exports = {}
8
8
  local ____ability = require("engine.internal.ability")
9
9
  local Ability = ____ability.Ability
10
+ local abilityTypeHasField = ____ability.abilityTypeHasField
10
11
  local ____object_2Dfield = require("engine.object-field")
11
12
  local ObjectArrayField = ____object_2Dfield.ObjectArrayField
12
13
  local ObjectField = ____object_2Dfield.ObjectField
@@ -29,8 +30,8 @@ __TS__ClassExtends(AbilityField, ObjectField)
29
30
  function AbilityField.prototype.getObjectDataEntryId(self, instance)
30
31
  return instance.typeId
31
32
  end
32
- function AbilityField.prototype.hasNativeFieldValue(self, instance)
33
- return instance:hasField(self.nativeField)
33
+ function AbilityField.prototype.hasNativeFieldValue(self, abilityTypeId)
34
+ return abilityTypeHasField(abilityTypeId, self.nativeField)
34
35
  end
35
36
  __TS__SetDescriptor(
36
37
  AbilityField.prototype,
@@ -197,8 +198,8 @@ __TS__ClassExtends(AbilityArrayField, ObjectArrayField)
197
198
  function AbilityArrayField.prototype.getObjectDataEntryId(self, instance)
198
199
  return instance.typeId
199
200
  end
200
- function AbilityArrayField.prototype.hasNativeFieldValue(self, instance)
201
- return instance:hasField(self.nativeField)
201
+ function AbilityArrayField.prototype.hasNativeFieldValue(self, abilityTypeId)
202
+ return abilityTypeHasField(abilityTypeId, self.nativeField)
202
203
  end
203
204
  __TS__SetDescriptor(
204
205
  AbilityArrayField.prototype,
@@ -269,8 +270,8 @@ end
269
270
  function AbilityLevelField.prototype.getObjectDataEntryId(self, instance)
270
271
  return instance.typeId
271
272
  end
272
- function AbilityLevelField.prototype.hasNativeFieldValue(self, instance)
273
- return instance:hasField(self.nativeField)
273
+ function AbilityLevelField.prototype.hasNativeFieldValue(self, abilityTypeId)
274
+ return abilityTypeHasField(abilityTypeId, self.nativeField)
274
275
  end
275
276
  __TS__SetDescriptor(
276
277
  AbilityLevelField.prototype,
@@ -1,16 +1,82 @@
1
1
  /** @noSelfInFile */
2
2
  import { Unit } from "../internal/unit";
3
- import { ObjectField } from "../object-field";
3
+ import { ObjectField, ObjectFieldValueChangeEvent, ObjectLevelField, ObjectLevelFieldValueChangeEvent, ReadonlyObjectFieldType, ReadonlyObjectLevelFieldType } from "../object-field";
4
4
  import { UnitType, UnitTypeId } from "../object-data/entry/unit-type";
5
+ import { ReadonlyNonEmptyLinkedSet } from "../../utility/linked-set";
6
+ import { AttackType } from "../object-data/auxiliary/attack-type";
7
+ import { UnitClassifications } from "../object-data/auxiliary/unit-classification";
5
8
  export declare abstract class UnitField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType = any> extends ObjectField<UnitType, Unit, ValueType, NativeFieldType> {
6
9
  protected get instanceClass(): typeof Unit;
7
10
  protected getObjectDataEntryId(instance: Unit): UnitTypeId;
11
+ protected hasNativeFieldValue(): boolean;
12
+ static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<UnitField>>;
13
+ }
14
+ export declare class UnitBooleanField extends UnitField<boolean, junitbooleanfield> {
15
+ protected get defaultValue(): boolean;
16
+ protected getNativeFieldById(id: number): junitbooleanfield;
17
+ protected getNativeFieldValue(instance: Unit): boolean;
18
+ protected setNativeFieldValue(instance: Unit, value: boolean): boolean;
19
+ static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<UnitBooleanField>>;
20
+ }
21
+ export declare class UnitFloatField extends UnitField<number, junitrealfield> {
22
+ protected get defaultValue(): number;
23
+ protected getNativeFieldById(id: number): junitrealfield;
24
+ protected getNativeFieldValue(instance: Unit): number;
25
+ protected setNativeFieldValue(instance: Unit, value: number): boolean;
26
+ static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<UnitFloatField>>;
27
+ }
28
+ export declare class UnitIntegerField extends UnitField<number, junitintegerfield> {
29
+ protected get defaultValue(): number;
30
+ protected getNativeFieldById(id: number): junitintegerfield;
31
+ protected getNativeFieldValue(instance: Unit): number;
32
+ protected setNativeFieldValue(instance: Unit, value: number): boolean;
33
+ static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<UnitIntegerField>>;
8
34
  }
9
35
  export declare class UnitStringField extends UnitField<string, junitstringfield> {
10
36
  protected get defaultValue(): string;
11
37
  protected getNativeFieldById(id: number): junitstringfield;
12
- protected hasNativeFieldValue(): boolean;
13
38
  protected getNativeFieldValue(instance: Unit): string;
14
- protected getObjectDataEntryId(instance: Unit): UnitTypeId;
15
39
  protected setNativeFieldValue(instance: Unit, value: string): boolean;
40
+ static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<UnitStringField>>;
41
+ }
42
+ type junitweaponfield = junitweaponbooleanfield | junitweaponintegerfield | junitweaponrealfield | junitweaponstringfield;
43
+ export declare abstract class UnitWeaponField<ValueType extends number | string | boolean = number | string | boolean, InputValueType extends ValueType = never, NativeFieldType extends junitweaponfield = junitweaponfield> extends ObjectLevelField<UnitType, Unit, ValueType, InputValueType, NativeFieldType> {
44
+ protected get instanceClass(): typeof Unit;
45
+ protected getLevelCount(): number;
46
+ protected getObjectDataEntryId(instance: Unit): UnitTypeId;
47
+ protected hasNativeFieldValue(): boolean;
48
+ static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<ReadonlyObjectLevelFieldType<UnitWeaponField>>;
49
+ }
50
+ export declare abstract class UnitNumberWeaponField<NativeFieldType extends junitweaponintegerfield | junitweaponrealfield = junitweaponintegerfield | junitweaponrealfield> extends UnitWeaponField<number, number, NativeFieldType> {
51
+ protected get defaultValue(): number;
52
+ static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<UnitNumberWeaponField>;
53
+ }
54
+ export declare abstract class UnitEnumWeaponField<T extends number> extends UnitWeaponField<T, T, junitweaponintegerfield> {
55
+ protected abstract values: ReadonlyNonEmptyLinkedSet<T>;
56
+ protected get defaultValue(): T;
57
+ protected getNativeFieldById(id: number): junitweaponintegerfield;
58
+ protected getNativeFieldValue(instance: Unit, index: number): T;
59
+ protected setNativeFieldValue(instance: Unit, index: number, value: T): boolean;
60
+ static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<UnitEnumWeaponField<number>>;
61
+ }
62
+ export declare class UnitAttackTypeWeaponField extends UnitEnumWeaponField<AttackType> {
63
+ protected values: ReadonlyNonEmptyLinkedSet<AttackType>;
64
+ }
65
+ export declare class UnitClassificationsField extends UnitField<UnitClassifications, junitintegerfield> {
66
+ protected get defaultValue(): UnitClassifications;
67
+ protected getNativeFieldById(id: number): junitintegerfield;
68
+ protected getNativeFieldValue(instance: Unit): UnitClassifications;
69
+ protected setNativeFieldValue(instance: Unit, value: UnitClassifications): boolean;
70
+ }
71
+ export declare class UnitFlyHeightField extends UnitFloatField {
72
+ protected getNativeFieldValue(instance: Unit): number;
73
+ protected setNativeFieldValue(instance: Unit, value: number): boolean;
74
+ }
75
+ export declare class UnitPropulsionWindowField extends UnitFloatField {
76
+ protected getNativeFieldValue(instance: Unit): number;
77
+ protected setNativeFieldValue(instance: Unit, value: number): boolean;
78
+ }
79
+ export declare class UnitScalingValueField extends UnitFloatField {
80
+ protected setNativeFieldValue(instance: Unit, value: number): boolean;
16
81
  }
82
+ export {};