warscript 0.0.1-dev.2d7cb44 → 0.0.1-dev.2fd8394

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 (40) hide show
  1. package/core/types/missile.lua +8 -7
  2. package/decl/native.d.ts +1 -0
  3. package/engine/ability-type-extended-tooltip.d.ts +8 -0
  4. package/engine/ability-type-extended-tooltip.lua +44 -0
  5. package/engine/behaviour/ability/emulate-impact.d.ts +14 -0
  6. package/engine/behaviour/ability/emulate-impact.lua +74 -1
  7. package/engine/behaviour/ability/instant-impact.d.ts +12 -1
  8. package/engine/behaviour/ability/instant-impact.lua +17 -2
  9. package/engine/behaviour/ability.d.ts +6 -0
  10. package/engine/behaviour/ability.lua +64 -8
  11. package/engine/buff.d.ts +53 -44
  12. package/engine/buff.lua +254 -227
  13. package/engine/internal/object-data/returned-melee-damage-factor.lua +21 -0
  14. package/engine/internal/unit/ability.lua +19 -15
  15. package/engine/internal/unit/bonus.d.ts +3 -0
  16. package/engine/internal/unit/bonus.lua +11 -0
  17. package/engine/internal/unit+ability.lua +10 -0
  18. package/engine/internal/unit-missile-data.lua +96 -94
  19. package/engine/internal/unit.lua +3 -0
  20. package/engine/lightning.lua +4 -4
  21. package/engine/object-data/entry/ability-type/barrage.d.ts +12 -0
  22. package/engine/object-data/entry/ability-type/barrage.lua +52 -0
  23. package/engine/object-data/entry/ability-type/blank-configurable.d.ts +0 -3
  24. package/engine/object-data/entry/ability-type/blank-configurable.lua +2 -32
  25. package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.d.ts +23 -0
  26. package/engine/object-data/entry/ability-type/blank-passive-with-cooldown.lua +112 -0
  27. package/engine/object-data/entry/ability-type/channel.d.ts +2 -2
  28. package/engine/object-data/entry/ability-type/channel.lua +3 -3
  29. package/engine/object-data/entry/ability-type.d.ts +10 -2
  30. package/engine/object-data/entry/ability-type.lua +55 -3
  31. package/engine/object-data/entry/buff-type/applicable.lua +10 -3
  32. package/engine/object-data/entry/unit-type.d.ts +10 -0
  33. package/engine/object-data/entry/unit-type.lua +34 -20
  34. package/engine/standard/fields/ability.d.ts +2 -2
  35. package/engine/standard/fields/ability.lua +2 -2
  36. package/engine/text-tag.d.ts +13 -1
  37. package/engine/text-tag.lua +79 -42
  38. package/package.json +2 -2
  39. package/engine/internal/unit/pseudo-passive-abilities.lua +0 -11
  40. /package/engine/internal/{unit/pseudo-passive-abilities.d.ts → object-data/returned-melee-damage-factor.d.ts} +0 -0
@@ -0,0 +1,21 @@
1
+ local ____exports = {}
2
+ local ____spiked_2Dcarapace = require("engine.object-data.entry.ability-type.spiked-carapace")
3
+ local SpikedCarapaceAbilityType = ____spiked_2Dcarapace.SpikedCarapaceAbilityType
4
+ ---
5
+ -- @internal For use by internal systems.
6
+ --
7
+ -- Spiked Carapace returns the given factor of melee attack damage to the attacker; the engine
8
+ -- decides what counts as a melee attack.
9
+ ____exports.RETURNED_MELEE_DAMAGE_FACTOR_DUMMY_ABILITY_TYPE_ID = compiletime(function()
10
+ local abilityType = SpikedCarapaceAbilityType:create()
11
+ abilityType.isInternal = true
12
+ abilityType.isButtonVisible = false
13
+ abilityType.returnedDamageFactor = 0
14
+ abilityType.receivedDamageFactor = 1
15
+ abilityType.armorIncrease = 0
16
+ return abilityType.id
17
+ end)
18
+ ---
19
+ -- @internal For use by internal systems.
20
+ ____exports.RETURNED_MELEE_DAMAGE_FACTOR_ABILITY_FIELD = ABILITY_RLF_RETURNED_DAMAGE_FACTOR
21
+ return ____exports
@@ -28,9 +28,6 @@ local ____lua_2Dsets = require("utility.lua-sets")
28
28
  local luaSetOf = ____lua_2Dsets.luaSetOf
29
29
  local ____attributes = require("attributes")
