warscript 0.0.1-dev.4117d1e → 0.0.1-dev.416ccba
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
+
local restoreCooldownGroup
|
|
2
3
|
local ____player = require("core.types.player")
|
|
3
4
|
local Player = ____player.Player
|
|
4
5
|
local ____dummy = require("objutil.dummy")
|
|
@@ -11,6 +12,8 @@ local ____object_2Ddata_2Dentry_2Did_2Dgenerator = require("engine.object-data.u
|
|
|
11
12
|
local abilityTypeIdGenerator = ____object_2Ddata_2Dentry_2Did_2Dgenerator.abilityTypeIdGenerator
|
|
12
13
|
local ____math = require("math")
|
|
13
14
|
local MINIMUM_POSITIVE_NORMALIZED_FLOAT = ____math.MINIMUM_POSITIVE_NORMALIZED_FLOAT
|
|
15
|
+
local ____timer = require("core.types.timer")
|
|
16
|
+
local Timer = ____timer.Timer
|
|
14
17
|
local isItemOwned = IsItemOwned
|
|
15
18
|
local isItemPowerup = IsItemPowerup
|
|
16
19
|
local getItemX = GetItemX
|
|
@@ -65,6 +68,12 @@ local function startItemCooldownInternal(handle, cooldown)
|
|
|
65
68
|
setAbilityRealLevelField(cooldownStarterAbility, ABILITY_RLF_COOLDOWN, 0, cooldown)
|
|
66
69
|
unitResetCooldown(dummy)
|
|
67
70
|
unitUseItem(dummy, cooldownStarterItem)
|
|
71
|
+
Timer:run(restoreCooldownGroup, handle, cooldownGroup)
|
|
72
|
+
end
|
|
73
|
+
restoreCooldownGroup = function(handle, cooldownGroup)
|
|
74
|
+
if getItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP) == COOLDOWN_STARTER_ABILITY_TYPE_ID then
|
|
75
|
+
setItemIntegerField(handle, ITEM_IF_COOLDOWN_GROUP, cooldownGroup)
|
|
76
|
+
end
|
|
68
77
|
end
|
|
69
78
|
---
|
|
70
79
|
-- @internal For use by internal systems only.
|
package/package.json
CHANGED