warscript 0.0.1-dev.1bb9c4e → 0.0.1-dev.20f0f7e

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 (98) hide show
  1. package/attributes.d.ts +5 -0
  2. package/attributes.lua +8 -1
  3. package/core/types/frame.lua +24 -21
  4. package/core/types/player.lua +3 -1
  5. package/core/types/playerCamera.d.ts +2 -0
  6. package/core/types/playerCamera.lua +123 -5
  7. package/core/types/tileCell.d.ts +9 -0
  8. package/core/types/tileCell.lua +92 -0
  9. package/core/types/timer.d.ts +2 -1
  10. package/core/types/timer.lua +21 -2
  11. package/decl/native.d.ts +846 -790
  12. package/engine/behavior.d.ts +5 -0
  13. package/engine/behavior.lua +106 -27
  14. package/engine/behaviour/ability/apply-buff.lua +1 -1
  15. package/engine/behaviour/ability/damage.d.ts +6 -3
  16. package/engine/behaviour/ability/damage.lua +24 -36
  17. package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
  18. package/engine/behaviour/ability/emulate-impact.lua +11 -3
  19. package/engine/behaviour/ability/restore-mana.d.ts +1 -1
  20. package/engine/behaviour/ability/restore-mana.lua +6 -6
  21. package/engine/behaviour/ability.lua +8 -17
  22. package/engine/behaviour/unit/stun-immunity.d.ts +5 -3
  23. package/engine/behaviour/unit/stun-immunity.lua +43 -27
  24. package/engine/behaviour/unit.d.ts +31 -1
  25. package/engine/behaviour/unit.lua +185 -4
  26. package/engine/buff.d.ts +2 -4
  27. package/engine/buff.lua +68 -83
  28. package/engine/internal/ability.d.ts +7 -1
  29. package/engine/internal/ability.lua +49 -9
  30. package/engine/internal/item/ability.lua +63 -11
  31. package/engine/internal/item+owner.lua +12 -6
  32. package/engine/internal/item.d.ts +6 -5
  33. package/engine/internal/item.lua +97 -26
  34. package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
  35. package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
  36. package/engine/internal/misc/frame-coordinates.d.ts +2 -0
  37. package/engine/internal/misc/frame-coordinates.lua +21 -0
  38. package/engine/internal/misc/get-terrain-z.d.ts +2 -0
  39. package/engine/internal/misc/get-terrain-z.lua +11 -0
  40. package/engine/internal/misc/player-local-handle.d.ts +2 -0
  41. package/engine/internal/misc/player-local-handle.lua +5 -0
  42. package/engine/internal/unit/ability.d.ts +35 -0
  43. package/engine/internal/unit/ability.lua +63 -1
  44. package/engine/internal/unit/allowed-targets.d.ts +1 -1
  45. package/engine/internal/unit/allowed-targets.lua +9 -1
  46. package/engine/internal/unit/order.d.ts +20 -0
  47. package/engine/internal/unit/order.lua +136 -0
  48. package/engine/internal/unit+ability.lua +10 -1
  49. package/engine/internal/unit+damage.d.ts +2 -11
  50. package/engine/internal/unit+damage.lua +10 -14
  51. package/engine/internal/unit+spellSteal.lua +1 -2
  52. package/engine/internal/unit-missile-launch.lua +9 -2
  53. package/engine/internal/unit.d.ts +26 -9
  54. package/engine/internal/unit.lua +251 -110
  55. package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
  56. package/engine/object-data/auxiliary/armor-type.lua +46 -0
  57. package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
  58. package/engine/object-data/auxiliary/attack-type.lua +42 -0
  59. package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
  60. package/engine/object-data/auxiliary/movement-type.lua +22 -0
  61. package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
  62. package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
  63. package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
  64. package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
  65. package/engine/object-data/entry/ability-type.lua +1 -3
  66. package/engine/object-data/entry/unit-type.d.ts +13 -4
  67. package/engine/object-data/entry/unit-type.lua +153 -85
  68. package/engine/object-field/ability.d.ts +4 -4
  69. package/engine/object-field/ability.lua +7 -6
  70. package/engine/object-field/unit.d.ts +57 -3
  71. package/engine/object-field/unit.lua +207 -7
  72. package/engine/object-field.d.ts +17 -6
  73. package/engine/object-field.lua +188 -92
  74. package/engine/random.d.ts +5 -0
  75. package/engine/random.lua +3 -0
  76. package/engine/standard/fields/unit.d.ts +4 -0
  77. package/engine/standard/fields/unit.lua +7 -0
  78. package/engine/text-tag.d.ts +36 -2
  79. package/engine/text-tag.lua +249 -10
  80. package/engine/unit.d.ts +1 -0
  81. package/engine/unit.lua +1 -0
  82. package/objutil/buff.lua +1 -2
  83. package/package.json +2 -2
  84. package/patch-lualib.lua +1 -1
  85. package/utility/arrays.d.ts +1 -0
  86. package/utility/arrays.lua +3 -0
  87. package/utility/callback-array.d.ts +13 -0
  88. package/utility/callback-array.lua +46 -0
  89. package/utility/functions.d.ts +8 -0
  90. package/utility/functions.lua +13 -0
  91. package/utility/linked-set.d.ts +1 -0
  92. package/utility/linked-set.lua +3 -0
  93. package/utility/lua-maps.d.ts +4 -0
  94. package/utility/lua-maps.lua +20 -0
  95. package/utility/lua-sets.d.ts +2 -0
  96. package/utility/lua-sets.lua +7 -0
  97. package/core/types/order.d.ts +0 -25
  98. package/core/types/order.lua +0 -55
