warscript 0.0.1-dev.a58cc52 → 0.0.1-dev.a5a2f5e
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/attributes.d.ts +6 -0
- package/attributes.lua +17 -1
- package/core/types/frame.lua +71 -22
- package/core/types/item.d.ts +1 -0
- package/core/types/item.lua +1 -0
- package/core/types/player.d.ts +17 -1
- package/core/types/player.lua +70 -24
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/sound.lua +1 -1
- package/core/types/tileCell.d.ts +11 -1
- package/core/types/tileCell.lua +97 -0
- package/core/types/timer.d.ts +3 -1
- package/core/types/timer.lua +27 -2
- package/decl/native.d.ts +6 -4
- package/destroyable.d.ts +1 -0
- package/destroyable.lua +9 -0
- package/engine/behavior.d.ts +14 -1
- package/engine/behavior.lua +230 -70
- package/engine/behaviour/ability/apply-buff.lua +5 -5
- package/engine/behaviour/ability/damage.d.ts +7 -2
- package/engine/behaviour/ability/damage.lua +31 -37
- package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
- package/engine/behaviour/ability/emulate-impact.lua +16 -7
- package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
- package/engine/behaviour/ability/remove-buffs.lua +21 -0
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.d.ts +11 -6
- package/engine/behaviour/ability.lua +38 -17
- package/engine/behaviour/unit/stun-immunity.d.ts +12 -6
- package/engine/behaviour/unit/stun-immunity.lua +57 -31
- package/engine/behaviour/unit.d.ts +39 -3
- package/engine/behaviour/unit.lua +269 -6
- package/engine/buff.d.ts +67 -22
- package/engine/buff.lua +371 -182
- package/engine/internal/ability.d.ts +7 -1
- package/engine/internal/ability.lua +64 -24
- package/engine/internal/item/ability.lua +63 -11
- package/engine/internal/item/fields.d.ts +12 -0
- package/engine/internal/item/fields.lua +33 -0
- package/engine/internal/item+owner.lua +12 -6
- package/engine/internal/item.d.ts +12 -16
- package/engine/internal/item.lua +118 -69
- package/engine/internal/mechanics/cast-ability.lua +6 -3
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- package/engine/internal/misc/frame-coordinates.d.ts +2 -0
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/object-data/armor-bonus.d.ts +2 -0
- package/engine/internal/object-data/attribute-bonus.lua +2 -2
- package/engine/internal/object-data/health-bonus.d.ts +2 -0
- package/engine/internal/object-data/health-bonus.lua +16 -0
- package/engine/internal/object-data/mana-bonus.d.ts +2 -0
- package/engine/internal/object-data/mana-bonus.lua +16 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
- package/engine/internal/unit/ability.d.ts +35 -0
- package/engine/internal/unit/ability.lua +98 -9
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/attributes.d.ts +17 -0
- package/engine/internal/unit/attributes.lua +46 -0
- package/engine/internal/unit/bonus.d.ts +6 -0
- package/engine/internal/unit/bonus.lua +33 -3
- package/engine/internal/unit/fly-height.d.ts +7 -0
- package/engine/internal/unit/fly-height.lua +20 -0
- package/engine/internal/unit/interrupts.d.ts +12 -0
- package/engine/internal/unit/interrupts.lua +28 -0
- package/engine/internal/unit/main-selected.lua +12 -27
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit/range-event.d.ts +12 -0
- package/engine/internal/unit/range-event.lua +90 -0
- package/engine/internal/unit/scale.d.ts +7 -0
- package/engine/internal/unit/scale.lua +20 -0
- package/engine/internal/unit+ability.lua +10 -1
- package/engine/internal/unit+bonus.lua +3 -3
- package/engine/internal/unit+damage.d.ts +1 -1
- package/engine/internal/unit+damage.lua +6 -1
- package/engine/internal/unit-missile-launch.lua +52 -14
- package/engine/internal/unit.d.ts +32 -26
- package/engine/internal/unit.lua +351 -269
- package/engine/local-client.d.ts +7 -0
- package/engine/local-client.lua +86 -1
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
- package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +1 -1
- package/engine/object-data/entry/ability-type/{armor-increase.d.ts → armor-bonus.d.ts} +3 -3
- package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
- package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
- package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
- package/engine/object-data/entry/ability-type.d.ts +2 -0
- package/engine/object-data/entry/ability-type.lua +89 -8
- package/engine/object-data/entry/buff-type/applicable.lua +113 -109
- package/engine/object-data/entry/destructible-type.d.ts +27 -1
- package/engine/object-data/entry/destructible-type.lua +155 -0
- package/engine/object-data/entry/unit-type.d.ts +15 -2
- package/engine/object-data/entry/unit-type.lua +135 -33
- package/engine/object-field/ability.d.ts +3 -3
- package/engine/object-field/ability.lua +9 -8
- package/engine/object-field/item.d.ts +22 -0
- package/engine/object-field/item.lua +118 -0
- package/engine/object-field/unit.d.ts +31 -5
- package/engine/object-field/unit.lua +95 -0
- package/engine/object-field.d.ts +18 -7
- package/engine/object-field.lua +294 -135
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +21 -0
- package/engine/standard/fields/ability.d.ts +2 -2
- package/engine/standard/fields/ability.lua +2 -2
- package/engine/standard/fields/item.d.ts +4 -0
- package/engine/standard/fields/item.lua +6 -0
- package/engine/standard/fields/unit.d.ts +12 -0
- package/engine/standard/fields/unit.lua +20 -0
- package/engine/synchronization.d.ts +11 -0
- package/engine/synchronization.lua +77 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +250 -10
- package/engine/unit.d.ts +6 -0
- package/engine/unit.lua +6 -0
- package/lualib_bundle.lua +1 -1
- package/math.d.ts +2 -0
- package/math.lua +14 -0
- package/net/socket.lua +1 -1
- package/objutil/buff.lua +10 -8
- package/objutil/object.lua +1 -1
- package/operation.lua +1 -4
- package/package.json +5 -5
- package/patch-lua.lua +15 -0
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +8 -0
- package/utility/callback-array.d.ts +17 -0
- package/utility/callback-array.lua +61 -0
- package/utility/functions.d.ts +7 -0
- package/utility/functions.lua +12 -0
- package/utility/linked-map.d.ts +35 -0
- package/utility/linked-map.lua +107 -0
- package/utility/linked-set.d.ts +4 -1
- package/utility/linked-set.lua +46 -1
- package/utility/lua-maps.d.ts +12 -2
- package/utility/lua-maps.lua +37 -2
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +4 -0
- package/utility/records.lua +20 -1
- package/utility/types.d.ts +3 -0
- package/utility/unordered-map.d.ts +27 -0
- package/utility/unordered-map.lua +99 -0
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
- /package/engine/internal/{object-data/armor-increase.d.ts → misc/damage-metadata-by-target.d.ts} +0 -0
- /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
- /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
4
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
5
|
+
local __TS__New = ____lualib.__TS__New
|
|
6
|
+
local ____exports = {}
|
|
7
|
+
local ____exception = require("exception")
|
|
8
|
+
local UnsupportedOperationException = ____exception.UnsupportedOperationException
|
|
9
|
+
____exports.UnorderedMap = __TS__Class()
|
|
10
|
+
local UnorderedMap = ____exports.UnorderedMap
|
|
11
|
+
UnorderedMap.name = "UnorderedMap"
|
|
12
|
+
function UnorderedMap.prototype.____constructor(self)
|
|
13
|
+
self.v = {}
|
|
14
|
+
self.s = 0
|
|
15
|
+
end
|
|
16
|
+
function UnorderedMap.prototype.get(self, key)
|
|
17
|
+
return self.v[key]
|
|
18
|
+
end
|
|
19
|
+
function UnorderedMap.prototype.getOrPut(self, key, defaultValue)
|
|
20
|
+
local value = self.v[key]
|
|
21
|
+
if value ~= nil then
|
|
22
|
+
return value
|
|
23
|
+
end
|
|
24
|
+
value = defaultValue()
|
|
25
|
+
if value ~= nil then
|
|
26
|
+
self.v[key] = value
|
|
27
|
+
self.s = self.s + 1
|
|
28
|
+
end
|
|
29
|
+
return value
|
|
30
|
+
end
|
|
31
|
+
function UnorderedMap.prototype.put(self, key, value)
|
|
32
|
+
local has = self.v[key] ~= nil
|
|
33
|
+
self.v[key] = value
|
|
34
|
+
if value ~= nil and not has then
|
|
35
|
+
self.s = self.s + 1
|
|
36
|
+
elseif value == nil and has then
|
|
37
|
+
self.s = self.s - 1
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
function UnorderedMap.prototype.remove(self, key)
|
|
41
|
+
if self.v[key] ~= nil then
|
|
42
|
+
self.v[key] = nil
|
|
43
|
+
self.s = self.s - 1
|
|
44
|
+
return true
|
|
45
|
+
end
|
|
46
|
+
return false
|
|
47
|
+
end
|
|
48
|
+
function UnorderedMap.prototype.contains(self, key)
|
|
49
|
+
return self.v[key] ~= nil
|
|
50
|
+
end
|
|
51
|
+
function UnorderedMap.prototype.__len(self)
|
|
52
|
+
return self.s
|
|
53
|
+
end
|
|
54
|
+
function UnorderedMap.prototype.__pairs(self)
|
|
55
|
+
return pairs(self.v)
|
|
56
|
+
end
|
|
57
|
+
__TS__SetDescriptor(
|
|
58
|
+
UnorderedMap.prototype,
|
|
59
|
+
"size",
|
|
60
|
+
{get = function(self)
|
|
61
|
+
return self.s
|
|
62
|
+
end},
|
|
63
|
+
true
|
|
64
|
+
)
|
|
65
|
+
local EmptyUnorderedMap = __TS__Class()
|
|
66
|
+
EmptyUnorderedMap.name = "EmptyUnorderedMap"
|
|
67
|
+
__TS__ClassExtends(EmptyUnorderedMap, ____exports.UnorderedMap)
|
|
68
|
+
function EmptyUnorderedMap.prototype.getOrPut(self)
|
|
69
|
+
error(
|
|
70
|
+
__TS__New(UnsupportedOperationException),
|
|
71
|
+
0
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
function EmptyUnorderedMap.prototype.put(self)
|
|
75
|
+
error(
|
|
76
|
+
__TS__New(UnsupportedOperationException),
|
|
77
|
+
0
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
function EmptyUnorderedMap.prototype.remove(self)
|
|
81
|
+
error(
|
|
82
|
+
__TS__New(UnsupportedOperationException),
|
|
83
|
+
0
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
function EmptyUnorderedMap.prototype.__len(self)
|
|
87
|
+
return 0
|
|
88
|
+
end
|
|
89
|
+
function EmptyUnorderedMap.prototype.__pairs(self)
|
|
90
|
+
return pairs(self.v)
|
|
91
|
+
end
|
|
92
|
+
local EMPTY_UNORDERED_MAP = __TS__New(EmptyUnorderedMap)
|
|
93
|
+
____exports.emptyUnorderedMap = function()
|
|
94
|
+
return EMPTY_UNORDERED_MAP
|
|
95
|
+
end
|
|
96
|
+
____exports.mutableUnorderedMap = function()
|
|
97
|
+
return __TS__New(____exports.UnorderedMap)
|
|
98
|
+
end
|
|
99
|
+
return ____exports
|
package/core/types/order.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** @noSelfInFile */
|
|
2
|
-
import { Unit } from "./unit";
|
|
3
|
-
import { Item } from "./item";
|
|
4
|
-
import { Destructable } from "./destructable";
|
|
5
|
-
export type Order = {
|
|
6
|
-
id: number;
|
|
7
|
-
startX: number;
|
|
8
|
-
startY: number;
|
|
9
|
-
} & ({
|
|
10
|
-
type: "immediate";
|
|
11
|
-
} | {
|
|
12
|
-
type: "point";
|
|
13
|
-
targetX: number;
|
|
14
|
-
targetY: number;
|
|
15
|
-
} | {
|
|
16
|
-
type: "target";
|
|
17
|
-
target: Unit | Item | Destructable;
|
|
18
|
-
});
|
|
19
|
-
declare module "../../engine/internal/unit" {
|
|
20
|
-
interface Unit {
|
|
21
|
-
readonly currentOrder: Order;
|
|
22
|
-
readonly lastOrder: Order;
|
|
23
|
-
issueOrder(order: Order): void;
|
|
24
|
-
}
|
|
25
|
-
}
|
package/core/types/order.lua
DELETED
|
@@ -1,55 +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 getUnitCurrentOrder = GetUnitCurrentOrder
|
|
7
|
-
local orders = setmetatable({}, {__mode = "k"})
|
|
8
|
-
Unit.onImmediateOrder:addListener(function(unit, orderId)
|
|
9
|
-
orders[unit] = {id = orderId, startX = unit.x, startY = unit.y, type = "immediate"}
|
|
10
|
-
end)
|
|
11
|
-
Unit.onPointOrder:addListener(function(unit, orderId, x, y)
|
|
12
|
-
orders[unit] = {
|
|
13
|
-
id = orderId,
|
|
14
|
-
startX = unit.x,
|
|
15
|
-
startY = unit.y,
|
|
16
|
-
type = "point",
|
|
17
|
-
targetX = x,
|
|
18
|
-
targetY = y
|
|
19
|
-
}
|
|
20
|
-
end)
|
|
21
|
-
Unit.onTargetOrder:addListener(function(unit, orderId, target)
|
|
22
|
-
orders[unit] = {
|
|
23
|
-
id = orderId,
|
|
24
|
-
startX = unit.x,
|
|
25
|
-
startY = unit.y,
|
|
26
|
-
type = "target",
|
|
27
|
-
target = target
|
|
28
|
-
}
|
|
29
|
-
end)
|
|
30
|
-
__TS__ObjectDefineProperty(
|
|
31
|
-
Unit.prototype,
|
|
32
|
-
"currentOrder",
|
|
33
|
-
{get = function(self)
|
|
34
|
-
local currentOrderId = getUnitCurrentOrder(self.handle)
|
|
35
|
-
local lastOrder = orders[self]
|
|
36
|
-
return lastOrder and (lastOrder.id == currentOrderId or currentOrderId == orderId("patrolAI") and lastOrder.id == orderId("patrol")) and lastOrder or ({id = 0, type = "immediate"})
|
|
37
|
-
end}
|
|
38
|
-
)
|
|
39
|
-
__TS__ObjectDefineProperty(
|
|
40
|
-
Unit.prototype,
|
|
41
|
-
"lastOrder",
|
|
42
|
-
{get = function(self)
|
|
43
|
-
return orders[self] or ({id = 0, type = "immediate"})
|
|
44
|
-
end}
|
|
45
|
-
)
|
|
46
|
-
Unit.prototype.issueOrder = function(self, order)
|
|
47
|
-
if order.type == "immediate" then
|
|
48
|
-
IssueImmediateOrderById(self.handle, order.id)
|
|
49
|
-
elseif order.type == "point" then
|
|
50
|
-
IssuePointOrderById(self.handle, order.id, order.targetX, order.targetY)
|
|
51
|
-
else
|
|
52
|
-
IssueTargetOrderById(self.handle, order.id, order.target.handle)
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
return ____exports
|
/package/engine/internal/{object-data/armor-increase.d.ts → misc/damage-metadata-by-target.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
/package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts}
RENAMED
|
File without changes
|
/package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua}
RENAMED
|
File without changes
|