30
30
  local attribute = ____attributes.attribute
31
- local ____pseudo_2Dpassive_2Dabilities = require("engine.internal.unit.pseudo-passive-abilities")
32
- local pseudoPassiveAbilityOrderTypeStringId = ____pseudo_2Dpassive_2Dabilities.pseudoPassiveAbilityOrderTypeStringId
33
- local pseudoPassiveAbilityTypeIds = ____pseudo_2Dpassive_2Dabilities.pseudoPassiveAbilityTypeIds
34
31
  local eventInvoke = Event.invoke
35
32
  local condition = Condition
36
33
  local createTrigger = CreateTrigger
@@ -93,7 +90,7 @@ local function createCommonEvent(underlyingEvent)
93
90
  underlyingEvent,
94
91
  3,
95
92
  function(caster, ability)
96
- return not (pseudoPassiveAbilityTypeIds[ability.typeId] ~= nil), caster, ability
93
+ return true, caster, ability
97
94
  end
98
95
  )
99
96
  end
@@ -173,7 +170,7 @@ local function createNoTargetEvent(underlyingEvent)
173
170
  underlyingEvent,
174
171
  1,
175
172
  function(caster, ability, targetUnit, targetItem, targetDestructible, x, y)
176
- if x == 0 and y == 0 and targetUnit == nil and targetItem == nil and targetDestructible == nil and not (pseudoPassiveAbilityTypeIds[ability.typeId] ~= nil) then
173
+ if x == 0 and y == 0 and targetUnit == nil and targetItem == nil and targetDestructible == nil then
177
174
  return true, caster, ability
178
175
  else
179
176
  return false
@@ -384,11 +381,7 @@ rawset(
384
381
  if unit ~= nil then
385
382
  local ability = unit:getAbility(abilityTypeId)
386
383
  if ability ~= nil then
387
- if pseudoPassiveAbilityTypeIds[ability.typeId] ~= nil then
388
- ability:interruptCast()
389
- else
390
- eventInvoke(event, unit, ability, orderTypeStringId)
391
- end
384
+ eventInvoke(event, unit, ability, orderTypeStringId)
392
385
  end
393
386
  end
394
387
  end)
@@ -404,6 +397,22 @@ local function invokeImpactEvent(unit, ability, ...)
404
397
  ability[impactCallbackIdAttribute] = nil
405
398
  eventInvoke(internalAbilityImpactEvent, unit, ability, ...)
406
399
  end