@@ -0,0 +1,46 @@
1
+ local ____exports = {}
2
+ local ____records = require("utility.records")
3
+ local invertRecord = ____records.invertRecord
4
+ local stringByArmorType = {
5
+ [0] = "small",
6
+ [1] = "medium",
7
+ [2] = "large",
8
+ [3] = "fort",
9
+ [4] = "normal",
10
+ [5] = "hero",
11
+ [6] = "divine",
12
+ [7] = "none"
13
+ }
14
+ local armorTypeByString = invertRecord(stringByArmorType)
15
+ local nativeByArmorType = {
16
+ [0] = DEFENSE_TYPE_LIGHT,
17
+ [1] = DEFENSE_TYPE_MEDIUM,
18
+ [2] = DEFENSE_TYPE_LARGE,
19
+ [3] = DEFENSE_TYPE_FORT,
20
+ [4] = DEFENSE_TYPE_NORMAL,
21
+ [5] = DEFENSE_TYPE_HERO,
22
+ [6] = DEFENSE_TYPE_DIVINE,
23
+ [7] = DEFENSE_TYPE_NONE
24
+ }
25
+ local armorTypeByNative = invertRecord(nativeByArmorType)
26
+ ---
27
+ -- @internal For use by internal systems only.
28
+ ____exports.armorTypeToString = function(armorType)
29
+ return stringByArmorType[armorType]
30
+ end
31
+ ---
32
+ -- @internal For use by internal systems only.
33
+ ____exports.stringToArmorType = function(____string)
34
+ return armorTypeByString[____string] or 7
35
+ end
36
+ ---
37
+ -- @internal For use by internal systems only.
38
+ ____exports.armorTypeToNative = function(armorType)
39
+ return nativeByArmorType[armorType]
40
+ end
41
+ ---
42
+ -- @internal For use by internal systems only.
43
+ ____exports.nativeToArmorType = function(armorType)
44
+ return armorTypeByNative[armorType]
45
+ end
46
+ return ____exports
@@ -1,11 +1,10 @@
1
1
  /** @noSelfInFile */
2
2
  export declare const enum AttackType {
3
- NONE = "unknown",
4
- NORMAL = "normal",
5
- PIERCE = "pierce",
6
- SIEGE = "siege",
7
- SPELL = "spells",
8
- CHAOS = "chaos",
9
- MAGIC = "magic",
10
- HERO = "hero"
3
+ SPELL = 0,
4
+ NORMAL = 1,
5
+ PIERCE = 2,
6
+ SIEGE = 3,
7
+ MAGIC = 4,
8
+ CHAOS = 5,
9
+ HERO = 6
11
10
  }
@@ -1,2 +1,44 @@
1
1
  local ____exports = {}
