Debian Codegraph @

scripts/myPowerHouse.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /////////////////////////////////////////////////////////////////////
20 // D.A.L.L.A.S. Generated Level Script - DLL Source File
21 //
22 // Filename: myPowerHouse.cpp
23 // Version: 3
24 /////////////////////////////////////////////////////////////////////
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <string.h>
28 #include <ctype.h>
29 #include "osiris_import.h"cxx . . $ `<file>/scripts/osiris_import.h`/
30 #include "osiris_common.h"cxx . . $ `<file>/scripts/osiris_common.h`/
31 #include "DallasFuncs.cpp"cxx . . $ `<file>/scripts/DallasFuncs.cpp`/
32
33 #include "module.h"cxx . . $ `<file>/lib/module.h`/
34
35 #ifdef __cpluspluscxx . . $ `<built-in>:467:9`!
36 extern "C" {
37 #endif
38 DLLEXPORTcxx . . $ `lib/module.h:114:9`! char STDCALLcxx . . $ `lib/module.h:88:11`! InitializeDLL(tOSIRISModuleInitcxx . . $ tOSIRISModuleInit# *func_list);
39 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void STDCALLcxx . . $ `lib/module.h:88:11`! ShutdownDLL(void);
40 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int STDCALLcxx . . $ `lib/module.h:88:11`! GetGOScriptID(const char *name, uint8_tcxx . . $ uint8_t# is_door);
41 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void STDCALLPTRcxx . . $ `lib/module.h:90:10`! CreateInstance(int id);
42 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void STDCALLcxx . . $ `lib/module.h:88:11`! DestroyInstance(int id, void *ptr);
43 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int16_t STDCALLcxx . . $ `lib/module.h:88:11`! CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data);
44 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int STDCALLcxx . . $ `lib/module.h:88:11`! GetTriggerScriptID(int trigger_room, int trigger_face);
45 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int STDCALLcxx . . $ `lib/module.h:88:11`! GetCOScriptList(int **list, int **id_list);
46 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int STDCALLcxx . . $ `lib/module.h:88:11`! SaveRestoreState(void *file_ptr, uint8_tcxx . . $ uint8_t# saving_state);
47 #ifdef __cpluspluscxx . . $ `<built-in>:467:9`!
48 }
49 #endif
50
51 // =================
52 // Script ID Numbers
53 // =================
54 #define ID_LEVEL_0000cxx . . $ `scripts/myPowerHouse.cpp:54:9`! 0x000
55
56 #define ID_CUSTOM_OBJECT_0827cxx . . $ `scripts/myPowerHouse.cpp:56:9`! 0x001
57
58 // ========================
59 // Script Class Definitions
60 // ========================
61
62 class BaseScriptcxx . . $ BaseScript# {
63 public:
64 BaseScriptcxx . . $ BaseScript#BaseScript(49f6e7a06ebc5aa8).();
65 ~cxx . . $ BaseScript#`~BaseScript`(ced63f7c635d850d).BaseScriptcxx . . $ BaseScript#();
66 virtual int16_t CallEventcxx . . $ BaseScript#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data);
67 };
68
69 class LevelScript_0000cxx . . $ LevelScript_0000# : public BaseScriptcxx . . $ BaseScript# {
70 public:
71 int16_t CallEventcxx . . $ LevelScript_0000#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data);
72 };
73
74 class CustomObjectScript_0827cxx . . $ CustomObjectScript_0827# : public BaseScriptcxx . . $ BaseScript# {
75 public:
76 int16_t CallEventcxx . . $ CustomObjectScript_0827#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data);
77 };
78
79 // ======================
80 // Global Action Counters
81 // ======================
82
83 #define MAX_ACTION_CTR_VALUEcxx . . $ `scripts/myPowerHouse.cpp:83:9`! 100000
84
85 int ScriptActionCtr_000cxx . . $ ScriptActionCtr_000. = 0;
86
87 // ========================================
88 // Function to Clear Global Action Counters
89 // ========================================
90 void ClearGlobalActionCtrscxx . . $ ClearGlobalActionCtrs(49f6e7a06ebc5aa8).(void) { ScriptActionCtr_000cxx . . $ ScriptActionCtr_000. = 0; }
91
92 // ========================================
93 // Function to Save Global Action Counters
94 // ========================================
95 void SaveGlobalActionCtrscxx . . $ SaveGlobalActionCtrs(5d22bdacc48458e8).(void *file_ptr) { File_WriteIntcxx . . $ File_WriteInt.(ScriptActionCtr_000cxx . . $ ScriptActionCtr_000., file_ptr); }
96
97 // ===========================================
98 // Function to Restore Global Action Counters
99 // ===========================================
100 void RestoreGlobalActionCtrscxx . . $ RestoreGlobalActionCtrs(5d22bdacc48458e8).(void *file_ptr) { ScriptActionCtr_000cxx . . $ ScriptActionCtr_000. = File_ReadIntcxx . . $ File_ReadInt.(file_ptr); }
101
102 // ===============================================================
103 // Start of Custom Script Block - DO NOT EDIT ANYTHING BEFORE THIS
104 // ===============================================================
105 /**{CUSTOM_SCRIPT_BLOCK_START}** DO NOT EDIT! **/
106
107 // Enter your custom script code here
108
109 /**{CUSTOM_SCRIPT_BLOCK_END}**** DO NOT EDIT! **/
110 // ============================================================
111 // End of Custom Script Block - DO NOT EDIT ANYTHING AFTER THIS
112 // ============================================================
113
114 // =================
115 // Message File Data
116 // =================
117
118 #define MAX_SCRIPT_MESSAGEScxx . . $ `scripts/myPowerHouse.cpp:118:9`! 256
119 #define MAX_MSG_FILEBUF_LENcxx . . $ `scripts/myPowerHouse.cpp:119:9`! 1024
120 #define NO_MESSAGE_STRINGcxx . . $ `scripts/myPowerHouse.cpp:120:9`! "*Message Not Found*"
121 #define INV_MSGNAME_STRINGcxx . . $ `scripts/myPowerHouse.cpp:121:9`! "*Message Name Invalid*"
122 #define WHITESPACE_CHARScxx . . $ `scripts/myPowerHouse.cpp:122:9`! " \t\r\n"
123
124 // Structure for storing a script message
125 struct tScriptMessagecxx . . $ tScriptMessage# {
126 char *namecxx . . $ tScriptMessage#name.; // the name of the message
127 char *messagecxx . . $ tScriptMessage#message.; // the actual message text
128 };
129
130 // Global storage for level script messages
131 tScriptMessagecxx . . $ tScriptMessage# *message_listcxx . . $ message_list.[MAX_SCRIPT_MESSAGEScxx . . $ `scripts/myPowerHouse.cpp:118:9`!];
132 int num_messagescxx . . $ num_messages.;
133
134 // ======================
135 // Message File Functions
136 // ======================
137
138 // Initializes the Message List
139 void InitMessageListcxx . . $ InitMessageList(49f6e7a06ebc5aa8).(void) {
140 for (int j = 0; j < MAX_SCRIPT_MESSAGEScxx . . $ `scripts/myPowerHouse.cpp:118:9`!; j++)
141 message_listcxx . . $ message_list.[j] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
142 num_messagescxx . . $ num_messages. = 0;
143 }
144
145 // Clear the Message List
146 void ClearMessageListcxx . . $ ClearMessageList(49f6e7a06ebc5aa8).(void) {
147 for (int j = 0; j < num_messagescxx . . $ num_messages.; j++) {
148 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[j]->namecxx . . $ tScriptMessage#name.);
149 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[j]->messagecxx . . $ tScriptMessage#message.);
150 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[j]);
151 message_listcxx . . $ message_list.[j] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
152 }
153 num_messagescxx . . $ num_messages. = 0;
154 }
155
156 // Adds a message to the list
157 int AddMessageToListcxx . . $ AddMessageToList(e99f026884c896d5).(char *name, char *msg) {
158 int pos;
159
160 // Make sure there is room in the list
161 if (num_messagescxx . . $ num_messages. >= MAX_SCRIPT_MESSAGEScxx . . $ `scripts/myPowerHouse.cpp:118:9`!)
162 return false;
163
164 // Allocate memory for this message entry
165 pos = num_messagescxx . . $ num_messages.;
166 message_listcxx . . $ message_list.[pos] = (tScriptMessagecxx . . $ tScriptMessage# *)malloccxx . . $ malloc(9f008b2a9698428b).(sizeof(tScriptMessagecxx . . $ tScriptMessage#));
167 if (message_listcxx . . $ message_list.[pos] == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
168 return false;
169
170 // Allocate memory for the message name
171 message_listcxx . . $ message_list.[pos]->namecxx . . $ tScriptMessage#name. = (char *)malloccxx . . $ malloc(9f008b2a9698428b).(strlen(name) + 1);
172 if (message_listcxx . . $ message_list.[pos]->namecxx . . $ tScriptMessage#name. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
173 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[pos]);
174 return false;
175 }
176 strcpy(message_listcxx . . $ message_list.[pos]->namecxx . . $ tScriptMessage#name., name);
177
178 // Allocate memory for the message name
179 message_listcxx . . $ message_list.[pos]->messagecxx . . $ tScriptMessage#message. = (char *)malloccxx . . $ malloc(9f008b2a9698428b).(strlen(msg) + 1);
180 if (message_listcxx . . $ message_list.[pos]->messagecxx . . $ tScriptMessage#message. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
181 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[pos]->namecxx . . $ tScriptMessage#name.);
182 freecxx . . $ free(bd21765a0afc8e3c).(message_listcxx . . $ message_list.[pos]);
183 return false;
184 }
185 strcpy(message_listcxx . . $ message_list.[pos]->messagecxx . . $ tScriptMessage#message., msg);
186 num_messagescxx . . $ num_messages.++;
187
188 return true;
189 }
190
191 // Removes any whitespace padding from the end of a string
192 void RemoveTrailingWhitespacecxx . . $ RemoveTrailingWhitespace(fda57c8427c60377).(char *s) {
193 int last_char_pos;
194
195 last_char_pos = strlen(s) - 1;
196 while (last_char_pos >= 0 && isspace(s[last_char_pos])) {
197 s[last_char_pos] = '\0';
198 last_char_pos--;
199 }
200 }
201
202 // Returns a pointer to the first non-whitespace char in given string
203 char *SkipInitialWhitespacecxx . . $ SkipInitialWhitespace(7a9722d75b371431).(char *s) {
204 while ((*s) != '\0' && isspace(*s))
205 s++;
206
207 return (s);
208 }
209
210 // Read in the Messages
211 int ReadMessageFilecxx . . $ ReadMessageFile(5c4306d8553b3696).(const char *filename) {
212 void *infile;
213 char filebuffer[MAX_MSG_FILEBUF_LENcxx . . $ `scripts/myPowerHouse.cpp:119:9`! + 1];
214 char *line, *msg_start;
215 int line_num;
216 bool next_msgid_found;
217
218 // Try to open the file for loading
219 infile = File_Opencxx . . $ File_Open.(filename, "rt");
220 if (!infile)
221 return false;
222
223 line_num = 0;
224 next_msgid_found = true;
225
226 // Clear the message list
227 ClearMessageListcxx . . $ ClearMessageList(49f6e7a06ebc5aa8).();
228
229 // Read in and parse each line of the file
230 while (!File_eofcxx . . $ File_eof.(infile)) {
231
232 // Clear the buffer
233 strcpy(filebuffer, "");
234
235 // Read in a line from the file
236 File_ReadStringcxx . . $ File_ReadString.(filebuffer, MAX_MSG_FILEBUF_LENcxx . . $ `scripts/myPowerHouse.cpp:119:9`!, infile);
237 line_num++;
238
239 // Remove whitespace padding at start and end of line
240 RemoveTrailingWhitespacecxx . . $ RemoveTrailingWhitespace(fda57c8427c60377).(filebuffer);
241 line = SkipInitialWhitespacecxx . . $ SkipInitialWhitespace(7a9722d75b371431).(filebuffer);
242
243 // If line is a comment, or empty, discard it
244 if (strlen(line) == 0 || strncmp(line, "//", 2) == 0)
245 continue;
246
247 if (!next_msgid_found) { // Parse out the last message ID number
248
249 // Grab the first keyword, make sure it's valid
250 line = strtok(line, WHITESPACE_CHARScxx . . $ `scripts/myPowerHouse.cpp:122:9`!);
251 if (line == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
252 continue;
253
254 // Grab the second keyword, and assign it as the next message ID
255 line = strtok(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, WHITESPACE_CHARScxx . . $ `scripts/myPowerHouse.cpp:122:9`!);
256 if (line == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
257 continue;
258
259 next_msgid_found = true;
260 } else { // Parse line as a message line
261
262 // Find the start of message, and mark it
263 msg_start = strchr(line, '=');
264 if (msg_start == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
265 continue;
266 msg_start[0] = '\0';
267 msg_start++;
268
269 // Add the message to the list
270 AddMessageToListcxx . . $ AddMessageToList(e99f026884c896d5).(line, msg_start);
271 }
272 }
273 File_Closecxx . . $ File_Close.(infile);
274
275 return true;
276 }
277
278 // Find a message
279 const char *GetMessagecxx . . $ GetMessage(fb58d2e09a2a1ce6).(const char *name) {
280 // Make sure given name is valid
281 if (name == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
282 return INV_MSGNAME_STRINGcxx . . $ `scripts/myPowerHouse.cpp:121:9`!;
283
284 // Search message list for name
285 for (int j = 0; j < num_messagescxx . . $ num_messages.; j++)
286 if (strcmp(message_listcxx . . $ message_list.[j]->namecxx . . $ tScriptMessage#name., name) == 0)
287 return (message_listcxx . . $ message_list.[j]->messagecxx . . $ tScriptMessage#message.);
288
289 // Couldn't find it
290 return NO_MESSAGE_STRINGcxx . . $ `scripts/myPowerHouse.cpp:120:9`!;
291 }
292
293 //======================
294 // Name List Arrays
295 //======================
296
297 #define NUM_DOOR_NAMEScxx . . $ `scripts/myPowerHouse.cpp:297:9`! 0
298 const char **Door_namescxx . . $ Door_names. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
299 int *Door_handlescxx . . $ Door_handles. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
300
301 #define NUM_OBJECT_NAMEScxx . . $ `scripts/myPowerHouse.cpp:301:9`! 1
302 const char *Object_namescxx . . $ Object_names.[NUM_OBJECT_NAMEScxx . . $ `scripts/myPowerHouse.cpp:301:9`!] = {"Finish Level"};
303 int Object_handlescxx . . $ Object_handles.[NUM_OBJECT_NAMEScxx . . $ `scripts/myPowerHouse.cpp:301:9`!];
304
305 #define NUM_ROOM_NAMEScxx . . $ `scripts/myPowerHouse.cpp:305:9`! 0
306 const char **Room_namescxx . . $ Room_names. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
307 int *Room_indexescxx . . $ Room_indexes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
308
309 #define NUM_TRIGGER_NAMEScxx . . $ `scripts/myPowerHouse.cpp:309:9`! 0
310 const char **Trigger_namescxx . . $ Trigger_names. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
311 int *Trigger_indexescxx . . $ Trigger_indexes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
312 int *Trigger_facescxx . . $ Trigger_faces. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
313 int *Trigger_roomscxx . . $ Trigger_rooms. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
314
315 #define NUM_SOUND_NAMEScxx . . $ `scripts/myPowerHouse.cpp:315:9`! 0
316 const char **Sound_namescxx . . $ Sound_names. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
317 int *Sound_indexescxx . . $ Sound_indexes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
318
319 #define NUM_TEXTURE_NAMEScxx . . $ `scripts/myPowerHouse.cpp:319:9`! 0
320 const char **Texture_namescxx . . $ Texture_names. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
321 int *Texture_indexescxx . . $ Texture_indexes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
322
323 #define NUM_PATH_NAMEScxx . . $ `scripts/myPowerHouse.cpp:323:9`! 0
324 const char **Path_namescxx . . $ Path_names. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
325 int *Path_indexescxx . . $ Path_indexes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
326
327 #define NUM_MATCEN_NAMEScxx . . $ `scripts/myPowerHouse.cpp:327:9`! 0
328 const char **Matcen_namescxx . . $ Matcen_names. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
329 int *Matcen_indexescxx . . $ Matcen_indexes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
330
331 #define NUM_GOAL_NAMEScxx . . $ `scripts/myPowerHouse.cpp:331:9`! 0
332 const char **Goal_namescxx . . $ Goal_names. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
333 int *Goal_indexescxx . . $ Goal_indexes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
334
335 #define NUM_MESSAGE_NAMEScxx . . $ `scripts/myPowerHouse.cpp:335:9`! 0
336 const char **Message_namescxx . . $ Message_names. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
337 const char **Message_stringscxx . . $ Message_strings. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
338
339 // ===============
340 // InitializeDLL()
341 // ===============
342 char STDCALLcxx . . $ `lib/module.h:88:11`! InitializeDLLcxx . . $ InitializeDLL(f9aae224659b2173).(tOSIRISModuleInitcxx . . $ tOSIRISModuleInit# *func_list) {
343 osicommon_Initializecxx . . $ osicommon_Initialize(5a9437a4d944b175).((tOSIRISModuleInitcxx . . $ tOSIRISModuleInit# *)func_list);
344 if (func_list->game_checksumcxx . . $ tOSIRISModuleInit#game_checksum. != CHECKSUMcxx . . $ `<built-in>:476:9`!) {
345 mprintfcxx . . $ mprintf.(0, "Game-Checksum FAIL!!! (%ul!=%ul)\n", func_list->game_checksumcxx . . $ tOSIRISModuleInit#game_checksum., CHECKSUMcxx . . $ `<built-in>:476:9`!);
346 mprintfcxx . . $ mprintf.(0, "RECOMPILE YOUR SCRIPTS!!!\n");
347 return 0;
348 }
349
350 ClearGlobalActionCtrscxx . . $ ClearGlobalActionCtrs(49f6e7a06ebc5aa8).();
351 dfInitcxx . . $ dfInit(49f6e7a06ebc5aa8).();
352 InitMessageListcxx . . $ InitMessageList(49f6e7a06ebc5aa8).();
353
354 // Build the filename of the message file
355 char filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`! + 32];
356 int lang_type;
357 if (func_list->script_identifiercxx . . $ tOSIRISModuleInit#script_identifier. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
358 _splitpathcxx . . $ _splitpath(f70bbbea1d7ce513).(func_list->script_identifiercxx . . $ tOSIRISModuleInit#script_identifier., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, filename, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
359 lang_type = Game_GetLanguagecxx . . $ Game_GetLanguage.();
360 if (lang_type == LANGUAGE_FRENCHcxx . . $ `scripts/osiris_common.h:416:9`!)
361 strcat(filename, "_FRN");
362 else if (lang_type == LANGUAGE_GERMANcxx . . $ `scripts/osiris_common.h:413:9`!)
363 strcat(filename, "_GER");
364 else if (lang_type == LANGUAGE_ITALIANcxx . . $ `scripts/osiris_common.h:415:9`!)
365 strcat(filename, "_ITN");
366 else if (lang_type == LANGUAGE_SPANISHcxx . . $ `scripts/osiris_common.h:414:9`!)
367 strcat(filename, "_SPN");
368 strcat(filename, ".msg");
369 } else {
370 strcpy(filename, "myPowerHouse.msg");
371 lang_type = LANGUAGE_ENGLISHcxx . . $ `scripts/osiris_common.h:412:9`!;
372 }
373 if (!ReadMessageFilecxx . . $ ReadMessageFile(5c4306d8553b3696).(filename)) {
374 mprintfcxx . . $ mprintf.(0, "ERROR: Could not load message file - %s\n", filename);
375 }
376
377 int j;
378
379 // Do Door Index lookups
380 for (j = 0; j < NUM_DOOR_NAMEScxx . . $ `scripts/myPowerHouse.cpp:297:9`!; j++)
381 Door_handlescxx . . $ Door_handles.[j] = Scrpt_FindDoorNamecxx . . $ Scrpt_FindDoorName.(Door_namescxx . . $ Door_names.[j]);
382
383 // Do Object Index lookups
384 for (j = 0; j < NUM_OBJECT_NAMEScxx . . $ `scripts/myPowerHouse.cpp:301:9`!; j++)
385 Object_handlescxx . . $ Object_handles.[j] = Scrpt_FindObjectNamecxx . . $ Scrpt_FindObjectName.(Object_namescxx . . $ Object_names.[j]);
386
387 // Do Room Index lookups
388 for (j = 0; j < NUM_ROOM_NAMEScxx . . $ `scripts/myPowerHouse.cpp:305:9`!; j++)
389 Room_indexescxx . . $ Room_indexes.[j] = Scrpt_FindRoomNamecxx . . $ Scrpt_FindRoomName.(Room_namescxx . . $ Room_names.[j]);
390
391 // Do Trigger Index lookups
392 for (j = 0; j < NUM_TRIGGER_NAMEScxx . . $ `scripts/myPowerHouse.cpp:309:9`!; j++) {
393 Trigger_indexescxx . . $ Trigger_indexes.[j] = Scrpt_FindTriggerNamecxx . . $ Scrpt_FindTriggerName.(Trigger_namescxx . . $ Trigger_names.[j]);
394 Trigger_facescxx . . $ Trigger_faces.[j] = Scrpt_GetTriggerFacecxx . . $ Scrpt_GetTriggerFace.(Trigger_indexescxx . . $ Trigger_indexes.[j]);
395 Trigger_roomscxx . . $ Trigger_rooms.[j] = Scrpt_GetTriggerRoomcxx . . $ Scrpt_GetTriggerRoom.(Trigger_indexescxx . . $ Trigger_indexes.[j]);
396 }
397
398 // Do Sound Index lookups
399 for (j = 0; j < NUM_SOUND_NAMEScxx . . $ `scripts/myPowerHouse.cpp:315:9`!; j++)
400 Sound_indexescxx . . $ Sound_indexes.[j] = Scrpt_FindSoundNamecxx . . $ Scrpt_FindSoundName.(Sound_namescxx . . $ Sound_names.[j]);
401
402 // Do Texture Index lookups
403 for (j = 0; j < NUM_TEXTURE_NAMEScxx . . $ `scripts/myPowerHouse.cpp:319:9`!; j++)
404 Texture_indexescxx . . $ Texture_indexes.[j] = Scrpt_FindTextureNamecxx . . $ Scrpt_FindTextureName.(Texture_namescxx . . $ Texture_names.[j]);
405
406 // Do Path Index lookups
407 for (j = 0; j < NUM_PATH_NAMEScxx . . $ `scripts/myPowerHouse.cpp:323:9`!; j++)
408 Path_indexescxx . . $ Path_indexes.[j] = Scrpt_FindPathNamecxx . . $ Scrpt_FindPathName.(Path_namescxx . . $ Path_names.[j]);
409
410 // Do Matcen Index lookups
411 for (j = 0; j < NUM_MATCEN_NAMEScxx . . $ `scripts/myPowerHouse.cpp:327:9`!; j++)
412 Matcen_indexescxx . . $ Matcen_indexes.[j] = Scrpt_FindMatcenNamecxx . . $ Scrpt_FindMatcenName.(Matcen_namescxx . . $ Matcen_names.[j]);
413
414 // Do Goal Index lookups
415 for (j = 0; j < NUM_GOAL_NAMEScxx . . $ `scripts/myPowerHouse.cpp:331:9`!; j++)
416 Goal_indexescxx . . $ Goal_indexes.[j] = Scrpt_FindLevelGoalNamecxx . . $ Scrpt_FindLevelGoalName.(Goal_namescxx . . $ Goal_names.[j]);
417
418 // Do Message Name lookups
419 for (j = 0; j < NUM_MESSAGE_NAMEScxx . . $ `scripts/myPowerHouse.cpp:335:9`!; j++)
420 Message_stringscxx . . $ Message_strings.[j] = GetMessagecxx . . $ GetMessage(fb58d2e09a2a1ce6).(Message_namescxx . . $ Message_names.[j]);
421
422 return 1;
423 }
424
425 // =============
426 // ShutdownDLL()
427 // =============
428 void STDCALLcxx . . $ `lib/module.h:88:11`! ShutdownDLLcxx . . $ ShutdownDLL(49f6e7a06ebc5aa8).(void) { ClearMessageListcxx . . $ ClearMessageList(49f6e7a06ebc5aa8).(); }
429
430 // ===============
431 // GetGOScriptID()
432 // ===============
433 int STDCALLcxx . . $ `lib/module.h:88:11`! GetGOScriptIDcxx . . $ GetGOScriptID(a2648ab7e2ef960e).(const char *name, uint8_tcxx . . $ uint8_t# isdoor) { return -1; }
434
435 // ================
436 // CreateInstance()
437 // ================
438 void STDCALLPTRcxx . . $ `lib/module.h:90:10`! CreateInstancecxx . . $ CreateInstance(d1680a912d714170).(int id) {
439 switch (id) {
440 case ID_LEVEL_0000cxx . . $ `scripts/myPowerHouse.cpp:54:9`!:
441 return new LevelScript_0000cxx . . $ LevelScript_0000#;
442 break;
443 case ID_CUSTOM_OBJECT_0827cxx . . $ `scripts/myPowerHouse.cpp:56:9`!:
444 return new CustomObjectScript_0827cxx . . $ CustomObjectScript_0827#;
445 break;
446 default:
447 mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id);
448 break;
449 }
450 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
451 }
452
453 // =================
454 // DestroyInstance()
455 // =================
456 void STDCALLcxx . . $ `lib/module.h:88:11`! DestroyInstancecxx . . $ DestroyInstance(6ca3d68f5c5f0975).(int id, void *ptr) {
457 switch (id) {
458 case ID_LEVEL_0000cxx . . $ `scripts/myPowerHouse.cpp:54:9`!:
459 delete ((LevelScript_0000cxx . . $ LevelScript_0000# *)ptr);
460 break;
461 case ID_CUSTOM_OBJECT_0827cxx . . $ `scripts/myPowerHouse.cpp:56:9`!:
462 delete ((CustomObjectScript_0827cxx . . $ CustomObjectScript_0827# *)ptr);
463 break;
464 default:
465 mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id);
466 break;
467 }
468 }
469
470 // ===================
471 // CallInstanceEvent()
472 // ===================
473 int16_t STDCALLcxx . . $ `lib/module.h:88:11`! CallInstanceEventcxx . . $ CallInstanceEvent(79be2a5a01598f29).(int id, void *ptr, int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
474 switch (id) {
475 case ID_LEVEL_0000cxx . . $ `scripts/myPowerHouse.cpp:54:9`!:
476 case ID_CUSTOM_OBJECT_0827cxx . . $ `scripts/myPowerHouse.cpp:56:9`!:
477 return ((BaseScriptcxx . . $ BaseScript# *)ptr)->CallEventcxx . . $ BaseScript#CallEvent(585a6502c7945bab).(event, data);
478 break;
479 default:
480 mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id);
481 break;
482 }
483 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
484 }
485
486 // ==================
487 // SaveRestoreState()
488 // ==================
489 int STDCALLcxx . . $ `lib/module.h:88:11`! SaveRestoreStatecxx . . $ SaveRestoreState(5276b51c10b71c09).(void *file_ptr, uint8_tcxx . . $ uint8_t# saving_state) { return 0; }
490
491 // ====================
492 // GetTriggerScriptID()
493 // ====================
494 int STDCALLcxx . . $ `lib/module.h:88:11`! GetTriggerScriptIDcxx . . $ GetTriggerScriptID(9b79fb6aee4c0440).(int trigger_room, int trigger_face) { return -1; }
495
496 // =================
497 // GetCOScriptList()
498 // =================
499 int STDCALLcxx . . $ `lib/module.h:88:11`! GetCOScriptListcxx . . $ GetCOScriptList(4454eefbcea844d6).(int **list, int **id_list) {
500 static int cust_handle_list[1];
501 static int cust_id_list[1] = {ID_CUSTOM_OBJECT_0827cxx . . $ `scripts/myPowerHouse.cpp:56:9`!};
502
503 // Fill in the custom handle list
504 cust_handle_list[0] = Object_handlescxx . . $ Object_handles.[0];
505
506 *list = cust_handle_list;
507 *id_list = cust_id_list;
508
509 return 1;
510 }
511
512 //=======================
513 // Script Implementation
514 //=======================
515
516 BaseScriptcxx . . $ BaseScript#::BaseScriptcxx . . $ BaseScript#BaseScript(49f6e7a06ebc5aa8).() {}
517
518 BaseScriptcxx . . $ BaseScript#::~cxx . . $ BaseScript#`~BaseScript`(ced63f7c635d850d).BaseScriptcxx . . $ BaseScript#() {}
519
520 int16_t BaseScriptcxx . . $ BaseScript#::CallEventcxx . . $ BaseScript#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
521 mprintfcxx . . $ mprintf.(0, "BaseScript::CallEvent()\n");
522 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
523 }
524
525 int16_t LevelScript_0000cxx . . $ LevelScript_0000#::CallEventcxx . . $ LevelScript_0000#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
526 switch (event) {
527 case EVT_SAVESTATEcxx . . $ `scripts/osiris_common.h:376:9`!: {
528 tOSIRISEVTSAVESTATEcxx . . $ tOSIRISEVTSAVESTATE# *event_data = &data->evt_savestatecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_savestate.;
529
530 SaveGlobalActionCtrscxx . . $ SaveGlobalActionCtrs(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTSAVESTATE#fileptr.);
531 dfSavecxx . . $ dfSave(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTSAVESTATE#fileptr.);
532 } break;
533 case EVT_RESTORESTATEcxx . . $ `scripts/osiris_common.h:377:9`!: {
534 tOSIRISEVTRESTORESTATEcxx . . $ tOSIRISEVTRESTORESTATE# *event_data = &data->evt_restorestatecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_restorestate.;
535
536 RestoreGlobalActionCtrscxx . . $ RestoreGlobalActionCtrs(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTRESTORESTATE#fileptr.);
537 dfRestorecxx . . $ dfRestore(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTRESTORESTATE#fileptr.);
538 } break;
539 case EVT_LEVELSTARTcxx . . $ `scripts/osiris_common.h:373:9`!: {
540 tOSIRISEVTLEVELSTARTcxx . . $ tOSIRISEVTLEVELSTART# *event_data = &data->evt_levelstartcxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_levelstart.;
541
542 ClearGlobalActionCtrscxx . . $ ClearGlobalActionCtrs(49f6e7a06ebc5aa8).();
543 dfInitcxx . . $ dfInit(49f6e7a06ebc5aa8).();
544 } break;
545 }
546 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
547 }
548
549 int16_t CustomObjectScript_0827cxx . . $ CustomObjectScript_0827#::CallEventcxx . . $ CustomObjectScript_0827#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
550 switch (event) {
551 case EVT_COLLIDEcxx . . $ `scripts/osiris_common.h:366:9`!: {
552 tOSIRISEVTCOLLIDEcxx . . $ tOSIRISEVTCOLLIDE# *event_data = &data->evt_collidecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_collide.;
553
554 // Script 000: Script Description Goes Here
555 if (qObjIsPlayercxx . . $ qObjIsPlayer(83c267b20bac841a).(event_data->it_handlecxx . . $ tOSIRISEVTCOLLIDE#it_handle.) == 1) {
556 aEndLevelcxx . . $ aEndLevel(49f6e7a06ebc5aa8).();
557
558 // Increment the script action counter
559 if (ScriptActionCtr_000cxx . . $ ScriptActionCtr_000. < MAX_ACTION_CTR_VALUEcxx . . $ `scripts/myPowerHouse.cpp:83:9`!)
560 ScriptActionCtr_000cxx . . $ ScriptActionCtr_000.++;
561 }
562 } break;
563 }
564 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
565 }
566
567 /*********************************************************
568 Script Save Block: DO NOT TOUCH ANYTHING IN THIS BLOCK!!!
569 **********************************************************
570 $$SCRIPT_BLOCK_START
571
572 VERSION 3
573 NEXT_ID 1
574
575 // UserType value blocks
576 $$UTYPE_VALS_START UserVar
577 $$UTYPE_VALS_END
578
579 $$UTYPE_VALS_START UserFlag
580 $$UTYPE_VALS_END
581
582 $$UTYPE_VALS_START SpewHandle
583 $$UTYPE_VALS_END
584
585 $$UTYPE_VALS_START TimerID
586 $$UTYPE_VALS_END
587
588 $$UTYPE_VALS_START SavedObjectSlot
589 $$UTYPE_VALS_END
590
591 $$UTYPE_VALS_START GoalID
592 $$UTYPE_VALS_END
593
594
595 // Name Lists
596 $$DOOR_LIST_START
597 $$DOOR_LIST_END
598
599 $$OBJECT_LIST_START
600 Finish Level
601 $$OBJECT_LIST_END
602
603 $$ROOM_LIST_START
604 $$ROOM_LIST_END
605
606 $$TRIGGER_LIST_START
607 $$TRIGGER_LIST_END
608
609 $$SOUND_LIST_START
610 $$SOUND_LIST_END
611
612 $$TEXTURE_LIST_START
613 $$TEXTURE_LIST_END
614
615 $$SPECNAME_LIST_START
616 $$SPECNAME_LIST_END
617
618 $$PATH_LIST_START
619 $$PATH_LIST_END
620
621 $$MATCEN_LIST_START
622 $$MATCEN_LIST_END
623
624 $$GOAL_LIST_START
625 $$GOAL_LIST_END
626
627 $$STRM_AUDIO_LIST_START
628 $$STRM_AUDIO_LIST_END
629
630
631 // Script Tree Dump
632 00:0:Script Description Goes Here
633 $$CHILD_BLOCK_START
634 01:1:0
635 02:0
636 03:0
637 $$CHILD_BLOCK_START
638 05:2
639 $$CHILD_BLOCK_START
640 06:qObjIsPlayer:Bool
641 $$CHILD_BLOCK_START
642 10:1:1:-1:Object
643 $$CHILD_BLOCK_END
644 07:1:0
645 10:5:1:Bool
646 $$CHILD_BLOCK_END
647 $$CHILD_BLOCK_END
648 04:0:0:0
649 $$CHILD_BLOCK_START
650 08:aEndLevel
651 $$CHILD_BLOCK_END
652 $$CHILD_BLOCK_END
653
654 $$SCRIPT_BLOCK_END
655 *********************************************************/