400
+ --- Invokes the impact events of a cast that never reaches its native impact, with the
401
+ -- cast's target: the common event and the one matching the target kind, as a real impact.
402
+ --
403
+ -- @internal For use by internal systems only.
404
+ ____exports.emulateAbilityImpactEvent = function(caster, ability, targetUnit, targetItem, targetDestructible, x, y)
405
+ eventInvoke(
406
+ internalAbilityImpactEvent,
407
+ caster,
408
+ ability,
409
+ targetUnit and targetUnit.handle,
410
+ targetItem and targetItem.handle,
411
+ targetDestructible and targetDestructible.handle,
412
+ x,
413
+ y
414
+ )
415
+ end
407
416
  internalAbilityChannelingStartEvent:addListener(
408
417
  999999,
409
418
  function(unit, ability, ...)
@@ -484,9 +493,4 @@ internalAbilityChannelingStartEvent:addListener(
484
493
  end
485
494
  end
486
495
  )
487
- local function doNothing()
488
- end
489
- for pseudoPassiveAbilityTypeId in pairs(pseudoPassiveAbilityTypeIds) do
490
- Unit.abilityCommandEvent[pseudoPassiveAbilityTypeId][pseudoPassiveAbilityOrderTypeStringId]:addListener(999999, doNothing)
491
- end
492
496
  return ____exports
@@ -13,6 +13,7 @@ export type UnitMovementSpeedFactorBonusId = UnitBonusId<"movementSpeedFactor">;
13
13
  export type UnitAutoAttackDamageBonusId = UnitBonusId<"autoAttackDamage">;
14
14
  export type UnitDamageFactorBonusId = UnitBonusId<"damageFactor">;
15
15
  export type UnitReceivedDamageFactorBonusId = UnitBonusId<"receivedDamageFactor">;
16
+ export type UnitReturnedMeleeDamageFactorBonusId = UnitBonusId<"returnedMeleeDamageFactor">;
16
17
  export type UnitEvasionProbabilityBonusId = UnitBonusId<"evasionProbability">;
17
18
  export type UnitManaRegenerationRateFactorBonusId = UnitBonusId<"manaRegenerationRateFactor">;
18
19
  export type UnitHealthRegenerationRateBonusId = UnitBonusId<"healthRegenerationRate">;
@@ -46,6 +47,8 @@ export declare namespace UnitBonusType {
46
47
  const AUTO_ATTACK_DAMAGE: UnitBonusType<UnitAutoAttackDamageBonusId>;
47
48
  const DAMAGE_FACTOR: UnitBonusType<UnitReceivedDamageFactorBonusId>;
48
49
  const RECEIVED_DAMAGE_FACTOR: UnitBonusType<UnitReceivedDamageFactorBonusId>;
50
+ /** The factor of melee attack damage returned to the attacker, as Spiked Carapace. */
51
+ const RETURNED_MELEE_DAMAGE_FACTOR: UnitBonusType<UnitReturnedMeleeDamageFactorBonusId>;
49
52
  const EVASION_PROBABILITY: UnitBonusType<UnitEvasionProbabilityBonusId>;
50
53
  const MANA_REGENERATION_RATE_FACTOR: UnitBonusType<UnitManaRegenerationRateFactorBonusId>;
51
54
  /** Supported range: -1000 to 1000; the total is clamped to it. */
@@ -42,6 +42,9 @@ local FRACTIONAL_HEALTH_REGENERATION_RATE_INCREASE_DUMMY_ABILITY_TYPE_ID = ____h
42
42
  local HEALTH_REGENERATION_RATE_DECREASE_DUMMY_ABILITY_TYPE_ID = ____health_2Dregeneration_2Drate_2Dincrease.HEALTH_REGENERATION_RATE_DECREASE_DUMMY_ABILITY_TYPE_ID
43
43
  local HEALTH_REGENERATION_RATE_DECREASE_DUMMY_VALUE = ____health_2Dregeneration_2Drate_2Dincrease.HEALTH_REGENERATION_RATE_DECREASE_DUMMY_VALUE
44
44
  local HEALTH_REGENERATION_RATE_INCREASE_DUMMY_ABILITY_TYPE_IDS = ____health_2Dregeneration_2Drate_2Dincrease.HEALTH_REGENERATION_RATE_INCREASE_DUMMY_ABILITY_TYPE_IDS
45
+ local ____returned_2Dmelee_2Ddamage_2Dfactor = require("engine.internal.object-data.returned-melee-damage-factor")
46
+ local RETURNED_MELEE_DAMAGE_FACTOR_ABILITY_FIELD = ____returned_2Dmelee_2Ddamage_2Dfactor.RETURNED_MELEE_DAMAGE_FACTOR_ABILITY_FIELD
47
+ local RETURNED_MELEE_DAMAGE_FACTOR_DUMMY_ABILITY_TYPE_ID = ____returned_2Dmelee_2Ddamage_2Dfactor.RETURNED_MELEE_DAMAGE_FACTOR_DUMMY_ABILITY_TYPE_ID
45
48
  local damageFactorByUnit = {}
46
49
  local receivedDamageFactorByUnit = {}
47
50
  local function atLeastOnceProbability(array)
@@ -98,6 +101,14 @@ do
98
101
  }
99
102
  UnitBonusType.DAMAGE_FACTOR = {reduce = product, valueByUnit = damageFactorByUnit, initialValue = 1}
100
103
  UnitBonusType.RECEIVED_DAMAGE_FACTOR = {reduce = product, valueByUnit = receivedDamageFactorByUnit, initialValue = 1}
104
+ --- The factor of melee attack damage returned to the attacker, as Spiked Carapace.
105
+ UnitBonusType.RETURNED_MELEE_DAMAGE_FACTOR = {
106
+ abilityTypeId = RETURNED_MELEE_DAMAGE_FACTOR_DUMMY_ABILITY_TYPE_ID,
107
+ field = RETURNED_MELEE_DAMAGE_FACTOR_ABILITY_FIELD,
108
+ integer = false,
109
+ reduce = sum,
110
+ initialValue = 0
111
+ }
101
112
  UnitBonusType.EVASION_PROBABILITY = {
102
113
  abilityTypeId = EVASION_PROBABILITY_DUMMY_ABILITY_TYPE_ID,
103
114
  field = EVASION_PROBABILITY_ABILITY_FIELD,
@@ -29,6 +29,7 @@ local abilityLevelChangedEvent = createDispatchingEvent(
29
29
  )
30
30
  rawset(Unit, "abilityLevelChangedEvent", abilityLevelChangedEvent)
31
31
  local getUnitAbilityLevel = GetUnitAbilityLevel
32
+ local unitDisableAbility = BlzUnitDisableAbility
32
33
  local function invokeAbilityLevelChangedEvent(unitHandle, abilityTypeId)
33
34
  local unit = Unit:of(unitHandle)
34
35
  if unit ~= nil then
@@ -86,6 +87,15 @@ UnitAbility.onCreate:addListener(
86
87
  Event.invoke(abilityGainedEvent, ability.owner, ability)
87
88
  end
88
89
  )
90
+ UnitAbility.onDestroy:addListener(
91
+ 999999,
92
+ function(ability)
93
+ local owner = ability.owner
94
+ if owner.state ~= 2 then
95
+ unitDisableAbility(owner.handle, ability.typeId, true, false)
96
+ end
97
+ end
98
+ )
89
99
  UnitAbility.destroyEvent:addListener(
90
100
  4,
91
101
  function(ability)
@@ -34,100 +34,102 @@ local DEFAULT_VALUES = {
34
34
  launchVisualOffsetY = ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y
35
35
  }
36
36
  local METATABLE = {__index = DEFAULT_VALUES}
37
+ local rawDataByUnitTypeId = postcompile(function()
38
+ return associate(
39
+ UnitType:getAll(),
40
+ function(unitType) return unitType.id end,
41
+ function(unitType)
42
+ return {
43
+ [0] = unitType.missileImpactOffsetZSD ~= ____exports.DEFAULT_MISSILE_IMPACT_OFFSET_Z and unitType.missileImpactOffsetZSD or nil,
44
+ [1] = unitType.missileImpactOffsetZHD ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZHD or nil,
45
+ [2] = unitType.missileImpactOffsetZDE ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZDE or nil,
46
+ [3] = unitType.missileLaunchOffsetX ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_X and unitType.missileLaunchOffsetX or nil,
47
+ [4] = unitType.missileLaunchOffsetY ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Y and unitType.missileLaunchOffsetY or nil,
48
+ [5] = unitType.missileLaunchOffsetZSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Z and unitType.missileLaunchOffsetZSD or nil,
49
+ [6] = unitType.missileLaunchOffsetZHD ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZHD or nil,
50
+ [7] = unitType.missileLaunchOffsetZDE ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZDE or nil,
51
+ [8] = unitType.missileLaunchVisualOffsetXSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_X and unitType.missileLaunchVisualOffsetXSD or nil,
52
+ [9] = unitType.missileLaunchVisualOffsetXHD ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXHD or nil,
53
+ [10] = unitType.missileLaunchVisualOffsetXDE ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXDE or nil,
54
+ [11] = unitType.missileLaunchVisualOffsetYSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y and unitType.missileLaunchVisualOffsetYSD or nil,
55
+ [12] = unitType.missileLaunchVisualOffsetYHD ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYHD or nil,
56
+ [13] = unitType.missileLaunchVisualOffsetYDE ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYDE or nil
57
+ }
58
+ end
59
+ )
60
+ end)
61
+ local function resolveData(data)
62
+ local ____setmetatable_10 = setmetatable
63
+ local ____LocalClient_isHD_1
64
+ if LocalClient.isHD then
65
+ ____LocalClient_isHD_1 = data[1] or data[0]
66
+ else
67
+ local ____LocalClient_isDE_0
68
+ if LocalClient.isDE then
69
+ ____LocalClient_isDE_0 = data[2] or data[0]
70
+ else
71
+ ____LocalClient_isDE_0 = data[0]
72
+ end
73
+ ____LocalClient_isHD_1 = ____LocalClient_isDE_0
74
+ end
75
+ local ____data__3_8 = data[3]
76
+ local ____data__4_9 = data[4]
77
+ local ____LocalClient_isHD_3
78
+ if LocalClient.isHD then
79
+ ____LocalClient_isHD_3 = data[6] or data[5]
80
+ else
81
+ local ____LocalClient_isDE_2
82
+ if LocalClient.isDE then
83
+ ____LocalClient_isDE_2 = data[7] or data[5]
84
+ else
85
+ ____LocalClient_isDE_2 = data[5]
86
+ end
87
+ ____LocalClient_isHD_3 = ____LocalClient_isDE_2
88
+ end
89
+ local ____LocalClient_isHD_5
90
+ if LocalClient.isHD then
91
+ ____LocalClient_isHD_5 = data[9] or data[8]
92
+ else
93
+ local ____LocalClient_isDE_4
94
+ if LocalClient.isDE then
95
+ ____LocalClient_isDE_4 = data[10] or data[8]
96
+ else
97
+ ____LocalClient_isDE_4 = data[8]
98
+ end
99
+ ____LocalClient_isHD_5 = ____LocalClient_isDE_4
100
+ end
101
+ local ____LocalClient_isHD_7
102
+ if LocalClient.isHD then
103
+ ____LocalClient_isHD_7 = data[12] or data[11]
104
+ else
105
+ local ____LocalClient_isDE_6
106
+ if LocalClient.isDE then
107
+ ____LocalClient_isDE_6 = data[13] or data[11]
108
+ else
109
+ ____LocalClient_isDE_6 = data[11]
110
+ end
111
+ ____LocalClient_isHD_7 = ____LocalClient_isDE_6
112
+ end
113
+ return ____setmetatable_10({
114
+ impactOffsetZ = ____LocalClient_isHD_1,
115
+ launchOffsetX = ____data__3_8,
116
+ launchOffsetY = ____data__4_9,
117
+ launchOffsetZ = ____LocalClient_isHD_3,
118
+ launchVisualOffsetX = ____LocalClient_isHD_5,
119
+ launchVisualOffsetY = ____LocalClient_isHD_7
120
+ }, METATABLE)
121
+ end
37
122
  ---
38
123
  -- @internal For use by internal systems only.
39
- ____exports.MISSILE_DATA_BY_UNIT_TYPE_ID = (function()
40
- return setmetatable(
41
- mapValues(
42
- postcompile(function()
43
- return associate(
44
- UnitType:getAll(),
45
- function(unitType) return unitType.id end,
46
- function(unitType)
47
- return {
48
- [0] = unitType.missileImpactOffsetZSD ~= ____exports.DEFAULT_MISSILE_IMPACT_OFFSET_Z and unitType.missileImpactOffsetZSD or nil,
49
- [1] = unitType.missileImpactOffsetZHD ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZHD or nil,
50
- [2] = unitType.missileImpactOffsetZDE ~= unitType.missileImpactOffsetZSD and unitType.missileImpactOffsetZDE or nil,
51
- [3] = unitType.missileLaunchOffsetX ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_X and unitType.missileLaunchOffsetX or nil,
52
- [4] = unitType.missileLaunchOffsetY ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Y and unitType.missileLaunchOffsetY or nil,
53
- [5] = unitType.missileLaunchOffsetZSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_OFFSET_Z and unitType.missileLaunchOffsetZSD or nil,
54
- [6] = unitType.missileLaunchOffsetZHD ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZHD or nil,
55
- [7] = unitType.missileLaunchOffsetZDE ~= unitType.missileLaunchOffsetZSD and unitType.missileLaunchOffsetZDE or nil,
56
- [8] = unitType.missileLaunchVisualOffsetXSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_X and unitType.missileLaunchVisualOffsetXSD or nil,
57
- [9] = unitType.missileLaunchVisualOffsetXHD ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXHD or nil,
58
- [10] = unitType.missileLaunchVisualOffsetXDE ~= unitType.missileLaunchVisualOffsetXSD and unitType.missileLaunchVisualOffsetXDE or nil,
59
- [11] = unitType.missileLaunchVisualOffsetYSD ~= ____exports.DEFAULT_MISSILE_LAUNCH_VISUAL_OFFSET_Y and unitType.missileLaunchVisualOffsetYSD or nil,
60
- [12] = unitType.missileLaunchVisualOffsetYHD ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYHD or nil,
61
- [13] = unitType.missileLaunchVisualOffsetYDE ~= unitType.missileLaunchVisualOffsetYSD and unitType.missileLaunchVisualOffsetYDE or nil
62
- }
63
- end
64
- )
65
- end),
66
- function(data)
67
- local ____setmetatable_10 = setmetatable
68
- local ____LocalClient_isHD_1
69
- if LocalClient.isHD then
70
- ____LocalClient_isHD_1 = data[1] or data[0]
71
- else
72
- local ____LocalClient_isDE_0
73
- if LocalClient.isDE then
74
- ____LocalClient_isDE_0 = data[2] or data[0]
75
- else
76
- ____LocalClient_isDE_0 = data[0]
77
- end
78
- ____LocalClient_isHD_1 = ____LocalClient_isDE_0
79
- end
80
- local ____data__3_8 = data[3]
81
- local ____data__4_9 = data[4]
82
- local ____LocalClient_isHD_3
83
- if LocalClient.isHD then
84
- ____LocalClient_isHD_3 = data[6] or data[5]
85
- else
86
- local ____LocalClient_isDE_2
87
- if LocalClient.isDE then
88
- ____LocalClient_isDE_2 = data[7] or data[5]
89
- else
90
- ____LocalClient_isDE_2 = data[5]
91
- end
92
- ____LocalClient_isHD_3 = ____LocalClient_isDE_2
93
- end
94
- local ____LocalClient_isHD_5
95
- if LocalClient.isHD then
96
- ____LocalClient_isHD_5 = data[9] or data[8]
97
- else
98
- local ____LocalClient_isDE_4
99
- if LocalClient.isDE then
100
- ____LocalClient_isDE_4 = data[10] or data[8]
101
- else
102
- ____LocalClient_isDE_4 = data[8]
103
- end
104
- ____LocalClient_isHD_5 = ____LocalClient_isDE_4
105
- end
106
- local ____LocalClient_isHD_7
107
- if LocalClient.isHD then
108
- ____LocalClient_isHD_7 = data[12] or data[11]
109
- else
110
- local ____LocalClient_isDE_6
111
- if LocalClient.isDE then
112
- ____LocalClient_isDE_6 = data[13] or data[11]
113
- else
114
- ____LocalClient_isDE_6 = data[11]
115
- end
116
- ____LocalClient_isHD_7 = ____LocalClient_isDE_6
117
- end
118
- return ____setmetatable_10({
119
- impactOffsetZ = ____LocalClient_isHD_1,
120
- launchOffsetX = ____data__3_8,
121
- launchOffsetY = ____data__4_9,
122
- launchOffsetZ = ____LocalClient_isHD_3,
123
- launchVisualOffsetX = ____LocalClient_isHD_5,
124
- launchVisualOffsetY = ____LocalClient_isHD_7
125
- }, METATABLE)
126
- end
127
- ),
128
- {__index = function(self)
129
- return DEFAULT_VALUES
130
- end}
131
- )
132
- end)()
124
+ ____exports.MISSILE_DATA_BY_UNIT_TYPE_ID = setmetatable(
125
+ mapValues(rawDataByUnitTypeId, resolveData),
126
+ {__index = function(self)
127
+ return DEFAULT_VALUES
128
+ end}
129
+ )
130
+ warpack.afterMapInit(function()
131
+ for unitTypeId, data in pairs(rawDataByUnitTypeId) do
132
+ ____exports.MISSILE_DATA_BY_UNIT_TYPE_ID[unitTypeId] = resolveData(data)
133
+ end
134
+ end)
133
135
  return ____exports
@@ -999,6 +999,9 @@ function Unit.prototype.removeAbility(self, abilityTypeId)
999
999
  if abilities[i].typeId == abilityTypeId then
1000
1000
  local ability = abilities[i]
1001
1001
  tremove(abilities, i)
1002
+ if ability.state == 2 then
1003
+ break
1004
+ end
1002
1005
  ability:destroy()
1003
1006
  return true
1004
1007
  end
@@ -264,8 +264,8 @@ Timer.onPeriod[UPDATE_PERIOD]:addListener(function()
264
264
  local sourceUnitFacing = rad(getUnitFacing(sourceUnit) - 90)
265
265
  local sourceUnitFacingCos = cos(sourceUnitFacing)
266
266
  local sourceUnitFacingSin = sin(sourceUnitFacing)
267
- local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.launchVisualOffsetX + lightning[103]
268
- local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.launchVisualOffsetY + lightning[104]
267
+ local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.launchVisualOffsetY + lightning[103]
268
+ local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.launchVisualOffsetX + lightning[104]
269
269
  moveLightningEx(
270
270
  lightning.handle,
271
271
  lightning[100],
@@ -283,8 +283,8 @@ Timer.onPeriod[UPDATE_PERIOD]:addListener(function()
283
283
  local sourceUnitFacing = rad(getUnitFacing(sourceUnit) - 90)
284
284
  local sourceUnitFacingCos = cos(sourceUnitFacing)
285
285
  local sourceUnitFacingSin = sin(sourceUnitFacing)
286
- local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.launchVisualOffsetX + lightning[103]
287
- local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.launchVisualOffsetY + lightning[104]
286
+ local sourceUnitOffsetX = sourceUnitMissileData.launchOffsetX + sourceUnitMissileData.launchVisualOffsetY + lightning[103]
287
+ local sourceUnitOffsetY = sourceUnitMissileData.launchOffsetY + sourceUnitMissileData.launchVisualOffsetX + lightning[104]
288
288
  moveLightningEx(
289
289
  lightning.handle,
290
290
  lightning[100],
@@ -0,0 +1,12 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityType, AbilityTypeId } from "../ability-type";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ export declare class BarrageAbilityType extends AbilityType {
5
+ static readonly BASE_ID: AbilityTypeId;
6
+ get damagePerTarget(): number[];
7
+ set damagePerTarget(damagePerTarget: ObjectDataEntryLevelFieldValueSupplier<number>);
8
+ get maximumTotalDamage(): number[];
9
+ set maximumTotalDamage(maximumTotalDamage: ObjectDataEntryLevelFieldValueSupplier<number>);
10
+ get maximumTargetCount(): number[];
11
+ set maximumTargetCount(maximumTargetCount: ObjectDataEntryLevelFieldValueSupplier<number>);
12
+ }
@@ -0,0 +1,52 @@
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.BarrageAbilityType = __TS__Class()
9
+ local BarrageAbilityType = ____exports.BarrageAbilityType
10
+ BarrageAbilityType.name = "BarrageAbilityType"
11
+ __TS__ClassExtends(BarrageAbilityType, AbilityType)
12
+ BarrageAbilityType.BASE_ID = fourCC("Aroc")
13
+ __TS__SetDescriptor(
14
+ BarrageAbilityType.prototype,
15
+ "damagePerTarget",
16
+ {
17
+ get = function(self)
18
+ return self:getNumberLevelField("Efk1")
19
+ end,
20
+ set = function(self, damagePerTarget)
21
+ self:setNumberLevelField("Efk1", damagePerTarget)
22
+ end
23
+ },
24
+ true
25
+ )
26
+ __TS__SetDescriptor(
27
+ BarrageAbilityType.prototype,
28
+ "maximumTotalDamage",
29
+ {
30
+ get = function(self)
31
+ return self:getNumberLevelField("Efk2")
32
+ end,
33
+ set = function(self, maximumTotalDamage)
34
+ self:setNumberLevelField("Efk2", maximumTotalDamage)
35
+ end
36
+ },
37
+ true
38
+ )
39
+ __TS__SetDescriptor(
40
+ BarrageAbilityType.prototype,
41
+ "maximumTargetCount",
42
+ {
43
+ get = function(self)
44
+ return self:getNumberLevelField("Efk3")
45
+ end,
46
+ set = function(self, maximumTargetCount)
47
+ self:setNumberLevelField("Efk3", maximumTargetCount)
48
+ end
49
+ },
50
+ true
51
+ )
52
+ return ____exports
@@ -7,14 +7,11 @@ export declare class BlankConfigurableAbilityType extends ChannelAbilityType {
7
7
  private readonly autoOrderTypeStringIdByTargetingType;
8
8
  private _usesAttackAnimation;
9
9
  private _isChanneling;
10
- private _isPassive;
11
10
  constructor(object: WarObject);
12
11
  get usesAttackAnimation(): boolean;
13
12
  set usesAttackAnimation(usesAttackAnimation: boolean);
14
13
  get isChanneling(): boolean;
15
14
  set isChanneling(isChanneling: boolean);
16
- get isPassive(): boolean;
17
- set isPassive(isPassive: boolean);
18
15
  get targetingType(): ChannelAbilityTypeTargetingType[];
19
16
  set targetingType(targetingType: ObjectDataEntryLevelFieldValueSupplier<ChannelAbilityTypeTargetingType>);
20
17
  get baseOrderTypeStringId(): string[];
@@ -23,9 +23,6 @@ local ALLOWED_TARGETS_ABILITY_COMBAT_CLASSIFICATIONS_LEVEL_FIELD = ____ability.A
23
23
  local AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD = ____ability.AREA_OF_EFFECT_ABILITY_FLOAT_LEVEL_FIELD
24
24
  local ____linked_2Dset = require("utility.linked-set")
25
25
  local LinkedSet = ____linked_2Dset.LinkedSet
26
- local ____pseudo_2Dpassive_2Dabilities = require("engine.internal.unit.pseudo-passive-abilities")
27
- local compiletimePseudoPassiveAbilityTypeIds = ____pseudo_2Dpassive_2Dabilities.compiletimePseudoPassiveAbilityTypeIds
28
- local pseudoPassiveAbilityOrderTypeStringId = ____pseudo_2Dpassive_2Dabilities.pseudoPassiveAbilityOrderTypeStringId
29
26
  local isChannelingAbilityTypeIds = {}
30
27
  local usesAttackAnimationByAbilityTypeId = {}
31
28
  ____exports.BlankConfigurableAbilityType = __TS__Class()
@@ -38,10 +35,9 @@ function BlankConfigurableAbilityType.prototype.____constructor(self, object)
38
35
  self.autoOrderTypeStringIdByTargetingType = {}
39
36
  self._usesAttackAnimation = false
40
37
  self._isChanneling = false
41
- self._isPassive = false
42
38
  self.buttonPositionX = 0
43
39
  self.buttonPositionY = 0
44
- self.casterAttachmentPresets = {}
40
+ self.casterEffectPresets = {}
45
41
  self.effectModelPaths = {}
46
42
  self.targetEffectPresets = {}
47
43
  self.levelCount = 1
@@ -50,7 +46,7 @@ function BlankConfigurableAbilityType.prototype.____constructor(self, object)
50
46
  self.isPhysical = false
51
47
  self.isUniversal = false
52
48
  self.isUniqueCast = true
53
- self.casterAttachmentPresetsDuration = 0
49
+ self.casterEffectPresetsDuration = 0
54
50
  self.disablesOtherAbilities = false
55
51
  self:setAutoOrderTypeStringIds()
56
52
  usesAttackAnimationByAbilityTypeId[self.id] = false
@@ -109,24 +105,6 @@ __TS__SetDescriptor(
109
105
  },
110
106
  true
111
107
  )
112
- __TS__SetDescriptor(
113
- BlankConfigurableAbilityType.prototype,
114
- "isPassive",
115
- {
116
- get = function(self)
117
- return self._isPassive
118
- end,
119
- set = function(self, isPassive)
120
- if isPassive then
121
- compiletimePseudoPassiveAbilityTypeIds[self.id] = true
122
- else
123
- compiletimePseudoPassiveAbilityTypeIds[self.id] = nil
124
- end
125
- self._isPassive = isPassive
126
- end
127
- },
128
- true
129
- )
130
108
  __TS__SetDescriptor(
131
109
  BlankConfigurableAbilityType.prototype,
132
110
  "targetingType",
@@ -231,14 +209,6 @@ do
231
209
  end
232
210
  )
233
211
  end
234
- local _ = postcompile(function()
235
- for abilityTypeId in pairs(compiletimePseudoPassiveAbilityTypeIds) do
236
- local abilityType = checkNotNull(____exports.BlankConfigurableAbilityType:of(abilityTypeId))
237
- abilityType.hotkey = ""
238
- abilityType.baseOrderTypeStringId = pseudoPassiveAbilityOrderTypeStringId
239
- abilityType.targetingType = 0
240
- end
241
- end)
242
212
  for abilityTypeId, usesAttackAnimation in pairs(postcompile(function()
243
213
  for abilityTypeId, usesAttackAnimation in pairs(usesAttackAnimationByAbilityTypeId) do
244
214
  if usesAttackAnimation then
@@ -0,0 +1,23 @@
1
+ /** @noSelfInFile */
2
+ import { ExhumeCorpsesAbilityType } from "./exhume-corpses";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ /**
5
+ * A passive ability whose cooldown can be started (`Ability.startCooldown`): Exhume
6
+ * Corpses (`Aexh`) is the only passive base ability that shows a cooldown.
7
+ *
8
+ * The corpse fields of the underlying Exhume Corpses are fixed at zero and its native
9
+ * durations at a practically infinite value. {@link buffDuration} and
10
+ * {@link heroBuffDuration} are kept for scripts separately from the native fields.
11
+ *
12
+ * The game ignores per-ability extended tooltips of this base ability, so the type's own
13
+ * tooltip is replaced locally with the one of the locally main selected unit's ability.
14
+ * Read the type's tooltip with `getAbilityTypeExtendedTooltip`, not with the native.
15
+ */
16
+ export declare class BlankPassiveAbilityWithCooldownAbilityType extends ExhumeCorpsesAbilityType {
17
+ static readonly IS_SYNTHETIC = true;
18
+ constructor(object: WarObject);
19
+ get buffDuration(): number[];
20
+ set buffDuration(buffDuration: ObjectDataEntryLevelFieldValueSupplier<number>);
21
+ get heroBuffDuration(): number[];
22
+ set heroBuffDuration(heroBuffDuration: ObjectDataEntryLevelFieldValueSupplier<number>);
23
+ }