2
+ local ____records = require("utility.records")
3
+ local invertRecord = ____records.invertRecord
4
+ local stringByAttackType = {
5
+ [1] = "normal",
6
+ [2] = "pierce",
7
+ [3] = "siege",
8
+ [0] = "spells",
9
+ [5] = "chaos",
10
+ [4] = "magic",
11
+ [6] = "hero"
12
+ }
13
+ local attackTypeByString = invertRecord(stringByAttackType)
14
+ local nativeByAttackType = {
15
+ [1] = ATTACK_TYPE_MELEE,
16
+ [2] = ATTACK_TYPE_PIERCE,
17
+ [3] = ATTACK_TYPE_SIEGE,
18
+ [0] = ATTACK_TYPE_NORMAL,
19
+ [5] = ATTACK_TYPE_CHAOS,
20
+ [4] = ATTACK_TYPE_MAGIC,
21
+ [6] = ATTACK_TYPE_HERO
22
+ }
23
+ local attackTypeByNative = invertRecord(nativeByAttackType)
24
+ ---
25
+ -- @internal For use by internal systems only.
26
+ ____exports.attackTypeToString = function(attackType)
27
+ return attackType ~= nil and stringByAttackType[attackType] or "unknown"
28
+ end
29
+ ---
30
+ -- @internal For use by internal systems only.
31
+ ____exports.stringToAttackType = function(____string)
32
+ return attackTypeByString[____string]
33
+ end
34
+ ---
35
+ -- @internal For use by internal systems only.
36
+ ____exports.attackTypeToNative = function(attackType)
37
+ return nativeByAttackType[attackType]
38
+ end
39
+ ---
40
+ -- @internal For use by internal systems only.
41
+ ____exports.nativeToAttackType = function(attackType)
42
+ return attackTypeByNative[attackType]
43
+ end
2
44
  return ____exports
@@ -1,10 +1,10 @@
1
1
  /** @noSelfInFile */
2
2
  export declare const enum MovementType {
3
- NONE = "",
4
- FLOAT = "float",
5
- FLY = "fly",
6
- FOOT = "foot",
7
- HORSE = "horse",
8
- HOVER = "hover",
9
- AMPHIBIOUS = "amph"
3
+ NONE = 0,
4
+ FOOT = 1,
5
+ FLY = 2,
6
+ HORSE = 4,
7
+ HOVER = 8,
8
+ FLOAT = 16,
9
+ AMPHIBIOUS = 32
10
10
  }
@@ -1,2 +1,24 @@
1
1
  local ____exports = {}
2
+ local ____records = require("utility.records")
3
+ local invertRecord = ____records.invertRecord
4
+ local stringByMovementType = {
5
+ [0] = "",
6
+ [16] = "float",
7
+ [2] = "fly",
8
+ [1] = "foot",
9
+ [4] = "horse",
10
+ [8] = "hover",
11
+ [32] = "amph"
12
+ }
13
+ local movementTypeByString = invertRecord(stringByMovementType)
14
+ ---
15
+ -- @internal For use by internal systems only.
16
+ ____exports.movementTypeToString = function(movementType)
17
+ return stringByMovementType[movementType]
18
+ end
19
+ ---
20
+ -- @internal For use by internal systems only.
21
+ ____exports.stringToMovementType = function(____string)
22
+ return movementTypeByString[____string] or 0
23
+ end
2
24
  return ____exports
