warcraft-3-w3ts-utils 0.1.7 → 0.1.9
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/dist/index.lua +13 -0
- package/dist/lua_modules/w3ts/globals/index.lua +23 -0
- package/dist/lua_modules/w3ts/globals/order.lua +2 -0
- package/dist/lua_modules/w3ts/handles/camera.lua +348 -0
- package/dist/lua_modules/w3ts/handles/destructable.lua +237 -0
- package/dist/lua_modules/w3ts/handles/dialog.lua +161 -0
- package/dist/lua_modules/w3ts/handles/effect.lua +198 -0
- package/dist/lua_modules/w3ts/handles/fogmodifier.lua +76 -0
- package/dist/lua_modules/w3ts/handles/force.lua +105 -0
- package/dist/lua_modules/w3ts/handles/frame.lua +417 -0
- package/dist/lua_modules/w3ts/handles/gamecache.lua +132 -0
- package/dist/lua_modules/w3ts/handles/group.lua +215 -0
- package/dist/lua_modules/w3ts/handles/handle.lua +38 -0
- package/dist/lua_modules/w3ts/handles/image.lua +105 -0
- package/dist/lua_modules/w3ts/handles/index.lua +226 -0
- package/dist/lua_modules/w3ts/handles/item.lua +375 -0
- package/dist/lua_modules/w3ts/handles/leaderboard.lua +211 -0
- package/dist/lua_modules/w3ts/handles/multiboard.lua +193 -0
- package/dist/lua_modules/w3ts/handles/player.lua +311 -0
- package/dist/lua_modules/w3ts/handles/point.lua +80 -0
- package/dist/lua_modules/w3ts/handles/quest.lua +176 -0
- package/dist/lua_modules/w3ts/handles/rect.lua +129 -0
- package/dist/lua_modules/w3ts/handles/region.lua +72 -0
- package/dist/lua_modules/w3ts/handles/sound.lua +174 -0
- package/dist/lua_modules/w3ts/handles/texttag.lua +97 -0
- package/dist/lua_modules/w3ts/handles/timer.lua +83 -0
- package/dist/lua_modules/w3ts/handles/timerdialog.lua +86 -0
- package/dist/lua_modules/w3ts/handles/trigger.lua +265 -0
- package/dist/lua_modules/w3ts/handles/ubersplat.lua +84 -0
- package/dist/lua_modules/w3ts/handles/unit.lua +1330 -0
- package/dist/lua_modules/w3ts/handles/weathereffect.lua +42 -0
- package/dist/lua_modules/w3ts/handles/widget.lua +53 -0
- package/dist/lua_modules/w3ts/hooks/index.lua +52 -0
- package/dist/lua_modules/w3ts/index.lua +36 -0
- package/dist/lua_modules/w3ts/system/base64.lua +108 -0
- package/dist/lua_modules/w3ts/system/binaryreader.lua +74 -0
- package/dist/lua_modules/w3ts/system/binarywriter.lua +88 -0
- package/dist/lua_modules/w3ts/system/file.lua +88 -0
- package/dist/lua_modules/w3ts/system/gametime.lua +27 -0
- package/dist/lua_modules/w3ts/system/host.lua +104 -0
- package/dist/lua_modules/w3ts/system/index.lua +58 -0
- package/dist/lua_modules/w3ts/system/sync.lua +239 -0
- package/dist/lua_modules/w3ts/utils/color.lua +189 -0
- package/dist/lua_modules/w3ts/utils/index.lua +38 -0
- package/dist/lualib_bundle.lua +2733 -0
- package/dist/package.json +41 -0
- package/dist/utils/abilities.lua +107 -0
- package/dist/utils/camera.lua +46 -0
- package/dist/utils/chat-command.lua +30 -0
- package/dist/utils/color.lua +41 -0
- package/dist/utils/index.lua +125 -0
- package/dist/utils/item.d.ts +14 -1
- package/dist/utils/item.lua +179 -0
- package/dist/utils/math.lua +17 -0
- package/dist/utils/minimapIcons.lua +28 -0
- package/dist/utils/misc.lua +143 -0
- package/dist/utils/physics.lua +161 -0
- package/dist/utils/players.d.ts +0 -1
- package/dist/utils/players.lua +233 -0
- package/dist/utils/point.lua +60 -0
- package/dist/utils/quests.lua +47 -0
- package/dist/utils/textTag.lua +110 -0
- package/dist/utils/timer.lua +21 -0
- package/dist/utils/units.lua +102 -0
- package/package.json +4 -6
- package/dist/index.js +0 -18
- package/dist/utils/abilities.js +0 -125
- package/dist/utils/camera.js +0 -37
- package/dist/utils/chat-command.js +0 -22
- package/dist/utils/color.js +0 -141
- package/dist/utils/index.js +0 -32
- package/dist/utils/item.js +0 -124
- package/dist/utils/math.js +0 -17
- package/dist/utils/minimapIcons.js +0 -27
- package/dist/utils/misc.js +0 -175
- package/dist/utils/physics.js +0 -194
- package/dist/utils/players.js +0 -189
- package/dist/utils/point.js +0 -74
- package/dist/utils/quests.js +0 -30
- package/dist/utils/textTag.js +0 -72
- package/dist/utils/timer.js +0 -16
- package/dist/utils/units.js +0 -81
- package/tsconfig.json +0 -40
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
|
+
local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
|
|
5
|
+
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
6
|
+
local ____exports = {}
|
|
7
|
+
local ____handle = require("lua_modules.w3ts.handles.handle")
|
|
8
|
+
local Handle = ____handle.Handle
|
|
9
|
+
____exports.MultiboardItem = __TS__Class()
|
|
10
|
+
local MultiboardItem = ____exports.MultiboardItem
|
|
11
|
+
MultiboardItem.name = "MultiboardItem"
|
|
12
|
+
__TS__ClassExtends(MultiboardItem, Handle)
|
|
13
|
+
function MultiboardItem.prototype.____constructor(self, board, x, y)
|
|
14
|
+
if Handle:initFromHandle() then
|
|
15
|
+
Handle.prototype.____constructor(self)
|
|
16
|
+
return
|
|
17
|
+
end
|
|
18
|
+
local handle = MultiboardGetItem(board.handle, x - 1, y - 1)
|
|
19
|
+
if handle == nil then
|
|
20
|
+
error("w3ts failed to create multiboarditem handle.", 3)
|
|
21
|
+
end
|
|
22
|
+
Handle.prototype.____constructor(self, handle)
|
|
23
|
+
end
|
|
24
|
+
function MultiboardItem.create(self, board, x, y)
|
|
25
|
+
local handle = MultiboardGetItem(board.handle, x - 1, y - 1)
|
|
26
|
+
if handle then
|
|
27
|
+
local obj = self:getObject(handle)
|
|
28
|
+
local values = {}
|
|
29
|
+
values.handle = handle
|
|
30
|
+
return __TS__ObjectAssign(obj, values)
|
|
31
|
+
end
|
|
32
|
+
return nil
|
|
33
|
+
end
|
|
34
|
+
function MultiboardItem.prototype.destroy(self)
|
|
35
|
+
MultiboardReleaseItem(self.handle)
|
|
36
|
+
end
|
|
37
|
+
function MultiboardItem.prototype.setIcon(self, icon)
|
|
38
|
+
MultiboardSetItemIcon(self.handle, icon)
|
|
39
|
+
end
|
|
40
|
+
function MultiboardItem.prototype.setStyle(self, showValue, showIcon)
|
|
41
|
+
MultiboardSetItemStyle(self.handle, showValue, showIcon)
|
|
42
|
+
end
|
|
43
|
+
function MultiboardItem.prototype.setValue(self, val)
|
|
44
|
+
MultiboardSetItemValue(self.handle, val)
|
|
45
|
+
end
|
|
46
|
+
function MultiboardItem.prototype.setValueColor(self, red, green, blue, alpha)
|
|
47
|
+
MultiboardSetItemValueColor(
|
|
48
|
+
self.handle,
|
|
49
|
+
red,
|
|
50
|
+
green,
|
|
51
|
+
blue,
|
|
52
|
+
alpha
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
function MultiboardItem.prototype.setWidth(self, width)
|
|
56
|
+
MultiboardSetItemWidth(self.handle, width)
|
|
57
|
+
end
|
|
58
|
+
function MultiboardItem.fromHandle(self, handle)
|
|
59
|
+
return self:getObject(handle)
|
|
60
|
+
end
|
|
61
|
+
____exports.Multiboard = __TS__Class()
|
|
62
|
+
local Multiboard = ____exports.Multiboard
|
|
63
|
+
Multiboard.name = "Multiboard"
|
|
64
|
+
__TS__ClassExtends(Multiboard, Handle)
|
|
65
|
+
function Multiboard.prototype.____constructor(self)
|
|
66
|
+
if Handle:initFromHandle() then
|
|
67
|
+
Handle.prototype.____constructor(self)
|
|
68
|
+
return
|
|
69
|
+
end
|
|
70
|
+
local handle = CreateMultiboard()
|
|
71
|
+
if handle == nil then
|
|
72
|
+
error("w3ts failed to create multiboard handle.", 3)
|
|
73
|
+
end
|
|
74
|
+
Handle.prototype.____constructor(self, handle)
|
|
75
|
+
end
|
|
76
|
+
__TS__SetDescriptor(
|
|
77
|
+
Multiboard.prototype,
|
|
78
|
+
"columns",
|
|
79
|
+
{
|
|
80
|
+
get = function(self)
|
|
81
|
+
return MultiboardGetColumnCount(self.handle)
|
|
82
|
+
end,
|
|
83
|
+
set = function(self, count)
|
|
84
|
+
MultiboardSetColumnCount(self.handle, count)
|
|
85
|
+
end
|
|
86
|
+
},
|
|
87
|
+
true
|
|
88
|
+
)
|
|
89
|
+
__TS__SetDescriptor(
|
|
90
|
+
Multiboard.prototype,
|
|
91
|
+
"displayed",
|
|
92
|
+
{get = function(self)
|
|
93
|
+
return IsMultiboardDisplayed(self.handle)
|
|
94
|
+
end},
|
|
95
|
+
true
|
|
96
|
+
)
|
|
97
|
+
__TS__SetDescriptor(
|
|
98
|
+
Multiboard.prototype,
|
|
99
|
+
"rows",
|
|
100
|
+
{
|
|
101
|
+
get = function(self)
|
|
102
|
+
return MultiboardGetRowCount(self.handle)
|
|
103
|
+
end,
|
|
104
|
+
set = function(self, count)
|
|
105
|
+
MultiboardSetRowCount(self.handle, count)
|
|
106
|
+
end
|
|
107
|
+
},
|
|
108
|
+
true
|
|
109
|
+
)
|
|
110
|
+
__TS__SetDescriptor(
|
|
111
|
+
Multiboard.prototype,
|
|
112
|
+
"title",
|
|
113
|
+
{
|
|
114
|
+
get = function(self)
|
|
115
|
+
return MultiboardGetTitleText(self.handle) or ""
|
|
116
|
+
end,
|
|
117
|
+
set = function(self, label)
|
|
118
|
+
MultiboardSetTitleText(self.handle, label)
|
|
119
|
+
end
|
|
120
|
+
},
|
|
121
|
+
true
|
|
122
|
+
)
|
|
123
|
+
function Multiboard.create(self)
|
|
124
|
+
local handle = CreateMultiboard()
|
|
125
|
+
if handle then
|
|
126
|
+
local obj = self:getObject(handle)
|
|
127
|
+
local values = {}
|
|
128
|
+
values.handle = handle
|
|
129
|
+
return __TS__ObjectAssign(obj, values)
|
|
130
|
+
end
|
|
131
|
+
return nil
|
|
132
|
+
end
|
|
133
|
+
function Multiboard.prototype.clear(self)
|
|
134
|
+
MultiboardClear(self.handle)
|
|
135
|
+
end
|
|
136
|
+
function Multiboard.prototype.createItem(self, x, y)
|
|
137
|
+
return ____exports.MultiboardItem:create(self, x, y)
|
|
138
|
+
end
|
|
139
|
+
function Multiboard.prototype.destroy(self)
|
|
140
|
+
DestroyMultiboard(self.handle)
|
|
141
|
+
end
|
|
142
|
+
function Multiboard.prototype.display(self, show)
|
|
143
|
+
MultiboardDisplay(self.handle, show)
|
|
144
|
+
end
|
|
145
|
+
function Multiboard.prototype.minimize(self, flag)
|
|
146
|
+
MultiboardMinimize(self.handle, flag)
|
|
147
|
+
end
|
|
148
|
+
function Multiboard.prototype.minimized(self)
|
|
149
|
+
return IsMultiboardMinimized(self.handle)
|
|
150
|
+
end
|
|
151
|
+
function Multiboard.prototype.setItemsIcons(self, icon)
|
|
152
|
+
MultiboardSetItemsIcon(self.handle, icon)
|
|
153
|
+
end
|
|
154
|
+
function Multiboard.prototype.setItemsStyle(self, showValues, showIcons)
|
|
155
|
+
MultiboardSetItemsStyle(self.handle, showValues, showIcons)
|
|
156
|
+
end
|
|
157
|
+
function Multiboard.prototype.setItemsValue(self, value)
|
|
158
|
+
MultiboardSetItemsValue(self.handle, value)
|
|
159
|
+
end
|
|
160
|
+
function Multiboard.prototype.setItemsValueColor(self, red, green, blue, alpha)
|
|
161
|
+
MultiboardSetItemsValueColor(
|
|
162
|
+
self.handle,
|
|
163
|
+
red,
|
|
164
|
+
green,
|
|
165
|
+
blue,
|
|
166
|
+
alpha
|
|
167
|
+
)
|
|
168
|
+
end
|
|
169
|
+
function Multiboard.prototype.setItemsWidth(self, width)
|
|
170
|
+
MultiboardSetItemsWidth(self.handle, width)
|
|
171
|
+
end
|
|
172
|
+
function Multiboard.prototype.setTitleTextColor(self, red, green, blue, alpha)
|
|
173
|
+
MultiboardSetTitleTextColor(
|
|
174
|
+
self.handle,
|
|
175
|
+
red,
|
|
176
|
+
green,
|
|
177
|
+
blue,
|
|
178
|
+
alpha
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
function Multiboard.fromHandle(self, handle)
|
|
182
|
+
local ____handle_0
|
|
183
|
+
if handle then
|
|
184
|
+
____handle_0 = self:getObject(handle)
|
|
185
|
+
else
|
|
186
|
+
____handle_0 = nil
|
|
187
|
+
end
|
|
188
|
+
return ____handle_0
|
|
189
|
+
end
|
|
190
|
+
function Multiboard.suppressDisplay(self, flag)
|
|
191
|
+
MultiboardSuppressDisplay(flag)
|
|
192
|
+
end
|
|
193
|
+
return ____exports
|
|
@@ -0,0 +1,311 @@
|
|
|
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 __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
|
|
6
|
+
local ____exports = {}
|
|
7
|
+
local ____handle = require("lua_modules.w3ts.handles.handle")
|
|
8
|
+
local Handle = ____handle.Handle
|
|
9
|
+
____exports.MapPlayer = __TS__Class()
|
|
10
|
+
local MapPlayer = ____exports.MapPlayer
|
|
11
|
+
MapPlayer.name = "MapPlayer"
|
|
12
|
+
__TS__ClassExtends(MapPlayer, Handle)
|
|
13
|
+
function MapPlayer.prototype.____constructor(self, index)
|
|
14
|
+
if Handle:initFromHandle() then
|
|
15
|
+
Handle.prototype.____constructor(self)
|
|
16
|
+
return
|
|
17
|
+
end
|
|
18
|
+
local handle = Player(index)
|
|
19
|
+
if handle == nil then
|
|
20
|
+
error("w3ts failed to create player handle.", 3)
|
|
21
|
+
end
|
|
22
|
+
Handle.prototype.____constructor(self, handle)
|
|
23
|
+
end
|
|
24
|
+
__TS__SetDescriptor(
|
|
25
|
+
MapPlayer.prototype,
|
|
26
|
+
"color",
|
|
27
|
+
{
|
|
28
|
+
get = function(self)
|
|
29
|
+
return GetPlayerColor(self.handle)
|
|
30
|
+
end,
|
|
31
|
+
set = function(self, color)
|
|
32
|
+
SetPlayerColor(self.handle, color)
|
|
33
|
+
end
|
|
34
|
+
},
|
|
35
|
+
true
|
|
36
|
+
)
|
|
37
|
+
__TS__SetDescriptor(
|
|
38
|
+
MapPlayer.prototype,
|
|
39
|
+
"controller",
|
|
40
|
+
{get = function(self)
|
|
41
|
+
return GetPlayerController(self.handle)
|
|
42
|
+
end},
|
|
43
|
+
true
|
|
44
|
+
)
|
|
45
|
+
__TS__SetDescriptor(
|
|
46
|
+
MapPlayer.prototype,
|
|
47
|
+
"handicap",
|
|
48
|
+
{
|
|
49
|
+
get = function(self)
|
|
50
|
+
return GetPlayerHandicap(self.handle)
|
|
51
|
+
end,
|
|
52
|
+
set = function(self, handicap)
|
|
53
|
+
SetPlayerHandicap(self.handle, handicap)
|
|
54
|
+
end
|
|
55
|
+
},
|
|
56
|
+
true
|
|
57
|
+
)
|
|
58
|
+
__TS__SetDescriptor(
|
|
59
|
+
MapPlayer.prototype,
|
|
60
|
+
"handicapXp",
|
|
61
|
+
{
|
|
62
|
+
get = function(self)
|
|
63
|
+
return GetPlayerHandicapXP(self.handle)
|
|
64
|
+
end,
|
|
65
|
+
set = function(self, handicap)
|
|
66
|
+
SetPlayerHandicapXP(self.handle, handicap)
|
|
67
|
+
end
|
|
68
|
+
},
|
|
69
|
+
true
|
|
70
|
+
)
|
|
71
|
+
__TS__SetDescriptor(
|
|
72
|
+
MapPlayer.prototype,
|
|
73
|
+
"id",
|
|
74
|
+
{get = function(self)
|
|
75
|
+
return GetPlayerId(self.handle)
|
|
76
|
+
end},
|
|
77
|
+
true
|
|
78
|
+
)
|
|
79
|
+
__TS__SetDescriptor(
|
|
80
|
+
MapPlayer.prototype,
|
|
81
|
+
"name",
|
|
82
|
+
{
|
|
83
|
+
get = function(self)
|
|
84
|
+
return GetPlayerName(self.handle) or ""
|
|
85
|
+
end,
|
|
86
|
+
set = function(self, value)
|
|
87
|
+
SetPlayerName(self.handle, value)
|
|
88
|
+
end
|
|
89
|
+
},
|
|
90
|
+
true
|
|
91
|
+
)
|
|
92
|
+
__TS__SetDescriptor(
|
|
93
|
+
MapPlayer.prototype,
|
|
94
|
+
"race",
|
|
95
|
+
{get = function(self)
|
|
96
|
+
return GetPlayerRace(self.handle)
|
|
97
|
+
end},
|
|
98
|
+
true
|
|
99
|
+
)
|
|
100
|
+
__TS__SetDescriptor(
|
|
101
|
+
MapPlayer.prototype,
|
|
102
|
+
"slotState",
|
|
103
|
+
{get = function(self)
|
|
104
|
+
return GetPlayerSlotState(self.handle)
|
|
105
|
+
end},
|
|
106
|
+
true
|
|
107
|
+
)
|
|
108
|
+
__TS__SetDescriptor(
|
|
109
|
+
MapPlayer.prototype,
|
|
110
|
+
"startLocation",
|
|
111
|
+
{get = function(self)
|
|
112
|
+
return GetPlayerStartLocation(self.handle)
|
|
113
|
+
end},
|
|
114
|
+
true
|
|
115
|
+
)
|
|
116
|
+
__TS__SetDescriptor(
|
|
117
|
+
MapPlayer.prototype,
|
|
118
|
+
"startLocationX",
|
|
119
|
+
{get = function(self)
|
|
120
|
+
return GetStartLocationX(self.startLocation)
|
|
121
|
+
end},
|
|
122
|
+
true
|
|
123
|
+
)
|
|
124
|
+
__TS__SetDescriptor(
|
|
125
|
+
MapPlayer.prototype,
|
|
126
|
+
"startLocationY",
|
|
127
|
+
{get = function(self)
|
|
128
|
+
return GetStartLocationY(self.startLocation)
|
|
129
|
+
end},
|
|
130
|
+
true
|
|
131
|
+
)
|
|
132
|
+
__TS__SetDescriptor(
|
|
133
|
+
MapPlayer.prototype,
|
|
134
|
+
"startLocationPoint",
|
|
135
|
+
{get = function(self)
|
|
136
|
+
return GetStartLocationLoc(self.startLocation)
|
|
137
|
+
end},
|
|
138
|
+
true
|
|
139
|
+
)
|
|
140
|
+
__TS__SetDescriptor(
|
|
141
|
+
MapPlayer.prototype,
|
|
142
|
+
"team",
|
|
143
|
+
{get = function(self)
|
|
144
|
+
return GetPlayerTeam(self.handle)
|
|
145
|
+
end},
|
|
146
|
+
true
|
|
147
|
+
)
|
|
148
|
+
__TS__SetDescriptor(
|
|
149
|
+
MapPlayer.prototype,
|
|
150
|
+
"townHallCount",
|
|
151
|
+
{get = function(self)
|
|
152
|
+
return BlzGetPlayerTownHallCount(self.handle)
|
|
153
|
+
end},
|
|
154
|
+
true
|
|
155
|
+
)
|
|
156
|
+
function MapPlayer.create(self, index)
|
|
157
|
+
local handle = Player(index)
|
|
158
|
+
if handle then
|
|
159
|
+
local obj = self:getObject(handle)
|
|
160
|
+
local values = {}
|
|
161
|
+
values.handle = handle
|
|
162
|
+
return __TS__ObjectAssign(obj, values)
|
|
163
|
+
end
|
|
164
|
+
return nil
|
|
165
|
+
end
|
|
166
|
+
function MapPlayer.prototype.addTechResearched(self, techId, levels)
|
|
167
|
+
AddPlayerTechResearched(self.handle, techId, levels)
|
|
168
|
+
end
|
|
169
|
+
function MapPlayer.prototype.decTechResearched(self, techId, levels)
|
|
170
|
+
BlzDecPlayerTechResearched(self.handle, techId, levels)
|
|
171
|
+
end
|
|
172
|
+
function MapPlayer.prototype.cacheHeroData(self)
|
|
173
|
+
CachePlayerHeroData(self.handle)
|
|
174
|
+
end
|
|
175
|
+
function MapPlayer.prototype.compareAlliance(self, otherPlayer, whichAllianceSetting)
|
|
176
|
+
return GetPlayerAlliance(self.handle, otherPlayer.handle, whichAllianceSetting)
|
|
177
|
+
end
|
|
178
|
+
function MapPlayer.prototype.coordsFogged(self, x, y)
|
|
179
|
+
return IsFoggedToPlayer(x, y, self.handle)
|
|
180
|
+
end
|
|
181
|
+
function MapPlayer.prototype.coordsMasked(self, x, y)
|
|
182
|
+
return IsMaskedToPlayer(x, y, self.handle)
|
|
183
|
+
end
|
|
184
|
+
function MapPlayer.prototype.coordsVisible(self, x, y)
|
|
185
|
+
return IsVisibleToPlayer(x, y, self.handle)
|
|
186
|
+
end
|
|
187
|
+
function MapPlayer.prototype.cripple(self, toWhichPlayers, flag)
|
|
188
|
+
CripplePlayer(self.handle, toWhichPlayers.handle, flag)
|
|
189
|
+
end
|
|
190
|
+
function MapPlayer.prototype.getScore(self, whichPlayerScore)
|
|
191
|
+
return GetPlayerScore(self.handle, whichPlayerScore)
|
|
192
|
+
end
|
|
193
|
+
function MapPlayer.prototype.getState(self, whichPlayerState)
|
|
194
|
+
return GetPlayerState(self.handle, whichPlayerState)
|
|
195
|
+
end
|
|
196
|
+
function MapPlayer.prototype.getStructureCount(self, includeIncomplete)
|
|
197
|
+
return GetPlayerStructureCount(self.handle, includeIncomplete)
|
|
198
|
+
end
|
|
199
|
+
function MapPlayer.prototype.getTaxRate(self, otherPlayer, whichResource)
|
|
200
|
+
return GetPlayerTaxRate(self.handle, otherPlayer, whichResource)
|
|
201
|
+
end
|
|
202
|
+
function MapPlayer.prototype.getTechCount(self, techId, specificonly)
|
|
203
|
+
return GetPlayerTechCount(self.handle, techId, specificonly)
|
|
204
|
+
end
|
|
205
|
+
function MapPlayer.prototype.getTechMaxAllowed(self, techId)
|
|
206
|
+
return GetPlayerTechMaxAllowed(self.handle, techId)
|
|
207
|
+
end
|
|
208
|
+
function MapPlayer.prototype.getTechResearched(self, techId, specificonly)
|
|
209
|
+
return GetPlayerTechResearched(self.handle, techId, specificonly)
|
|
210
|
+
end
|
|
211
|
+
function MapPlayer.prototype.getUnitCount(self, includeIncomplete)
|
|
212
|
+
return GetPlayerUnitCount(self.handle, includeIncomplete)
|
|
213
|
+
end
|
|
214
|
+
function MapPlayer.prototype.getUnitCountByType(self, unitName, includeIncomplete, includeUpgrades)
|
|
215
|
+
return GetPlayerTypedUnitCount(self.handle, unitName, includeIncomplete, includeUpgrades)
|
|
216
|
+
end
|
|
217
|
+
function MapPlayer.prototype.inForce(self, whichForce)
|
|
218
|
+
return IsPlayerInForce(self.handle, whichForce.handle)
|
|
219
|
+
end
|
|
220
|
+
function MapPlayer.prototype.isLocal(self)
|
|
221
|
+
return GetLocalPlayer() == self.handle
|
|
222
|
+
end
|
|
223
|
+
function MapPlayer.prototype.isObserver(self)
|
|
224
|
+
return IsPlayerObserver(self.handle)
|
|
225
|
+
end
|
|
226
|
+
function MapPlayer.prototype.isPlayerAlly(self, otherPlayer)
|
|
227
|
+
return IsPlayerAlly(self.handle, otherPlayer.handle)
|
|
228
|
+
end
|
|
229
|
+
function MapPlayer.prototype.isPlayerEnemy(self, otherPlayer)
|
|
230
|
+
return IsPlayerEnemy(self.handle, otherPlayer.handle)
|
|
231
|
+
end
|
|
232
|
+
function MapPlayer.prototype.isRacePrefSet(self, pref)
|
|
233
|
+
return IsPlayerRacePrefSet(self.handle, pref)
|
|
234
|
+
end
|
|
235
|
+
function MapPlayer.prototype.isSelectable(self)
|
|
236
|
+
return GetPlayerSelectable(self.handle)
|
|
237
|
+
end
|
|
238
|
+
function MapPlayer.prototype.pointFogged(self, whichPoint)
|
|
239
|
+
return IsLocationFoggedToPlayer(whichPoint.handle, self.handle)
|
|
240
|
+
end
|
|
241
|
+
function MapPlayer.prototype.pointMasked(self, whichPoint)
|
|
242
|
+
return IsLocationMaskedToPlayer(whichPoint.handle, self.handle)
|
|
243
|
+
end
|
|
244
|
+
function MapPlayer.prototype.pointVisible(self, whichPoint)
|
|
245
|
+
return IsLocationVisibleToPlayer(whichPoint.handle, self.handle)
|
|
246
|
+
end
|
|
247
|
+
function MapPlayer.prototype.remove(self, gameResult)
|
|
248
|
+
RemovePlayer(self.handle, gameResult)
|
|
249
|
+
end
|
|
250
|
+
function MapPlayer.prototype.removeAllGuardPositions(self)
|
|
251
|
+
RemoveAllGuardPositions(self.handle)
|
|
252
|
+
end
|
|
253
|
+
function MapPlayer.prototype.setAbilityAvailable(self, abilId, avail)
|
|
254
|
+
SetPlayerAbilityAvailable(self.handle, abilId, avail)
|
|
255
|
+
end
|
|
256
|
+
function MapPlayer.prototype.setAlliance(self, otherPlayer, whichAllianceSetting, value)
|
|
257
|
+
SetPlayerAlliance(self.handle, otherPlayer.handle, whichAllianceSetting, value)
|
|
258
|
+
end
|
|
259
|
+
function MapPlayer.prototype.setOnScoreScreen(self, flag)
|
|
260
|
+
SetPlayerOnScoreScreen(self.handle, flag)
|
|
261
|
+
end
|
|
262
|
+
function MapPlayer.prototype.setState(self, whichPlayerState, value)
|
|
263
|
+
SetPlayerState(self.handle, whichPlayerState, value)
|
|
264
|
+
end
|
|
265
|
+
function MapPlayer.prototype.setTaxRate(self, otherPlayer, whichResource, rate)
|
|
266
|
+
SetPlayerTaxRate(self.handle, otherPlayer.handle, whichResource, rate)
|
|
267
|
+
end
|
|
268
|
+
function MapPlayer.prototype.setTechMaxAllowed(self, techId, maximum)
|
|
269
|
+
SetPlayerTechMaxAllowed(self.handle, techId, maximum)
|
|
270
|
+
end
|
|
271
|
+
function MapPlayer.prototype.setTechResearched(self, techId, setToLevel)
|
|
272
|
+
SetPlayerTechResearched(self.handle, techId, setToLevel)
|
|
273
|
+
end
|
|
274
|
+
function MapPlayer.prototype.setUnitsOwner(self, newOwner)
|
|
275
|
+
SetPlayerUnitsOwner(self.handle, newOwner)
|
|
276
|
+
end
|
|
277
|
+
function MapPlayer.fromEnum(self)
|
|
278
|
+
return ____exports.MapPlayer:fromHandle(GetEnumPlayer())
|
|
279
|
+
end
|
|
280
|
+
function MapPlayer.fromEvent(self)
|
|
281
|
+
return ____exports.MapPlayer:fromHandle(GetTriggerPlayer())
|
|
282
|
+
end
|
|
283
|
+
function MapPlayer.fromFilter(self)
|
|
284
|
+
return ____exports.MapPlayer:fromHandle(GetFilterPlayer())
|
|
285
|
+
end
|
|
286
|
+
function MapPlayer.fromHandle(self, handle)
|
|
287
|
+
local ____handle_0
|
|
288
|
+
if handle then
|
|
289
|
+
____handle_0 = self:getObject(handle)
|
|
290
|
+
else
|
|
291
|
+
____handle_0 = nil
|
|
292
|
+
end
|
|
293
|
+
return ____handle_0
|
|
294
|
+
end
|
|
295
|
+
function MapPlayer.fromIndex(self, index)
|
|
296
|
+
return self:fromHandle(Player(index))
|
|
297
|
+
end
|
|
298
|
+
function MapPlayer.fromLocal(self)
|
|
299
|
+
local pl = GetLocalPlayer()
|
|
300
|
+
if pl == nil then
|
|
301
|
+
do
|
|
302
|
+
local i = 0
|
|
303
|
+
while i < 10 do
|
|
304
|
+
print("$$$$$$$$$ LOCAL PLAYER IS NULL. TELL ME")
|
|
305
|
+
i = i + 1
|
|
306
|
+
end
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
return self:fromHandle(pl)
|
|
310
|
+
end
|
|
311
|
+
return ____exports
|
|
@@ -0,0 +1,80 @@
|
|
|
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 __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
|
|
6
|
+
local ____exports = {}
|
|
7
|
+
local ____handle = require("lua_modules.w3ts.handles.handle")
|
|
8
|
+
local Handle = ____handle.Handle
|
|
9
|
+
____exports.Point = __TS__Class()
|
|
10
|
+
local Point = ____exports.Point
|
|
11
|
+
Point.name = "Point"
|
|
12
|
+
__TS__ClassExtends(Point, Handle)
|
|
13
|
+
function Point.prototype.____constructor(self, x, y)
|
|
14
|
+
if Handle:initFromHandle() then
|
|
15
|
+
Handle.prototype.____constructor(self)
|
|
16
|
+
return
|
|
17
|
+
end
|
|
18
|
+
local handle = Location(x, y)
|
|
19
|
+
if handle == nil then
|
|
20
|
+
error("w3ts failed to create player handle.", 3)
|
|
21
|
+
end
|
|
22
|
+
Handle.prototype.____constructor(self, handle)
|
|
23
|
+
end
|
|
24
|
+
__TS__SetDescriptor(
|
|
25
|
+
Point.prototype,
|
|
26
|
+
"x",
|
|
27
|
+
{
|
|
28
|
+
get = function(self)
|
|
29
|
+
return GetLocationX(self.handle)
|
|
30
|
+
end,
|
|
31
|
+
set = function(self, value)
|
|
32
|
+
MoveLocation(self.handle, value, self.y)
|
|
33
|
+
end
|
|
34
|
+
},
|
|
35
|
+
true
|
|
36
|
+
)
|
|
37
|
+
__TS__SetDescriptor(
|
|
38
|
+
Point.prototype,
|
|
39
|
+
"y",
|
|
40
|
+
{
|
|
41
|
+
get = function(self)
|
|
42
|
+
return GetLocationY(self.handle)
|
|
43
|
+
end,
|
|
44
|
+
set = function(self, value)
|
|
45
|
+
MoveLocation(self.handle, self.x, value)
|
|
46
|
+
end
|
|
47
|
+
},
|
|
48
|
+
true
|
|
49
|
+
)
|
|
50
|
+
__TS__SetDescriptor(
|
|
51
|
+
Point.prototype,
|
|
52
|
+
"z",
|
|
53
|
+
{get = function(self)
|
|
54
|
+
return GetLocationZ(self.handle)
|
|
55
|
+
end},
|
|
56
|
+
true
|
|
57
|
+
)
|
|
58
|
+
function Point.create(self, x, y)
|
|
59
|
+
local handle = Location(x, y)
|
|
60
|
+
local obj = self:getObject(handle)
|
|
61
|
+
local values = {}
|
|
62
|
+
values.handle = handle
|
|
63
|
+
return __TS__ObjectAssign(obj, values)
|
|
64
|
+
end
|
|
65
|
+
function Point.prototype.destroy(self)
|
|
66
|
+
RemoveLocation(self.handle)
|
|
67
|
+
end
|
|
68
|
+
function Point.prototype.setPosition(self, x, y)
|
|
69
|
+
MoveLocation(self.handle, x, y)
|
|
70
|
+
end
|
|
71
|
+
function Point.fromHandle(self, handle)
|
|
72
|
+
local ____handle_0
|
|
73
|
+
if handle then
|
|
74
|
+
____handle_0 = self:getObject(handle)
|
|
75
|
+
else
|
|
76
|
+
____handle_0 = nil
|
|
77
|
+
end
|
|
78
|
+
return ____handle_0
|
|
79
|
+
end
|
|
80
|
+
return ____exports
|