warscript 0.0.1-dev.dd8349d → 0.0.1-dev.e0e46c4
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.
- package/core/types/timer.d.ts +1 -1
- package/engine/behaviour/ability/apply-buff.lua +1 -1
- package/engine/behaviour/ability/emulate-impact.lua +9 -2
- package/engine/behaviour/ability.lua +8 -17
- package/engine/behaviour/unit/stun-immunity.d.ts +5 -3
- package/engine/behaviour/unit/stun-immunity.lua +43 -27
- package/engine/behaviour/unit.d.ts +13 -1
- package/engine/behaviour/unit.lua +55 -3
- package/engine/buff.d.ts +2 -1
- package/engine/buff.lua +9 -3
- package/engine/internal/ability.d.ts +2 -0
- package/engine/internal/ability.lua +10 -0
- package/engine/internal/item/ability.lua +51 -1
- package/engine/internal/item.d.ts +1 -0
- package/engine/internal/item.lua +7 -3
- package/engine/internal/unit/ability.d.ts +35 -0
- package/engine/internal/unit/ability.lua +62 -0
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit.d.ts +2 -1
- package/engine/internal/unit.lua +70 -57
- package/engine/object-field/unit.d.ts +4 -0
- package/engine/object-field/unit.lua +13 -0
- package/engine/object-field.d.ts +6 -3
- package/engine/object-field.lua +85 -73
- package/engine/standard/fields/unit.d.ts +3 -0
- package/engine/standard/fields/unit.lua +5 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +175 -10
- package/engine/unit.d.ts +1 -0
- package/engine/unit.lua +1 -0
- package/package.json +1 -1
- package/utility/functions.d.ts +3 -0
- package/utility/functions.lua +3 -0
- package/utility/lua-maps.d.ts +1 -0
- package/utility/lua-maps.lua +4 -0
- package/core/types/order.d.ts +0 -26
- package/core/types/order.lua +0 -65
package/core/types/order.lua
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
3
|
-
local ____exports = {}
|
|
4
|
-
local ____unit = require("core.types.unit")
|
|
5
|
-
local Unit = ____unit.Unit
|
|
6
|
-
local ____game = require("core.game")
|
|
7
|
-
local elapsedTime = ____game.elapsedTime
|
|
8
|
-
local getUnitCurrentOrder = GetUnitCurrentOrder
|
|
9
|
-
local orders = setmetatable({}, {__mode = "k"})
|
|
10
|
-
Unit.onImmediateOrder:addListener(function(unit, orderId)
|
|
11
|
-
orders[unit] = {
|
|
12
|
-
id = orderId,
|
|
13
|
-
startX = unit.x,
|
|
14
|
-
startY = unit.y,
|
|
15
|
-
issueTime = elapsedTime(),
|
|
16
|
-
type = "immediate"
|
|
17
|
-
}
|
|
18
|
-
end)
|
|
19
|
-
Unit.onPointOrder:addListener(function(unit, orderId, x, y)
|
|
20
|
-
orders[unit] = {
|
|
21
|
-
id = orderId,
|
|
22
|
-
startX = unit.x,
|
|
23
|
-
startY = unit.y,
|
|
24
|
-
issueTime = elapsedTime(),
|
|
25
|
-
type = "point",
|
|
26
|
-
targetX = x,
|
|
27
|
-
targetY = y
|
|
28
|
-
}
|
|
29
|
-
end)
|
|
30
|
-
Unit.onTargetOrder:addListener(function(unit, orderId, target)
|
|
31
|
-
orders[unit] = {
|
|
32
|
-
id = orderId,
|
|
33
|
-
startX = unit.x,
|
|
34
|
-
startY = unit.y,
|
|
35
|
-
issueTime = elapsedTime(),
|
|
36
|
-
type = "target",
|
|
37
|
-
target = target
|
|
38
|
-
}
|
|
39
|
-
end)
|
|
40
|
-
__TS__ObjectDefineProperty(
|
|
41
|
-
Unit.prototype,
|
|
42
|
-
"currentOrder",
|
|
43
|
-
{get = function(self)
|
|
44
|
-
local currentOrderId = getUnitCurrentOrder(self.handle)
|
|
45
|
-
local lastOrder = orders[self]
|
|
46
|
-
return lastOrder and (lastOrder.id == currentOrderId or currentOrderId == orderId("patrolAI") and lastOrder.id == orderId("patrol")) and lastOrder or ({id = 0, type = "immediate"})
|
|
47
|
-
end}
|
|
48
|
-
)
|
|
49
|
-
__TS__ObjectDefineProperty(
|
|
50
|
-
Unit.prototype,
|
|
51
|
-
"lastOrder",
|
|
52
|
-
{get = function(self)
|
|
53
|
-
return orders[self] or ({id = 0, type = "immediate"})
|
|
54
|
-
end}
|
|
55
|
-
)
|
|
56
|
-
Unit.prototype.issueOrder = function(self, order)
|
|
57
|
-
if order.type == "immediate" then
|
|
58
|
-
IssueImmediateOrderById(self.handle, order.id)
|
|
59
|
-
elseif order.type == "point" then
|
|
60
|
-
IssuePointOrderById(self.handle, order.id, order.targetX, order.targetY)
|
|
61
|
-
else
|
|
62
|
-
IssueTargetOrderById(self.handle, order.id, order.target.handle)
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
return ____exports
|