-
Notifications
You must be signed in to change notification settings - Fork 9
/
script_1b4af057274ffcd0.gsc
320 lines (308 loc) · 7.83 KB
/
script_1b4af057274ffcd0.gsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
// Decompiled by Serious. Credits to Scoba for his original tool, Cerberus, which I heavily upgraded to support remaining features, other games, and other platforms.
#using scripts\core_common\util_shared.gsc;
#using scripts\core_common\system_shared.gsc;
#using scripts\core_common\ai\strategic_command.gsc;
#using scripts\core_common\ai\planner_squad.gsc;
#using scripts\core_common\ai\planner_commander.gsc;
#using script_30e0aa25775a6927;
#using script_31e56101095f174b;
#using script_522aeb6ae906391e;
#namespace namespace_e4f52212;
/*
Name: __init__system__
Namespace: namespace_e4f52212
Checksum: 0xF89033D0
Offset: 0x108
Size: 0x3C
Parameters: 0
Flags: AutoExec
*/
function autoexec __init__system__()
{
system::register(#"hash_44a6f2632e19a5c3", &namespace_526571f4::__init__, undefined, undefined);
}
#namespace namespace_526571f4;
/*
Name: __init__
Namespace: namespace_526571f4
Checksum: 0x7079EA14
Offset: 0x150
Size: 0x154
Parameters: 0
Flags: Linked, Private
*/
function private __init__()
{
plannercommanderutility::registerutilityapi(#"commanderscoreage", &_monkey_water_corvus_vo_cleared);
plannercommanderutility::registerdaemonapi(#"daemonzmaltars", &function_ea95685);
plannercommanderutility::registerdaemonapi(#"daemonzmblockers", &function_80c4721f);
plannercommanderutility::registerdaemonapi(#"daemonzmchests", &function_73588006);
plannercommanderutility::registerdaemonapi(#"daemonzmpowerups", &function_ccdf2c6f);
plannercommanderutility::registerdaemonapi(#"daemonzmswitches", &function_48fcded4);
plannercommanderutility::registerdaemonapi(#"daemonzmwallbuys", &function_873b1369);
}
/*
Name: function_ea95685
Namespace: namespace_526571f4
Checksum: 0x7EF8BAE2
Offset: 0x2B0
Size: 0x1AC
Parameters: 1
Flags: Linked, Private
*/
function private function_ea95685(commander)
{
altars = [];
if(isarray(level.var_76a7ad28))
{
foreach(altar in level.var_76a7ad28)
{
if(!isdefined(altar))
{
continue;
}
var_bc510a14 = array();
var_bc510a14[#"origin"] = altar.origin;
var_bc510a14[#"type"] = altar.script_unitrigger_type;
if(!isdefined(var_bc510a14[#"__unsafe__"]))
{
var_bc510a14[#"__unsafe__"] = array();
}
var_bc510a14[#"__unsafe__"][#"altar"] = altar;
altars[altars.size] = var_bc510a14;
}
}
blackboard::setstructblackboardattribute(commander, #"zm_altars", altars);
}
/*
Name: function_80c4721f
Namespace: namespace_526571f4
Checksum: 0x1678D242
Offset: 0x468
Size: 0x324
Parameters: 1
Flags: Linked, Private
*/
function private function_80c4721f(commander)
{
blockers = [];
var_521da80d = array("zombie_door", "zombie_airlock_buy", "zombie_debris");
foreach(var_b849a5e7 in var_521da80d)
{
doorblockers = getentarray(var_b849a5e7, "targetname");
foreach(doorblocker in doorblockers)
{
var_6f43058 = array();
if(isdefined(doorblocker.purchaser))
{
continue;
}
if(doorblocker._door_open === 1 || doorblocker.has_been_opened === 1)
{
continue;
}
if(isdefined(doorblocker.var_1661d836) && doorblocker.var_1661d836)
{
continue;
}
if(isdefined(doorblocker.var_c947f134) && doorblocker.var_c947f134)
{
continue;
}
if(isdefined(doorblocker.script_noteworthy))
{
switch(doorblocker.script_noteworthy)
{
case "electric_door":
case "local_electric_door":
case "electric_buyable_door":
{
continue;
}
}
}
var_6f43058[#"cost"] = doorblocker.zombie_cost;
var_6f43058[#"origin"] = doorblocker.origin;
if(!isdefined(var_6f43058[#"__unsafe__"]))
{
var_6f43058[#"__unsafe__"] = array();
}
var_6f43058[#"__unsafe__"][#"blocker"] = doorblocker;
blockers[blockers.size] = var_6f43058;
}
}
blackboard::setstructblackboardattribute(commander, #"zm_blockers", blockers);
}
/*
Name: function_73588006
Namespace: namespace_526571f4
Checksum: 0x128C936D
Offset: 0x798
Size: 0x1FC
Parameters: 1
Flags: Linked, Private
*/
function private function_73588006(commander)
{
chests = [];
if(isarray(level.chests))
{
foreach(chest in level.chests)
{
if(!isdefined(chest))
{
continue;
}
if(isdefined(chest.hidden) && chest.hidden)
{
continue;
}
var_559e6014 = array();
var_559e6014[#"origin"] = chest.unitrigger_stub.origin;
var_559e6014[#"cost"] = chest.zombie_cost;
var_559e6014[#"type"] = chest.unitrigger_stub.script_unitrigger_type;
if(!isdefined(var_559e6014[#"__unsafe__"]))
{
var_559e6014[#"__unsafe__"] = array();
}
var_559e6014[#"__unsafe__"][#"chest"] = chest;
chests[chests.size] = var_559e6014;
}
}
blackboard::setstructblackboardattribute(commander, #"zm_chests", chests);
}
/*
Name: function_ccdf2c6f
Namespace: namespace_526571f4
Checksum: 0x9A63DA32
Offset: 0x9A0
Size: 0x1AC
Parameters: 1
Flags: Linked, Private
*/
function private function_ccdf2c6f(commander)
{
powerups = [];
if(isarray(level.active_powerups))
{
foreach(powerup in level.active_powerups)
{
if(!isdefined(powerup))
{
continue;
}
if(powerup.powerup_name == #"nuke")
{
continue;
}
var_131b0d64 = array();
var_131b0d64[#"type"] = powerup.powerup_name;
if(!isdefined(var_131b0d64[#"__unsafe__"]))
{
var_131b0d64[#"__unsafe__"] = array();
}
var_131b0d64[#"__unsafe__"][#"powerup"] = powerup;
powerups[powerups.size] = var_131b0d64;
}
}
blackboard::setstructblackboardattribute(commander, #"zm_powerups", powerups);
}
/*
Name: function_48fcded4
Namespace: namespace_526571f4
Checksum: 0xDCDE691C
Offset: 0xB58
Size: 0x1CC
Parameters: 1
Flags: Linked, Private
*/
function private function_48fcded4(commander)
{
switches = [];
switchents = getentarray("use_elec_switch", "targetname");
if(isarray(switchents))
{
foreach(switchent in switchents)
{
if(!isdefined(switchent))
{
continue;
}
var_b353dc21 = array();
var_b353dc21[#"origin"] = switchent.origin;
var_b353dc21[#"cost"] = switchent.zombie_cost;
if(!isdefined(var_b353dc21[#"__unsafe__"]))
{
var_b353dc21[#"__unsafe__"] = array();
}
var_b353dc21[#"__unsafe__"][#"switch"] = switchent;
switches[switches.size] = var_b353dc21;
}
}
blackboard::setstructblackboardattribute(commander, #"zm_switches", switches);
}
/*
Name: function_873b1369
Namespace: namespace_526571f4
Checksum: 0x8673E97E
Offset: 0xD30
Size: 0x2FC
Parameters: 1
Flags: Linked, Private
*/
function private function_873b1369(commander)
{
wallbuys = [];
if(isarray(level._spawned_wallbuys))
{
foreach(wallbuy in level._spawned_wallbuys)
{
if(!isdefined(wallbuy.trigger_stub))
{
continue;
}
if(wallbuy.weapon.type === "melee")
{
continue;
}
var_75f73822 = array();
var_75f73822[#"weapon"] = wallbuy.weapon;
var_75f73822[#"origin"] = wallbuy.trigger_stub.origin;
var_75f73822[#"height"] = wallbuy.trigger_stub.script_height;
var_75f73822[#"length"] = wallbuy.trigger_stub.script_length;
var_75f73822[#"width"] = wallbuy.trigger_stub.script_width;
var_75f73822[#"type"] = wallbuy.trigger_stub.script_unitrigger_type;
zombieweapon = level.zombie_weapons[wallbuy.weapon];
var_75f73822[#"ammo_cost"] = zombieweapon.ammo_cost;
var_75f73822[#"cost"] = zombieweapon.cost;
var_75f73822[#"upgrade_weapon"] = zombieweapon.upgrade;
if(!isdefined(var_75f73822[#"__unsafe__"]))
{
var_75f73822[#"__unsafe__"] = array();
}
var_75f73822[#"__unsafe__"][#"wallbuy"] = wallbuy;
wallbuys[wallbuys.size] = var_75f73822;
}
}
blackboard::setstructblackboardattribute(commander, #"zm_wallbuys", wallbuys);
}
/*
Name: _monkey_water_corvus_vo_cleared
Namespace: namespace_526571f4
Checksum: 0xB1098E6C
Offset: 0x1038
Size: 0x9A
Parameters: 3
Flags: Linked, Private
*/
function private _monkey_water_corvus_vo_cleared(commander, squad, constants)
{
/#
assert(isdefined(constants[#"maxage"]), ("" + "") + "");
#/
if(gettime() > squad.createtime + constants[#"maxage"])
{
return 0;
}
return 1;
}