@@ -0,0 +1,6 @@
1
+ /** @noSelfInFile */
2
+ export declare enum UnitAttribute {
3
+ STRENGTH = 1,
4
+ INTELLIGENCE = 2,
5
+ AGILITY = 3
6
+ }
@@ -0,0 +1,9 @@
1
+ local ____exports = {}
2
+ ____exports.UnitAttribute = UnitAttribute or ({})
3
+ ____exports.UnitAttribute.STRENGTH = 1
4
+ ____exports.UnitAttribute[____exports.UnitAttribute.STRENGTH] = "STRENGTH"
5
+ ____exports.UnitAttribute.INTELLIGENCE = 2
6
+ ____exports.UnitAttribute[____exports.UnitAttribute.INTELLIGENCE] = "INTELLIGENCE"
7
+ ____exports.UnitAttribute.AGILITY = 3
8
+ ____exports.UnitAttribute[____exports.UnitAttribute.AGILITY] = "AGILITY"
9
+ return ____exports
@@ -0,0 +1,8 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityType, AbilityTypeId } from "../ability-type";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ export declare class PermanentInvisibilityAbilityType extends AbilityType {
5
+ static readonly BASE_ID: AbilityTypeId;
6
+ get shouldAutoAcquireAttackTargets(): boolean[];
7
+ set shouldAutoAcquireAttackTargets(shouldAutoAcquireAttackTargets: ObjectDataEntryLevelFieldValueSupplier<boolean>);
8
+ }
@@ -0,0 +1,26 @@
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.PermanentInvisibilityAbilityType = __TS__Class()
9
+ local PermanentInvisibilityAbilityType = ____exports.PermanentInvisibilityAbilityType
10
+ PermanentInvisibilityAbilityType.name = "PermanentInvisibilityAbilityType"
11
+ __TS__ClassExtends(PermanentInvisibilityAbilityType, AbilityType)
12
+ PermanentInvisibilityAbilityType.BASE_ID = fourCC("Apiv")
13
+ __TS__SetDescriptor(
14
+ PermanentInvisibilityAbilityType.prototype,
15
+ "shouldAutoAcquireAttackTargets",
16
+ {
17
+ get = function(self)
18
+ return self:getBooleanLevelField("Gho1")
19
+ end,
20
+ set = function(self, shouldAutoAcquireAttackTargets)
21
+ self:setBooleanLevelField("Gho1", shouldAutoAcquireAttackTargets)
22
+ end
23
+ },
24
+ true
25
+ )
26
+ return ____exports
@@ -979,9 +979,7 @@ for abilityTypeId, animationFQN in pairs(postcompile(function() return castAnima
979
979
  4,
980
980
  function(caster, ability)
981
981
  if ability:getField(ABILITY_RLF_CASTING_TIME) ~= 0 then
982
- Timer:run(function()
983
- caster:playAnimation(animationFQN)
984
- end)
982
+ Timer:run(caster, "playAnimation", animationFQN)
985
983
  end
986
984
  end
987
985
  )
@@ -13,6 +13,7 @@ import type { AbilityTypeId } from "./ability-type";
13
13
  import type { UpgradeId } from "./upgrade";
14
14
  import { AnimationQualifier } from "../auxiliary/animation-qualifier";
15
15
  import { AttackType } from "../auxiliary/attack-type";
16
+ import { ArmorType } from "../auxiliary/armor-type";
16
17
  export type UnitTypeId = ObjectDataEntryId & number & {
17
18
  readonly __unitTypeId: unique symbol;
18
19
  };
@@ -23,8 +24,8 @@ export declare class UnitTypeWeapon {
23
24
  private readonly unitType;
24
25
  private readonly index;
25
26
  private constructor();
26
- get attackType(): AttackType;
27
- set attackType(attackType: AttackType);
27
+ get attackType(): AttackType | undefined;
28
+ set attackType(attackType: AttackType | undefined);
28
29
  get backSwingDuration(): number;
29
30
  set backSwingDuration(backSwingDuration: number);
30
31
  get cooldown(): number;
@@ -144,6 +145,8 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
144
145
  set runSpeedSD(runSpeedSD: number);
145
146
  get runSpeedHD(): number;
146
147
  set runSpeedHD(runSpeedHD: number);
148
+ get selectionCircleHeight(): number;
149
+ set selectionCircleHeight(height: number);
147
150
  get selectionCircleScale(): number;
148
151
  set selectionCircleScale(selectionCircleScale: number);
149
152
  get selectionCircleScaleSD(): number;
@@ -182,16 +185,20 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
182
185
  set walkSpeedSD(walkSpeedSD: number);
183
186
  get walkSpeedHD(): number;
184
187
  set walkSpeedHD(walkSpeedHD: number);
188
+ get armor(): number;
189
+ set armor(armor: number);
185
190
  get armorSoundType(): ArmorSoundType;
186
191
  set armorSoundType(armorSoundType: ArmorSoundType);
187
192
  get armorSoundTypeSD(): ArmorSoundType;
188
193
  set armorSoundTypeSD(armorSoundTypeSD: ArmorSoundType);
189
194
  get armorSoundTypeHD(): ArmorSoundType;
190
195
  set armorSoundTypeHD(armorSoundTypeHD: ArmorSoundType);
196
+ get armorType(): ArmorType;
197
+ set armorType(armorType: ArmorType);
191
198
  get combatClassifications(): CombatClassifications;
192
199
  set combatClassifications(combatClassifications: CombatClassifications);
193
- get unitClassifications(): UnitClassifications;
194
- set unitClassifications(unitClassifications: UnitClassifications);
200
+ get classifications(): UnitClassifications;
201
+ set classifications(unitClassifications: UnitClassifications);
195
202
  get weapons(): TupleOf<UnitTypeWeapon, 2>;
196
203
  get firstWeapon(): UnitTypeWeapon;
197
204
  get secondWeapon(): UnitTypeWeapon;
@@ -225,6 +232,8 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
225
232
  set goldCost(goldCost: number);
226
233
  get healthRegenerationRate(): number;
227
234
  set healthRegenerationRate(healthRegenerationRate: number);
235
+ get level(): number;
236
+ set level(level: number);
228
237
  get manaRegenerationRate(): number;
229
238
  set manaRegenerationRate(manaRegenerationRate: number);
230
239
  get maximumHealth(): number;