| 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: BossCamera.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/BossCamera.cpp:54:9`! 0x000 |
| 55 | |
| 56 | #define ID_TRIGGER_0000cxx . . $ `scripts/BossCamera.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 TriggerScript_0000cxx . . $ TriggerScript_0000# : public BaseScriptcxx . . $ BaseScript# { |
| 75 | public: |
| 76 | int16_t CallEventcxx . . $ TriggerScript_0000#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data); |
| 77 | }; |
| 78 | |
| 79 | // ====================== |
| 80 | // Global Action Counters |
| 81 | // ====================== |
| 82 | |
| 83 | #define MAX_ACTION_CTR_VALUEcxx . . $ `scripts/BossCamera.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/BossCamera.cpp:118:9`! 256 |
| 119 | #define MAX_MSG_FILEBUF_LENcxx . . $ `scripts/BossCamera.cpp:119:9`! 1024 |
| 120 | #define NO_MESSAGE_STRINGcxx . . $ `scripts/BossCamera.cpp:120:9`! "*Message Not Found*" |
| 121 | #define INV_MSGNAME_STRINGcxx . . $ `scripts/BossCamera.cpp:121:9`! "*Message Name Invalid*" |
| 122 | #define WHITESPACE_CHARScxx . . $ `scripts/BossCamera.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/BossCamera.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/BossCamera.cpp:118:9`!; j++) |
| 141 | message_listcxx . . $ message_list.[j] = NULLcxx . . $ `<external>/15298297234472979974/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 . . $ `<external>/15298297234472979974/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/BossCamera.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 . . $ `<external>/15298297234472979974/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 . . $ `<external>/15298297234472979974/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 . . $ `<external>/15298297234472979974/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/BossCamera.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/BossCamera.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/BossCamera.cpp:122:9`!); |
| 251 | if (line == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 252 | continue; |
| 253 | |
| 254 | // Grab the second keyword, and assign it as the next message ID |
| 255 | line = strtok(NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, WHITESPACE_CHARScxx . . $ `scripts/BossCamera.cpp:122:9`!); |
| 256 | if (line == NULLcxx . . $ `<external>/15298297234472979974/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 . . $ `<external>/15298297234472979974/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 . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 282 | return INV_MSGNAME_STRINGcxx . . $ `scripts/BossCamera.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/BossCamera.cpp:120:9`!; |
| 291 | } |
| 292 | |
| 293 | //====================== |
| 294 | // Name List Arrays |
| 295 | //====================== |
| 296 | |
| 297 | #define NUM_DOOR_NAMEScxx . . $ `scripts/BossCamera.cpp:297:9`! 0 |
| 298 | const char **Door_namescxx . . $ Door_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 299 | int *Door_handlescxx . . $ Door_handles. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 300 | |
| 301 | #define NUM_OBJECT_NAMEScxx . . $ `scripts/BossCamera.cpp:301:9`! 1 |
| 302 | const char *Object_namescxx . . $ Object_names.[NUM_OBJECT_NAMEScxx . . $ `scripts/BossCamera.cpp:301:9`!] = {"Boss"}; |
| 303 | int Object_handlescxx . . $ Object_handles.[NUM_OBJECT_NAMEScxx . . $ `scripts/BossCamera.cpp:301:9`!]; |
| 304 | |
| 305 | #define NUM_ROOM_NAMEScxx . . $ `scripts/BossCamera.cpp:305:9`! 0 |
| 306 | const char **Room_namescxx . . $ Room_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 307 | int *Room_indexescxx . . $ Room_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 308 | |
| 309 | #define NUM_TRIGGER_NAMEScxx . . $ `scripts/BossCamera.cpp:309:9`! 1 |
| 310 | const char *Trigger_namescxx . . $ Trigger_names.[NUM_TRIGGER_NAMEScxx . . $ `scripts/BossCamera.cpp:309:9`!] = {"EnterBigRoom"}; |
| 311 | int Trigger_indexescxx . . $ Trigger_indexes.[NUM_TRIGGER_NAMEScxx . . $ `scripts/BossCamera.cpp:309:9`!]; |
| 312 | int Trigger_facescxx . . $ Trigger_faces.[NUM_TRIGGER_NAMEScxx . . $ `scripts/BossCamera.cpp:309:9`!]; |
| 313 | int Trigger_roomscxx . . $ Trigger_rooms.[NUM_TRIGGER_NAMEScxx . . $ `scripts/BossCamera.cpp:309:9`!]; |
| 314 | |
| 315 | #define NUM_SOUND_NAMEScxx . . $ `scripts/BossCamera.cpp:315:9`! 0 |
| 316 | const char **Sound_namescxx . . $ Sound_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 317 | int *Sound_indexescxx . . $ Sound_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 318 | |
| 319 | #define NUM_TEXTURE_NAMEScxx . . $ `scripts/BossCamera.cpp:319:9`! 0 |
| 320 | const char **Texture_namescxx . . $ Texture_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 321 | int *Texture_indexescxx . . $ Texture_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 322 | |
| 323 | #define NUM_PATH_NAMEScxx . . $ `scripts/BossCamera.cpp:323:9`! 1 |
| 324 | const char *Path_namescxx . . $ Path_names.[NUM_PATH_NAMEScxx . . $ `scripts/BossCamera.cpp:323:9`!] = {"BossPath"}; |
| 325 | int Path_indexescxx . . $ Path_indexes.[NUM_PATH_NAMEScxx . . $ `scripts/BossCamera.cpp:323:9`!]; |
| 326 | |
| 327 | #define NUM_MATCEN_NAMEScxx . . $ `scripts/BossCamera.cpp:327:9`! 0 |
| 328 | const char **Matcen_namescxx . . $ Matcen_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 329 | int *Matcen_indexescxx . . $ Matcen_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 330 | |
| 331 | #define NUM_GOAL_NAMEScxx . . $ `scripts/BossCamera.cpp:331:9`! 0 |
| 332 | const char **Goal_namescxx . . $ Goal_names. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 333 | int *Goal_indexescxx . . $ Goal_indexes. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 334 | |
| 335 | #define NUM_MESSAGE_NAMEScxx . . $ `scripts/BossCamera.cpp:335:9`! 1 |
| 336 | const char *Message_namescxx . . $ Message_names.[NUM_MESSAGE_NAMEScxx . . $ `scripts/BossCamera.cpp:335:9`!] = {"Message2"}; |
| 337 | const char *Message_stringscxx . . $ Message_strings.[NUM_MESSAGE_NAMEScxx . . $ `scripts/BossCamera.cpp:335: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>:477:9`!) { |
| 345 | mprintfcxx . . $ mprintf.(0, "Game-Checksum FAIL!!! (%ul!=%ul)\n", func_list->game_checksumcxx . . $ tOSIRISModuleInit#game_checksum., CHECKSUMcxx . . $ `<built-in>:477: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 . . $ `<external>/15298297234472979974/stddef.h:416:9`!) { |
| 358 | _splitpathcxx . . $ _splitpath(f70bbbea1d7ce513).(func_list->script_identifiercxx . . $ tOSIRISModuleInit#script_identifier., NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, filename, NULLcxx . . $ `<external>/15298297234472979974/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, "BossCamera.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/BossCamera.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/BossCamera.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/BossCamera.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/BossCamera.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/BossCamera.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/BossCamera.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/BossCamera.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/BossCamera.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/BossCamera.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/BossCamera.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/BossCamera.cpp:54:9`!: |
| 441 | return new LevelScript_0000cxx . . $ LevelScript_0000#; |
| 442 | break; |
| 443 | case ID_TRIGGER_0000cxx . . $ `scripts/BossCamera.cpp:56:9`!: |
| 444 | return new TriggerScript_0000cxx . . $ TriggerScript_0000#; |
| 445 | break; |
| 446 | default: |
| 447 | mprintfcxx . . $ mprintf.(0, "SCRIPT: Illegal ID (%d)\n", id); |
| 448 | break; |
| 449 | } |
| 450 | return NULLcxx . . $ `<external>/15298297234472979974/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/BossCamera.cpp:54:9`!: |
| 459 | delete ((LevelScript_0000cxx . . $ LevelScript_0000# *)ptr); |
| 460 | break; |
| 461 | case ID_TRIGGER_0000cxx . . $ `scripts/BossCamera.cpp:56:9`!: |
| 462 | delete ((TriggerScript_0000cxx . . $ TriggerScript_0000# *)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/BossCamera.cpp:54:9`!: |
| 476 | case ID_TRIGGER_0000cxx . . $ `scripts/BossCamera.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) { |
| 495 | if (trigger_room == Trigger_roomscxx . . $ Trigger_rooms.[0] && trigger_face == Trigger_facescxx . . $ Trigger_faces.[0]) |
| 496 | return ID_TRIGGER_0000cxx . . $ `scripts/BossCamera.cpp:56:9`!; |
| 497 | |
| 498 | return -1; |
| 499 | } |
| 500 | |
| 501 | // ================= |
| 502 | // GetCOScriptList() |
| 503 | // ================= |
| 504 | int STDCALLcxx . . $ `lib/module.h:88:11`! GetCOScriptListcxx . . $ GetCOScriptList(4454eefbcea844d6).(int **list, int **id_list) { |
| 505 | static int *cust_handle_list = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 506 | static int *cust_id_list = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 507 | |
| 508 | *list = cust_handle_list; |
| 509 | *id_list = cust_id_list; |
| 510 | |
| 511 | return 0; |
| 512 | } |
| 513 | |
| 514 | //======================= |
| 515 | // Script Implementation |
| 516 | //======================= |
| 517 | |
| 518 | BaseScriptcxx . . $ BaseScript#::BaseScriptcxx . . $ BaseScript#BaseScript(49f6e7a06ebc5aa8).() {} |
| 519 | |
| 520 | BaseScriptcxx . . $ BaseScript#::~cxx . . $ BaseScript#`~BaseScript`(ced63f7c635d850d).BaseScriptcxx . . $ BaseScript#() {} |
| 521 | |
| 522 | int16_t BaseScriptcxx . . $ BaseScript#::CallEventcxx . . $ BaseScript#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) { |
| 523 | mprintfcxx . . $ mprintf.(0, "BaseScript::CallEvent()\n"); |
| 524 | return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!; |
| 525 | } |
| 526 | |
| 527 | int16_t LevelScript_0000cxx . . $ LevelScript_0000#::CallEventcxx . . $ LevelScript_0000#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) { |
| 528 | switch (event) { |
| 529 | case EVT_SAVESTATEcxx . . $ `scripts/osiris_common.h:376:9`!: { |
| 530 | tOSIRISEVTSAVESTATEcxx . . $ tOSIRISEVTSAVESTATE# *event_data = &data->evt_savestatecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_savestate.; |
| 531 | |
| 532 | SaveGlobalActionCtrscxx . . $ SaveGlobalActionCtrs(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTSAVESTATE#fileptr.); |
| 533 | dfSavecxx . . $ dfSave(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTSAVESTATE#fileptr.); |
| 534 | } break; |
| 535 | case EVT_RESTORESTATEcxx . . $ `scripts/osiris_common.h:377:9`!: { |
| 536 | tOSIRISEVTRESTORESTATEcxx . . $ tOSIRISEVTRESTORESTATE# *event_data = &data->evt_restorestatecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_restorestate.; |
| 537 | |
| 538 | RestoreGlobalActionCtrscxx . . $ RestoreGlobalActionCtrs(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTRESTORESTATE#fileptr.); |
| 539 | dfRestorecxx . . $ dfRestore(5d22bdacc48458e8).(event_data->fileptrcxx . . $ tOSIRISEVTRESTORESTATE#fileptr.); |
| 540 | } break; |
| 541 | case EVT_LEVELSTARTcxx . . $ `scripts/osiris_common.h:373:9`!: { |
| 542 | tOSIRISEVTLEVELSTARTcxx . . $ tOSIRISEVTLEVELSTART# *event_data = &data->evt_levelstartcxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_levelstart.; |
| 543 | |
| 544 | ClearGlobalActionCtrscxx . . $ ClearGlobalActionCtrs(49f6e7a06ebc5aa8).(); |
| 545 | dfInitcxx . . $ dfInit(49f6e7a06ebc5aa8).(); |
| 546 | } break; |
| 547 | } |
| 548 | return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!; |
| 549 | } |
| 550 | |
| 551 | int16_t TriggerScript_0000cxx . . $ TriggerScript_0000#::CallEventcxx . . $ TriggerScript_0000#CallEvent(585a6502c7945bab).(int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) { |
| 552 | switch (event) { |
| 553 | case EVT_COLLIDEcxx . . $ `scripts/osiris_common.h:366:9`!: { |
| 554 | tOSIRISEVTCOLLIDEcxx . . $ tOSIRISEVTCOLLIDE# *event_data = &data->evt_collidecxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_collide.; |
| 555 | |
| 556 | // Script 000: Script Description Goes Here |
| 557 | if (qObjIsPlayercxx . . $ qObjIsPlayer(83c267b20bac841a).(event_data->it_handlecxx . . $ tOSIRISEVTCOLLIDE#it_handle.) == true) { |
| 558 | aCinematicSimplecxx . . $ aCinematicSimple(c7ae4e6e8283faf7).(Path_indexescxx . . $ Path_indexes.[0], Message_stringscxx . . $ Message_strings.[0], Object_handlescxx . . $ Object_handles.[0], 10.000000f, 1); |
| 559 | |
| 560 | // Increment the script action counter |
| 561 | if (ScriptActionCtr_000cxx . . $ ScriptActionCtr_000. < MAX_ACTION_CTR_VALUEcxx . . $ `scripts/BossCamera.cpp:83:9`!) |
| 562 | ScriptActionCtr_000cxx . . $ ScriptActionCtr_000.++; |
| 563 | } |
| 564 | } break; |
| 565 | } |
| 566 | return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!; |
| 567 | } |
| 568 | |
| 569 | /********************************************************* |
| 570 | Script Save Block: DO NOT TOUCH ANYTHING IN THIS BLOCK!!! |
| 571 | ********************************************************** |
| 572 | $$SCRIPT_BLOCK_START |
| 573 | |
| 574 | VERSION 3 |
| 575 | NEXT_ID 1 |
| 576 | |
| 577 | // UserType value blocks |
| 578 | $$UTYPE_VALS_START UserVar |
| 579 | $$UTYPE_VALS_END |
| 580 | |
| 581 | $$UTYPE_VALS_START UserFlag |
| 582 | $$UTYPE_VALS_END |
| 583 | |
| 584 | $$UTYPE_VALS_START SpewHandle |
| 585 | $$UTYPE_VALS_END |
| 586 | |
| 587 | $$UTYPE_VALS_START TimerID |
| 588 | $$UTYPE_VALS_END |
| 589 | |
| 590 | $$UTYPE_VALS_START SavedObjectSlot |
| 591 | $$UTYPE_VALS_END |
| 592 | |
| 593 | $$UTYPE_VALS_START GoalID |
| 594 | $$UTYPE_VALS_END |
| 595 | |
| 596 | |
| 597 | // Name Lists |
| 598 | $$DOOR_LIST_START |
| 599 | $$DOOR_LIST_END |
| 600 | |
| 601 | $$OBJECT_LIST_START |
| 602 | Boss |
| 603 | $$OBJECT_LIST_END |
| 604 | |
| 605 | $$ROOM_LIST_START |
| 606 | $$ROOM_LIST_END |
| 607 | |
| 608 | $$TRIGGER_LIST_START |
| 609 | EnterBigRoom |
| 610 | $$TRIGGER_LIST_END |
| 611 | |
| 612 | $$SOUND_LIST_START |
| 613 | $$SOUND_LIST_END |
| 614 | |
| 615 | $$TEXTURE_LIST_START |
| 616 | $$TEXTURE_LIST_END |
| 617 | |
| 618 | $$SPECNAME_LIST_START |
| 619 | $$SPECNAME_LIST_END |
| 620 | |
| 621 | $$PATH_LIST_START |
| 622 | BossPath |
| 623 | $$PATH_LIST_END |
| 624 | |
| 625 | $$MATCEN_LIST_START |
| 626 | $$MATCEN_LIST_END |
| 627 | |
| 628 | $$GOAL_LIST_START |
| 629 | $$GOAL_LIST_END |
| 630 | |
| 631 | $$STRM_AUDIO_LIST_START |
| 632 | $$STRM_AUDIO_LIST_END |
| 633 | |
| 634 | |
| 635 | // Script Tree Dump |
| 636 | 00:0:Script Description Goes Here |
| 637 | $$CHILD_BLOCK_START |
| 638 | 01:0:0 |
| 639 | 02:1 |
| 640 | 03:0 |
| 641 | $$CHILD_BLOCK_START |
| 642 | 05:1 |
| 643 | $$CHILD_BLOCK_START |
| 644 | 06:qObjIsPlayer:Bool |
| 645 | $$CHILD_BLOCK_START |
| 646 | 10:1:1:-1:Object |
| 647 | $$CHILD_BLOCK_END |
| 648 | 07:0:6 |
| 649 | $$CHILD_BLOCK_END |
| 650 | $$CHILD_BLOCK_END |
| 651 | 04:0:0:0 |
| 652 | $$CHILD_BLOCK_START |
| 653 | 08:aCinematicSimple |
| 654 | $$CHILD_BLOCK_START |
| 655 | 10:16:0:CameraPath |
| 656 | 10:8:Message2:Text |
| 657 | 10:1:0:0:Target |
| 658 | 10:6:10.000000:Seconds |
| 659 | 10:5:1:FadeIn |
| 660 | $$CHILD_BLOCK_END |
| 661 | $$CHILD_BLOCK_END |
| 662 | $$CHILD_BLOCK_END |
| 663 | |
| 664 | $$SCRIPT_BLOCK_END |
| 665 | *********************************************************/ |