| 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 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Data/scripts/DallasFuncs.cpp $ |
| 21 | * $Revision: 1.1 $ |
| 22 | * $Date: 2000-04-18 01:45:34 $ |
| 23 | * $Author: icculus $ |
| 24 | * |
| 25 | * Definitions for the D3 actions & queries for Dallas |
| 26 | * |
| 27 | * $Log: not supported by cvs2svn $ |
| 28 | * |
| 29 | * 214 10/27/99 4:19p Josh |
| 30 | * upped timer handle count once again to 50 |
| 31 | * |
| 32 | * 213 10/23/99 2:56p Chris |
| 33 | * Fixed the place object on object goal |
| 34 | * |
| 35 | * 212 10/23/99 2:42a Chris |
| 36 | * Added the PutObjectOnObject AI Goal |
| 37 | * |
| 38 | * 211 10/17/99 9:04p Samir |
| 39 | * added a complex cinematic function for moving camera to position from |
| 40 | * position on the clipboard. |
| 41 | * |
| 42 | * 210 10/16/99 9:56p Jeff |
| 43 | * added a way to strip all players of all weapons and energy |
| 44 | * |
| 45 | * 209 10/16/99 8:44p Jeff |
| 46 | * created an action to remove all powerups from a room. Created an |
| 47 | * action to strip a player of all weapons |
| 48 | * |
| 49 | * 208 10/15/99 6:05p Samir |
| 50 | * added a query for max speed of an object. |
| 51 | * |
| 52 | * 207 10/12/99 12:43p Jeff |
| 53 | * added actions and queries for virus infection and negative light |
| 54 | * |
| 55 | * 206 10/08/99 4:15p Samir |
| 56 | * added frametime query |
| 57 | * |
| 58 | * 205 5/20/99 4:11p Jeff |
| 59 | * null terminate string for message when adding to inventory correctly |
| 60 | * (\0 not 0) |
| 61 | * |
| 62 | * 204 5/20/99 3:12p Chris |
| 63 | * Fixed bug in blockage code |
| 64 | * |
| 65 | * 203 5/19/99 4:57p Matt |
| 66 | * Added an action & a query. |
| 67 | * |
| 68 | * 202 5/19/99 2:55p Chris |
| 69 | * Fixed bug with aAISetTarget |
| 70 | * |
| 71 | * 201 5/19/99 12:25p Chris |
| 72 | * Added new functions |
| 73 | * |
| 74 | * 200 5/19/99 11:25a Matt |
| 75 | * Added multisafe functions & Dallas actions for showing a timer on the |
| 76 | * screen and adding custom HUD messages. |
| 77 | * |
| 78 | * 199 5/11/99 5:17p Jeff |
| 79 | * added query to get difficulty level |
| 80 | * |
| 81 | * 198 5/11/99 11:49a Matt |
| 82 | * Added the ability to specify a name when adding an item to the |
| 83 | * inventory. |
| 84 | * |
| 85 | * 197 5/08/99 10:10p Nate |
| 86 | * Fixed Level Goal Item index problem |
| 87 | * |
| 88 | * 196 5/08/99 2:39p Chris |
| 89 | * Added a new function for dallas |
| 90 | * |
| 91 | * 195 5/07/99 11:56p Matt |
| 92 | * Added an action to give a player an "invisible" key -- one that doesn't |
| 93 | * get added to the inventory or shown on the HUD. |
| 94 | * |
| 95 | * 194 5/07/99 8:22p 3dsmax |
| 96 | * Fixed goal query bugs |
| 97 | * |
| 98 | * 193 5/07/99 7:22p Chris |
| 99 | * Added some level goal querys |
| 100 | * |
| 101 | * 192 5/07/99 2:58p Matt |
| 102 | * Increased the maximum number of timer handles from 20 to 40. |
| 103 | * |
| 104 | * 191 5/06/99 4:11a Jeff |
| 105 | * created multisafe function to destroy robots in the level (helps boss |
| 106 | * fights) |
| 107 | * |
| 108 | * 190 5/04/99 6:52p Jeff |
| 109 | * added new canned cinematic to fade screen to white and endlevel. Fixed |
| 110 | * crash bug with invalid player path for canned cine with player paths |
| 111 | * |
| 112 | * 189 5/04/99 12:13p Matt |
| 113 | * Renamed fire-flare symbol to fire-weapon. |
| 114 | * |
| 115 | * 188 5/04/99 1:05a Matt |
| 116 | * Added new fire weapon function, and added a #define to make the old |
| 117 | * fire flare function use it. |
| 118 | * |
| 119 | * 187 5/02/99 1:36a Jason |
| 120 | * added moving object lighting viseffects |
| 121 | * |
| 122 | * 186 4/30/99 6:52p Matt |
| 123 | * Changed comment |
| 124 | * |
| 125 | * 185 4/30/99 6:51p Matt |
| 126 | * Added a query to check if an object is on the terrain. |
| 127 | * |
| 128 | * 184 4/30/99 4:32p Matt |
| 129 | * Added a Dallas action to fire a flare from an object. |
| 130 | * |
| 131 | * 183 4/29/99 4:50p Jeff |
| 132 | * fixed evil evil merge problems |
| 133 | * |
| 134 | * 182 4/29/99 12:30p Chris |
| 135 | * Dumb bug (Follow path simple now takes and USES the priority field) |
| 136 | * |
| 137 | * 181 4/29/99 1:59a Chris |
| 138 | * Added the portal blockage support |
| 139 | * |
| 140 | * 179 4/28/99 7:34p Matt |
| 141 | * Increased the number of spew handles from 20 to 50. |
| 142 | * |
| 143 | * 178 4/28/99 5:15p Jeff |
| 144 | * fixed bug with adding items to inventory...should not timeout on spew |
| 145 | * for spewable |
| 146 | * |
| 147 | * 177 4/27/99 5:37p Matt |
| 148 | * Added action to set/clear physics flags for an object. |
| 149 | * |
| 150 | * 176 4/26/99 10:35p Chris |
| 151 | * |
| 152 | * 175 4/26/99 1:43p Chris |
| 153 | * |
| 154 | * 174 4/26/99 1:40p Nate |
| 155 | * Fixed bug with undeclared 'ctype' identifier |
| 156 | * |
| 157 | * 173 4/26/99 11:11a Chris |
| 158 | * Added a new function |
| 159 | * |
| 160 | * 172 4/25/99 10:37p Matt |
| 161 | * Changes in death flags |
| 162 | * |
| 163 | * 171 4/25/99 3:06p Matt |
| 164 | * Increased the max number of spew handles from 10 to 20. |
| 165 | * |
| 166 | * 170 4/24/99 2:18a Chris |
| 167 | * Added some new functions. |
| 168 | * |
| 169 | * 169 4/19/99 6:14p Chris |
| 170 | * Added two new AI Queries for Nate |
| 171 | * |
| 172 | * 168 4/07/99 11:25a Matt |
| 173 | * Added fail level action |
| 174 | * |
| 175 | * 167 4/07/99 3:05a Chris |
| 176 | * Improved the team stuff and fixed a compile bug in |
| 177 | * LightningCreateGunpoints |
| 178 | * |
| 179 | * 166 4/06/99 11:44p Matt |
| 180 | * Added action to create a lighting bolt between two gunpoints on the |
| 181 | * same object, and queries to return an object's original shields and to |
| 182 | * multiply a percent times a float. |
| 183 | * |
| 184 | * 165 4/06/99 8:44p Matt |
| 185 | * Added a couple actions for Mark's energy/shield collector |
| 186 | * |
| 187 | * 164 4/06/99 11:00a Jeff |
| 188 | * |
| 189 | * 163 4/05/99 5:44p Chris |
| 190 | * Added a drop all objects functions |
| 191 | * |
| 192 | * 162 4/05/99 1:07p Chris |
| 193 | * Added a goal failed state |
| 194 | * |
| 195 | * 161 4/04/99 6:20p Matt |
| 196 | * Added distance-based shake Dallas action. |
| 197 | * |
| 198 | * 160 4/03/99 3:51p Chris |
| 199 | * |
| 200 | * 159 4/03/99 3:16p Chris |
| 201 | * |
| 202 | * 158 4/03/99 2:49p Chris |
| 203 | * Fixed a bug with the ScriptedDeath DALLAS func. |
| 204 | * |
| 205 | * 157 4/03/99 1:12a Jeff |
| 206 | * added multisafe/dallas actions to set an object on fire |
| 207 | * |
| 208 | * 156 4/02/99 6:41p Matt |
| 209 | * Added query to find the closest player to an object. |
| 210 | * |
| 211 | * 155 4/02/99 1:20p Nate |
| 212 | * Fixed dallas syntax bug with qGetAttachedChild |
| 213 | * |
| 214 | * 154 4/02/99 12:57p Chris |
| 215 | * Added 2 new DALLAS actions for Nate |
| 216 | * |
| 217 | * 153 4/02/99 11:27a Nate |
| 218 | * Upped the SavedObjectHandle limit to 20 |
| 219 | * |
| 220 | * 152 4/02/99 11:24a Matt |
| 221 | * Added kill object action that allows the caller to specify the death. |
| 222 | * |
| 223 | * 151 3/31/99 11:40a Jason |
| 224 | * added support for attached thick lightning |
| 225 | * |
| 226 | * 150 3/30/99 7:40p Chris |
| 227 | * |
| 228 | * 149 3/30/99 7:39p Chris |
| 229 | * |
| 230 | * 148 3/30/99 7:25p Chris |
| 231 | * Make the weath_lightning stuff more flexable |
| 232 | * |
| 233 | * 147 3/29/99 8:41p Nate |
| 234 | * Jason fix |
| 235 | * |
| 236 | * 146 3/29/99 8:02p Nate |
| 237 | * Added qObjCanSeePlayerAdvancedWithStore |
| 238 | * |
| 239 | * 145 3/29/99 7:30p Jason |
| 240 | * added cool new energy effect |
| 241 | * |
| 242 | * 144 3/29/99 6:04p Nate |
| 243 | * Changed aLightningCreate header for new abilities. |
| 244 | * |
| 245 | * 143 3/29/99 5:26p Chris |
| 246 | * Added the unattach form object and the set max speed functions to |
| 247 | * DALLAS |
| 248 | * |
| 249 | * 142 3/29/99 11:11a Jeff |
| 250 | * fixed fvi calls for view cone functions (hit_none is a valid hit) |
| 251 | * |
| 252 | * 141 3/28/99 6:47p Matt |
| 253 | * Added default value for spark rate |
| 254 | * |
| 255 | * 140 3/28/99 5:56p Matt |
| 256 | * Added Dallas action to turn on object sparking |
| 257 | * |
| 258 | * 139 3/28/99 3:29p Sean |
| 259 | * Jeff: Fixed misnamed dallas func |
| 260 | * |
| 261 | * 138 3/27/99 9:14p Jeff |
| 262 | * added advanced object view cones dallas funcs |
| 263 | * |
| 264 | * 137 3/27/99 7:22p Jeff |
| 265 | * fixed cinematics when going from one cut to another immediatly. Added |
| 266 | * start transition |
| 267 | * |
| 268 | * 136 3/26/99 12:38p Jeff |
| 269 | * added cloak predefs |
| 270 | * |
| 271 | * 135 3/25/99 9:09p Nate |
| 272 | * Fixed Land On Object action |
| 273 | * |
| 274 | * 134 3/25/99 4:56p Chris |
| 275 | * Added code for the land on object DALLAS goal |
| 276 | * |
| 277 | * 133 3/24/99 10:02a Matt |
| 278 | * Added Dallas action to set music region for all players |
| 279 | * |
| 280 | * 132 3/23/99 6:42p Chris |
| 281 | * Added the Get to Object Goal for DALLAS |
| 282 | * |
| 283 | * 131 3/23/99 4:30p Chris |
| 284 | * Fixed a bug in the AIGoalGoToRoom() (parameters where out of order) |
| 285 | * |
| 286 | * 130 3/22/99 6:35p Matt |
| 287 | * Added Dallas action to create a lightning bolt between two objects. |
| 288 | * Jason will implement this. |
| 289 | * |
| 290 | * 129 3/22/99 1:59p Matt |
| 291 | * Added break glass Dallas action |
| 292 | * |
| 293 | * 128 3/04/99 6:13p Matt |
| 294 | * Pass second game message string in message2. Also changed color of the |
| 295 | * HUD message. |
| 296 | * |
| 297 | * 127 3/03/99 3:02p Matt |
| 298 | * Added Game Message action in Dallas |
| 299 | * |
| 300 | * 126 3/02/99 11:19a Jeff |
| 301 | * added comment |
| 302 | * |
| 303 | * 125 2/28/99 11:24p Matt |
| 304 | * Changed a literal to a symbolic constant |
| 305 | * |
| 306 | * 124 2/28/99 8:31p Jeff |
| 307 | * added fade and move player dallas action. Fixed the end-level sequence |
| 308 | * changing view back to player for split second. |
| 309 | * |
| 310 | * 123 2/27/99 1:41p Matt |
| 311 | * Added saved object handles to savegame read/write functions. |
| 312 | * |
| 313 | * 122 2/26/99 1:57a Jeff |
| 314 | * added text to end level sequence |
| 315 | * |
| 316 | * 121 2/25/99 8:53p Jeff |
| 317 | * Inventory supports level change persistant items. Inventory supports |
| 318 | * time-out objects. Inventory Reset changed (takes a level of reset |
| 319 | * now). Quad lasers stay across level change (single player). Guidebot |
| 320 | * bug fixed (now back in ship on level start). Quads time out when |
| 321 | * spewed. Invulnerability and cloak powerups no longer use game |
| 322 | * event/callbacks, so they can be saved in game saves (moved to |
| 323 | * MakePlayerInvulnerable and MakeObjectInvisible) |
| 324 | * |
| 325 | * 120 2/23/99 7:34p Jeff |
| 326 | * save out position clipboard, fixed up add inventory item |
| 327 | * |
| 328 | * 119 2/23/99 7:23p Matt |
| 329 | * Fixed function parms for new types. |
| 330 | * |
| 331 | * 118 2/23/99 11:09a Matt |
| 332 | * Fixed level goal actions/queries |
| 333 | * |
| 334 | * 117 2/22/99 10:21p Matt |
| 335 | * Added (but did not test) several actions and queries for level goals. |
| 336 | * |
| 337 | * 116 2/22/99 10:53a Matt |
| 338 | * Added a version of the streaming audio action that takes a text string, |
| 339 | * for sounds that aren't in the table file. |
| 340 | * |
| 341 | * 115 2/22/99 10:40a Luke |
| 342 | * fixed aAIGoalFollowPath with new data types |
| 343 | * |
| 344 | * 114 2/22/99 1:19a Jeff |
| 345 | * added support for inventory (simple) in dallas. Moved end-level |
| 346 | * sequence to use IGC. Add position clipboard stuff for dallas. Fixed |
| 347 | * some inventory bug with storing object handles |
| 348 | * |
| 349 | * 113 2/21/99 8:35p Jeff |
| 350 | * misc changes to handle new matcen and path types of dallas |
| 351 | * |
| 352 | * 112 2/21/99 6:35p Matt |
| 353 | * Finished action for setting object movement type, and fixed the attach |
| 354 | * new object action. |
| 355 | * |
| 356 | * 111 2/21/99 6:05p Matt |
| 357 | * Use new types for matcens, paths, & streaming audio. |
| 358 | * |
| 359 | * 110 2/21/99 5:49p Matt |
| 360 | * Added Dallas action to set an object's volume |
| 361 | * |
| 362 | * 109 2/21/99 4:55p Matt |
| 363 | * Added actions to set an object's movement type and to enable/disable |
| 364 | * gravity for a object. |
| 365 | * |
| 366 | * 108 2/19/99 6:44p Chris |
| 367 | * |
| 368 | * 107 2/16/99 9:36p Jeff |
| 369 | * added low text layout for cinematics |
| 370 | * |
| 371 | * 106 2/16/99 12:37a Matt |
| 372 | * Added set object velocity action |
| 373 | * |
| 374 | * 105 2/15/99 9:57p Matt |
| 375 | * Several small changes |
| 376 | * |
| 377 | * 104 2/15/99 3:30p Dan |
| 378 | * Fixed typo |
| 379 | * |
| 380 | * 103 2/15/99 3:19p Dan |
| 381 | * Added integer add & subtract queries (MattT on Dan's machine) |
| 382 | * |
| 383 | * 102 2/15/99 11:09a Matt |
| 384 | * Added function to count the number of a certain type of object in the |
| 385 | * level. (Also added HUD actions to print an int and float.) |
| 386 | * |
| 387 | * 101 2/14/99 4:27a Jeff |
| 388 | * forgot to unset a flag when ending a custom cinematic. and set a flag |
| 389 | * when starting a custom cinematic. |
| 390 | * |
| 391 | * 100 2/13/99 8:44p Jeff |
| 392 | * made intro cinematic into a 'canned' cinematic. Added ability to |
| 393 | * create custom in-game cinematics (SUPER powerful) |
| 394 | * |
| 395 | * 99 2/13/99 5:33p Matt |
| 396 | * Changed pathname in endlevel sequence from string to specific string |
| 397 | * |
| 398 | * 98 2/12/99 6:14p Matt |
| 399 | * Added object is type query |
| 400 | * |
| 401 | * 97 2/12/99 4:17p Matt |
| 402 | * Added key name & HUD message to give key action |
| 403 | * |
| 404 | * 96 2/12/99 12:07p Matt |
| 405 | * Make region action use enumerated type |
| 406 | * |
| 407 | * 95 2/11/99 1:07p Matt |
| 408 | * Added action to enable/disable triggers |
| 409 | * |
| 410 | * 94 2/11/99 2:53a Jeff |
| 411 | * improvements to introcam |
| 412 | * |
| 413 | * 93 2/10/99 4:06p Matt |
| 414 | * Changed the object type name parameter to the attach action to a |
| 415 | * specific string. |
| 416 | * |
| 417 | * 92 2/10/99 2:56p Matt |
| 418 | * Fixed typo |
| 419 | * |
| 420 | * 91 2/10/99 2:31p Matt |
| 421 | * Added Enable/Disable Matcen action. |
| 422 | * |
| 423 | * 90 2/10/99 1:47p Matt |
| 424 | * Changed object handle symbolic constants |
| 425 | * |
| 426 | * 89 2/10/99 1:21p Matt |
| 427 | * Added UserFlags and a query to return a user var as an integer. |
| 428 | * |
| 429 | * 88 2/09/99 1:29p Matt |
| 430 | * Added Matcen IDs, object handle saves, random value query, player in |
| 431 | * room query. |
| 432 | * |
| 433 | * 87 2/08/99 5:08p Matt |
| 434 | * Added MatcenID user type, and added No Reorientation flag to flag masks |
| 435 | * for all the AI actions. |
| 436 | * |
| 437 | * 86 2/08/99 3:10a Jeff |
| 438 | * added a multisafe type for player control type setting. Improved intro |
| 439 | * cinematic action function, player now follows path. |
| 440 | * |
| 441 | * 85 2/06/99 10:03p Matt |
| 442 | * Added keys system |
| 443 | * |
| 444 | * 84 2/06/99 1:52a Matt |
| 445 | * Added a bunch of Dallas funcs, mostly for Sean |
| 446 | * |
| 447 | * 83 2/05/99 5:51p Chris |
| 448 | * Added rereorienation to ai goal flags |
| 449 | * |
| 450 | * 82 2/05/99 1:29p Matt |
| 451 | * Changed wind to use direction vector & speed instead of velocity |
| 452 | * vector, and added some defaults to some actions. |
| 453 | * |
| 454 | * 81 2/04/99 3:24p Matt |
| 455 | * Increased the number of user vars to 25, and added save/load code for |
| 456 | * user vars and sound & spew handles. |
| 457 | * |
| 458 | * 80 2/03/99 5:48p Matt |
| 459 | * Added room damage system |
| 460 | * |
| 461 | * 79 2/03/99 2:56a Jeff |
| 462 | * ship permission actions and queries |
| 463 | * |
| 464 | * 78 2/03/99 12:24a Matt |
| 465 | * Got HUD message, 2D sound, streaming sound, and player-is-visible all |
| 466 | * working correctly in multiplayer. |
| 467 | * |
| 468 | * 77 2/02/99 3:58p Jeff |
| 469 | * started to implement level intro cinematic (need ai functions first). |
| 470 | * No longer need camera object to do cinematic (auto-created)...path |
| 471 | * cameras use speed based on distance needed to travel. |
| 472 | * |
| 473 | * 76 2/02/99 3:38p Luke |
| 474 | * Changed Matcen names to take direct string input instead of using |
| 475 | * messages |
| 476 | * |
| 477 | * 75 2/02/99 12:35p Jeff |
| 478 | * changed cinematic path parameter to use a instead of s |
| 479 | * |
| 480 | * 74 2/01/99 2:08p Kevin |
| 481 | * Fixed parameter order for qObjCanSeeObj |
| 482 | * |
| 483 | * 73 2/01/99 1:11p Matt |
| 484 | * Changed a bunch of stuff to work with object handles instead of player |
| 485 | * numbers. Also fixed the view cone action, which ignored distance. |
| 486 | * |
| 487 | * 72 2/01/99 12:41p Kevin |
| 488 | * Moved some functions into the training system script |
| 489 | * |
| 490 | * 71 1/31/99 11:06p Matt |
| 491 | * Changed timers from handles to IDs, and implemented music region set. |
| 492 | * |
| 493 | * 70 1/31/99 9:00p Jeff |
| 494 | * added new in game cinematics system |
| 495 | * |
| 496 | * 69 1/31/99 8:11p Matt |
| 497 | * Added player visible query, and made zoom work with popup cameras. |
| 498 | * |
| 499 | * 68 1/31/99 7:15p Matt |
| 500 | * Added physics flags for spew |
| 501 | * |
| 502 | * 67 1/30/99 7:54p Chris |
| 503 | * |
| 504 | * 66 1/30/99 3:46p Luke |
| 505 | * Changed two boolean parameters to be FALSE by default (0 didn't work) |
| 506 | * |
| 507 | * 65 1/30/99 3:19p Matt |
| 508 | * Made Dallas spews work from object centers in addition to gunpoints |
| 509 | * |
| 510 | * 64 1/29/99 3:14p Matt |
| 511 | * Deleted some obsolete Dallas actions, and made the player controls |
| 512 | * actions take player numbers instead of the player object. |
| 513 | * |
| 514 | * 63 1/29/99 2:50p Luke |
| 515 | * Added a bunch of default values to help designers and fixed a few |
| 516 | * parameter listings, but modified no actual code |
| 517 | * |
| 518 | * 62 1/29/99 12:57p Kevin |
| 519 | * Added cone to ObjCanSeeObj |
| 520 | * |
| 521 | * 61 1/29/99 12:49p Matt |
| 522 | * Added door actions & queries, chagned the working of the math queries, |
| 523 | * adding math queries for percentages, and reworded a few other queries. |
| 524 | * |
| 525 | * 60 1/26/99 6:39p Kevin |
| 526 | * Added energy get/set |
| 527 | * |
| 528 | * 59 1/26/99 5:17p Matt |
| 529 | * Added user types and stop object sound action. |
| 530 | * |
| 531 | * 58 1/26/99 12:53p Kevin |
| 532 | * Added SetTeam function |
| 533 | * |
| 534 | * 57 1/26/99 10:51a Matt |
| 535 | * Fixed stupid oversight. |
| 536 | * |
| 537 | * 56 1/25/99 6:32p Matt |
| 538 | * A bunch of stuff: sounds, goal flag masks, pick up with radius. |
| 539 | * |
| 540 | * 55 1/25/99 12:19p Matt |
| 541 | * Fixed stupid bugs |
| 542 | * |
| 543 | * 54 1/25/99 11:13a Matt |
| 544 | * Changed a bunch of actions to use enums for On/Off, Enable/Disable, |
| 545 | * etc. instead of bools. Also changed the Player controls action to use |
| 546 | * flags. |
| 547 | * |
| 548 | * 53 1/25/99 10:15a Matt |
| 549 | * AI Goal stuff |
| 550 | * |
| 551 | * 52 1/25/99 7:23a Chris |
| 552 | * Added the GUID (Goal Unique Id) and added the ability for weapon |
| 553 | * batteries to always fire exactly forward. |
| 554 | * |
| 555 | * 51 1/24/99 6:28p Matt |
| 556 | * Added path follow action |
| 557 | * |
| 558 | * 50 1/23/99 5:37p Matt |
| 559 | * Deleted AI goal flags that the user won't be using |
| 560 | * |
| 561 | * 49 1/23/99 5:19p Matt |
| 562 | * Added AI goal flags |
| 563 | * |
| 564 | * 48 1/23/99 4:48p Matt |
| 565 | * Added some default parameter values |
| 566 | * |
| 567 | * 47 1/23/99 2:56a Jeff |
| 568 | * added target field to boss intro struct |
| 569 | * |
| 570 | * 46 1/22/99 7:50p Kevin |
| 571 | * Training mission additions.. |
| 572 | * |
| 573 | * 45 1/22/99 5:42p Matt |
| 574 | * Added a couple AI actions, though I haven't tested them fully yet. |
| 575 | * |
| 576 | * 44 1/22/99 3:09p Matt |
| 577 | * Added forcefield state query |
| 578 | * |
| 579 | * 43 1/21/99 7:03p Matt |
| 580 | * Added action to set/clear secret flag |
| 581 | * |
| 582 | * 42 1/20/99 9:30p Matt |
| 583 | * Got AISetMode action working |
| 584 | * |
| 585 | * 41 1/20/99 6:26p Matt |
| 586 | * Added several actions |
| 587 | * |
| 588 | * 40 1/20/99 3:49p Kevin |
| 589 | * Added some glue functions |
| 590 | * |
| 591 | * 39 1/20/99 3:44a Jeff |
| 592 | * created functions and struct for boss introduction cinematic sequence |
| 593 | * |
| 594 | * 38 1/19/99 6:54p Matt |
| 595 | * Added queries to add & subtract floats |
| 596 | * |
| 597 | * 37 1/19/99 6:13p Matt |
| 598 | * Added an action & query for lighting distance |
| 599 | * |
| 600 | * 36 1/19/99 3:43p Kevin |
| 601 | * Added msafe functionality to set an object to render type RT_NONE |
| 602 | * |
| 603 | * 35 1/19/99 12:16p Matt |
| 604 | * Added start endlevel sequence action |
| 605 | * |
| 606 | * 34 1/19/99 10:33a Kevin |
| 607 | * |
| 608 | * 33 1/19/99 10:02a Matt |
| 609 | * Added unfinished sound action |
| 610 | * |
| 611 | * 32 1/18/99 7:31p Matt |
| 612 | * Added a bunch of Dallas actions |
| 613 | * |
| 614 | * 31 1/18/99 6:18p Kevin |
| 615 | * Added controller masking to DALLAS |
| 616 | * |
| 617 | * 30 1/18/99 3:30p Matt |
| 618 | * Added some default values and ranges |
| 619 | * |
| 620 | * 29 1/15/99 5:02p Matt |
| 621 | * Got activate/deactive matcen actions working |
| 622 | * |
| 623 | * 28 1/15/99 11:04a Matt |
| 624 | * Added actions for matcens (not working) and fog (working) |
| 625 | * |
| 626 | * 27 1/13/99 5:48p Nate |
| 627 | * Fixed "Sheild" in function prototypes |
| 628 | * |
| 629 | * 26 1/13/99 12:42p Matt |
| 630 | * Added an action to close a popup view |
| 631 | * |
| 632 | * 25 1/11/99 8:43p Nate |
| 633 | * Added custom DALLAS queries |
| 634 | * |
| 635 | * 24 1/11/99 6:23p Nate |
| 636 | * Fixed two broken queries, some spelling errors, and made "Obj type" |
| 637 | * return an ObjectType (specific enumerated type) |
| 638 | * |
| 639 | * 23 1/11/99 4:53p Matt |
| 640 | * Change spew action to use enum, and added real values for SpewType |
| 641 | * |
| 642 | * 22 1/11/99 2:14p Chris |
| 643 | * Massive work on OSIRIS and AI |
| 644 | * |
| 645 | * 21 1/11/99 10:43a Matt |
| 646 | * Made forcefield on/off/toggle optionally do both sides of a portal |
| 647 | * |
| 648 | * 20 1/11/99 10:25a Matt |
| 649 | * Added spew handles and got spew off working. Also added functions to |
| 650 | * init, load, & save variables. |
| 651 | * |
| 652 | * 19 1/08/99 6:07p Matt |
| 653 | * Added some comments |
| 654 | * |
| 655 | * 18 1/08/99 4:33p Matt |
| 656 | * Got popup views working in Dallas |
| 657 | * |
| 658 | * 17 1/08/99 3:00p Luke |
| 659 | * (Jeff) fixed ObjPlayAnim bug (never filled in objhandle) |
| 660 | * |
| 661 | * 16 1/06/99 12:02p Matt |
| 662 | * Fixed some function name mismatches |
| 663 | * |
| 664 | * 15 1/05/99 6:53p Jeff |
| 665 | * fixed hud message color |
| 666 | * |
| 667 | * 14 1/05/99 6:38p Jeff |
| 668 | * fixed spew errors, added some defines |
| 669 | * |
| 670 | * 13 1/05/99 4:31p Matt |
| 671 | * Added a bunch more actions |
| 672 | * |
| 673 | * 12 1/05/99 3:41p Jeff |
| 674 | * added spew create and stop functions |
| 675 | * |
| 676 | * 11 1/04/99 11:03p Matt |
| 677 | * Added a bunch of actions & queries, and renamed a bunch of others |
| 678 | * |
| 679 | * 10 1/02/99 3:50p Matt |
| 680 | * Added ENUM defines to comment block, and made aShowHUDMessage() take |
| 681 | * var args. |
| 682 | * |
| 683 | * 9 1/01/99 3:25p Matt |
| 684 | * Fixed lightning actions |
| 685 | * |
| 686 | * 8 12/30/98 6:56p Matt |
| 687 | * Added a bunch more actions and queries |
| 688 | * |
| 689 | * 7 12/23/98 6:43p Nate |
| 690 | * Fixed the category for the qIsPlayerWeapon Query |
| 691 | * |
| 692 | * 6 12/23/98 6:10p Matt |
| 693 | * Added toggle forcefield action |
| 694 | * |
| 695 | * 5 12/23/98 4:29p Matt |
| 696 | * Un-did hack from previous version. Now works w/ scripts. |
| 697 | * |
| 698 | * 4 12/23/98 3:02p Luke |
| 699 | * Nate: temp fix so that editor will compile |
| 700 | * |
| 701 | * 3 12/23/98 1:46p Matt |
| 702 | * Renamed the portal render/forcefield actions |
| 703 | * |
| 704 | * 2 12/23/98 1:39p Matt |
| 705 | * Added DallasFuncs.cpp to project |
| 706 | * |
| 707 | * 1 12/23/98 1:36p Matt |
| 708 | * |
| 709 | */ |
| 710 | |
| 711 | #include <cstdio> |
| 712 | #include <cstring> |
| 713 | #include <cstdarg> |
| 714 | #include <cfloat> |
| 715 | |
| 716 | #include "osiris_vector.h"cxx . . $ `<file>/scripts/osiris_vector.h`/ |
| 717 | |
| 718 | // These should really be included, I think, but there's a problem with osiris_import.h being included twice |
| 719 | // #include "osiris_import.h" |
| 720 | // #include "osiris_common.h" |
| 721 | |
| 722 | /* |
| 723 | |
| 724 | Dallas types: |
| 725 | |
| 726 | ID Name How passed |
| 727 | o object object handle |
| 728 | d door handle of door object |
| 729 | r room integer room number |
| 730 | t trigger integer trigger number |
| 731 | i int integer |
| 732 | b bool usigned byte |
| 733 | f float single-precision float (4 bytes) |
| 734 | p percentage single-precision float in range 0.0 - 1.0 |
| 735 | v vector pointer to triplet of floats |
| 736 | s string pointer to null-terminated string |
| 737 | e enum integer |
| 738 | a name a specific (non-localizable) name, as of a matcen. Does not appear in the |
| 739 | message file. n sound sound name h path integer path number m matcen |
| 740 | integer matcen numer l level goal integer level goal number z streaming audio pointer to null-terminated name |
| 741 | of audio file |
| 742 | |
| 743 | |
| 744 | |
| 745 | Dallas Action Categories. Used by Dallas to build the action list. |
| 746 | |
| 747 | $$CATEGORIES |
| 748 | Objects |
| 749 | Players |
| 750 | Doors |
| 751 | Rooms |
| 752 | Triggers |
| 753 | Spew |
| 754 | Weather |
| 755 | AI |
| 756 | Sound && Music |
| 757 | Timer |
| 758 | Level Goals |
| 759 | Mission |
| 760 | Math |
| 761 | User Vars |
| 762 | Misc |
| 763 | Scripts |
| 764 | Cinematics |
| 765 | Custom |
| 766 | $$END |
| 767 | |
| 768 | |
| 769 | Enumerated types: |
| 770 | |
| 771 | $$ENUM Axis |
| 772 | 0:X |
| 773 | 1:Y |
| 774 | 2:Z |
| 775 | $$END |
| 776 | |
| 777 | $$ENUM SpewType |
| 778 | 0:Explosion0 |
| 779 | 1:Explosion1 |
| 780 | 2:Explosion2 |
| 781 | 3:Explosion3 |
| 782 | 4:Explosion4 |
| 783 | 5:Explosion5 |
| 784 | 6:Explosion6 |
| 785 | 7:Grey Smoke |
| 786 | 8:Black Smoke |
| 787 | 15:Red Spark |
| 788 | 16:Blue Spark |
| 789 | 23:Napalm |
| 790 | 28:Raindrop |
| 791 | 35:Corona0 |
| 792 | 36:Corona1 |
| 793 | 37:Corona2 |
| 794 | 38:Corona3 |
| 795 | 39:Snowflake |
| 796 | 41:Blue Fire |
| 797 | $$END |
| 798 | |
| 799 | //I've just defined the flags that spew needs, but feel free to define others if you need them |
| 800 | $$FLAG PhysicsFlags |
| 801 | 128:Gravity |
| 802 | 2048:Fixed Velocity |
| 803 | 32768:Reverse Gravity |
| 804 | 65536:No Collide |
| 805 | 2097152:Ignore Concussive Force |
| 806 | 8388608:Lock X |
| 807 | 16777216:Lock Y |
| 808 | 33554432:Lock Z |
| 809 | $$END |
| 810 | |
| 811 | $$FLAG FVIHitFlags |
| 812 | 1:Check against objects |
| 813 | 2:Hit backfaces of poly objects |
| 814 | 4:Go through transparent walls if hit |
| 815 | 8:Ignore powerups |
| 816 | 16:Check for collisions with backfaces (default ignored) |
| 817 | 32:Solid Portals |
| 818 | 256:Ignore Moving Objects |
| 819 | 512:Ignore Non-Lightmap Objects |
| 820 | 1024:Ignore all objects besides players |
| 821 | 2048:Ignore all walls |
| 822 | 4096:Check terrain ceiling |
| 823 | 8192:Ignore all objects but doors |
| 824 | 524288:Ignore external rooms |
| 825 | 1048576:Ignore weapons |
| 826 | 2097152:Ignore terrain |
| 827 | 4194304:Treat players as spheres |
| 828 | 8388608:Treat Robots as spheres |
| 829 | $$END |
| 830 | Total: 16269119 |
| 831 | |
| 832 | $$ENUM ObjectType |
| 833 | 2:Robot |
| 834 | 4:Player |
| 835 | 5:Weapon |
| 836 | 6:Viewer |
| 837 | 7:Powerup |
| 838 | 8:Debris |
| 839 | 10:Shockwave |
| 840 | 11:Clutter |
| 841 | 16:Building |
| 842 | 17:Door |
| 843 | $$END |
| 844 | |
| 845 | $$FLAG PlayerControl |
| 846 | 1:Forward Thrust |
| 847 | 2:Reverse Thrust |
| 848 | 4:Slide Left |
| 849 | 8:Slide Right |
| 850 | 16:Slide Up |
| 851 | 32:Slide Down |
| 852 | 64:Pitch Up |
| 853 | 128:Pitch Down |
| 854 | 256:Heading Left |
| 855 | 512:Heading Right |
| 856 | 1024:Roll Left |
| 857 | 2048:Roll Right |
| 858 | 4096:Primary |
| 859 | 8192:Secondary |
| 860 | 16384:Afterburner |
| 861 | $$END |
| 862 | |
| 863 | $$ENUM Enabled/Disabled |
| 864 | 0:DISABLED |
| 865 | 1:ENABLED |
| 866 | $$END |
| 867 | |
| 868 | $$ENUM Enable/Disable |
| 869 | 0:DISABLE |
| 870 | 1:ENABLE |
| 871 | $$END |
| 872 | |
| 873 | $$ENUM Completed |
| 874 | 0:NOT COMPLETED |
| 875 | 1:COMPLETED |
| 876 | $$END |
| 877 | |
| 878 | $$ENUM Failed |
| 879 | 0:NOT FAILED |
| 880 | 1:FAILED |
| 881 | $$END |
| 882 | |
| 883 | $$ENUM Can/Cannot |
| 884 | 0:CANNOT |
| 885 | 1:CAN |
| 886 | $$END |
| 887 | |
| 888 | $$ENUM On/Off |
| 889 | 0:OFF |
| 890 | 1:ON |
| 891 | $$END |
| 892 | |
| 893 | $$ENUM Yes/No |
| 894 | 0:NO |
| 895 | 1:YES |
| 896 | $$END |
| 897 | |
| 898 | $$ENUM Activate/Deactivate |
| 899 | 0:DEACTIVATE |
| 900 | 1:ACTIVATE |
| 901 | $$END |
| 902 | |
| 903 | $$ENUM Teams |
| 904 | 0:PTMC |
| 905 | 65536:Rebel |
| 906 | 131072:Hostile |
| 907 | 196608:Neutral |
| 908 | $$END |
| 909 | |
| 910 | */ |
| 911 | |
| 912 | // |
| 913 | // Variables |
| 914 | // |
| 915 | |
| 916 | #define MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`! 25 // make sure this value matches the USERTYPE definition |
| 917 | float User_varscxx . . $ User_vars.[MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!]; |
| 918 | |
| 919 | #define MAX_SPEW_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:919:9`! 50 // make sure this value matches the USERTYPE definition |
| 920 | int Spew_handlescxx . . $ Spew_handles.[MAX_SPEW_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:919:9`!]; |
| 921 | |
| 922 | #define MAX_SOUND_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:922:9`! 10 // make sure this value matches the USERTYPE definition |
| 923 | int Sound_handlescxx . . $ Sound_handles.[MAX_SOUND_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:922:9`!]; |
| 924 | |
| 925 | #define MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`! 20 // make sure this value matches the USERTYPE definition |
| 926 | int Saved_object_handlescxx . . $ Saved_object_handles.[MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!]; |
| 927 | |
| 928 | int User_flagscxx . . $ User_flags.; |
| 929 | |
| 930 | class cPositionClipboardcxx . . $ cPositionClipboard# { |
| 931 | public: |
| 932 | cPositionClipboardcxx . . $ cPositionClipboard#cPositionClipboard(49f6e7a06ebc5aa8).() { has_poscxx . . $ cPositionClipboard#has_pos. = false; } |
| 933 | bool has_poscxx . . $ cPositionClipboard#has_pos.; |
| 934 | int roomcxx . . $ cPositionClipboard#room.; |
| 935 | vectorcxx . . $ vector# poscxx . . $ cPositionClipboard#pos.; |
| 936 | matrixcxx . . $ matrix# orientcxx . . $ cPositionClipboard#orient.; |
| 937 | }; |
| 938 | cPositionClipboardcxx . . $ cPositionClipboard# PositionClipboardcxx . . $ cPositionClipboard#cPositionClipboard(49f6e7a06ebc5aa8).; |
| 939 | |
| 940 | #define SOUND_INVALID_HANDLEcxx . . $ `scripts/DallasFuncs.cpp:940:9`! -1 |
| 941 | #define SPEW_INVALID_HANDLEcxx . . $ `scripts/DallasFuncs.cpp:941:9`! -1 |
| 942 | |
| 943 | /* |
| 944 | Tell Dallas about our handles |
| 945 | |
| 946 | $$USERTYPE UserVar:24 |
| 947 | $$USERTYPE UserFlag:31 |
| 948 | $$USERTYPE SpewHandle:49 |
| 949 | $$USERTYPE TimerID:49 |
| 950 | $$USERTYPE SavedObjectSlot:19 |
| 951 | */ |
| 952 | |
| 953 | // TEMP!!! |
| 954 | #ifndef OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`! |
| 955 | #define OBJECT_HANDLE_NONE -1 |
| 956 | #endif |
| 957 | |
| 958 | // |
| 959 | // System functions |
| 960 | // |
| 961 | |
| 962 | // Initialize vars |
| 963 | void dfInitcxx . . $ dfInit(49f6e7a06ebc5aa8).() { |
| 964 | int i; |
| 965 | |
| 966 | for (i = 0; i < MAX_SPEW_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:919:9`!; i++) |
| 967 | Spew_handlescxx . . $ Spew_handles.[i] = SPEW_INVALID_HANDLEcxx . . $ `scripts/DallasFuncs.cpp:941:9`!; |
| 968 | |
| 969 | for (i = 0; i < MAX_SOUND_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:922:9`!; i++) |
| 970 | Sound_handlescxx . . $ Sound_handles.[i] = SOUND_INVALID_HANDLEcxx . . $ `scripts/DallasFuncs.cpp:940:9`!; |
| 971 | |
| 972 | for (i = 0; i < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!; i++) |
| 973 | User_varscxx . . $ User_vars.[i] = 0.0; |
| 974 | |
| 975 | for (i = 0; i < MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!; i++) |
| 976 | Saved_object_handlescxx . . $ Saved_object_handles.[i] = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 977 | |
| 978 | User_flagscxx . . $ User_flags. = 0; |
| 979 | } |
| 980 | |
| 981 | // Save vars |
| 982 | void dfSavecxx . . $ dfSave(5d22bdacc48458e8).(void *fileptr) { |
| 983 | int i; |
| 984 | |
| 985 | for (i = 0; i < MAX_SPEW_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:919:9`!; i++) |
| 986 | File_WriteIntcxx . . $ File_WriteInt.(Spew_handlescxx . . $ Spew_handles.[i], fileptr); |
| 987 | |
| 988 | for (i = 0; i < MAX_SOUND_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:922:9`!; i++) |
| 989 | File_WriteIntcxx . . $ File_WriteInt.(Sound_handlescxx . . $ Sound_handles.[i], fileptr); |
| 990 | |
| 991 | for (i = 0; i < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!; i++) |
| 992 | File_WriteFloatcxx . . $ File_WriteFloat.(User_varscxx . . $ User_vars.[i], fileptr); |
| 993 | |
| 994 | for (i = 0; i < MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!; i++) |
| 995 | File_WriteIntcxx . . $ File_WriteInt.(Saved_object_handlescxx . . $ Saved_object_handles.[i], fileptr); |
| 996 | |
| 997 | File_WriteIntcxx . . $ File_WriteInt.(User_flagscxx . . $ User_flags., fileptr); |
| 998 | |
| 999 | File_WriteBytecxx . . $ File_WriteByte.(PositionClipboardcxx . . $ PositionClipboard..has_poscxx . . $ cPositionClipboard#has_pos., fileptr); |
| 1000 | File_WriteIntcxx . . $ File_WriteInt.(PositionClipboardcxx . . $ PositionClipboard..roomcxx . . $ cPositionClipboard#room., fileptr); |
| 1001 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos..xcxx . . $ vector#x., fileptr); |
| 1002 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos..ycxx . . $ vector#y., fileptr); |
| 1003 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos..zcxx . . $ vector#z., fileptr); |
| 1004 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..fveccxx . . $ matrix#fvec..xcxx . . $ vector#x., fileptr); |
| 1005 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..fveccxx . . $ matrix#fvec..ycxx . . $ vector#y., fileptr); |
| 1006 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..fveccxx . . $ matrix#fvec..zcxx . . $ vector#z., fileptr); |
| 1007 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..uveccxx . . $ matrix#uvec..xcxx . . $ vector#x., fileptr); |
| 1008 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..uveccxx . . $ matrix#uvec..ycxx . . $ vector#y., fileptr); |
| 1009 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..uveccxx . . $ matrix#uvec..zcxx . . $ vector#z., fileptr); |
| 1010 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..rveccxx . . $ matrix#rvec..xcxx . . $ vector#x., fileptr); |
| 1011 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..rveccxx . . $ matrix#rvec..ycxx . . $ vector#y., fileptr); |
| 1012 | File_WriteFloatcxx . . $ File_WriteFloat.(PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..rveccxx . . $ matrix#rvec..zcxx . . $ vector#z., fileptr); |
| 1013 | } |
| 1014 | |
| 1015 | // Restore vars |
| 1016 | void dfRestorecxx . . $ dfRestore(5d22bdacc48458e8).(void *fileptr) { |
| 1017 | int i; |
| 1018 | |
| 1019 | for (i = 0; i < MAX_SPEW_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:919:9`!; i++) |
| 1020 | Spew_handlescxx . . $ Spew_handles.[i] = File_ReadIntcxx . . $ File_ReadInt.(fileptr); |
| 1021 | |
| 1022 | for (i = 0; i < MAX_SOUND_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:922:9`!; i++) |
| 1023 | Sound_handlescxx . . $ Sound_handles.[i] = File_ReadIntcxx . . $ File_ReadInt.(fileptr); |
| 1024 | |
| 1025 | for (i = 0; i < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!; i++) |
| 1026 | User_varscxx . . $ User_vars.[i] = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1027 | |
| 1028 | for (i = 0; i < MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!; i++) |
| 1029 | Saved_object_handlescxx . . $ Saved_object_handles.[i] = File_ReadIntcxx . . $ File_ReadInt.(fileptr); |
| 1030 | |
| 1031 | User_flagscxx . . $ User_flags. = File_ReadIntcxx . . $ File_ReadInt.(fileptr); |
| 1032 | |
| 1033 | PositionClipboardcxx . . $ PositionClipboard..has_poscxx . . $ cPositionClipboard#has_pos. = (File_ReadBytecxx . . $ File_ReadByte.(fileptr)) ? true : false; |
| 1034 | PositionClipboardcxx . . $ PositionClipboard..roomcxx . . $ cPositionClipboard#room. = File_ReadIntcxx . . $ File_ReadInt.(fileptr); |
| 1035 | PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos..xcxx . . $ vector#x. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1036 | PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos..ycxx . . $ vector#y. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1037 | PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos..zcxx . . $ vector#z. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1038 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..fveccxx . . $ matrix#fvec..xcxx . . $ vector#x. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1039 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..fveccxx . . $ matrix#fvec..ycxx . . $ vector#y. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1040 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..fveccxx . . $ matrix#fvec..zcxx . . $ vector#z. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1041 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..uveccxx . . $ matrix#uvec..xcxx . . $ vector#x. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1042 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..uveccxx . . $ matrix#uvec..ycxx . . $ vector#y. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1043 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..uveccxx . . $ matrix#uvec..zcxx . . $ vector#z. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1044 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..rveccxx . . $ matrix#rvec..xcxx . . $ vector#x. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1045 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..rveccxx . . $ matrix#rvec..ycxx . . $ vector#y. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1046 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient..rveccxx . . $ matrix#rvec..zcxx . . $ vector#z. = File_ReadFloatcxx . . $ File_ReadFloat.(fileptr); |
| 1047 | } |
| 1048 | |
| 1049 | int dfGetPlayercxx . . $ dfGetPlayer(7864480464b09eea).(int objhandle) { |
| 1050 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1051 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 1052 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 1053 | |
| 1054 | if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!) { |
| 1055 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_PARENTcxx . . $ `scripts/osiris_common.h:834:9`!, &mstruct); |
| 1056 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 1057 | |
| 1058 | if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`! || mstruct.typecxx . . $ msafe_struct#type. == OBJ_OBSERVERcxx . . $ `Descent3/object_external.h:182:9`! || mstruct.typecxx . . $ msafe_struct#type. == OBJ_GHOSTcxx . . $ `Descent3/object_external.h:172:9`!) { |
| 1059 | return mstruct.objhandlecxx . . $ msafe_struct#objhandle.; |
| 1060 | } else { |
| 1061 | mprintfcxx . . $ mprintf.(0, "---------------------NOT A PLAYER OR PLAYER WEAPON!!!!!!!!!-------------\n"); |
| 1062 | return objhandle; |
| 1063 | } |
| 1064 | |
| 1065 | } else if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`! || mstruct.typecxx . . $ msafe_struct#type. == OBJ_OBSERVERcxx . . $ `Descent3/object_external.h:182:9`! || mstruct.typecxx . . $ msafe_struct#type. == OBJ_GHOSTcxx . . $ `Descent3/object_external.h:172:9`!) { |
| 1066 | return objhandle; |
| 1067 | } else { |
| 1068 | mprintfcxx . . $ mprintf.(0, "---------------------NOT A PLAYER OR PLAYER WEAPON!!!!!!!!!-------------\n"); |
| 1069 | } |
| 1070 | |
| 1071 | return objhandle; |
| 1072 | } |
| 1073 | |
| 1074 | // |
| 1075 | // D3 actions |
| 1076 | // |
| 1077 | |
| 1078 | /* |
| 1079 | $$ACTION |
| 1080 | Rooms |
| 1081 | [e:Enable/Disable] forcefield at portal [i:PortalNum] in room [r:Room]; Double-sided = [b:DoublesidedFlag=1] |
| 1082 | aPortalRenderSet |
| 1083 | Enable/Disable forcefield |
| 1084 | Turns on or off the specified forcefield |
| 1085 | |
| 1086 | Parameters: |
| 1087 | Room: The room the forcefield is in |
| 1088 | PortalNum: The portal number of the forcefield |
| 1089 | $$END |
| 1090 | */ |
| 1091 | void aPortalRenderSetcxx . . $ aPortalRenderSet(cb82e25e9f99304e).(int state, int portalnum, int roomnum, bool doublesided) { |
| 1092 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1093 | |
| 1094 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 1095 | mstruct.portalnumcxx . . $ msafe_struct#portalnum. = portalnum; |
| 1096 | mstruct.flagscxx . . $ msafe_struct#flags. = doublesided ? 1 : 0; |
| 1097 | mstruct.statecxx . . $ msafe_struct#state. = state; |
| 1098 | |
| 1099 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_PORTAL_RENDERcxx . . $ `scripts/osiris_common.h:789:9`!, &mstruct); |
| 1100 | } |
| 1101 | |
| 1102 | /* |
| 1103 | $$ACTION |
| 1104 | Rooms |
| 1105 | [e:Enable/Disable] Blockage at portal [i:PortalNum] in room [r:Room] |
| 1106 | aPortalBlockageSet |
| 1107 | Enable/Disable Blockage |
| 1108 | Turns on or off the blockage at a specified portal |
| 1109 | |
| 1110 | Parameters: |
| 1111 | Room: The room the blockage is in |
| 1112 | PortalNum: The portal number of the blockage |
| 1113 | $$END |
| 1114 | */ |
| 1115 | void aPortalBlockageSetcxx . . $ aPortalBlockageSet(b1146eedae1e1d0b).(int state, int portalnum, int roomnum) { |
| 1116 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1117 | |
| 1118 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 1119 | mstruct.portalnumcxx . . $ msafe_struct#portalnum. = portalnum; |
| 1120 | mstruct.statecxx . . $ msafe_struct#state. = state; |
| 1121 | |
| 1122 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_PORTAL_BLOCKcxx . . $ `scripts/osiris_common.h:799:9`!, &mstruct); |
| 1123 | } |
| 1124 | |
| 1125 | /* |
| 1126 | $$ACTION |
| 1127 | Rooms |
| 1128 | Toggle forcefield at portal [i:PortalNum] in room [r:Room]; Double-sided = [b:DoublesidedFlag=1] |
| 1129 | aPortalRenderToggle |
| 1130 | Toggle forcefield |
| 1131 | Turns off the specified forcefield if it's on, and on if it's off |
| 1132 | |
| 1133 | Parameters: |
| 1134 | Room: The room the forcefield is in |
| 1135 | PortalNum: The portal number of the forcefield |
| 1136 | $$END |
| 1137 | */ |
| 1138 | void aPortalRenderTogglecxx . . $ aPortalRenderToggle(6908015b96d379c0).(int portalnum, int roomnum, bool doublesided) { |
| 1139 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1140 | |
| 1141 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 1142 | mstruct.portalnumcxx . . $ msafe_struct#portalnum. = portalnum; |
| 1143 | |
| 1144 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_ROOM_PORTAL_RENDERcxx . . $ `scripts/osiris_common.h:789:9`!, &mstruct); |
| 1145 | |
| 1146 | mstruct.flagscxx . . $ msafe_struct#flags. = doublesided ? 1 : 0; |
| 1147 | mstruct.statecxx . . $ msafe_struct#state. = !mstruct.statecxx . . $ msafe_struct#state.; |
| 1148 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_PORTAL_RENDERcxx . . $ `scripts/osiris_common.h:789:9`!, &mstruct); |
| 1149 | } |
| 1150 | |
| 1151 | /* |
| 1152 | $$ACTION |
| 1153 | Rooms |
| 1154 | Break glass at portal [i:PortalNum] in room [r:Room] |
| 1155 | aPortalBreakGlass |
| 1156 | Break glass |
| 1157 | Breaks the glass in the specified portal |
| 1158 | |
| 1159 | Parameters: |
| 1160 | PortalNum: The portal number of the forcefield |
| 1161 | Room: The room the forcefield is in |
| 1162 | $$END |
| 1163 | */ |
| 1164 | void aPortalBreakGlasscxx . . $ aPortalBreakGlass(3e454b8ccf442868).(int portalnum, int roomnum) { |
| 1165 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1166 | |
| 1167 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 1168 | mstruct.portalnumcxx . . $ msafe_struct#portalnum. = portalnum; |
| 1169 | |
| 1170 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_BREAK_GLASScxx . . $ `scripts/osiris_common.h:798:9`!, &mstruct); |
| 1171 | } |
| 1172 | |
| 1173 | /* |
| 1174 | Damage sound types |
| 1175 | $$ENUM DamageSoundType |
| 1176 | 0:None |
| 1177 | 1:Energy Weapon |
| 1178 | 2:Matter Weapon |
| 1179 | 3:Melee Attach |
| 1180 | 4:Concussive Force |
| 1181 | 5:Wall Hit |
| 1182 | $$END |
| 1183 | */ |
| 1184 | |
| 1185 | /* |
| 1186 | $$ACTION |
| 1187 | Rooms |
| 1188 | Set room [r:Room] damage to [f:Damage] with sound type [e:DamageSoundType] |
| 1189 | aRoomSetDamage |
| 1190 | Set room damage |
| 1191 | Sets the sepecifed room to damage the player |
| 1192 | |
| 1193 | Parameters: |
| 1194 | Room: The room that will cause the damage |
| 1195 | Damage: the damage rate, in shield units per second |
| 1196 | $$END |
| 1197 | */ |
| 1198 | void aRoomSetDamagecxx . . $ aRoomSetDamage(d6d7ce2c0b3115db).(int roomnum, float damage, int soundtype) { |
| 1199 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1200 | |
| 1201 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 1202 | mstruct.amountcxx . . $ msafe_struct#amount. = damage; |
| 1203 | mstruct.indexcxx . . $ msafe_struct#index. = soundtype; |
| 1204 | |
| 1205 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_DAMAGEcxx . . $ `scripts/osiris_common.h:793:9`!, &mstruct); |
| 1206 | } |
| 1207 | |
| 1208 | /* |
| 1209 | $$ACTION |
| 1210 | Misc |
| 1211 | Show HUD message [s:Message] |
| 1212 | aShowHUDMessage |
| 1213 | Show HUD message |
| 1214 | Shows a HUD message for all players |
| 1215 | |
| 1216 | Parameters: |
| 1217 | Message: The message to show |
| 1218 | $$END |
| 1219 | */ |
| 1220 | void aShowHUDMessagecxx . . $ aShowHUDMessage(326aeb464d16410c).(const char *format, ...) { |
| 1221 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1222 | va_list args; |
| 1223 | |
| 1224 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, format); |
| 1225 | stdcxx . . $ std/::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(mstruct.messagecxx . . $ msafe_struct#message., sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1, format, args); |
| 1226 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(args); |
| 1227 | mstruct.messagecxx . . $ msafe_struct#message.[sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1] = 0; // if message too long, vsnprintf() won't terminate |
| 1228 | |
| 1229 | mstruct.statecxx . . $ msafe_struct#state. = 0; // means all players |
| 1230 | mstruct.colorcxx . . $ msafe_struct#color. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 255, 0); |
| 1231 | |
| 1232 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_HUD_MESSAGEcxx . . $ `scripts/osiris_common.h:881:9`!, &mstruct); |
| 1233 | } |
| 1234 | |
| 1235 | /* |
| 1236 | $$ACTION |
| 1237 | Misc |
| 1238 | Show HUD message [s:Message] for player [o:PlayerObject=IT] |
| 1239 | aShowHUDMessageObj |
| 1240 | Show HUD message |
| 1241 | Shows a HUD message for a specific player |
| 1242 | |
| 1243 | Parameters: |
| 1244 | Message: The message to show |
| 1245 | PlayerObject: The player who sees the object |
| 1246 | $$END |
| 1247 | */ |
| 1248 | void aShowHUDMessageObjcxx . . $ aShowHUDMessageObj(8e3214043a6f5af8).(const char *format, int objhandle, ...) { |
| 1249 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1250 | va_list args; |
| 1251 | |
| 1252 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(args, objhandle); |
| 1253 | stdcxx . . $ std/::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(mstruct.messagecxx . . $ msafe_struct#message., sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1, format, args); |
| 1254 | va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); |
| 1255 | mstruct.messagecxx . . $ msafe_struct#message.[sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1] = 0; // if message too long, vsnprintf() won't terminate |
| 1256 | |
| 1257 | mstruct.statecxx . . $ msafe_struct#state. = 1; // means specific player |
| 1258 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = dfGetPlayercxx . . $ dfGetPlayer(7864480464b09eea).(objhandle); |
| 1259 | mstruct.colorcxx . . $ msafe_struct#color. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 255, 0); |
| 1260 | |
| 1261 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_HUD_MESSAGEcxx . . $ `scripts/osiris_common.h:881:9`!, &mstruct); |
| 1262 | } |
| 1263 | |
| 1264 | /* |
| 1265 | $$ACTION |
| 1266 | Misc |
| 1267 | Show Colored HUD message of color [i:Red] [i:Green] [i:Blue] saying [s:Message] |
| 1268 | aShowColoredHUDMessage |
| 1269 | Show Colored HUD message |
| 1270 | Shows a colored HUD message for all players |
| 1271 | |
| 1272 | Parameters: |
| 1273 | Red: Red component of color (0-255) |
| 1274 | Green: Green component of color (0-255) |
| 1275 | Blue: Blue component of color (0-255) |
| 1276 | Message: The message to show |
| 1277 | $$END |
| 1278 | */ |
| 1279 | void aShowColoredHUDMessagecxx . . $ aShowColoredHUDMessage(e6b86272566182ce).(int red, int green, int blue, const char *format, ...) { |
| 1280 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1281 | va_list args; |
| 1282 | |
| 1283 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, format); |
| 1284 | stdcxx . . $ std/::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(mstruct.messagecxx . . $ msafe_struct#message., sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1, format, args); |
| 1285 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(args); |
| 1286 | mstruct.messagecxx . . $ msafe_struct#message.[sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1] = 0; // if message too long, vsnprintf() won't terminate |
| 1287 | |
| 1288 | mstruct.statecxx . . $ msafe_struct#state. = 0; // means all players |
| 1289 | mstruct.colorcxx . . $ msafe_struct#color. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).((uint8_tcxx . . $ uint8_t#)red, (uint8_tcxx . . $ uint8_t#)green, (uint8_tcxx . . $ uint8_t#)blue); |
| 1290 | |
| 1291 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_HUD_MESSAGEcxx . . $ `scripts/osiris_common.h:881:9`!, &mstruct); |
| 1292 | } |
| 1293 | |
| 1294 | /* |
| 1295 | $$ACTION |
| 1296 | Misc |
| 1297 | Show Colored HUD message of color [i:Red] [i:Green] [i:Blue] saying [s:Message] for player [o:PlayerObject=IT] |
| 1298 | aShowColoredHUDMessageObj |
| 1299 | Show Colored HUD message |
| 1300 | Shows a colored HUD message for a specific player |
| 1301 | |
| 1302 | Parameters: |
| 1303 | Red: Red component of color (0-255) |
| 1304 | Green: Green component of color (0-255) |
| 1305 | Blue: Blue component of color (0-255) |
| 1306 | Message: The message to show |
| 1307 | PlayerObject: The player who sees the object |
| 1308 | $$END |
| 1309 | */ |
| 1310 | void aShowColoredHUDMessageObjcxx . . $ aShowColoredHUDMessageObj(54a540ddebed463b).(int red, int green, int blue, const char *format, int objhandle, ...) { |
| 1311 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1312 | va_list args; |
| 1313 | |
| 1314 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, objhandle); |
| 1315 | stdcxx . . $ std/::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(mstruct.messagecxx . . $ msafe_struct#message., sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1, format, args); |
| 1316 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(args); |
| 1317 | mstruct.messagecxx . . $ msafe_struct#message.[sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1] = 0; // if message too long, vsnprintf() won't terminate |
| 1318 | |
| 1319 | mstruct.statecxx . . $ msafe_struct#state. = 1; |
| 1320 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = dfGetPlayercxx . . $ dfGetPlayer(7864480464b09eea).(objhandle); |
| 1321 | mstruct.colorcxx . . $ msafe_struct#color. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).((uint8_tcxx . . $ uint8_t#)red, (uint8_tcxx . . $ uint8_t#)green, (uint8_tcxx . . $ uint8_t#)blue); |
| 1322 | |
| 1323 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_HUD_MESSAGEcxx . . $ `scripts/osiris_common.h:881:9`!, &mstruct); |
| 1324 | } |
| 1325 | |
| 1326 | /* |
| 1327 | $$ACTION |
| 1328 | Misc |
| 1329 | Add Game Message [s:GameMessage] with HUD mesage [s:HUDMessage] |
| 1330 | aAddGameMessage |
| 1331 | Add Game Message |
| 1332 | Adds a message to the game message log, and shows another message on the HUD |
| 1333 | |
| 1334 | Parameters: |
| 1335 | GameMessage: The message that's added to the game message log |
| 1336 | HUDMessage: The message that's displayed on the HUD |
| 1337 | $$END |
| 1338 | */ |
| 1339 | void aAddGameMessagecxx . . $ aAddGameMessage(2fa786934fe80e24).(const char *game_message, const char *hud_message) { |
| 1340 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1341 | |
| 1342 | strncpy(mstruct.messagecxx . . $ msafe_struct#message., game_message, sizeof(mstruct.messagecxx . . $ msafe_struct#message.)); |
| 1343 | mstruct.messagecxx . . $ msafe_struct#message.[sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1] = 0; |
| 1344 | |
| 1345 | strncpy(mstruct.message2cxx . . $ msafe_struct#message2., hud_message, sizeof(mstruct.message2cxx . . $ msafe_struct#message2.)); |
| 1346 | mstruct.messagecxx . . $ msafe_struct#message.[sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1] = 0; |
| 1347 | |
| 1348 | mstruct.colorcxx . . $ msafe_struct#color. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 242, 148); |
| 1349 | mstruct.statecxx . . $ msafe_struct#state. = 0; // means all players |
| 1350 | |
| 1351 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_GAME_MESSAGEcxx . . $ `scripts/osiris_common.h:886:9`!, &mstruct); |
| 1352 | } |
| 1353 | |
| 1354 | /* |
| 1355 | $$ACTION |
| 1356 | Weather |
| 1357 | Turn rain ON with density = [p:Density=0.5:0.0|1.0] |
| 1358 | aRainTurnOn |
| 1359 | Turn rain ON |
| 1360 | Turns on the rain |
| 1361 | |
| 1362 | Parameters: |
| 1363 | ?? |
| 1364 | $$END |
| 1365 | */ |
| 1366 | void aRainTurnOncxx . . $ aRainTurnOn(9364e6e7bff7660).(float density) { |
| 1367 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1368 | |
| 1369 | mstruct.scalarcxx . . $ msafe_struct#scalar. = density; |
| 1370 | mstruct.statecxx . . $ msafe_struct#state. = true; |
| 1371 | |
| 1372 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_WEATHER_RAINcxx . . $ `scripts/osiris_common.h:860:9`!, &mstruct); |
| 1373 | } |
| 1374 | |
| 1375 | /* |
| 1376 | $$ACTION |
| 1377 | Weather |
| 1378 | Turn rain OFF |
| 1379 | aRainTurnOff |
| 1380 | Turn rain OFF |
| 1381 | Turns off the rain |
| 1382 | |
| 1383 | Parameters: |
| 1384 | None. |
| 1385 | $$END |
| 1386 | */ |
| 1387 | void aRainTurnOffcxx . . $ aRainTurnOff(49f6e7a06ebc5aa8).() { |
| 1388 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1389 | |
| 1390 | mstruct.statecxx . . $ msafe_struct#state. = false; |
| 1391 | |
| 1392 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_WEATHER_RAINcxx . . $ `scripts/osiris_common.h:860:9`!, &mstruct); |
| 1393 | } |
| 1394 | |
| 1395 | /* |
| 1396 | $$ACTION |
| 1397 | Weather |
| 1398 | Turn snow ON with density = [p:Density=0.5:0.0|1.0] |
| 1399 | aSnowTurnOn |
| 1400 | Turn snow ON |
| 1401 | Turns on the snow |
| 1402 | |
| 1403 | Parameters: |
| 1404 | ?? |
| 1405 | $$END |
| 1406 | */ |
| 1407 | void aSnowTurnOncxx . . $ aSnowTurnOn(9364e6e7bff7660).(float density) { |
| 1408 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1409 | |
| 1410 | mstruct.scalarcxx . . $ msafe_struct#scalar. = density; |
| 1411 | mstruct.statecxx . . $ msafe_struct#state. = true; |
| 1412 | |
| 1413 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_WEATHER_SNOWcxx . . $ `scripts/osiris_common.h:861:9`!, &mstruct); |
| 1414 | } |
| 1415 | |
| 1416 | /* |
| 1417 | $$ACTION |
| 1418 | Weather |
| 1419 | Turn snow OFF |
| 1420 | aSnowTurnOff |
| 1421 | Turn snow OFF |
| 1422 | Turns off the snow |
| 1423 | |
| 1424 | Parameters: |
| 1425 | None |
| 1426 | $$END |
| 1427 | */ |
| 1428 | void aSnowTurnOffcxx . . $ aSnowTurnOff(49f6e7a06ebc5aa8).() { |
| 1429 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1430 | |
| 1431 | mstruct.statecxx . . $ msafe_struct#state. = false; |
| 1432 | |
| 1433 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_WEATHER_SNOWcxx . . $ `scripts/osiris_common.h:861:9`!, &mstruct); |
| 1434 | } |
| 1435 | |
| 1436 | /* |
| 1437 | $$ACTION |
| 1438 | Weather |
| 1439 | Turn lightning ON with frequency of [f:Seconds=5.0] and probability of [p:Probability=0.5] |
| 1440 | aLightningTurnOn |
| 1441 | Turn lightning ON |
| 1442 | Turns on the lightning |
| 1443 | |
| 1444 | Parameters: |
| 1445 | Seconds: How often to check to create lightning |
| 1446 | Probability: The chance of creating lightning at each check |
| 1447 | $$END |
| 1448 | */ |
| 1449 | void aLightningTurnOncxx . . $ aLightningTurnOn(5102ef758adc0ae7).(float check_delay, float prob) { |
| 1450 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1451 | |
| 1452 | mstruct.statecxx . . $ msafe_struct#state. = true; |
| 1453 | mstruct.scalarcxx . . $ msafe_struct#scalar. = check_delay; |
| 1454 | mstruct.randvalcxx . . $ msafe_struct#randval. = static_cast<int>(prob * static_cast<float>(RAND_MAXcxx . . $ `<external>/10696550936717951914/stdlib.h:87:9`!)); |
| 1455 | |
| 1456 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_WEATHER_LIGHTNINGcxx . . $ `scripts/osiris_common.h:862:9`!, &mstruct); |
| 1457 | } |
| 1458 | |
| 1459 | /* |
| 1460 | $$ACTION |
| 1461 | Weather |
| 1462 | Turn lightning OFF |
| 1463 | aLightningTurnOff |
| 1464 | Turn lightning OFF |
| 1465 | Turns off the lightning |
| 1466 | |
| 1467 | Parameters: |
| 1468 | None |
| 1469 | $$END |
| 1470 | */ |
| 1471 | void aLightningTurnOffcxx . . $ aLightningTurnOff(49f6e7a06ebc5aa8).() { |
| 1472 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1473 | |
| 1474 | mstruct.statecxx . . $ msafe_struct#state. = false; |
| 1475 | |
| 1476 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_WEATHER_LIGHTNINGcxx . . $ `scripts/osiris_common.h:862:9`!, &mstruct); |
| 1477 | } |
| 1478 | |
| 1479 | /* |
| 1480 | $$ACTION |
| 1481 | Weather |
| 1482 | Create lighting between [o:Object1] and [o:Object2]; with [f:Lifetime=1.0], [f:Thickness=1.0], [i:NumTiles=1], |
| 1483 | [u:Texture], [f:SlideTime=0], [i:TimesDrawn=1], and color=[i:Red=255],[i:Green=255],[i:Blue=255], |
| 1484 | AutoTile=[b:AutoTile=false] aLightningCreate Create lighting between two objects Creates a lighting effect between two |
| 1485 | specified obejcts |
| 1486 | |
| 1487 | Parameters: |
| 1488 | Object1, Object2: Where the lighting is created |
| 1489 | Lifetime: How long the lighting lasts |
| 1490 | Thickness: How thick the lightning is |
| 1491 | NumTiles: How many times to tile the texture within the bolt |
| 1492 | Texture: The texture to be used for the lighting |
| 1493 | SlideTime: The time it will take to slide the entire bolt once |
| 1494 | TimesDrawn: The number of times to draw the bolt (saturation) |
| 1495 | Red, Green, Blue: The color of the lighting (0-255) |
| 1496 | AutoTile - For automatic UV tiling based on the length of the bolt |
| 1497 | $$END |
| 1498 | */ |
| 1499 | void aLightningCreatecxx . . $ aLightningCreate(485de53fc2b521b2).(int objhandle1, int objhandle2, float lifetime, float thickness, int numtiles, int texture_id, |
| 1500 | float slidetime, int timesdrawn, int red, int green, int blue, bool autotile) { |
| 1501 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1502 | int type; |
| 1503 | |
| 1504 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objhandle1, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_I_TYPEcxx . . $ `scripts/osiris_common.h:626:9`!, &type); |
| 1505 | if (type == OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!) |
| 1506 | return; |
| 1507 | |
| 1508 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objhandle2, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_I_TYPEcxx . . $ `scripts/osiris_common.h:626:9`!, &type); |
| 1509 | if (type == OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!) |
| 1510 | return; |
| 1511 | |
| 1512 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objhandle1, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_I_ROOMNUMcxx . . $ `scripts/osiris_common.h:630:9`!, &mstruct.roomnumcxx . . $ msafe_struct#roomnum.); |
| 1513 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objhandle1, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_V_POScxx . . $ `scripts/osiris_common.h:628:9`!, &mstruct.poscxx . . $ msafe_struct#pos.); |
| 1514 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objhandle2, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_V_POScxx . . $ `scripts/osiris_common.h:628:9`!, &mstruct.pos2cxx . . $ msafe_struct#pos2.); |
| 1515 | |
| 1516 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle1; |
| 1517 | mstruct.ithandlecxx . . $ msafe_struct#ithandle. = objhandle2; |
| 1518 | mstruct.lifetimecxx . . $ msafe_struct#lifetime. = lifetime; |
| 1519 | mstruct.sizecxx . . $ msafe_struct#size. = thickness; |
| 1520 | |
| 1521 | mstruct.intervalcxx . . $ msafe_struct#interval. = slidetime; |
| 1522 | mstruct.countcxx . . $ msafe_struct#count. = timesdrawn; |
| 1523 | mstruct.indexcxx . . $ msafe_struct#index. = numtiles; |
| 1524 | mstruct.texnumcxx . . $ msafe_struct#texnum. = texture_id; |
| 1525 | mstruct.colorcxx . . $ msafe_struct#color. = ((red >> 3) << 10) | ((green >> 3) << 5) | (blue >> 3); |
| 1526 | |
| 1527 | if (autotile) |
| 1528 | mstruct.statecxx . . $ msafe_struct#state. = 1; |
| 1529 | else |
| 1530 | mstruct.statecxx . . $ msafe_struct#state. = 0; |
| 1531 | |
| 1532 | mstruct.flagscxx . . $ msafe_struct#flags. = 0; |
| 1533 | |
| 1534 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_WEATHER_LIGHTNING_BOLTcxx . . $ `scripts/osiris_common.h:863:9`!, &mstruct); |
| 1535 | } |
| 1536 | |
| 1537 | /* |
| 1538 | $$ACTION |
| 1539 | Weather |
| 1540 | Create lighting between gunpoints [i:Gunpoint1=0] & [i:Gunpoint2=1] of [o:Object=OWNER]; with [f:Lifetime=1.0], |
| 1541 | [f:Thickness=1.0], [i:NumTiles=1], [u:Texture], [f:SlideTime=0], [i:TimesDrawn=1], and |
| 1542 | color=[i:Red=255],[i:Green=255],[i:Blue=255], AutoTile=[b:AutoTile=false] aLightningCreateGunpoints Create lighting |
| 1543 | between gunpoints Creates a lighting effect between two specified gunpoints on an object |
| 1544 | |
| 1545 | Parameters: |
| 1546 | Object: Where the lighting is created |
| 1547 | Gunpoint1,Gunpoint2: The points between which the lightning is created |
| 1548 | Lifetime: How long the lighting lasts |
| 1549 | Thickness: How thick the lightning is |
| 1550 | NumTiles: How many times to tile the texture within the bolt |
| 1551 | Texture: The texture to be used for the lighting |
| 1552 | SlideTime: The time it will take to slide the entire bolt once |
| 1553 | TimesDrawn: The number of times to draw the bolt (saturation) |
| 1554 | Red, Green, Blue: The color of the lighting (0-255) |
| 1555 | AutoTile - For automatic UV tiling based on the length of the bolt |
| 1556 | $$END |
| 1557 | */ |
| 1558 | void aLightningCreateGunpointscxx . . $ aLightningCreateGunpoints(fefaa2133ec6ef6d).(int gunpoint1, int gunpoint2, int objhandle, float lifetime, float thickness, |
| 1559 | int numtiles, int texture_id, float slidetime, int timesdrawn, int red, int green, |
| 1560 | int blue, bool autotile) { |
| 1561 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1562 | |
| 1563 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 1564 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 1565 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ROOMNUMcxx . . $ `scripts/osiris_common.h:822:9`!, &mstruct); |
| 1566 | if (mstruct.roomnumcxx . . $ msafe_struct#roomnum. == -1) |
| 1567 | return; |
| 1568 | |
| 1569 | mstruct.g1cxx . . $ msafe_struct#g1. = gunpoint1; |
| 1570 | mstruct.g2cxx . . $ msafe_struct#g2. = gunpoint2; |
| 1571 | |
| 1572 | mstruct.lifetimecxx . . $ msafe_struct#lifetime. = lifetime; |
| 1573 | mstruct.sizecxx . . $ msafe_struct#size. = thickness; |
| 1574 | mstruct.intervalcxx . . $ msafe_struct#interval. = slidetime; |
| 1575 | mstruct.countcxx . . $ msafe_struct#count. = timesdrawn; |
| 1576 | mstruct.indexcxx . . $ msafe_struct#index. = numtiles; |
| 1577 | mstruct.texnumcxx . . $ msafe_struct#texnum. = texture_id; |
| 1578 | mstruct.colorcxx . . $ msafe_struct#color. = ((red >> 3) << 10) | ((green >> 3) << 5) | (blue >> 3); |
| 1579 | |
| 1580 | if (autotile) |
| 1581 | mstruct.statecxx . . $ msafe_struct#state. = 1; |
| 1582 | else |
| 1583 | mstruct.statecxx . . $ msafe_struct#state. = 0; |
| 1584 | |
| 1585 | mstruct.flagscxx . . $ msafe_struct#flags. = 1; |
| 1586 | |
| 1587 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_WEATHER_LIGHTNING_BOLTcxx . . $ `scripts/osiris_common.h:863:9`!, &mstruct); |
| 1588 | } |
| 1589 | |
| 1590 | /* |
| 1591 | $$ACTION |
| 1592 | User Vars |
| 1593 | Set user flag [e:UserFlag] to [b:True/False] |
| 1594 | aUserFlagSet |
| 1595 | Set user flag |
| 1596 | Set a flag to true or flase |
| 1597 | |
| 1598 | Parameters: |
| 1599 | UserFlag: The variable to set |
| 1600 | True/False: What to set the flag to |
| 1601 | $$END |
| 1602 | */ |
| 1603 | void aUserFlagSetcxx . . $ aUserFlagSet(918ebd27a9ddbad3).(int flagnum, bool state) { |
| 1604 | if ((flagnum >= 0) && (flagnum < 32)) { |
| 1605 | int bit = 1 << flagnum; |
| 1606 | if (state) |
| 1607 | User_flagscxx . . $ User_flags. |= bit; |
| 1608 | else |
| 1609 | User_flagscxx . . $ User_flags. &= ~bit; |
| 1610 | } |
| 1611 | } |
| 1612 | |
| 1613 | /* |
| 1614 | $$ACTION |
| 1615 | User Vars |
| 1616 | Set user var [e:UserVar] to [f:value] |
| 1617 | aUserVarSet |
| 1618 | Set user var |
| 1619 | Set a user variable to specific value |
| 1620 | |
| 1621 | Parameters: |
| 1622 | UserVar: The variable to set |
| 1623 | Value: The value assigned to the variable |
| 1624 | $$END |
| 1625 | */ |
| 1626 | void aUserVarSetcxx . . $ aUserVarSet(43c79ee2f1b9aefe).(int varnum, float value) { |
| 1627 | if ((varnum >= 0) && (varnum < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!)) |
| 1628 | User_varscxx . . $ User_vars.[varnum] = value; |
| 1629 | } |
| 1630 | |
| 1631 | /* |
| 1632 | $$ACTION |
| 1633 | User Vars |
| 1634 | Increment user var [e:UserVar] |
| 1635 | aUserVarInc |
| 1636 | Increment user var |
| 1637 | Adds one to a user variable |
| 1638 | |
| 1639 | Parameters: |
| 1640 | UserVar: The variable to increment |
| 1641 | $$END |
| 1642 | */ |
| 1643 | void aUserVarInccxx . . $ aUserVarInc(d4f767463ce0a6b3).(int varnum) { |
| 1644 | if ((varnum >= 0) && (varnum < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!)) |
| 1645 | User_varscxx . . $ User_vars.[varnum]++; |
| 1646 | } |
| 1647 | |
| 1648 | /* |
| 1649 | $$ACTION |
| 1650 | User Vars |
| 1651 | Decrement user var [e:UserVar] |
| 1652 | aUserVarDec |
| 1653 | Decrement user var |
| 1654 | Subtracts one to a user variable |
| 1655 | |
| 1656 | Parameters: |
| 1657 | UserVar: The variable to decrement |
| 1658 | $$END |
| 1659 | */ |
| 1660 | void aUserVarDeccxx . . $ aUserVarDec(d4f767463ce0a6b3).(int varnum) { |
| 1661 | if ((varnum >= 0) && (varnum < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!)) |
| 1662 | User_varscxx . . $ User_vars.[varnum]--; |
| 1663 | } |
| 1664 | |
| 1665 | /* |
| 1666 | $$ACTION |
| 1667 | User Vars |
| 1668 | Add [f:value] to user var [e:UserVar] |
| 1669 | aUserVarAdd |
| 1670 | Add to user var |
| 1671 | Adds to a user variable |
| 1672 | |
| 1673 | Parameters: |
| 1674 | Value: The amount to add to the user variable |
| 1675 | UserVar: The variable to be modified |
| 1676 | $$END |
| 1677 | */ |
| 1678 | void aUserVarAddcxx . . $ aUserVarAdd(1746e8aa98ca1bc0).(float value, int varnum) { |
| 1679 | if ((varnum >= 0) && (varnum < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!)) |
| 1680 | User_varscxx . . $ User_vars.[varnum] += value; |
| 1681 | } |
| 1682 | |
| 1683 | /* |
| 1684 | $$ACTION |
| 1685 | User Vars |
| 1686 | Subtract [f:value] from user var [e:UserVar] |
| 1687 | aUserVarSub |
| 1688 | Subtract from user var |
| 1689 | Subtracts from a user variable |
| 1690 | |
| 1691 | Parameters: |
| 1692 | Value: The amount to subtract from the user variable |
| 1693 | UserVar: The variable to be modified |
| 1694 | $$END |
| 1695 | */ |
| 1696 | void aUserVarSubcxx . . $ aUserVarSub(1746e8aa98ca1bc0).(float value, int varnum) { |
| 1697 | if ((varnum >= 0) && (varnum < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!)) |
| 1698 | User_varscxx . . $ User_vars.[varnum] -= value; |
| 1699 | } |
| 1700 | |
| 1701 | /* |
| 1702 | $$ENUM Lock/Unlock |
| 1703 | 0:UNLOCK |
| 1704 | 1:LOCK |
| 1705 | $$END |
| 1706 | */ |
| 1707 | |
| 1708 | /* |
| 1709 | $$ACTION |
| 1710 | Doors |
| 1711 | [e:Lock/Unlock] door [d:DoorName] |
| 1712 | aDoorLockUnlock |
| 1713 | Lock/Unlock door |
| 1714 | Locks or unlocks the specified door |
| 1715 | |
| 1716 | Parameters: |
| 1717 | DoorName: the object name of the door to be locked or unlocked |
| 1718 | $$END |
| 1719 | */ |
| 1720 | void aDoorLockUnlockcxx . . $ aDoorLockUnlock(3e454b8ccf442868).(int state, int objref) { |
| 1721 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1722 | |
| 1723 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 1724 | mstruct.statecxx . . $ msafe_struct#state. = state; |
| 1725 | |
| 1726 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_DOOR_LOCK_STATEcxx . . $ `scripts/osiris_common.h:873:9`!, &mstruct); |
| 1727 | } |
| 1728 | |
| 1729 | /* |
| 1730 | $$ACTION |
| 1731 | Doors |
| 1732 | Activate door [d:Door] |
| 1733 | aDoorActivate |
| 1734 | Activate door |
| 1735 | Activates (i.e. opens and possibly closes) the specified door |
| 1736 | |
| 1737 | Parameters: |
| 1738 | Door: the object of the door to be activated |
| 1739 | $$END |
| 1740 | */ |
| 1741 | void aDoorActivatecxx . . $ aDoorActivate(d4f767463ce0a6b3).(int objref) { |
| 1742 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1743 | |
| 1744 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 1745 | |
| 1746 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_DOOR_ACTIVATEcxx . . $ `scripts/osiris_common.h:874:9`!, &mstruct); |
| 1747 | } |
| 1748 | |
| 1749 | /* |
| 1750 | $$ACTION |
| 1751 | Doors |
| 1752 | Set door [d:Door] position to [p:Position] |
| 1753 | aDoorSetPos |
| 1754 | Set door position |
| 1755 | Moves the door to the specified position |
| 1756 | |
| 1757 | Parameters: |
| 1758 | Door: the object of the door to be set |
| 1759 | Position: the position of the door, with 0% being fully closed and 100% fully open |
| 1760 | $$END |
| 1761 | */ |
| 1762 | void aDoorSetPoscxx . . $ aDoorSetPos(43c79ee2f1b9aefe).(int objhandle, float pos) { |
| 1763 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1764 | |
| 1765 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 1766 | mstruct.scalarcxx . . $ msafe_struct#scalar. = pos; |
| 1767 | |
| 1768 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_DOOR_POSITIONcxx . . $ `scripts/osiris_common.h:875:9`!, &mstruct); |
| 1769 | } |
| 1770 | |
| 1771 | /* |
| 1772 | $$ACTION |
| 1773 | Doors |
| 1774 | Stop door [d:Door] |
| 1775 | aDoorStop |
| 1776 | Stop door |
| 1777 | Stops the specified door if it's animating |
| 1778 | |
| 1779 | Parameters: |
| 1780 | Door: the object of the door to stop |
| 1781 | $$END |
| 1782 | */ |
| 1783 | void aDoorStopcxx . . $ aDoorStop(d4f767463ce0a6b3).(int objhandle) { |
| 1784 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1785 | |
| 1786 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 1787 | |
| 1788 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_DOOR_STOPcxx . . $ `scripts/osiris_common.h:876:9`!, &mstruct); |
| 1789 | } |
| 1790 | |
| 1791 | /* |
| 1792 | $$ACTION |
| 1793 | Misc |
| 1794 | Create Popup View at gunpoint [i:GunPoint] of [o:Object] for [f:Time=10.0] seconds with zoom [f:Zoom=1.0] |
| 1795 | aCreatePopupView |
| 1796 | Creates a temorary view window |
| 1797 | |
| 1798 | Parameters: |
| 1799 | GunPoint: the gun number where the viewer should be placed |
| 1800 | Object: the object that is the viewer |
| 1801 | Time: how long the view lasts. If time set to 0, popup stays up until explicitly closed. |
| 1802 | Zoom: the relative zoom of the viewer camera. 1.0 is the normal zoom. |
| 1803 | $$END |
| 1804 | */ |
| 1805 | void aCreatePopupViewcxx . . $ aCreatePopupView(aef2b8561d239819).(int gunpoint, int objref, float time, float zoom) { |
| 1806 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1807 | |
| 1808 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 1809 | mstruct.intervalcxx . . $ msafe_struct#interval. = time; |
| 1810 | mstruct.gunpointcxx . . $ msafe_struct#gunpoint. = gunpoint; |
| 1811 | mstruct.scalarcxx . . $ msafe_struct#scalar. = zoom; |
| 1812 | |
| 1813 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_POPUP_CAMERAcxx . . $ `scripts/osiris_common.h:884:9`!, &mstruct); |
| 1814 | } |
| 1815 | |
| 1816 | /* |
| 1817 | $$ACTION |
| 1818 | Misc |
| 1819 | Close the popup view |
| 1820 | aClosePopupView |
| 1821 | Closes the popup view, if it's up |
| 1822 | |
| 1823 | Parameters: |
| 1824 | None. |
| 1825 | $$END |
| 1826 | */ |
| 1827 | void aClosePopupViewcxx . . $ aClosePopupView(49f6e7a06ebc5aa8).() { MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_CLOSE_POPUPcxx . . $ `scripts/osiris_common.h:885:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); } |
| 1828 | |
| 1829 | /* |
| 1830 | $$ACTION |
| 1831 | Objects |
| 1832 | Set object [o:Object] shields to [f:Shields] |
| 1833 | aObjSetShields |
| 1834 | Set object shields |
| 1835 | Sets an object's shields to a specific value |
| 1836 | |
| 1837 | Parameters: |
| 1838 | Object: the object whose shields are being set |
| 1839 | Shields: the value to assign to the object's shields |
| 1840 | $$END |
| 1841 | */ |
| 1842 | void aObjSetShieldscxx . . $ aObjSetShields(43c79ee2f1b9aefe).(int objref, float shields) { |
| 1843 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1844 | |
| 1845 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 1846 | mstruct.shieldscxx . . $ msafe_struct#shields. = shields; |
| 1847 | |
| 1848 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_SHIELDScxx . . $ `scripts/osiris_common.h:802:9`!, &mstruct); |
| 1849 | } |
| 1850 | |
| 1851 | /* |
| 1852 | $$ACTION |
| 1853 | Objects |
| 1854 | Set object [o:Object] energy to [f:Energy] |
| 1855 | aObjSetEnergy |
| 1856 | Set object energy |
| 1857 | Sets an object's energy to a specific value |
| 1858 | |
| 1859 | Parameters: |
| 1860 | Object: the object whose energy are being set |
| 1861 | Energy: the value to assign to the object's energy |
| 1862 | $$END |
| 1863 | */ |
| 1864 | void aObjSetEnergycxx . . $ aObjSetEnergy(43c79ee2f1b9aefe).(int objref, float energy) { |
| 1865 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1866 | |
| 1867 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 1868 | mstruct.energycxx . . $ msafe_struct#energy. = energy; |
| 1869 | |
| 1870 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_ENERGYcxx . . $ `scripts/osiris_common.h:803:9`!, &mstruct); |
| 1871 | } |
| 1872 | |
| 1873 | /* |
| 1874 | $$ACTION |
| 1875 | Objects |
| 1876 | Play object [o:Object] animation from frame [i:StartFrame] to [i:EndFrame=1], cycle time = [f:CycleTime=1.0], looping = |
| 1877 | [b:Looping=FALSE] aObjPlayAnim Play object animation Plays an animation for an object |
| 1878 | |
| 1879 | Parameters: |
| 1880 | Object: the object to animate |
| 1881 | StartFrame: the frame number of the start of the animation |
| 1882 | EndFrame: the frame number of the end of the animation |
| 1883 | CycleTime: how long the entire animation takes |
| 1884 | Looping: if true, animation repeats. If false, animation plays once |
| 1885 | $$END |
| 1886 | */ |
| 1887 | void aObjPlayAnimcxx . . $ aObjPlayAnim(db8fec34dcd7c607).(int objref, int startframe, int endframe, float cycletime, bool looping) { |
| 1888 | int flags = 0; |
| 1889 | |
| 1890 | if (looping) |
| 1891 | flags |= AIAF_LOOPINGcxx . . $ `Descent3/aistruct_external.h:115:9`!; |
| 1892 | |
| 1893 | Obj_SetCustomAnimcxx . . $ Obj_SetCustomAnim(d2ce4cea4bbae452).(objref, (float)startframe, (float)endframe, cycletime, flags, -1, -1); |
| 1894 | } |
| 1895 | |
| 1896 | /* |
| 1897 | $$ACTION |
| 1898 | Objects |
| 1899 | Damage object [o:Object] by [f:DamageAmount] |
| 1900 | aObjApplyDamage |
| 1901 | Damage object |
| 1902 | Applies damage to an object |
| 1903 | |
| 1904 | Parameters: |
| 1905 | Object: the object to damage |
| 1906 | DamageAmount: how much damage to apply to the object (scaled by difficulty level) |
| 1907 | $$END |
| 1908 | */ |
| 1909 | void aObjApplyDamagecxx . . $ aObjApplyDamage(43c79ee2f1b9aefe).(int objref, float damage) { |
| 1910 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 1911 | |
| 1912 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 1913 | mstruct.killer_handlecxx . . $ msafe_struct#killer_handle. = objref; |
| 1914 | mstruct.damage_typecxx . . $ msafe_struct#damage_type. = 0; |
| 1915 | mstruct.amountcxx . . $ msafe_struct#amount. = damage; |
| 1916 | |
| 1917 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_DAMAGE_OBJECTcxx . . $ `scripts/osiris_common.h:811:9`!, &mstruct); |
| 1918 | } |
| 1919 | |
| 1920 | /* |
| 1921 | Death info |
| 1922 | |
| 1923 | $$ENUM DeathDelayType |
| 1924 | 0:No Delay |
| 1925 | 1:Delay Min/Max |
| 1926 | 2:Delay from Anim |
| 1927 | $$END |
| 1928 | |
| 1929 | $$ENUM DeathExplosionSize |
| 1930 | 0:Small |
| 1931 | 1:Medium |
| 1932 | 2:Large |
| 1933 | $$END |
| 1934 | |
| 1935 | $$FLAG DeathFlags |
| 1936 | 4:During Delay: Sparks |
| 1937 | 8:During Delay: Loses anti-grav |
| 1938 | 16:During Delay: Smokes |
| 1939 | 1048576:During Delay: Flies in air |
| 1940 | 2097152:During Delay: Fireballs |
| 1941 | 4194304:During Delay: Fades away |
| 1942 | 32:On Death: Fireballs |
| 1943 | 64:On Death: Breaks apart |
| 1944 | 128:On Death: Blast ring |
| 1945 | 256:On Death: Remains |
| 1946 | 512:On Death: Loses anti-grav |
| 1947 | 8388608:On Death: Fades away |
| 1948 | 4096:On Contact: Fireball |
| 1949 | 8192:On Contact: Breaks apart |
| 1950 | 16384:On Contact: Blask ring |
| 1951 | 32768:On Contact: Remains |
| 1952 | 65536:Debris: Smokes |
| 1953 | 131072:Debris Death: Fireball |
| 1954 | 262144:Debris Death: Blast ring |
| 1955 | 524288:Debris Death: Remains |
| 1956 | $$END |
| 1957 | |
| 1958 | $$ACTION |
| 1959 | Objects |
| 1960 | Kill object [o:Object]; delay type = [e:DeathDelayType], explosion size = [e:DeathExplosionSize], death flags = |
| 1961 | [g:DeathFlags], Min/Max delay = [f:MinDelay] / [f:MaxDelay] aObjKill Kill Object Kills the specified object using the |
| 1962 | specified death info |
| 1963 | |
| 1964 | Parameters: |
| 1965 | Object: the object to kill |
| 1966 | $$END |
| 1967 | */ |
| 1968 | void aObjKillcxx . . $ aObjKill(6d4df84d66905e21).(int objhandle, int delay_type, int expl_size, int death_flags, float min_delay, float max_delay) { |
| 1969 | death_flags |= (expl_size << DF_EXPL_SIZE_SHIFTcxx . . $ `Descent3/deathinfo_external.h:89:9`!); |
| 1970 | |
| 1971 | if (delay_type == 2) |
| 1972 | death_flags |= DF_DELAY_FROM_ANIMcxx . . $ `Descent3/deathinfo_external.h:67:9`!; |
| 1973 | |
| 1974 | if (delay_type == 0) |
| 1975 | min_delay = max_delay = 0; |
| 1976 | |
| 1977 | Obj_Killcxx . . $ Obj_Kill.(objhandle, OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!, 1000.0f, death_flags, min_delay, max_delay); |
| 1978 | } |
| 1979 | |
| 1980 | /* |
| 1981 | $$ACTION |
| 1982 | Objects |
| 1983 | Kill object [o:Object] with its default death |
| 1984 | aObjDestroy |
| 1985 | Kill Object with default death |
| 1986 | Kills the specified object using the object's default death |
| 1987 | |
| 1988 | Parameters: |
| 1989 | Object: the object to kill |
| 1990 | $$END |
| 1991 | */ |
| 1992 | void aObjDestroycxx . . $ aObjDestroy(d4f767463ce0a6b3).(int objhandle) { Obj_Killcxx . . $ Obj_Kill.(objhandle, OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!, 1000.0f, -1, 0.0, 0.0); } |
| 1993 | |
| 1994 | /* |
| 1995 | $$ACTION |
| 1996 | Objects |
| 1997 | Delete object [o:Object] |
| 1998 | aObjDelete |
| 1999 | Delete Object |
| 2000 | Delete the specified object. The object disappears with no death. |
| 2001 | |
| 2002 | Parameters: |
| 2003 | Object: the object to delete |
| 2004 | $$END |
| 2005 | */ |
| 2006 | void aObjDeletecxx . . $ aObjDelete(d4f767463ce0a6b3).(int objhandle) { |
| 2007 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2008 | |
| 2009 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 2010 | mstruct.playsoundcxx . . $ msafe_struct#playsound. = 0; |
| 2011 | |
| 2012 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_REMOVEcxx . . $ `scripts/osiris_common.h:819:9`!, &mstruct); |
| 2013 | } |
| 2014 | |
| 2015 | /* |
| 2016 | $$ACTION |
| 2017 | Objects |
| 2018 | Set object [o:Object] lighting distance to [f:Distance] |
| 2019 | aObjSetLightingDist |
| 2020 | Set object lighting distance |
| 2021 | Sets the lighting distance for an object |
| 2022 | |
| 2023 | Parameters: |
| 2024 | Object: the object to set |
| 2025 | Distance: how far the light from the object will cast |
| 2026 | $$END |
| 2027 | */ |
| 2028 | void aObjSetLightingDistcxx . . $ aObjSetLightingDist(43c79ee2f1b9aefe).(int objhandle, float dist) { |
| 2029 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2030 | |
| 2031 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 2032 | mstruct.light_distancecxx . . $ msafe_struct#light_distance. = dist; |
| 2033 | |
| 2034 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_LIGHT_DISTcxx . . $ `scripts/osiris_common.h:841:9`!, &mstruct); |
| 2035 | } |
| 2036 | |
| 2037 | /* |
| 2038 | $$ACTION |
| 2039 | Objects |
| 2040 | Set object [o:Object] lighting color = [f:Red=0.5],[f:Green=0.5],[f:Blue=0.5] |
| 2041 | aObjSetLightingColor |
| 2042 | Set object lighting color |
| 2043 | Sets the lighting color for an object |
| 2044 | |
| 2045 | Parameters: |
| 2046 | Object: the object to set |
| 2047 | R,G,B: the fog color (0.0 to 1.0 for each of R,G, & B) |
| 2048 | $$END |
| 2049 | */ |
| 2050 | void aObjSetLightingColorcxx . . $ aObjSetLightingColor(a8f6e5be37b619e5).(int objhandle, float r, float g, float b) { |
| 2051 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2052 | |
| 2053 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 2054 | mstruct.r1cxx . . $ msafe_struct#r1. = r; |
| 2055 | mstruct.g1cxx . . $ msafe_struct#g1. = g; |
| 2056 | mstruct.b1cxx . . $ msafe_struct#b1. = b; |
| 2057 | |
| 2058 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_LIGHT_COLORcxx . . $ `scripts/osiris_common.h:805:9`!, &mstruct); |
| 2059 | } |
| 2060 | |
| 2061 | /* |
| 2062 | $$ACTION |
| 2063 | Objects |
| 2064 | [e:Enable/Disable] gravity for object [o:Object] |
| 2065 | aObjGravityEnable |
| 2066 | Enable/Disable object gravity |
| 2067 | Enable or Disable gravity for the specified object |
| 2068 | |
| 2069 | Parameters: |
| 2070 | Enable/Disable: whether gravity should be on or off |
| 2071 | Object: the object to set |
| 2072 | $$END |
| 2073 | */ |
| 2074 | void aObjGravityEnablecxx . . $ aObjGravityEnable(3e454b8ccf442868).(int enable, int objhandle) { |
| 2075 | int flags = PF_GRAVITYcxx . . $ `Descent3/object_external.h:320:9`!; |
| 2076 | |
| 2077 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objhandle, enable ? VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`! : VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, OBJV_I_PHYSICS_FLAGScxx . . $ `scripts/osiris_common.h:641:9`!, &flags); |
| 2078 | } |
| 2079 | |
| 2080 | /* |
| 2081 | Object movement types |
| 2082 | $$ENUM MovementType |
| 2083 | 0:None |
| 2084 | 1:Physics |
| 2085 | 2:Walking |
| 2086 | $$END |
| 2087 | */ |
| 2088 | |
| 2089 | /* |
| 2090 | $$ACTION |
| 2091 | Objects |
| 2092 | Set movement type for [o:Object] to [e:MovementType] |
| 2093 | aObjSetMovementType |
| 2094 | Set movement type for object |
| 2095 | Sets the movement type for an object |
| 2096 | |
| 2097 | Parameters: |
| 2098 | Object: the object to set |
| 2099 | MovementType: how this object moves |
| 2100 | $$END |
| 2101 | */ |
| 2102 | void aObjSetMovementTypecxx . . $ aObjSetMovementType(3e454b8ccf442868).(int objhandle, int mtype) { Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objhandle, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, OBJV_C_MOVEMENT_TYPEcxx . . $ `scripts/osiris_common.h:638:9`!, &mtype); } |
| 2103 | |
| 2104 | /* |
| 2105 | $$ACTION |
| 2106 | Objects |
| 2107 | Set object [o:Object] movement direction = <[f:X],[f:Y],[f:Z]>, speed = [f:Speed=1.0] |
| 2108 | aObjSetVelocity |
| 2109 | Set object movement direction and speed |
| 2110 | Sets the movement direction and speed for an object |
| 2111 | |
| 2112 | Parameters: |
| 2113 | Object: the object to set |
| 2114 | X,Y,Z: the direction vector for the wind |
| 2115 | Speed: the speed of the wind (10.0 is faster than the player ship) |
| 2116 | $$END |
| 2117 | */ |
| 2118 | void aObjSetVelocitycxx . . $ aObjSetVelocity(c31bc224e645f73e).(int objhandle, float x, float y, float z, float speed) { |
| 2119 | vectorcxx . . $ vector# velocity; |
| 2120 | |
| 2121 | velocity.xcxx . . $ vector#x. = x * speed; |
| 2122 | velocity.ycxx . . $ vector#y. = y * speed; |
| 2123 | velocity.zcxx . . $ vector#z. = z * speed; |
| 2124 | |
| 2125 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objhandle, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, OBJV_V_VELOCITYcxx . . $ `scripts/osiris_common.h:631:9`!, &velocity); |
| 2126 | } |
| 2127 | |
| 2128 | /* |
| 2129 | $$ACTION |
| 2130 | Rooms |
| 2131 | Turn [e:On/Off] Strobe in room [r:Room] |
| 2132 | aRoomSetLightingStrobe |
| 2133 | Turn On/Off strobe in room |
| 2134 | Turns on or off the light stobe in a room |
| 2135 | |
| 2136 | Parameters: |
| 2137 | On/Off: whether the stobe should be on or off |
| 2138 | Room: the room to set |
| 2139 | $$END |
| 2140 | */ |
| 2141 | void aRoomSetLightingStrobecxx . . $ aRoomSetLightingStrobe(3e454b8ccf442868).(int state, int roomnum) { |
| 2142 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2143 | |
| 2144 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 2145 | mstruct.statecxx . . $ msafe_struct#state. = state; |
| 2146 | |
| 2147 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_LIGHT_STROBEcxx . . $ `scripts/osiris_common.h:795:9`!, &mstruct); |
| 2148 | } |
| 2149 | |
| 2150 | /* |
| 2151 | $$ACTION |
| 2152 | Rooms |
| 2153 | Turn [e:On/Off] Flicker in room [r:Room] |
| 2154 | aRoomSetLightingFlicker |
| 2155 | Turn On/Off flicker in room |
| 2156 | Turns on or off the light flicker in a room |
| 2157 | |
| 2158 | Parameters: |
| 2159 | On/Off: whether the flicker should be on or off |
| 2160 | Room: the room to set |
| 2161 | $$END |
| 2162 | */ |
| 2163 | void aRoomSetLightingFlickercxx . . $ aRoomSetLightingFlicker(3e454b8ccf442868).(int state, int roomnum) { |
| 2164 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2165 | |
| 2166 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 2167 | mstruct.statecxx . . $ msafe_struct#state. = state; |
| 2168 | |
| 2169 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_LIGHT_FLICKERcxx . . $ `scripts/osiris_common.h:794:9`!, &mstruct); |
| 2170 | } |
| 2171 | |
| 2172 | /* |
| 2173 | $$ACTION |
| 2174 | Rooms |
| 2175 | Turn [e:On/Off] fuelcen in room [r:Room] |
| 2176 | aRoomSetFuelcen |
| 2177 | Turn On/Off fuelcen in room |
| 2178 | Turns on or off the fuelcen in a room |
| 2179 | |
| 2180 | Parameters: |
| 2181 | On/Off: whether the fuelcen should be on or off |
| 2182 | Room: the room to set |
| 2183 | $$END |
| 2184 | */ |
| 2185 | void aRoomSetFuelcencxx . . $ aRoomSetFuelcen(3e454b8ccf442868).(int state, int roomnum) { |
| 2186 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2187 | |
| 2188 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 2189 | mstruct.statecxx . . $ msafe_struct#state. = state; |
| 2190 | |
| 2191 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_REFUELcxx . . $ `scripts/osiris_common.h:796:9`!, &mstruct); |
| 2192 | } |
| 2193 | |
| 2194 | /* |
| 2195 | $$ACTION |
| 2196 | Rooms |
| 2197 | Set room [r:Room] lighting pulse time = [f:PulseTime] offset = [f:PulseOffset] |
| 2198 | aRoomSetLightingPulse |
| 2199 | Set room lighting pulse values |
| 2200 | Sets the lighting pulse values for a room |
| 2201 | |
| 2202 | Parameters: |
| 2203 | Room: the room to set |
| 2204 | PulseTime: how long a pulse cycle takes, or 0 to turn off pulse |
| 2205 | PulseOffset: the time offset for this pulse |
| 2206 | $$END |
| 2207 | */ |
| 2208 | void aRoomSetLightingPulsecxx . . $ aRoomSetLightingPulse(3b3943b4e4191a93).(int roomnum, float time, float offset) { |
| 2209 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2210 | |
| 2211 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 2212 | mstruct.pulse_timecxx . . $ msafe_struct#pulse_time. = (uint8_tcxx . . $ uint8_t#)(time * 100); |
| 2213 | mstruct.pulse_offsetcxx . . $ msafe_struct#pulse_offset. = (uint8_tcxx . . $ uint8_t#)(offset * 100); |
| 2214 | |
| 2215 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_LIGHT_PULSEcxx . . $ `scripts/osiris_common.h:788:9`!, &mstruct); |
| 2216 | } |
| 2217 | |
| 2218 | /* |
| 2219 | $$ACTION |
| 2220 | Misc |
| 2221 | Set waypoint [i:Number] |
| 2222 | aSetWaypoint |
| 2223 | Set waypoint |
| 2224 | Sets the specified waypoint as active |
| 2225 | |
| 2226 | Parameters: |
| 2227 | Number: which waypoint to set |
| 2228 | $$END |
| 2229 | */ |
| 2230 | void aSetWaypointcxx . . $ aSetWaypoint(d4f767463ce0a6b3).(int number) { |
| 2231 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2232 | |
| 2233 | mstruct.indexcxx . . $ msafe_struct#index. = number; |
| 2234 | |
| 2235 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_WAYPOINTcxx . . $ `scripts/osiris_common.h:882:9`!, &mstruct); |
| 2236 | } |
| 2237 | |
| 2238 | /* |
| 2239 | $$ACTION |
| 2240 | Spew |
| 2241 | Turn ON spew from [o:Object] at gunpoint |
| 2242 | [i:GunNum];[e:SpewType=7],[f:Mass=0.0],[f:Drag=0.0],[g:PhysicsFlags=65536:100480],[b:IsRealObject=FALSE],[f:BlobLifetime=1.5],[f:BlobInterval=0.15],[f:SpewLife=30.0],[f:BlobSize=4.0],[f:BlobSpeed=20.0],[b:Randomize]. |
| 2243 | Handle = [e:SpewHandle] aTurnOnSpew Turn on spew Turns on spew and sets the spew type and other variables |
| 2244 | |
| 2245 | Parameters: |
| 2246 | Object: the object to spew from |
| 2247 | GunNum: the gunpoint on the object to spew from, or -1 to spew from center of object |
| 2248 | SpewType: The type of effect the blobs of spew should be |
| 2249 | Mass: the mass of each blob of spew |
| 2250 | Drag: the drag of the blob as it moves through the atmosphere |
| 2251 | PhysicsFlags: how the slews blobs are treated by the physics |
| 2252 | IsRealObject: if set than the spew blobs are real objects, else it's just a viseffect (leave it as is unless you know |
| 2253 | what you are doing) BlobLifetime: the lifetime of each blob of spew BlobInterval: how often a new blob of spew should be |
| 2254 | created SpewLife: the lifetime of the spewer (-1 for infinite) BlobSize: the size of each blob of spew BlobSpeed: the |
| 2255 | speed of each blob spew Randomize: if set than BlobSize, BlobSpeed and BlobLifetime are randomized a little (+/- some) |
| 2256 | for each blob SpewHandle: Where to store the handle for this spewer |
| 2257 | $$END |
| 2258 | */ |
| 2259 | void aTurnOnSpewcxx . . $ aTurnOnSpew(145b60b86cd2d6d7).(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, uint8_tcxx . . $ uint8_t# isreal, |
| 2260 | float lifetime, float interval, float longevity, float size, float speed, uint8_tcxx . . $ uint8_t# random, |
| 2261 | int handle_slot) { |
| 2262 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2263 | |
| 2264 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 2265 | mstruct.gunpointcxx . . $ msafe_struct#gunpoint. = gunpoint; |
| 2266 | mstruct.effect_typecxx . . $ msafe_struct#effect_type. = effect_type; |
| 2267 | mstruct.masscxx . . $ msafe_struct#mass. = mass; |
| 2268 | mstruct.dragcxx . . $ msafe_struct#drag. = drag; |
| 2269 | mstruct.phys_infocxx . . $ msafe_struct#phys_info. = gravity_type; |
| 2270 | mstruct.is_realcxx . . $ msafe_struct#is_real. = isreal; |
| 2271 | mstruct.lifetimecxx . . $ msafe_struct#lifetime. = lifetime; |
| 2272 | mstruct.intervalcxx . . $ msafe_struct#interval. = interval; |
| 2273 | mstruct.longevitycxx . . $ msafe_struct#longevity. = longevity; |
| 2274 | mstruct.sizecxx . . $ msafe_struct#size. = size; |
| 2275 | mstruct.speedcxx . . $ msafe_struct#speed. = speed; |
| 2276 | mstruct.randomcxx . . $ msafe_struct#random. = (random) ? SPEW_RAND_SIZEcxx . . $ `scripts/osiris_common.h:442:9`! | SPEW_RAND_LIFETIMEcxx . . $ `scripts/osiris_common.h:443:9`! | SPEW_RAND_SPEEDcxx . . $ `scripts/osiris_common.h:441:9`! : 0; |
| 2277 | |
| 2278 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_START_SPEWcxx . . $ `scripts/osiris_common.h:815:9`!, &mstruct); |
| 2279 | |
| 2280 | if ((handle_slot >= 0) && (handle_slot < MAX_SPEW_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:919:9`!)) |
| 2281 | Spew_handlescxx . . $ Spew_handles.[handle_slot] = mstruct.idcxx . . $ msafe_struct#id.; |
| 2282 | } |
| 2283 | |
| 2284 | /* |
| 2285 | $$ACTION |
| 2286 | Spew |
| 2287 | Turn OFF spew from [e:SpewHandle] |
| 2288 | aTurnOffSpew |
| 2289 | Turn off spew |
| 2290 | Turns off spew that was created with Turn On Spew. Pass in the handle given by Turn On Spew. |
| 2291 | |
| 2292 | Parameters: |
| 2293 | SpewHandle: the handle of the spewer to stop |
| 2294 | $$END |
| 2295 | */ |
| 2296 | void aTurnOffSpewcxx . . $ aTurnOffSpew(d4f767463ce0a6b3).(int handle_slot) { |
| 2297 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2298 | |
| 2299 | if ((handle_slot >= 0) && (handle_slot < MAX_SPEW_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:919:9`!)) { |
| 2300 | |
| 2301 | mstruct.idcxx . . $ msafe_struct#id. = Spew_handlescxx . . $ Spew_handles.[handle_slot]; |
| 2302 | |
| 2303 | if (mstruct.idcxx . . $ msafe_struct#id. != SPEW_INVALID_HANDLEcxx . . $ `scripts/DallasFuncs.cpp:941:9`!) { |
| 2304 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_STOP_SPEWcxx . . $ `scripts/osiris_common.h:816:9`!, &mstruct); |
| 2305 | Spew_handlescxx . . $ Spew_handles.[handle_slot] = SPEW_INVALID_HANDLEcxx . . $ `scripts/DallasFuncs.cpp:941:9`!; |
| 2306 | } |
| 2307 | } |
| 2308 | } |
| 2309 | |
| 2310 | /* |
| 2311 | $$ACTION |
| 2312 | Objects |
| 2313 | Attach new object of type [a:ChildTypeName] attachpoint [i:ChildPoint] to object [o:Parent] at attachpoint |
| 2314 | [i:ParentPoint] aAttachObject Attach new object Creates a new object attached to another object |
| 2315 | |
| 2316 | Parameters: |
| 2317 | $$END |
| 2318 | */ |
| 2319 | void aAttachObjectcxx . . $ aAttachObject(5b5238ee4a080898).(const char *objtypename, int childpoint, int objref, int parentpoint) { |
| 2320 | int child_handle; |
| 2321 | int child_type = Obj_FindTypecxx . . $ Obj_FindType.(objtypename); |
| 2322 | int child_id = Obj_FindIDcxx . . $ Obj_FindID.(objtypename); |
| 2323 | |
| 2324 | if (child_id >= 0) { |
| 2325 | |
| 2326 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2327 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 2328 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 2329 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ROOMNUMcxx . . $ `scripts/osiris_common.h:822:9`!, &mstruct); |
| 2330 | |
| 2331 | child_handle = Obj_Createcxx . . $ Obj_Create(fa124986c2825aef).(child_type, child_id, mstruct.roomnumcxx . . $ msafe_struct#roomnum., &mstruct.poscxx . . $ msafe_struct#pos.); |
| 2332 | |
| 2333 | if (child_handle != OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!) { |
| 2334 | if (!Obj_AttachObjectAPcxx . . $ Obj_AttachObjectAP.(objref, parentpoint, child_handle, childpoint, 1)) { |
| 2335 | |
| 2336 | //!!Error attaching, so delete new object |
| 2337 | } |
| 2338 | } |
| 2339 | } |
| 2340 | } |
| 2341 | |
| 2342 | /* |
| 2343 | $$ACTION |
| 2344 | Objects |
| 2345 | UnAttach [o:AttachedObject] from an object |
| 2346 | aUnAttachObject |
| 2347 | UnAttach an object from another one |
| 2348 | Unattaches an object |
| 2349 | |
| 2350 | Parameters: |
| 2351 | $$END |
| 2352 | */ |
| 2353 | void aUnAttachObjectcxx . . $ aUnAttachObject(d4f767463ce0a6b3).(int objref) { Obj_UnattachFromParentcxx . . $ Obj_UnattachFromParent.(objref); } |
| 2354 | |
| 2355 | /* |
| 2356 | $$ACTION |
| 2357 | Objects |
| 2358 | Object [o:ParentObject] drop all attached objects |
| 2359 | aDropObjects |
| 2360 | Drop attached objects |
| 2361 | Makes an object drop objects attached to it |
| 2362 | |
| 2363 | Parameters: |
| 2364 | $$END |
| 2365 | */ |
| 2366 | void aDropObjectscxx . . $ aDropObjects(d4f767463ce0a6b3).(int objref) { Obj_UnattachChildrencxx . . $ Obj_UnattachChildren.(objref); } |
| 2367 | |
| 2368 | /* |
| 2369 | $$ACTION |
| 2370 | Objects |
| 2371 | Attach existing object [o:Child] attachpoint [i:ChildPoint] to object [o:Parent] at attachpoint [i:ParentPoint] |
| 2372 | aAttachExistingObject |
| 2373 | Attach existing object to another object |
| 2374 | Attaches an existing object to another object |
| 2375 | |
| 2376 | Parameters: |
| 2377 | $$END |
| 2378 | */ |
| 2379 | void aAttachExistingObjectcxx . . $ aAttachExistingObject(748afa4755bc9595).(int child_ref, int childpoint, int objref, int parentpoint) { |
| 2380 | if (!Obj_AttachObjectAPcxx . . $ Obj_AttachObjectAP.(objref, parentpoint, child_ref, childpoint, 1)) { |
| 2381 | |
| 2382 | //!!Error attaching, so delete new object |
| 2383 | } |
| 2384 | } |
| 2385 | |
| 2386 | /* |
| 2387 | $$ACTION |
| 2388 | Sound && Music |
| 2389 | Set music region to [e:Region] for player [o:PlayerObject=IT] |
| 2390 | aMusicSetRegion |
| 2391 | Set music region |
| 2392 | Sets the specified region as the active region for the music system |
| 2393 | |
| 2394 | Parameters: |
| 2395 | Region: which region is now active |
| 2396 | PlayerObject: which player gets the music change |
| 2397 | $$END |
| 2398 | */ |
| 2399 | void aMusicSetRegioncxx . . $ aMusicSetRegion(3e454b8ccf442868).(int region_num, int objhandle) { |
| 2400 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2401 | |
| 2402 | mstruct.statecxx . . $ msafe_struct#state. = 0; // specific player |
| 2403 | mstruct.indexcxx . . $ msafe_struct#index. = region_num; |
| 2404 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 2405 | |
| 2406 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MUSIC_REGIONcxx . . $ `scripts/osiris_common.h:887:9`!, &mstruct); |
| 2407 | } |
| 2408 | |
| 2409 | /* |
| 2410 | $$ACTION |
| 2411 | Sound && Music |
| 2412 | Set music region to [e:Region] for all players |
| 2413 | aMusicSetRegionAll |
| 2414 | Set music region for all players |
| 2415 | Sets the specified region as the active region for the music system for all players |
| 2416 | |
| 2417 | Parameters: |
| 2418 | Region: which region is now active |
| 2419 | $$END |
| 2420 | */ |
| 2421 | void aMusicSetRegionAllcxx . . $ aMusicSetRegionAll(d4f767463ce0a6b3).(int region_num) { |
| 2422 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2423 | |
| 2424 | mstruct.statecxx . . $ msafe_struct#state. = 0; // all players |
| 2425 | mstruct.indexcxx . . $ msafe_struct#index. = region_num; |
| 2426 | |
| 2427 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MUSIC_REGIONcxx . . $ `scripts/osiris_common.h:887:9`!, &mstruct); |
| 2428 | } |
| 2429 | |
| 2430 | /* |
| 2431 | $$ACTION |
| 2432 | Timer |
| 2433 | Generate object [o:Object] timer event in [f:Time] seconds with ID [e:TimerID] |
| 2434 | aSetObjectTimer |
| 2435 | Generate object timer event |
| 2436 | Sets an object timer to go off in the specified amount of time |
| 2437 | |
| 2438 | Parameters: |
| 2439 | Object: the object to receive the timer notification |
| 2440 | Time: how long in seconds until notification |
| 2441 | TimerID: the ID for this timer |
| 2442 | $$END |
| 2443 | */ |
| 2444 | void aSetObjectTimercxx . . $ aSetObjectTimer(d6d7ce2c0b3115db).(int objref, float time, int id) { |
| 2445 | tOSIRISTIMERcxx . . $ tOSIRISTIMER# timer_info; |
| 2446 | |
| 2447 | timer_info.flagscxx . . $ tOSIRISTIMER#flags. = 0; |
| 2448 | timer_info.repeat_countcxx . . $ tOSIRISTIMER#repeat_count. = 0; |
| 2449 | timer_info.object_handlecxx . . $ tOSIRISTIMER#$anonymous_type_2#object_handle. = objref; |
| 2450 | timer_info.object_handle_detonatorcxx . . $ tOSIRISTIMER#object_handle_detonator. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 2451 | timer_info.timer_intervalcxx . . $ tOSIRISTIMER#timer_interval. = time; |
| 2452 | timer_info.idcxx . . $ tOSIRISTIMER#id. = id; |
| 2453 | |
| 2454 | Scrpt_CreateTimercxx . . $ Scrpt_CreateTimer.(&timer_info); |
| 2455 | } |
| 2456 | |
| 2457 | /* |
| 2458 | $$ACTION |
| 2459 | Timer |
| 2460 | Generate level timer event in [f:Time] seconds using with ID [e:TimerID] |
| 2461 | aSetLevelTimer |
| 2462 | Generate level timer event |
| 2463 | Sets a level timer to go off in the specified amount of time |
| 2464 | |
| 2465 | Parameters: |
| 2466 | Time: how long in seconds until notification |
| 2467 | TimerID: the ID for this timer |
| 2468 | $$END |
| 2469 | */ |
| 2470 | void aSetLevelTimercxx . . $ aSetLevelTimer(1746e8aa98ca1bc0).(float time, int id) { |
| 2471 | tOSIRISTIMERcxx . . $ tOSIRISTIMER# timer_info; |
| 2472 | |
| 2473 | timer_info.flagscxx . . $ tOSIRISTIMER#flags. = OTF_LEVELcxx . . $ `scripts/osiris_common.h:1170:9`!; |
| 2474 | timer_info.repeat_countcxx . . $ tOSIRISTIMER#repeat_count. = OTF_LEVELcxx . . $ `scripts/osiris_common.h:1170:9`!; |
| 2475 | timer_info.object_handle_detonatorcxx . . $ tOSIRISTIMER#object_handle_detonator. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 2476 | timer_info.timer_intervalcxx . . $ tOSIRISTIMER#timer_interval. = time; |
| 2477 | timer_info.idcxx . . $ tOSIRISTIMER#id. = id; |
| 2478 | |
| 2479 | Scrpt_CreateTimercxx . . $ Scrpt_CreateTimer.(&timer_info); |
| 2480 | } |
| 2481 | |
| 2482 | /* |
| 2483 | $$ACTION |
| 2484 | Timer |
| 2485 | Cancel Timer [e:TimerID] |
| 2486 | aCancelTimer |
| 2487 | Cancels a timer event |
| 2488 | Cancels a timer |
| 2489 | |
| 2490 | Parameters: |
| 2491 | TimerID: the ID for this timer |
| 2492 | $$END |
| 2493 | */ |
| 2494 | void aCancelTimercxx . . $ aCancelTimer(d4f767463ce0a6b3).(int id) { Scrpt_CancelTimerIDcxx . . $ Scrpt_CancelTimerID.(id); } |
| 2495 | |
| 2496 | /* |
| 2497 | $$ACTION |
| 2498 | Timer |
| 2499 | Show Timer [e:TimerID] on HUD |
| 2500 | aTimerShow |
| 2501 | Show Timer on HUD |
| 2502 | Shows the specified timer on the HUD |
| 2503 | |
| 2504 | Parameters: |
| 2505 | TimerID: the ID for this timer |
| 2506 | $$END |
| 2507 | */ |
| 2508 | void aTimerShowcxx . . $ aTimerShow(d4f767463ce0a6b3).(int id) { |
| 2509 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2510 | |
| 2511 | mstruct.indexcxx . . $ msafe_struct#index. = id; |
| 2512 | mstruct.colorcxx . . $ msafe_struct#color. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 255, 0); |
| 2513 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_START_TIMERcxx . . $ `scripts/osiris_common.h:892:9`!, &mstruct); |
| 2514 | } |
| 2515 | |
| 2516 | /* |
| 2517 | $$ACTION |
| 2518 | Mission |
| 2519 | End level |
| 2520 | aEndLevel |
| 2521 | End level |
| 2522 | Terminates the level |
| 2523 | |
| 2524 | Parameters: |
| 2525 | None. |
| 2526 | $$END |
| 2527 | */ |
| 2528 | void aEndLevelcxx . . $ aEndLevel(49f6e7a06ebc5aa8).() { |
| 2529 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2530 | |
| 2531 | mstruct.statecxx . . $ msafe_struct#state. = 1; // success |
| 2532 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_END_LEVELcxx . . $ `scripts/osiris_common.h:883:9`!, &mstruct); |
| 2533 | } |
| 2534 | |
| 2535 | /* |
| 2536 | $$ACTION |
| 2537 | Mission |
| 2538 | Fail Level |
| 2539 | aFailLevel |
| 2540 | Fail Level |
| 2541 | Terminates the level in failure. Level will restart. |
| 2542 | |
| 2543 | Parameters: |
| 2544 | None. |
| 2545 | $$END |
| 2546 | */ |
| 2547 | void aFailLevelcxx . . $ aFailLevel(49f6e7a06ebc5aa8).() { |
| 2548 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2549 | |
| 2550 | mstruct.statecxx . . $ msafe_struct#state. = 0; // failure |
| 2551 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_MISC_END_LEVELcxx . . $ `scripts/osiris_common.h:883:9`!, &mstruct); |
| 2552 | } |
| 2553 | |
| 2554 | /* |
| 2555 | $$ACTION |
| 2556 | Cinematics |
| 2557 | Start endlevel sequence; camera = [o:Camera], path = [h:PlayerPath], time = [f:Time=10.0], text = [s:Text] |
| 2558 | aStartEndlevelSequence |
| 2559 | Start endlevel sequence |
| 2560 | Start the endlevel camera sequence |
| 2561 | |
| 2562 | Parameters: |
| 2563 | Camera: the viewer object for the sequence |
| 2564 | PlayerPath: the path the player ship follows |
| 2565 | Time: how long before the level ends |
| 2566 | Text: Any text (if any) you want to display (pass empty message if you want none) |
| 2567 | $$END |
| 2568 | */ |
| 2569 | void aStartEndlevelSequencecxx . . $ aStartEndlevelSequence(6f39538d6eb5c41c).(int objhandle, int pathid, float time, const char *text) { |
| 2570 | tCannedCinematicInfocxx . . $ tCannedCinematicInfo# info; |
| 2571 | |
| 2572 | info.object_to_use_for_pointcxx . . $ tCannedCinematicInfo#object_to_use_for_point. = objhandle; |
| 2573 | info.target_pathidcxx . . $ tCannedCinematicInfo#target_pathid. = pathid; |
| 2574 | info.text_to_displaycxx . . $ tCannedCinematicInfo#text_to_display. = text; |
| 2575 | info.timecxx . . $ tCannedCinematicInfo#time. = time; |
| 2576 | info.typecxx . . $ tCannedCinematicInfo#type. = CANNED_LEVEL_END_POINTcxx . . $ `Descent3/gamecinematics_external.h:95:9`!; |
| 2577 | |
| 2578 | Cine_StartCannedcxx . . $ Cine_StartCanned.(&info); |
| 2579 | } |
| 2580 | |
| 2581 | /* |
| 2582 | $$ACTION |
| 2583 | Cinematics |
| 2584 | Start endlevel sequence with camera on path; camera path = [h:CameraPath], player path = [h:PlayerPath], time = |
| 2585 | [f:Time=10.0], text = [s:Text] aStartEndlevelSequencePath Start endlevel sequence on Path Start the endlevel camera |
| 2586 | sequence, with the camera on a path |
| 2587 | |
| 2588 | Parameters: |
| 2589 | CameraPath: the path the camera should follow for the sequence |
| 2590 | PlayerPath: the path the player ship follows |
| 2591 | Time: how long before the level ends |
| 2592 | Text: Any text (if any) you want to display (pass empty message if you want none) |
| 2593 | $$END |
| 2594 | */ |
| 2595 | void aStartEndlevelSequencePathcxx . . $ aStartEndlevelSequencePath(6f39538d6eb5c41c).(int camerapath, int pathid, float time, const char *text) { |
| 2596 | tCannedCinematicInfocxx . . $ tCannedCinematicInfo# info; |
| 2597 | |
| 2598 | info.camera_pathidcxx . . $ tCannedCinematicInfo#camera_pathid. = camerapath; |
| 2599 | info.target_pathidcxx . . $ tCannedCinematicInfo#target_pathid. = pathid; |
| 2600 | info.text_to_displaycxx . . $ tCannedCinematicInfo#text_to_display. = text; |
| 2601 | info.timecxx . . $ tCannedCinematicInfo#time. = time; |
| 2602 | info.typecxx . . $ tCannedCinematicInfo#type. = CANNED_LEVEL_END_PATHcxx . . $ `Descent3/gamecinematics_external.h:94:9`!; |
| 2603 | |
| 2604 | Cine_StartCannedcxx . . $ Cine_StartCanned.(&info); |
| 2605 | } |
| 2606 | |
| 2607 | /* |
| 2608 | $$ACTION |
| 2609 | Cinematics |
| 2610 | Fade Screen to white, and end level time = [f:Time=10.0], text = [s:Text] |
| 2611 | aFadeWhiteAndEndlevel |
| 2612 | Fades the screen to white and ends the level |
| 2613 | |
| 2614 | Parameters: |
| 2615 | Time: how long before the level ends (the screen fades to white across this time) |
| 2616 | Text: Any text (if any) you want to display (pass empty message if you want none) |
| 2617 | $$END |
| 2618 | */ |
| 2619 | void aFadeWhiteAndEndlevelcxx . . $ aFadeWhiteAndEndlevel(2053b7f568041c23).(float time, const char *text) { |
| 2620 | tCannedCinematicInfocxx . . $ tCannedCinematicInfo# info; |
| 2621 | |
| 2622 | info.text_to_displaycxx . . $ tCannedCinematicInfo#text_to_display. = text; |
| 2623 | info.timecxx . . $ tCannedCinematicInfo#time. = time; |
| 2624 | info.typecxx . . $ tCannedCinematicInfo#type. = CANNED_LEVEL_END_FADE_WHITEcxx . . $ `Descent3/gamecinematics_external.h:97:9`!; |
| 2625 | |
| 2626 | Cine_StartCannedcxx . . $ Cine_StartCanned.(&info); |
| 2627 | } |
| 2628 | |
| 2629 | /* |
| 2630 | $$ACTION |
| 2631 | Players |
| 2632 | Fade Screen out and move [o:Player] to Position Clipboard |
| 2633 | aFadeAndMovePlayer |
| 2634 | Fades the screen out and 'warps' the player to the position in the |
| 2635 | position clipboard. |
| 2636 | |
| 2637 | Parameters: |
| 2638 | Player: the player to move |
| 2639 | $$END |
| 2640 | */ |
| 2641 | void aFadeAndMovePlayercxx . . $ aFadeAndMovePlayer(d4f767463ce0a6b3).(int Player) { |
| 2642 | if (PositionClipboardcxx . . $ PositionClipboard..has_poscxx . . $ cPositionClipboard#has_pos.) { |
| 2643 | tCannedCinematicInfocxx . . $ tCannedCinematicInfo# info; |
| 2644 | |
| 2645 | info.roomcxx . . $ tCannedCinematicInfo#room. = PositionClipboardcxx . . $ PositionClipboard..roomcxx . . $ cPositionClipboard#room.; |
| 2646 | info.poscxx . . $ tCannedCinematicInfo#pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos.; |
| 2647 | info.orientcxx . . $ tCannedCinematicInfo#orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient.; |
| 2648 | info.target_objhandlecxx . . $ tCannedCinematicInfo#target_objhandle. = Player; |
| 2649 | info.typecxx . . $ tCannedCinematicInfo#type. = CANNED_MOVE_PLAYER_FADEcxx . . $ `Descent3/gamecinematics_external.h:96:9`!; |
| 2650 | |
| 2651 | Cine_StartCannedcxx . . $ Cine_StartCanned.(&info); |
| 2652 | } else { |
| 2653 | mprintfcxx . . $ mprintf.(0, "No ClipBoard Data Filled In\n"); |
| 2654 | } |
| 2655 | } |
| 2656 | |
| 2657 | /* |
| 2658 | $$ACTION |
| 2659 | Mission |
| 2660 | Set mission flag [i:FlagNum] to [b:State] |
| 2661 | aMissionSetFlag |
| 2662 | Set mission flag |
| 2663 | Sets the specified mission flag |
| 2664 | |
| 2665 | Parameters: |
| 2666 | FlagNum: the flag to set |
| 2667 | State: the value to set the flag to |
| 2668 | $$END |
| 2669 | */ |
| 2670 | void aMissionSetFlagcxx . . $ aMissionSetFlag(918ebd27a9ddbad3).(int flagnum, bool state) { Msn_FlagSetcxx . . $ Msn_FlagSet.(flagnum, state); } |
| 2671 | |
| 2672 | /* |
| 2673 | $$ACTION |
| 2674 | Mission |
| 2675 | Set secret level flag to [b:State] |
| 2676 | aMissionSetSecretFlag |
| 2677 | Set secret level flags |
| 2678 | Sets/Clears the secret level flag, so the next secret level will be enabled/disabled |
| 2679 | |
| 2680 | Parameters: |
| 2681 | State: whether to set or clear the flag |
| 2682 | $$END |
| 2683 | */ |
| 2684 | void aMissionSetSecretFlagcxx . . $ aMissionSetSecretFlag(b45ddcbc8423892c).(bool state) { Msn_FlagSetcxx . . $ Msn_FlagSet.(32, state); } |
| 2685 | |
| 2686 | /* |
| 2687 | $$ACTION |
| 2688 | Mission |
| 2689 | Set level objective flag [i:FlagNum] to [b:State=1] |
| 2690 | aMissionSetLevelFlag |
| 2691 | Set level objective flag |
| 2692 | Sets the specified level objective flag |
| 2693 | |
| 2694 | Parameters: |
| 2695 | FlagNum: the flag to set |
| 2696 | State: the value to set the flag to |
| 2697 | $$END |
| 2698 | */ |
| 2699 | void aMissionSetLevelFlagcxx . . $ aMissionSetLevelFlag(918ebd27a9ddbad3).(int flagnum, bool state) { |
| 2700 | //!!Add code here |
| 2701 | } |
| 2702 | |
| 2703 | /* |
| 2704 | $$ACTION |
| 2705 | Sound && Music |
| 2706 | Play 2D Sound [n:Sound] for player [o:PlayerObject=IT], volume = [p:Volume=1.0:0.0|1.0] |
| 2707 | aSoundPlay2DObj |
| 2708 | Play 2D Sound |
| 2709 | Plays a sound in 2D |
| 2710 | |
| 2711 | Parameters: |
| 2712 | Sound: the sound to play |
| 2713 | PlayerObject: the player who hears the sound |
| 2714 | Volume: how loud to play the sound |
| 2715 | $$END |
| 2716 | */ |
| 2717 | void aSoundPlay2DObjcxx . . $ aSoundPlay2DObj(c2f439e40e2f19ed).(int soundnum, int objhandle, float volume) { |
| 2718 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2719 | |
| 2720 | mstruct.statecxx . . $ msafe_struct#state. = 1; // specific player |
| 2721 | mstruct.indexcxx . . $ msafe_struct#index. = soundnum; |
| 2722 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = dfGetPlayercxx . . $ dfGetPlayer(7864480464b09eea).(objhandle); |
| 2723 | mstruct.volumecxx . . $ msafe_struct#volume. = volume; |
| 2724 | |
| 2725 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_SOUND_2Dcxx . . $ `scripts/osiris_common.h:866:9`!, &mstruct); |
| 2726 | } |
| 2727 | |
| 2728 | /* |
| 2729 | $$ACTION |
| 2730 | Sound && Music |
| 2731 | Play 2D Sound [n:Sound] for all players, volume = [p:Volume=1.0:0.0|1.0] |
| 2732 | aSoundPlay2D |
| 2733 | Play 2D Sound |
| 2734 | Plays a sound in 2D |
| 2735 | |
| 2736 | Parameters: |
| 2737 | Sound: the sound to play |
| 2738 | Volume: how loud to play the sound |
| 2739 | $$END |
| 2740 | */ |
| 2741 | void aSoundPlay2Dcxx . . $ aSoundPlay2D(43c79ee2f1b9aefe).(int soundnum, float volume) { |
| 2742 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2743 | |
| 2744 | mstruct.statecxx . . $ msafe_struct#state. = 0; // all players |
| 2745 | mstruct.indexcxx . . $ msafe_struct#index. = soundnum; |
| 2746 | mstruct.volumecxx . . $ msafe_struct#volume. = volume; |
| 2747 | |
| 2748 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_SOUND_2Dcxx . . $ `scripts/osiris_common.h:866:9`!, &mstruct); |
| 2749 | } |
| 2750 | |
| 2751 | /* |
| 2752 | $$ACTION |
| 2753 | Sound && Music |
| 2754 | Play Sound [n:Sound] from object [o:Object], volume = [p:Volume=1.0:0.0|1.0] |
| 2755 | aSoundPlayObject |
| 2756 | Play Object Sound |
| 2757 | Plays a sound from an object |
| 2758 | |
| 2759 | Parameters: |
| 2760 | Sound: the sound to play |
| 2761 | Object: the object to attach the sound to |
| 2762 | Volume: how loud to play the sound |
| 2763 | $$END |
| 2764 | */ |
| 2765 | void aSoundPlayObjectcxx . . $ aSoundPlayObject(c2f439e40e2f19ed).(int soundnum, int objref, float volume) { |
| 2766 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2767 | |
| 2768 | mstruct.indexcxx . . $ msafe_struct#index. = soundnum; |
| 2769 | mstruct.volumecxx . . $ msafe_struct#volume. = volume; |
| 2770 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 2771 | |
| 2772 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_SOUND_OBJECTcxx . . $ `scripts/osiris_common.h:867:9`!, &mstruct); |
| 2773 | } |
| 2774 | |
| 2775 | /* |
| 2776 | $$ACTION |
| 2777 | Sound && Music |
| 2778 | Play streaming sound [z:Sound] for all players, volume = [p:Volume=1.0:0.0|1.0] |
| 2779 | aSoundPlaySteaming |
| 2780 | Play Steaming Sound |
| 2781 | Plays a streaming sound sample |
| 2782 | |
| 2783 | Parameters: |
| 2784 | Sound: the sound to play |
| 2785 | Volume: how loud to play the sound |
| 2786 | $$END |
| 2787 | */ |
| 2788 | void aSoundPlaySteamingcxx . . $ aSoundPlaySteaming(42eacfea086a5352).(const char *soundname, float volume) { |
| 2789 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2790 | |
| 2791 | mstruct.statecxx . . $ msafe_struct#state. = 0; // all players |
| 2792 | |
| 2793 | strncpy(mstruct.namecxx . . $ msafe_struct#name., soundname, sizeof(mstruct.namecxx . . $ msafe_struct#name.) - 1); |
| 2794 | mstruct.namecxx . . $ msafe_struct#name.[sizeof(mstruct.namecxx . . $ msafe_struct#name.) - 1] = 0; |
| 2795 | mstruct.volumecxx . . $ msafe_struct#volume. = volume; |
| 2796 | |
| 2797 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_SOUND_STREAMINGcxx . . $ `scripts/osiris_common.h:868:9`!, &mstruct); |
| 2798 | } |
| 2799 | |
| 2800 | /* |
| 2801 | $$ACTION |
| 2802 | Sound && Music |
| 2803 | Play streaming sound [a:SoundName] for all players, volume = [p:Volume=1.0:0.0|1.0] (TEXT NAME VERSION) |
| 2804 | aSoundPlaySteamingText |
| 2805 | Play Steaming Sound |
| 2806 | Plays a streaming sound sample |
| 2807 | |
| 2808 | Parameters: |
| 2809 | SoundName: the sound to play |
| 2810 | Volume: how loud to play the sound |
| 2811 | $$END |
| 2812 | */ |
| 2813 | #define aSoundPlaySteamingTextcxx . . $ `scripts/DallasFuncs.cpp:2813:9`! aSoundPlaySteaming |
| 2814 | |
| 2815 | /* |
| 2816 | $$ACTION |
| 2817 | Sound && Music |
| 2818 | Play streaming sound [z:Sound] for player [o:PlayerObject=IT], volume = [p:Volume=1.0:0.0|1.0] |
| 2819 | aSoundPlaySteamingObj |
| 2820 | Play Steaming Sound |
| 2821 | Plays a streaming sound sample |
| 2822 | |
| 2823 | Parameters: |
| 2824 | Sound: the sound to play |
| 2825 | Volume: how loud to play the sound |
| 2826 | $$END |
| 2827 | */ |
| 2828 | void aSoundPlaySteamingObjcxx . . $ aSoundPlaySteamingObj(e7ada7bd8e0da89f).(const char *soundname, int objhandle, float volume) { |
| 2829 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2830 | |
| 2831 | mstruct.statecxx . . $ msafe_struct#state. = 1; // specific player |
| 2832 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 2833 | |
| 2834 | strncpy(mstruct.namecxx . . $ msafe_struct#name., soundname, sizeof(mstruct.namecxx . . $ msafe_struct#name.) - 1); |
| 2835 | mstruct.namecxx . . $ msafe_struct#name.[sizeof(mstruct.namecxx . . $ msafe_struct#name.) - 1] = 0; |
| 2836 | mstruct.volumecxx . . $ msafe_struct#volume. = volume; |
| 2837 | |
| 2838 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_SOUND_STREAMINGcxx . . $ `scripts/osiris_common.h:868:9`!, &mstruct); |
| 2839 | } |
| 2840 | |
| 2841 | /* |
| 2842 | $$ACTION |
| 2843 | Sound && Music |
| 2844 | Set volume for object [o:Object] to [p:Volume=1.0:0.0|1.0] |
| 2845 | aSoundVolumeObj |
| 2846 | Set volume for object sound |
| 2847 | Sets the volume for all sounds attached to an object |
| 2848 | |
| 2849 | Parameters: |
| 2850 | Object - the object whose sound to stop |
| 2851 | Volume - the volume to set |
| 2852 | $$END |
| 2853 | */ |
| 2854 | void aSoundVolumeObjcxx . . $ aSoundVolumeObj(43c79ee2f1b9aefe).(int objhandle, float volume) { |
| 2855 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2856 | |
| 2857 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 2858 | mstruct.volumecxx . . $ msafe_struct#volume. = volume; |
| 2859 | |
| 2860 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_SOUND_VOLUME_OBJcxx . . $ `scripts/osiris_common.h:871:9`!, &mstruct); |
| 2861 | } |
| 2862 | |
| 2863 | /* |
| 2864 | $$ACTION |
| 2865 | Sound && Music |
| 2866 | Stop sound for object [o:Object] |
| 2867 | aSoundStopObj |
| 2868 | Stop sound for object |
| 2869 | Stops all sounds attached to an object |
| 2870 | |
| 2871 | Parameters: |
| 2872 | Object - the object whose sound to stop |
| 2873 | $$END |
| 2874 | */ |
| 2875 | void aSoundStopObjcxx . . $ aSoundStopObj(d4f767463ce0a6b3).(int objhandle) { |
| 2876 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2877 | |
| 2878 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 2879 | |
| 2880 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_SOUND_STOP_OBJcxx . . $ `scripts/osiris_common.h:870:9`!, &mstruct); |
| 2881 | } |
| 2882 | |
| 2883 | /* |
| 2884 | $$ENUM Ghost/Unghost |
| 2885 | 0:UNGHOST |
| 2886 | 1:GHOST |
| 2887 | $$END |
| 2888 | */ |
| 2889 | |
| 2890 | /* |
| 2891 | $$ACTION |
| 2892 | Objects |
| 2893 | [e:Ghost/Unghost] object [o:Object] |
| 2894 | aObjGhostSet |
| 2895 | Ghost/Unghost an object |
| 2896 | Ghosts or Unghosts an object |
| 2897 | |
| 2898 | Parameters: |
| 2899 | Ghost/Unghost: whether to ghost or unghost the object |
| 2900 | Object: the object to ghost or unghost |
| 2901 | $$END |
| 2902 | */ |
| 2903 | void aObjGhostSetcxx . . $ aObjGhostSet(3e454b8ccf442868).(int state, int objref) { |
| 2904 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2905 | |
| 2906 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 2907 | |
| 2908 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(state ? MSAFE_OBJECT_GHOSTcxx . . $ `scripts/osiris_common.h:817:9`! : MSAFE_OBJECT_UNGHOSTcxx . . $ `scripts/osiris_common.h:818:9`!, &mstruct); |
| 2909 | } |
| 2910 | |
| 2911 | /* |
| 2912 | $$ACTION |
| 2913 | Objects |
| 2914 | Hide object [o:Object] |
| 2915 | aObjHide |
| 2916 | Hide an object |
| 2917 | Makes an object not render. It will still be there but be invisible. |
| 2918 | |
| 2919 | Parameters: |
| 2920 | Object: the object to hide |
| 2921 | $$END |
| 2922 | */ |
| 2923 | void aObjHidecxx . . $ aObjHide(d4f767463ce0a6b3).(int objref) { |
| 2924 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2925 | |
| 2926 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 2927 | |
| 2928 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_NO_RENDERcxx . . $ `scripts/osiris_common.h:840:9`!, &mstruct); |
| 2929 | } |
| 2930 | |
| 2931 | /* |
| 2932 | $$ACTION |
| 2933 | Objects |
| 2934 | Make object [o:Object] invulnerable for [i:Time=20.0] |
| 2935 | aObjMakeInvuln |
| 2936 | Makes object invulnerable |
| 2937 | Makes object invulnerable |
| 2938 | |
| 2939 | Parameters: |
| 2940 | Object: the object to make invulnerable |
| 2941 | Time: how long the object stays invulnerable |
| 2942 | $$END |
| 2943 | */ |
| 2944 | void aObjMakeInvulncxx . . $ aObjMakeInvuln(3e454b8ccf442868).(int objref, int time) { |
| 2945 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2946 | |
| 2947 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 2948 | mstruct.statecxx . . $ msafe_struct#state. = 1; |
| 2949 | mstruct.lifetimecxx . . $ msafe_struct#lifetime. = time; |
| 2950 | |
| 2951 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_INVULNERABLEcxx . . $ `scripts/osiris_common.h:836:9`!, &mstruct); |
| 2952 | } |
| 2953 | |
| 2954 | /* |
| 2955 | $$ACTION |
| 2956 | Objects |
| 2957 | Make object [o:Object] vulnerable |
| 2958 | aObjMakeVulnerable |
| 2959 | Makes object invulnerable |
| 2960 | Makes object invulnerable |
| 2961 | |
| 2962 | Parameters: |
| 2963 | Object: the object to make vulnerable again |
| 2964 | |
| 2965 | $$END |
| 2966 | */ |
| 2967 | void aObjMakeVulnerablecxx . . $ aObjMakeVulnerable(d4f767463ce0a6b3).(int objref) { |
| 2968 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2969 | |
| 2970 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 2971 | mstruct.statecxx . . $ msafe_struct#state. = 0; |
| 2972 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_INVULNERABLEcxx . . $ `scripts/osiris_common.h:836:9`!, &mstruct); |
| 2973 | } |
| 2974 | |
| 2975 | /* |
| 2976 | $$ACTION |
| 2977 | Objects |
| 2978 | Deform object [o:Object] by [f:Amount=.1:0|1.0] for [f:Time] seconds |
| 2979 | aObjDeform |
| 2980 | Deform object |
| 2981 | Deforms an object (applies the microwave cannon effect) |
| 2982 | |
| 2983 | Parameters: |
| 2984 | Object: the object to deform |
| 2985 | Amount: how much to deform the object. 0.1 is a "normal" amount; 0.4 is a big amount. |
| 2986 | Time: how long to deform the object |
| 2987 | $$END |
| 2988 | */ |
| 2989 | void aObjDeformcxx . . $ aObjDeform(3b3943b4e4191a93).(int objhandle, float amount, float time) { |
| 2990 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 2991 | |
| 2992 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 2993 | mstruct.amountcxx . . $ msafe_struct#amount. = amount; |
| 2994 | mstruct.lifetimecxx . . $ msafe_struct#lifetime. = time; |
| 2995 | |
| 2996 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_DEFORMcxx . . $ `scripts/osiris_common.h:842:9`!, &mstruct); |
| 2997 | } |
| 2998 | |
| 2999 | /* |
| 3000 | $$ACTION |
| 3001 | Objects |
| 3002 | Make object [o:Object] spark at a rate of [f:SparkRate=50] for [f:Time] seconds |
| 3003 | aObjSpark |
| 3004 | Make object spark |
| 3005 | Makes an object have sparks for the given amount of time |
| 3006 | |
| 3007 | Parameters: |
| 3008 | Object: the object to apply sparks to |
| 3009 | SparkRate: how many sparks per second the object will have |
| 3010 | Time: how long the sparking will last |
| 3011 | $$END |
| 3012 | */ |
| 3013 | void aObjSparkcxx . . $ aObjSpark(3b3943b4e4191a93).(int objhandle, float rate, float time) { |
| 3014 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3015 | |
| 3016 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 3017 | mstruct.amountcxx . . $ msafe_struct#amount. = rate; |
| 3018 | mstruct.lifetimecxx . . $ msafe_struct#lifetime. = time; |
| 3019 | |
| 3020 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_SPARKScxx . . $ `scripts/osiris_common.h:848:9`!, &mstruct); |
| 3021 | } |
| 3022 | |
| 3023 | /* |
| 3024 | $$ACTION |
| 3025 | Misc |
| 3026 | Shake viewer by [f:Amount=40.0:0|100.0] |
| 3027 | aMiscViewerShake |
| 3028 | Shake view |
| 3029 | Shakes the viewer |
| 3030 | |
| 3031 | Parameters: |
| 3032 | Amount: how much to shake the viewer (0-100) |
| 3033 | $$END |
| 3034 | */ |
| 3035 | void aMiscViewerShakecxx . . $ aMiscViewerShake(9364e6e7bff7660).(float amount) { |
| 3036 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3037 | |
| 3038 | mstruct.amountcxx . . $ msafe_struct#amount. = amount; |
| 3039 | |
| 3040 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_VIEWER_SHAKEcxx . . $ `scripts/osiris_common.h:843:9`!, &mstruct); |
| 3041 | } |
| 3042 | |
| 3043 | /* |
| 3044 | $$ACTION |
| 3045 | Misc |
| 3046 | Shake area around object [o:Object] by [f:Amount=40.0:0|100.0] over a distance of [f:Dist=100] |
| 3047 | aMiscShakeArea |
| 3048 | Shake the area around an object |
| 3049 | Shakes the viewer proportional to the distance to an object |
| 3050 | |
| 3051 | Parameters: |
| 3052 | Object: the epicenter of the shake |
| 3053 | Amount: how much to shake the viewer (0-100) |
| 3054 | Dist: how far away the shake can be felt. |
| 3055 | $$END |
| 3056 | */ |
| 3057 | void aMiscShakeAreacxx . . $ aMiscShakeArea(3b3943b4e4191a93).(int objhandle, float amount, float dist) { |
| 3058 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3059 | |
| 3060 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 3061 | mstruct.amountcxx . . $ msafe_struct#amount. = amount; |
| 3062 | mstruct.scalarcxx . . $ msafe_struct#scalar. = dist; |
| 3063 | |
| 3064 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_SHAKE_AREAcxx . . $ `scripts/osiris_common.h:852:9`!, &mstruct); |
| 3065 | } |
| 3066 | |
| 3067 | /* |
| 3068 | $$ACTION |
| 3069 | Rooms |
| 3070 | Set texture on room [r:Room] face [i:FaceNum] to [u:Texture] |
| 3071 | aRoomSetFaceTexture |
| 3072 | Change face texture |
| 3073 | Sets the texture for a room face |
| 3074 | |
| 3075 | Parameters: |
| 3076 | Room: the room the face is in |
| 3077 | FaceNum: the face whose texture is changed |
| 3078 | TextureName: the texture to assign to the specified face |
| 3079 | $$END |
| 3080 | */ |
| 3081 | void aRoomSetFaceTexturecxx . . $ aRoomSetFaceTexture(b1146eedae1e1d0b).(int roomnum, int facenum, int texturenum) { |
| 3082 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3083 | |
| 3084 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 3085 | mstruct.facenumcxx . . $ msafe_struct#facenum. = facenum; |
| 3086 | mstruct.indexcxx . . $ msafe_struct#index. = texturenum; |
| 3087 | |
| 3088 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_TEXTUREcxx . . $ `scripts/osiris_common.h:785:9`!, &mstruct); |
| 3089 | } |
| 3090 | |
| 3091 | /* |
| 3092 | $$ACTION |
| 3093 | Misc |
| 3094 | [e:Activate/Deactivate] matcen [m:Matcen] |
| 3095 | aMatcenSetState |
| 3096 | Activate/Deactivate matcen |
| 3097 | Activates or Deactivates a matcen, so it starts or stops producing |
| 3098 | |
| 3099 | Parameters: |
| 3100 | Activate/Deactivate: whether to start or stop the matcen |
| 3101 | Matcen: the matcen to activate |
| 3102 | $$END |
| 3103 | */ |
| 3104 | void aMatcenSetStatecxx . . $ aMatcenSetState(3e454b8ccf442868).(int state, int matcen_id) { |
| 3105 | int flags = MSTAT_ACTIVEcxx . . $ `Descent3/matcen_external.h:28:9`!; |
| 3106 | |
| 3107 | if (matcen_id >= 0) |
| 3108 | Matcen_Valuecxx . . $ Matcen_Value(504a19c195c7574e).(matcen_id, state ? VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`! : VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, MTNV_I_STATUScxx . . $ `scripts/osiris_common.h:744:9`!, &flags); |
| 3109 | } |
| 3110 | |
| 3111 | /* |
| 3112 | $$ACTION |
| 3113 | Misc |
| 3114 | [e:Enable/Disable] matcen [m:Matcen] |
| 3115 | aMatcenSetEnableState |
| 3116 | Enable/disable matcen |
| 3117 | Enable or disable a matcen, so it's capable of producing |
| 3118 | |
| 3119 | Parameters: |
| 3120 | Enable/Disable: whether the matcen is cabable of producing |
| 3121 | Matcen: the matcen to enable or disable |
| 3122 | $$END |
| 3123 | */ |
| 3124 | void aMatcenSetEnableStatecxx . . $ aMatcenSetEnableState(3e454b8ccf442868).(int state, int matcen_id) { |
| 3125 | int flags = MSTAT_DISABLEDcxx . . $ `Descent3/matcen_external.h:27:9`!; |
| 3126 | |
| 3127 | if (matcen_id >= 0) |
| 3128 | Matcen_Valuecxx . . $ Matcen_Value(504a19c195c7574e).(matcen_id, state ? VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`! : VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`!, MTNV_I_STATUScxx . . $ `scripts/osiris_common.h:744:9`!, &flags); |
| 3129 | } |
| 3130 | |
| 3131 | /* |
| 3132 | $$ACTION |
| 3133 | Misc |
| 3134 | Set matcen [m:Matcen] max produced = [i:MaxProduced=-1], production rate multiplier = [f:Multiplier=1.0], max alive |
| 3135 | children = [i:MaxAlive=-1:1|32] aMatcenSetValues Set matcen values Set matcen values for max produced, production rate |
| 3136 | multiplier, and max alive children |
| 3137 | |
| 3138 | Parameters: |
| 3139 | Matcen: the matcen to set |
| 3140 | MaxProduced: the total number this matcen will produce in its lifetime, or -1 for no limit |
| 3141 | Multiplier: controls the speed of the matcen. 1.0 is the normal speed |
| 3142 | MaxAlive: the maximum number of created object that will be alive at one time, or -1 for no limit |
| 3143 | $$END |
| 3144 | */ |
| 3145 | void aMatcenSetValuescxx . . $ aMatcenSetValues(ae907061efa2dd37).(int matcen_id, int max_produced, float multiplier, int max_alive) { |
| 3146 | if (matcen_id >= 0) { |
| 3147 | Matcen_Valuecxx . . $ Matcen_Value(504a19c195c7574e).(matcen_id, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, MTNV_I_MAX_PRODcxx . . $ `scripts/osiris_common.h:742:9`!, &max_produced, 0); |
| 3148 | Matcen_Valuecxx . . $ Matcen_Value(504a19c195c7574e).(matcen_id, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, MTNV_F_PROD_MULTIPLIERcxx . . $ `scripts/osiris_common.h:743:9`!, &multiplier, 0); |
| 3149 | Matcen_Valuecxx . . $ Matcen_Value(504a19c195c7574e).(matcen_id, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, MTNV_I_MAX_ALIVE_CHILDRENcxx . . $ `scripts/osiris_common.h:746:9`!, &max_alive, 0); |
| 3150 | } |
| 3151 | } |
| 3152 | |
| 3153 | /* |
| 3154 | $$ACTION |
| 3155 | Rooms |
| 3156 | Set fog in room [r:Room] to color = [f:Red=0.5],[f:Green=0.5],[f:Blue=0.5], depth = [f:Depth=300.0] |
| 3157 | aRoomSetFog |
| 3158 | Set room fog |
| 3159 | Sets the fog color and depth for a room |
| 3160 | |
| 3161 | Parameters: |
| 3162 | Room: the room to set |
| 3163 | R,G,B: the fog color (0-1) |
| 3164 | Depth: how deep the fog should be |
| 3165 | $$END |
| 3166 | */ |
| 3167 | void aRoomSetFogcxx . . $ aRoomSetFog(c31bc224e645f73e).(int roomnum, float r, float g, float b, float depth) { |
| 3168 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3169 | |
| 3170 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 3171 | mstruct.fog_depthcxx . . $ msafe_struct#fog_depth. = depth; |
| 3172 | mstruct.fog_rcxx . . $ msafe_struct#fog_r. = r; |
| 3173 | mstruct.fog_gcxx . . $ msafe_struct#fog_g. = g; |
| 3174 | mstruct.fog_bcxx . . $ msafe_struct#fog_b. = b; |
| 3175 | |
| 3176 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_FOGcxx . . $ `scripts/osiris_common.h:787:9`!, &mstruct); |
| 3177 | } |
| 3178 | |
| 3179 | /* |
| 3180 | $$ACTION |
| 3181 | Rooms |
| 3182 | Change fog in room [r:Room] to color = [f:Red=0.5],[f:Green=0.5],[f:Blue=0.5], delpth = [f:Depth=200.0] over |
| 3183 | [f:Time=20.0] seconds aRoomChangeFog Change room fog Changes the fog in a room over time |
| 3184 | |
| 3185 | Parameters: |
| 3186 | Room: the room to set |
| 3187 | R,G,B: the new fog color (0-1) |
| 3188 | Depth: how deep the fog should be after the change (starts from the current fog depth) |
| 3189 | Time: how long in seconds the change takes |
| 3190 | $$END |
| 3191 | */ |
| 3192 | void aRoomChangeFogcxx . . $ aRoomChangeFog(1b654de4a593e534).(int roomnum, float r, float g, float b, float depth, float time) { |
| 3193 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3194 | |
| 3195 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 3196 | mstruct.fog_depthcxx . . $ msafe_struct#fog_depth. = depth; |
| 3197 | mstruct.fog_rcxx . . $ msafe_struct#fog_r. = r; |
| 3198 | mstruct.fog_gcxx . . $ msafe_struct#fog_g. = g; |
| 3199 | mstruct.fog_bcxx . . $ msafe_struct#fog_b. = b; |
| 3200 | mstruct.intervalcxx . . $ msafe_struct#interval. = time; |
| 3201 | |
| 3202 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_CHANGING_FOGcxx . . $ `scripts/osiris_common.h:791:9`!, &mstruct); |
| 3203 | } |
| 3204 | |
| 3205 | /* |
| 3206 | $$ACTION |
| 3207 | Rooms |
| 3208 | Turn fog [e:On/Off] in room [r:Room] |
| 3209 | aRoomFogSetState |
| 3210 | Turn fog On/Off |
| 3211 | Turns On or Off the fog in a room |
| 3212 | |
| 3213 | Parameters: |
| 3214 | On/Off: whether to turn the fog on or off |
| 3215 | Room: the room in which to turn on or off the fog |
| 3216 | $$END |
| 3217 | */ |
| 3218 | void aRoomFogSetStatecxx . . $ aRoomFogSetState(3e454b8ccf442868).(int state, int roomnum) { |
| 3219 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3220 | |
| 3221 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 3222 | mstruct.statecxx . . $ msafe_struct#state. = state; |
| 3223 | |
| 3224 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_FOG_STATEcxx . . $ `scripts/osiris_common.h:790:9`!, &mstruct); |
| 3225 | } |
| 3226 | |
| 3227 | /* |
| 3228 | $$ACTION |
| 3229 | Rooms |
| 3230 | Toggle fog in room [r:Room] |
| 3231 | aRoomToggleFog |
| 3232 | Toggle room fog |
| 3233 | Toggles the fog state in a room |
| 3234 | |
| 3235 | Parameters: |
| 3236 | Room: the room in which to turn off the fog |
| 3237 | $$END |
| 3238 | */ |
| 3239 | void aRoomToggleFogcxx . . $ aRoomToggleFog(d4f767463ce0a6b3).(int roomnum) { |
| 3240 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3241 | |
| 3242 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 3243 | |
| 3244 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_ROOM_FOG_STATEcxx . . $ `scripts/osiris_common.h:790:9`!, &mstruct); |
| 3245 | |
| 3246 | mstruct.statecxx . . $ msafe_struct#state. = !mstruct.statecxx . . $ msafe_struct#state.; |
| 3247 | |
| 3248 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_FOG_STATEcxx . . $ `scripts/osiris_common.h:790:9`!, &mstruct); |
| 3249 | } |
| 3250 | |
| 3251 | /* |
| 3252 | $$ACTION |
| 3253 | Rooms |
| 3254 | Set wind in room [r:Room], direction = <[f:X],[f:Y],[f:Z]>, speed = [f:Speed=1.0] |
| 3255 | aRoomSetWind |
| 3256 | Set wind in room |
| 3257 | Sets the wind in a room |
| 3258 | |
| 3259 | Parameters: |
| 3260 | Room: the room in which to set the wind |
| 3261 | X,Y,Z: the direction vector for the wind |
| 3262 | Speed: the speed of the wind (10.0 is faster than the player ship) |
| 3263 | $$END |
| 3264 | */ |
| 3265 | void aRoomSetWindcxx . . $ aRoomSetWind(c31bc224e645f73e).(int roomnum, float x, float y, float z, float speed) { |
| 3266 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3267 | |
| 3268 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 3269 | //!!mstruct.wind = *v; |
| 3270 | mstruct.windcxx . . $ msafe_struct#wind..xcxx . . $ vector#x. = x * speed; |
| 3271 | mstruct.windcxx . . $ msafe_struct#wind..ycxx . . $ vector#y. = y * speed; |
| 3272 | mstruct.windcxx . . $ msafe_struct#wind..zcxx . . $ vector#z. = z * speed; |
| 3273 | |
| 3274 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_WINDcxx . . $ `scripts/osiris_common.h:786:9`!, &mstruct); |
| 3275 | } |
| 3276 | |
| 3277 | /* |
| 3278 | $$ACTION |
| 3279 | Rooms |
| 3280 | Change wind in room [r:Room] to direction = <[f:X],[f:Y],[f:Z]>, speed = [f:Speed=1.0] over [f:Time=10.0] seconds |
| 3281 | aRoomChangeWind |
| 3282 | Change wind in room |
| 3283 | Changes the wind in a room over time |
| 3284 | |
| 3285 | Parameters: |
| 3286 | Room: the room in which to set the wind |
| 3287 | X,Y,Z: the direction vector for the wind |
| 3288 | Speed: the speed of the wind (10.0 is faster than the player ship) |
| 3289 | Time: how long the change takes |
| 3290 | $$END |
| 3291 | */ |
| 3292 | void aRoomChangeWindcxx . . $ aRoomChangeWind(1b654de4a593e534).(int roomnum, float x, float y, float z, float speed, float time) { |
| 3293 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 3294 | |
| 3295 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 3296 | //!!mstruct.wind = *v; |
| 3297 | mstruct.windcxx . . $ msafe_struct#wind..xcxx . . $ vector#x. = x * speed; |
| 3298 | mstruct.windcxx . . $ msafe_struct#wind..ycxx . . $ vector#y. = y * speed; |
| 3299 | mstruct.windcxx . . $ msafe_struct#wind..zcxx . . $ vector#z. = z * speed; |
| 3300 | mstruct.intervalcxx . . $ msafe_struct#interval. = time; |
| 3301 | |
| 3302 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_CHANGING_WINDcxx . . $ `scripts/osiris_common.h:792:9`!, &mstruct); |
| 3303 | } |
| 3304 | |
| 3305 | /* |
| 3306 | $$ACTION |
| 3307 | AI |
| 3308 | Object For [o:Object] turn the AI scripted death flag [e:On/Off] |
| 3309 | aSetScriptedDeath |
| 3310 | Turn On/Off the AI scripted death flag |
| 3311 | Turns on/off the scripted death flag for the specified object |
| 3312 | |
| 3313 | Parameters: |
| 3314 | Object - the object in question |
| 3315 | On/Off - whether to turn on/off the AI Scripted Death Flag |
| 3316 | $$END |
| 3317 | */ |
| 3318 | void aSetScriptedDeathcxx . . $ aSetScriptedDeath(3e454b8ccf442868).(int objhandle, int state) { |
| 3319 | int flags = OF_AI_DEATHcxx . . $ `Descent3/object_external.h:293:9`!; |
| 3320 | |
| 3321 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objhandle, state ? VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`! : VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, OBJV_I_FLAGScxx . . $ `scripts/osiris_common.h:635:9`!, &flags); |
| 3322 | } |
| 3323 | |
| 3324 | /* |
| 3325 | $$ACTION |
| 3326 | AI |
| 3327 | Turn [e:On/Off] the AI for object [o:Object] |
| 3328 | aAISetState |
| 3329 | Turn On/Off the AI for object |
| 3330 | Turns on or off the AI for the specified object |
| 3331 | |
| 3332 | Parameters: |
| 3333 | On/Off - whether to turn the AI on or off |
| 3334 | Object - the object whose AI is turned on or off |
| 3335 | $$END |
| 3336 | */ |
| 3337 | void aAISetStatecxx . . $ aAISetState(3e454b8ccf442868).(int state, int objhandle) { AI_PowerSwitchcxx . . $ AI_PowerSwitch.(objhandle, state != 0); } |
| 3338 | |
| 3339 | /* |
| 3340 | $$ACTION |
| 3341 | AI |
| 3342 | Set the FOV of [o:Object] to [f:FOV] degrees |
| 3343 | aAISetFOV |
| 3344 | Sets the FOV for an AI object (0 - 360) |
| 3345 | Sets the FOV for an AI object (0 - 360) |
| 3346 | |
| 3347 | Parameters: |
| 3348 | Object - the object whose AI is turned on or off |
| 3349 | FOV - the number of angles of the FOV |
| 3350 | $$END |
| 3351 | */ |
| 3352 | void aAISetFOVcxx . . $ aAISetFOV(43c79ee2f1b9aefe).(int objhandle, float fov) { |
| 3353 | fov = cos(fov * PIcxx . . $ `fix/fix.h:73:9`! / (360.0)); |
| 3354 | AI_Valuecxx . . $ AI_Value.(objhandle, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, AIV_F_FOVcxx . . $ `scripts/osiris_common.h:537:9`!, &fov); |
| 3355 | } |
| 3356 | |
| 3357 | /* |
| 3358 | $$ACTION |
| 3359 | AI |
| 3360 | Set the Target of [o:Object] to [o:Target] |
| 3361 | aAISetTarget |
| 3362 | Sets the target for an AI object |
| 3363 | Sets the target for an AI object |
| 3364 | |
| 3365 | Parameters: |
| 3366 | Object - the object whose AI target is being set |
| 3367 | Target - the object to be targetted for attack |
| 3368 | $$END |
| 3369 | */ |
| 3370 | void aAISetTargetcxx . . $ aAISetTarget(3e454b8ccf442868).(int objhandle, int targethandle) { AI_Valuecxx . . $ AI_Value.(objhandle, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, AIV_I_TARGET_HANDLEcxx . . $ `scripts/osiris_common.h:524:9`!, &targethandle); } |
| 3371 | |
| 3372 | /* |
| 3373 | $$ACTION |
| 3374 | AI |
| 3375 | Set Team to [e:Teams] for the AI for object [o:Object] |
| 3376 | aAISetTeam |
| 3377 | Sets the team for a specific object |
| 3378 | Sets the team for a specific object |
| 3379 | |
| 3380 | Parameters: |
| 3381 | Team: Which team you want the object to belong to |
| 3382 | Object - the object whose team you want to change |
| 3383 | $$END |
| 3384 | */ |
| 3385 | void aAISetTeamcxx . . $ aAISetTeam(3e454b8ccf442868).(int team, int objhandle) { |
| 3386 | int flags = AIF_TEAM_MASKcxx . . $ `Descent3/aistruct_external.h:364:9`!; |
| 3387 | AI_Valuecxx . . $ AI_Value.(objhandle, VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, AIV_I_FLAGScxx . . $ `scripts/osiris_common.h:556:9`!, &flags); |
| 3388 | flags = team; // AIF_TEAM_REBEL; |
| 3389 | AI_Valuecxx . . $ AI_Value.(objhandle, VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`!, AIV_I_FLAGScxx . . $ `scripts/osiris_common.h:556:9`!, &flags); |
| 3390 | |
| 3391 | int target_handle = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 3392 | AI_Valuecxx . . $ AI_Value.(objhandle, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, AIV_I_TARGET_HANDLEcxx . . $ `scripts/osiris_common.h:524:9`!, &target_handle); |
| 3393 | } |
| 3394 | |
| 3395 | /* |
| 3396 | $$ACTION |
| 3397 | AI |
| 3398 | Clear the [e:GoalPriority=3] prioriity goal for object [o:Object] |
| 3399 | aAIClearGoal |
| 3400 | Clears a goal for a specific object |
| 3401 | Clears a goal for a specific object |
| 3402 | |
| 3403 | Parameters: |
| 3404 | GoalPriority: The priority of the goal you can to clear |
| 3405 | Object: the object whose goal you want to clear |
| 3406 | $$END |
| 3407 | */ |
| 3408 | |
| 3409 | void aAIClearGoalcxx . . $ aAIClearGoal(3e454b8ccf442868).(int slot, int handle) { AI_ClearGoalcxx . . $ AI_ClearGoal.(handle, slot); } |
| 3410 | |
| 3411 | /* |
| 3412 | $$ENUM AIModeType |
| 3413 | 1:Stalker |
| 3414 | 2:Standard Attack |
| 3415 | 3:Guardian |
| 3416 | 4:Stationary Turret |
| 3417 | 6:Melee |
| 3418 | 7:Bird Flock |
| 3419 | 9:Herd |
| 3420 | $$END |
| 3421 | |
| 3422 | Luke would additionally like these types: |
| 3423 | Wander |
| 3424 | Berzerker |
| 3425 | Pursue |
| 3426 | Sniper |
| 3427 | Survival |
| 3428 | Sneak Attack |
| 3429 | Supervisor |
| 3430 | |
| 3431 | */ |
| 3432 | |
| 3433 | /* |
| 3434 | $$ACTION |
| 3435 | AI |
| 3436 | Set AI mode for object [o:Object] to [e:AIModeType] |
| 3437 | aAISetMode |
| 3438 | Set AI mode |
| 3439 | Sets the AI mode for an objectTurn ON AI for object |
| 3440 | |
| 3441 | Parameters: |
| 3442 | Object - the object whose AI mode is set |
| 3443 | AIModeType - which mode to set for the object |
| 3444 | $$END |
| 3445 | */ |
| 3446 | void aAISetModecxx . . $ aAISetMode(3e454b8ccf442868).(int objhandle, int modetype) { AI_SetTypecxx . . $ AI_SetType.(objhandle, modetype); } |
| 3447 | |
| 3448 | /* |
| 3449 | $$ACTION |
| 3450 | AI |
| 3451 | Set [o:Object] to have a max speed of [f:MaxSpeed] |
| 3452 | aAISetMaxSpeed |
| 3453 | Set the max speed of an object |
| 3454 | Set the max speed of an object |
| 3455 | |
| 3456 | Parameters: |
| 3457 | Object - the object whose AI mode is set |
| 3458 | MaxSpeed - Maximum speed |
| 3459 | $$END |
| 3460 | */ |
| 3461 | void aAISetMaxSpeedcxx . . $ aAISetMaxSpeed(43c79ee2f1b9aefe).(int objhandle, float max_speed) { AI_Valuecxx . . $ AI_Value.(objhandle, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, AIV_F_MAX_SPEEDcxx . . $ `scripts/osiris_common.h:505:9`!, &max_speed); } |
| 3462 | |
| 3463 | // Used for all AI Goal calls |
| 3464 | #define DEFAULT_INFLUENCEcxx . . $ `scripts/DallasFuncs.cpp:3464:9`! 1.0 |
| 3465 | |
| 3466 | /* |
| 3467 | Flags for AI Goals |
| 3468 | |
| 3469 | $$FLAG AIGoalFlags |
| 3470 | 1:Permanent |
| 3471 | 4:Keep at Completion |
| 3472 | 16:Object is Target |
| 3473 | 128:Go Directly to Goal if Visible |
| 3474 | 256:Force Awareness |
| 3475 | 512:Objects are Friends |
| 3476 | 1024:Objects are Species |
| 3477 | 2048:Objects are Enemies |
| 3478 | 4096:Orient Velocity |
| 3479 | 65536:Orient Target |
| 3480 | 131072:No Reorientation |
| 3481 | 262144:Orient Goal Object |
| 3482 | 1048576:Orient Path Node |
| 3483 | 2097152:Follow Path Exactly |
| 3484 | 4194304:Reverse at End of Path |
| 3485 | 8388608:Circle at End of Path |
| 3486 | 16777216:Follow Path in Reverse Direction |
| 3487 | $$END |
| 3488 | |
| 3489 | Flags for AI |
| 3490 | |
| 3491 | $$FLAG AIFlags |
| 3492 | 1:Weapon Attack 1 |
| 3493 | 2:Weapon Attack 2 |
| 3494 | 4:Melee Attack 1 |
| 3495 | 8:Melee Attack 2 |
| 3496 | 32: Act as team neutral until shot |
| 3497 | 64:Persistant (always using CPU cycles) |
| 3498 | 128:Dodging |
| 3499 | 256:Firing Ranged Weapons |
| 3500 | 512:Flinching |
| 3501 | 1024:Determining Targets |
| 3502 | 2048:Aiming |
| 3503 | 8192:Auto-avoid walls |
| 3504 | 16384:Disabled |
| 3505 | 32768:Team PTMC (WARNING - NEVER SET TWO TEAMS) |
| 3506 | 65536:Team Rebel (WARNING - NEVER SET TWO TEAMS) |
| 3507 | 131072:Team Hostile to everyone (WARNING - NEVER SET TWO TEAMS) |
| 3508 | 196608:Team Neutral to everyone (WARNING - NEVER SET TWO TEAMS) |
| 3509 | 524288:Orientate to velocity |
| 3510 | 4194304:Target by distance |
| 3511 | 8388608:Disable ranged weapon firing (even in script) |
| 3512 | 16777216:Disable melee attacks (even in script) |
| 3513 | 33554432:Auto-avoid friends |
| 3514 | 268435456:Biased Flight Height |
| 3515 | 536870912:Force awareness (always using CPU cycles) |
| 3516 | $$END |
| 3517 | |
| 3518 | User type for Goal IDs |
| 3519 | |
| 3520 | $$USERTYPE GoalID:99 |
| 3521 | |
| 3522 | AI Goal slot values |
| 3523 | |
| 3524 | $$ENUM GoalPriority |
| 3525 | 3:High |
| 3526 | 0:Low |
| 3527 | $$END |
| 3528 | |
| 3529 | $$ENUM Set/Clear |
| 3530 | 0:Clear |
| 3531 | 1:Set |
| 3532 | $$END |
| 3533 | |
| 3534 | */ |
| 3535 | |
| 3536 | /* |
| 3537 | $$ACTION |
| 3538 | AI |
| 3539 | [e:Set/Clear=1] AI Flags [g:AIFlags=0] for Object [o:Object] |
| 3540 | aAIFlags |
| 3541 | Sets and clears AI flags |
| 3542 | Sets and clears AI flags |
| 3543 | |
| 3544 | Parameters: |
| 3545 | Set/Clear - Set or Clear the specified flags |
| 3546 | AIFlags - the flags to either set or clear (other flags are not effected) |
| 3547 | Object - The object of which you want to alter the AI flags |
| 3548 | $$END |
| 3549 | */ |
| 3550 | void aAIFlagscxx . . $ aAIFlags(b1146eedae1e1d0b).(int set, int flags, int handle) { |
| 3551 | bool f_team = false; |
| 3552 | |
| 3553 | // Because its a bitfield, I had to hack a team value... Team PTMC was 0; so, it was |
| 3554 | // impossible to set... 32768 wasn't used, so I hacked it here. O' The shame... :( |
| 3555 | |
| 3556 | if (!set) |
| 3557 | flags &= ~(AIF_TEAM_MASKcxx . . $ `Descent3/aistruct_external.h:364:9`!); |
| 3558 | else |
| 3559 | f_team = (flags & (AIF_TEAM_MASKcxx . . $ `Descent3/aistruct_external.h:364:9`! | 32768)) != 0; |
| 3560 | |
| 3561 | // hacked PTMC team value |
| 3562 | flags &= ~(32768); |
| 3563 | |
| 3564 | // Since it is a bit field... clear out the old value |
| 3565 | if (f_team) { |
| 3566 | int team_mask = AIF_TEAM_MASKcxx . . $ `Descent3/aistruct_external.h:364:9`!; |
| 3567 | AI_Valuecxx . . $ AI_Value.(handle, VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, AIV_I_FLAGScxx . . $ `scripts/osiris_common.h:556:9`!, &team_mask); |
| 3568 | } |
| 3569 | |
| 3570 | AI_Valuecxx . . $ AI_Value.(handle, (set) ? VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`! : VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, AIV_I_FLAGScxx . . $ `scripts/osiris_common.h:556:9`!, &flags); |
| 3571 | } |
| 3572 | |
| 3573 | /* |
| 3574 | $$ACTION |
| 3575 | AI |
| 3576 | Set AI object [o:Object] goal Priority = [e:GoalPriority=3] circle distance to [f:distance] |
| 3577 | aAIGoalSetCircleDistance |
| 3578 | Sets the circle distance for a goal |
| 3579 | Sets the circle distance for a goal |
| 3580 | |
| 3581 | Parameters: |
| 3582 | Object - the object who is send to the room |
| 3583 | Priority - priority of the goal in question |
| 3584 | $$END |
| 3585 | */ |
| 3586 | void aAIGoalSetCircleDistancecxx . . $ aAIGoalSetCircleDistance(c2f439e40e2f19ed).(int objhandle, int slot, float distance) { |
| 3587 | AI_GoalValuecxx . . $ AI_GoalValue(bf765428094b1867).(objhandle, slot, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, AIGV_F_CIRCLE_DISTcxx . . $ `scripts/osiris_common.h:592:9`!, &distance); |
| 3588 | } |
| 3589 | |
| 3590 | /* |
| 3591 | $$ACTION |
| 3592 | AI |
| 3593 | Send AI object [o:Object] to room [r:Room]; Priority = [e:GoalPriority=3], Flags = [g:AIGoalFlags=4352:201109], GoalID = |
| 3594 | [e:GoalID=-1] aAIGoalGotoRoom Send AI object to room Instructs an AI object to go to a specific room |
| 3595 | |
| 3596 | Parameters: |
| 3597 | Object - the object who is send to the room |
| 3598 | Room - the room to go do |
| 3599 | Priority - if High, overrides the default goals; if Low, does only when the object has no other enabled goals |
| 3600 | Flags - the flags for this goal |
| 3601 | GoalID - an ID for this goal |
| 3602 | $$END |
| 3603 | */ |
| 3604 | void aAIGoalGotoRoomcxx . . $ aAIGoalGotoRoom(1559a299834bcdd5).(int objhandle, int roomnum, int slot, int flags, int goalid) { |
| 3605 | vectorcxx . . $ vector# pos; |
| 3606 | |
| 3607 | Room_Valuecxx . . $ Room_Value(504a19c195c7574e).(roomnum, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, RMSV_V_PATH_PNTcxx . . $ `scripts/osiris_common.h:689:9`!, &pos, 0); |
| 3608 | |
| 3609 | AI_AddGoalcxx . . $ AI_AddGoal.(objhandle, AIG_GET_TO_POScxx . . $ `Descent3/aistruct_external.h:201:9`!, slot, DEFAULT_INFLUENCEcxx . . $ `scripts/DallasFuncs.cpp:3464:9`!, goalid, flags, &pos, roomnum); |
| 3610 | } |
| 3611 | |
| 3612 | /* |
| 3613 | $$ACTION |
| 3614 | AI |
| 3615 | Send AI object [o:Object] to object [o:Target]; Priority = [e:GoalPriority=3], Flags = [g:AIGoalFlags=4352:201109], |
| 3616 | GoalID = [e:GoalID=-1] aAIGoalGotoObject Send AI object to a specified object Instructs an AI object to go to a specific |
| 3617 | object |
| 3618 | |
| 3619 | Parameters: |
| 3620 | Object - the object who is send to the room |
| 3621 | Target - the object to get to |
| 3622 | Priority - if High, overrides the default goals; if Low, does only when the object has no other enabled goals |
| 3623 | Flags - the flags for this goal |
| 3624 | GoalID - an ID for this goal |
| 3625 | $$END |
| 3626 | */ |
| 3627 | void aAIGoalGotoObjectcxx . . $ aAIGoalGotoObject(1559a299834bcdd5).(int objhandle, int target, int slot, int flags, int goalid) { |
| 3628 | AI_AddGoalcxx . . $ AI_AddGoal.(objhandle, AIG_GET_TO_OBJcxx . . $ `Descent3/aistruct_external.h:183:9`!, slot, DEFAULT_INFLUENCEcxx . . $ `scripts/DallasFuncs.cpp:3464:9`!, goalid, flags, target); |
| 3629 | } |
| 3630 | |
| 3631 | /* |
| 3632 | $$ACTION |
| 3633 | AI |
| 3634 | Send AI object [o:Object] on path [h:Path]; Flags = [g:AIGoalFlags=4352:32706959], GoalID = [e:GoalID=-1], Priority = |
| 3635 | [e:GoalPriority=3] aAIGoalFollowPathSimple Send AI object on path Instructs an AI object to follow a path |
| 3636 | |
| 3637 | Parameters: |
| 3638 | Object - the object who is send to the room |
| 3639 | Path - the path to follow |
| 3640 | Flags - the flags for this goal |
| 3641 | GoalID - an ID for this goal |
| 3642 | Priority - The priority of the goal |
| 3643 | $$END |
| 3644 | */ |
| 3645 | void aAIGoalFollowPathSimplecxx . . $ aAIGoalFollowPathSimple(1559a299834bcdd5).(int objhandle, int pathid, int flags, int goalid, int priority = 0) { |
| 3646 | //!!GoalID not used yet |
| 3647 | |
| 3648 | if (pathid != -1) |
| 3649 | AI_GoalFollowPathSimplecxx . . $ AI_GoalFollowPathSimple(ea6ae529d4ec1c7a).(objhandle, pathid, goalid, flags, priority); |
| 3650 | } |
| 3651 | |
| 3652 | /* |
| 3653 | $$ACTION |
| 3654 | AI |
| 3655 | Send AI object [o:Object] on path [h:Path] between nodes [i:FirstNode] and [i:LastNode], starting at [i:StartNode]; |
| 3656 | Priority = [e:GoalPriority=3], Flags = [g:AIGoalFlags=4352:32706959], GoalID = [e:GoalID=-1] aAIGoalFollowPath Send AI |
| 3657 | object on path Instructs an AI object to follow a path |
| 3658 | |
| 3659 | Parameters: |
| 3660 | Object - the object who is send to the room |
| 3661 | Path - the path to follow |
| 3662 | FirstNode, LastNode - the endpoints of the part of the path to follow |
| 3663 | StartNode - where to start following the path |
| 3664 | Priority - if High, overrides the default goals; if Low, does only when the object has no other enabled goals |
| 3665 | Flags - the flags for this goal |
| 3666 | GoalID - an ID for this goal |
| 3667 | $$END |
| 3668 | */ |
| 3669 | void aAIGoalFollowPathcxx . . $ aAIGoalFollowPath(399580efc014f2ba).(int objhandle, int pathid, int firstnode, int lastnode, int startnode, int slot, int flags, |
| 3670 | int goalid) { |
| 3671 | if (pathid != -1) |
| 3672 | AI_AddGoalcxx . . $ AI_AddGoal.(objhandle, AIG_FOLLOW_PATHcxx . . $ `Descent3/aistruct_external.h:195:9`!, slot, DEFAULT_INFLUENCEcxx . . $ `scripts/DallasFuncs.cpp:3464:9`!, goalid, flags, pathid, firstnode, lastnode, |
| 3673 | startnode); |
| 3674 | } |
| 3675 | |
| 3676 | /* |
| 3677 | $$ACTION |
| 3678 | AI |
| 3679 | Make object [o:Picker] (attachpoint [i:PickerPoint]) pick up object [o:Pickee] (attachpoint = [i:PickeePoint]); Aligned |
| 3680 | = [b:Aligned]; Priority = [e:GoalPriority=3], Flags = [g:AIGoalFlags:463253], GoalID = [e:GoalID=-1] aAIGoalPickUpObject |
| 3681 | Make object pick up object |
| 3682 | Make one object pick up another |
| 3683 | |
| 3684 | Parameters: |
| 3685 | Picker - the object doing the picking up |
| 3686 | PickerPoint - the attach point on the picker |
| 3687 | Pickee - the object being picked up |
| 3688 | PickeePoint - the attach point on the pickee |
| 3689 | Aligned - if true, aligns the two object |
| 3690 | Priority - if High, overrides the default goals; if Low, does only when the object has no other enabled goals |
| 3691 | Flags - the flags for this goal |
| 3692 | GoalID - an ID for this goal |
| 3693 | $$END |
| 3694 | */ |
| 3695 | void aAIGoalPickUpObjectcxx . . $ aAIGoalPickUpObject(da774757f55f3ae3).(int pickerhandle, int pickerpoint, int pickeehandle, int pickeepoint, bool aligned, int slot, |
| 3696 | int flags, int goalid) { |
| 3697 | AI_AddGoalcxx . . $ AI_AddGoal.(pickerhandle, AIG_ATTACH_TO_OBJcxx . . $ `Descent3/aistruct_external.h:184:9`!, slot, DEFAULT_INFLUENCEcxx . . $ `scripts/DallasFuncs.cpp:3464:9`!, goalid, flags, pickeehandle, pickerpoint, |
| 3698 | pickeepoint, 0.0, aligned, 0); |
| 3699 | } |
| 3700 | |
| 3701 | /* |
| 3702 | $$ACTION |
| 3703 | AI |
| 3704 | Make object [o:Picker] (attachpoint [i:CarriedObjectPoint]) be set down onto object [o:LandOnObject] (attachpoint = |
| 3705 | [i:LandOnPoint]); Priority = [e:GoalPriority=3], Flags = [g:AIGoalFlags:463253], GoalID = [e:GoalID=-1] |
| 3706 | aAIGoalSetObjectOnObject |
| 3707 | Make object pick up object |
| 3708 | Make one object pick up another |
| 3709 | |
| 3710 | Parameters: |
| 3711 | Picker - the object doing the picking up |
| 3712 | CarriedObjectPoint - the attach point on the picker |
| 3713 | LandOnObject - the object being picked up |
| 3714 | LandOnPoint - the attach point on the pickee |
| 3715 | Priority - if High, overrides the default goals; if Low, does only when the object has no other enabled goals |
| 3716 | Flags - the flags for this goal |
| 3717 | GoalID - an ID for this goal |
| 3718 | $$END |
| 3719 | */ |
| 3720 | void aAIGoalSetObjectOnObjectcxx . . $ aAIGoalSetObjectOnObject(46e3349fa2177d8f).(int pickerhandle, int pickerpoint, int pickeehandle, int pickeepoint, int slot, int flags, |
| 3721 | int goalid) { |
| 3722 | AI_AddGoalcxx . . $ AI_AddGoal.(pickerhandle, AIG_PLACE_OBJ_ON_OBJcxx . . $ `Descent3/aistruct_external.h:189:9`!, slot, DEFAULT_INFLUENCEcxx . . $ `scripts/DallasFuncs.cpp:3464:9`!, goalid, flags, pickeehandle, pickerpoint, |
| 3723 | pickeepoint, 0.0, true, 0); |
| 3724 | } |
| 3725 | |
| 3726 | /* |
| 3727 | $$ACTION |
| 3728 | AI |
| 3729 | Make object [o:LandingObject] (attachpoint [i:LanderAttachPoint]) land on object [o:ObjectToLandOn] (attachpoint = |
| 3730 | [i:LandOnObjectAttachPoint]); Priority = [e:GoalPriority=3], Flags = [g:AIGoalFlags:463253], GoalID = [e:GoalID=-1] |
| 3731 | aAIGoalLandOnObject |
| 3732 | Make an object land on another object |
| 3733 | Make one object and on another object |
| 3734 | |
| 3735 | Parameters: |
| 3736 | LandingObject - the object that is going to land |
| 3737 | LanderAttachPoint - the attach point that the landing object uses |
| 3738 | ObjectToLandOn - the object being landed on |
| 3739 | LandOnObjectAttachPoint - the attach point of the object being landed on |
| 3740 | Priority - if High, overrides the default goals; if Low, does only when the object has no other enabled goals |
| 3741 | Flags - the flags for this goal |
| 3742 | GoalID - an ID for this goal |
| 3743 | $$END |
| 3744 | */ |
| 3745 | void aAIGoalLandOnObjectcxx . . $ aAIGoalLandOnObject(46e3349fa2177d8f).(int pickerhandle, int pickerpoint, int pickeehandle, int pickeepoint, int slot, int flags, |
| 3746 | int goalid) { |
| 3747 | AI_AddGoalcxx . . $ AI_AddGoal.(pickerhandle, AIG_ATTACH_TO_OBJcxx . . $ `Descent3/aistruct_external.h:184:9`!, slot, DEFAULT_INFLUENCEcxx . . $ `scripts/DallasFuncs.cpp:3464:9`!, goalid, flags | GF_IS_ATTACH_CHILDcxx . . $ `Descent3/aistruct_external.h:244:9`!, pickeehandle, |
| 3748 | pickerpoint, pickeepoint, 0.0, true, 0); |
| 3749 | } |
| 3750 | |
| 3751 | /* |
| 3752 | $$ACTION |
| 3753 | AI |
| 3754 | Make object [o:Picker] (attachpoint [i:PickerPoint]) pick up object [o:Pickee] with radius = [p:RadiusRatio=1.0]; |
| 3755 | Priority = [e:GoalPriority=3], Flags = [g:AIGoalFlags:463253], GoalID = [e:GoalID=-1] aAIGoalPickUpObjectRad Make object |
| 3756 | pick up object Make one object pick up another |
| 3757 | |
| 3758 | Parameters: |
| 3759 | Picker - the object doing the picking up |
| 3760 | PickerPoint - the attach point on the picker |
| 3761 | Pickee - the object being picked up |
| 3762 | RadiusRatio - how close to hold the object relative to the object's size |
| 3763 | Priority - if High, overrides the default goals; if Low, does only when the object has no other enabled goals |
| 3764 | Flags - the flags for this goal |
| 3765 | GoalID - an ID for this goal |
| 3766 | $$END |
| 3767 | */ |
| 3768 | void aAIGoalPickUpObjectRadcxx . . $ aAIGoalPickUpObjectRad(5af2683e1dd7d9e5).(int pickerhandle, int pickerpoint, int pickeehandle, float radius, int slot, int flags, |
| 3769 | int goalid) { |
| 3770 | AI_AddGoalcxx . . $ AI_AddGoal.(pickerhandle, AIG_ATTACH_TO_OBJcxx . . $ `Descent3/aistruct_external.h:184:9`!, slot, DEFAULT_INFLUENCEcxx . . $ `scripts/DallasFuncs.cpp:3464:9`!, goalid, flags, pickeehandle, pickerpoint, -1, |
| 3771 | radius, 0, 1); |
| 3772 | } |
| 3773 | |
| 3774 | /* |
| 3775 | $$ACTION |
| 3776 | Objects |
| 3777 | [e:Set/Clear=1] Physics Flags [g:PhysicsFlags=0] for Object [o:Object] |
| 3778 | aPhysFlags |
| 3779 | Set/Clear Physics flags |
| 3780 | Sets or and clears physics flags |
| 3781 | |
| 3782 | Parameters: |
| 3783 | Set/Clear - Set or Clear the specified flags |
| 3784 | PhysicsFlags - the flags to either set or clear (other flags are not effected) |
| 3785 | Object - The object of which you want to alter the physics flags |
| 3786 | $$END |
| 3787 | */ |
| 3788 | void aPhysFlagscxx . . $ aPhysFlags(b1146eedae1e1d0b).(int set, int flags, int handle) { |
| 3789 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(handle, (set) ? VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`! : VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, OBJV_I_PHYSICS_FLAGScxx . . $ `scripts/osiris_common.h:641:9`!, &flags); |
| 3790 | } |
| 3791 | |
| 3792 | /* |
| 3793 | $$ACTION |
| 3794 | Cinematics |
| 3795 | Simple letterbox format cinematic, using path [h:CameraPath], with text [s:Text] targeting [o:Target] for |
| 3796 | [f:Seconds=10.0f] has fade in [b:FadeIn] aCinematicSimple CinematicSimple This creates a simple cinematic, in Letterbox |
| 3797 | mode. The camera will follow the given path. And the given text will be shown at the bottom of the screen. There is no |
| 3798 | 'quick exit' by keypress. To do more than one line of text, seperate each line of text using a pipe ('|'). |
| 3799 | |
| 3800 | Parameters: |
| 3801 | CameraPath: The path the camera should follow |
| 3802 | Text: The text to be displayed on the screen |
| 3803 | Target: Object to target during the cinematic |
| 3804 | Seconds: how long the cinematic should last |
| 3805 | FadeIn: If TRUE then the cinematic will fade in |
| 3806 | |
| 3807 | $$END |
| 3808 | */ |
| 3809 | void aCinematicSimplecxx . . $ aCinematicSimple(c7ae4e6e8283faf7).(int pathid, const char *Text, int Target, float Seconds, bool FadeIn = false) { |
| 3810 | tGameCinematiccxx . . $ tGameCinematic# info; |
| 3811 | |
| 3812 | info.flagscxx . . $ tGameCinematic#flags. = 0; |
| 3813 | info.flagscxx . . $ tGameCinematic#flags. = (GCF_LETTERBOXcxx . . $ `Descent3/gamecinematics_external.h:155:9`! | GCF_USEPATHcxx . . $ `Descent3/gamecinematics_external.h:159:9`! | GCF_TEXT_WIPEINcxx . . $ `Descent3/gamecinematics_external.h:163:9`! | GCF_LAYOUT_BOTTOMcxx . . $ `Descent3/gamecinematics_external.h:168:9`!); |
| 3814 | info.target_objhandlecxx . . $ tGameCinematic#target_objhandle. = Target; |
| 3815 | info.max_time_playcxx . . $ tGameCinematic#max_time_play. = Seconds; |
| 3816 | info.callbackcxx . . $ tGameCinematic#callback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3817 | info.text_displaycxx . . $ tGameCinematic#text_display..mincxx . . $ PercentageRange#min. = 0.40f; |
| 3818 | info.text_displaycxx . . $ tGameCinematic#text_display..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3819 | info.track_targetcxx . . $ tGameCinematic#track_target..mincxx . . $ PercentageRange#min. = 0.0f; |
| 3820 | info.track_targetcxx . . $ tGameCinematic#track_target..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3821 | info.player_disabledcxx . . $ tGameCinematic#player_disabled..mincxx . . $ PercentageRange#min. = 0.0f; |
| 3822 | info.player_disabledcxx . . $ tGameCinematic#player_disabled..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3823 | info.in_camera_viewcxx . . $ tGameCinematic#in_camera_view..mincxx . . $ PercentageRange#min. = 0.0f; |
| 3824 | info.in_camera_viewcxx . . $ tGameCinematic#in_camera_view..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3825 | info.quick_exitcxx . . $ tGameCinematic#quick_exit..mincxx . . $ PercentageRange#min. = 1.0f; |
| 3826 | info.quick_exitcxx . . $ tGameCinematic#quick_exit..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3827 | info.end_transitioncxx . . $ tGameCinematic#end_transition. = GCTT_FADEINOUTcxx . . $ `Descent3/gamecinematics_external.h:191:9`!; |
| 3828 | info.start_transitioncxx . . $ tGameCinematic#start_transition. = (FadeIn) ? GCTT_FADEcxx . . $ `Descent3/gamecinematics_external.h:190:9`! : GCTT_NONEcxx . . $ `Descent3/gamecinematics_external.h:188:9`!; |
| 3829 | info.pathidcxx . . $ tGameCinematic#pathid. = pathid; |
| 3830 | |
| 3831 | Cine_Startcxx . . $ Cine_Start.(&info, Text); |
| 3832 | } |
| 3833 | |
| 3834 | /* |
| 3835 | $$ACTION |
| 3836 | Cinematics |
| 3837 | Introduction fly-in using path [h:CameraPath], with text [s:Text] following player position [o:TotallyNotUsedTarget] on |
| 3838 | [h:PlayerPath] for [f:Seconds=10.0f]. aCinematicIntro CinematicIntro THE TARGET IS NOT USED, IT'S HERE FOR BACKWARD |
| 3839 | COMPATIBILITY This starts a level introduction cinematic. The camera will follow the given path. And the given text will |
| 3840 | be shown at the bottom of the screen. There is a 'quick exit' by keypress, after the first quarter of the cinematic is |
| 3841 | done. To do more than one line of text, seperate each line of text using a pipe ('|'). |
| 3842 | |
| 3843 | Parameters: |
| 3844 | ONCE AGAIN, THE TARGET IS NOT USED, IT'S HERE FOR BACKWARD COMPATIBILITY |
| 3845 | ONCE AGAIN, THE TARGET IS NOT USED, IT'S HERE FOR BACKWARD COMPATIBILITY |
| 3846 | CameraPath: The path the camera should follow |
| 3847 | Text: The text to be displayed on the screen |
| 3848 | Target: NO LONGER USED (it's the player object) |
| 3849 | PlayerPath: The path the target object should follow |
| 3850 | Seconds: how long the cinematic should last |
| 3851 | ONCE AGAIN, THE TARGET IS NOT USED, IT'S HERE FOR BACKWARD COMPATIBILITY |
| 3852 | ONCE AGAIN, THE TARGET IS NOT USED, IT'S HERE FOR BACKWARD COMPATIBILITY |
| 3853 | $$END |
| 3854 | */ |
| 3855 | void aCinematicIntrocxx . . $ aCinematicIntro(9a088fbb57c12d8e).(int camera_path, const char *Text, int NoLongerUserTarget, int PlayerPath, float Seconds) { |
| 3856 | tCannedCinematicInfocxx . . $ tCannedCinematicInfo# info; |
| 3857 | |
| 3858 | info.typecxx . . $ tCannedCinematicInfo#type. = CANNED_LEVEL_INTROcxx . . $ `Descent3/gamecinematics_external.h:93:9`!; |
| 3859 | info.camera_pathidcxx . . $ tCannedCinematicInfo#camera_pathid. = camera_path; |
| 3860 | info.target_pathidcxx . . $ tCannedCinematicInfo#target_pathid. = PlayerPath; |
| 3861 | info.text_to_displaycxx . . $ tCannedCinematicInfo#text_to_display. = Text; |
| 3862 | info.timecxx . . $ tCannedCinematicInfo#time. = Seconds; |
| 3863 | |
| 3864 | Cine_StartCannedcxx . . $ Cine_StartCanned.(&info); |
| 3865 | } |
| 3866 | |
| 3867 | /* |
| 3868 | $$ACTION |
| 3869 | Cinematics |
| 3870 | Stops the currently playing in-game cinematic |
| 3871 | aCinematicStop |
| 3872 | CinematicStop |
| 3873 | Stops a currently playing in-game cinematic, restoring everything |
| 3874 | $$END |
| 3875 | */ |
| 3876 | void aCinematicStopcxx . . $ aCinematicStop(49f6e7a06ebc5aa8).(void) { Cine_Stopcxx . . $ Cine_Stop.(); } |
| 3877 | |
| 3878 | class complex_cinematiccxx . . $ complex_cinematic# { |
| 3879 | public: |
| 3880 | complex_cinematiccxx . . $ complex_cinematic#complex_cinematic(49f6e7a06ebc5aa8).() { |
| 3881 | being_madecxx . . $ complex_cinematic#being_made. = false; |
| 3882 | memset(&infocxx . . $ complex_cinematic#info., 0, sizeof(tGameCinematiccxx . . $ tGameCinematic#)); |
| 3883 | } |
| 3884 | |
| 3885 | tGameCinematiccxx . . $ tGameCinematic# infocxx . . $ complex_cinematic#info.; |
| 3886 | bool being_madecxx . . $ complex_cinematic#being_made.; |
| 3887 | }; |
| 3888 | complex_cinematiccxx . . $ complex_cinematic# ccinematiccxx . . $ complex_cinematic#complex_cinematic(49f6e7a06ebc5aa8).; |
| 3889 | |
| 3890 | /* |
| 3891 | $$ACTION |
| 3892 | Cinematics |
| 3893 | Complex Cinematic: Start |
| 3894 | aComplexCinematicStart |
| 3895 | ComplexCinematicStart |
| 3896 | Starts the creation process of a 'complex' in-game cinematic. |
| 3897 | $$END |
| 3898 | */ |
| 3899 | void aComplexCinematicStartcxx . . $ aComplexCinematicStart(49f6e7a06ebc5aa8).(void) { |
| 3900 | ccinematiccxx . . $ ccinematic..being_madecxx . . $ complex_cinematic#being_made. = true; |
| 3901 | memset(&ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info., 0, sizeof(tGameCinematiccxx . . $ tGameCinematic#)); |
| 3902 | |
| 3903 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. = (GCF_LETTERBOXcxx . . $ `Descent3/gamecinematics_external.h:155:9`! | GCF_USEPATHcxx . . $ `Descent3/gamecinematics_external.h:159:9`! | GCF_TEXT_WIPEINcxx . . $ `Descent3/gamecinematics_external.h:163:9`! | GCF_LAYOUT_BOTTOMcxx . . $ `Descent3/gamecinematics_external.h:168:9`! | GCF_STOPIFTAGETDEADcxx . . $ `Descent3/gamecinematics_external.h:174:9`!); |
| 3904 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..target_objhandlecxx . . $ tGameCinematic#target_objhandle. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 3905 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..max_time_playcxx . . $ tGameCinematic#max_time_play. = 10.0f; |
| 3906 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..callbackcxx . . $ tGameCinematic#callback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3907 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..text_displaycxx . . $ tGameCinematic#text_display..mincxx . . $ PercentageRange#min. = 0.40f; |
| 3908 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..text_displaycxx . . $ tGameCinematic#text_display..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3909 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..track_targetcxx . . $ tGameCinematic#track_target..mincxx . . $ PercentageRange#min. = 0.0f; |
| 3910 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..track_targetcxx . . $ tGameCinematic#track_target..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3911 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..player_disabledcxx . . $ tGameCinematic#player_disabled..mincxx . . $ PercentageRange#min. = 0.0f; |
| 3912 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..player_disabledcxx . . $ tGameCinematic#player_disabled..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3913 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..in_camera_viewcxx . . $ tGameCinematic#in_camera_view..mincxx . . $ PercentageRange#min. = 0.0f; |
| 3914 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..in_camera_viewcxx . . $ tGameCinematic#in_camera_view..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3915 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..quick_exitcxx . . $ tGameCinematic#quick_exit..mincxx . . $ PercentageRange#min. = 1.0f; |
| 3916 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..quick_exitcxx . . $ tGameCinematic#quick_exit..maxcxx . . $ PercentageRange#max. = 1.0f; |
| 3917 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..end_transitioncxx . . $ tGameCinematic#end_transition. = GCTT_FADEINOUTcxx . . $ `Descent3/gamecinematics_external.h:191:9`!; |
| 3918 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..start_transitioncxx . . $ tGameCinematic#start_transition. = GCTT_NONEcxx . . $ `Descent3/gamecinematics_external.h:188:9`!; |
| 3919 | |
| 3920 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..pathidcxx . . $ tGameCinematic#pathid. = -1; |
| 3921 | } |
| 3922 | |
| 3923 | /* |
| 3924 | $$ACTION |
| 3925 | Cinematics |
| 3926 | Complex Cinematic: End, cinematic text: [s:Text] play time: [f:Seconds=10.0] |
| 3927 | aComplexCinematicEnd |
| 3928 | ComplexCinematicEnd |
| 3929 | Ends the creation process of a 'complex' in-game cinematic and starts it running. |
| 3930 | Params: |
| 3931 | Text: The text you want displayed during the cinematic |
| 3932 | Seconds: How long cinematic should play |
| 3933 | $$END |
| 3934 | */ |
| 3935 | void aComplexCinematicEndcxx . . $ aComplexCinematicEnd(42eacfea086a5352).(const char *Text, float Seconds) { |
| 3936 | if (!ccinematiccxx . . $ ccinematic..being_madecxx . . $ complex_cinematic#being_made.) |
| 3937 | return; |
| 3938 | |
| 3939 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..max_time_playcxx . . $ tGameCinematic#max_time_play. = Seconds; |
| 3940 | |
| 3941 | Cine_Startcxx . . $ Cine_Start.(&ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info., Text); |
| 3942 | ccinematiccxx . . $ ccinematic..being_madecxx . . $ complex_cinematic#being_made. = false; |
| 3943 | } |
| 3944 | |
| 3945 | /* |
| 3946 | $$ACTION |
| 3947 | Cinematics |
| 3948 | Complex Cinematic: Text Display Start [p:Start=0.4] until End [p:End=0.8] |
| 3949 | aComplexCinematicText |
| 3950 | ComplexCinematicText |
| 3951 | Determines the range (based on a percentage into the cinematic) that the text should display |
| 3952 | Params: |
| 3953 | Start: At what percentage of time into the cinematic should text start displaying |
| 3954 | End: At what percentage of time into the cinematic should text stop displaying |
| 3955 | $$END |
| 3956 | */ |
| 3957 | void aComplexCinematicTextcxx . . $ aComplexCinematicText(5102ef758adc0ae7).(float Start, float End) { |
| 3958 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..text_displaycxx . . $ tGameCinematic#text_display..mincxx . . $ PercentageRange#min. = Start; |
| 3959 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..text_displaycxx . . $ tGameCinematic#text_display..maxcxx . . $ PercentageRange#max. = End; |
| 3960 | } |
| 3961 | |
| 3962 | /* |
| 3963 | $$ACTION |
| 3964 | Cinematics |
| 3965 | Complex Cinematic: Track Target [o:Target] Start [p:Start=0.0] until End [p:End=1.0] |
| 3966 | aComplexCinematicTrack |
| 3967 | ComplexCinematicTrack |
| 3968 | Determines the range (based on a percentage into the cinematic) that the target should be tracked |
| 3969 | (NOTE: it should be the entire time...0->100% but you may feel different) |
| 3970 | Params: |
| 3971 | Target: Object to target |
| 3972 | Start: At what percentage of time into the cinematic should target be tracked |
| 3973 | End: At what percentage of time into the cinematic should target stop being tracked |
| 3974 | $$END |
| 3975 | */ |
| 3976 | void aComplexCinematicTrackcxx . . $ aComplexCinematicTrack(3b3943b4e4191a93).(int Target, float Start, float End) { |
| 3977 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..target_objhandlecxx . . $ tGameCinematic#target_objhandle. = Target; |
| 3978 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..track_targetcxx . . $ tGameCinematic#track_target..mincxx . . $ PercentageRange#min. = Start; |
| 3979 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..track_targetcxx . . $ tGameCinematic#track_target..maxcxx . . $ PercentageRange#max. = End; |
| 3980 | } |
| 3981 | |
| 3982 | /* |
| 3983 | $$ACTION |
| 3984 | Cinematics |
| 3985 | Complex Cinematic: Player Disabled Start [p:Start=0.0] until End [p:End=1.0] |
| 3986 | aComplexCinematicPlayerDisabled |
| 3987 | ComplexCinematicPlayerDisabled |
| 3988 | Determines the range (based on a percentage into the cinematic) that the player's |
| 3989 | controls are disabled. |
| 3990 | Params: |
| 3991 | Start: At what percentage of time into the cinematic should controls disable |
| 3992 | End: At what percentage of time into the cinematic should controls be renabled |
| 3993 | $$END |
| 3994 | */ |
| 3995 | void aComplexCinematicPlayerDisabledcxx . . $ aComplexCinematicPlayerDisabled(5102ef758adc0ae7).(float Start, float End) { |
| 3996 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..player_disabledcxx . . $ tGameCinematic#player_disabled..mincxx . . $ PercentageRange#min. = Start; |
| 3997 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..player_disabledcxx . . $ tGameCinematic#player_disabled..maxcxx . . $ PercentageRange#max. = End; |
| 3998 | } |
| 3999 | |
| 4000 | /* |
| 4001 | $$ACTION |
| 4002 | Cinematics |
| 4003 | Complex Cinematic: View From Camera Start [p:Start=0.0] until End [p:End=1.0] |
| 4004 | aComplexCinematicCameraView |
| 4005 | ComplexCinematicCameraView |
| 4006 | Determines the range (based on a percentage into the cinematic) that the view is from |
| 4007 | the camera |
| 4008 | Params: |
| 4009 | Start: At what percentage of time into the cinematic should the view be in the camera |
| 4010 | End: At what percentage of time into the cinematic should the view be back to the player |
| 4011 | $$END |
| 4012 | */ |
| 4013 | void aComplexCinematicCameraViewcxx . . $ aComplexCinematicCameraView(5102ef758adc0ae7).(float Start, float End) { |
| 4014 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..in_camera_viewcxx . . $ tGameCinematic#in_camera_view..mincxx . . $ PercentageRange#min. = Start; |
| 4015 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..in_camera_viewcxx . . $ tGameCinematic#in_camera_view..maxcxx . . $ PercentageRange#max. = End; |
| 4016 | } |
| 4017 | |
| 4018 | /* |
| 4019 | $$ACTION |
| 4020 | Cinematics |
| 4021 | Complex Cinematic: Quick Exit Start [p:Start=1.0] until End [p:End=1.0] |
| 4022 | aComplexCinematicQuickExit |
| 4023 | ComplexCinematicQuickExit |
| 4024 | Determines the range (based on a percentage into the cinematic) that the player can quick |
| 4025 | exit from the cinematic by pressing a key (usually 0%-100% or 100%-100%) |
| 4026 | Params: |
| 4027 | Start: At what percentage of time into the cinematic can the player quick exit |
| 4028 | End: At what percentage of time into the cinematic can't the player quick exit |
| 4029 | $$END |
| 4030 | */ |
| 4031 | void aComplexCinematicQuickExitcxx . . $ aComplexCinematicQuickExit(5102ef758adc0ae7).(float Start, float End) { |
| 4032 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..quick_exitcxx . . $ tGameCinematic#quick_exit..mincxx . . $ PercentageRange#min. = Start; |
| 4033 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..quick_exitcxx . . $ tGameCinematic#quick_exit..maxcxx . . $ PercentageRange#max. = End; |
| 4034 | } |
| 4035 | |
| 4036 | /* |
| 4037 | $$ENUM CineEndTransition |
| 4038 | 0:None |
| 4039 | 1:Wacky |
| 4040 | 2:Fade In |
| 4041 | 3:Fade Out/In |
| 4042 | $$END |
| 4043 | */ |
| 4044 | |
| 4045 | /* |
| 4046 | $$ACTION |
| 4047 | Cinematics |
| 4048 | Complex Cinematic: Set End Transition to [e:CineEndTransition=3] |
| 4049 | aComplexCinematicEndTrans |
| 4050 | ComplexCinematicEndTrans |
| 4051 | Sets the end transition setting. |
| 4052 | $$END |
| 4053 | */ |
| 4054 | void aComplexCinematicEndTranscxx . . $ aComplexCinematicEndTrans(d4f767463ce0a6b3).(int End) { ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..end_transitioncxx . . $ tGameCinematic#end_transition. = End; } |
| 4055 | |
| 4056 | /* |
| 4057 | $$ACTION |
| 4058 | Cinematics |
| 4059 | Complex Cinematic: Set Start Fade in to [b:Enable] |
| 4060 | aComplexCinematicStartTrans |
| 4061 | ComplexCinematicStartTrans |
| 4062 | Sets whether the cinematic should fade in to start |
| 4063 | $$END |
| 4064 | */ |
| 4065 | void aComplexCinematicStartTranscxx . . $ aComplexCinematicStartTrans(b45ddcbc8423892c).(bool Enable) { ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..start_transitioncxx . . $ tGameCinematic#start_transition. = (Enable) ? GCTT_FADEcxx . . $ `Descent3/gamecinematics_external.h:190:9`! : GCTT_NONEcxx . . $ `Descent3/gamecinematics_external.h:188:9`!; } |
| 4066 | |
| 4067 | /* |
| 4068 | $$ACTION |
| 4069 | Cinematics |
| 4070 | Complex Cinematic: Put Camera On Path [h:Path] |
| 4071 | aComplexCinematicCameraOnPath |
| 4072 | ComplexCinematicCameraOnPath |
| 4073 | Tells the cinematic that the camera should be on the given path |
| 4074 | $$END |
| 4075 | */ |
| 4076 | void aComplexCinematicCameraOnPathcxx . . $ aComplexCinematicCameraOnPath(d4f767463ce0a6b3).(int Path) { |
| 4077 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. |= GCF_USEPATHcxx . . $ `Descent3/gamecinematics_external.h:159:9`!; |
| 4078 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. &= ~GCF_USEPOINTcxx . . $ `Descent3/gamecinematics_external.h:160:9`!; |
| 4079 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..pathidcxx . . $ tGameCinematic#pathid. = Path; |
| 4080 | } |
| 4081 | |
| 4082 | /* |
| 4083 | $$ACTION |
| 4084 | Cinematics |
| 4085 | Complex Cinematic: Put Camera At Position [v:Position] in room [r:Room] |
| 4086 | aComplexCinematicCameraAtPoint |
| 4087 | ComplexCinematicCameraAtPoint |
| 4088 | Tells the cinematic that the camera should be on a point |
| 4089 | Params: |
| 4090 | Position: The position of the camera in the world |
| 4091 | Room: The room that that position is in |
| 4092 | $$END |
| 4093 | */ |
| 4094 | void aComplexCinematicCameraAtPointcxx . . $ aComplexCinematicCameraAtPoint(86b7faebfcd459cf).(vectorcxx . . $ vector# *Position, int Room) { |
| 4095 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. &= ~GCF_USEPATHcxx . . $ `Descent3/gamecinematics_external.h:159:9`!; |
| 4096 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. |= GCF_USEPOINTcxx . . $ `Descent3/gamecinematics_external.h:160:9`!; |
| 4097 | |
| 4098 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..positioncxx . . $ tGameCinematic#position. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). *Position; |
| 4099 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..roomcxx . . $ tGameCinematic#room. = Room; |
| 4100 | } |
| 4101 | |
| 4102 | /* |
| 4103 | $$ACTION |
| 4104 | Cinematics |
| 4105 | Complex Cinematic: Put Camera At Position in clipboard in room [r:Room] |
| 4106 | aComplexCinematicCameraAtStoredPt |
| 4107 | ComplexCinematicCameraAtStored Point |
| 4108 | Tells the cinematic that the camera should be on a point stored in clipboard |
| 4109 | Params: |
| 4110 | Room: The room that that position is in |
| 4111 | $$END |
| 4112 | */ |
| 4113 | void aComplexCinematicCameraAtStoredPtcxx . . $ aComplexCinematicCameraAtStoredPt(d4f767463ce0a6b3).(int Room) { |
| 4114 | if (!PositionClipboardcxx . . $ PositionClipboard..has_poscxx . . $ cPositionClipboard#has_pos.) |
| 4115 | return; |
| 4116 | |
| 4117 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. &= ~GCF_USEPATHcxx . . $ `Descent3/gamecinematics_external.h:159:9`!; |
| 4118 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. |= GCF_USEPOINTcxx . . $ `Descent3/gamecinematics_external.h:160:9`!; |
| 4119 | |
| 4120 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..positioncxx . . $ tGameCinematic#position. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos.; |
| 4121 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..roomcxx . . $ tGameCinematic#room. = Room; |
| 4122 | } |
| 4123 | |
| 4124 | /* |
| 4125 | $$ENUM CineScreenMode |
| 4126 | 0:LetterBox |
| 4127 | 1:FullScreen |
| 4128 | $$END |
| 4129 | */ |
| 4130 | |
| 4131 | /* |
| 4132 | $$ACTION |
| 4133 | Cinematics |
| 4134 | Complex Cinematic: Set Screen Mode to [e:CineScreenMode=0] |
| 4135 | aComplexCinematicScreenMode |
| 4136 | ComplexCinematicScreenMode |
| 4137 | Sets what type of screen mode the cinematic should be in |
| 4138 | $$END |
| 4139 | */ |
| 4140 | void aComplexCinematicScreenModecxx . . $ aComplexCinematicScreenMode(d4f767463ce0a6b3).(int Mode) { |
| 4141 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. &= ~GCF_SCREENFORMATcxx . . $ `Descent3/gamecinematics_external.h:157:9`!; |
| 4142 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. |= Mode; |
| 4143 | } |
| 4144 | |
| 4145 | /* |
| 4146 | $$ENUM CineTextMode |
| 4147 | 0:None |
| 4148 | 4:WipeIn |
| 4149 | 8:FadeInOut |
| 4150 | $$END |
| 4151 | */ |
| 4152 | |
| 4153 | /* |
| 4154 | $$ACTION |
| 4155 | Cinematics |
| 4156 | Complex Cinematic: Set Text Display Mode to [e:CineTextMode=8] |
| 4157 | aComplexCinematicTextMode |
| 4158 | ComplexCinematicTextMode |
| 4159 | Sets what type of text effect the cinematic should use |
| 4160 | $$END |
| 4161 | */ |
| 4162 | void aComplexCinematicTextModecxx . . $ aComplexCinematicTextMode(d4f767463ce0a6b3).(int Mode) { |
| 4163 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. &= ~GCF_TEXT_MASKcxx . . $ `Descent3/gamecinematics_external.h:166:9`!; |
| 4164 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. |= Mode; |
| 4165 | } |
| 4166 | |
| 4167 | /* |
| 4168 | $$ENUM CineTextLayoutMode |
| 4169 | 0:Bottom |
| 4170 | 16:Top |
| 4171 | 32:Middle |
| 4172 | 64:Low |
| 4173 | $$END |
| 4174 | */ |
| 4175 | |
| 4176 | /* |
| 4177 | $$ACTION |
| 4178 | Cinematics |
| 4179 | Complex Cinematic: Set Text Screen Layout to [e:CineTextLayoutMode=0] |
| 4180 | aComplexCinematicTextLayoutMode |
| 4181 | ComplexCinematicTextLayoutMode |
| 4182 | Sets what type of text layout the cinematic should use |
| 4183 | $$END |
| 4184 | */ |
| 4185 | void aComplexCinematicTextLayoutModecxx . . $ aComplexCinematicTextLayoutMode(d4f767463ce0a6b3).(int Mode) { |
| 4186 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. &= ~GCF_LAYOUT_MASKcxx . . $ `Descent3/gamecinematics_external.h:172:9`!; |
| 4187 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. |= Mode; |
| 4188 | } |
| 4189 | |
| 4190 | /* |
| 4191 | $$FLAG CinematicFlags |
| 4192 | 256:Stop If Target Is Dead |
| 4193 | 512:Force Target To End of Path on Quick Exit |
| 4194 | $$END |
| 4195 | */ |
| 4196 | |
| 4197 | /* |
| 4198 | $$ACTION |
| 4199 | Cinematics |
| 4200 | Complex Cinematic: Flags: [g:CinematicFlags=256:768] |
| 4201 | aComplexCinematicFlags |
| 4202 | ComplexCinematicFlags |
| 4203 | Sets special flags for the cinematic |
| 4204 | $$END |
| 4205 | */ |
| 4206 | void aComplexCinematicFlagscxx . . $ aComplexCinematicFlags(d4f767463ce0a6b3).(int flags) { |
| 4207 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. &= ~(GCF_STOPIFTAGETDEADcxx . . $ `Descent3/gamecinematics_external.h:174:9`! | GCF_FORCETARGETTOENDcxx . . $ `Descent3/gamecinematics_external.h:175:9`!); |
| 4208 | ccinematiccxx . . $ ccinematic..infocxx . . $ complex_cinematic#info..flagscxx . . $ tGameCinematic#flags. |= flags; |
| 4209 | } |
| 4210 | |
| 4211 | /* |
| 4212 | $$ACTION |
| 4213 | Mission |
| 4214 | Enable the given ship [a:Ship], so it can be chosen in single player |
| 4215 | aEnableShip |
| 4216 | EnableShip |
| 4217 | Enables a ship (given it's name) so it can be chosen in |
| 4218 | single player ship selection dialog. |
| 4219 | |
| 4220 | Parameters: |
| 4221 | Ship: The name of the ship you want to enable |
| 4222 | $$END |
| 4223 | */ |
| 4224 | void aEnableShipcxx . . $ aEnableShip(85c52e162fed56f9).(const char *Ship) { |
| 4225 | // this doesn't have to be multiplayer friendly, since it's a single |
| 4226 | // player only thing |
| 4227 | Game_EnableShipcxx . . $ Game_EnableShip.(Ship, true); |
| 4228 | } |
| 4229 | |
| 4230 | /* |
| 4231 | $$ACTION |
| 4232 | Mission |
| 4233 | Disable the given ship [a:Ship], so it can't be chosen in single player |
| 4234 | aDisableShip |
| 4235 | DisableShip |
| 4236 | Disables a ship (given it's name) so it can't be chosen in |
| 4237 | single player ship selection dialog. |
| 4238 | |
| 4239 | Parameters: |
| 4240 | Ship: The name of the ship you want to disable |
| 4241 | |
| 4242 | $$END |
| 4243 | */ |
| 4244 | void aDisableShipcxx . . $ aDisableShip(85c52e162fed56f9).(const char *Ship) { |
| 4245 | // this doesn't have to be multiplayer friendly, since it's a single |
| 4246 | // player only thing |
| 4247 | Game_EnableShipcxx . . $ Game_EnableShip.(Ship, false); |
| 4248 | } |
| 4249 | |
| 4250 | /* |
| 4251 | $$ACTION |
| 4252 | Triggers |
| 4253 | [e:Enable/Disable] trigger [t:Trigger] |
| 4254 | aTriggerSetState |
| 4255 | Enable/Disable a trigger |
| 4256 | Enables or disables the specified trigger |
| 4257 | |
| 4258 | Parameters: |
| 4259 | Enable/Disable: whether to enable or disable the trigger |
| 4260 | Trigger: which trigger to set |
| 4261 | $$END |
| 4262 | */ |
| 4263 | void aTriggerSetStatecxx . . $ aTriggerSetState(3e454b8ccf442868).(int state, int trigger_num) { |
| 4264 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4265 | |
| 4266 | mstruct.trigger_numcxx . . $ msafe_struct#trigger_num. = trigger_num; |
| 4267 | mstruct.statecxx . . $ msafe_struct#state. = state; |
| 4268 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_TRIGGER_SETcxx . . $ `scripts/osiris_common.h:879:9`!, &mstruct); |
| 4269 | } |
| 4270 | |
| 4271 | /* |
| 4272 | $$ACTION |
| 4273 | Players |
| 4274 | Add [o:Object] to [o:PlayerObject]'s inventory, Spewable when player dies [b:Spewable=FALSE] |
| 4275 | aAddObjectToInventory |
| 4276 | Adds a specific object to a player's inventory |
| 4277 | |
| 4278 | Parameters: |
| 4279 | Object: Object to add |
| 4280 | PlayerObject: Player to get object |
| 4281 | Spewable: Whether the object should be spewed from the inventory when the player dies |
| 4282 | $$END |
| 4283 | */ |
| 4284 | void aAddObjectToInventorycxx . . $ aAddObjectToInventory(6908015b96d379c0).(int Object, int PlayerObject, bool Spewable) { |
| 4285 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4286 | |
| 4287 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = PlayerObject; |
| 4288 | mstruct.ithandlecxx . . $ msafe_struct#ithandle. = Object; |
| 4289 | mstruct.messagecxx . . $ msafe_struct#message.[0] = '\0'; // no name |
| 4290 | |
| 4291 | if (Spewable) |
| 4292 | mstruct.flagscxx . . $ msafe_struct#flags. = 0; |
| 4293 | else |
| 4294 | mstruct.flagscxx . . $ msafe_struct#flags. = INVAF_NOTSPEWABLEcxx . . $ `scripts/osiris_common.h:765:9`!; |
| 4295 | |
| 4296 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_INVEN_ADD_OBJECTcxx . . $ `scripts/osiris_common.h:902:9`!, &mstruct); |
| 4297 | } |
| 4298 | |
| 4299 | /* |
| 4300 | $$ACTION |
| 4301 | Players |
| 4302 | Add [o:Object] to [o:PlayerObject]'s inventory with name [s:ItemName], Spewable when player dies [b:Spewable=FALSE] |
| 4303 | aAddObjectToInventoryNamed |
| 4304 | Adds a specific object to a player's inventory with a custom name |
| 4305 | |
| 4306 | Parameters: |
| 4307 | Object: Object to add |
| 4308 | PlayerObject: Player to get object |
| 4309 | ItemName: The name for this object |
| 4310 | Spewable: Whether the object should be spewed from the inventory when the player dies |
| 4311 | $$END |
| 4312 | */ |
| 4313 | void aAddObjectToInventoryNamedcxx . . $ aAddObjectToInventoryNamed(455aa33a27fe54a6).(int Object, int PlayerObject, const char *name, bool Spewable) { |
| 4314 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4315 | |
| 4316 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = PlayerObject; |
| 4317 | mstruct.ithandlecxx . . $ msafe_struct#ithandle. = Object; |
| 4318 | |
| 4319 | strncpy(mstruct.messagecxx . . $ msafe_struct#message., name, sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1); |
| 4320 | mstruct.messagecxx . . $ msafe_struct#message.[sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1] = '\0'; |
| 4321 | |
| 4322 | if (Spewable) |
| 4323 | mstruct.flagscxx . . $ msafe_struct#flags. = 0; |
| 4324 | else |
| 4325 | mstruct.flagscxx . . $ msafe_struct#flags. = INVAF_NOTSPEWABLEcxx . . $ `scripts/osiris_common.h:765:9`!; |
| 4326 | |
| 4327 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_INVEN_ADD_OBJECTcxx . . $ `scripts/osiris_common.h:902:9`!, &mstruct); |
| 4328 | } |
| 4329 | |
| 4330 | /* |
| 4331 | $$ACTION |
| 4332 | Players |
| 4333 | Remove [o:Object] from [o:PlayerObject]'s inventory |
| 4334 | aRemoveObjectFromInventory |
| 4335 | Removes a specific object from a player's inventory |
| 4336 | |
| 4337 | Parameters: |
| 4338 | Object: Object to remove |
| 4339 | PlayerObject: Which Player |
| 4340 | $$END |
| 4341 | */ |
| 4342 | void aRemoveObjectFromInventorycxx . . $ aRemoveObjectFromInventory(3e454b8ccf442868).(int Object, int PlayerObject) { |
| 4343 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4344 | |
| 4345 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = PlayerObject; |
| 4346 | mstruct.ithandlecxx . . $ msafe_struct#ithandle. = Object; |
| 4347 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_INVEN_REMOVE_OBJECTcxx . . $ `scripts/osiris_common.h:904:9`!, &mstruct); |
| 4348 | } |
| 4349 | |
| 4350 | /* |
| 4351 | $$ACTION |
| 4352 | Objects |
| 4353 | Store [o:Object] position in position clipboard |
| 4354 | aStoreObjectInPositionClipboard |
| 4355 | Stores the position of an object in the internal 'clipboard' |
| 4356 | |
| 4357 | Parameters: |
| 4358 | Object: object whose position you want to store |
| 4359 | $$END |
| 4360 | */ |
| 4361 | void aStoreObjectInPositionClipboardcxx . . $ aStoreObjectInPositionClipboard(d4f767463ce0a6b3).(int Object) { |
| 4362 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4363 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = Object; |
| 4364 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_WORLD_POSITIONcxx . . $ `scripts/osiris_common.h:846:9`!, &mstruct); |
| 4365 | |
| 4366 | PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 4367 | PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). mstruct.orientcxx . . $ msafe_struct#orient.; |
| 4368 | PositionClipboardcxx . . $ PositionClipboard..roomcxx . . $ cPositionClipboard#room. = mstruct.roomnumcxx . . $ msafe_struct#roomnum.; |
| 4369 | PositionClipboardcxx . . $ PositionClipboard..has_poscxx . . $ cPositionClipboard#has_pos. = true; |
| 4370 | } |
| 4371 | |
| 4372 | /* |
| 4373 | $$ACTION |
| 4374 | Objects |
| 4375 | Move [o:Object] to position in position clipboard |
| 4376 | aMoveObjectToPositionClipboard |
| 4377 | Moves an object to the position stored in the internal 'clipboard' |
| 4378 | |
| 4379 | Parameters: |
| 4380 | Object: object whose position you want to change |
| 4381 | $$END |
| 4382 | */ |
| 4383 | void aMoveObjectToPositionClipboardcxx . . $ aMoveObjectToPositionClipboard(d4f767463ce0a6b3).(int Object) { |
| 4384 | if (!PositionClipboardcxx . . $ PositionClipboard..has_poscxx . . $ cPositionClipboard#has_pos.) |
| 4385 | return; |
| 4386 | |
| 4387 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4388 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = Object; |
| 4389 | mstruct.poscxx . . $ msafe_struct#pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). PositionClipboardcxx . . $ PositionClipboard..poscxx . . $ cPositionClipboard#pos.; |
| 4390 | mstruct.orientcxx . . $ msafe_struct#orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). PositionClipboardcxx . . $ PositionClipboard..orientcxx . . $ cPositionClipboard#orient.; |
| 4391 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = PositionClipboardcxx . . $ PositionClipboard..roomcxx . . $ cPositionClipboard#room.; |
| 4392 | |
| 4393 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_WORLD_POSITIONcxx . . $ `scripts/osiris_common.h:846:9`!, &mstruct); |
| 4394 | } |
| 4395 | |
| 4396 | /* |
| 4397 | $$ACTION |
| 4398 | Objects |
| 4399 | Cloak [o:Object] for [f:Seconds] seconds |
| 4400 | aCloakObject |
| 4401 | Cloaks an object for the time specified. |
| 4402 | |
| 4403 | Parameters: |
| 4404 | Object: object to cloak |
| 4405 | Seconds: how long should it be cloaked |
| 4406 | $$END |
| 4407 | */ |
| 4408 | void aCloakObjectcxx . . $ aCloakObject(43c79ee2f1b9aefe).(int Object, float Seconds) { |
| 4409 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4410 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = Object; |
| 4411 | mstruct.statecxx . . $ msafe_struct#state. = 1; |
| 4412 | mstruct.lifetimecxx . . $ msafe_struct#lifetime. = Seconds; |
| 4413 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_CLOAKcxx . . $ `scripts/osiris_common.h:837:9`!, &mstruct); |
| 4414 | } |
| 4415 | |
| 4416 | /* |
| 4417 | $$ACTION |
| 4418 | Objects |
| 4419 | UnCloak [o:Object] |
| 4420 | aUnCloakObject |
| 4421 | UnCloaks an object |
| 4422 | |
| 4423 | Parameters: |
| 4424 | Object: object to uncloak |
| 4425 | $$END |
| 4426 | */ |
| 4427 | void aUnCloakObjectcxx . . $ aUnCloakObject(d4f767463ce0a6b3).(int Object) { |
| 4428 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4429 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = Object; |
| 4430 | mstruct.statecxx . . $ msafe_struct#state. = 0; |
| 4431 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_CLOAKcxx . . $ `scripts/osiris_common.h:837:9`!, &mstruct); |
| 4432 | } |
| 4433 | |
| 4434 | /* |
| 4435 | $$ACTION |
| 4436 | Players |
| 4437 | Cloak all players for [f:Seconds] seconds |
| 4438 | aCloakAllPlayers |
| 4439 | Cloaks all the Players in the game |
| 4440 | |
| 4441 | Parameters: |
| 4442 | Seconds: how long should the players be cloaked |
| 4443 | $$END |
| 4444 | */ |
| 4445 | void aCloakAllPlayerscxx . . $ aCloakAllPlayers(9364e6e7bff7660).(float Seconds) { |
| 4446 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4447 | mstruct.statecxx . . $ msafe_struct#state. = 1; |
| 4448 | mstruct.lifetimecxx . . $ msafe_struct#lifetime. = Seconds; |
| 4449 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_CLOAKALLPLAYERScxx . . $ `scripts/osiris_common.h:832:9`!, &mstruct); |
| 4450 | } |
| 4451 | |
| 4452 | /* |
| 4453 | $$ACTION |
| 4454 | Players |
| 4455 | UnCloak all players |
| 4456 | aUnCloakAllPlayers |
| 4457 | UnCloaks all the Players in the game |
| 4458 | |
| 4459 | $$END |
| 4460 | */ |
| 4461 | void aUnCloakAllPlayerscxx . . $ aUnCloakAllPlayers(49f6e7a06ebc5aa8).(void) { |
| 4462 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4463 | mstruct.statecxx . . $ msafe_struct#state. = 0; |
| 4464 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_CLOAKALLPLAYERScxx . . $ `scripts/osiris_common.h:832:9`!, &mstruct); |
| 4465 | } |
| 4466 | |
| 4467 | /* |
| 4468 | $$ACTION |
| 4469 | Objects |
| 4470 | Set [o:Object] on Fire for [f:Seconds] doing [f:Damage] damage per second |
| 4471 | aSetObjectOnFire |
| 4472 | Sets an object on fire |
| 4473 | |
| 4474 | Parameters: |
| 4475 | Object = object to be set on fire |
| 4476 | Seconds = how long it should be on fire |
| 4477 | Damage = how much damage per second the fire should do |
| 4478 | $$END |
| 4479 | */ |
| 4480 | void aSetObjectOnFirecxx . . $ aSetObjectOnFire(3b3943b4e4191a93).(int obj, float seconds, float dps) { |
| 4481 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4482 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = obj; |
| 4483 | mstruct.longevitycxx . . $ msafe_struct#longevity. = seconds; |
| 4484 | mstruct.intervalcxx . . $ msafe_struct#interval. = dps; |
| 4485 | mstruct.ithandlecxx . . $ msafe_struct#ithandle. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 4486 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_SETONFIREcxx . . $ `scripts/osiris_common.h:849:9`!, &mstruct); |
| 4487 | } |
| 4488 | |
| 4489 | /* |
| 4490 | $$ACTION |
| 4491 | Objects |
| 4492 | Fire weapon [a:WeaponName] from gun number [i:GunNum] of object [o:Object] |
| 4493 | aObjFireWeapon |
| 4494 | Fire weapon |
| 4495 | Fires the specified weapon from the given gun number of an object |
| 4496 | |
| 4497 | Parameters: |
| 4498 | WeaponName - the weapon to fire |
| 4499 | GunNum - the gun number to fire from, or -1 to fire from the object's center |
| 4500 | Object - the object to fire the flare |
| 4501 | $$END |
| 4502 | */ |
| 4503 | void aObjFireWeaponcxx . . $ aObjFireWeapon(7b85637613228108).(const char *weapon_name, int gun_num, int objhandle) { |
| 4504 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4505 | |
| 4506 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 4507 | mstruct.indexcxx . . $ msafe_struct#index. = Wpn_FindIDcxx . . $ Wpn_FindID.(weapon_name); |
| 4508 | if (mstruct.indexcxx . . $ msafe_struct#index. == -1) |
| 4509 | return; |
| 4510 | mstruct.gunpointcxx . . $ msafe_struct#gunpoint. = gun_num; |
| 4511 | |
| 4512 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_FIRE_WEAPONcxx . . $ `scripts/osiris_common.h:857:9`!, &mstruct); |
| 4513 | } |
| 4514 | |
| 4515 | /* |
| 4516 | $$ACTION |
| 4517 | Objects |
| 4518 | Fire flare from gun number [i:GunNum] of object [o:Object] |
| 4519 | aObjFireFlare |
| 4520 | Fire flare |
| 4521 | Fires a flare from the given gun number of an object |
| 4522 | |
| 4523 | Parameters: |
| 4524 | GunNum - the gun number to fire from, or -1 to fire from the object's center |
| 4525 | Object - the object to fire the flare |
| 4526 | $$END |
| 4527 | */ |
| 4528 | #define aObjFireFlarecxx . . $ `scripts/DallasFuncs.cpp:4528:9`!(gun_num, objhandle) aObjFireWeapon("Yellow flare", gun_num, objhandle) |
| 4529 | |
| 4530 | //////////////////////////////////////////////////////////////////////////////////////////// |
| 4531 | // The following code is to handle a 'kill all object except these' Dallas command sequence. |
| 4532 | // these are beneficial for areas like Boss rooms with no escape or something, were it is |
| 4533 | // just nice to kill all objects in the level, except what is needed, for framerate |
| 4534 | // It will only kill robots in the level, except those designated to spare. |
| 4535 | |
| 4536 | struct tKillRobotListNodecxx . . $ tKillRobotListNode# { |
| 4537 | tKillObjectItemcxx . . $ tKillObjectItem# itemcxx . . $ tKillRobotListNode#item.; |
| 4538 | tKillRobotListNodecxx . . $ tKillRobotListNode# *nextcxx . . $ tKillRobotListNode#next.; |
| 4539 | }; |
| 4540 | |
| 4541 | class CKillRobotListcxx . . $ CKillRobotList# { |
| 4542 | public: |
| 4543 | CKillRobotListcxx . . $ CKillRobotList#CKillRobotList(49f6e7a06ebc5aa8).() { listcxx . . $ CKillRobotList#list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; }; |
| 4544 | ~cxx . . $ CKillRobotList#`~CKillRobotList`(ced63f7c635d850d).CKillRobotListcxx . . $ CKillRobotList#() { clearcxx . . $ CKillRobotList#clear(49f6e7a06ebc5aa8).(); } |
| 4545 | |
| 4546 | void clearcxx . . $ CKillRobotList#clear(49f6e7a06ebc5aa8).(void); |
| 4547 | void addcxx . . $ CKillRobotList#add(ccc817e5288bc4ea).(tKillObjectItemcxx . . $ tKillObjectItem# *data); |
| 4548 | |
| 4549 | tKillRobotListNodecxx . . $ tKillRobotListNode# *listcxx . . $ CKillRobotList#list.; |
| 4550 | }; |
| 4551 | CKillRobotListcxx . . $ CKillRobotList# KillRobotListcxx . . $ KillRobotList.; |
| 4552 | |
| 4553 | void CKillRobotListcxx . . $ CKillRobotList#::clearcxx . . $ CKillRobotList#clear(49f6e7a06ebc5aa8).(void) { |
| 4554 | tKillRobotListNodecxx . . $ tKillRobotListNode# *next, *curr = listcxx . . $ CKillRobotList#list.; |
| 4555 | |
| 4556 | while (curr) { |
| 4557 | next = curr->nextcxx . . $ tKillRobotListNode#next.; |
| 4558 | freecxx . . $ free(bd21765a0afc8e3c).(curr); |
| 4559 | curr = next; |
| 4560 | } |
| 4561 | |
| 4562 | listcxx . . $ CKillRobotList#list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 4563 | } |
| 4564 | |
| 4565 | void CKillRobotListcxx . . $ CKillRobotList#::addcxx . . $ CKillRobotList#add(ccc817e5288bc4ea).(tKillObjectItemcxx . . $ tKillObjectItem# *data) { |
| 4566 | tKillRobotListNodecxx . . $ tKillRobotListNode# *curr = listcxx . . $ CKillRobotList#list.; |
| 4567 | |
| 4568 | if (!curr) { |
| 4569 | listcxx . . $ CKillRobotList#list. = curr = (tKillRobotListNodecxx . . $ tKillRobotListNode# *)malloccxx . . $ malloc(9f008b2a9698428b).(sizeof(tKillRobotListNodecxx . . $ tKillRobotListNode#)); |
| 4570 | } else { |
| 4571 | while (curr->nextcxx . . $ tKillRobotListNode#next.) { |
| 4572 | curr = curr->nextcxx . . $ tKillRobotListNode#next.; |
| 4573 | } |
| 4574 | |
| 4575 | curr->nextcxx . . $ tKillRobotListNode#next. = (tKillRobotListNodecxx . . $ tKillRobotListNode# *)malloccxx . . $ malloc(9f008b2a9698428b).(sizeof(tKillRobotListNodecxx . . $ tKillRobotListNode#)); |
| 4576 | curr = curr->nextcxx . . $ tKillRobotListNode#next.; |
| 4577 | } |
| 4578 | |
| 4579 | if (!curr) |
| 4580 | return; |
| 4581 | |
| 4582 | curr->nextcxx . . $ tKillRobotListNode#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 4583 | memcpy(&curr->itemcxx . . $ tKillRobotListNode#item., data, sizeof(tKillObjectItemcxx . . $ tKillObjectItem#)); |
| 4584 | } |
| 4585 | |
| 4586 | /* |
| 4587 | $$ACTION |
| 4588 | Objects |
| 4589 | Destroy All Robots: Start |
| 4590 | aDestroyAllRobotsInit |
| 4591 | Initializes the "Destroy All Robots" DALLAS command sequence. Call this BEFORE doing |
| 4592 | any other of the "Destroy All Robots" commands. |
| 4593 | |
| 4594 | NOTE: It is VERY important that the entire command sequence happens all in the same |
| 4595 | action, and in proper order. |
| 4596 | $$END |
| 4597 | */ |
| 4598 | void aDestroyAllRobotsInitcxx . . $ aDestroyAllRobotsInit(49f6e7a06ebc5aa8).(void) { KillRobotListcxx . . $ KillRobotList..clearcxx . . $ CKillRobotList#clear(49f6e7a06ebc5aa8).(); } |
| 4599 | |
| 4600 | /* |
| 4601 | $$ACTION |
| 4602 | Objects |
| 4603 | Destroy All Robots: Spare robots of this type [a:RobotID] |
| 4604 | aDestroyAllRobotsSpareType |
| 4605 | Spares any robot that has if of the species given (i.e. Tubbs) |
| 4606 | |
| 4607 | Parameters: |
| 4608 | RobotID - the name of the group of robots to Spare |
| 4609 | $$END |
| 4610 | */ |
| 4611 | void aDestroyAllRobotsSpareTypecxx . . $ aDestroyAllRobotsSpareType(85c52e162fed56f9).(const char *name) { |
| 4612 | int id = Obj_FindIDcxx . . $ Obj_FindID.(name); |
| 4613 | |
| 4614 | if (id != -1) { |
| 4615 | tKillObjectItemcxx . . $ tKillObjectItem# item; |
| 4616 | item.info_typecxx . . $ tKillObjectItem#info_type. = KOI_IDcxx . . $ `scripts/osiris_common.h:1211:9`!; |
| 4617 | item.idcxx . . $ tKillObjectItem#id. = id; |
| 4618 | |
| 4619 | KillRobotListcxx . . $ KillRobotList..addcxx . . $ CKillRobotList#add(ccc817e5288bc4ea).(&item); |
| 4620 | } |
| 4621 | } |
| 4622 | |
| 4623 | /* |
| 4624 | $$ACTION |
| 4625 | Objects |
| 4626 | Destroy All Robots: Spare robot ([o:RobotHandle]) |
| 4627 | aDestroyAllRobotsSpareHandle |
| 4628 | Spares the robot with the given handle |
| 4629 | |
| 4630 | Parameters: |
| 4631 | RobotHandle - the handle of the robot to Spare |
| 4632 | $$END |
| 4633 | */ |
| 4634 | void aDestroyAllRobotsSpareHandlecxx . . $ aDestroyAllRobotsSpareHandle(d4f767463ce0a6b3).(int handle) { |
| 4635 | if (handle != OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!) { |
| 4636 | tKillObjectItemcxx . . $ tKillObjectItem# item; |
| 4637 | item.info_typecxx . . $ tKillObjectItem#info_type. = KOI_HANDLEcxx . . $ `scripts/osiris_common.h:1212:9`!; |
| 4638 | item.objhandlecxx . . $ tKillObjectItem#objhandle. = handle; |
| 4639 | |
| 4640 | KillRobotListcxx . . $ KillRobotList..addcxx . . $ CKillRobotList#add(ccc817e5288bc4ea).(&item); |
| 4641 | } |
| 4642 | } |
| 4643 | |
| 4644 | /* |
| 4645 | $$ACTION |
| 4646 | Objects |
| 4647 | Destroy All Robots: End |
| 4648 | aDestroyAllRobotsEnd |
| 4649 | Destroys the robots (except those spared) in the level |
| 4650 | |
| 4651 | $$END |
| 4652 | */ |
| 4653 | void aDestroyAllRobotsEndcxx . . $ aDestroyAllRobotsEnd(49f6e7a06ebc5aa8).(void) { |
| 4654 | tKillRobotListNodecxx . . $ tKillRobotListNode# *curr = KillRobotListcxx . . $ KillRobotList..listcxx . . $ CKillRobotList#list.; |
| 4655 | int count = 0; |
| 4656 | |
| 4657 | if (!curr) |
| 4658 | return; |
| 4659 | |
| 4660 | while (curr) { |
| 4661 | count++; |
| 4662 | curr = curr->nextcxx . . $ tKillRobotListNode#next.; |
| 4663 | } |
| 4664 | |
| 4665 | curr = KillRobotListcxx . . $ KillRobotList..listcxx . . $ CKillRobotList#list.; |
| 4666 | tKillObjectItemcxx . . $ tKillObjectItem# *kolist = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 4667 | |
| 4668 | kolist = (tKillObjectItemcxx . . $ tKillObjectItem# *)malloccxx . . $ malloc(9f008b2a9698428b).(sizeof(tKillObjectItemcxx . . $ tKillObjectItem#) * count); |
| 4669 | if (!kolist) |
| 4670 | return; |
| 4671 | |
| 4672 | count = 0; |
| 4673 | while (curr) { |
| 4674 | memcpy(&kolist[count], &curr->itemcxx . . $ tKillRobotListNode#item., sizeof(tKillObjectItemcxx . . $ tKillObjectItem#)); |
| 4675 | count++; |
| 4676 | curr = curr->nextcxx . . $ tKillRobotListNode#next.; |
| 4677 | } |
| 4678 | |
| 4679 | msafe_structcxx . . $ msafe_struct# ms; |
| 4680 | ms.countcxx . . $ msafe_struct#count. = count; |
| 4681 | ms.listcxx . . $ msafe_struct#list. = kolist; |
| 4682 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_DESTROY_ROBOTS_EXCEPTcxx . . $ `scripts/osiris_common.h:858:9`!, &ms); |
| 4683 | |
| 4684 | freecxx . . $ free(bd21765a0afc8e3c).(kolist); |
| 4685 | |
| 4686 | KillRobotListcxx . . $ KillRobotList..clearcxx . . $ CKillRobotList#clear(49f6e7a06ebc5aa8).(); |
| 4687 | } |
| 4688 | |
| 4689 | /* |
| 4690 | $$ACTION |
| 4691 | Objects |
| 4692 | [e:Enable/Disable] virus infections signs for [o:Object] |
| 4693 | aEnableVirusInfection |
| 4694 | Enables or disables the graphical effects related to an object being infected |
| 4695 | with a virus |
| 4696 | |
| 4697 | $$END |
| 4698 | */ |
| 4699 | void aEnableVirusInfectioncxx . . $ aEnableVirusInfection(3e454b8ccf442868).(int enable, int handle) { |
| 4700 | char cenable; |
| 4701 | cenable = (enable) ? 1 : 0; |
| 4702 | |
| 4703 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(handle, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, OBJV_C_VIRUS_INFECTEDcxx . . $ `scripts/osiris_common.h:650:9`!, &cenable); |
| 4704 | } |
| 4705 | |
| 4706 | /* |
| 4707 | $$ACTION |
| 4708 | Objects |
| 4709 | [e:Enable/Disable] negative lighting for [o:Object] |
| 4710 | aEnableNegativeLighting |
| 4711 | Enables or disables negative dynamic lighting (ala black hole) for the object |
| 4712 | |
| 4713 | $$END |
| 4714 | */ |
| 4715 | void aEnableNegativeLightingcxx . . $ aEnableNegativeLighting(3e454b8ccf442868).(int enable, int handle) { |
| 4716 | char cenable; |
| 4717 | cenable = (enable) ? 1 : 0; |
| 4718 | |
| 4719 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(handle, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, OBJV_C_NEGATIVE_LIGHTcxx . . $ `scripts/osiris_common.h:651:9`!, &cenable); |
| 4720 | } |
| 4721 | |
| 4722 | /* |
| 4723 | $$ACTION |
| 4724 | Players |
| 4725 | Strip all weapons and energy from player [o:Object] |
| 4726 | aStripWeaponsEnergy |
| 4727 | Removes all weapons (but lasers) and ammo, and reduces energy to 0. |
| 4728 | |
| 4729 | $$END |
| 4730 | */ |
| 4731 | void aStripWeaponsEnergycxx . . $ aStripWeaponsEnergy(d4f767463ce0a6b3).(int Object) { |
| 4732 | int val = 0; |
| 4733 | Player_Valuecxx . . $ Player_Value(504a19c195c7574e).(Object, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, PLYV_I_STRIP_WEAPONScxx . . $ `scripts/osiris_common.h:482:9`!, &val); |
| 4734 | } |
| 4735 | |
| 4736 | /* |
| 4737 | $$ACTION |
| 4738 | Players |
| 4739 | Strip all weapons and energy from all players |
| 4740 | aStripWeaponsEnergyFromAll |
| 4741 | Removes all weapons (but lasers) and ammo, and reduces energy to 0. |
| 4742 | |
| 4743 | $$END |
| 4744 | */ |
| 4745 | void aStripWeaponsEnergyFromAllcxx . . $ aStripWeaponsEnergyFromAll(49f6e7a06ebc5aa8).(void) { |
| 4746 | int val = -1; |
| 4747 | Player_Valuecxx . . $ Player_Value(504a19c195c7574e).(OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!, VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, PLYV_I_STRIP_WEAPONScxx . . $ `scripts/osiris_common.h:482:9`!, &val); |
| 4748 | } |
| 4749 | |
| 4750 | /* |
| 4751 | $$ACTION |
| 4752 | Rooms |
| 4753 | Remove all powerups from room [r:Room] |
| 4754 | aRemovePowerupsInRoom |
| 4755 | Removes all the powerups in the room given |
| 4756 | |
| 4757 | $$END |
| 4758 | */ |
| 4759 | void aRemovePowerupsInRoomcxx . . $ aRemovePowerupsInRoom(d4f767463ce0a6b3).(int Room) { |
| 4760 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4761 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = Room; |
| 4762 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_ROOM_REMOVE_ALL_POWERUPScxx . . $ `scripts/osiris_common.h:800:9`!, &mstruct); |
| 4763 | } |
| 4764 | |
| 4765 | /* |
| 4766 | $$QUERY |
| 4767 | Objects |
| 4768 | b:Is [o:Object] virus infected |
| 4769 | qVirusInfected |
| 4770 | Returns true if the object is showing signs of being infected by a virus |
| 4771 | |
| 4772 | $$END |
| 4773 | */ |
| 4774 | bool qVirusInfectedcxx . . $ qVirusInfected(83c267b20bac841a).(int handle) { |
| 4775 | char cenable; |
| 4776 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(handle, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_C_VIRUS_INFECTEDcxx . . $ `scripts/osiris_common.h:650:9`!, &cenable); |
| 4777 | |
| 4778 | return (cenable) ? true : false; |
| 4779 | } |
| 4780 | |
| 4781 | /* |
| 4782 | $$QUERY |
| 4783 | Objects |
| 4784 | b:Is [o:Object] giving off negative dynamic light (ala black hole) |
| 4785 | qNegativeLight |
| 4786 | Returns true if the object is giving off negative light, like a black hole (it is |
| 4787 | removing light from the world) |
| 4788 | |
| 4789 | $$END |
| 4790 | */ |
| 4791 | bool qNegativeLightcxx . . $ qNegativeLight(83c267b20bac841a).(int handle) { |
| 4792 | char cenable; |
| 4793 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(handle, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_C_NEGATIVE_LIGHTcxx . . $ `scripts/osiris_common.h:651:9`!, &cenable); |
| 4794 | |
| 4795 | return (cenable) ? true : false; |
| 4796 | } |
| 4797 | |
| 4798 | /* |
| 4799 | $$QUERY |
| 4800 | Mission |
| 4801 | i:Get difficulty level |
| 4802 | qGetDifficulty |
| 4803 | Returns the difficulty level (0 = trainee,4 = insane) |
| 4804 | |
| 4805 | $$END |
| 4806 | */ |
| 4807 | int qGetDifficultycxx . . $ qGetDifficulty(b126dc7c1de90089).(void) { return Game_GetDiffLevelcxx . . $ Game_GetDiffLevel.(); } |
| 4808 | |
| 4809 | /* |
| 4810 | Requested by Luke 1/15/99 |
| 4811 | |
| 4812 | PickupPowerup [OBJECT] |
| 4813 | -deletes powerup and plays powerup sound |
| 4814 | AddToInventory [OBJECT] |
| 4815 | -add powerup to the player's inventory |
| 4816 | Turn Fog in Room [ROOM] to [TRUE/FALSE] |
| 4817 | -turns on/off the fog flag |
| 4818 | Fade Fog in Room [ROOM] to Distance [DIST] and Color [RGB] over Time |
| 4819 | [TIME] |
| 4820 | -needs new code, but should be easy (like SetRoomFog over time) |
| 4821 | -ask Jason for new code if need be |
| 4822 | Fade Wind in Room [ROOM] to Direction [XYZ] over Time [TIME] |
| 4823 | -another new code one, but also easy (like SetRoomWind over time) |
| 4824 | -Jason also can help on this one |
| 4825 | AI: Fire when close [ROBOT], Distance [DIST] |
| 4826 | -Robot fires constantly when a player is within DIST meters |
| 4827 | |
| 4828 | */ |
| 4829 | |
| 4830 | /* |
| 4831 | |
| 4832 | MatcenSetStatus |
| 4833 | ChangeFaceTexture |
| 4834 | |
| 4835 | PlaySoundLoc3d |
| 4836 | TouchSound |
| 4837 | |
| 4838 | */ |
| 4839 | |
| 4840 | /* |
| 4841 | $$QUERY |
| 4842 | Objects |
| 4843 | f:[o:Object] cloak time left |
| 4844 | qObjectCloakTime |
| 4845 | |
| 4846 | Parameters: |
| 4847 | Object: object to get cloak time left (0 if it's not cloaked) |
| 4848 | $$END |
| 4849 | */ |
| 4850 | float qObjectCloakTimecxx . . $ qObjectCloakTime(5cde91ea12d43f46).(int Object) { |
| 4851 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4852 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = Object; |
| 4853 | mstruct.statecxx . . $ msafe_struct#state. = 0; |
| 4854 | mstruct.lifetimecxx . . $ msafe_struct#lifetime. = 0; |
| 4855 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_CLOAKcxx . . $ `scripts/osiris_common.h:837:9`!, &mstruct); |
| 4856 | |
| 4857 | return (mstruct.statecxx . . $ msafe_struct#state.) ? mstruct.lifetimecxx . . $ msafe_struct#lifetime. : 0; |
| 4858 | } |
| 4859 | |
| 4860 | /* |
| 4861 | $$QUERY |
| 4862 | Objects |
| 4863 | f:Get [o:Object] position on [e:Axis=0] axis |
| 4864 | qObjectPosition |
| 4865 | |
| 4866 | Parameters: |
| 4867 | Object: object to get cloak time left (0 if it's not cloaked) |
| 4868 | $$END |
| 4869 | */ |
| 4870 | float qObjectPositioncxx . . $ qObjectPosition(ac70f22789a9917c).(int handle, int axis) { |
| 4871 | float value = 0.0f; |
| 4872 | int type; |
| 4873 | |
| 4874 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(handle, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_I_TYPEcxx . . $ `scripts/osiris_common.h:626:9`!, &type); |
| 4875 | if (type != OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!) { |
| 4876 | vectorcxx . . $ vector# pos; |
| 4877 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(handle, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_V_POScxx . . $ `scripts/osiris_common.h:628:9`!, &pos); |
| 4878 | |
| 4879 | switch (axis) { |
| 4880 | case 0: |
| 4881 | value = pos.xcxx . . $ vector#x.; |
| 4882 | break; |
| 4883 | case 1: |
| 4884 | value = pos.ycxx . . $ vector#y.; |
| 4885 | break; |
| 4886 | case 2: |
| 4887 | value = pos.zcxx . . $ vector#z.; |
| 4888 | break; |
| 4889 | } |
| 4890 | } |
| 4891 | |
| 4892 | return value; |
| 4893 | } |
| 4894 | |
| 4895 | /* |
| 4896 | $$QUERY |
| 4897 | AI |
| 4898 | b:[o:Object] close to target |
| 4899 | qAICloseToTarget |
| 4900 | |
| 4901 | Parameters: |
| 4902 | Object: Is this object near its target |
| 4903 | $$END |
| 4904 | */ |
| 4905 | bool qAICloseToTargetcxx . . $ qAICloseToTarget(83c267b20bac841a).(int me) { |
| 4906 | int target = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 4907 | bool f_close = false; |
| 4908 | char ctype; |
| 4909 | int status; |
| 4910 | float awareness; |
| 4911 | |
| 4912 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(me, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_C_CONTROL_TYPEcxx . . $ `scripts/osiris_common.h:637:9`!, &ctype); |
| 4913 | if (ctype == CT_AIcxx . . $ `Descent3/object_external.h:217:9`!) { |
| 4914 | AI_Valuecxx . . $ AI_Value.(me, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, AIV_I_TARGET_HANDLEcxx . . $ `scripts/osiris_common.h:524:9`!, &target); |
| 4915 | if (target != OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!) { |
| 4916 | AI_Valuecxx . . $ AI_Value.(me, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, AIV_F_AWARENESScxx . . $ `scripts/osiris_common.h:555:9`!, &awareness); |
| 4917 | |
| 4918 | if (awareness >= AWARE_BARELYcxx . . $ `Descent3/aistruct_external.h:326:9`!) { |
| 4919 | AI_Valuecxx . . $ AI_Value.(me, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, AIV_I_STATUS_REGcxx . . $ `scripts/osiris_common.h:557:9`!, &status); |
| 4920 | f_close = ((status & AISR_CIRCLE_DISTcxx . . $ `Descent3/aistruct_external.h:396:9`!) != 0); |
| 4921 | } |
| 4922 | } |
| 4923 | } |
| 4924 | |
| 4925 | return f_close; |
| 4926 | } |
| 4927 | |
| 4928 | /* |
| 4929 | $$QUERY |
| 4930 | AI |
| 4931 | b:Is [o:Object] aware |
| 4932 | qAIIsObjectAware |
| 4933 | |
| 4934 | Parameters: |
| 4935 | Object: Is this object near its target |
| 4936 | $$END |
| 4937 | */ |
| 4938 | bool qAIIsObjectAwarecxx . . $ qAIIsObjectAware(83c267b20bac841a).(int me) { |
| 4939 | bool f_aware = false; |
| 4940 | char ctype; |
| 4941 | |
| 4942 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(me, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_C_CONTROL_TYPEcxx . . $ `scripts/osiris_common.h:637:9`!, &ctype); |
| 4943 | if (ctype == CT_AIcxx . . $ `Descent3/object_external.h:217:9`!) { |
| 4944 | float awareness; |
| 4945 | AI_Valuecxx . . $ AI_Value.(me, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, AIV_F_AWARENESScxx . . $ `scripts/osiris_common.h:555:9`!, &awareness); |
| 4946 | |
| 4947 | if (awareness >= AWARE_BARELYcxx . . $ `Descent3/aistruct_external.h:326:9`!) { |
| 4948 | f_aware = true; |
| 4949 | } |
| 4950 | } |
| 4951 | |
| 4952 | return f_aware; |
| 4953 | } |
| 4954 | |
| 4955 | /* |
| 4956 | $$QUERY |
| 4957 | AI |
| 4958 | o:[o:Object] get target |
| 4959 | qAIGetTarget |
| 4960 | |
| 4961 | Parameters: |
| 4962 | Object: object we want the the target of |
| 4963 | $$END |
| 4964 | */ |
| 4965 | int qAIGetTargetcxx . . $ qAIGetTarget(7864480464b09eea).(int me) { |
| 4966 | int target = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 4967 | char ctype; |
| 4968 | |
| 4969 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(me, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_C_CONTROL_TYPEcxx . . $ `scripts/osiris_common.h:637:9`!, &ctype); |
| 4970 | if (ctype == CT_AIcxx . . $ `Descent3/object_external.h:217:9`!) { |
| 4971 | AI_Valuecxx . . $ AI_Value.(me, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, AIV_I_TARGET_HANDLEcxx . . $ `scripts/osiris_common.h:524:9`!, &target); |
| 4972 | } |
| 4973 | |
| 4974 | return target; |
| 4975 | } |
| 4976 | |
| 4977 | /* |
| 4978 | $$QUERY |
| 4979 | Players |
| 4980 | b:[o:Player] has [o:Object] in their inventory |
| 4981 | qHasObjectInInventory |
| 4982 | |
| 4983 | Parameters: |
| 4984 | Player: Player to check |
| 4985 | Object: Which object to check for |
| 4986 | $$END |
| 4987 | */ |
| 4988 | bool qHasObjectInInventorycxx . . $ qHasObjectInInventory(cf9ef193275fa6d8).(int PlayerObject, int Object) { |
| 4989 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 4990 | |
| 4991 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = PlayerObject; |
| 4992 | mstruct.ithandlecxx . . $ msafe_struct#ithandle. = Object; |
| 4993 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_INVEN_CHECK_OBJECTcxx . . $ `scripts/osiris_common.h:903:9`!, &mstruct); |
| 4994 | |
| 4995 | return mstruct.statecxx . . $ msafe_struct#state.; |
| 4996 | } |
| 4997 | |
| 4998 | /* |
| 4999 | $$ACTION |
| 5000 | Objects |
| 5001 | Save object handle for [o:Object] in slot [e:SavedObjectSlot] |
| 5002 | aObjSaveHandle |
| 5003 | Save object handle |
| 5004 | Saves an object handle for later user |
| 5005 | |
| 5006 | Parameters: |
| 5007 | o:Object: the object whose handle is saved |
| 5008 | SavedObjectSlot: the slot in which to save the handle |
| 5009 | $$END |
| 5010 | */ |
| 5011 | void aObjSaveHandlecxx . . $ aObjSaveHandle(3e454b8ccf442868).(int objhandle, int slot) { |
| 5012 | if ((slot >= 0) && (slot < MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!)) |
| 5013 | Saved_object_handlescxx . . $ Saved_object_handles.[slot] = objhandle; |
| 5014 | } |
| 5015 | |
| 5016 | /* |
| 5017 | $$ACTION |
| 5018 | Level Goals |
| 5019 | Set goal [l:LevelGoal] as [e:Completed] |
| 5020 | aGoalCompleted |
| 5021 | Set goal completion state |
| 5022 | Tells the goal system that the specified goal has been completed or not |
| 5023 | |
| 5024 | Parameters: |
| 5025 | LevelGoal: the goal to set |
| 5026 | Completed: whether or not the goal has been completed |
| 5027 | $$END |
| 5028 | */ |
| 5029 | void aGoalCompletedcxx . . $ aGoalCompleted(3e454b8ccf442868).(int goal_index, int completed) { |
| 5030 | int flags = LGF_COMPLETEDcxx . . $ `Descent3/levelgoal_external.h:41:9`!; |
| 5031 | |
| 5032 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(completed ? VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`! : VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, LGSV_I_STATUScxx . . $ `scripts/osiris_common.h:725:9`!, &flags, goal_index); |
| 5033 | } |
| 5034 | |
| 5035 | /* |
| 5036 | $$ACTION |
| 5037 | Level Goals |
| 5038 | Set goal [l:LevelGoal] item number [i:ItemIndex] as [e:Completed] |
| 5039 | aGoalItemCompleted |
| 5040 | Set goal item completion state |
| 5041 | Tells the goal system that the specified goal item has been completed or not |
| 5042 | |
| 5043 | Parameters: |
| 5044 | LevelGoal: the goal |
| 5045 | ItemIndex: the index of the item in question |
| 5046 | Completed: whether or not the goal item has been completed |
| 5047 | $$END |
| 5048 | */ |
| 5049 | void aGoalItemCompletedcxx . . $ aGoalItemCompleted(b1146eedae1e1d0b).(int goal_index, int item_index, int completed) { |
| 5050 | bool f_set = (completed != 0); |
| 5051 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, LGSSV_B_ITEM_DONEcxx . . $ `scripts/osiris_common.h:730:9`!, &f_set, goal_index, item_index - 1); |
| 5052 | } |
| 5053 | |
| 5054 | /* |
| 5055 | $$ACTION |
| 5056 | Level Goals |
| 5057 | Set goal [l:LevelGoal] as [e:Failed] |
| 5058 | aGoalFailed |
| 5059 | Set goal fail state |
| 5060 | Tells the goal system that the specified goal has been failed or not |
| 5061 | |
| 5062 | Parameters: |
| 5063 | LevelGoal: the goal to set |
| 5064 | Failed: whether or not the goal has been failed |
| 5065 | $$END |
| 5066 | */ |
| 5067 | void aGoalFailedcxx . . $ aGoalFailed(3e454b8ccf442868).(int goal_index, int failed) { |
| 5068 | int flags = LGF_FAILEDcxx . . $ `Descent3/levelgoal_external.h:45:9`!; |
| 5069 | |
| 5070 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(failed ? VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`! : VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, LGSV_I_STATUScxx . . $ `scripts/osiris_common.h:725:9`!, &flags, goal_index); |
| 5071 | } |
| 5072 | |
| 5073 | /* |
| 5074 | $$ACTION |
| 5075 | Level Goals |
| 5076 | [e:Enable/Disable] goal [l:LevelGoal] |
| 5077 | aGoalEnableDisable |
| 5078 | Enable/disable goal |
| 5079 | Enable or disable the specified goal |
| 5080 | |
| 5081 | Parameters: |
| 5082 | Enable/Disable: whether the goal should be enabled or disabled |
| 5083 | LevelGoal: the goal to set |
| 5084 | $$END |
| 5085 | */ |
| 5086 | void aGoalEnableDisablecxx . . $ aGoalEnableDisable(3e454b8ccf442868).(int enabled, int goal_index) { |
| 5087 | int flags = LGF_ENABLEDcxx . . $ `Descent3/levelgoal_external.h:40:9`!; |
| 5088 | |
| 5089 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(enabled ? VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`! : VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`!, LGSV_I_STATUScxx . . $ `scripts/osiris_common.h:725:9`!, &flags, goal_index); |
| 5090 | } |
| 5091 | |
| 5092 | /* |
| 5093 | $$ACTION |
| 5094 | Level Goals |
| 5095 | Set goal [l:LevelGoal] priority = [i:Priority] |
| 5096 | aGoalSetPriority |
| 5097 | Set goal priority |
| 5098 | Sets the priority of the specified goal |
| 5099 | |
| 5100 | Parameters: |
| 5101 | LevelGoal: the goal to set |
| 5102 | Priority: the priority to set |
| 5103 | $$END |
| 5104 | */ |
| 5105 | void aGoalSetPrioritycxx . . $ aGoalSetPriority(3e454b8ccf442868).(int goal_index, int priority) { LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, LGSV_I_PRIORITYcxx . . $ `scripts/osiris_common.h:723:9`!, &priority, goal_index); } |
| 5106 | |
| 5107 | /* |
| 5108 | $$ACTION |
| 5109 | Level Goals |
| 5110 | Set goal [l:LevelGoal] completion message = [s:Message] |
| 5111 | aGoalSetCompletionMessage |
| 5112 | Set goal completion message |
| 5113 | Sets the completion message for the specified goal |
| 5114 | |
| 5115 | Parameters: |
| 5116 | LevelGoal: the goal to set |
| 5117 | Message: the message for the goal |
| 5118 | $$END |
| 5119 | */ |
| 5120 | void aGoalSetCompletionMessagecxx . . $ aGoalSetCompletionMessage(66835f578de1bcb3).(int goal_index, const char *message) { |
| 5121 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(VF_SETcxx . . $ `scripts/osiris_common.h:449:9`!, LGSV_PC_COMPLETION_MESSAGEcxx . . $ `scripts/osiris_common.h:722:9`!, (void *) message, goal_index); |
| 5122 | } |
| 5123 | |
| 5124 | /* |
| 5125 | $$ACTION |
| 5126 | Level Goals |
| 5127 | GuideBot [e:Can/Cannot] lead the player to goal [l:LevelGoal] |
| 5128 | aGoalSetGBKnowledge |
| 5129 | GuideBot can/cannot lead the player to goal |
| 5130 | Tells the goal system whether the GuideBot is allowed to lead the player to the specified goal |
| 5131 | |
| 5132 | Parameters: |
| 5133 | Can/Cannot: whether or not the GuideBot can lead the player to the goal |
| 5134 | LevelGoal: the goal to set |
| 5135 | $$END |
| 5136 | */ |
| 5137 | void aGoalSetGBKnowledgecxx . . $ aGoalSetGBKnowledge(3e454b8ccf442868).(int enabled, int goal_index) { |
| 5138 | int flags = LGF_GB_DOESNT_KNOW_LOCcxx . . $ `Descent3/levelgoal_external.h:43:9`!; |
| 5139 | |
| 5140 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(enabled ? VF_CLEAR_FLAGScxx . . $ `scripts/osiris_common.h:452:9`! : VF_SET_FLAGScxx . . $ `scripts/osiris_common.h:451:9`!, LGSV_I_STATUScxx . . $ `scripts/osiris_common.h:725:9`!, &flags, goal_index); |
| 5141 | } |
| 5142 | |
| 5143 | // |
| 5144 | // D3 queries |
| 5145 | // |
| 5146 | |
| 5147 | /* NOTE: The following query is handled internally by DALLAS |
| 5148 | $$QUERY |
| 5149 | Scripts |
| 5150 | b:Script [x:ScriptID] has executed |
| 5151 | qScriptExecuted_DALLAS |
| 5152 | Has this script been executed? |
| 5153 | Determines if the specified script has executed at least once |
| 5154 | |
| 5155 | Parameters: |
| 5156 | ScriptID: The script to check |
| 5157 | $$END |
| 5158 | */ |
| 5159 | |
| 5160 | /* NOTE: The following query is handled internally by DALLAS |
| 5161 | $$QUERY |
| 5162 | Scripts |
| 5163 | i:Times Script [x:ScriptID] has been executed |
| 5164 | qTimesScriptExecuted_DALLAS |
| 5165 | How many times has this script been executed? |
| 5166 | Returns the number of times the specified script has executed |
| 5167 | |
| 5168 | Parameters: |
| 5169 | ScriptID: The script to check |
| 5170 | $$END |
| 5171 | */ |
| 5172 | |
| 5173 | /* |
| 5174 | $$QUERY |
| 5175 | Objects |
| 5176 | b:[o:Object] exists |
| 5177 | qObjExists |
| 5178 | Does this object exist? |
| 5179 | Determines if the specified object exists in the world |
| 5180 | |
| 5181 | Parameters: |
| 5182 | Object: The object to check |
| 5183 | $$END |
| 5184 | */ |
| 5185 | bool qObjExistscxx . . $ qObjExists(83c267b20bac841a).(int objref) { |
| 5186 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5187 | |
| 5188 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 5189 | |
| 5190 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 5191 | |
| 5192 | return (mstruct.typecxx . . $ msafe_struct#type. != -1); |
| 5193 | } |
| 5194 | |
| 5195 | /* |
| 5196 | $$QUERY |
| 5197 | Objects |
| 5198 | b:[o:Object=IT] is a player |
| 5199 | qObjIsPlayer |
| 5200 | Is this object a player? |
| 5201 | Determines if the specified object is a player |
| 5202 | |
| 5203 | Parameters: |
| 5204 | Object: The object to check |
| 5205 | $$END |
| 5206 | */ |
| 5207 | bool qObjIsPlayercxx . . $ qObjIsPlayer(83c267b20bac841a).(int objref) { |
| 5208 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5209 | |
| 5210 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 5211 | |
| 5212 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 5213 | |
| 5214 | return (mstruct.typecxx . . $ msafe_struct#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!); |
| 5215 | } |
| 5216 | |
| 5217 | /* |
| 5218 | $$QUERY |
| 5219 | Objects |
| 5220 | b:[o:Object=IT] is a player weapon |
| 5221 | qObjIsPlayerWeapon |
| 5222 | Is this object a player weapon? |
| 5223 | Determines if the specified object is a player weapon |
| 5224 | |
| 5225 | Parameters: |
| 5226 | Object: The object to check |
| 5227 | $$END |
| 5228 | */ |
| 5229 | bool qObjIsPlayerWeaponcxx . . $ qObjIsPlayerWeapon(83c267b20bac841a).(int handle) { |
| 5230 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5231 | |
| 5232 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handle; |
| 5233 | |
| 5234 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 5235 | |
| 5236 | if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!) { |
| 5237 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_PARENTcxx . . $ `scripts/osiris_common.h:834:9`!, &mstruct); |
| 5238 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 5239 | |
| 5240 | if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) |
| 5241 | return 1; |
| 5242 | } |
| 5243 | |
| 5244 | return 0; |
| 5245 | } |
| 5246 | |
| 5247 | /* |
| 5248 | $$QUERY |
| 5249 | Objects |
| 5250 | b:[o:Object=IT] is a player or player weapon |
| 5251 | qObjIsPlayerOrPlayerWeapon |
| 5252 | Is this object either a player or a player weapon? |
| 5253 | Determines if the specified object is either a player or a player weapon |
| 5254 | |
| 5255 | Parameters: |
| 5256 | Object: The object to check |
| 5257 | $$END |
| 5258 | */ |
| 5259 | bool qObjIsPlayerOrPlayerWeaponcxx . . $ qObjIsPlayerOrPlayerWeapon(83c267b20bac841a).(int handle) { |
| 5260 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5261 | |
| 5262 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handle; |
| 5263 | |
| 5264 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 5265 | |
| 5266 | if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) |
| 5267 | return 1; |
| 5268 | |
| 5269 | if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!) { |
| 5270 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_PARENTcxx . . $ `scripts/osiris_common.h:834:9`!, &mstruct); |
| 5271 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 5272 | |
| 5273 | if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) |
| 5274 | return 1; |
| 5275 | } |
| 5276 | |
| 5277 | return 0; |
| 5278 | } |
| 5279 | |
| 5280 | /* |
| 5281 | $$QUERY |
| 5282 | Objects |
| 5283 | b:[o:Object=IT] is an energy weapon |
| 5284 | qObjIsEnergyWeapon |
| 5285 | Is this object an energy weapon? |
| 5286 | Determines if the specified object is an energy weapon |
| 5287 | |
| 5288 | Parameters: |
| 5289 | Object: The object to check |
| 5290 | $$END |
| 5291 | */ |
| 5292 | bool qObjIsEnergyWeaponcxx . . $ qObjIsEnergyWeapon(83c267b20bac841a).(int handle) { |
| 5293 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5294 | |
| 5295 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handle; |
| 5296 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ENERGY_WEAPONcxx . . $ `scripts/osiris_common.h:853:9`!, &mstruct); |
| 5297 | |
| 5298 | return mstruct.statecxx . . $ msafe_struct#state.; |
| 5299 | } |
| 5300 | |
| 5301 | /* |
| 5302 | $$QUERY |
| 5303 | Objects |
| 5304 | b:[o:Object=IT] is a [e:ObjectType] |
| 5305 | qObjIsType |
| 5306 | Is this object the specified type? |
| 5307 | Determines if the specified object is the specified type |
| 5308 | |
| 5309 | Parameters: |
| 5310 | Object: The object to check |
| 5311 | ObjectType: The type to check |
| 5312 | $$END |
| 5313 | */ |
| 5314 | bool qObjIsTypecxx . . $ qObjIsType(cf9ef193275fa6d8).(int objhandle, int type) { |
| 5315 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5316 | |
| 5317 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 5318 | |
| 5319 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 5320 | |
| 5321 | return (mstruct.typecxx . . $ msafe_struct#type. == type); |
| 5322 | } |
| 5323 | |
| 5324 | /* |
| 5325 | $$QUERY |
| 5326 | Objects |
| 5327 | b:[o:TargetObject] is within the [i:Cone=90] degree view cone of [o:Object] |
| 5328 | qObjCanSeeObj |
| 5329 | Can object see the target object |
| 5330 | Determines if the specified object can see the other object |
| 5331 | |
| 5332 | Parameters: |
| 5333 | Object: The object doing the looking |
| 5334 | TargetObject: The target object |
| 5335 | Cone: Angle between 0-360 which makes the viewcone that determines if the object can see the other object |
| 5336 | $$END |
| 5337 | */ |
| 5338 | bool qObjCanSeeObjcxx . . $ qObjCanSeeObj(1432650661211742).(int handletarget, int cone, int handlesrc) { |
| 5339 | vectorcxx . . $ vector# vsource, vtarget; |
| 5340 | |
| 5341 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5342 | |
| 5343 | // Get half of the angle that the user specified because they specified a cone, and we want an angle |
| 5344 | double cangle = (double)((double)cone / (double)2); |
| 5345 | |
| 5346 | double testangle = cos(cangle * PIcxx . . $ `fix/fix.h:73:9`! / 180); |
| 5347 | |
| 5348 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handletarget; |
| 5349 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 5350 | vtarget =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 5351 | |
| 5352 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handlesrc; |
| 5353 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 5354 | vsource =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 5355 | |
| 5356 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handlesrc; |
| 5357 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ORIENTcxx . . $ `scripts/osiris_common.h:821:9`!, &mstruct); |
| 5358 | |
| 5359 | vectorcxx . . $ vector# subvec = vtarget -cxx . . $ operator-(b77b703cd1e43e33). vsource; |
| 5360 | vm_VectorNormalizeFastcxx . . $ vm_VectorNormalizeFast(4939a7e530383cd4).(&subvec); |
| 5361 | float dotp = vm_DotProductcxx . . $ vm_DotProduct(a0b9c8659ecc16b8).(&subvec, &mstruct.orientcxx . . $ msafe_struct#orient..fveccxx . . $ matrix#fvec.); |
| 5362 | |
| 5363 | if (dotp > testangle) { |
| 5364 | return true; |
| 5365 | } |
| 5366 | return false; |
| 5367 | } |
| 5368 | |
| 5369 | /* |
| 5370 | $$QUERY |
| 5371 | Objects |
| 5372 | b:[o:TargetObject] is within the [i:Cone=90] degree view cone of [o:Object] using flags [g:FVIHitFlags=1048585:16269119] |
| 5373 | qObjCanSeeObjAdvanced |
| 5374 | Can object see the target object |
| 5375 | Determines if the specified object can see the other object using the given flags |
| 5376 | |
| 5377 | Parameters: |
| 5378 | Object: The object doing the looking |
| 5379 | TargetObject: The target object |
| 5380 | Cone: Angle between 0-360 which makes the viewcone that determines if the object can see the other object |
| 5381 | FVIHitFlags: Flags used to determine visibility |
| 5382 | $$END |
| 5383 | */ |
| 5384 | bool qObjCanSeeObjAdvancedcxx . . $ qObjCanSeeObjAdvanced(a1642a0ee405ca20).(int handletarget, int cone, int handlesrc, int fvi_flags) { |
| 5385 | vectorcxx . . $ vector# vsource, vtarget; |
| 5386 | int sourceroom; |
| 5387 | |
| 5388 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5389 | |
| 5390 | // Get half of the angle that the user specified because they specified a cone, and we want an angle |
| 5391 | double cangle = (double)((double)cone / (double)2); |
| 5392 | |
| 5393 | double testangle = cos(cangle * PIcxx . . $ `fix/fix.h:73:9`! / 180); |
| 5394 | |
| 5395 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handletarget; |
| 5396 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 5397 | vtarget =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 5398 | |
| 5399 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handlesrc; |
| 5400 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 5401 | vsource =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 5402 | |
| 5403 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handlesrc; |
| 5404 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ROOMNUMcxx . . $ `scripts/osiris_common.h:822:9`!, &mstruct); |
| 5405 | sourceroom = mstruct.roomnumcxx . . $ msafe_struct#roomnum.; |
| 5406 | |
| 5407 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handlesrc; |
| 5408 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ORIENTcxx . . $ `scripts/osiris_common.h:821:9`!, &mstruct); |
| 5409 | |
| 5410 | vectorcxx . . $ vector# subvec = vtarget -cxx . . $ operator-(b77b703cd1e43e33). vsource; |
| 5411 | vm_VectorNormalizeFastcxx . . $ vm_VectorNormalizeFast(4939a7e530383cd4).(&subvec); |
| 5412 | float dotp = vm_DotProductcxx . . $ vm_DotProduct(a0b9c8659ecc16b8).(&subvec, &mstruct.orientcxx . . $ msafe_struct#orient..fveccxx . . $ matrix#fvec.); |
| 5413 | |
| 5414 | if (dotp > testangle) { |
| 5415 | // see if we can cast a ray to the object |
| 5416 | ray_infocxx . . $ ray_info# ray; |
| 5417 | fvi_flags |= FQ_CHECK_OBJScxx . . $ `lib/findintersection_external.h:59:9`!; |
| 5418 | int fate = FVI_RayCastcxx . . $ FVI_RayCast.(handlesrc, &vsource, &vtarget, sourceroom, 0.0f, fvi_flags, &ray); |
| 5419 | if (fate == HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`!) |
| 5420 | return true; |
| 5421 | |
| 5422 | if (fate == HIT_OBJECTcxx . . $ `lib/findintersection_external.h:47:9`!) { |
| 5423 | if (ray.hit_objectcxx . . $ ray_info#hit_object. == handletarget) { |
| 5424 | return true; |
| 5425 | } |
| 5426 | } |
| 5427 | } |
| 5428 | return false; |
| 5429 | } |
| 5430 | |
| 5431 | /* |
| 5432 | $$QUERY |
| 5433 | Objects |
| 5434 | o:[o:Object=IT] parent |
| 5435 | qObjParent |
| 5436 | Object parent |
| 5437 | Gets the parent of the specified object |
| 5438 | |
| 5439 | Parameters: |
| 5440 | Object: The object whose parent is returned |
| 5441 | $$END |
| 5442 | */ |
| 5443 | int qObjParentcxx . . $ qObjParent(7864480464b09eea).(int objhandle) { |
| 5444 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5445 | |
| 5446 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 5447 | |
| 5448 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_PARENTcxx . . $ `scripts/osiris_common.h:834:9`!, &mstruct); |
| 5449 | |
| 5450 | return mstruct.objhandlecxx . . $ msafe_struct#objhandle.; |
| 5451 | } |
| 5452 | |
| 5453 | /* |
| 5454 | $$QUERY |
| 5455 | Objects |
| 5456 | o:Get attached child of [o:Object] at attach point [i:AttachPoint] |
| 5457 | qGetAtachedChild |
| 5458 | Attached child |
| 5459 | Gets the attached child of the specified object |
| 5460 | |
| 5461 | Parameters: |
| 5462 | Object: The object who we want to determine its attached child |
| 5463 | AttachPoint: The attach point the child is attached to |
| 5464 | $$END |
| 5465 | */ |
| 5466 | int qGetAtachedChildcxx . . $ qGetAtachedChild(9b79fb6aee4c0440).(int objhandle, int attachpoint) { return Obj_GetAttachChildHandlecxx . . $ Obj_GetAttachChildHandle.(objhandle, attachpoint); } |
| 5467 | |
| 5468 | /* |
| 5469 | $$QUERY |
| 5470 | Objects |
| 5471 | r:[o:Object=IT] room |
| 5472 | qObjRoom |
| 5473 | Object Room |
| 5474 | Returns the room the specified object is in |
| 5475 | |
| 5476 | Parameters: |
| 5477 | Object: The object whose room you want to know |
| 5478 | $$END |
| 5479 | */ |
| 5480 | int qObjRoomcxx . . $ qObjRoom(7864480464b09eea).(int objref) { |
| 5481 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5482 | |
| 5483 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 5484 | |
| 5485 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ROOMNUMcxx . . $ `scripts/osiris_common.h:822:9`!, &mstruct); |
| 5486 | |
| 5487 | return mstruct.roomnumcxx . . $ msafe_struct#roomnum.; |
| 5488 | } |
| 5489 | |
| 5490 | // These should be in object_external.h |
| 5491 | #define ROOMNUM_CELLNUM_FLAGcxx . . $ `scripts/DallasFuncs.cpp:5491:9`! 0x80000000 |
| 5492 | #define ROOMNUM_OUTSIDEcxx . . $ `scripts/DallasFuncs.cpp:5492:9`!(roomnum) (((roomnum) & ROOMNUM_CELLNUM_FLAGcxx . . $ `scripts/DallasFuncs.cpp:5491:9`!) != 0) |
| 5493 | |
| 5494 | /* |
| 5495 | $$QUERY |
| 5496 | Objects |
| 5497 | b:[o:Object=IT] is on the terrain |
| 5498 | qObjOnTerrain |
| 5499 | Object on terrain? |
| 5500 | Determines if the specified object is on the terrain |
| 5501 | |
| 5502 | Parameters: |
| 5503 | Object: The object to check |
| 5504 | $$END |
| 5505 | */ |
| 5506 | bool qObjOnTerraincxx . . $ qObjOnTerrain(83c267b20bac841a).(int objhandle) { |
| 5507 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5508 | |
| 5509 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 5510 | |
| 5511 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ROOMNUMcxx . . $ `scripts/osiris_common.h:822:9`!, &mstruct); |
| 5512 | |
| 5513 | return ROOMNUM_OUTSIDEcxx . . $ msafe_struct#roomnum.(mstruct.roomnum); |
| 5514 | } |
| 5515 | |
| 5516 | /* |
| 5517 | $$QUERY |
| 5518 | Objects |
| 5519 | e(ObjectType):[o:Object=IT] type |
| 5520 | qObjType |
| 5521 | Object type |
| 5522 | Returns the specified object's type |
| 5523 | |
| 5524 | Parameters: |
| 5525 | Object: The object whose type you want to know |
| 5526 | $$END |
| 5527 | */ |
| 5528 | int qObjTypecxx . . $ qObjType(7864480464b09eea).(int objref) { |
| 5529 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5530 | |
| 5531 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 5532 | |
| 5533 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 5534 | |
| 5535 | return mstruct.typecxx . . $ msafe_struct#type.; |
| 5536 | } |
| 5537 | |
| 5538 | /* |
| 5539 | $$QUERY |
| 5540 | User Vars |
| 5541 | f:User Variable [e:UserVar] |
| 5542 | qUserVarValue |
| 5543 | User Variable |
| 5544 | Returns the value of the specified user variable |
| 5545 | |
| 5546 | Parameters: |
| 5547 | UserVar: The variable whose value to return |
| 5548 | $$END |
| 5549 | */ |
| 5550 | float qUserVarValuecxx . . $ qUserVarValue(5cde91ea12d43f46).(int varnum) { |
| 5551 | if ((varnum >= 0) && (varnum < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!)) |
| 5552 | return User_varscxx . . $ User_vars.[varnum]; |
| 5553 | else |
| 5554 | return 0.0; |
| 5555 | } |
| 5556 | |
| 5557 | /* |
| 5558 | $$QUERY |
| 5559 | User Vars |
| 5560 | i:User Variable [e:UserVar] (Integer) |
| 5561 | qUserVarValueInt |
| 5562 | User Variable (Integer) |
| 5563 | Returns the value of the specified user variable rounded to the nearest integer |
| 5564 | |
| 5565 | Parameters: |
| 5566 | UserVar: The variable whose value to return |
| 5567 | $$END |
| 5568 | */ |
| 5569 | int qUserVarValueIntcxx . . $ qUserVarValueInt(7864480464b09eea).(int varnum) { |
| 5570 | if ((varnum >= 0) && (varnum < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!)) |
| 5571 | return (User_varscxx . . $ User_vars.[varnum] + 0.5); |
| 5572 | else |
| 5573 | return 0.0; |
| 5574 | } |
| 5575 | |
| 5576 | /* |
| 5577 | $$QUERY |
| 5578 | User Vars |
| 5579 | b:User Flag [e:UserFlag] |
| 5580 | qUserFlag |
| 5581 | User flag |
| 5582 | Returns the state of the specified user flag |
| 5583 | |
| 5584 | Parameters: |
| 5585 | UserFlag: The flag whose state to return |
| 5586 | $$END |
| 5587 | */ |
| 5588 | bool qUserFlagcxx . . $ qUserFlag(83c267b20bac841a).(int flagnum) { |
| 5589 | if ((flagnum >= 0) && (flagnum < 32)) |
| 5590 | return ((User_flagscxx . . $ User_flags. & (1 << flagnum)) != 0); |
| 5591 | else |
| 5592 | return 0; |
| 5593 | } |
| 5594 | |
| 5595 | /* |
| 5596 | $$QUERY |
| 5597 | Objects |
| 5598 | f:Object [o:Object] shields |
| 5599 | qObjShields |
| 5600 | Get an object's shields |
| 5601 | Gets an object's shields |
| 5602 | |
| 5603 | Parameters: |
| 5604 | Object: the object whose shields are being queried |
| 5605 | $$END |
| 5606 | */ |
| 5607 | float qObjShieldscxx . . $ qObjShields(5cde91ea12d43f46).(int objref) { |
| 5608 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5609 | |
| 5610 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 5611 | |
| 5612 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_SHIELDScxx . . $ `scripts/osiris_common.h:802:9`!, &mstruct); |
| 5613 | |
| 5614 | return mstruct.shieldscxx . . $ msafe_struct#shields.; |
| 5615 | } |
| 5616 | |
| 5617 | /* |
| 5618 | $$QUERY |
| 5619 | Objects |
| 5620 | f:Object [o:Object] energy |
| 5621 | qObjEnergy |
| 5622 | Get an object's energy |
| 5623 | Gets an object's energy |
| 5624 | |
| 5625 | Parameters: |
| 5626 | Object: the object whose energy are being queried |
| 5627 | $$END |
| 5628 | */ |
| 5629 | float qObjEnergycxx . . $ qObjEnergy(5cde91ea12d43f46).(int objref) { |
| 5630 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5631 | |
| 5632 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 5633 | |
| 5634 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ENERGYcxx . . $ `scripts/osiris_common.h:803:9`!, &mstruct); |
| 5635 | |
| 5636 | return mstruct.energycxx . . $ msafe_struct#energy.; |
| 5637 | } |
| 5638 | |
| 5639 | /* |
| 5640 | $$QUERY |
| 5641 | Objects |
| 5642 | f:Object [o:Object] original shields |
| 5643 | qObjShieldsOriginal |
| 5644 | Object's original shields |
| 5645 | Gets an object's original (full-strength) shields |
| 5646 | |
| 5647 | Parameters: |
| 5648 | Object: the object whose shields are being queried |
| 5649 | $$END |
| 5650 | */ |
| 5651 | float qObjShieldsOriginalcxx . . $ qObjShieldsOriginal(5cde91ea12d43f46).(int objref) { |
| 5652 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5653 | |
| 5654 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 5655 | |
| 5656 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_SHIELDS_ORIGINALcxx . . $ `scripts/osiris_common.h:855:9`!, &mstruct); |
| 5657 | |
| 5658 | return mstruct.shieldscxx . . $ msafe_struct#shields.; |
| 5659 | } |
| 5660 | |
| 5661 | /* |
| 5662 | $$QUERY |
| 5663 | Doors |
| 5664 | b:Door [d:Door] is locked |
| 5665 | qDoorLocked |
| 5666 | Door locked |
| 5667 | Determines if a door is locked |
| 5668 | |
| 5669 | Parameters: |
| 5670 | Door: the door to check |
| 5671 | $$END |
| 5672 | */ |
| 5673 | bool qDoorLockedcxx . . $ qDoorLocked(83c267b20bac841a).(int objref) { |
| 5674 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5675 | |
| 5676 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objref; |
| 5677 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_DOOR_LOCK_STATEcxx . . $ `scripts/osiris_common.h:873:9`!, &mstruct); |
| 5678 | |
| 5679 | return mstruct.statecxx . . $ msafe_struct#state.; |
| 5680 | } |
| 5681 | |
| 5682 | /* |
| 5683 | $$QUERY |
| 5684 | Doors |
| 5685 | b:Door [d:Door] is openable by [o:Object=IT] |
| 5686 | qDoorOpenable |
| 5687 | Door openable |
| 5688 | Determines if a door is openable by the specified object |
| 5689 | |
| 5690 | Parameters: |
| 5691 | Door: the door to check |
| 5692 | Object: the object to check |
| 5693 | $$END |
| 5694 | */ |
| 5695 | bool qDoorOpenablecxx . . $ qDoorOpenable(cf9ef193275fa6d8).(int door_handle, int opener_handle) { |
| 5696 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5697 | |
| 5698 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = door_handle; |
| 5699 | mstruct.ithandlecxx . . $ msafe_struct#ithandle. = opener_handle; |
| 5700 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_DOOR_OPENABLEcxx . . $ `scripts/osiris_common.h:877:9`!, &mstruct); |
| 5701 | |
| 5702 | return mstruct.statecxx . . $ msafe_struct#state.; |
| 5703 | } |
| 5704 | |
| 5705 | /* |
| 5706 | $$QUERY |
| 5707 | Doors |
| 5708 | p:Door [d:Door] position |
| 5709 | qDoorGetPos |
| 5710 | Get door position |
| 5711 | Gets the position of the specified door |
| 5712 | |
| 5713 | Parameters: |
| 5714 | Door: the object of the door |
| 5715 | $$END |
| 5716 | */ |
| 5717 | float qDoorGetPoscxx . . $ qDoorGetPos(5cde91ea12d43f46).(int objhandle) { |
| 5718 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5719 | |
| 5720 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 5721 | |
| 5722 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_DOOR_POSITIONcxx . . $ `scripts/osiris_common.h:875:9`!, &mstruct); |
| 5723 | |
| 5724 | return mstruct.scalarcxx . . $ msafe_struct#scalar.; |
| 5725 | } |
| 5726 | |
| 5727 | /* |
| 5728 | $$QUERY |
| 5729 | Mission |
| 5730 | b:Mission flag [i:FlagNum] is set |
| 5731 | aMissionGetFlag |
| 5732 | Get a mission flag |
| 5733 | Gets the specified mission flag |
| 5734 | |
| 5735 | Parameters: |
| 5736 | FlagNum: the flag to get |
| 5737 | $$END |
| 5738 | */ |
| 5739 | bool aMissionGetFlagcxx . . $ aMissionGetFlag(83c267b20bac841a).(int flagnum) { return Msn_FlagGetcxx . . $ Msn_FlagGet.(flagnum); } |
| 5740 | |
| 5741 | /* |
| 5742 | $$QUERY |
| 5743 | Mission |
| 5744 | b:Level objective flag [i:FlagNum] is set |
| 5745 | aMissionGetLevelFlag |
| 5746 | Get a level objective flag |
| 5747 | Gets the specified level objective flag |
| 5748 | |
| 5749 | Parameters: |
| 5750 | FlagNum: the flag to get |
| 5751 | $$END |
| 5752 | */ |
| 5753 | bool aMissionGetLevelFlagcxx . . $ aMissionGetLevelFlag(83c267b20bac841a).(int flagnum) { |
| 5754 | //!!Add code here |
| 5755 | |
| 5756 | return 0; |
| 5757 | } |
| 5758 | |
| 5759 | /* |
| 5760 | $$QUERY |
| 5761 | Objects |
| 5762 | f:Object [o:Object] animation frame |
| 5763 | qObjAnimFrame |
| 5764 | Object animation frame |
| 5765 | Get an object's animation frame |
| 5766 | |
| 5767 | Parameters: |
| 5768 | Object: the object whose animation frame is being queried |
| 5769 | $$END |
| 5770 | */ |
| 5771 | float qObjAnimFramecxx . . $ qObjAnimFrame(5cde91ea12d43f46).(int objref) { |
| 5772 | float anim_frame; |
| 5773 | |
| 5774 | Obj_Valuecxx . . $ Obj_Value(504a19c195c7574e).(objref, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, OBJV_F_ANIM_FRAMEcxx . . $ `scripts/osiris_common.h:643:9`!, &anim_frame); |
| 5775 | |
| 5776 | return anim_frame; |
| 5777 | } |
| 5778 | |
| 5779 | /* |
| 5780 | $$QUERY |
| 5781 | Rooms |
| 5782 | b:Room [r:Room] fog is on |
| 5783 | qRoomFogOn |
| 5784 | Room fog is on |
| 5785 | Checks if the fog is on in a room |
| 5786 | |
| 5787 | Parameters: |
| 5788 | Room: the room to check |
| 5789 | $$END |
| 5790 | */ |
| 5791 | bool qRoomFogOncxx . . $ qRoomFogOn(83c267b20bac841a).(int roomnum) { |
| 5792 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5793 | |
| 5794 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 5795 | |
| 5796 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_ROOM_FOG_STATEcxx . . $ `scripts/osiris_common.h:790:9`!, &mstruct); |
| 5797 | |
| 5798 | return mstruct.statecxx . . $ msafe_struct#state.; |
| 5799 | } |
| 5800 | |
| 5801 | /* |
| 5802 | $$ACTION |
| 5803 | Players |
| 5804 | [e:Enable/Disable] player controls [g:PlayerControl] for [o:PlayerObject] |
| 5805 | aTogglePlayerObjControl |
| 5806 | TogglePlayerControl |
| 5807 | Sets a players control either disabled or enabled |
| 5808 | |
| 5809 | Parameters: |
| 5810 | Object: The player object |
| 5811 | PlayerObject: The player this affects |
| 5812 | Enable/Disable: Whether to Enable or Disable the specified controls |
| 5813 | $$END |
| 5814 | */ |
| 5815 | void aTogglePlayerObjControlcxx . . $ aTogglePlayerObjControl(b1146eedae1e1d0b).(int enable, int controlmask, int objhandle) { |
| 5816 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5817 | |
| 5818 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 5819 | mstruct.control_maskcxx . . $ msafe_struct#control_mask. = controlmask; |
| 5820 | mstruct.control_valcxx . . $ msafe_struct#control_val. = enable; |
| 5821 | |
| 5822 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_PLAYER_CMASKcxx . . $ `scripts/osiris_common.h:839:9`!, &mstruct); |
| 5823 | } |
| 5824 | |
| 5825 | /* |
| 5826 | $$ACTION |
| 5827 | Players |
| 5828 | [e:Enable/Disable] all player control for [o:PlayerObject] |
| 5829 | aTogglePlayerObjAllControls |
| 5830 | ToggleAllPlayerControls |
| 5831 | Sets a players control either disabled or enabled |
| 5832 | |
| 5833 | Parameters: |
| 5834 | Enable/Disable: Enable/Disable the specified control |
| 5835 | PlayerObject: The player this affects |
| 5836 | $$END |
| 5837 | */ |
| 5838 | void aTogglePlayerObjAllControlscxx . . $ aTogglePlayerObjAllControls(3e454b8ccf442868).(int enable, int objhandle) { |
| 5839 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5840 | int controlbit = 0xffffffff; |
| 5841 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 5842 | mstruct.control_maskcxx . . $ msafe_struct#control_mask. = controlbit; |
| 5843 | mstruct.control_valcxx . . $ msafe_struct#control_val. = enable ? 1 : 0; |
| 5844 | |
| 5845 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_PLAYER_CMASKcxx . . $ `scripts/osiris_common.h:839:9`!, &mstruct); |
| 5846 | } |
| 5847 | |
| 5848 | /* |
| 5849 | $$ACTION |
| 5850 | Players |
| 5851 | Give player [o:PlayerObject] key [o:KeyObject], key number [i:KeyNum=1:1|8], name = [s:KeyName], show HUD message = |
| 5852 | [e:Yes/No] aObjectPlayerGiveKey Give player key Gives a player the specified key, and deletes the key object if not |
| 5853 | multiplayer |
| 5854 | |
| 5855 | Parameters: |
| 5856 | PlayerObject: The player who gets the key |
| 5857 | KeyObject: the object that is the key |
| 5858 | KeyNum: which key this is (1-8) |
| 5859 | KeyName: the name of this key (shown in inventory & on HUD) |
| 5860 | Yes/No: should the name of the key be shown on the HUD? |
| 5861 | $$END |
| 5862 | */ |
| 5863 | void aObjectPlayerGiveKeycxx . . $ aObjectPlayerGiveKey(68ed5df2bcf2e283).(int player_handle, int key_handle, int key_num, const char *key_name, int show_on_hud) { |
| 5864 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5865 | |
| 5866 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = key_handle; |
| 5867 | mstruct.ithandlecxx . . $ msafe_struct#ithandle. = player_handle; |
| 5868 | mstruct.indexcxx . . $ msafe_struct#index. = key_num; |
| 5869 | |
| 5870 | strncpy(mstruct.messagecxx . . $ msafe_struct#message., key_name, sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1); |
| 5871 | mstruct.messagecxx . . $ msafe_struct#message.[sizeof(mstruct.messagecxx . . $ msafe_struct#message.) - 1] = 0; |
| 5872 | |
| 5873 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_PLAYER_KEYcxx . . $ `scripts/osiris_common.h:844:9`!, &mstruct); |
| 5874 | |
| 5875 | if (show_on_hud) |
| 5876 | aShowHUDMessagecxx . . $ aShowHUDMessage(326aeb464d16410c).(key_name); |
| 5877 | } |
| 5878 | |
| 5879 | /* |
| 5880 | $$ACTION |
| 5881 | Players |
| 5882 | Give player [o:PlayerObject] invisible key number [i:KeyNum=1:1|8] |
| 5883 | aObjectPlayerGiveInvisibleKey |
| 5884 | Give player key |
| 5885 | Gives a player the specified key, which doesn't show up on the HUD or in the inventory |
| 5886 | |
| 5887 | Parameters: |
| 5888 | PlayerObject: The player who gets the key |
| 5889 | KeyNum: which key this is (1-8) |
| 5890 | $$END |
| 5891 | */ |
| 5892 | void aObjectPlayerGiveInvisibleKeycxx . . $ aObjectPlayerGiveInvisibleKey(3e454b8ccf442868).(int player_handle, int key_num) { |
| 5893 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5894 | |
| 5895 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 5896 | mstruct.ithandlecxx . . $ msafe_struct#ithandle. = player_handle; |
| 5897 | mstruct.indexcxx . . $ msafe_struct#index. = key_num; |
| 5898 | mstruct.messagecxx . . $ msafe_struct#message.[0] = 0; // don't think this is used, but just in case |
| 5899 | |
| 5900 | MSafe_CallFunctioncxx . . $ MSafe_CallFunction.(MSAFE_OBJECT_PLAYER_KEYcxx . . $ `scripts/osiris_common.h:844:9`!, &mstruct); |
| 5901 | } |
| 5902 | |
| 5903 | /* |
| 5904 | $$QUERY |
| 5905 | Objects |
| 5906 | f:Object [o:Object] lighting distance |
| 5907 | qObjGetLightingDist |
| 5908 | Get object lighting distance |
| 5909 | Gets the lighting distance for an object |
| 5910 | |
| 5911 | Parameters: |
| 5912 | Object: the object to get |
| 5913 | $$END |
| 5914 | */ |
| 5915 | float qObjGetLightingDistcxx . . $ qObjGetLightingDist(5cde91ea12d43f46).(int objhandle) { |
| 5916 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 5917 | |
| 5918 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 5919 | |
| 5920 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_LIGHT_DISTcxx . . $ `scripts/osiris_common.h:841:9`!, &mstruct); |
| 5921 | |
| 5922 | return mstruct.light_distancecxx . . $ msafe_struct#light_distance.; |
| 5923 | } |
| 5924 | |
| 5925 | /* |
| 5926 | $$QUERY |
| 5927 | Math |
| 5928 | f:[f:Float1] plus [f:Float2] |
| 5929 | qMathAddFloat |
| 5930 | Add floats |
| 5931 | Adds two floating-point numbers and returns the result |
| 5932 | |
| 5933 | Parameters: |
| 5934 | Float1, Float2: the numbers to add |
| 5935 | $$END |
| 5936 | */ |
| 5937 | float qMathAddFloatcxx . . $ qMathAddFloat(d59a45cd3bfd2eda).(float f0, float f1) { return f0 + f1; } |
| 5938 | |
| 5939 | /* |
| 5940 | $$QUERY |
| 5941 | Math |
| 5942 | f:[f:Float1] minus [f:Float2] |
| 5943 | qMathSubFloat |
| 5944 | Subtract floats |
| 5945 | Subtracts one floating-point number from another |
| 5946 | |
| 5947 | Parameters: |
| 5948 | Float1, Float2: subtracts Float2 from Float1 |
| 5949 | $$END |
| 5950 | */ |
| 5951 | float qMathSubFloatcxx . . $ qMathSubFloat(d59a45cd3bfd2eda).(float f0, float f1) { return f0 - f1; } |
| 5952 | |
| 5953 | /* |
| 5954 | $$QUERY |
| 5955 | Math |
| 5956 | f:[f:Float1] times [f:Float2] |
| 5957 | qMathMulFloat |
| 5958 | Multiply floats |
| 5959 | Multiplies two floating-point numbers and returns the result |
| 5960 | |
| 5961 | Parameters: |
| 5962 | Float1, Float2: the numbers to multiply |
| 5963 | $$END |
| 5964 | */ |
| 5965 | float qMathMulFloatcxx . . $ qMathMulFloat(d59a45cd3bfd2eda).(float f0, float f1) { return f0 * f1; } |
| 5966 | |
| 5967 | /* |
| 5968 | $$QUERY |
| 5969 | Math |
| 5970 | f:Convert int [i:Int] to float |
| 5971 | qMathIntToFloat |
| 5972 | Convert Int to Float |
| 5973 | Converts an integer value to a floating-point value |
| 5974 | |
| 5975 | Parameters: |
| 5976 | Int: the interger that's converted to a float |
| 5977 | $$END |
| 5978 | */ |
| 5979 | float qMathIntToFloatcxx . . $ qMathIntToFloat(5cde91ea12d43f46).(int i) { return (float)i; } |
| 5980 | |
| 5981 | /* |
| 5982 | $$QUERY |
| 5983 | Math |
| 5984 | p:[p:Percent1] plus [p:Percent2] |
| 5985 | qMathAddPercent |
| 5986 | Add percentages |
| 5987 | Adds two percentages and returns the result, without going above 100% |
| 5988 | |
| 5989 | Parameters: |
| 5990 | Percent1, Percent2: the percentages to add |
| 5991 | $$END |
| 5992 | */ |
| 5993 | float qMathAddPercentcxx . . $ qMathAddPercent(d59a45cd3bfd2eda).(float f0, float f1) { |
| 5994 | float r = f0 + f1; |
| 5995 | |
| 5996 | return (r > 1.0) ? 1.0 : r; |
| 5997 | } |
| 5998 | |
| 5999 | /* |
| 6000 | $$QUERY |
| 6001 | Math |
| 6002 | p:[p:Percent1] minus [p:Percent2] |
| 6003 | qMathSubPercent |
| 6004 | Subtract percentages |
| 6005 | Subtracts one percentage number from another, withing going below 0% |
| 6006 | |
| 6007 | Parameters: |
| 6008 | Percent1, Percent2: subtracts Percent2 from Percent1 |
| 6009 | $$END |
| 6010 | */ |
| 6011 | float qMathSubPercentcxx . . $ qMathSubPercent(d59a45cd3bfd2eda).(float f0, float f1) { |
| 6012 | float r = f0 - f1; |
| 6013 | |
| 6014 | return (r < 0.0) ? 0.0 : r; |
| 6015 | } |
| 6016 | |
| 6017 | /* |
| 6018 | $$QUERY |
| 6019 | Math |
| 6020 | i:[i:Integer1] plus [i:Integer2] |
| 6021 | qMathAddInt |
| 6022 | Add integers |
| 6023 | Adds two integer numbers and returns the result |
| 6024 | |
| 6025 | Parameters: |
| 6026 | Integer1, Integer2: the numbers to add |
| 6027 | $$END |
| 6028 | */ |
| 6029 | int qMathAddIntcxx . . $ qMathAddInt(9b79fb6aee4c0440).(int f0, int f1) { return f0 + f1; } |
| 6030 | |
| 6031 | /* |
| 6032 | $$QUERY |
| 6033 | Math |
| 6034 | i:[i:Integer1] minus [i:Integer2] |
| 6035 | qMathSubInt |
| 6036 | Subtract integers |
| 6037 | Subtracts one integer number from another |
| 6038 | |
| 6039 | Parameters: |
| 6040 | Integer1, Integer2: subtracts Integer2 from Integer1 |
| 6041 | $$END |
| 6042 | */ |
| 6043 | int qMathSubIntcxx . . $ qMathSubInt(9b79fb6aee4c0440).(int f0, int f1) { return f0 - f1; } |
| 6044 | |
| 6045 | /* |
| 6046 | $$QUERY |
| 6047 | Math |
| 6048 | f:[p:Percent] of [f:Float] |
| 6049 | qMathPercentage |
| 6050 | Percentage of a number |
| 6051 | Multiplies a number by a percentage |
| 6052 | |
| 6053 | Parameters: |
| 6054 | Percent: how much to scale the number by |
| 6055 | Float: the number that's scaled |
| 6056 | $$END |
| 6057 | */ |
| 6058 | float qMathPercentagecxx . . $ qMathPercentage(d59a45cd3bfd2eda).(float f0, float f1) { return f0 * f1; } |
| 6059 | |
| 6060 | #include <math.h> |
| 6061 | |
| 6062 | /* |
| 6063 | $$QUERY |
| 6064 | Objects |
| 6065 | f:Distance between [o:Object1] and [o:Object2] |
| 6066 | qObjGetDistance |
| 6067 | Distance between two objects |
| 6068 | Gets the distance between two objects |
| 6069 | |
| 6070 | Parameters: |
| 6071 | Object1, Object2: the two objects |
| 6072 | $$END |
| 6073 | */ |
| 6074 | float qObjGetDistancecxx . . $ qObjGetDistance(ac70f22789a9917c).(int objhandle0, int objhandle1) { |
| 6075 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6076 | vectorcxx . . $ vector# p0; |
| 6077 | |
| 6078 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle0; |
| 6079 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6080 | p0 =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 6081 | |
| 6082 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle1; |
| 6083 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6084 | |
| 6085 | return vm_VectorDistancecxx . . $ vm_VectorDistance(e65d563e2b53cc54).(&p0, &mstruct.poscxx . . $ msafe_struct#pos.); |
| 6086 | } |
| 6087 | |
| 6088 | /* |
| 6089 | $$QUERY |
| 6090 | Rooms |
| 6091 | b:Forcefield at portal [i:PortalNum] in room [r:Room] is on |
| 6092 | qPortalIsOn |
| 6093 | Forcefield is on |
| 6094 | Checks whether a forcefield is on |
| 6095 | |
| 6096 | Parameters: |
| 6097 | Room: The room the forcefield is in |
| 6098 | PortalNum: The portal number of the forcefield |
| 6099 | $$END |
| 6100 | */ |
| 6101 | bool qPortalIsOncxx . . $ qPortalIsOn(cf9ef193275fa6d8).(int portalnum, int roomnum) { |
| 6102 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6103 | |
| 6104 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 6105 | mstruct.portalnumcxx . . $ msafe_struct#portalnum. = portalnum; |
| 6106 | |
| 6107 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_ROOM_PORTAL_RENDERcxx . . $ `scripts/osiris_common.h:789:9`!, &mstruct); |
| 6108 | |
| 6109 | return mstruct.statecxx . . $ msafe_struct#state.; |
| 6110 | } |
| 6111 | |
| 6112 | /* |
| 6113 | $$QUERY |
| 6114 | Misc |
| 6115 | b:Random chance of [p:Probability] |
| 6116 | qRandomChance |
| 6117 | Random Chance |
| 6118 | Determines whether a random event should happen. Returns true the portion of the time specified. |
| 6119 | |
| 6120 | Parameters: |
| 6121 | Probablilty: how likely this query is to return true. |
| 6122 | $$END |
| 6123 | */ |
| 6124 | bool qRandomChancecxx . . $ qRandomChance(4e2b510d3867ab27).(float prob) { |
| 6125 | if (prob == 0.0) |
| 6126 | return false; |
| 6127 | |
| 6128 | return ((static_cast<float>(randcxx . . $ rand(9efc7249d839d30e).()) / static_cast<float>(RAND_MAXcxx . . $ `<external>/10696550936717951914/stdlib.h:87:9`!)) <= prob); |
| 6129 | } |
| 6130 | |
| 6131 | /* |
| 6132 | $$QUERY |
| 6133 | Math |
| 6134 | f:Random value between [f:LowerLimit] and [f:UpperLimit] |
| 6135 | qRandomValue |
| 6136 | Random Value |
| 6137 | Returns a random value between the two specified values |
| 6138 | |
| 6139 | Parameters: |
| 6140 | LowerLimit: the returned value will be higher than or equal to this value |
| 6141 | UpperLimit: the returned value will be lower than or equal to this value |
| 6142 | $$END |
| 6143 | */ |
| 6144 | float qRandomValuecxx . . $ qRandomValue(d59a45cd3bfd2eda).(float low, float high) { return low + (static_cast<float>(randcxx . . $ rand(9efc7249d839d30e).()) / static_cast<float>(RAND_MAXcxx . . $ `<external>/10696550936717951914/stdlib.h:87:9`!)) * (high - low); } |
| 6145 | |
| 6146 | /* |
| 6147 | $$QUERY |
| 6148 | Objects |
| 6149 | b:Player is within the [i:Cone=90] degree view cone of [o:Object] at a max distance of [f:Distance] |
| 6150 | qObjCanSeePlayer |
| 6151 | Can object see a player |
| 6152 | Determines if the specified object can see a player |
| 6153 | |
| 6154 | Parameters: |
| 6155 | Object: The object doing the looking |
| 6156 | Cone: Angle between 0-360 which makes the viewcone that determines if the object can see the other object |
| 6157 | Distance: The player must be within this distance for this query to return true |
| 6158 | $$END |
| 6159 | */ |
| 6160 | bool qObjCanSeePlayercxx . . $ qObjCanSeePlayer(50d374bf72a54d6d).(int cone, int handlesrc, float max_distance) { |
| 6161 | vectorcxx . . $ vector# vsource, vtarget, viewvec; |
| 6162 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6163 | |
| 6164 | // Get half of the angle that the user specified because they specified a cone, and we want an angle |
| 6165 | double cangle = (double)((double)cone / (double)2); |
| 6166 | double t = cangle * PIcxx . . $ `fix/fix.h:73:9`! / 180; |
| 6167 | double testangle = coscxx . . $ cos(fee4f1d22bc8e617).(t); |
| 6168 | |
| 6169 | // Loop though all possible players |
| 6170 | for (int p = 0; p < MAX_PLAYERScxx . . $ `scripts/osiris_common.h:927:9`!; p++) { |
| 6171 | |
| 6172 | // Get player position |
| 6173 | mstruct.slotcxx . . $ msafe_struct#slot. = p; |
| 6174 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_PLAYER_HANDLEcxx . . $ `scripts/osiris_common.h:838:9`!, &mstruct); |
| 6175 | |
| 6176 | // See if this player active |
| 6177 | if (mstruct.objhandlecxx . . $ msafe_struct#objhandle. == OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!) |
| 6178 | continue; |
| 6179 | |
| 6180 | // Get the target position |
| 6181 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6182 | vtarget =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 6183 | |
| 6184 | // Get the viewer position |
| 6185 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handlesrc; |
| 6186 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6187 | vsource =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 6188 | |
| 6189 | // Get the viewer orientation |
| 6190 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handlesrc; |
| 6191 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ORIENTcxx . . $ `scripts/osiris_common.h:821:9`!, &mstruct); |
| 6192 | |
| 6193 | // Get the normalized vector from the source to the target |
| 6194 | float dist = vm_GetNormalizedDirFastcxx . . $ vm_GetNormalizedDirFast(94d642bbc45232c7).(&viewvec, &vtarget, &vsource); |
| 6195 | |
| 6196 | // Get the angle between the objects |
| 6197 | float dot = vm_DotProductcxx . . $ vm_DotProduct(a0b9c8659ecc16b8).(&viewvec, &mstruct.orientcxx . . $ msafe_struct#orient..fveccxx . . $ matrix#fvec.); |
| 6198 | |
| 6199 | // Check angle and distance |
| 6200 | if ((dot > testangle) && (dist < max_distance)) |
| 6201 | return 1; |
| 6202 | } |
| 6203 | |
| 6204 | // Didn't find any in the view cone |
| 6205 | return 0; |
| 6206 | } |
| 6207 | |
| 6208 | /* |
| 6209 | $$QUERY |
| 6210 | Objects |
| 6211 | b:Player is within the [i:Cone=90] degree view cone of [o:Object] at a max distance of [f:Distance] using flags |
| 6212 | [g:FVIHitFlags=1048585:16269119] qObjCanSeePlayerAdvanced Can object see a player Determines if the specified object can |
| 6213 | see a player (but allowing some customizability as to what the object can see through) |
| 6214 | |
| 6215 | Parameters: |
| 6216 | Object: The object doing the looking |
| 6217 | Cone: Angle between 0-360 which makes the viewcone that determines if the object can see the other object |
| 6218 | Distance: The player must be within this distance for this query to return true |
| 6219 | FVIHitFlags: Flags used to determine visibility |
| 6220 | $$END |
| 6221 | */ |
| 6222 | bool qObjCanSeePlayerAdvancedcxx . . $ qObjCanSeePlayerAdvanced(17bed177865b7a2b).(int cone, int handlesrc, float max_distance, int fvi_flags) { |
| 6223 | vectorcxx . . $ vector# vsource, vtarget, viewvec; |
| 6224 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6225 | matrixcxx . . $ matrix# orient; |
| 6226 | int sourceroom; |
| 6227 | |
| 6228 | // Get half of the angle that the user specified because they specified a cone, and we want an angle |
| 6229 | double cangle = (double)((double)cone / (double)2); |
| 6230 | double t = cangle * PIcxx . . $ `fix/fix.h:73:9`! / 180; |
| 6231 | double testangle = coscxx . . $ cos(fee4f1d22bc8e617).(t); |
| 6232 | |
| 6233 | // Get the viewer position |
| 6234 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handlesrc; |
| 6235 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6236 | vsource =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 6237 | |
| 6238 | // Get the viewer orientation |
| 6239 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ORIENTcxx . . $ `scripts/osiris_common.h:821:9`!, &mstruct); |
| 6240 | orient =cxx . . $ matrix#`operator=`(4c6f8b29806742). mstruct.orientcxx . . $ msafe_struct#orient.; |
| 6241 | |
| 6242 | // Get the viewer room |
| 6243 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ROOMNUMcxx . . $ `scripts/osiris_common.h:822:9`!, &mstruct); |
| 6244 | sourceroom = mstruct.roomnumcxx . . $ msafe_struct#roomnum.; |
| 6245 | |
| 6246 | // Loop though all possible players |
| 6247 | for (int p = 0; p < MAX_PLAYERScxx . . $ `scripts/osiris_common.h:927:9`!; p++) { |
| 6248 | |
| 6249 | // Get player position |
| 6250 | mstruct.slotcxx . . $ msafe_struct#slot. = p; |
| 6251 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_PLAYER_HANDLEcxx . . $ `scripts/osiris_common.h:838:9`!, &mstruct); |
| 6252 | |
| 6253 | // See if this player active |
| 6254 | if (mstruct.objhandlecxx . . $ msafe_struct#objhandle. == OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!) |
| 6255 | continue; |
| 6256 | |
| 6257 | // Get the target position |
| 6258 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6259 | vtarget =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 6260 | |
| 6261 | // Get the normalized vector from the source to the target |
| 6262 | float dist = vm_GetNormalizedDirFastcxx . . $ vm_GetNormalizedDirFast(94d642bbc45232c7).(&viewvec, &vtarget, &vsource); |
| 6263 | |
| 6264 | // Get the angle between the objects |
| 6265 | float dot = vm_DotProductcxx . . $ vm_DotProduct(a0b9c8659ecc16b8).(&viewvec, &orient.fveccxx . . $ matrix#fvec.); |
| 6266 | |
| 6267 | // Check angle and distance |
| 6268 | if ((dot > testangle) && (dist < max_distance)) { |
| 6269 | // see if we can cast a ray to the player |
| 6270 | ray_infocxx . . $ ray_info# ray; |
| 6271 | fvi_flags |= (FQ_CHECK_OBJScxx . . $ `lib/findintersection_external.h:59:9`! | FQ_ONLY_PLAYER_OBJcxx . . $ `lib/findintersection_external.h:69:9`!); |
| 6272 | int fate = FVI_RayCastcxx . . $ FVI_RayCast.(handlesrc, &vsource, &vtarget, sourceroom, 0.0f, fvi_flags, &ray); |
| 6273 | |
| 6274 | if (fate == HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`!) |
| 6275 | return true; |
| 6276 | |
| 6277 | if (fate == HIT_OBJECTcxx . . $ `lib/findintersection_external.h:47:9`!) { |
| 6278 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = ray.hit_objectcxx . . $ ray_info#hit_object.; |
| 6279 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 6280 | if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) { |
| 6281 | return 1; |
| 6282 | } |
| 6283 | |
| 6284 | return 1; |
| 6285 | } |
| 6286 | } |
| 6287 | } |
| 6288 | |
| 6289 | // Didn't find any in the view cone |
| 6290 | return 0; |
| 6291 | } |
| 6292 | |
| 6293 | /* |
| 6294 | $$QUERY |
| 6295 | Objects |
| 6296 | b:Player (store in [e:SavedObjectSlot]) is within the [i:Cone=90] degree view cone of [o:Object] at a max distance of |
| 6297 | [f:Distance] using flags [g:FVIHitFlags=1048585:16269119] qObjCanSeePlayerAdvancedWithStore Can object see a player |
| 6298 | Determines if the specified object can see a player (but allowing some customizability as to what the object can see |
| 6299 | through), and if the player can be seen, stores the object in the given object slot. |
| 6300 | |
| 6301 | Parameters: |
| 6302 | SavedObjectSlot: the slot to save the seen player object in |
| 6303 | Object: The object doing the looking |
| 6304 | Cone: Angle between 0-360 which makes the viewcone that determines if the object can see the other object |
| 6305 | Distance: The player must be within this distance for this query to return true |
| 6306 | FVIHitFlags: Flags used to determine visibility |
| 6307 | $$END |
| 6308 | */ |
| 6309 | bool qObjCanSeePlayerAdvancedWithStorecxx . . $ qObjCanSeePlayerAdvancedWithStore(8de546ec8bd22b36).(int slot, int cone, int handlesrc, float max_distance, int fvi_flags) { |
| 6310 | vectorcxx . . $ vector# vsource, vtarget, viewvec; |
| 6311 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6312 | matrixcxx . . $ matrix# orient; |
| 6313 | int sourceroom; |
| 6314 | |
| 6315 | // Get half of the angle that the user specified because they specified a cone, and we want an angle |
| 6316 | double cangle = (double)((double)cone / (double)2); |
| 6317 | double t = cangle * PIcxx . . $ `fix/fix.h:73:9`! / 180; |
| 6318 | double testangle = coscxx . . $ cos(fee4f1d22bc8e617).(t); |
| 6319 | |
| 6320 | // Get the viewer position |
| 6321 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handlesrc; |
| 6322 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6323 | vsource =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 6324 | |
| 6325 | // Get the viewer orientation |
| 6326 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ORIENTcxx . . $ `scripts/osiris_common.h:821:9`!, &mstruct); |
| 6327 | orient =cxx . . $ matrix#`operator=`(4c6f8b29806742). mstruct.orientcxx . . $ msafe_struct#orient.; |
| 6328 | |
| 6329 | // Get the viewer room |
| 6330 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_ROOMNUMcxx . . $ `scripts/osiris_common.h:822:9`!, &mstruct); |
| 6331 | sourceroom = mstruct.roomnumcxx . . $ msafe_struct#roomnum.; |
| 6332 | |
| 6333 | // Loop though all possible players |
| 6334 | for (int p = 0; p < MAX_PLAYERScxx . . $ `scripts/osiris_common.h:927:9`!; p++) { |
| 6335 | |
| 6336 | // Get player position |
| 6337 | mstruct.slotcxx . . $ msafe_struct#slot. = p; |
| 6338 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_PLAYER_HANDLEcxx . . $ `scripts/osiris_common.h:838:9`!, &mstruct); |
| 6339 | |
| 6340 | // See if this player active |
| 6341 | if (mstruct.objhandlecxx . . $ msafe_struct#objhandle. == OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!) |
| 6342 | continue; |
| 6343 | |
| 6344 | // Get the target position |
| 6345 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6346 | vtarget =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 6347 | |
| 6348 | // Get the normalized vector from the source to the target |
| 6349 | float dist = vm_GetNormalizedDirFastcxx . . $ vm_GetNormalizedDirFast(94d642bbc45232c7).(&viewvec, &vtarget, &vsource); |
| 6350 | |
| 6351 | // Get the angle between the objects |
| 6352 | float dot = vm_DotProductcxx . . $ vm_DotProduct(a0b9c8659ecc16b8).(&viewvec, &orient.fveccxx . . $ matrix#fvec.); |
| 6353 | |
| 6354 | // Check angle and distance |
| 6355 | if ((dot > testangle) && (dist < max_distance)) { |
| 6356 | // see if we can cast a ray to the player |
| 6357 | ray_infocxx . . $ ray_info# ray; |
| 6358 | fvi_flags |= (FQ_CHECK_OBJScxx . . $ `lib/findintersection_external.h:59:9`! | FQ_ONLY_PLAYER_OBJcxx . . $ `lib/findintersection_external.h:69:9`!); |
| 6359 | int fate = FVI_RayCastcxx . . $ FVI_RayCast.(handlesrc, &vsource, &vtarget, sourceroom, 0.0f, fvi_flags, &ray); |
| 6360 | |
| 6361 | if (fate == HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`!) { |
| 6362 | if ((slot >= 0) && (slot < MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!)) |
| 6363 | Saved_object_handlescxx . . $ Saved_object_handles.[slot] = mstruct.objhandlecxx . . $ msafe_struct#objhandle.; |
| 6364 | return true; |
| 6365 | } |
| 6366 | |
| 6367 | if (fate == HIT_OBJECTcxx . . $ `lib/findintersection_external.h:47:9`!) { |
| 6368 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = ray.hit_objectcxx . . $ ray_info#hit_object.; |
| 6369 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_TYPEcxx . . $ `scripts/osiris_common.h:812:9`!, &mstruct); |
| 6370 | if (mstruct.typecxx . . $ msafe_struct#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) { |
| 6371 | if ((slot >= 0) && (slot < MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!)) |
| 6372 | Saved_object_handlescxx . . $ Saved_object_handles.[slot] = mstruct.objhandlecxx . . $ msafe_struct#objhandle.; |
| 6373 | return 1; |
| 6374 | } |
| 6375 | |
| 6376 | if ((slot >= 0) && (slot < MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!)) |
| 6377 | Saved_object_handlescxx . . $ Saved_object_handles.[slot] = mstruct.objhandlecxx . . $ msafe_struct#objhandle.; |
| 6378 | |
| 6379 | return 1; |
| 6380 | } |
| 6381 | } |
| 6382 | } |
| 6383 | |
| 6384 | // Didn't find any in the view cone |
| 6385 | if ((slot >= 0) && (slot < MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!)) |
| 6386 | Saved_object_handlescxx . . $ Saved_object_handles.[slot] = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 6387 | |
| 6388 | return 0; |
| 6389 | } |
| 6390 | |
| 6391 | /* |
| 6392 | $$QUERY |
| 6393 | Rooms |
| 6394 | b:A player is in room [r:Room] |
| 6395 | qRoomHasPlayer |
| 6396 | A player is in the room |
| 6397 | Determines if a player is in the specified room |
| 6398 | |
| 6399 | Parameters: |
| 6400 | Room: the room to check |
| 6401 | $$END |
| 6402 | */ |
| 6403 | bool qRoomHasPlayercxx . . $ qRoomHasPlayer(83c267b20bac841a).(int roomnum) { |
| 6404 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6405 | |
| 6406 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 6407 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_ROOM_HAS_PLAYERcxx . . $ `scripts/osiris_common.h:797:9`!, &mstruct); |
| 6408 | |
| 6409 | return mstruct.statecxx . . $ msafe_struct#state.; |
| 6410 | } |
| 6411 | |
| 6412 | /* |
| 6413 | $$QUERY |
| 6414 | Mission |
| 6415 | b:Is the ship [a:Ship] enabled? |
| 6416 | qIsShipEnabled |
| 6417 | Given the name of a ship, it will return true |
| 6418 | if the ship is allowed to be chosen in the single player |
| 6419 | ship selection. |
| 6420 | |
| 6421 | Parameters: |
| 6422 | Ship: The name of the ship you want to query |
| 6423 | $$END |
| 6424 | */ |
| 6425 | bool qIsShipEnabledcxx . . $ qIsShipEnabled(c5f7da30cbc0f4e9).(const char *Ship) { return Game_IsShipEnabledcxx . . $ Game_IsShipEnabled.(Ship); } |
| 6426 | |
| 6427 | /* |
| 6428 | $$QUERY |
| 6429 | Rooms |
| 6430 | f:Room [r:Room] damage |
| 6431 | qRoomGetDamage |
| 6432 | Get room damage |
| 6433 | Returns the current damage setting for the specified room |
| 6434 | |
| 6435 | Parameters: |
| 6436 | Room: The room for which the damage is returned |
| 6437 | $$END |
| 6438 | */ |
| 6439 | float qRoomGetDamagecxx . . $ qRoomGetDamage(5cde91ea12d43f46).(int roomnum) { |
| 6440 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6441 | |
| 6442 | mstruct.roomnumcxx . . $ msafe_struct#roomnum. = roomnum; |
| 6443 | |
| 6444 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_ROOM_DAMAGEcxx . . $ `scripts/osiris_common.h:793:9`!, &mstruct); |
| 6445 | |
| 6446 | return mstruct.amountcxx . . $ msafe_struct#amount.; |
| 6447 | } |
| 6448 | |
| 6449 | /* |
| 6450 | $$QUERY |
| 6451 | Objects |
| 6452 | o:Saved object handle [e:SavedObjectSlot] |
| 6453 | qObjSavedHandle |
| 6454 | Saved object handle |
| 6455 | Returns the object handle saved in the specified slot |
| 6456 | |
| 6457 | Parameters: |
| 6458 | HandleSlot: the slot for which the object handle is returned |
| 6459 | $$END |
| 6460 | */ |
| 6461 | int qObjSavedHandlecxx . . $ qObjSavedHandle(7864480464b09eea).(int slot) { |
| 6462 | if ((slot >= 0) && (slot < MAX_SAVED_OBJECT_HANDLEScxx . . $ `scripts/DallasFuncs.cpp:925:9`!)) |
| 6463 | return Saved_object_handlescxx . . $ Saved_object_handles.[slot]; |
| 6464 | else |
| 6465 | return OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 6466 | } |
| 6467 | |
| 6468 | /* |
| 6469 | $$QUERY |
| 6470 | Triggers |
| 6471 | Trigger [t:Trigger] state |
| 6472 | qTriggerGetState |
| 6473 | Get the enabled/disabled state of a trigger |
| 6474 | Determines if a trigger is enabled or disabled |
| 6475 | |
| 6476 | Parameters: |
| 6477 | Trigger: which trigger to check |
| 6478 | $$END |
| 6479 | */ |
| 6480 | bool qTriggerGetStatecxx . . $ qTriggerGetState(83c267b20bac841a).(int trigger_num) { |
| 6481 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6482 | |
| 6483 | mstruct.trigger_numcxx . . $ msafe_struct#trigger_num. = trigger_num; |
| 6484 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_TRIGGER_SETcxx . . $ `scripts/osiris_common.h:879:9`!, &mstruct); |
| 6485 | |
| 6486 | return mstruct.statecxx . . $ msafe_struct#state.; |
| 6487 | } |
| 6488 | |
| 6489 | /* |
| 6490 | $$QUERY |
| 6491 | Objects |
| 6492 | i:Number of [e:ObjectType] objects of ID = [a:ObjectIDName] in mine |
| 6493 | qObjCountTypeID |
| 6494 | Get number of objects of a certain type |
| 6495 | Counts the number of objects of the specified type |
| 6496 | |
| 6497 | Parameters: |
| 6498 | ObjectType: the type of the objects to count |
| 6499 | ObjectIDName: the name of the object ID to count |
| 6500 | $$END |
| 6501 | */ |
| 6502 | int qObjCountTypeIDcxx . . $ qObjCountTypeID(95e580389a7cc305).(int type, const char *idname) { |
| 6503 | int id = Obj_FindIDcxx . . $ Obj_FindID.(idname); |
| 6504 | |
| 6505 | if (id != -1) { |
| 6506 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6507 | |
| 6508 | mstruct.typecxx . . $ msafe_struct#type. = type; |
| 6509 | mstruct.idcxx . . $ msafe_struct#id. = id; |
| 6510 | |
| 6511 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_COUNT_TYPEcxx . . $ `scripts/osiris_common.h:847:9`!, &mstruct); |
| 6512 | |
| 6513 | return mstruct.countcxx . . $ msafe_struct#count.; |
| 6514 | } else |
| 6515 | return 0; |
| 6516 | } |
| 6517 | |
| 6518 | /* |
| 6519 | $$ACTION |
| 6520 | Misc |
| 6521 | Show HUD message [s:Message] [f:Float] |
| 6522 | aShowHUDMessageF |
| 6523 | Show HUD message |
| 6524 | Shows a HUD message for all players with a float parameter |
| 6525 | |
| 6526 | Parameters: |
| 6527 | Message: The message to show, with %f marking where the number should go |
| 6528 | $$END |
| 6529 | */ |
| 6530 | #define aShowHUDMessageFcxx . . $ `scripts/DallasFuncs.cpp:6530:9`! aShowHUDMessage |
| 6531 | |
| 6532 | /* |
| 6533 | $$ACTION |
| 6534 | Misc |
| 6535 | Show HUD message [s:Message] for player [o:PlayerObject=IT] with parm [f:Float] |
| 6536 | aShowHUDMessageObjF |
| 6537 | Show HUD message to one player |
| 6538 | Shows a HUD message for one players with a float parameter |
| 6539 | |
| 6540 | Parameters: |
| 6541 | Message: The message to show, with %f marking where the number should go |
| 6542 | PlayerObject: the player who sees the message |
| 6543 | Float: the number to show |
| 6544 | $$END |
| 6545 | */ |
| 6546 | #define aShowHUDMessageObjFcxx . . $ `scripts/DallasFuncs.cpp:6546:9`! aShowHUDMessageObj |
| 6547 | |
| 6548 | /* |
| 6549 | $$ACTION |
| 6550 | Misc |
| 6551 | Show HUD message [s:Message] [i:Integer] |
| 6552 | aShowHUDMessageI |
| 6553 | Show HUD message |
| 6554 | Shows a HUD message for all players with an integer parameter |
| 6555 | |
| 6556 | Parameters: |
| 6557 | Message: The message to show, with %d marking where the number should go |
| 6558 | $$END |
| 6559 | */ |
| 6560 | #define aShowHUDMessageIcxx . . $ `scripts/DallasFuncs.cpp:6560:9`! aShowHUDMessage |
| 6561 | |
| 6562 | /* |
| 6563 | $$QUERY |
| 6564 | Level Goals |
| 6565 | b:All Primary Objectives Complete |
| 6566 | qGoalPrimariesComplete |
| 6567 | All Primary Objective Complete |
| 6568 | Determines if all primary objectives are complete |
| 6569 | |
| 6570 | Parameters: |
| 6571 | None. |
| 6572 | $$END |
| 6573 | */ |
| 6574 | bool qGoalPrimariesCompletecxx . . $ qGoalPrimariesComplete(c9857a73d68e59ba).() { |
| 6575 | int flags = LF_ALL_PRIMARIES_DONEcxx . . $ `Descent3/levelgoal_external.h:23:9`!; |
| 6576 | |
| 6577 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, LGV_I_STATUScxx . . $ `scripts/osiris_common.h:710:9`!, &flags); |
| 6578 | |
| 6579 | return (flags != 0); |
| 6580 | } |
| 6581 | |
| 6582 | /* |
| 6583 | $$QUERY |
| 6584 | Level Goals |
| 6585 | b:Goal [l:LevelGoal] is enabled |
| 6586 | qGoalEnabled |
| 6587 | Goal is enabled |
| 6588 | Determines if the specified goal is enabled |
| 6589 | |
| 6590 | Parameters: |
| 6591 | LevelGoal: the goal to check |
| 6592 | $$END |
| 6593 | */ |
| 6594 | bool qGoalEnabledcxx . . $ qGoalEnabled(83c267b20bac841a).(int goal_index) { |
| 6595 | int flags; |
| 6596 | |
| 6597 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, LGSV_I_STATUScxx . . $ `scripts/osiris_common.h:725:9`!, &flags, goal_index); |
| 6598 | |
| 6599 | return ((flags & LGF_ENABLEDcxx . . $ `Descent3/levelgoal_external.h:40:9`!) != 0); |
| 6600 | } |
| 6601 | |
| 6602 | /* |
| 6603 | $$QUERY |
| 6604 | Level Goals |
| 6605 | b:Goal [l:LevelGoal] is complete |
| 6606 | qGoalCompleted |
| 6607 | Goal is enabled |
| 6608 | Determines if the specified goal is complete |
| 6609 | |
| 6610 | Parameters: |
| 6611 | LevelGoal: the goal to check |
| 6612 | $$END |
| 6613 | */ |
| 6614 | bool qGoalCompletedcxx . . $ qGoalCompleted(83c267b20bac841a).(int goal_index) { |
| 6615 | int flags; |
| 6616 | |
| 6617 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, LGSV_I_STATUScxx . . $ `scripts/osiris_common.h:725:9`!, &flags, goal_index); |
| 6618 | |
| 6619 | return ((flags & LGF_COMPLETEDcxx . . $ `Descent3/levelgoal_external.h:41:9`!) != 0); |
| 6620 | } |
| 6621 | |
| 6622 | /* |
| 6623 | $$QUERY |
| 6624 | Level Goals |
| 6625 | b:Goal [l:LevelGoal] is failed |
| 6626 | qGoalFailed |
| 6627 | Goal is failed |
| 6628 | Determines if the specified goal is failed |
| 6629 | |
| 6630 | Parameters: |
| 6631 | LevelGoal: the goal to check |
| 6632 | $$END |
| 6633 | */ |
| 6634 | bool qGoalFailedcxx . . $ qGoalFailed(83c267b20bac841a).(int goal_index) { |
| 6635 | int flags; |
| 6636 | |
| 6637 | LGoal_Valuecxx . . $ LGoal_Value(295e93bc75a1dcc5).(VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, LGSV_I_STATUScxx . . $ `scripts/osiris_common.h:725:9`!, &flags, goal_index); |
| 6638 | |
| 6639 | return ((flags & LGF_FAILEDcxx . . $ `Descent3/levelgoal_external.h:45:9`!) != 0); |
| 6640 | } |
| 6641 | |
| 6642 | /* |
| 6643 | $$QUERY |
| 6644 | Players |
| 6645 | o:Closest player to [o:Object]. Store dist in user var [e:UserVar]. |
| 6646 | qPlayerClosest |
| 6647 | Closest player |
| 6648 | Find the closest player to the specified object |
| 6649 | |
| 6650 | Parameters: |
| 6651 | Object: the object to check players against |
| 6652 | $$END |
| 6653 | */ |
| 6654 | int qPlayerClosestcxx . . $ qPlayerClosest(9b79fb6aee4c0440).(int objhandle, int varnum) { |
| 6655 | vectorcxx . . $ vector# objpos; |
| 6656 | float closest_dist = FLT_MAXcxx . . $ `<external>/18143172452841944454/float.h:104:9`!; |
| 6657 | int closest_player = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!; |
| 6658 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6659 | |
| 6660 | // Get the object position |
| 6661 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = objhandle; |
| 6662 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6663 | objpos =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). mstruct.poscxx . . $ msafe_struct#pos.; |
| 6664 | |
| 6665 | // Loop though all possible players and compute distance |
| 6666 | for (int p = 0; p < MAX_PLAYERScxx . . $ `scripts/osiris_common.h:927:9`!; p++) { |
| 6667 | |
| 6668 | // Get player position |
| 6669 | mstruct.slotcxx . . $ msafe_struct#slot. = p; |
| 6670 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_PLAYER_HANDLEcxx . . $ `scripts/osiris_common.h:838:9`!, &mstruct); |
| 6671 | |
| 6672 | // See if this player active |
| 6673 | if (mstruct.objhandlecxx . . $ msafe_struct#objhandle. == OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!) |
| 6674 | continue; |
| 6675 | |
| 6676 | // Get the target position |
| 6677 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_POScxx . . $ `scripts/osiris_common.h:820:9`!, &mstruct); |
| 6678 | |
| 6679 | // Get the normalized vector from the source to the target |
| 6680 | float dist = vm_VectorDistanceQuickcxx . . $ vm_VectorDistanceQuick(a0b9c8659ecc16b8).(&objpos, &mstruct.poscxx . . $ msafe_struct#pos.); |
| 6681 | |
| 6682 | if (dist < closest_dist) { |
| 6683 | closest_dist = dist; |
| 6684 | closest_player = mstruct.objhandlecxx . . $ msafe_struct#objhandle.; |
| 6685 | } |
| 6686 | } |
| 6687 | |
| 6688 | if ((varnum >= 0) && (varnum < MAX_USER_VARScxx . . $ `scripts/DallasFuncs.cpp:916:9`!)) |
| 6689 | User_varscxx . . $ User_vars.[varnum] = closest_dist; |
| 6690 | |
| 6691 | return closest_player; |
| 6692 | } |
| 6693 | |
| 6694 | /* |
| 6695 | $$QUERY |
| 6696 | Objects |
| 6697 | f:[o:WeaponObject=IT] damage |
| 6698 | qObjDamage |
| 6699 | Object damage |
| 6700 | Returns the amount of damage the given weapon object does |
| 6701 | |
| 6702 | Parameters: |
| 6703 | WeaponObject: The weapon object whose damage it returned |
| 6704 | $$END |
| 6705 | */ |
| 6706 | float qObjDamagecxx . . $ qObjDamage(5cde91ea12d43f46).(int handle) { |
| 6707 | msafe_structcxx . . $ msafe_struct# mstruct; |
| 6708 | |
| 6709 | mstruct.objhandlecxx . . $ msafe_struct#objhandle. = handle; |
| 6710 | MSafe_GetValuecxx . . $ MSafe_GetValue.(MSAFE_OBJECT_DAMAGE_AMOUNTcxx . . $ `scripts/osiris_common.h:854:9`!, &mstruct); |
| 6711 | |
| 6712 | return mstruct.amountcxx . . $ msafe_struct#amount.; |
| 6713 | } |
| 6714 | |
| 6715 | /* |
| 6716 | $$QUERY |
| 6717 | Misc |
| 6718 | f:Frametime |
| 6719 | qFrametime |
| 6720 | Game Frametime |
| 6721 | Returns the frametime |
| 6722 | |
| 6723 | Parameters: |
| 6724 | None |
| 6725 | $$END |
| 6726 | */ |
| 6727 | float qFrametimecxx . . $ qFrametime(9b8c9e39889c762c).() { return Game_GetFrameTimecxx . . $ Game_GetFrameTime.(); } |
| 6728 | |
| 6729 | /* |
| 6730 | $$QUERY |
| 6731 | AI |
| 6732 | f:[o:Object] max speed |
| 6733 | qAIQueryMaxSpeed |
| 6734 | |
| 6735 | Parameters: |
| 6736 | Object: Get object's max speed. |
| 6737 | $$END |
| 6738 | */ |
| 6739 | float qAIQueryMaxSpeedcxx . . $ qAIQueryMaxSpeed(5cde91ea12d43f46).(int objhandle) { |
| 6740 | float max_speed = 0.0f; |
| 6741 | AI_Valuecxx . . $ AI_Value.(objhandle, VF_GETcxx . . $ `scripts/osiris_common.h:450:9`!, AIV_F_MAX_SPEEDcxx . . $ `scripts/osiris_common.h:505:9`!, &max_speed); |
| 6742 | return max_speed; |
| 6743 | } |