Debian Codegraph @

Descent3/Player.cpp

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
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/Main/Player.cpp $
21 * $Revision: 331 $
22 * $Date: 10/22/01 12:43p $
23 * $Author: Matt $
24 *
25 * Code for dealing with players
26 *
27 * $Log: /DescentIII/Main/Player.cpp $
28 *
29 * 331 10/22/01 12:43p Matt
30 * On player death/exit, don't try to spew a red guidebot if Mercenary is
31 * not installed.
32 *
33 * 330 3/20/00 12:19p Matt
34 * Merge of Duane's post-1.3 changes.
35 * Change for no avilable vis effects.
36 *
37 * 329 1/26/00 9:20p Jeff
38 * added support for IntelliVIBE DLL
39 *
40 * 328 11/02/99 1:56p Chris
41 * Fixed bug with black pyro spewing a blue gb on death
42 *
43 * 327 10/21/99 9:28p Jeff
44 * B.A. Macintosh code merge
45 *
46 * 326 10/20/99 5:40p Chris
47 * Added the Red Guidebot
48 *
49 * 325 7/28/99 3:47p Kevin
50 * Mac!
51 *
52 * 324 7/26/99 4:56p Kevin
53 * more demo bug fixes
54 *
55 * 323 7/26/99 12:40p Kevin
56 * Fixed some multiplayer client recorded demo bugs
57 *
58 * 322 7/08/99 5:45p Jason
59 * Bug fixes for the patch
60 *
61 * 321 5/23/99 3:06a Jason
62 * fixed bug with player rankings not being updated correctly
63 *
64 * 320 5/21/99 7:09p Jason
65 * fixed some weird multiplayer rejoin anomalies
66 *
67 * 319 5/20/99 7:54p 3dsmax
68 * added better memory support changing ships
69 *
70 * 318 5/20/99 2:53p Jason
71 * made autowaypoints work in coop
72 *
73 * 317 5/20/99 2:48a Matt
74 * Auto-waypoints now stored & used per player. Manual waypoints will all
75 * players, once Jason makes it work.
76 *
77 * 316 5/19/99 3:25p Jason
78 * fixed wrong ordering of InitObjectScripts and MultiSendObject
79 *
80 * 315 5/17/99 11:03a Matt
81 * When initializing the player ship for a new level, limit the ammo to
82 * the max the ship can carry.
83 *
84 * 314 5/13/99 3:41p Ardussi
85 * changes for compiling on the Mac
86 *
87 * 313 5/12/99 3:26p Jason
88 * made terrain damage effect multiplayer friendly
89 *
90 * 312 5/10/99 10:23p Ardussi
91 * changes to compile on Mac
92 *
93 * 311 5/10/99 9:25p Jeff
94 * first phase of Rock 'n' Ride support added
95 *
96 * 310 5/10/99 2:01a Jason
97 * make player invulnerable for 2 seconds during respawn in a single
98 * player game
99 *
100 * 309 5/08/99 4:12p Chris
101 * Added AI hearing noises... version 1
102 *
103 * 308 5/07/99 1:44p Chris
104 * Made in-game cinematics use the ORIENT_PATH_NODE for player ships
105 *
106 * 307 5/05/99 2:33p Jason
107 * Room 18 face 116: No connection for edge 3
108 * Room 18 face 116: No connection for edge 4
109 * Room 18 face 116: No connection for edge 5
110 * Room 18 face 140: No connection for edge 0
111 * Fixed some multiplayer issues
112 *
113 * 306 5/05/99 1:32a Jeff
114 * save/restore player energy also
115 *
116 * 305 5/05/99 1:28a Jeff
117 * save/restore player's shields in single player game if they are over
118 * 100
119 *
120 * 304 5/04/99 9:27p Jeff
121 * cheaters don't win! (no score for cheaters)
122 *
123 * 303 5/04/99 7:09p Jason
124 * changed sun damage effect just a little
125 *
126 * 302 4/29/99 3:03p Jason
127 * fixed player popping in and out in a multiplayer game
128 *
129 * 301 4/28/99 5:55p Matt
130 * Don't spew powerup for secondaries if have none. This fixes spewing
131 * multipacks with count == 0.
132 *
133 * 300 4/28/99 5:10p Jeff
134 * fixed inventory spew in multiplayer (with non-spewable items)
135 *
136 * 299 4/28/99 2:25a Jeff
137 * added call to add guidebot in selected multiplayer games to the clients
138 *
139 * 298 4/27/99 10:33p Matt
140 * Added code to spew multi-pack powerups upon death if available for a
141 * weapon. Now you're not limited to spewing three homing missiles, for
142 * example -- you can spew a multi-pack with 8 missiles in it.
143 *
144 * 297 4/27/99 4:27p Jeff
145 * added player respawn osiris event
146 *
147 * 296 4/27/99 4:44a Jeff
148 * only add guidebots to inventory in a single player game...must figure
149 * out a way to handle initial join of multiplayer
150 *
151 * 295 4/27/99 1:38a Jason
152 * fixed sparse array bug with players
153 *
154 * 294 4/26/99 7:53p Jason
155 * temp fix for multiplayer waypoints
156 *
157 * 293 4/24/99 10:39p Samir
158 * turn off any current ship engine sounds if ship noises are turned off
159 *
160 * 292 4/24/99 8:40p Samir
161 * ship toggle sounds implemented.
162 *
163 * 291 4/24/99 7:22p Jason
164 * fixed another respawn problem
165 *
166 * 290 4/24/99 6:45p Jeff
167 * added functions for theif so he can steal things other than weapons
168 *
169 * 289 4/24/99 2:20a Chris
170 * Added the Neutral_till_hit flag
171 *
172 * 288 4/23/99 1:56a Matt
173 * Added system for counting kills of friendly objects
174 *
175 * 287 4/22/99 4:31p Jason
176 * fixed team spawning problems
177 *
178 * 286 4/21/99 11:05a Kevin
179 * new ps_rand and ps_srand to replace rand & srand
180 *
181 * 285 4/14/99 3:57a Jeff
182 * fixed case mismatch in #includes
183 *
184 * 284 4/10/99 5:56p Matt
185 * Cleaned up object initialization code, including create object & load
186 * object.
187 *
188 * 283 4/09/99 7:04p Jason
189 * changed some texture defines
190 *
191 * 282 4/06/99 6:25p Jason
192 * various fixes for multiplayer
193 *
194 * 281 4/06/99 6:02p Matt
195 * Added score system
196 *
197 * 280 4/06/99 2:08p Jason
198 * fixed crashes with dying models not being set
199 *
200 * 279 4/05/99 3:34p Matt
201 * Cleaned up player start flags
202 *
203 * 278 4/05/99 10:54a Matt
204 * Added auto-waypoint system
205 *
206 * 277 4/03/99 2:20p Jason
207 * added better heat damage effect
208 *
209 * 276 4/02/99 6:31p Jason
210 * Fixed multiplayer powerup/player start bugs
211 *
212 * 275 4/02/99 3:55p Chris
213 * Fixed or at least commented about guidebot bugs
214 *
215 * 274 3/31/99 10:27a Samir
216 * code to reset auto select states when ship is initializiaed and code to
217 * save and load these states from disk.
218 *
219 * 273 3/23/99 12:33p Kevin
220 * More post level results improvements
221 *
222 * 272 3/16/99 6:43p Kevin
223 * OEM Split fixes
224 *
225 * 271 3/12/99 7:45p Jeff
226 * handle demo items (lifeleft, player change type, etc). Reset quad fire
227 * masks on inventory spew.
228 *
229 * 270 3/11/99 6:31p Jeff
230 * numerous fixes to demo system in multiplayer games (when
231 * recording/playback a demo in a multiplayer game)
232 *
233 * 269 3/10/99 2:25p Kevin
234 * Save/Load and Demo file fixes
235 *
236 * 268 3/09/99 6:34p Kevin
237 * Made the training mission not be branching, and fixed the crash with
238 * people dying in the demo playback
239 *
240 * 267 3/09/99 6:17p Jason
241 * fixed observer mode changing
242 *
243 * 266 3/09/99 3:19p Jason
244 * fixed persistent player death message in multiplayer game
245 *
246 * 265 3/08/99 5:14p Jason
247 * added delay to player respawn after death
248 *
249 * 264 3/05/99 11:57a Jason
250 * fixes for OEM
251 *
252 * 263 3/04/99 7:39p Matt
253 * Added sound effects to FreeSpace-style persistent HUD messages.
254 *
255 * 262 3/03/99 5:35p Matt
256 * Added fade-out for goal complete messages
257 *
258 * 261 3/03/99 3:38a Samir
259 * reset reticle when you die.
260 *
261 * 260 3/02/99 2:50p Samir
262 * hud observer mode works with rest of hud.
263 *
264 * 259 3/02/99 1:17p Jason
265 * made player textures play at a fixed rate
266 *
267 * 258 3/02/99 12:22p Matt
268 * Revisions to weapon & ammo powerups. Not fully tested.
269 *
270 * 257 3/01/99 7:20p Chris
271 * Fixed dist problems with finding nearby objects
272 *
273 * 256 3/01/99 4:17p Jeff
274 *
275 * 255 2/25/99 8:55p Jeff
276 * Inventory supports level change persistant items. Inventory supports
277 * time-out objects. Inventory Reset changed (takes a level of reset
278 * now). Quad lasers stay across level change (single player). Guidebot
279 * bug fixed (now back in ship on level start). Quads time out when
280 * spewed. Invulnerability and cloak powerups no longer use game
281 * event/callbacks, so they can be saved in game saves (moved to
282 * MakePlayerInvulnerable and MakeObjectInvisible)
283 *
284 * 254 2/25/99 10:28a Jason
285 * made player able to fire flares in netgames
286 *
287 * 253 2/24/99 11:25a Matt
288 * Small improvement
289 *
290 * 251 2/23/99 7:35p Jeff
291 * handle not spewing of inventory items marked as such
292 *
293 * 250 2/22/99 2:04p Jason
294 * added different damages for players and generics
295 *
296 * 249 2/18/99 5:27p Matt
297 * Added color parm to AddPersistentHUDMessage() and fixed the timeout.
298 *
299 * 248 2/17/99 2:08p Jason
300 * fixed observermode bug
301 *
302 * 247 2/17/99 2:04p Jason
303 * changed spew timeouts just a little
304 *
305 * 246 2/16/99 3:47p Jason
306 * added marker updates to multiplayer server stream
307 *
308 * 245 2/15/99 7:50p Jeff
309 * new pilot file class and read/write system checked in...should be more
310 * robust than old
311 *
312 * 244 2/15/99 11:22a Jason
313 * took out client-side prediciton
314 *
315 * 243 2/13/99 12:32a Jeff
316 * updated inventory spew to handle 'new' inventory system. Inventory
317 * reset takes a different parameter too now.
318 *
319 * 242 2/12/99 3:38p Jason
320 * added client side interpolation
321 *
322 * 241 2/11/99 1:22a Jeff
323 * made function to switch a player into AI mode, converted code that did
324 * this to call this function.
325 *
326 * 240 2/10/99 1:47p Matt
327 * Changed object handle symbolic constants
328 *
329 * 239 2/09/99 6:53p Jeff
330 * implemented 'typing inidcator' in multiplayer...players that are typing
331 * messages have an icon on them
332 *
333 * 238 2/08/99 5:26p Jeff
334 * removed all calls to MultiSendRemoveObject, incorportated into
335 * SetObjectDeadFlag. Fixes sequencing issues in multiplayer
336 *
337 * 237 2/08/99 3:06a Jeff
338 * added a function to reset a player's control type
339 *
340 * 236 2/06/99 10:03p Matt
341 * Added keys system
342 *
343 * 235 2/04/99 11:20a Jason
344 * added waypoint message
345 *
346 * 234 2/04/99 11:01a Jason
347 * added anti cheating to multiplayer
348 *
349 * 233 2/03/99 4:26p Jason
350 * made multiplayer coop actually work!
351 *
352 * 232 2/03/99 1:50a Jeff
353 * fixed bug on checking if a player ship is available (if -1 is passed
354 * in)
355 *
356 * 231 2/01/99 4:25p Jeff
357 * fixed player invulnerabilty after cinematic sequence and death bug
358 *
359 * 230 2/01/99 12:56p Jeff
360 * correctly restore hud if in cinematics
361 *
362 * 229 1/31/99 7:26p Matt
363 * Renamed a bunch of functions to have HUD capitalized
364 *
365 * 228 1/29/99 7:13p Jeff
366 * localization
367 *
368 * 227 1/28/99 6:17p Jason
369 * added markers
370 *
371 * 226 1/27/99 6:37p Jason
372 * fixed player spawning over terrain
373 *
374 * 225 1/21/99 11:15p Jeff
375 * pulled out some structs and defines from header files and moved them
376 * into seperate header files so that multiplayer dlls don't require major
377 * game headers, just those new headers. Side effect is a shorter build
378 * time. Also cleaned up some header file #includes that weren't needed.
379 * This affected polymodel.h, object.h, player.h, vecmat.h, room.h,
380 * manage.h and multi.h
381 *
382 * 224 1/20/99 4:23p Jason
383 * made player flags work again
384 *
385 * 223 1/18/99 6:18p Kevin
386 * Added controller masking to DALLAS
387 *
388 * 222 1/15/99 7:52p Chris
389 * Updated ObjSetPos() to include a f_update_attach_children flag
390 *
391 * 221 1/14/99 4:24p Jason
392 * made damage effect go away much faster
393 *
394 * 220 1/13/99 2:29a Chris
395 * Massive AI, OSIRIS update
396 *
397 * 219 1/12/99 7:11p Jeff
398 * init scripts on player spew
399 *
400 * 218 1/08/99 2:56p Samir
401 * Ripped out OSIRIS1.
402 *
403 * 217 1/06/99 12:34p Jason
404 * misc changes for multiplayer
405 *
406 * 216 12/01/98 3:35p Matt
407 * Got rear view working.
408 *
409 * 215 11/23/98 1:50p Jason
410 * added thruster sounds
411 *
412 * 214 11/13/98 12:30p Jason
413 * changes for weapons
414 *
415 * 213 11/11/98 7:18p Jeff
416 * changes made so that a dedicated server's team is always -1 (team game
417 * or not)
418 *
419 * 212 11/11/98 11:41a Jason
420 * added sunlight damage
421 *
422 * 211 11/06/98 11:39a Chris
423 * Robots with flamethrowers and Omega cannons work in single player
424 *
425 * 210 11/03/98 6:16p Chris
426 * Starting to make on/off and spray weapons accessable to robots
427 *
428 * 209 10/29/98 4:54p Jason
429 * made ClearTransientObjects not work in multiplayer
430 *
431 * 208 10/28/98 5:25p Jason
432 * fixed player death problems in multiplayer
433 *
434 * 207 10/22/98 10:45p Samir
435 * try more death options.
436 *
437 * 206 10/22/98 2:58p Chris
438 * Difficulty levels are in beta
439 *
440 * 205 10/19/98 9:22p Matt
441 * Stop effects sound when resetting player object.
442 *
443 * 204 10/19/98 11:35a Chris
444 * Made a change in when the player gets GB
445 *
446 * 203 10/18/98 11:11p Matt
447 * Added call to ClearTransientObjects() and cleaned up some sequencing
448 * stuff.
449 *
450 * 202 10/18/98 7:27p Samir
451 * spin on y axis for d2 death.
452 *
453 * 201 10/17/98 3:07p Jason
454 * respawn players not near each other
455 *
456 * 200 10/16/98 1:54p Kevin
457 * Changes for Demo Beta 4
458 *
459 * 199 10/14/98 4:27p Samir
460 * use new persistent hud message system for death message.
461 *
462 * 198 10/14/98 1:02p Jason
463 * fixed FindSoundName issues
464 *
465 * 197 10/13/98 4:12p Jason
466 * toned down speed of observer mode
467 *
468 * 196 10/13/98 3:41p Kevin
469 * bug fixes
470 *
471 * 195 10/13/98 2:31p Jason
472 * automatically create new player starts
473 *
474 * 194 10/13/98 1:53p Jason
475 * added some asserts to track down explosion bug
476 *
477 * 193 10/08/98 5:49p Sean
478 * (Jeff) fixed reset of Quad fire flag when resetting a player ship
479 *
480 * 192 10/08/98 3:36p Jason
481 * fixes for the demo
482 *
483 * 191 10/07/98 9:29p Jeff
484 * reset quad firing masks on init new ship
485 *
486 * 190 10/07/98 12:35p Jason
487 * fixed player cameras going from level to level
488 *
489 * 189 10/05/98 6:48p Jason
490 * took out annoying mprintf
491 *
492 * 188 10/03/98 8:05p Matt
493 * Added asserts
494 *
495 * 187 10/02/98 8:54p Jason
496 * fixed bad parentin on badass damage
497 *
498 * 186 10/02/98 12:31p Samir
499 * restored player breakup with fixed code (from renderobject.cpp too).
500 *
501 * 185 10/01/98 11:30a Jeff
502 * made the observer mode events into just a client event
503 *
504 * 184 9/30/98 4:05p Jason
505 * more parenting fun
506 *
507 * 183 9/30/98 3:49p Jeff
508 * added events for when a player enters/exits observer mode
509 *
510 * 182 9/30/98 3:17p Jason
511 * fixed countermeasure spewing problem
512 *
513 * 181 9/29/98 1:59p Jason
514 * don't do breakup death
515 *
516 * 180 9/28/98 8:39p Jason
517 * give spewed objects parents
518 *
519 * 179 9/28/98 10:59a Samir
520 * clarified passing of pointer to CreateFireball in
521 * PlayerShipSpewPartSub. Adding two vectors should return a vector
522 * reference, and that should be valid, but I guess not.
523 *
524 * 178 9/23/98 6:07p Samir
525 * player death cam should fit nicely on walls.
526 *
527 * 177 9/23/98 2:55p Chris
528 * Improved auto-leveling and added newbie leveling
529 *
530 * 176 9/22/98 6:48p Jason
531 * fixed dedicated server problems
532 *
533 * 175 9/22/98 5:20p Jason
534 * fixed some player bugs
535 *
536 * 174 9/22/98 11:15a Jeff
537 * took out bad ASSERT
538 *
539 * 173 9/21/98 12:56p Jason
540 * made camera even smoother
541 *
542 * 172 9/21/98 12:11p Jason
543 * fixed camera problems
544 *
545 * 171 9/18/98 6:09p Jason
546 * added smoother camera
547 *
548 * 170 9/18/98 4:52p Jason
549 * Incremental checkin for camera
550 *
551 * 169 9/18/98 1:27p Matt
552 * Added afterburner release sound
553 *
554 * 168 9/18/98 11:18a Jason
555 * fixed miscellaneous bugs with camera system
556 *
557 * 167 9/17/98 3:03p Jason
558 * added lightning and invul hit effects
559 *
560 * 166 9/16/98 5:10p Jason
561 * added first pass at thrid-person camera system
562 *
563 * 165 9/11/98 12:26p Jason
564 * got energy to shield and fusion damage working in multiplayer
565 *
566 * 164 9/10/98 12:18p Jason
567 * more changes to afterburner/thrust effect
568 *
569 * 163 9/09/98 7:09p Jason
570 * changed afterburner effect for ships
571 *
572 * 162 8/28/98 1:34p Matt
573 * Added code to reset the waypoint when starting a new level, and while I
574 * was at it cleaned up the new level start sequencing.
575 *
576 * 161 8/24/98 2:45p Jason
577 * added team start position stuff
578 *
579 * 160 8/24/98 12:24p Jason
580 * added waypoints and player start position flags
581 *
582 * 159 8/20/98 7:01p Jeff
583 * changed sound on energy->shields converter
584 *
585 * 158 8/19/98 12:38p Jason
586 * made countermeasure spewing work correctly
587 *
588 * 157 8/17/98 10:48a Jason
589 * added more sparks when players explode
590 *
591 * 156 8/16/98 6:18p Chris
592 * Fixed player spewing
593 *
594 * 155 8/16/98 2:34a Jeff
595 * fixed a hud message
596 *
597 * 154 8/16/98 12:19a Jeff
598 * added energy->shields function
599 *
600 * 153 8/10/98 2:21p Jeff
601 * changes made due to adding flag for inventory reset
602 *
603 * 152 8/07/98 2:44p Jeff
604 * some changes to ship permissions (reset can take a -1 for pnum in order
605 * to reset everyone)
606 *
607 * 151 8/07/98 10:51a Jason
608 * made custom textures 64x64
609 *
610 * 150 8/06/98 2:44p Jeff
611 * added ship permissions functions (first round)
612 *
613 * 149 8/03/98 5:56p Jason
614 * got fusion cannon working correctly
615 *
616 * 148 8/03/98 4:29p Jason
617 * fixed afterburner bug
618 *
619 * 147 7/31/98 3:24p Samir
620 * allow breakup death outside only.
621 *
622 * 146 7/31/98 1:55p Jason
623 * added a function for custom textures
624 *
625 * 145 7/31/98 11:51a Jason
626 * added player ship choosing to multiplayer games
627 *
628 * 144 7/29/98 12:47p Jason
629 * multiplayer changes
630 *
631 * 143 7/28/98 5:39p Samir
632 * tweaked death sequence.
633 *
634 * 142 7/28/98 12:29p Jason
635 * added rotational velocity to multiplayer position packets
636 *
637 * 141 7/27/98 5:59p Jason
638 * added piggyback mode plus multiplayer colors
639 *
640 * 140 7/22/98 4:36p Jason
641 * took out bugs from observer mode
642 *
643 * 139 7/22/98 3:16p Jason
644 * added observer mode
645 *
646 * 138 7/20/98 10:42a Jason
647 * added more player scalars, plus afterburner changes
648 *
649 * 137 7/19/98 6:48p Jeff
650 * got rid of annoying mprintf on death
651 *
652 * 136 7/17/98 5:57p Jason
653 * misc multiplayer changes
654 *
655 * 135 7/15/98 2:33p Jason
656 * added scalar variables for various player skills
657 *
658 * 134 7/03/98 3:09p Jeff
659 * added counter measures inventory
660 *
661 * 133 7/02/98 6:37p Jason
662 * fixed bug with last rev
663 *
664 * 132 7/02/98 6:30p Jason
665 * added some multiplayer stuff for Jeff
666 *
667 * 131 7/02/98 12:57p Jason
668 * various changes for multiplayer positional sequencing
669 *
670 * 130 6/29/98 3:08p Jason
671 * added on/off weapons
672 *
673 * 129 6/25/98 5:17p Jason
674 * added multiple colored balls for players
675 *
676 * 128 6/22/98 6:02p Samir
677 * don't show cockpit when dying.
678 *
679 * 127 6/17/98 6:31p Samir
680 * Added anti-grav warning when dying.
681 *
682 * 126 6/16/98 10:54a Jeff
683 *
684 * 125 6/15/98 6:08p Chris
685 * Hit_type to hit_type[0]
686 *
687 * 124 6/11/98 12:48p Jason
688 * added better spewing weapons
689 *
690 * 123 6/05/98 4:54p Samir
691 * fixed bugs in MoveDeathCam.
692 *
693 * 122 6/03/98 6:42p Chris
694 * Added multipoint collision detection an Assert on invalid (infinite
695 * endpoint).
696 *
697 * 121 6/02/98 5:49p Jeff
698 * changed assert in PlayerSpewObject so it handles a ghost along with
699 * player type
700 *
701 * 120 6/01/98 10:37a Matt
702 * Added system to spew powerups when the player dies. Still needs Jason
703 * to deal with mng_FindSpecificGenericPage().
704 *
705 * 119 5/27/98 12:36a Samir
706 * invulnerablize player at start of E3 demo level, and use default
707 * weapons.
708 *
709 * 118 5/26/98 10:48p Samir
710 * for E3, new level = special weapons.
711 *
712 * 117 5/25/98 6:50p Matt
713 * Added needed include.
714 *
715 * 116 5/22/98 6:27p Samir
716 * reimplemented spinning D2 death, a bit modified.
717 *
718 * 115 5/22/98 11:59a Chris
719 * Fixed improper uses of FindSoundName and made the proper static sounds
720 *
721 * 114 5/15/98 5:41p Jason
722 * implemented volume lighting system
723 *
724 * 113 5/12/98 3:45p Chris
725 * Added a "dead" buddy when the player dies with the buddy in his
726 * inventory
727 *
728 * 112 5/11/98 4:40p Chris
729 * AI info is now a malloc'ed pointer
730 *
731 * 111 5/04/98 4:04p Chris
732 * Minestone checkin' -- energy effect and more AI functionality
733 *
734 * 110 5/04/98 12:22p Chris
735 * Improved Guidebot spewing
736 *
737 * 109 5/04/98 10:56a Kevin
738 * Mastertracker fixes/enhancements
739 *
740 * 108 5/01/98 6:50p Samir
741 * changed death sequence to fall on melee kill (single player) and death
742 * camera improvements.
743 *
744 * 107 5/01/98 4:32p Jason
745 * take care afterburner sound when a player dies
746 *
747 * 106 4/30/98 2:48p Kevin
748 * mastertracker
749 *
750 * 105 4/30/98 2:34p Kevin
751 * Movet mastertracker stuff to playerinit
752 *
753 * 104 4/30/98 1:15p Kevin
754 * Added lifetime deaths and kills for MT
755 *
756 * 103 4/30/98 11:32a Chris
757 * ClearWB to WBClear
758 *
759 * 102 4/29/98 12:51p Kevin
760 * Added mastertracker values
761 *
762 * 101 4/27/98 1:14p Jason
763 * cleaned up afterburner stuff
764 *
765 * 100 4/22/98 4:20p Jason
766 * reset player effects when dead
767 *
768 * 99 4/22/98 3:25p Jason
769 * changes for multiplayer debugging
770 *
771 * 98 4/20/98 3:03p Craig
772 * FROM JASON: Fixed effect resetting bug
773 *
774 * 97 4/19/98 5:00p Jason
775 * added cool napalm effect, plus made object effects dynamically
776 * allocated
777 *
778 * 96 4/18/98 7:17a Samir
779 * Update level time each player frame.
780 *
781 * 95 4/17/98 1:59p Jason
782 * added cool object effects
783 *
784 * 94 4/15/98 2:33p Jason
785 * changed some smoke trail stuff
786 *
787 * 93 4/13/98 12:42p Jason
788 * changed afterburner effect
789 *
790 * 92 4/10/98 8:59p Jason
791 * toned down red damage effect
792 *
793 * 91 4/10/98 3:28p Jason
794 * fixed afterburner bug
795 *
796 * 90 4/10/98 2:42p Jason
797 * fixed afterburner blobs to be a stream
798 *
799 * 89 4/09/98 7:15p Craig
800 * Remove inventory add
801 *
802 * 88 4/09/98 5:18p Jason
803 * got guided working in multiplayer
804 *
805 * 87 4/09/98 2:23p Jason
806 * added guided/afterburner stuff
807 *
808 * 86 4/07/98 7:17p Chris
809 * Removed guidebots from multiplayer
810 *
811 * 85 4/07/98 4:50p Jason
812 * made red damage glow fade much quicker
813 *
814 * 84 4/07/98 4:25p Chris
815 * Added support for buddy bot
816 *
817 * 83 4/06/98 2:54p Jason
818 * yet more multiplayer changes
819 *
820 * 82 4/06/98 12:14p Jason
821 * changes to multiplayer
822 *
823 * 81 4/03/98 12:28p Jason
824 * fixed confusion with clients changing rooms in multiplayer
825 *
826 * 80 4/03/98 11:55a Jason
827 * fixed polymodel paging problem
828 *
829 * 79 4/02/98 6:32p Jason
830 * get multiple items in inventory spewing
831 *
832 * 78 4/01/98 6:23p Jason
833 * added a slew of stuff for multiplayer
834 *
835 * 77 4/01/98 2:13p Jason
836 * added PlayerChangeShip
837 *
838 * 76 4/01/98 12:02p Jason
839 * incremental checkin for rendering changes
840 *
841 * 75 3/31/98 11:15a Jason
842 * added the ability for player objects to cast light
843 *
844 * 74 3/30/98 5:11p Jason
845 * more changes for game/dll integration
846 *
847 * 73 3/27/98 6:53p Samir
848 * lessen death glitter.
849 *
850 * 72 3/23/98 7:37p Jason
851 * fixed multiplayer shield problem
852 *
853 * 71 3/20/98 6:05p Chris
854 * Fixed a bug with player sounds
855 *
856 * 70 3/20/98 5:51p Jason
857 * more changes for multiplayer
858 *
859 * 69 3/20/98 2:18p Jason
860 * changes for multiplayer
861 *
862 * 68 3/19/98 7:15p Jason
863 * more changes for multiplayer
864 *
865 * 67 3/18/98 5:45p Jason
866 * more multiplayer script integration
867 *
868 * 66 3/18/98 12:11p Jason
869 * fixed non-existant killer problems
870 *
871 * 65 3/18/98 11:08a Jason
872 * more changes for script and multiplayer
873 *
874 * 64 3/17/98 3:25p Jason
875 * added number of team functions
876 *
877 * 63 3/17/98 2:40p Samir
878 * reorg of hud/gauge system.
879 *
880 * 62 3/17/98 11:34a Jason
881 * added GetGoalRoom stuff
882 *
883 * 61 3/13/98 12:09p Samir
884 * made changes to reflect new cockpit.cpp and cockpit.h
885 *
886 * 60 3/12/98 7:30p Chris
887 * Added ObjSetOrient
888 *
889 * 59 2/25/98 2:05p Jason
890 * did FOV and object visibility changes
891 *
892 * 58 2/25/98 1:01p Jason
893 * fixed FOV effect showing up for everyone in a multiplayer game
894 *
895 * 57 2/24/98 2:31p Jason
896 * added FOV warp effect for when coming back to life
897 *
898 * 56 2/23/98 4:52p Chris
899 * Removed size hack
900 *
901 * 55 2/19/98 6:38p Chris
902 * Added the ship size hack back in.
903 *
904 * 54 2/19/98 6:31p Jason
905 * fixed bug where a player killer object wasn't valid
906 *
907 * 53 2/18/98 11:03p Chris
908 * Removed the false ship size of 4.0 that we used for the milestone
909 *
910 * 52 2/18/98 2:13a Chris
911 * hacked size to 4
912 *
913 * 51 2/17/98 11:33p Matt
914 * Stop player weapon firing activity when player dies
915 *
916 * 50 2/17/98 3:46p Matt
917 * Revamped weapon system and got sounds for spray and fusion weapons
918 * working. Still need to implements getting continuous & cutoff sounds
919 * from player ship.
920 *
921 * 49 2/15/98 4:50p Jeff
922 * added a call to reset the player's inventory
923 *
924 * 48 2/09/98 5:38p Jeff
925 * changed EVT_PLAYEREXPLODED to EVT_GAMEPLAYEREXPLODED
926 *
927 * 47 2/06/98 6:07p Jason
928 * made multiplayer objects get deleted in single-player mode
929 *
930 * 46 2/05/98 2:57p Matt
931 * Changed code to use ObjSetPos()
932 *
933 * 45 2/05/98 10:44a Jason
934 * changed Red_blast_ring_index define
935 *
936 * 44 2/04/98 6:09p Matt
937 * Changed object room number to indicate a terrain cell via a flag. Got
938 * rid of the object flag which used to indicate terrain.
939 *
940 * 43 2/03/98 4:04p Jeff
941 * added OSIRIS events for player killed and exploded
942 *
943 * 42 1/28/98 1:12p Jason
944 * took shields field out of Player struct
945 *
946 * 41 1/28/98 12:00p Jason
947 * more changes for multiplayer
948 *
949 * 40 1/23/98 6:25p Jason
950 * Got spray weapons working
951 *
952 * 39 1/23/98 11:21a Jason
953 * incremental multiplayer checkin
954 *
955 * 38 1/21/98 6:09p Jason
956 * Got player deaths working in multiplayer
957 *
958 * 37 1/21/98 1:31p Samir
959 * No use thrust because of multiplayer.
960 *
961 * 36 1/21/98 1:11p Jason
962 * incremental checkin for multiplayer
963 *
964 * 35 1/20/98 6:35p Samir
965 * Death sequence more multiplayer friendly?
966 *
967 * 34 1/20/98 6:01p Jason
968 * first pass at getting multiplayer deaths working
969 *
970 * 33 1/20/98 12:10p Jason
971 * implemented vis effect system
972 *
973 * 32 1/19/98 5:49p Samir
974 * Some more death stuff.
975 *
976 * 31 1/08/98 12:31p Samir
977 * Called InitPlayerNewShip when died.
978 *
979 * 30 1/07/98 6:39p Jason
980 * Fixed player object number stuff
981 *
982 * 29 12/17/97 4:02p Samir
983 * Fixed bug.
984 *
985 * 28 12/16/97 4:44p Samir
986 * Some newer player death stuff.
987 *
988 * 27 12/10/97 3:28p Samir
989 * Some randomness.
990 *
991 * 26 12/01/97 2:45p Samir
992 * Press space bar to quit death sequence.
993 *
994 * 25 11/17/97 4:58p Samir
995 * Fixed player death cam problems.
996 *
997 * 24 11/14/97 2:59p Mark
998 * FROM JASON:changed the way paging weapons and player weapons work
999 *
1000 * 23 11/11/97 12:31p Samir
1001 * Hopefully fixed bug when death cam is moving from terrain to mine and
1002 * vice-versa.
1003 *
1004 * 22 10/28/97 6:38p Samir
1005 * Took out include to gauges.h
1006 *
1007 * 21 10/27/97 4:31p Samir
1008 * Commented out annoying mprintfs.
1009 *
1010 * 20 10/27/97 10:57a Samir
1011 * A little better close corner death scenes.
1012 *
1013 * 19 10/23/97 6:46p Samir
1014 * Mostly functional player explosions with special FX like fireballs and
1015 * splinters, breakups, etc.
1016 *
1017 * 18 10/22/97 7:26p Samir
1018 * Player death mostly working. Damn hangup still occurs. Freaky.
1019 *
1020 * 17 10/21/97 3:16p Samir
1021 * Death with explosions (not customized yet.)
1022 *
1023 * 16 10/20/97 3:00p Samir
1024 * Tweaked some random behavior in death and 'fixed' the camera on room
1025 * side problem.
1026 *
1027 * 15 10/16/97 4:10p Chris
1028 * Added some bounciness to the player object
1029 *
1030 * 14 10/15/97 3:05p Samir
1031 * Death cam 99% working.
1032 *
1033 * 13 10/10/97 3:57p Samir
1034 * Death sequence mostly perfect. Needs explosions still.
1035 *
1036 * 12 10/08/97 6:36p Samir
1037 * Except for player explosions, player death cycle implemented. May
1038 * change due to asthetics.
1039 *
1040 * 11 10/03/97 11:59a Samir
1041 * Take care of setting player weapon usage stats.
1042 *
1043 * 10 10/01/97 4:51p Samir
1044 * Moved ApplyDamagePlayer to damage.cpp
1045 *
1046 * 9 9/30/97 5:34p Samir
1047 * Moved level script code out of this file.
1048 *
1049 * 8 9/17/97 5:40p Samir
1050 * Fixed some vulnerability problems.
1051 *
1052 * 7 9/17/97 11:35a Samir
1053 * BIG SEGMENT RIPOUT
1054 *
1055 * 6 9/12/97 4:16p Samir
1056 * Added cloaking and invulnerability.
1057 *
1058 * 5 9/05/97 4:37p Samir
1059 * Some nonsense.
1060 *
1061 * 4 9/05/97 3:53p Samir
1062 * Fixed some more initial player stats.
1063 *
1064 * 3 9/05/97 2:33p Samir
1065 * Simple player death should work.
1066 *
1067 * 2 9/05/97 12:26p Samir
1068 * Player takes damage, and dies.
1069 *
1070 * 5 5/06/97 3:45p Matt
1071 * Save all player flags in player struct, not just over_terrain
1072 *
1073 * 4 5/06/97 12:53p Matt
1074 * Save over terrain flag with start position in player struct
1075 *
1076 * 3 4/23/97 6:06p Jason
1077 * made player ship and weapons work correctly together (first pass)
1078 *
1079 * 2 4/01/97 10:49p Matt
1080 * Added code
1081 *
1082 * 1 4/01/97 10:27p Matt
1083 *
1084 * $NoKeywords: $
1085 */
1086
1087 #include <cmath>
1088
1089 #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/
1090 #include "player.h"cxx . . $ `<file>/Descent3/player.h`/
1091 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
1092 #include "hud.h"cxx . . $ `<file>/Descent3/hud.h`/
1093 #include "gauges.h"cxx . . $ `<file>/Descent3/gauges.h`/
1094 #include "Mission.h"cxx . . $ `<file>/Descent3/Mission.h`/
1095 #include "vecmat.h"cxx . . $ `<file>/lib/vecmat.h`/
1096 #include "fireball.h"cxx . . $ `<file>/Descent3/fireball.h`/
1097 #include "polymodel.h"cxx . . $ `<file>/model/polymodel.h`/
1098 #include "findintersection.h"cxx . . $ `<file>/physics/findintersection.h`/
1099 #include "hud.h"cxx . . $ `<file>/Descent3/hud.h`/
1100 #include "splinter.h"cxx . . $ `<file>/Descent3/splinter.h`/
1101 #include "physics.h"cxx . . $ `<file>/physics/physics.h`/
1102 #include "viseffect.h"cxx . . $ `<file>/Descent3/viseffect.h`/
1103 #include "damage.h"cxx . . $ `<file>/Descent3/damage.h`/
1104 #include "multi.h"cxx . . $ `<file>/Descent3/multi.h`/
1105 #include "ship.h"cxx . . $ `<file>/Descent3/ship.h`/
1106 #include "gameevent.h"cxx . . $ `<file>/Descent3/gameevent.h`/
1107 #include "gameloop.h"cxx . . $ `<file>/Descent3/gameloop.h`/
1108 #include "descent.h"cxx . . $ `<file>/Descent3/descent.h`/
1109 #include "cockpit.h"cxx . . $ `<file>/Descent3/cockpit.h`/
1110 #include "game2dll.h"cxx . . $ `<file>/lib/game2dll.h`/
1111 #include "robotfire.h"cxx . . $ `<file>/Descent3/robotfire.h`/
1112 #include "robot.h"cxx . . $ `<file>/Descent3/robot.h`/
1113 #include "AIMain.h"cxx . . $ `<file>/Descent3/AIMain.h`/
1114 #include "aipath.h"cxx . . $ `<file>/Descent3/aipath.h`/
1115 #include "AIGoal.h"cxx . . $ `<file>/Descent3/AIGoal.h`/
1116 #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/
1117 #include "soundload.h"cxx . . $ `<file>/sndlib/soundload.h`/
1118 #include "sounds.h"cxx . . $ `<file>/Descent3/sounds.h`/
1119 #include "weapon.h"cxx . . $ `<file>/Descent3/weapon.h`/
1120 #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/
1121 #include "pilot.h"cxx . . $ `<file>/Descent3/pilot.h`/
1122 #include "vclip.h"cxx . . $ `<file>/Descent3/vclip.h`/
1123 #include <stdlib.h>
1124 #include "objinit.h"cxx . . $ `<file>/Descent3/objinit.h`/
1125 #include "difficulty.h"cxx . . $ `<file>/Descent3/difficulty.h`/
1126 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
1127 #include "ObjScript.h"cxx . . $ `<file>/Descent3/ObjScript.h`/
1128 #include "gamecinematics.h"cxx . . $ `<file>/Descent3/gamecinematics.h`/
1129 #include "demofile.h"cxx . . $ `<file>/lib/demofile.h`/
1130 #include "psrand.h"cxx . . $ `<file>/misc/psrand.h`/
1131 #include "osiris_share.h"cxx . . $ `<file>/Descent3/osiris_share.h`/
1132 #include "config.h"cxx . . $ `<file>/Descent3/config.h`/
1133 #include "osiris_dll.h"cxx . . $ `<file>/Descent3/osiris_dll.h`/
1134 #include "gamesequence.h"cxx . . $ `<file>/Descent3/gamesequence.h`/
1135
1136 #include <algorithm>
1137
1138 playercxx . . $ player# Playerscxx . . $ Players.[MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!];
1139 int Player_numcxx . . $ Player_num.;
1140
1141 int Num_teamscxx . . $ Num_teams. = 0;
1142 int Team_gamecxx . . $ Team_game. = 0;
1143 int Default_ship_permissioncxx . . $ Default_ship_permission. = 0x01;
1144 float HudNameTancxx . . $ HudNameTan. = -1;
1145
1146 teamcxx . . $ team# Teamscxx . . $ Teams.[MAX_TEAMScxx . . $ `Descent3/player_external_struct.h:87:9`!];
1147
1148 static int Highest_player_startcxx . . $ Highest_player_start. = 0;
1149
1150 // Only one of these waypoint variable can be active at one time; the other will be -1
1151 int Current_waypointcxx . . $ Current_waypoint. = 0; // the most recent manually-set waypoint, or -1
1152
1153 // Stuff for the new score info on the HUD
1154 int Score_addedcxx . . $ Score_added. = 0; // the recently-added amount
1155 float Score_added_timercxx . . $ Score_added_timer. = 0.0; // how long the added value will be displayed
1156
1157 // Camera stuff
1158 #define MAX_CAMERA_SAMPLEScxx . . $ `Descent3/Player.cpp:1158:9`! 100
1159 #define MAX_CAMERA_SUB_SAMPLEScxx . . $ `Descent3/Player.cpp:1159:9`! 50
1160 #define CAMERA_LAG_TIMEcxx . . $ `Descent3/Player.cpp:1160:9`! .10f // How far behind the camera is in time
1161 #define CAMERA_SAMPLE_INCREMENTcxx . . $ `Descent3/Player.cpp:1161:9`! (CAMERA_LAG_TIMEcxx . . $ `Descent3/Player.cpp:1160:9`! / (float)MAX_CAMERA_SUB_SAMPLEScxx . . $ `Descent3/Player.cpp:1159:9`!)
1162 bool Player_has_cameracxx . . $ Player_has_camera. = false;
1163 int Player_camera_objnumcxx . . $ Player_camera_objnum. = -1;
1164 float Player_shields_saved_from_last_levelcxx . . $ Player_shields_saved_from_last_level. = -1.0f;
1165 float Player_energy_saved_from_last_levelcxx . . $ Player_energy_saved_from_last_level. = -1.0f;
1166
1167 uint32_tcxx . . $ uint32_t# Players_typingcxx . . $ Players_typing.; // information about which players are typing messages (to display an icon)
1168
1169 static float Player_camera_last_sample_timecxx . . $ Player_camera_last_sample_time. = 0;
1170 static float Player_camera_last_follow_timecxx . . $ Player_camera_last_follow_time. = 0;
1171
1172 static int Camera_sample_indexcxx . . $ Camera_sample_index. = 0;
1173 static int Camera_follow_indexcxx . . $ Camera_follow_index. = 0;
1174 static vectorcxx . . $ vector# Camera_sample_vectorscxx . . $ Camera_sample_vectors.[MAX_CAMERA_SAMPLEScxx . . $ `Descent3/Player.cpp:1158:9`!];
1175 static matrixcxx . . $ matrix# Camera_sample_matrixcxx . . $ Camera_sample_matrix.[MAX_CAMERA_SAMPLEScxx . . $ `Descent3/Player.cpp:1158:9`!];
1176 static int Camera_sample_roomscxx . . $ Camera_sample_rooms.[MAX_CAMERA_SAMPLEScxx . . $ `Descent3/Player.cpp:1158:9`!];
1177
1178 float Total_time_deadcxx . . $ Total_time_dead. = 0;
1179
1180 static void StartPlayerDeathcxx . . $ StartPlayerDeath(b328c1935e30afea).(int slot, float damage, bool melee, int fate);
1181
1182 // Sets up the players array
1183 void InitPlayerscxx . . $ InitPlayers(49f6e7a06ebc5aa8).() {
1184 int i;
1185
1186 // find the ships that are allowed by default
1187 Default_ship_permissioncxx . . $ Default_ship_permission. = 0;
1188 for (i = 0; i < MAX_SHIPScxx . . $ `Descent3/ship.h:122:9`!; i++) {
1189 if (Shipscxx . . $ Ships.[i].usedcxx . . $ ship#used. & Shipscxx . . $ Ships.[i].flagscxx . . $ ship#flags. & SF_DEFAULT_ALLOWcxx . . $ `Descent3/ship.h:143:9`!) {
1190 int flag = 0x01;
1191 flag = flag << i;
1192 Default_ship_permissioncxx . . $ Default_ship_permission. |= flag;
1193 }
1194 }
1195
1196 for (i = 0; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++) {
1197 Playerscxx . . $ Players.[i].startpos_flagscxx . . $ player#startpos_flags. = 0;
1198
1199 int index = AllocTexturecxx . . $ AllocTexture(b126dc7c1de90089).();
1200
1201 ASSERTcxx . . $ `misc/pserror.h:246:9`!(index >= 0);
1202 GameTexturescxx . . $ GameTextures.[index].bm_handlecxx . . $ texture#bm_handle. = 0;
1203 snprintf(GameTexturescxx . . $ GameTextures.[index].namecxx . . $ texture#name., sizeof(GameTexturescxx . . $ GameTextures.[index].namecxx . . $ texture#name.), "Player %d texture", i);
1204 Playerscxx . . $ Players.[i].custom_texture_handlecxx . . $ player#custom_texture_handle. = index;
1205 }
1206 PlayerResetShipPermissionscxx . . $ PlayerResetShipPermissions(9609253e83e89946).(-1, true);
1207 Players_typingcxx . . $ Players_typing. = 0;
1208 }
1209
1210 // Look for player objects & set player starts
1211 void FindPlayerStartscxx . . $ FindPlayerStarts(49f6e7a06ebc5aa8).() {
1212 int i;
1213 int unique = 0;
1214
1215 // Flag all players as unused
1216 for (i = 0; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++)
1217 Playerscxx . . $ Players.[i].start_roomnumcxx . . $ player#start_roomnum. = -1;
1218
1219 Highest_player_startcxx . . $ Highest_player_start. = 0;
1220
1221 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
1222 ps_srandcxx . . $ ps_srand(cb2f890c2fdad230).(400);
1223 }
1224
1225 // Now look for player objects
1226 for (i = 0; i <= Highest_object_indexcxx . . $ Highest_object_index.; i++)
1227 if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) {
1228 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Players[Objects[i].id].start_roomnum == -1); // make sure not used twice
1229 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[i].idcxx . . $ object#id.].start_poscxx . . $ player#start_pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). Objectscxx . . $ Objects.[i].poscxx . . $ object#pos.;
1230 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[i].idcxx . . $ object#id.].start_roomnumcxx . . $ player#start_roomnum. = Objectscxx . . $ Objects.[i].roomnumcxx . . $ object#roomnum.;
1231 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[i].idcxx . . $ object#id.].start_orientcxx . . $ player#start_orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). Objectscxx . . $ Objects.[i].orientcxx . . $ object#orient.;
1232 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[i].idcxx . . $ object#id.].objnumcxx . . $ player#objnum. = i;
1233
1234 if (Objectscxx . . $ Objects.[i].idcxx . . $ object#id. > Highest_player_startcxx . . $ Highest_player_start.)
1235 Highest_player_startcxx . . $ Highest_player_start. = Objectscxx . . $ Objects.[i].idcxx . . $ object#id.;
1236
1237 unique++;
1238 }
1239
1240 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "There are %d unique start positions in this level\n", unique);
1241
1242 // Now create the extra players
1243 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
1244 // Build a list so we can fill in the rest
1245 int choose_list[MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!];
1246 int num_choose = 0;
1247 for (i = 0; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++) {
1248 if (Playerscxx . . $ Players.[i].start_roomnumcxx . . $ player#start_roomnum. != -1) {
1249 choose_list[num_choose++] = i;
1250 }
1251 }
1252 for (i = Highest_player_startcxx . . $ Highest_player_start. + 1; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++) {
1253 int oldplaynum = ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % num_choose;
1254 oldplaynum = choose_list[oldplaynum];
1255
1256 int objnum = ObjCreatecxx . . $ ObjCreate(849c3da80a4f387f).(OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!, i, Playerscxx . . $ Players.[oldplaynum].start_roomnumcxx . . $ player#start_roomnum., &Playerscxx . . $ Players.[oldplaynum].start_poscxx . . $ player#start_pos.,
1257 &Playerscxx . . $ Players.[oldplaynum].start_orientcxx . . $ player#start_orient.);
1258 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objnum >= 0);
1259 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].start_poscxx . . $ player#start_pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). Playerscxx . . $ Players.[oldplaynum].start_poscxx . . $ player#start_pos.;
1260 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].start_roomnumcxx . . $ player#start_roomnum. = Playerscxx . . $ Players.[oldplaynum].start_roomnumcxx . . $ player#start_roomnum.;
1261 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].start_orientcxx . . $ player#start_orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). Playerscxx . . $ Players.[oldplaynum].start_orientcxx . . $ player#start_orient.;
1262 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].startpos_flagscxx . . $ player#startpos_flags. = Playerscxx . . $ Players.[oldplaynum].startpos_flagscxx . . $ player#startpos_flags.;
1263 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].objnumcxx . . $ player#objnum. = objnum;
1264 if (Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id. > Highest_player_startcxx . . $ Highest_player_start.)
1265 Highest_player_startcxx . . $ Highest_player_start. = Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.;
1266 }
1267
1268 for (i = 0; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++) {
1269 // Make all extra slots use slot 0
1270 if (Playerscxx . . $ Players.[i].start_roomnumcxx . . $ player#start_roomnum. == -1) {
1271 int oldplaynum = ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % num_choose;
1272 oldplaynum = choose_list[oldplaynum];
1273
1274 int objnum = ObjCreatecxx . . $ ObjCreate(849c3da80a4f387f).(OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!, i, Playerscxx . . $ Players.[oldplaynum].start_roomnumcxx . . $ player#start_roomnum., &Playerscxx . . $ Players.[oldplaynum].start_poscxx . . $ player#start_pos.,
1275 &Playerscxx . . $ Players.[oldplaynum].start_orientcxx . . $ player#start_orient.);
1276 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objnum >= 0);
1277 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].start_poscxx . . $ player#start_pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). Playerscxx . . $ Players.[oldplaynum].start_poscxx . . $ player#start_pos.;
1278 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].start_roomnumcxx . . $ player#start_roomnum. = Playerscxx . . $ Players.[oldplaynum].start_roomnumcxx . . $ player#start_roomnum.;
1279 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].start_orientcxx . . $ player#start_orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). Playerscxx . . $ Players.[oldplaynum].start_orientcxx . . $ player#start_orient.;
1280 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].startpos_flagscxx . . $ player#startpos_flags. = Playerscxx . . $ Players.[oldplaynum].startpos_flagscxx . . $ player#startpos_flags.;
1281 Playerscxx . . $ Players.[Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.].objnumcxx . . $ player#objnum. = objnum;
1282 if (Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id. > Highest_player_startcxx . . $ Highest_player_start.)
1283 Highest_player_startcxx . . $ Highest_player_start. = Objectscxx . . $ Objects.[objnum].idcxx . . $ object#id.;
1284 }
1285 }
1286 }
1287 }
1288
1289 // Returns a random player starting position
1290 int PlayerGetRandomStartPositioncxx . . $ PlayerGetRandomStartPosition(7864480464b09eea).(int slot) {
1291 if (Netgamecxx . . $ Netgame..flagscxx . . $ netgame_info#flags. & NF_RESPAWN_WAYPOINTcxx . . $ `Descent3/multi_external.h:240:9`!) {
1292 // Grab an autowaypoint
1293 if (Playerscxx . . $ Players.[slot].current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. != -1) {
1294 int waypointnum = -(Playerscxx . . $ Players.[slot].current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. - 1);
1295 return waypointnum;
1296 } else {
1297 if (Current_waypointcxx . . $ Current_waypoint. < 0)
1298 return 0;
1299 else
1300 return Current_waypointcxx . . $ Current_waypoint.;
1301 }
1302 }
1303
1304 ps_srandcxx . . $ ps_srand(cb2f890c2fdad230).((timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!() * 1000));
1305 // If this is a team game then pick a spot on that team
1306 if (Team_gamecxx . . $ Team_game.) {
1307
1308 int team = PlayerGetTeamcxx . . $ PlayerGetTeam(7864480464b09eea).(slot);
1309 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Picking team start position, team=%d.\n", team);
1310 int num_avail = 0;
1311 int avail_array[MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!];
1312
1313 for (int i = 0; i <= Highest_player_startcxx . . $ Highest_player_start.; i++) {
1314 if ((Playerscxx . . $ Players.[i].startpos_flagscxx . . $ player#startpos_flags. & (1 << team)) && Playerscxx . . $ Players.[i].start_roomnumcxx . . $ player#start_roomnum. != -1) {
1315 avail_array[num_avail] = i;
1316 num_avail++;
1317 }
1318 }
1319 if (num_avail > 0) {
1320 int num;
1321 int done = 0;
1322 while (!done) {
1323 num = avail_array[ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % (num_avail)];
1324 if (Playerscxx . . $ Players.[num].start_roomnumcxx . . $ player#start_roomnum. != -1)
1325 done = 1;
1326 }
1327 return num;
1328 }
1329 }
1330
1331 // Default to non-team mode
1332 int num;
1333 int done = 0;
1334 int badcount = 0;
1335 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Picking non-team start position.\n");
1336 while (!done) {
1337 num = ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % (Highest_player_startcxx . . $ Highest_player_start. + 1);
1338 if (Playerscxx . . $ Players.[num].start_roomnumcxx . . $ player#start_roomnum. != -1) {
1339 // Check to see if there are any other players in this room
1340 int objnum = -1;
1341 if (Playerscxx . . $ Players.[num].start_roomnumcxx . . $ player#start_roomnum. >= 0) {
1342 roomcxx . . $ room# *rp = &Roomscxx . . $ Rooms.[Playerscxx . . $ Players.[num].start_roomnumcxx . . $ player#start_roomnum.];
1343 objnum = rp->objectscxx . . $ room#objects.;
1344 } else {
1345 objnum = Terrain_segcxx . . $ Terrain_seg.[Playerscxx . . $ Players.[num].start_roomnumcxx . . $ player#start_roomnum.].objectscxx . . $ terrain_segment#objects.;
1346 }
1347 int bad = 0;
1348 for (; objnum != -1 && !bad; objnum = Objectscxx . . $ Objects.[objnum].nextcxx . . $ object#next.) {
1349 if (Objectscxx . . $ Objects.[objnum].typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!)
1350 bad = 1;
1351 }
1352
1353 if (bad) {
1354 badcount++;
1355 if (badcount >= 15) // give up after fifteen tries
1356 {
1357 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Stopping cuz I couldn't find a valid player position!\n");
1358 done = 1;
1359 }
1360 } else
1361 done = 1;
1362 }
1363 }
1364
1365 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Picked index for start position %d\n", num);
1366
1367 return num;
1368 }
1369
1370 // Called from a single player game to get rid of all multiplayer ships
1371 void DeleteMultiplayerObjectscxx . . $ DeleteMultiplayerObjects(49f6e7a06ebc5aa8).() {
1372 for (int i = 0; i <= Highest_object_indexcxx . . $ Highest_object_index.; i++) {
1373 if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`! && Objectscxx . . $ Objects.[i].idcxx . . $ object#id. != Player_numcxx . . $ Player_num.)
1374 ObjDeletecxx . . $ ObjDelete(d4f767463ce0a6b3).(i);
1375 }
1376 }
1377
1378 // Stops all sounds for a player
1379 void PlayerStopSoundscxx . . $ PlayerStopSounds(d4f767463ce0a6b3).(int slot) {
1380 if (Playerscxx . . $ Players.[slot].afterburner_sound_handlecxx . . $ player#afterburner_sound_handle. != -1) {
1381 Sound_systemcxx . . $ Sound_system..StopSoundImmediatecxx . . $ hlsSystem#StopSoundImmediate(d4f767463ce0a6b3).(Playerscxx . . $ Players.[slot].afterburner_sound_handlecxx . . $ player#afterburner_sound_handle.);
1382 Playerscxx . . $ Players.[slot].afterburner_sound_handlecxx . . $ player#afterburner_sound_handle. = -1;
1383 }
1384
1385 if (Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. != -1) {
1386 Sound_systemcxx . . $ Sound_system..StopSoundImmediatecxx . . $ hlsSystem#StopSoundImmediate(d4f767463ce0a6b3).(Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle.);
1387 Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. = -1;
1388 }
1389 }
1390
1391 // Called when a player is entering the game for the first time
1392 void InitPlayerNewGamecxx . . $ InitPlayerNewGame(d4f767463ce0a6b3).(int slot) {
1393 Playerscxx . . $ Players.[slot].num_kills_totalcxx . . $ player#num_kills_total. = 0;
1394 Playerscxx . . $ Players.[slot].num_deaths_totalcxx . . $ player#num_deaths_total. = 0;
1395 Playerscxx . . $ Players.[slot].scorecxx . . $ player#score. = 0;
1396
1397 uint32_tcxx . . $ uint32_t# bit = (0x01 << slot);
1398 Players_typingcxx . . $ Players_typing. &= ~bit;
1399 }
1400
1401 // Called when a player is entering a new level
1402 void InitPlayerNewLevelcxx . . $ InitPlayerNewLevel(d4f767463ce0a6b3).(int slot) {
1403 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
1404
1405 if (Player_numcxx . . $ Player_num. == slot && (!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!))) {
1406 // see if we should restore our shields (which were saved in the last call
1407 // to ResetPlayerObject. Only restore if shields are >INITIAL_SHIELDS
1408 if (Player_shields_saved_from_last_levelcxx . . $ Player_shields_saved_from_last_level. > INITIAL_SHIELDScxx . . $ `Descent3/player_external.h:69:9`!)
1409 Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.].shieldscxx . . $ object#shields. = Player_shields_saved_from_last_levelcxx . . $ Player_shields_saved_from_last_level.;
1410 if (Player_energy_saved_from_last_levelcxx . . $ Player_energy_saved_from_last_level. > INITIAL_ENERGYcxx . . $ `Descent3/player_external.h:68:9`!)
1411 Playerscxx . . $ Players.[slot].energycxx . . $ player#energy. = Player_energy_saved_from_last_levelcxx . . $ Player_energy_saved_from_last_level.;
1412
1413 // set this to -1 to prevent any unneeded madness
1414 Player_shields_saved_from_last_levelcxx . . $ Player_shields_saved_from_last_level. = -1.0f;
1415 Player_energy_saved_from_last_levelcxx . . $ Player_energy_saved_from_last_level. = -1.0f;
1416 }
1417
1418 Playerscxx . . $ Players.[slot].num_kills_levelcxx . . $ player#num_kills_level. = 0;
1419 Playerscxx . . $ Players.[slot].friendly_kills_levelcxx . . $ player#friendly_kills_level. = 0;
1420 Playerscxx . . $ Players.[slot].num_hits_levelcxx . . $ player#num_hits_level. = 0;
1421 Playerscxx . . $ Players.[slot].num_discharges_levelcxx . . $ player#num_discharges_level. = 0;
1422 Playerscxx . . $ Players.[slot].num_markerscxx . . $ player#num_markers. = 0;
1423 Playerscxx . . $ Players.[slot].inventorycxx . . $ player#inventory..Resetcxx . . $ Inventory#Reset(b994e01f1c45a386).(true, (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) ? INVRESET_ALLcxx . . $ `Descent3/Inventory.h:201:9`! : INVRESET_LEVELCHANGEcxx . . $ `Descent3/Inventory.h:202:9`!);
1424 Playerscxx . . $ Players.[slot].counter_measurescxx . . $ player#counter_measures..Resetcxx . . $ Inventory#Reset(b994e01f1c45a386).(true, (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) ? INVRESET_ALLcxx . . $ `Descent3/Inventory.h:201:9`! : INVRESET_LEVELCHANGEcxx . . $ `Descent3/Inventory.h:202:9`!);
1425 Playerscxx . . $ Players.[slot].keyscxx . . $ player#keys. = 0;
1426 Playerscxx . . $ Players.[slot].num_deaths_levelcxx . . $ player#num_deaths_level. = 0;
1427
1428 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
1429 NetPlayerscxx . . $ NetPlayers.[slot].packet_timecxx . . $ netplayer#packet_time. = 0;
1430
1431 if (slot == Player_numcxx . . $ Player_num.)
1432 Player_camera_objnumcxx . . $ Player_camera_objnum. = -1;
1433
1434 // Turn off rear view
1435 Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. &= ~PLAYER_FLAGS_REARVIEWcxx . . $ `Descent3/player_external.h:97:9`!;
1436
1437 // Kill autowaypoint
1438 Playerscxx . . $ Players.[slot].current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. = -1;
1439
1440 // Restore Quad Lasers if they are still in inventory
1441 static int quad_laser_id = -2;
1442 if (quad_laser_id == -2)
1443 quad_laser_id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("QuadLaser");
1444 if (quad_laser_id != -1) {
1445 if (Playerscxx . . $ Players.[slot].inventorycxx . . $ player#inventory..CheckItemcxx . . $ Inventory#CheckItem(cf9ef193275fa6d8).(OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, quad_laser_id)) {
1446 objectcxx . . $ object# *pobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
1447 pobj->dynamic_wbcxx . . $ object#dynamic_wb.[LASER_INDEXcxx . . $ `Descent3/weapon_external.h:22:9`!].flagscxx . . $ dynamic_wb_info#flags. |= DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!;
1448 pobj->dynamic_wbcxx . . $ object#dynamic_wb.[SUPER_LASER_INDEXcxx . . $ `Descent3/weapon_external.h:27:9`!].flagscxx . . $ dynamic_wb_info#flags. |= DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!;
1449 }
1450 }
1451
1452 uint32_tcxx . . $ uint32_t# bit = (0x01 << slot);
1453 Players_typingcxx . . $ Players_typing. &= ~bit;
1454
1455 // Give the player a GuideBot if he doesn't have one and if the GB isn't out there
1456 if ((!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) && (Demo_flagscxx . . $ Demo_flags. != DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!)) {
1457 if ((!Playerscxx . . $ Players.[slot].inventorycxx . . $ player#inventory..CheckItemcxx . . $ Inventory#CheckItem(cf9ef193275fa6d8).(OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!, ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`!)) &&
1458 (ObjGetcxx . . $ ObjGet(11672e354c0b263a).(Buddy_handlecxx . . $ Buddy_handle.[slot])->typecxx . . $ object#type. != OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!))
1459 Playerscxx . . $ Players.[slot].inventorycxx . . $ player#inventory..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!, ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`!);
1460 }
1461
1462 // Limit the player's ammo to what the current ship can hold
1463 playercxx . . $ player# *player = &Playerscxx . . $ Players.[slot];
1464 shipcxx . . $ ship# *ship = &Shipscxx . . $ Ships.[player->ship_indexcxx . . $ player#ship_index.];
1465 for (int i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
1466 if ((i >= SECONDARY_INDEXcxx . . $ `Descent3/weapon.h:255:9`!) || ship->static_wbcxx . . $ ship#static_wb.[i].ammo_usagecxx . . $ otype_wb_info#ammo_usage.)
1467 player->weapon_ammocxx . . $ player#weapon_ammo.[i] = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).<float>(ship->max_ammocxx . . $ ship#max_ammo.[i], player->weapon_ammocxx . . $ player#weapon_ammo.[i]);
1468 }
1469
1470 #ifdef E3_DEMO
1471 extern float E3_TIME_LIMIT;
1472
1473 MakePlayerInvulnerable(slot, E3_TIME_LIMIT * 2);
1474 //@@ Players[slot].energy=200.0f;
1475 //@@ Players[slot].weapon_flags=HAS_FLAG(LASER_INDEX)+HAS_FLAG(PLASMA_INDEX)+HAS_FLAG(VAUSS_INDEX)
1476 //@@ +HAS_FLAG(MICROWAVE_INDEX);
1477 //@@ Players[slot].weapon_flags+= HAS_FLAG(GUIDED_INDEX)+HAS_FLAG(NAPALMROCKET_INDEX)+HAS_FLAG(CYCLONE_INDEX);
1478 //@@
1479 //@@ for (int i=0;i<MAX_PLAYER_WEAPONS;i++)
1480 //@@ Players[slot].weapon_ammo[i] = 1000;
1481
1482 #endif
1483 }
1484
1485 // Resets all the properties a player ship to the default values
1486 // Pass into inven_reset what you want passed to Inventory.Reset()
1487 void InitPlayerNewShipcxx . . $ InitPlayerNewShip(3e454b8ccf442868).(int slot, int inven_reset) {
1488 int i;
1489
1490 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
1491
1492 Playerscxx . . $ Players.[slot].energycxx . . $ player#energy. = INITIAL_ENERGYcxx . . $ `Descent3/player_external.h:68:9`!;
1493 Playerscxx . . $ Players.[slot].num_ballscxx . . $ player#num_balls. = 0;
1494 Playerscxx . . $ Players.[slot].laser_levelcxx . . $ player#laser_level. = 0;
1495 Playerscxx . . $ Players.[slot].killer_objnumcxx . . $ player#killer_objnum. = -1;
1496 Playerscxx . . $ Players.[slot].light_distcxx . . $ player#light_dist. = 0;
1497 Playerscxx . . $ Players.[slot].oldroomcxx . . $ player#oldroom. = -1;
1498 Playerscxx . . $ Players.[slot].guided_objcxx . . $ player#guided_obj. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1499 Playerscxx . . $ Players.[slot].user_timeout_objcxx . . $ player#user_timeout_obj. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1500 Playerscxx . . $ Players.[slot].afterburn_time_leftcxx . . $ player#afterburn_time_left. = AFTERBURN_TIMEcxx . . $ `Descent3/player.h:394:9`!;
1501 Playerscxx . . $ Players.[slot].last_thrust_timecxx . . $ player#last_thrust_time. = 0;
1502 Playerscxx . . $ Players.[slot].last_afterburner_timecxx . . $ player#last_afterburner_time. = 0;
1503
1504 // start out with basic weapons
1505 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++)
1506 Playerscxx . . $ Players.[slot].weapon_ammocxx . . $ player#weapon_ammo.[i] = 0;
1507
1508 Playerscxx . . $ Players.[slot].weapon_flagscxx . . $ player#weapon_flags. = HAS_FLAGcxx . . $ `Descent3/weapon.h:215:9`!(LASER_INDEXcxx . . $ `Descent3/weapon_external.h:22:9`!);
1509 Playerscxx . . $ Players.[slot].weapon_flagscxx . . $ player#weapon_flags. += HAS_FLAGcxx . . $ `Descent3/weapon.h:215:9`!(CONCUSSION_INDEXcxx . . $ `Descent3/weapon_external.h:32:9`!);
1510 Playerscxx . . $ Players.[slot].weapon_flagscxx . . $ player#weapon_flags. += HAS_FLAGcxx . . $ `Descent3/weapon.h:215:9`!(FLARE_INDEXcxx . . $ `Descent3/weapon_external.h:43:9`!);
1511 Playerscxx . . $ Players.[slot].weapon_ammocxx . . $ player#weapon_ammo.[CONCUSSION_INDEXcxx . . $ `Descent3/weapon_external.h:32:9`!] = 2 + MAX_DIFFICULTY_LEVELScxx . . $ `Descent3/difficulty_external.h:22:9`! - Difficulty_levelcxx . . $ Difficulty_level.;
1512
1513 Playerscxx . . $ Players.[slot].weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!].indexcxx . . $ player_weapon#index. = LASER_INDEXcxx . . $ `Descent3/weapon_external.h:22:9`!;
1514 Playerscxx . . $ Players.[slot].weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!].firing_timecxx . . $ player_weapon#firing_time. = 0;
1515 Playerscxx . . $ Players.[slot].weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!].sound_handlecxx . . $ player_weapon#sound_handle. = -1;
1516
1517 Playerscxx . . $ Players.[slot].weaponcxx . . $ player#weapon.[PW_SECONDARYcxx . . $ `Descent3/player_external.h:109:9`!].indexcxx . . $ player_weapon#index. = CONCUSSION_INDEXcxx . . $ `Descent3/weapon_external.h:32:9`!;
1518 Playerscxx . . $ Players.[slot].weaponcxx . . $ player#weapon.[PW_SECONDARYcxx . . $ `Descent3/player_external.h:109:9`!].firing_timecxx . . $ player_weapon#firing_time. = 0;
1519 Playerscxx . . $ Players.[slot].weaponcxx . . $ player#weapon.[PW_SECONDARYcxx . . $ `Descent3/player_external.h:109:9`!].sound_handlecxx . . $ player_weapon#sound_handle. = -1;
1520
1521 Playerscxx . . $ Players.[slot].small_left_objcxx . . $ player#small_left_obj. = -1;
1522 Playerscxx . . $ Players.[slot].small_right_objcxx . . $ player#small_right_obj. = -1;
1523 Playerscxx . . $ Players.[slot].small_dll_objcxx . . $ player#small_dll_obj. = -1;
1524
1525 // some other stuff
1526 Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. = 0;
1527
1528 Playerscxx . . $ Players.[slot].invulnerable_timecxx . . $ player#invulnerable_time. = 0;
1529
1530 Playerscxx . . $ Players.[slot].damage_magnitudecxx . . $ player#damage_magnitude. = 0;
1531 Playerscxx . . $ Players.[slot].edrain_magnitudecxx . . $ player#edrain_magnitude. = 0;
1532
1533 if (Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum. >= 0 && Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum. <= Highest_object_indexcxx . . $ Highest_object_index. &&
1534 Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.].typecxx . . $ object#type. != OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!)
1535 Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.].weapon_fire_flagscxx . . $ object#weapon_fire_flags. = 0;
1536
1537 // reset the inventory
1538 Playerscxx . . $ Players.[slot].inventorycxx . . $ player#inventory..Resetcxx . . $ Inventory#Reset(b994e01f1c45a386).(true, inven_reset);
1539 Playerscxx . . $ Players.[slot].counter_measurescxx . . $ player#counter_measures..Resetcxx . . $ Inventory#Reset(b994e01f1c45a386).(true, inven_reset);
1540
1541 Playerscxx . . $ Players.[slot].last_homing_warning_sound_timecxx . . $ player#last_homing_warning_sound_time. = 0.0f;
1542 Playerscxx . . $ Players.[slot].last_hit_wall_sound_timecxx . . $ player#last_hit_wall_sound_time. = 0.0f;
1543 Playerscxx . . $ Players.[slot].multiplayer_flagscxx . . $ player#multiplayer_flags. = 0;
1544 Playerscxx . . $ Players.[slot].last_multiplayer_flagscxx . . $ player#last_multiplayer_flags. = 0;
1545 Playerscxx . . $ Players.[slot].afterburner_magcxx . . $ player#afterburner_mag. = 0;
1546 Playerscxx . . $ Players.[slot].thrust_magcxx . . $ player#thrust_mag. = 0;
1547 Playerscxx . . $ Players.[slot].last_guided_timecxx . . $ player#last_guided_time. = 0;
1548 Playerscxx . . $ Players.[slot].afterburner_sound_handlecxx . . $ player#afterburner_sound_handle. = -1;
1549
1550 Playerscxx . . $ Players.[slot].thruster_sound_statecxx . . $ player#thruster_sound_state. = 0;
1551 Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. = -1;
1552
1553 Playerscxx . . $ Players.[slot].movement_scalarcxx . . $ player#movement_scalar. = 1;
1554 Playerscxx . . $ Players.[slot].armor_scalarcxx . . $ player#armor_scalar. = 1;
1555 Playerscxx . . $ Players.[slot].damage_scalarcxx . . $ player#damage_scalar. = 1;
1556 Playerscxx . . $ Players.[slot].turn_scalarcxx . . $ player#turn_scalar. = 1;
1557 Playerscxx . . $ Players.[slot].weapon_recharge_scalarcxx . . $ player#weapon_recharge_scalar. = 1;
1558 Playerscxx . . $ Players.[slot].weapon_speed_scalarcxx . . $ player#weapon_speed_scalar. = 1;
1559 // Enable all controller input
1560 Playerscxx . . $ Players.[slot].controller_bitflagscxx . . $ player#controller_bitflags. = 0xffffffff;
1561
1562 ResetWeaponSelectStatescxx . . $ ResetWeaponSelectStates(ed53e3bbd3fa2f69).(); // reset storage of current weapon class selected per slot.
1563 ResetReticlecxx . . $ ResetReticle(49f6e7a06ebc5aa8).();
1564
1565 // add his guidebot (if it is a guidebot game)
1566 // this is here in case DMFC calls this function (which would remove the guidebot)
1567 if (GetGameStatecxx . . $ GetGameState(473ac89a9d0ba37a).() == GAMESTATE_LVLPLAYINGcxx . . $ GAMESTATE_LVLPLAYING. && Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`! && Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`! &&
1568 Netgamecxx . . $ Netgame..flagscxx . . $ netgame_info#flags. & NF_ALLOWGUIDEBOTcxx . . $ `Descent3/multi_external.h:232:9`!) {
1569 if ((!Playerscxx . . $ Players.[slot].inventorycxx . . $ player#inventory..CheckItemcxx . . $ Inventory#CheckItem(cf9ef193275fa6d8).(OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!, ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`!)) &&
1570 (ObjGetcxx . . $ ObjGet(11672e354c0b263a).(Buddy_handlecxx . . $ Buddy_handle.[slot])->typecxx . . $ object#type. != OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!))
1571 Playerscxx . . $ Players.[slot].inventorycxx . . $ player#inventory..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!, ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`!);
1572 }
1573 }
1574
1575 // Gives the named player an afterburner
1576 void PlayerGiveAfterburnercxx . . $ PlayerGiveAfterburner(d4f767463ce0a6b3).(int slot) {
1577 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
1578 Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. |= PLAYER_FLAGS_AFTERBURNERcxx . . $ `Descent3/player_external.h:89:9`!;
1579 }
1580
1581 // makes the player invulnerable
1582 void MakePlayerInvulnerablecxx . . $ MakePlayerInvulnerable(a421cb528a2d8d2f).(int slot, float time, bool play_sound_and_message) {
1583 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
1584 Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. |= PLAYER_FLAGS_INVULNERABLEcxx . . $ `Descent3/player_external.h:79:9`!;
1585 Playerscxx . . $ Players.[slot].invulnerable_timecxx . . $ player#invulnerable_time. = time;
1586
1587 if (play_sound_and_message) {
1588 Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. |= PLAYER_FLAGS_PLAYSOUNDMSGFORINVULNcxx . . $ `Descent3/player_external.h:99:9`!;
1589 static int inv_sound_on_id = -2;
1590 if (inv_sound_on_id == -2)
1591 inv_sound_on_id = FindSoundNamecxx . . $ FindSoundName(5c4306d8553b3696).("Invulnerability on");
1592
1593 if (inv_sound_on_id != -1)
1594 Sound_systemcxx . . $ Sound_system..Play3dSoundcxx . . $ hlsSystem#Play3dSound(7fd84bfdbf757f76).(inv_sound_on_id, &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.], MAX_GAME_VOLUMEcxx . . $ `sndlib/ssl_lib.h:265:9`! / 2);
1595
1596 if (slot == Player_numcxx . . $ Player_num.) {
1597 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_INVULNONcxx . . $ `Descent3/stringtable.h:671:9`!);
1598 }
1599 }
1600 }
1601
1602 // makes the player invulnerable
1603 void MakePlayerVulnerablecxx . . $ MakePlayerVulnerable(d4f767463ce0a6b3).(int slot) {
1604 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
1605 // Play sound maybe.
1606 Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. &= ~PLAYER_FLAGS_INVULNERABLEcxx . . $ `Descent3/player_external.h:79:9`!;
1607 Playerscxx . . $ Players.[slot].invulnerable_timecxx . . $ player#invulnerable_time. = 0.0f;
1608
1609 if (Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & PLAYER_FLAGS_PLAYSOUNDMSGFORINVULNcxx . . $ `Descent3/player_external.h:99:9`!) {
1610 static int inv_sound_off_id = -1;
1611 if (inv_sound_off_id == -1)
1612 inv_sound_off_id = FindSoundNamecxx . . $ FindSoundName(5c4306d8553b3696).("Invulnerability off");
1613
1614 if (inv_sound_off_id != -1)
1615 Sound_systemcxx . . $ Sound_system..Play3dSoundcxx . . $ hlsSystem#Play3dSound(7fd84bfdbf757f76).(inv_sound_off_id, &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.], MAX_GAME_VOLUMEcxx . . $ `sndlib/ssl_lib.h:265:9`! / 2);
1616
1617 if (slot == Player_numcxx . . $ Player_num.) {
1618 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_INVULNOFFcxx . . $ `Descent3/stringtable.h:663:9`!);
1619 }
1620 }
1621 }
1622
1623 // Performs the player death sequence.
1624
1625 // Here list prototypes of all player automatic functions
1626 void DoNewPlayerDeathFramecxx . . $ DoNewPlayerDeathFrame(d4f767463ce0a6b3).(int slot);
1627
1628 // Does sampling of player position plus sets the camera positon
1629
1630 void UpdatePlayerCameraPositioncxx . . $ UpdatePlayerCameraPosition(49f6e7a06ebc5aa8).() {
1631 objectcxx . . $ object# *playerobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.];
1632 vectorcxx . . $ vector# dest_pos;
1633 matrixcxx . . $ matrix# dest_mat;
1634 int dest_room;
1635 int total_increments = 0;
1636
1637 // Increment our timers
1638 Player_camera_last_sample_timecxx . . $ Player_camera_last_sample_time. += Frametimecxx . . $ Frametime.;
1639 Player_camera_last_follow_timecxx . . $ Player_camera_last_follow_time. += Frametimecxx . . $ Frametime.;
1640
1641 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Player_camera_last_sample_time >= 0);
1642 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Player_camera_last_follow_time >= 0);
1643
1644 while (Player_camera_last_sample_timecxx . . $ Player_camera_last_sample_time. >= CAMERA_SAMPLE_INCREMENTcxx . . $ `Descent3/Player.cpp:1161:9`!) {
1645 Player_camera_last_sample_timecxx . . $ Player_camera_last_sample_time. -= CAMERA_SAMPLE_INCREMENTcxx . . $ `Descent3/Player.cpp:1161:9`!;
1646 total_increments++;
1647 }
1648
1649 if (total_increments > 0) {
1650 vectorcxx . . $ vector# delta_vec = playerobj->poscxx . . $ object#pos. -cxx . . $ operator-(b77b703cd1e43e33). Camera_sample_vectorscxx . . $ Camera_sample_vectors.[Camera_sample_indexcxx . . $ Camera_sample_index.];
1651
1652 vectorcxx . . $ vector# delta_r = playerobj->orientcxx . . $ object#orient..rveccxx . . $ matrix#rvec. -cxx . . $ operator-(b77b703cd1e43e33). Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.].rveccxx . . $ matrix#rvec.;
1653 vectorcxx . . $ vector# delta_u = playerobj->orientcxx . . $ object#orient..uveccxx . . $ matrix#uvec. -cxx . . $ operator-(b77b703cd1e43e33). Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.].uveccxx . . $ matrix#uvec.;
1654 vectorcxx . . $ vector# delta_f = playerobj->orientcxx . . $ object#orient..fveccxx . . $ matrix#fvec. -cxx . . $ operator-(b77b703cd1e43e33). Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.].fveccxx . . $ matrix#fvec.;
1655
1656 delta_vec /=cxx . . $ `operator/=`(f132838b2cd11d6). total_increments;
1657 delta_r /=cxx . . $ `operator/=`(f132838b2cd11d6). total_increments;
1658 delta_u /=cxx . . $ `operator/=`(f132838b2cd11d6). total_increments;
1659 delta_f /=cxx . . $ `operator/=`(f132838b2cd11d6). total_increments;
1660
1661 vectorcxx . . $ vector# current_pos = Camera_sample_vectorscxx . . $ Camera_sample_vectors.[Camera_sample_indexcxx . . $ Camera_sample_index.];
1662 vectorcxx . . $ vector# current_r = Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.].rveccxx . . $ matrix#rvec.;
1663 vectorcxx . . $ vector# current_u = Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.].uveccxx . . $ matrix#uvec.;
1664 vectorcxx . . $ vector# current_f = Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.].fveccxx . . $ matrix#fvec.;
1665
1666 int current_room = Camera_sample_roomscxx . . $ Camera_sample_rooms.[Camera_sample_indexcxx . . $ Camera_sample_index.];
1667
1668 for (int i = 0; i < total_increments; i++) {
1669 Camera_sample_vectorscxx . . $ Camera_sample_vectors.[Camera_sample_indexcxx . . $ Camera_sample_index.] =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). current_pos;
1670
1671 if (i < (total_increments / 2))
1672 Camera_sample_roomscxx . . $ Camera_sample_rooms.[Camera_sample_indexcxx . . $ Camera_sample_index.] = current_room;
1673 else
1674 Camera_sample_roomscxx . . $ Camera_sample_rooms.[Camera_sample_indexcxx . . $ Camera_sample_index.] = playerobj->roomnumcxx . . $ object#roomnum.;
1675
1676 Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.].rveccxx . . $ matrix#rvec. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). current_r;
1677 Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.].uveccxx . . $ matrix#uvec. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). current_u;
1678 Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.].fveccxx . . $ matrix#fvec. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). current_f;
1679
1680 Camera_sample_indexcxx . . $ Camera_sample_index.++;
1681
1682 if (Camera_sample_indexcxx . . $ Camera_sample_index. == MAX_CAMERA_SAMPLEScxx . . $ `Descent3/Player.cpp:1158:9`!)
1683 Camera_sample_indexcxx . . $ Camera_sample_index. = 0;
1684
1685 current_pos +=cxx . . $ `operator+=`(801a8d6f7ab7bef9). delta_vec;
1686 current_r +=cxx . . $ `operator+=`(801a8d6f7ab7bef9). delta_r;
1687 current_u +=cxx . . $ `operator+=`(801a8d6f7ab7bef9). delta_u;
1688 current_f +=cxx . . $ `operator+=`(801a8d6f7ab7bef9). delta_f;
1689 }
1690
1691 Camera_sample_vectorscxx . . $ Camera_sample_vectors.[Camera_sample_indexcxx . . $ Camera_sample_index.] =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). current_pos;
1692 Camera_sample_roomscxx . . $ Camera_sample_rooms.[Camera_sample_indexcxx . . $ Camera_sample_index.] = playerobj->roomnumcxx . . $ object#roomnum.;
1693 Camera_sample_matrixcxx . . $ Camera_sample_matrix.[Camera_sample_indexcxx . . $ Camera_sample_index.] =cxx . . $ matrix#`operator=`(4c6f8b29806742). playerobj->orientcxx . . $ object#orient.;
1694 }
1695
1696 while (Player_camera_last_follow_timecxx . . $ Player_camera_last_follow_time. >= CAMERA_SAMPLE_INCREMENTcxx . . $ `Descent3/Player.cpp:1161:9`!) {
1697 Camera_follow_indexcxx . . $ Camera_follow_index.++;
1698
1699 if (Camera_follow_indexcxx . . $ Camera_follow_index. == MAX_CAMERA_SAMPLEScxx . . $ `Descent3/Player.cpp:1158:9`!)
1700 Camera_follow_indexcxx . . $ Camera_follow_index. = 0;
1701
1702 Player_camera_last_follow_timecxx . . $ Player_camera_last_follow_time. -= CAMERA_SAMPLE_INCREMENTcxx . . $ `Descent3/Player.cpp:1161:9`!;
1703 }
1704
1705 // Get normalize position of the following camera
1706 int follow_start = Camera_follow_indexcxx . . $ Camera_follow_index.;
1707 int follow_end = (Camera_follow_indexcxx . . $ Camera_follow_index. + 1) % MAX_CAMERA_SAMPLEScxx . . $ `Descent3/Player.cpp:1158:9`!;
1708
1709 float follow_norm = Player_camera_last_follow_timecxx . . $ Player_camera_last_follow_time. / CAMERA_SAMPLE_INCREMENTcxx . . $ `Descent3/Player.cpp:1161:9`!;
1710
1711 ASSERTcxx . . $ `misc/pserror.h:246:9`!(follow_norm >= 0 && follow_norm <= 1);
1712
1713 // Set position
1714 dest_pos =cxx . . $ vector#`operator=`(c0842353a20857d).
1715 ((1.0 - follow_norm) *cxx . . $ `operator*`(9d6577ff3e9faa29). Camera_sample_vectorscxx . . $ Camera_sample_vectors.[follow_start]) +cxx . . $ operator+(b77b703cd1e43e33). (follow_norm *cxx . . $ `operator*`(9d6577ff3e9faa29). Camera_sample_vectorscxx . . $ Camera_sample_vectors.[follow_end]);
1716
1717 // Set room
1718 if (follow_norm > .5)
1719 dest_room = Camera_sample_roomscxx . . $ Camera_sample_rooms.[follow_start];
1720 else
1721 dest_room = Camera_sample_roomscxx . . $ Camera_sample_rooms.[follow_end];
1722
1723 // Set orientation matrix
1724 dest_mat.rveccxx . . $ matrix#rvec. =cxx . . $ vector#`operator=`(c0842353a20857d). ((1.0 - follow_norm) *cxx . . $ `operator*`(9d6577ff3e9faa29). Camera_sample_matrixcxx . . $ Camera_sample_matrix.[follow_start].rveccxx . . $ matrix#rvec.) +cxx . . $ operator+(b77b703cd1e43e33).
1725 ((follow_norm)*cxx . . $ `operator*`(9d6577ff3e9faa29).Camera_sample_matrixcxx . . $ Camera_sample_matrix.[follow_end].rveccxx . . $ matrix#rvec.);
1726 dest_mat.uveccxx . . $ matrix#uvec. =cxx . . $ vector#`operator=`(c0842353a20857d). ((1.0 - follow_norm) *cxx . . $ `operator*`(9d6577ff3e9faa29). Camera_sample_matrixcxx . . $ Camera_sample_matrix.[follow_start].uveccxx . . $ matrix#uvec.) +cxx . . $ operator+(b77b703cd1e43e33).
1727 ((follow_norm)*cxx . . $ `operator*`(9d6577ff3e9faa29).Camera_sample_matrixcxx . . $ Camera_sample_matrix.[follow_end].uveccxx . . $ matrix#uvec.);
1728 dest_mat.fveccxx . . $ matrix#fvec. =cxx . . $ vector#`operator=`(c0842353a20857d). ((1.0 - follow_norm) *cxx . . $ `operator*`(9d6577ff3e9faa29). Camera_sample_matrixcxx . . $ Camera_sample_matrix.[follow_start].fveccxx . . $ matrix#fvec.) +cxx . . $ operator+(b77b703cd1e43e33).
1729 ((follow_norm)*cxx . . $ `operator*`(9d6577ff3e9faa29).Camera_sample_matrixcxx . . $ Camera_sample_matrix.[follow_end].fveccxx . . $ matrix#fvec.);
1730
1731 // Set camera position
1732 fvi_infocxx . . $ fvi_info# hit_data;
1733 fvi_querycxx . . $ fvi_query# fq;
1734 vectorcxx . . $ vector# new_pos = dest_pos;
1735 new_pos -=cxx . . $ `operator-=`(801a8d6f7ab7bef9). dest_mat.fveccxx . . $ matrix#fvec. *cxx . . $ `operator*`(252247219a31502c). (playerobj->sizecxx . . $ object#size. * 3);
1736 new_pos +=cxx . . $ `operator+=`(801a8d6f7ab7bef9). dest_mat.uveccxx . . $ matrix#uvec. *cxx . . $ `operator*`(252247219a31502c). (playerobj->sizecxx . . $ object#size. / 2);
1737
1738 fq.p1cxx . . $ fvi_query#p1. = &new_pos;
1739 fq.p0cxx . . $ fvi_query#p0. = &dest_pos;
1740 fq.startroomcxx . . $ fvi_query#startroom. = dest_room;
1741 fq.radcxx . . $ fvi_query#rad. = .5;
1742 fq.thisobjnumcxx . . $ fvi_query#thisobjnum. = OBJNUMcxx . . $ `Descent3/object.h:700:9`!(playerobj);
1743 fq.ignore_obj_listcxx . . $ fvi_query#ignore_obj_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1744 fq.flagscxx . . $ fvi_query#flags. = FQ_CHECK_OBJScxx . . $ `lib/findintersection_external.h:59:9`! | FQ_IGNORE_NON_LIGHTMAP_OBJECTScxx . . $ `lib/findintersection_external.h:68:9`!;
1745 fvi_FindIntersectioncxx . . $ fvi_FindIntersection(e1c4d7bd350effc8).(&fq, &hit_data);
1746
1747 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(&Objectscxx . . $ Objects.[Player_camera_objnumcxx . . $ Player_camera_objnum.], &hit_data.hit_pntcxx . . $ fvi_info#hit_pnt., hit_data.hit_roomcxx . . $ fvi_info#hit_room., &dest_mat, false);
1748 }
1749
1750 // Creates or destroys a player camera depending on what the situation calls for
1751 void SetupPlayerCameracxx . . $ SetupPlayerCamera(49f6e7a06ebc5aa8).() {
1752 objectcxx . . $ object# *playerobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.];
1753
1754 if (Player_has_cameracxx . . $ Player_has_camera.) {
1755 if (Player_camera_objnumcxx . . $ Player_camera_objnum. == -1) {
1756 // We have to create a new camera
1757 int objnum = ObjCreatecxx . . $ ObjCreate(849c3da80a4f387f).(OBJ_CAMERAcxx . . $ `Descent3/object_external.h:169:9`!, 0, playerobj->roomnumcxx . . $ object#roomnum., &playerobj->poscxx . . $ object#pos., &playerobj->orientcxx . . $ object#orient.);
1758 if (objnum < 0) {
1759 // Couldn't create a camera for some reason
1760 Player_has_cameracxx . . $ Player_has_camera. = false;
1761 Player_camera_objnumcxx . . $ Player_camera_objnum. = 0;
1762 return;
1763 } else {
1764 Player_camera_objnumcxx . . $ Player_camera_objnum. = objnum;
1765 Camera_sample_indexcxx . . $ Camera_sample_index. = MAX_CAMERA_SUB_SAMPLEScxx . . $ `Descent3/Player.cpp:1159:9`!;
1766 Player_camera_last_sample_timecxx . . $ Player_camera_last_sample_time. = 0;
1767 Player_camera_last_follow_timecxx . . $ Player_camera_last_follow_time. = 0;
1768 Camera_follow_indexcxx . . $ Camera_follow_index. = 0;
1769
1770 for (int i = 0; i < MAX_CAMERA_SAMPLEScxx . . $ `Descent3/Player.cpp:1158:9`!; i++) {
1771 Camera_sample_matrixcxx . . $ Camera_sample_matrix.[i] =cxx . . $ matrix#`operator=`(4c6f8b29806742). playerobj->orientcxx . . $ object#orient.;
1772 Camera_sample_vectorscxx . . $ Camera_sample_vectors.[i] =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). playerobj->poscxx . . $ object#pos.;
1773 Camera_sample_roomscxx . . $ Camera_sample_rooms.[i] = playerobj->roomnumcxx . . $ object#roomnum.;
1774 }
1775 }
1776 }
1777
1778 if (Viewer_objectcxx . . $ Viewer_object. == playerobj) {
1779 // Set viewer to be camera
1780 Viewer_objectcxx . . $ Viewer_object. = &Objectscxx . . $ Objects.[Player_camera_objnumcxx . . $ Player_camera_objnum.];
1781 }
1782
1783 UpdatePlayerCameraPositioncxx . . $ UpdatePlayerCameraPosition(49f6e7a06ebc5aa8).();
1784 } else {
1785 if (Player_camera_objnumcxx . . $ Player_camera_objnum. != -1) {
1786 SetObjectDeadFlagcxx . . $ SetObjectDeadFlag(80a724877f6428f2).(&Objectscxx . . $ Objects.[Player_camera_objnumcxx . . $ Player_camera_objnum.]);
1787 Player_camera_objnumcxx . . $ Player_camera_objnum. = -1;
1788 }
1789 }
1790 }
1791
1792 // Does actions for the given player slot
1793 void DoPlayerFrameForOnecxx . . $ DoPlayerFrameForOne(d4f767463ce0a6b3).(int slot) {
1794 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
1795 objectcxx . . $ object# *obj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
1796 static int napalm_id = -1;
1797
1798 Playerscxx . . $ Players.[slot].time_levelcxx . . $ player#time_level. = Gametimecxx . . $ Gametime.;
1799
1800 if (napalm_id == -1) {
1801 napalm_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("Napalm");
1802 }
1803
1804 // If piggy backing observer, then set position relative to observed object
1805 if (obj->typecxx . . $ object#type. == OBJ_OBSERVERcxx . . $ `Descent3/object_external.h:182:9`! && Playerscxx . . $ Players.[slot].piggy_objnumcxx . . $ player#piggy_objnum. != -1) {
1806 objectcxx . . $ object# *observed = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].piggy_objnumcxx . . $ player#piggy_objnum.];
1807 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(obj, &observed->poscxx . . $ object#pos., observed->roomnumcxx . . $ object#roomnum., &observed->orientcxx . . $ object#orient., false);
1808
1809 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info. =cxx . . $ physics_info#`operator=`(fa4a94890b261b64). observed->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info.;
1810 }
1811
1812 if (obj->typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`! || obj->typecxx . . $ object#type. == OBJ_OBSERVERcxx . . $ `Descent3/object_external.h:182:9`! && obj->idcxx . . $ object#id. == Player_numcxx . . $ Player_num.) {
1813 // Do camera stuff if needed
1814 SetupPlayerCameracxx . . $ SetupPlayerCamera(49f6e7a06ebc5aa8).();
1815 }
1816
1817 if (Demo_flagscxx . . $ Demo_flags. != DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!) {
1818 if ((Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`!) || (Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!))
1819 DoNewPlayerDeathFramecxx . . $ DoNewPlayerDeathFrame(d4f767463ce0a6b3).(slot);
1820 }
1821
1822 // do invulnerable stuff
1823 if (Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & PLAYER_FLAGS_INVULNERABLEcxx . . $ `Descent3/player_external.h:79:9`!) {
1824 Playerscxx . . $ Players.[slot].invulnerable_timecxx . . $ player#invulnerable_time. -= Frametimecxx . . $ Frametime.;
1825 if (Playerscxx . . $ Players.[slot].invulnerable_timecxx . . $ player#invulnerable_time. <= 0.0f) {
1826 // deinvulnerablize the player!!
1827 MakePlayerVulnerablecxx . . $ MakePlayerVulnerable(d4f767463ce0a6b3).(slot);
1828 }
1829 }
1830
1831 // Do terrain damage stuff
1832 if (Terrain_skycxx . . $ Terrain_sky..damage_per_secondcxx . . $ terrain_sky#damage_per_second. > 0 && !(Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & (PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`! | PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!))) {
1833 if (OBJECT_OUTSIDEcxx . . $ `lib/object_external_struct.h:130:9`!(obj)) {
1834 float scalar = GetTerrainDynamicScalarcxx . . $ GetTerrainDynamicScalar(bdb4036c8ebf1af).(&obj->poscxx . . $ object#pos., CELLNUMcxx . . $ `lib/object_external_struct.h:121:9`!(obj->roomnum));
1835
1836 // White out the screen
1837 if (scalar > 0 && slot == Player_numcxx . . $ Player_num.) {
1838 float vals[4];
1839
1840 vals[0] = 1.0;
1841 vals[1] = 1.0;
1842 vals[2] = .8f;
1843 vals[3] = scalar / 4;
1844
1845 CreateNewEventcxx . . $ CreateNewEvent(85af21da76cb0316).(RENDER_EVENTcxx . . $ `Descent3/gameevent.h:29:9`!, 0, 0, &vals, sizeof(float) * 4, DrawAlphaEventcxx . . $ DrawAlphaEvent(6ca3d68f5c5f0975).);
1846 }
1847
1848 if (scalar > .7) {
1849 SetNapalmDamageEffectcxx . . $ SetNapalmDamageEffect(6964148eab73f28a).(obj, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, napalm_id);
1850 obj->effect_infocxx . . $ object#effect_info.->damage_timecxx . . $ effect_info_s#damage_time. = 1;
1851 obj->effect_infocxx . . $ object#effect_info.->damage_per_secondcxx . . $ effect_info_s#damage_per_second. = 2;
1852 }
1853 }
1854 }
1855
1856 Playerscxx . . $ Players.[slot].invul_magnitudecxx . . $ player#invul_magnitude. -= (Frametimecxx . . $ Frametime. * 2);
1857
1858 // Drop the red effect of the console player faster than other players
1859 float alpha_blend_scalar_time = 1.0;
1860 if (slot == Player_numcxx . . $ Player_num.)
1861 alpha_blend_scalar_time = 2.0;
1862
1863 Playerscxx . . $ Players.[slot].damage_magnitudecxx . . $ player#damage_magnitude. -= (Frametimecxx . . $ Frametime. * (MAX_DAMAGE_MAGcxx . . $ `Descent3/damage.h:106:9`!)*alpha_blend_scalar_time);
1864 Playerscxx . . $ Players.[slot].edrain_magnitudecxx . . $ player#edrain_magnitude. -= (Frametimecxx . . $ Frametime. * (MAX_EDRAIN_MAGcxx . . $ `Descent3/damage.h:107:9`!)*alpha_blend_scalar_time);
1865
1866 if (Playerscxx . . $ Players.[slot].invul_magnitudecxx . . $ player#invul_magnitude. < 0)
1867 Playerscxx . . $ Players.[slot].invul_magnitudecxx . . $ player#invul_magnitude. = 0;
1868
1869 if (Playerscxx . . $ Players.[slot].damage_magnitudecxx . . $ player#damage_magnitude. < 0)
1870 Playerscxx . . $ Players.[slot].damage_magnitudecxx . . $ player#damage_magnitude. = 0;
1871 if (Playerscxx . . $ Players.[slot].edrain_magnitudecxx . . $ player#edrain_magnitude. < 0)
1872 Playerscxx . . $ Players.[slot].edrain_magnitudecxx . . $ player#edrain_magnitude. = 0;
1873
1874 if ((obj->weapon_fire_flagscxx . . $ object#weapon_fire_flags. & WFF_SPRAYcxx . . $ `Descent3/player_external.h:103:9`!) && !(Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!)) {
1875 int ship_index = Playerscxx . . $ Players.[slot].ship_indexcxx . . $ player#ship_index.;
1876 int wb_index = Playerscxx . . $ Players.[slot].weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!].indexcxx . . $ player_weapon#index.;
1877 DoSprayEffectcxx . . $ DoSprayEffect(8a3ad1df6cc7128b).(&Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.], &Shipscxx . . $ Ships.[ship_index].static_wbcxx . . $ ship#static_wb.[wb_index], wb_index);
1878 }
1879
1880 // Do On/Off weapons for multiplayer
1881 if (slot != Player_numcxx . . $ Player_num. && (obj->weapon_fire_flagscxx . . $ object#weapon_fire_flags. & WFF_ON_OFFcxx . . $ `Descent3/player_external.h:104:9`!) && !(Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!)) {
1882 FireOnOffWeaponcxx . . $ FireOnOffWeapon(419c470199a90a97).(&Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.]);
1883 }
1884
1885 // Do thrust stuff here
1886 if (Player_numcxx . . $ Player_num. == slot && Game_togglescxx . . $ Game_toggles..ship_noisescxx . . $ tGameToggles#ship_noises. == false) {
1887 if (Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. > -1) {
1888 Sound_systemcxx . . $ Sound_system..StopSoundImmediatecxx . . $ hlsSystem#StopSoundImmediate(d4f767463ce0a6b3).(Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle.);
1889 Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. = -1;
1890 }
1891 }
1892
1893 if (Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & PLAYER_FLAGS_THRUSTEDcxx . . $ `Descent3/player_external.h:94:9`!) {
1894 Playerscxx . . $ Players.[slot].thrust_magcxx . . $ player#thrust_mag. += (Frametimecxx . . $ Frametime. * 2);
1895 if (Playerscxx . . $ Players.[slot].thrust_magcxx . . $ player#thrust_mag. > 1)
1896 Playerscxx . . $ Players.[slot].thrust_magcxx . . $ player#thrust_mag. = 1;
1897
1898 // Play thrust sound
1899 if (slot == Player_numcxx . . $ Player_num.) {
1900 if (Playerscxx . . $ Players.[slot].thruster_sound_statecxx . . $ player#thruster_sound_state. == 0) {
1901 if (Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. != -1) {
1902 Sound_systemcxx . . $ Sound_system..StopSoundImmediatecxx . . $ hlsSystem#StopSoundImmediate(d4f767463ce0a6b3).(Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle.);
1903 Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. = -1;
1904 }
1905 if (Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. == -1) {
1906 if (Game_togglescxx . . $ Game_toggles..ship_noisescxx . . $ tGameToggles#ship_noises.) {
1907 Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. = Sound_systemcxx . . $ Sound_system..Play3dSoundcxx . . $ hlsSystem#Play3dSound(7fd84bfdbf757f76).(SOUND_SHIP_FORWARD_THRUSTcxx . . $ `Descent3/sounds.h:144:9`!, obj);
1908 }
1909 }
1910
1911 Playerscxx . . $ Players.[slot].thruster_sound_statecxx . . $ player#thruster_sound_state. = 1;
1912 }
1913 }
1914 } else {
1915 // Cool down thrust
1916 Playerscxx . . $ Players.[slot].thrust_magcxx . . $ player#thrust_mag. -= (Frametimecxx . . $ Frametime. * 2);
1917 if (Playerscxx . . $ Players.[slot].thrust_magcxx . . $ player#thrust_mag. < 0)
1918 Playerscxx . . $ Players.[slot].thrust_magcxx . . $ player#thrust_mag. = 0;
1919
1920 // Stop thrust sound
1921 if (slot == Player_numcxx . . $ Player_num.) {
1922 if (Playerscxx . . $ Players.[slot].thruster_sound_statecxx . . $ player#thruster_sound_state. == 1) {
1923 if (Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. != -1) {
1924 Sound_systemcxx . . $ Sound_system..StopSoundImmediatecxx . . $ hlsSystem#StopSoundImmediate(d4f767463ce0a6b3).(Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle.);
1925 }
1926
1927 Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. = -1;
1928
1929 if (Game_togglescxx . . $ Game_toggles..ship_noisescxx . . $ tGameToggles#ship_noises.) {
1930 Sound_systemcxx . . $ Sound_system..Play3dSoundcxx . . $ hlsSystem#Play3dSound(7fd84bfdbf757f76).(SOUND_SHIP_FORWARD_RELEASEcxx . . $ `Descent3/sounds.h:145:9`!, obj);
1931 }
1932 }
1933
1934 if (Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. == -1) {
1935 if (Game_togglescxx . . $ Game_toggles..ship_noisescxx . . $ tGameToggles#ship_noises.) {
1936 Playerscxx . . $ Players.[slot].thruster_sound_handlecxx . . $ player#thruster_sound_handle. = Sound_systemcxx . . $ Sound_system..Play3dSoundcxx . . $ hlsSystem#Play3dSound(7fd84bfdbf757f76).(SOUND_SHIP_IDLEcxx . . $ `Descent3/sounds.h:143:9`!, obj);
1937 }
1938 }
1939 Playerscxx . . $ Players.[slot].thruster_sound_statecxx . . $ player#thruster_sound_state. = 0;
1940 }
1941 }
1942
1943 // Do afterburner stuff
1944 if ((Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & PLAYER_FLAGS_AFTERBURN_ONcxx . . $ `Descent3/player_external.h:92:9`!) &&
1945 !(Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & (PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`! | PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!))) {
1946 if (Playerscxx . . $ Players.[slot].afterburner_sound_handlecxx . . $ player#afterburner_sound_handle. == -1) {
1947 // turn on the afterburner!
1948 Playerscxx . . $ Players.[slot].afterburner_sound_handlecxx . . $ player#afterburner_sound_handle. = Sound_systemcxx . . $ Sound_system..Play3dSoundcxx . . $ hlsSystem#Play3dSound(7fd84bfdbf757f76).(SOUND_AFTERBURNERcxx . . $ `Descent3/sounds.h:113:9`!, obj);
1949 }
1950
1951 Playerscxx . . $ Players.[slot].afterburner_magcxx . . $ player#afterburner_mag. += (Frametimecxx . . $ Frametime. * 2);
1952 if (Playerscxx . . $ Players.[slot].afterburner_magcxx . . $ player#afterburner_mag. > 1)
1953 Playerscxx . . $ Players.[slot].afterburner_magcxx . . $ player#afterburner_mag. = 1;
1954 } else {
1955 // Cool down afterburner
1956 Playerscxx . . $ Players.[slot].afterburner_magcxx . . $ player#afterburner_mag. -= (Frametimecxx . . $ Frametime. * 2);
1957 if (Playerscxx . . $ Players.[slot].afterburner_magcxx . . $ player#afterburner_mag. < 0)
1958 Playerscxx . . $ Players.[slot].afterburner_magcxx . . $ player#afterburner_mag. = 0;
1959
1960 if (Playerscxx . . $ Players.[slot].afterburner_sound_handlecxx . . $ player#afterburner_sound_handle. != -1) {
1961 Sound_systemcxx . . $ Sound_system..StopSoundImmediatecxx . . $ hlsSystem#StopSoundImmediate(d4f767463ce0a6b3).(Playerscxx . . $ Players.[slot].afterburner_sound_handlecxx . . $ player#afterburner_sound_handle.);
1962 Playerscxx . . $ Players.[slot].afterburner_sound_handlecxx . . $ player#afterburner_sound_handle. = -1;
1963 Sound_systemcxx . . $ Sound_system..Play3dSoundcxx . . $ hlsSystem#Play3dSound(7fd84bfdbf757f76).(SOUND_AFTERBURNER_TAILcxx . . $ `Descent3/sounds.h:121:9`!, obj);
1964 }
1965 }
1966 }
1967
1968 // Do player automatic frame (all player automatic actions)
1969 // Does all player, single or multiplayer games
1970 void DoPlayerFramecxx . . $ DoPlayerFrame(49f6e7a06ebc5aa8).() {
1971 if (Demo_flagscxx . . $ Demo_flags. == DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!) {
1972 for (int i = 0; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++) {
1973 if (Objectscxx . . $ Objects.[Playerscxx . . $ Players.[i].objnumcxx . . $ player#objnum.].idcxx . . $ object#id. != i)
1974 continue;
1975 if (Objectscxx . . $ Objects.[Playerscxx . . $ Players.[i].objnumcxx . . $ player#objnum.].typecxx . . $ object#type. == OBJ_GHOSTcxx . . $ `Descent3/object_external.h:172:9`!)
1976 continue;
1977
1978 DoPlayerFrameForOnecxx . . $ DoPlayerFrameForOne(d4f767463ce0a6b3).(i);
1979 }
1980
1981 } else if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
1982 for (int i = 0; i < MAX_NET_PLAYERScxx . . $ `Descent3/multi_external.h:132:9`!; i++) {
1983 if (!(NetPlayerscxx . . $ NetPlayers.[i].flagscxx . . $ netplayer#flags. & NPF_CONNECTEDcxx . . $ `Descent3/multi_external.h:165:9`!))
1984 continue;
1985
1986 DoPlayerFrameForOnecxx . . $ DoPlayerFrameForOne(d4f767463ce0a6b3).(i);
1987 }
1988
1989 } else {
1990 DoPlayerFrameForOnecxx . . $ DoPlayerFrameForOne(d4f767463ce0a6b3).(Player_numcxx . . $ Player_num.);
1991 }
1992 }
1993
1994 // This function performs the death roll for a player.
1995 #define MIN_DEATHCAM_DISTcxx . . $ `Descent3/Player.cpp:1995:9`! 40.0f
1996 #define MEDIAN_DEATHCAM_DISTcxx . . $ `Descent3/Player.cpp:1996:9`! 80.0f
1997 #define MAX_DEATHCAM_DISTcxx . . $ `Descent3/Player.cpp:1997:9`! 150.0f
1998
1999 #define DEATH_PHYS_INTERVALcxx . . $ `Descent3/Player.cpp:1999:9`! 0.10f
2000 #define DEATH_FATE_INTERVALcxx . . $ `Descent3/Player.cpp:2000:9`! 0.50f
2001
2002 #define MAX_EXPLOSION_MAGcxx . . $ `Descent3/Player.cpp:2002:9`! 40.0f
2003 #define MAX_ROLL_TIMEcxx . . $ `Descent3/Player.cpp:2003:9`! 2.5
2004 #define DEATH_COCKPIT_TIMEcxx . . $ `Descent3/Player.cpp:2004:9`! 0.0f
2005
2006 #define DEATH_INSTANTcxx . . $ `Descent3/Player.cpp:2006:9`! 0
2007 #define DEATH_FALLcxx . . $ `Descent3/Player.cpp:2007:9`! 1
2008 #define DEATH_BREAKUPcxx . . $ `Descent3/Player.cpp:2008:9`! 2
2009 #define DEATH_D2STYLEcxx . . $ `Descent3/Player.cpp:2009:9`! 3
2010
2011 #define DEATH_EXPLODE_THRESHOLDcxx . . $ `Descent3/Player.cpp:2011:9`! 100.0f
2012 #define DEATH_BREAKUP_THRESHOLDcxx . . $ `Descent3/Player.cpp:2012:9`! 40.0f
2013
2014 struct tDeathSeqcxx . . $ tDeathSeq# {
2015 objectcxx . . $ object# *cameracxx . . $ tDeathSeq#camera.;
2016 objectcxx . . $ object# *oldviewercxx . . $ tDeathSeq#oldviewer.;
2017
2018 poly_modelcxx . . $ poly_model# *dying_modelcxx . . $ tDeathSeq#dying_model.;
2019
2020 int16_t fatecxx . . $ tDeathSeq#fate.;
2021 int16_t breakup_countcxx . . $ tDeathSeq#breakup_count.;
2022 float initial_death_timecxx . . $ tDeathSeq#initial_death_time.;
2023 float time_dyingcxx . . $ tDeathSeq#time_dying.;
2024 float max_time_dyingcxx . . $ tDeathSeq#max_time_dying.;
2025 float physics_frametimecxx . . $ tDeathSeq#physics_frametime.;
2026 float fate_frametimecxx . . $ tDeathSeq#fate_frametime.;
2027
2028 float damagecxx . . $ tDeathSeq#damage.;
2029 float accel_modcxx . . $ tDeathSeq#accel_mod.;
2030 vectorcxx . . $ vector# force_dircxx . . $ tDeathSeq#force_dir.;
2031
2032 uint8_tcxx . . $ uint8_t# saved_ctrl_typecxx . . $ tDeathSeq#saved_ctrl_type.;
2033 uint32_tcxx . . $ uint32_t# saved_phys_flagscxx . . $ tDeathSeq#saved_phys_flags.;
2034 float saved_dragcxx . . $ tDeathSeq#saved_drag.;
2035 vectorcxx . . $ vector# saved_rotthrustcxx . . $ tDeathSeq#saved_rotthrust.;
2036
2037 tHUDModecxx . . $ tHUDMode# saved_cockpitcxx . . $ tDeathSeq#saved_cockpit.;
2038 int saved_player_modelnumcxx . . $ tDeathSeq#saved_player_modelnum.;
2039 bool in_cockpitcxx . . $ tDeathSeq#in_cockpit.;
2040
2041 tDeathSeqcxx . . $ tDeathSeq#tDeathSeq(49f6e7a06ebc5aa8).() { cameracxx . . $ tDeathSeq#camera. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; };
2042
2043 };
2044
2045 static tDeathSeqcxx . . $ tDeathSeq# Deathcxx . . $ Death.[MAX_NET_PLAYERScxx . . $ `Descent3/multi_external.h:132:9`!];
2046
2047 void debug_deathtypecxx . . $ debug_deathtype(3e454b8ccf442868).(int slot, int damage) {
2048 if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_INSTANTcxx . . $ `Descent3/Player.cpp:2006:9`!)
2049 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "INSTANT DEATH ");
2050 else if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_FALLcxx . . $ `Descent3/Player.cpp:2007:9`!)
2051 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "FALLING DEATH ");
2052 else if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_BREAKUPcxx . . $ `Descent3/Player.cpp:2008:9`!)
2053 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "BREAKUP DEATH ");
2054 else
2055 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "UNKNOWN DEATH ");
2056 }
2057
2058 float MoveDeathCamcxx . . $ MoveDeathCam(54709106d64c0257).(int slot, vectorcxx . . $ vector# *vec, float distance);
2059 void PlayerShipExplodecxx . . $ PlayerShipExplode(4ebbd0c3cbf1b78a).(objectcxx . . $ object# *obj, float magnitude);
2060 void PlayerShipBreakupcxx . . $ PlayerShipBreakup(4ebbd0c3cbf1b78a).(objectcxx . . $ object# *obj, float magnitude);
2061 void PlayerShipSpewPartcxx . . $ PlayerShipSpewPart(dc43bf10ea54b482).(objectcxx . . $ object# *obj, int subobjnum, float magnitude);
2062
2063 void InitiatePlayerDeathcxx . . $ InitiatePlayerDeath(638d79040b3e553a).(objectcxx . . $ object# *playerobj, bool melee, int fate) {
2064 if (!(Playerscxx . . $ Players.[playerobj->idcxx . . $ object#id.].flagscxx . . $ player#flags. & (PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`! + PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`!))) {
2065 // player is dying. We don't want to make player dead yet.
2066 Playerscxx . . $ Players.[playerobj->idcxx . . $ object#id.].flagscxx . . $ player#flags. |= PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`!;
2067
2068 // Take care of stuff that should happen when you die
2069 ClearPlayerFiringcxx . . $ ClearPlayerFiring(766a1b7183ffa4b4).(playerobj, PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!);
2070 ClearPlayerFiringcxx . . $ ClearPlayerFiring(766a1b7183ffa4b4).(playerobj, PW_SECONDARYcxx . . $ `Descent3/player_external.h:109:9`!);
2071
2072 // Start the death sequence
2073 StartPlayerDeathcxx . . $ StartPlayerDeath(b328c1935e30afea).(playerobj->idcxx . . $ object#id., -playerobj->shieldscxx . . $ object#shields., melee, fate);
2074 }
2075 }
2076
2077 // Chooses the style of death a player is going to use
2078 int PlayerChooseDeathFatecxx . . $ PlayerChooseDeathFate(3894405e7b40415d).(int slot, float damage, bool melee) {
2079 int fate;
2080 bool is_moving;
2081 objectcxx . . $ object# *playerobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
2082
2083 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
2084
2085 if (vm_GetMagnitudecxx . . $ vm_GetMagnitude(4939a7e530383cd4).(&playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity.))
2086 is_moving = true;
2087 else
2088 is_moving = false;
2089
2090 fate = (damage <= DEATH_BREAKUP_THRESHOLDcxx . . $ `Descent3/Player.cpp:2012:9`! && is_moving && !melee && OBJECT_OUTSIDEcxx . . $ `lib/object_external_struct.h:130:9`!(playerobj)) ? DEATH_BREAKUPcxx . . $ `Descent3/Player.cpp:2008:9`!
2091 : (damage <= DEATH_EXPLODE_THRESHOLDcxx . . $ `Descent3/Player.cpp:2011:9`! || melee) ? DEATH_FALLcxx . . $ `Descent3/Player.cpp:2007:9`!
2092 : DEATH_INSTANTcxx . . $ `Descent3/Player.cpp:2006:9`!;
2093
2094 if (fate == DEATH_BREAKUPcxx . . $ `Descent3/Player.cpp:2008:9`!) {
2095 if ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 4) < 2)
2096 fate = DEATH_D2STYLEcxx . . $ `Descent3/Player.cpp:2009:9`!;
2097 } else if (fate == DEATH_FALLcxx . . $ `Descent3/Player.cpp:2007:9`!) {
2098 if ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 4) != 3)
2099 fate = DEATH_D2STYLEcxx . . $ `Descent3/Player.cpp:2009:9`!;
2100 }
2101
2102 // split ship into subobjects. they should still be one object but now with several parts.
2103 if (playerobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..dying_model_numcxx . . $ polyobj_info#dying_model_num. == -1) {
2104 if (fate == DEATH_BREAKUPcxx . . $ `Descent3/Player.cpp:2008:9`!) {
2105 fate = DEATH_FALLcxx . . $ `Descent3/Player.cpp:2007:9`!;
2106 }
2107 }
2108
2109 return fate;
2110 }
2111
2112 ///////////////////////////////////////////////////////////////////////////////
2113 // Starts player death sequence.
2114
2115 void StartPlayerDeathcxx . . $ StartPlayerDeath(b328c1935e30afea).(int slot, float damage, bool melee, int fate) {
2116 int objnum;
2117 objectcxx . . $ object# *playerobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
2118 int killer_num = Playerscxx . . $ Players.[playerobj->idcxx . . $ object#id.].killer_objnumcxx . . $ player#killer_objnum.;
2119 objectcxx . . $ object# *killer;
2120
2121 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
2122
2123 Playerscxx . . $ Players.[playerobj->idcxx . . $ object#id.].num_deaths_levelcxx . . $ player#num_deaths_level.++;
2124 Playerscxx . . $ Players.[playerobj->idcxx . . $ object#id.].num_deaths_totalcxx . . $ player#num_deaths_total.++;
2125 // Do killer object stuff
2126 if (killer_num < 0 || killer_num > MAX_OBJECTScxx . . $ `lib/object_external_struct.h:107:9`!)
2127 killer = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2128 else {
2129 killer = &Objectscxx . . $ Objects.[killer_num];
2130 if (killer->typecxx . . $ object#type. == OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!)
2131 killer = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2132 }
2133
2134 // determine current state of player object.
2135 // create death camera if it doesn't exit
2136 if (slot == Player_numcxx . . $ Player_num.) {
2137 objnum = ObjCreatecxx . . $ ObjCreate(849c3da80a4f387f).(OBJ_CAMERAcxx . . $ `Descent3/object_external.h:169:9`!, 0, playerobj->roomnumcxx . . $ object#roomnum., &playerobj->poscxx . . $ object#pos., &playerobj->orientcxx . . $ object#orient.);
2138 if (objnum == -1) {
2139 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Failed to create death cam.\n");
2140 Int3cxx . . $ `misc/pserror.h:247:9`!();
2141 } else {
2142 Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera. = &Objectscxx . . $ Objects.[objnum];
2143 if (Objectscxx . . $ Objects.[objnum].typecxx . . $ object#type. == OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!)
2144 Int3cxx . . $ `misc/pserror.h:247:9`!(); // Samir- This really shouldn't happen. will cause assertion
2145 }
2146
2147 Deathcxx . . $ Death.[slot].oldviewercxx . . $ tDeathSeq#oldviewer. = Viewer_objectcxx . . $ Viewer_object.;
2148
2149 // set screen mode
2150 if (Cinematic_inusecxx . . $ Cinematic_inuse.) {
2151 Deathcxx . . $ Death.[slot].saved_cockpitcxx . . $ tDeathSeq#saved_cockpit. = Cinematic_GetOldHudModecxx . . $ Cinematic_GetOldHudMode(d2d05048dda10524).();
2152 } else {
2153 Deathcxx . . $ Death.[slot].saved_cockpitcxx . . $ tDeathSeq#saved_cockpit. = GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).();
2154 }
2155
2156 Deathcxx . . $ Death.[slot].in_cockpitcxx . . $ tDeathSeq#in_cockpit. = true;
2157 }
2158
2159 // save player ship information that will be changed here.
2160 Deathcxx . . $ Death.[slot].saved_ctrl_typecxx . . $ tDeathSeq#saved_ctrl_type. = playerobj->control_typecxx . . $ object#control_type.;
2161 Deathcxx . . $ Death.[slot].saved_phys_flagscxx . . $ tDeathSeq#saved_phys_flags. = playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags.;
2162 Deathcxx . . $ Death.[slot].saved_dragcxx . . $ tDeathSeq#saved_drag. = playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..dragcxx . . $ physics_info#drag.;
2163 Deathcxx . . $ Death.[slot].saved_player_modelnumcxx . . $ tDeathSeq#saved_player_modelnum. = playerobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.;
2164 Deathcxx . . $ Death.[slot].saved_rotthrustcxx . . $ tDeathSeq#saved_rotthrust. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotthrustcxx . . $ physics_info#$anonymous_type_2#rotthrust.;
2165 Deathcxx . . $ Death.[slot].breakup_countcxx . . $ tDeathSeq#breakup_count. = 0;
2166
2167 if (killer == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) // If the killer isn't valid, just use the reverse forward direction
2168 Deathcxx . . $ Death.[slot].force_dircxx . . $ tDeathSeq#force_dir. =cxx . . $ vector#`operator=`(c0842353a20857d). -cxx . . $ operator-(9e07539e219c6f20).playerobj->orientcxx . . $ object#orient..fveccxx . . $ matrix#fvec.;
2169 else
2170 Deathcxx . . $ Death.[slot].force_dircxx . . $ tDeathSeq#force_dir. =cxx . . $ vector#`operator=`(c0842353a20857d). playerobj->poscxx . . $ object#pos. -cxx . . $ operator-(b77b703cd1e43e33). killer->poscxx . . $ object#pos.;
2171
2172 vm_NormalizeVectorcxx . . $ vm_NormalizeVector(4939a7e530383cd4).(&Deathcxx . . $ Death.[slot].force_dircxx . . $ tDeathSeq#force_dir.);
2173 Deathcxx . . $ Death.[slot].force_dircxx . . $ tDeathSeq#force_dir. =cxx . . $ vector#`operator=`(c0842353a20857d). Deathcxx . . $ Death.[slot].force_dircxx . . $ tDeathSeq#force_dir. *cxx . . $ `operator*`(14b8f9ac5c1e7b85). playerobj->orientcxx . . $ object#orient.;
2174
2175 // determine fate of player ship
2176 if (fate == -1)
2177 Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. = PlayerChooseDeathFatecxx . . $ PlayerChooseDeathFate(3894405e7b40415d).(slot, damage, melee);
2178 else
2179 Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. = fate;
2180
2181 // split ship into subobjects. they should still be one object but now with several parts.
2182 if (playerobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..dying_model_numcxx . . $ polyobj_info#dying_model_num. != -1) {
2183 playerobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num. = playerobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..dying_model_numcxx . . $ polyobj_info#dying_model_num.;
2184 Deathcxx . . $ Death.[slot].dying_modelcxx . . $ tDeathSeq#dying_model. = GetPolymodelPointercxx . . $ GetPolymodelPointer(ac85e77c73ebf794).(playerobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.);
2185 playerobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..subobj_flagscxx . . $ polyobj_info#subobj_flags. = 0xffffffff;
2186 // playerobj->rtype.pobj_info.subobj_flags = ~(0xffffffff << (Death[slot].dying_model->n_models));
2187 // mprintf(0, "initflags=%08x\n", playerobj->rtype.pobj_info.subobj_flags);
2188 } else {
2189 // This ship has no dying model so dont break up
2190 if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_BREAKUPcxx . . $ `Descent3/Player.cpp:2008:9`!)
2191 Int3cxx . . $ `misc/pserror.h:247:9`!(); // Get Jason - a death was chosen that this ship doesn't support
2192
2193 Deathcxx . . $ Death.[slot].dying_modelcxx . . $ tDeathSeq#dying_model. = GetPolymodelPointercxx . . $ GetPolymodelPointer(ac85e77c73ebf794).(playerobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.);
2194 playerobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..subobj_flagscxx . . $ polyobj_info#subobj_flags. = 0xffffffff;
2195 }
2196
2197 // determine physics properties of death
2198 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(playerobj, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
2199 float rotate_adj = 0.0f;
2200
2201 if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_BREAKUPcxx . . $ `Descent3/Player.cpp:2008:9`!) {
2202 // a breakup typically means the ship starts to fall apart.
2203 Deathcxx . . $ Death.[slot].accel_modcxx . . $ tDeathSeq#accel_mod. = 1.0f;
2204 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. = (PF_FIXED_ROT_VELOCITYcxx . . $ `Descent3/object_external.h:325:9`!);
2205 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..dragcxx . . $ physics_info#drag. = .005f;
2206 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..masscxx . . $ physics_info#mass. = 3000.0f;
2207 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..coeff_restitutioncxx . . $ physics_info#coeff_restitution. = 0.3f;
2208 rotate_adj = 32768.0f;
2209 } else if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_D2STYLEcxx . . $ `Descent3/Player.cpp:2009:9`!) {
2210 Deathcxx . . $ Death.[slot].accel_modcxx . . $ tDeathSeq#accel_mod. = 0.960f;
2211 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..dragcxx . . $ physics_info#drag. = 50.0;
2212 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..masscxx . . $ physics_info#mass. = 3000.0f;
2213 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. = PF_FIXED_ROT_VELOCITYcxx . . $ `Descent3/object_external.h:325:9`!;
2214 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..coeff_restitutioncxx . . $ physics_info#coeff_restitution. = 0.3f;
2215 rotate_adj = 32768.0f;
2216 } else {
2217 // if we're falling or dying immediately, let gravity take control of the ship while it
2218 // deaccelerates.
2219 Deathcxx . . $ Death.[slot].accel_modcxx . . $ tDeathSeq#accel_mod. = 0.960f;
2220 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. = PF_GRAVITYcxx . . $ `Descent3/object_external.h:320:9`! | PF_FIXED_ROT_VELOCITYcxx . . $ `Descent3/object_external.h:325:9`!;
2221 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..num_bouncescxx . . $ physics_info#num_bounces. = 0;
2222 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..coeff_restitutioncxx . . $ physics_info#coeff_restitution. = .03f;
2223 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..masscxx . . $ physics_info#mass. = 2500.0f;
2224 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..dragcxx . . $ physics_info#drag. = 50.0f;
2225 rotate_adj = 32768.0f;
2226 }
2227
2228 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..xcxx . . $ vector#x. = (float)((rotate_adj));
2229 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..ycxx . . $ vector#y. = (float)((rotate_adj));
2230 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..zcxx . . $ vector#z. = (float)((rotate_adj));
2231
2232 // set times and other stuff for dying.
2233 if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_FALLcxx . . $ `Descent3/Player.cpp:2007:9`!)
2234 Deathcxx . . $ Death.[slot].max_time_dyingcxx . . $ tDeathSeq#max_time_dying. = 3.0f;
2235 else if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_INSTANTcxx . . $ `Descent3/Player.cpp:2006:9`!)
2236 Deathcxx . . $ Death.[slot].max_time_dyingcxx . . $ tDeathSeq#max_time_dying. = 2.5f;
2237 else if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_BREAKUPcxx . . $ `Descent3/Player.cpp:2008:9`!)
2238 Deathcxx . . $ Death.[slot].max_time_dyingcxx . . $ tDeathSeq#max_time_dying. = 4.0f;
2239 else if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_D2STYLEcxx . . $ `Descent3/Player.cpp:2009:9`!)
2240 Deathcxx . . $ Death.[slot].max_time_dyingcxx . . $ tDeathSeq#max_time_dying. = 2.0f;
2241
2242 Total_time_deadcxx . . $ Total_time_dead. = 0;
2243
2244 Deathcxx . . $ Death.[slot].initial_death_timecxx . . $ tDeathSeq#initial_death_time. = Gametimecxx . . $ Gametime.;
2245 Deathcxx . . $ Death.[slot].physics_frametimecxx . . $ tDeathSeq#physics_frametime. = Gametimecxx . . $ Gametime.;
2246 Deathcxx . . $ Death.[slot].fate_frametimecxx . . $ tDeathSeq#fate_frametime. = Gametimecxx . . $ Gametime.;
2247
2248 #ifndef RELEASE
2249 // debug_deathtype(slot, damage);
2250 #endif
2251 }
2252
2253 ///////////////////////////////////////////////////////////////////////////////
2254 // The Death sequencer.
2255
2256 void DoNewPlayerDeathFramecxx . . $ DoNewPlayerDeathFrame(d4f767463ce0a6b3).(int slot) {
2257 objectcxx . . $ object# *playerobj;
2258
2259 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
2260
2261 // Kevin added this in case the player dies and while dying stops recording a demo.
2262 // It's the cleanest solution I could find.
2263 if ((Player_numcxx . . $ Player_num. == slot) && (!Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera.))
2264 return;
2265
2266 // if (Player_num==slot)
2267 // ASSERT(Death[slot].camera);
2268
2269 playerobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
2270
2271 // determine current state of player object.
2272 Deathcxx . . $ Death.[slot].time_dyingcxx . . $ tDeathSeq#time_dying. = Gametimecxx . . $ Gametime. - Deathcxx . . $ Death.[slot].initial_death_timecxx . . $ tDeathSeq#initial_death_time.;
2273
2274 // Increase death time
2275 if (slot == Player_numcxx . . $ Player_num. && (Playerscxx . . $ Players.[slot].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!)) {
2276 // Total_time_dead+=Frametime;
2277 Total_time_deadcxx . . $ Total_time_dead. = Deathcxx . . $ Death.[slot].time_dyingcxx . . $ tDeathSeq#time_dying.;
2278 if (Total_time_deadcxx . . $ Total_time_dead. > DEATH_RESPAWN_TIMEcxx . . $ `Descent3/player.h:439:9`!) {
2279 AddPersistentHUDMessagecxx . . $ AddPersistentHUDMessage(2c96e75cbf2ca747).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(0, 255, 0), HUD_MSG_PERSISTENT_CENTERcxx . . $ `Descent3/hud.h:312:9`!, Game_window_ycxx . . $ Game_window_y. + Game_window_hcxx . . $ Game_window_h. - 20,
2280 HUD_MSG_PERSISTENT_INFINITEcxx . . $ `Descent3/hud.h:311:9`!, 0, SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!, TXT_SPACETOCONTcxx . . $ `Descent3/stringtable.h:196:9`!);
2281 }
2282 }
2283
2284 // depending on state of player ship, perform some operation
2285 if (Playerscxx . . $ Players.[playerobj->idcxx . . $ object#id.].flagscxx . . $ player#flags. & PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`!) {
2286 // modify player ship physics as needed.
2287 // player ship will fall to the ground and deaccelerate
2288 // modify physics properties every INTERVAL
2289 if ((Deathcxx . . $ Death.[slot].physics_frametimecxx . . $ tDeathSeq#physics_frametime. + DEATH_PHYS_INTERVALcxx . . $ `Descent3/Player.cpp:1999:9`!) > Gametimecxx . . $ Gametime.) {
2290 if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_FALLcxx . . $ `Descent3/Player.cpp:2007:9`!) {
2291 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..xcxx . . $ vector#x. /= 1.15f;
2292 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..ycxx . . $ vector#y. /= 1.1f;
2293 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..zcxx . . $ vector#z. /= 1.0f;
2294 } else if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_D2STYLEcxx . . $ `Descent3/Player.cpp:2009:9`!) {
2295 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..xcxx . . $ vector#x. /= 1.15f;
2296 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..ycxx . . $ vector#y. /= 1.0f;
2297 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..zcxx . . $ vector#z. /= 1.05f;
2298 } else {
2299 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..xcxx . . $ vector#x. /= 1.10f;
2300 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..ycxx . . $ vector#y. /= 1.05f;
2301 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..zcxx . . $ vector#z. /= 1.0f;
2302 }
2303
2304 playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity. *=cxx . . $ `operator*=`(f132838b2cd11d6). Deathcxx . . $ Death.[slot].accel_modcxx . . $ tDeathSeq#accel_mod.;
2305 Deathcxx . . $ Death.[slot].physics_frametimecxx . . $ tDeathSeq#physics_frametime. = Gametimecxx . . $ Gametime.;
2306 }
2307
2308 // move death camera if distance between death camera and player is less than a certain amount.
2309 if (slot == Player_numcxx . . $ Player_num. && Deathcxx . . $ Death.[slot].in_cockpitcxx . . $ tDeathSeq#in_cockpit.) {
2310 if (Deathcxx . . $ Death.[slot].time_dyingcxx . . $ tDeathSeq#time_dying. > DEATH_COCKPIT_TIMEcxx . . $ `Descent3/Player.cpp:2004:9`!) {
2311 Deathcxx . . $ Death.[slot].in_cockpitcxx . . $ tDeathSeq#in_cockpit. = false;
2312 SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).(HUD_LETTERBOXcxx . . $ HUD_LETTERBOX.);
2313 Viewer_objectcxx . . $ Viewer_object. = Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera.; // set the current viewer to be this new camera.
2314 }
2315 } else if (slot == Player_numcxx . . $ Player_num.) {
2316 vectorcxx . . $ vector# directional;
2317 float death_cam_dist = vm_VectorDistanceQuickcxx . . $ vm_VectorDistanceQuick(a0b9c8659ecc16b8).(&Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera.->poscxx . . $ object#pos., &playerobj->poscxx . . $ object#pos.);
2318
2319 if (death_cam_dist < MIN_DEATHCAM_DISTcxx . . $ `Descent3/Player.cpp:1995:9`!) {
2320 vm_MakeRandomVectorcxx . . $ vm_MakeRandomVector(ec8cf6451c36d470).(&directional);
2321 MoveDeathCamcxx . . $ MoveDeathCam(54709106d64c0257).(slot, &directional, MEDIAN_DEATHCAM_DISTcxx . . $ `Descent3/Player.cpp:1996:9`!);
2322 } else if (death_cam_dist > MAX_DEATHCAM_DISTcxx . . $ `Descent3/Player.cpp:1997:9`!) {
2323 vm_MakeRandomVectorcxx . . $ vm_MakeRandomVector(ec8cf6451c36d470).(&directional);
2324 MoveDeathCamcxx . . $ MoveDeathCam(54709106d64c0257).(slot, &directional, MEDIAN_DEATHCAM_DISTcxx . . $ `Descent3/Player.cpp:1996:9`!);
2325 }
2326
2327 // check to see if the vector from death cam to player is obstructed by something.
2328 fvi_infocxx . . $ fvi_info# hit_data;
2329 fvi_querycxx . . $ fvi_query# fq;
2330
2331 hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] = (OBJECT_OUTSIDEcxx . . $ `lib/object_external_struct.h:130:9`!(playerobj) ? HIT_TERRAINcxx . . $ `lib/findintersection_external.h:48:9`! : HIT_WALLcxx . . $ `lib/findintersection_external.h:46:9`!);
2332 fq.p1cxx . . $ fvi_query#p1. = &playerobj->poscxx . . $ object#pos.;
2333 fq.p0cxx . . $ fvi_query#p0. = &Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera.->poscxx . . $ object#pos.;
2334 fq.startroomcxx . . $ fvi_query#startroom. = Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera.->roomnumcxx . . $ object#roomnum.;
2335 fq.radcxx . . $ fvi_query#rad. = .5;
2336 fq.thisobjnumcxx . . $ fvi_query#thisobjnum. = OBJNUMcxx . . $ `Descent3/object.h:700:9`!(Death[slot].camera);
2337 fq.ignore_obj_listcxx . . $ fvi_query#ignore_obj_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2338 fq.flagscxx . . $ fvi_query#flags. = 0;
2339 fvi_FindIntersectioncxx . . $ fvi_FindIntersection(e1c4d7bd350effc8).(&fq, &hit_data);
2340
2341 if (hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] == HIT_WALLcxx . . $ `lib/findintersection_external.h:46:9`!) {
2342 // death camera's view is obstructed, move the death cam
2343 // mprintf(0, "Death cam view obstructed, changing view...\n");
2344 vm_MakeRandomVectorcxx . . $ vm_MakeRandomVector(ec8cf6451c36d470).(&directional);
2345 MoveDeathCamcxx . . $ MoveDeathCam(54709106d64c0257).(slot, &directional, MEDIAN_DEATHCAM_DISTcxx . . $ `Descent3/Player.cpp:1996:9`!);
2346 }
2347
2348 // orient death camera towards player ship
2349 directional =cxx . . $ vector#`operator=`(c0842353a20857d). playerobj->poscxx . . $ object#pos. -cxx . . $ operator-(b77b703cd1e43e33). Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera.->poscxx . . $ object#pos.;
2350 if (vm_GetMagnitudeFastcxx . . $ vm_GetMagnitudeFast(4939a7e530383cd4).(&directional) == 0.0f)
2351 directional.xcxx . . $ vector#x. += 1.0f;
2352 vm_VectorToMatrixcxx . . $ vm_VectorToMatrix(543233b88555916d).(&Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera.->orientcxx . . $ object#orient., &directional, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2353 }
2354
2355 // perform fate specific actions here
2356 if (Deathcxx . . $ Death.[slot].time_dyingcxx . . $ tDeathSeq#time_dying. >= Deathcxx . . $ Death.[slot].max_time_dyingcxx . . $ tDeathSeq#max_time_dying.) {
2357 PlayerShipExplodecxx . . $ PlayerShipExplode(4ebbd0c3cbf1b78a).(playerobj, 40.0f);
2358 Playerscxx . . $ Players.[playerobj->idcxx . . $ object#id.].flagscxx . . $ player#flags. |= PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!;
2359 Playerscxx . . $ Players.[playerobj->idcxx . . $ object#id.].flagscxx . . $ player#flags. &= ~PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`!;
2360 }
2361 // fate action occurs every fate interval.
2362 else if ((Deathcxx . . $ Death.[slot].fate_frametimecxx . . $ tDeathSeq#fate_frametime. + DEATH_FATE_INTERVALcxx . . $ `Descent3/Player.cpp:2000:9`!) > Gametimecxx . . $ Gametime.) {
2363 if (Deathcxx . . $ Death.[slot].fatecxx . . $ tDeathSeq#fate. == DEATH_BREAKUPcxx . . $ `Descent3/Player.cpp:2008:9`!) {
2364 if (ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 8) {
2365 // break up a piece of the ship
2366 if (Deathcxx . . $ Death.[slot].breakup_countcxx . . $ tDeathSeq#breakup_count. == 2) {
2367 Deathcxx . . $ Death.[slot].time_dyingcxx . . $ tDeathSeq#time_dying. = Deathcxx . . $ Death.[slot].max_time_dyingcxx . . $ tDeathSeq#max_time_dying.;
2368 } else {
2369 PlayerShipBreakupcxx . . $ PlayerShipBreakup(4ebbd0c3cbf1b78a).(playerobj, 20.0f + (ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 10));
2370 Deathcxx . . $ Death.[slot].breakup_countcxx . . $ tDeathSeq#breakup_count.++;
2371 // mprintf(0, "Breakup!\n");
2372 }
2373 }
2374 }
2375 Deathcxx . . $ Death.[slot].fate_frametimecxx . . $ tDeathSeq#fate_frametime. = Gametimecxx . . $ Gametime.;
2376 }
2377
2378 // do smoke trails and special visual effects.
2379 if ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 6) == 0) {
2380 // smoke
2381 int visnum;
2382 vectorcxx . . $ vector# smoke_pt;
2383 smoke_pt =cxx . . $ vector#`operator=`(c0842353a20857d). (-cxx . . $ operator-(9e07539e219c6f20).playerobj->orientcxx . . $ object#orient..fveccxx . . $ matrix#fvec.) *cxx . . $ `operator*`(252247219a31502c). (playerobj->sizecxx . . $ object#size. * 0.5f);
2384 smoke_pt =cxx . . $ vector#`operator=`(c0842353a20857d). playerobj->poscxx . . $ object#pos. +cxx . . $ operator+(b77b703cd1e43e33). smoke_pt;
2385 visnum = CreateFireballcxx . . $ CreateFireball(2a769cac3223e33b).(&smoke_pt, BLACK_SMOKE_INDEXcxx . . $ `Descent3/fireball_external.h:30:9`!, playerobj->roomnumcxx . . $ object#roomnum., VISUAL_FIREBALLcxx . . $ `Descent3/fireball.h:165:9`!);
2386 if (visnum >= 0)
2387 VisEffectscxx . . $ VisEffects.[visnum].sizecxx . . $ vis_effect#size. = 1.0 + ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 3) / 3.0); // Make small!
2388 }
2389
2390 // Create an explosion that follows every now and then
2391 if ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 5) == 0) {
2392
2393 vectorcxx . . $ vector# dest;
2394 poly_modelcxx . . $ poly_model# *pm = Deathcxx . . $ Death.[slot].dying_modelcxx . . $ tDeathSeq#dying_model.;
2395 bsp_infocxx . . $ bsp_info# *sm = &pm->submodelcxx . . $ poly_model#submodel.[0];
2396 int vertnum = ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % sm->nvertscxx . . $ bsp_info#nverts.;
2397
2398 GetPolyModelPointInWorldcxx . . $ GetPolyModelPointInWorld(89309ad7c08ec4a9).(&dest, pm, &playerobj->poscxx . . $ object#pos., &playerobj->orientcxx . . $ object#orient., 0, &sm->vertscxx . . $ bsp_info#verts.[vertnum]);
2399 int visnum = CreateFireballcxx . . $ CreateFireball(2a769cac3223e33b).(&dest, GetRandomSmallExplosioncxx . . $ GetRandomSmallExplosion(b126dc7c1de90089).(), playerobj->roomnumcxx . . $ object#roomnum., VISUAL_FIREBALLcxx . . $ `Descent3/fireball.h:165:9`!);
2400
2401 if (visnum >= 0) { // DAJ added to pervent -1 array index
2402 VisEffectscxx . . $ VisEffects.[visnum].sizecxx . . $ vis_effect#size. += ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 20) / 20.0) * 3.0;
2403
2404 if ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 2)) {
2405 VisEffectscxx . . $ VisEffects.[visnum].movement_typecxx . . $ vis_effect#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
2406 VisEffectscxx . . $ VisEffects.[visnum].velocitycxx . . $ vis_effect#velocity. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity.;
2407 VisEffectscxx . . $ VisEffects.[visnum].masscxx . . $ vis_effect#mass. = playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..masscxx . . $ physics_info#mass.;
2408 VisEffectscxx . . $ VisEffects.[visnum].dragcxx . . $ vis_effect#drag. = playerobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..dragcxx . . $ physics_info#drag.;
2409 }
2410 }
2411 }
2412 }
2413
2414 // mprintf(0,"Playerobj size=%f\n",playerobj->size);
2415 }
2416
2417 #define TARGET_DEGREEcxx . . $ `Descent3/Player.cpp:2417:9`! (170 / 2)
2418 #define FOV_CHANGE_TIMEcxx . . $ `Descent3/Player.cpp:2418:9`! .7f
2419
2420 // Alters the field of view over a period of time
2421 void DoFOVEventcxx . . $ DoFOVEvent(6ca3d68f5c5f0975).(int eventnum, void *data) {
2422 float *val = (float *)data;
2423 float new_time = *val;
2424 float norm = new_time / FOV_CHANGE_TIMEcxx . . $ `Descent3/Player.cpp:2418:9`!;
2425
2426 new_time -= Frametimecxx . . $ Frametime.;
2427
2428 if (new_time < 0) {
2429 Render_zoomcxx . . $ Render_zoom. = D3_DEFAULT_ZOOMcxx . . $ `Descent3/descent.h:178:9`!;
2430 } else {
2431
2432 float num = (Render_FOVcxx . . $ Render_FOV. / 2) + (norm * (TARGET_DEGREEcxx . . $ `Descent3/Player.cpp:2417:9`! - (Render_FOVcxx . . $ Render_FOV. / 2)));
2433 num = (3.14 * (float)num / 180.0);
2434 Render_zoomcxx . . $ Render_zoom. = tancxx . . $ tan(fbcf3211dfe1bfd1).(num);
2435 CreateNewEventcxx . . $ CreateNewEvent(85af21da76cb0316).(OBJECT_EVENTcxx . . $ `Descent3/gameevent.h:28:9`!, FOV_CHANGE_EVENTcxx . . $ `Descent3/gameevent.h:37:9`!, 0, &new_time, sizeof(float), DoFOVEventcxx . . $ DoFOVEvent(6ca3d68f5c5f0975).);
2436 }
2437 }
2438
2439 // forces an end to the player death sequence
2440 void EndPlayerDeathcxx . . $ EndPlayerDeath(d4f767463ce0a6b3).(int slot) {
2441 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
2442 objectcxx . . $ object# *playerobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
2443
2444 if (slot == Player_numcxx . . $ Player_num.) {
2445 if (Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera.) {
2446 ObjDeletecxx . . $ ObjDelete(d4f767463ce0a6b3).(OBJNUMcxx . . $ `Descent3/object.h:700:9`!(Death[slot].camera));
2447 Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2448 Viewer_objectcxx . . $ Viewer_object. = Deathcxx . . $ Death.[slot].oldviewercxx . . $ tDeathSeq#oldviewer.;
2449 }
2450 SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).(Deathcxx . . $ Death.[slot].saved_cockpitcxx . . $ tDeathSeq#saved_cockpit.);
2451 ResetPersistentHUDMessagecxx . . $ ResetPersistentHUDMessage(49f6e7a06ebc5aa8).();
2452 }
2453
2454 if (!(Playerscxx . . $ Players.[playerobj->idcxx . . $ object#id.].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!))
2455 PlayerShipExplodecxx . . $ PlayerShipExplode(4ebbd0c3cbf1b78a).(playerobj, 50.0f);
2456
2457 // Stop sounds for this player
2458 PlayerStopSoundscxx . . $ PlayerStopSounds(d4f767463ce0a6b3).(slot);
2459
2460 // Get rid of explosions, weapons etc. that are still alive
2461 if (!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!))
2462 ClearTransientObjectscxx . . $ ClearTransientObjects(d4f767463ce0a6b3).(0);
2463
2464 // Reset the player object
2465 InitPlayerNewShipcxx . . $ InitPlayerNewShip(3e454b8ccf442868).(slot, INVRESET_DEATHSPEWcxx . . $ `Descent3/Inventory.h:203:9`!);
2466 ResetPlayerObjectcxx . . $ ResetPlayerObject(918ebd27a9ddbad3).(slot);
2467
2468 // Do the zoom-in effect and set him for invulernable in single player
2469 if (slot == Player_numcxx . . $ Player_num.) {
2470 float val = FOV_CHANGE_TIMEcxx . . $ `Descent3/Player.cpp:2418:9`!;
2471 float *valp = &val;
2472 DoFOVEventcxx . . $ DoFOVEvent(6ca3d68f5c5f0975).(-1, (void *)valp);
2473
2474 if (!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) {
2475 MakePlayerInvulnerablecxx . . $ MakePlayerInvulnerable(a421cb528a2d8d2f).(slot, 2.0);
2476 }
2477 }
2478
2479 // call osiris level event
2480 tOSIRISEventInfocxx . . $ tOSIRISEventInfo# evt;
2481 evt.evt_player_respawncxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_player_respawn..it_handlecxx . . $ tOSIRISEVTPLAYERRESPAWN#it_handle. = Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.].handlecxx . . $ object#handle.;
2482 Osiris_CallLevelEventcxx . . $ Osiris_CallLevelEvent(a880c8b99cdc05b4).(EVT_PLAYER_RESPAWNcxx . . $ `scripts/osiris_common.h:399:9`!, &evt);
2483 }
2484
2485 void MovePlayerToWaypointcxx . . $ MovePlayerToWaypoint(419c470199a90a97).(objectcxx . . $ object# *objp);
2486
2487 void ResetPlayerObjectcxx . . $ ResetPlayerObject(918ebd27a9ddbad3).(int slot, bool f_reset_pos) {
2488 // Init physics
2489 objectcxx . . $ object# *playobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
2490 shipcxx . . $ ship# *ship = &Shipscxx . . $ Ships.[Playerscxx . . $ Players.[slot].ship_indexcxx . . $ player#ship_index.];
2491
2492 playobj->shieldscxx . . $ object#shields. = INITIAL_SHIELDScxx . . $ `Descent3/player_external.h:69:9`!;
2493 Playerscxx . . $ Players.[slot].energycxx . . $ player#energy. = INITIAL_ENERGYcxx . . $ `Descent3/player_external.h:68:9`!;
2494 playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info. =cxx . . $ physics_info#`operator=`(fa4a94890b261b64). Shipscxx . . $ Ships.[Playerscxx . . $ Players.[slot].ship_indexcxx . . $ player#ship_index.].phys_infocxx . . $ ship#phys_info.;
2495 Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.].effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. = EF_VOLUME_LITcxx . . $ `Descent3/object_external.h:201:9`!;
2496
2497 if (playobj->effect_infocxx . . $ object#effect_info.->sound_handlecxx . . $ effect_info_s#sound_handle. != SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!) {
2498 Sound_systemcxx . . $ Sound_system..StopSoundLoopingcxx . . $ hlsSystem#StopSoundLooping(d4f767463ce0a6b3).(playobj->effect_infocxx . . $ object#effect_info.->sound_handlecxx . . $ effect_info_s#sound_handle.);
2499 playobj->effect_infocxx . . $ object#effect_info.->sound_handlecxx . . $ effect_info_s#sound_handle. = SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!;
2500 }
2501
2502 if (f_reset_pos) {
2503 if ((Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) && !(Netgamecxx . . $ Netgame..flagscxx . . $ netgame_info#flags. & NF_RESPAWN_WAYPOINTcxx . . $ `Descent3/multi_external.h:240:9`!)) {
2504 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(playobj, &Playerscxx . . $ Players.[slot].start_poscxx . . $ player#start_pos., Playerscxx . . $ Players.[slot].start_roomnumcxx . . $ player#start_roomnum., &Playerscxx . . $ Players.[slot].start_orientcxx . . $ player#start_orient., false);
2505 } else {
2506 MovePlayerToWaypointcxx . . $ MovePlayerToWaypoint(419c470199a90a97).(playobj);
2507 }
2508 }
2509
2510 playobj->render_typecxx . . $ object#render_type. = RT_POLYOBJcxx . . $ `Descent3/object_external.h:258:9`!;
2511 playobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num. = ship->model_handlecxx . . $ ship#model_handle.;
2512 playobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..dying_model_numcxx . . $ polyobj_info#dying_model_num. = ship->dying_model_handlecxx . . $ ship#dying_model_handle.;
2513 playobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..tmap_overridecxx . . $ polyobj_info#tmap_override. = -1;
2514 playobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..subobj_flagscxx . . $ polyobj_info#subobj_flags. = 0xFFFFFFFF;
2515 playobj->lighting_render_typecxx . . $ object#lighting_render_type. = LRT_GOURAUDcxx . . $ `Descent3/object.h:650:9`!;
2516 playobj->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
2517 playobj->flagscxx . . $ object#flags. = (OF_POLYGON_OBJECTcxx . . $ `Descent3/object_external.h:281:9`! | OF_DESTROYABLEcxx . . $ `Descent3/object_external.h:279:9`!);
2518
2519 if (Demo_flagscxx . . $ Demo_flags. == DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!) {
2520 playobj->flagscxx . . $ object#flags. |= OF_SERVER_OBJECTcxx . . $ `Descent3/object_external.h:291:9`!;
2521 }
2522
2523 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
2524 if (Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_CLIENTcxx . . $ `Descent3/multi_external.h:128:9`!) {
2525 playobj->flagscxx . . $ object#flags. |= OF_SERVER_OBJECTcxx . . $ `Descent3/object_external.h:291:9`!;
2526 } else
2527 playobj->flagscxx . . $ object#flags. |= OF_CLIENT_KNOWScxx . . $ `Descent3/object_external.h:289:9`!;
2528 }
2529
2530 playobj->sizecxx . . $ object#size. = Poly_modelscxx . . $ Poly_models.[playobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.].radcxx . . $ poly_model#rad.;
2531
2532 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity.);
2533 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..thrustcxx . . $ physics_info#thrust.);
2534 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel.);
2535 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotthrustcxx . . $ physics_info#$anonymous_type_2#rotthrust.);
2536
2537 playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..turnrollcxx . . $ physics_info#turnroll. = 0;
2538
2539 if (slot == Player_numcxx . . $ Player_num.) {
2540 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(playobj, CT_FLYINGcxx . . $ `Descent3/object_external.h:219:9`!);
2541 playobj->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
2542 } else {
2543 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(playobj, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
2544 playobj->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
2545 playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. = PF_FIXED_VELOCITYcxx . . $ `Descent3/object_external.h:324:9`!;
2546 }
2547
2548 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
2549 MultiMakePlayerRealcxx . . $ MultiMakePlayerReal(d4f767463ce0a6b3).(slot);
2550 if (Netgamecxx . . $ Netgame..flagscxx . . $ netgame_info#flags. & NF_PERMISSABLEcxx . . $ `Descent3/multi_external.h:239:9`!)
2551 playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. &= ~PF_WIGGLEcxx . . $ `Descent3/object_external.h:316:9`!;
2552 }
2553
2554 if (slot == Player_numcxx . . $ Player_num.) {
2555 Viewer_objectcxx . . $ Viewer_object. = Player_objectcxx . . $ Player_object. = playobj;
2556 }
2557
2558 // Reset quad firing mask
2559 objectcxx . . $ object# *objp = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
2560 for (int weapon_battery = 0; weapon_battery < MAX_WBS_PER_OBJcxx . . $ `lib/robotfirestruct.h:32:9`!; weapon_battery++) {
2561 objp->dynamic_wbcxx . . $ object#dynamic_wb.[weapon_battery].flagscxx . . $ dynamic_wb_info#flags. &= ~DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!;
2562 }
2563
2564 // Give the player a GuideBot if he doesn't have one and if the GB isn't out there
2565 if ((!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) && (Demo_flagscxx . . $ Demo_flags. != DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!)) {
2566 // The first if is to prevent a tough demo playback bug where
2567 // the game would crash *after* the demo is done playing back.
2568 if (ObjGetcxx . . $ ObjGet(11672e354c0b263a).(Buddy_handlecxx . . $ Buddy_handle.[slot]))
2569 if ((!Playerscxx . . $ Players.[slot].inventorycxx . . $ player#inventory..CheckItemcxx . . $ Inventory#CheckItem(cf9ef193275fa6d8).(OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!, ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`!)) &&
2570 (ObjGetcxx . . $ ObjGet(11672e354c0b263a).(Buddy_handlecxx . . $ Buddy_handle.[slot])->typecxx . . $ object#type. != OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!))
2571 Playerscxx . . $ Players.[slot].inventorycxx . . $ player#inventory..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!, ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`!);
2572 }
2573
2574 // reinit the reticle
2575 ResetReticlecxx . . $ ResetReticle(49f6e7a06ebc5aa8).();
2576 }
2577
2578 // Resets a player's control type back to it's default setting
2579 void ResetPlayerControlTypecxx . . $ ResetPlayerControlType(d4f767463ce0a6b3).(int slot) {
2580 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
2581
2582 // Init physics
2583 objectcxx . . $ object# *playobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
2584 shipcxx . . $ ship# *ship = &Shipscxx . . $ Ships.[Playerscxx . . $ Players.[slot].ship_indexcxx . . $ player#ship_index.];
2585
2586 playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info. =cxx . . $ physics_info#`operator=`(fa4a94890b261b64). Shipscxx . . $ Ships.[Playerscxx . . $ Players.[slot].ship_indexcxx . . $ player#ship_index.].phys_infocxx . . $ ship#phys_info.;
2587
2588 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity.);
2589 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..thrustcxx . . $ physics_info#thrust.);
2590 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel.);
2591 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotthrustcxx . . $ physics_info#$anonymous_type_2#rotthrust.);
2592
2593 playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..turnrollcxx . . $ physics_info#turnroll. = 0;
2594
2595 if (slot == Player_numcxx . . $ Player_num.) {
2596 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(playobj, CT_FLYINGcxx . . $ `Descent3/object_external.h:219:9`!);
2597 playobj->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
2598 } else {
2599 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(playobj, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
2600 playobj->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
2601 playobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. = PF_FIXED_VELOCITYcxx . . $ `Descent3/object_external.h:324:9`!;
2602 }
2603 }
2604
2605 // Makes the player into an AI controlled physics object
2606 void PlayerSetControlToAIcxx . . $ PlayerSetControlToAI(43c79ee2f1b9aefe).(int slot, float velocity) {
2607 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
2608 if (slot < 0 || slot >= MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!)
2609 return;
2610
2611 objectcxx . . $ object# *pobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
2612
2613 // Turn off some player physics stuff
2614 pobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. &= ~PF_USES_THRUSTcxx . . $ `Descent3/object_external.h:319:9`!;
2615 pobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..dragcxx . . $ physics_info#drag. = .1f;
2616 pobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. &= ~PF_LEVELINGcxx . . $ `Descent3/object_external.h:314:9`!;
2617
2618 // pobj->flags &= ~OF_DESTROYABLE;
2619 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&pobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..thrustcxx . . $ physics_info#thrust.);
2620 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&pobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotthrustcxx . . $ physics_info#$anonymous_type_2#rotthrust.);
2621 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&pobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel.);
2622 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&pobj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity.);
2623
2624 // Put the player in AI mode
2625 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(pobj, CT_AIcxx . . $ `Descent3/object_external.h:217:9`!);
2626
2627 memset(pobj->ai_infocxx . . $ object#ai_info., 0, sizeof(ai_framecxx . . $ ai_frame#));
2628
2629 pobj->ai_infocxx . . $ object#ai_info.->ai_classcxx . . $ ai_frame#ai_class. = AIC_STATICcxx . . $ `Descent3/aistruct.h:440:9`!;
2630 pobj->ai_infocxx . . $ object#ai_info.->ai_typecxx . . $ ai_frame#ai_type. = AIT_AIScxx . . $ `Descent3/aistruct_external.h:79:9`!;
2631
2632 GoalInitTypeGoalscxx . . $ GoalInitTypeGoals(766a1b7183ffa4b4).(pobj, AIT_AIScxx . . $ `Descent3/aistruct_external.h:79:9`!);
2633
2634 pobj->ai_infocxx . . $ object#ai_info.->flagscxx . . $ ai_frame#flags. = AIF_PERSISTANTcxx . . $ `Descent3/aistruct_external.h:354:9`! | AIF_DISABLE_FIRINGcxx . . $ `Descent3/aistruct_external.h:374:9`! | AIF_DISABLE_MELEEcxx . . $ `Descent3/aistruct_external.h:375:9`! | AIF_ORIENT_TO_VELcxx . . $ `Descent3/aistruct_external.h:370:9`!;
2635 pobj->ai_infocxx . . $ object#ai_info.->max_velocitycxx . . $ ai_frame#max_velocity. = velocity;
2636 pobj->ai_infocxx . . $ object#ai_info.->max_delta_velocitycxx . . $ ai_frame#max_delta_velocity. = 40.0f;
2637 pobj->ai_infocxx . . $ object#ai_info.->max_turn_ratecxx . . $ ai_frame#max_turn_rate. = 14000;
2638 pobj->ai_infocxx . . $ object#ai_info.->awarenesscxx . . $ ai_frame#awareness. = AWARE_MOSTLYcxx . . $ `Descent3/aistruct_external.h:324:9`!;
2639 pobj->ai_infocxx . . $ object#ai_info.->movement_typecxx . . $ ai_frame#movement_type. = MC_FLYINGcxx . . $ `Descent3/object_external.h:246:9`!;
2640 pobj->ai_infocxx . . $ object#ai_info.->next_movementcxx . . $ ai_frame#next_movement. = AI_INVALID_INDEXcxx . . $ `Descent3/aistruct.h:404:9`!;
2641 pobj->ai_infocxx . . $ object#ai_info.->anim_sound_handlecxx . . $ ai_frame#anim_sound_handle. = 0;
2642 pobj->ai_infocxx . . $ object#ai_info.->status_regcxx . . $ ai_frame#status_reg. = 0;
2643 pobj->ai_infocxx . . $ object#ai_info.->last_played_sound_indexcxx . . $ ai_frame#last_played_sound_index. = -1;
2644 pobj->ai_infocxx . . $ object#ai_info.->weapon_speedcxx . . $ ai_frame#weapon_speed. = 0.0f;
2645 pobj->ai_infocxx . . $ object#ai_info.->animation_typecxx . . $ ai_frame#animation_type. = AS_ALERTcxx . . $ `Descent3/aistruct_external.h:409:9`!;
2646 pobj->ai_infocxx . . $ object#ai_info.->next_melee_timecxx . . $ ai_frame#next_melee_time. = Gametimecxx . . $ Gametime.;
2647 pobj->ai_infocxx . . $ object#ai_info.->next_flinch_timecxx . . $ ai_frame#next_flinch_time. = Gametimecxx . . $ Gametime.;
2648 pobj->ai_infocxx . . $ object#ai_info.->target_handlecxx . . $ ai_frame#target_handle. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!;
2649 pobj->ai_infocxx . . $ object#ai_info.->next_check_see_target_timecxx . . $ ai_frame#next_check_see_target_time. = Gametimecxx . . $ Gametime.;
2650 pobj->ai_infocxx . . $ object#ai_info.->last_see_target_timecxx . . $ ai_frame#last_see_target_time. = Gametimecxx . . $ Gametime.;
2651 pobj->ai_infocxx . . $ object#ai_info.->last_render_timecxx . . $ ai_frame#last_render_time. = -1.0f;
2652 pobj->ai_infocxx . . $ object#ai_info.->next_target_update_timecxx . . $ ai_frame#next_target_update_time. = Gametimecxx . . $ Gametime.;
2653 pobj->ai_infocxx . . $ object#ai_info.->notify_flagscxx . . $ ai_frame#notify_flags. |= AI_NOTIFIES_ALWAYS_ONcxx . . $ `Descent3/aistruct_external.h:316:9`!;
2654 pobj->ai_infocxx . . $ object#ai_info.->last_see_target_poscxx . . $ ai_frame#last_see_target_pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). Zero_vectorcxx . . $ Zero_vector.;
2655 pobj->ai_infocxx . . $ object#ai_info.->dodge_vel_percentcxx . . $ ai_frame#dodge_vel_percent. = 1.0f;
2656 pobj->ai_infocxx . . $ object#ai_info.->attack_vel_percentcxx . . $ ai_frame#attack_vel_percent. = 1.0f;
2657 pobj->ai_infocxx . . $ object#ai_info.->fight_samecxx . . $ ai_frame#fight_same. = 0.0f;
2658 pobj->ai_infocxx . . $ object#ai_info.->agressioncxx . . $ ai_frame#agression. = 0.0f;
2659 pobj->ai_infocxx . . $ object#ai_info.->avoid_friends_distancecxx . . $ ai_frame#avoid_friends_distance. = 0.0f;
2660 pobj->ai_infocxx . . $ object#ai_info.->biased_flight_importancecxx . . $ ai_frame#biased_flight_importance. = 0.0f;
2661 pobj->ai_infocxx . . $ object#ai_info.->circle_distancecxx . . $ ai_frame#circle_distance. = 10.0f;
2662 pobj->ai_infocxx . . $ object#ai_info.->dodge_percentcxx . . $ ai_frame#dodge_percent. = 0.0f;
2663 pobj->ai_infocxx . . $ object#ai_info.->fight_teamcxx . . $ ai_frame#fight_team. = 0.0f;
2664
2665 AIPathInitPathcxx . . $ AIPathInitPath(211cadd9cc3984f1).(&pobj->ai_infocxx . . $ object#ai_info.->pathcxx . . $ ai_frame#path.);
2666 }
2667
2668 // Moves a player to a specified start position
2669 void PlayerMoveToStartPoscxx . . $ PlayerMoveToStartPos(3e454b8ccf442868).(int player_slot, int start_slot) {
2670 objectcxx . . $ object# *playobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[player_slot].objnumcxx . . $ player#objnum.];
2671
2672 if (start_slot >= 0) // Non autowaypoint
2673 {
2674 Playerscxx . . $ Players.[player_slot].current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. = -1;
2675 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(playobj, &Playerscxx . . $ Players.[start_slot].start_poscxx . . $ player#start_pos., Playerscxx . . $ Players.[start_slot].start_roomnumcxx . . $ player#start_roomnum.,
2676 &Playerscxx . . $ Players.[start_slot].start_orientcxx . . $ player#start_orient., true);
2677 } else {
2678 // Do autowaypoint stuff
2679 int waypointnum = (-start_slot) + 1;
2680 Playerscxx . . $ Players.[player_slot].current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. = waypointnum;
2681 MovePlayerToWaypointcxx . . $ MovePlayerToWaypoint(419c470199a90a97).(playobj);
2682 }
2683 }
2684
2685 // Force player to explode (this should be called to intercept the death sequencer's control of explosions
2686 void StartPlayerExplosioncxx . . $ StartPlayerExplosion(d4f767463ce0a6b3).(int slot) {
2687 Deathcxx . . $ Death.[slot].max_time_dyingcxx . . $ tDeathSeq#max_time_dying. = 0.0f;
2688
2689 if (Deathcxx . . $ Death.[slot].in_cockpitcxx . . $ tDeathSeq#in_cockpit.) {
2690 Deathcxx . . $ Death.[slot].in_cockpitcxx . . $ tDeathSeq#in_cockpit. = false;
2691 SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).(HUD_LETTERBOXcxx . . $ HUD_LETTERBOX.);
2692 Viewer_objectcxx . . $ Viewer_object. = Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera.; // set the current viewer to be this new camera.
2693 }
2694 }
2695
2696 // Detaches a subobject from the player ship
2697 void DeadPlayerShipHitcxx . . $ DeadPlayerShipHit(a35642c99d329708).(objectcxx . . $ object# *obj, int hit_room, vectorcxx . . $ vector# *hitpt, float magnitude) {
2698 fvi_infocxx . . $ fvi_info# hit_data;
2699 fvi_querycxx . . $ fvi_query# fq;
2700 vectorcxx . . $ vector# hitvec, hitpt2;
2701 int subobjnum = -1;
2702
2703 // vector from hitpoint to object center position
2704 hitvec =cxx . . $ vector#`operator=`(c0842353a20857d). obj->poscxx . . $ object#pos. -cxx . . $ operator-(b77b703cd1e43e33). (*hitpt);
2705 hitpt2 =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). *hitpt;
2706
2707 // get first subobject to be hit when looking for a hit subobject.
2708 hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] = HIT_SPHERE_2_POLY_OBJECTcxx . . $ `lib/findintersection_external.h:52:9`!;
2709
2710 while (hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] != HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`!) {
2711 fq.p0cxx . . $ fvi_query#p0. = &hitpt2;
2712 fq.p1cxx . . $ fvi_query#p1. = &obj->poscxx . . $ object#pos.;
2713 fq.startroomcxx . . $ fvi_query#startroom. = hit_room;
2714 fq.radcxx . . $ fvi_query#rad. = obj->sizecxx . . $ object#size.;
2715 fq.thisobjnumcxx . . $ fvi_query#thisobjnum. = obj - Objectscxx . . $ Objects.;
2716 fq.ignore_obj_listcxx . . $ fvi_query#ignore_obj_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2717 fq.flagscxx . . $ fvi_query#flags. = FQ_CHECK_OBJScxx . . $ `lib/findintersection_external.h:59:9`! | FQ_OBJ_BACKFACEcxx . . $ `lib/findintersection_external.h:60:9`! | FQ_ONLY_PLAYER_OBJcxx . . $ `lib/findintersection_external.h:69:9`!;
2718
2719 fvi_FindIntersectioncxx . . $ fvi_FindIntersection(e1c4d7bd350effc8).(&fq, &hit_data);
2720
2721 if (hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] == HIT_SPHERE_2_POLY_OBJECTcxx . . $ `lib/findintersection_external.h:52:9`!) {
2722 // we probably hit a subobject of the player object.
2723 // NOTE: we should check if the hit object is still the player object!
2724 subobjnum = hit_data.hit_subobjectcxx . . $ fvi_info#hit_subobject.[0];
2725 } else if (hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] != HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`!) {
2726 hitpt2 =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). hit_data.hit_pntcxx . . $ fvi_info#hit_pnt.;
2727 hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] = HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`!;
2728 }
2729 }
2730
2731 if (subobjnum > -1) {
2732 // we hit a subobject. new debris object, and delete this subobject from the player model. note that
2733 // we should must the suobject handle to the polymodel when we're done.
2734 PlayerShipSpewPartcxx . . $ PlayerShipSpewPart(dc43bf10ea54b482).(obj, subobjnum, magnitude);
2735 }
2736 }
2737
2738 // Spews a guidebot
2739 void PlayerSpewGuidebotcxx . . $ PlayerSpewGuidebot(a7790401ac9fc765).(objectcxx . . $ object# *parent, int type, int id) {
2740 int objnum;
2741 objectcxx . . $ object# *obj;
2742 int model_num = Object_infocxx . . $ Object_info.[ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`!].render_handlecxx . . $ object_info#render_handle.;
2743 float size;
2744
2745 if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(Ships[Players[parent->id].ship_index].name, "Black Pyro") == 0) {
2746 // Only spew red GB if merc is installed
2747 extern bool MercInstalledcxx . . $ MercInstalled(c9857a73d68e59ba).();
2748 if (MercInstalledcxx . . $ MercInstalled(c9857a73d68e59ba).())
2749 model_num = Object_infocxx . . $ Object_info.[ROBOT_GUIDEBOTREDcxx . . $ `Descent3/object_external.h:355:9`!].render_handlecxx . . $ object_info#render_handle.;
2750 }
2751
2752 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(model_num, OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!, &size);
2753
2754 objnum = ObjCreatecxx . . $ ObjCreate(849c3da80a4f387f).(OBJ_DEBRIScxx . . $ `Descent3/object_external.h:168:9`!, 0, parent->roomnumcxx . . $ object#roomnum., &parent->poscxx . . $ object#pos., &parent->orientcxx . . $ object#orient.);
2755
2756 if (objnum < 0 || objnum > Highest_object_indexcxx . . $ Highest_object_index.) {
2757 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "WARNING: No object slots. Dead GB not created!\n");
2758 return;
2759 }
2760
2761 obj = &Objectscxx . . $ Objects.[objnum];
2762
2763 // Set polygon-object-specific data
2764 obj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num. = model_num;
2765 obj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..subobj_flagscxx . . $ polyobj_info#subobj_flags. = 0xFFFFFFFF;
2766
2767 // Set physics data for this object
2768
2769 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity. =cxx . . $ vector#`operator=`(c0842353a20857d). parent->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity. +cxx . . $ operator+(b77b703cd1e43e33). parent->orientcxx . . $ object#orient..fveccxx . . $ matrix#fvec. *cxx . . $ `operator*`(252247219a31502c). 30.0;
2770
2771 vm_MakeZerocxx . . $ vm_MakeZero(ec8cf6451c36d470).(&obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotthrustcxx . . $ physics_info#$anonymous_type_2#rotthrust.);
2772
2773 obj->sizecxx . . $ object#size. = Object_infocxx . . $ Object_info.[ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`!].sizecxx . . $ object_info#size.;
2774 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..masscxx . . $ physics_info#mass. = 40.0;
2775 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..dragcxx . . $ physics_info#drag. = .001f;
2776
2777 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. = (PF_GRAVITYcxx . . $ `Descent3/object_external.h:320:9`! | PF_BOUNCEcxx . . $ `Descent3/object_external.h:315:9`! | PF_FIXED_ROT_VELOCITYcxx . . $ `Descent3/object_external.h:325:9`!);
2778 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..coeff_restitutioncxx . . $ physics_info#coeff_restitution. = .25f;
2779
2780 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..xcxx . . $ vector#x. = (float)((120000.0f * (float)(D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`! / 2 - ps_randcxx . . $ ps_rand(b126dc7c1de90089).())) / (float)(D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`! / 2));
2781 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..ycxx . . $ vector#y. = (float)((120000.0f * (float)(D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`! / 2 - ps_randcxx . . $ ps_rand(b126dc7c1de90089).())) / (float)(D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`! / 2));
2782 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..zcxx . . $ vector#z. = (float)((120000.0f * (float)(D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`! / 2 - ps_randcxx . . $ ps_rand(b126dc7c1de90089).())) / (float)(D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`! / 2));
2783
2784 obj->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..num_bouncescxx . . $ physics_info#num_bounces. = 5;
2785
2786 obj->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
2787
2788 ASSERTcxx . . $ `misc/pserror.h:246:9`!(obj != Player_object);
2789 obj->typecxx . . $ object#type. = OBJ_DEBRIScxx . . $ `Descent3/object_external.h:168:9`!;
2790 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(obj, CT_DEBRIScxx . . $ `Descent3/object_external.h:223:9`!); // become debris while exploding
2791 obj->lifeleftcxx . . $ object#lifeleft. = 5.0 + ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 50) * .05);
2792 obj->flagscxx . . $ object#flags. |= OF_USES_LIFELEFTcxx . . $ `Descent3/object_external.h:276:9`!;
2793 DemoWriteObjLifeLeftcxx . . $ DemoWriteObjLifeLeft(419c470199a90a97).(obj);
2794 }
2795
2796 // Spews an object in a random direction
2797 void PlayerSpewObjectcxx . . $ PlayerSpewObject(ffd507765906b057).(objectcxx . . $ object# *objp, int timed, int room, vectorcxx . . $ vector# *pos, matrixcxx . . $ matrix# *orient) {
2798 ASSERTcxx . . $ `misc/pserror.h:246:9`!((!(Game_mode & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) || (Netgame.local_role == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!));
2799
2800 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(objp, pos, room, orient, true);
2801
2802 // Set random velocity for powerups
2803 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity..xcxx . . $ vector#x. = ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() / (float)D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`!) - .5f) * 40.0; // +20 to -20
2804 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity..zcxx . . $ vector#z. = ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() / (float)D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`!) - .5f) * 40.0; // +20 to -20
2805 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..velocitycxx . . $ physics_info#velocity..ycxx . . $ vector#y. = ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() / (float)D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`!) - .5f) * 40.0; // +20 to -20
2806
2807 // Send object to other players
2808 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
2809 if (Netgamecxx . . $ Netgame..flagscxx . . $ netgame_info#flags. & NF_COOPcxx . . $ `Descent3/multi_external.h:244:9`!)
2810 timed = 0;
2811
2812 if (Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
2813 if (timed == 2) {
2814 objp->flagscxx . . $ object#flags. |= OF_USES_LIFELEFTcxx . . $ `Descent3/object_external.h:276:9`!;
2815 objp->lifeleftcxx . . $ object#lifeleft. = 20.0;
2816 } else if (timed == 1) {
2817 objp->flagscxx . . $ object#flags. |= OF_USES_LIFELEFTcxx . . $ `Descent3/object_external.h:276:9`!;
2818 objp->lifeleftcxx . . $ object#lifeleft. = 180.0;
2819 }
2820 DemoWriteObjLifeLeftcxx . . $ DemoWriteObjLifeLeft(419c470199a90a97).(objp);
2821 }
2822 }
2823 }
2824
2825 // Spews an object in a random direction
2826 // Returns the new object
2827 int PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(objectcxx . . $ object# *parent, int type, int id, int timed, void *sinfo) {
2828 if (id < 0) // Don't spew non-existant stuff
2829 return -1;
2830
2831 ASSERTcxx . . $ `misc/pserror.h:246:9`!((parent->type == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) || (parent->type == OBJ_GHOSTcxx . . $ `Descent3/object_external.h:172:9`!));
2832
2833 if (type == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!) {
2834 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
2835 if (Object_infocxx . . $ Object_info.[id].multi_allowedcxx . . $ object_info#multi_allowed. == 0)
2836 return -1;
2837 }
2838 }
2839 // A dead GB is spew'ed on player death (if he had one)
2840 if (type == OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`! && id == ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`!) {
2841 PlayerSpewGuidebotcxx . . $ PlayerSpewGuidebot(a7790401ac9fc765).(parent, type, id);
2842 return -1;
2843 }
2844
2845 int objnum = ObjCreatecxx . . $ ObjCreate(849c3da80a4f387f).(type, id, parent->roomnumcxx . . $ object#roomnum., &parent->poscxx . . $ object#pos., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, parent->handlecxx . . $ object#handle.);
2846
2847 if (objnum < 0) {
2848 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't spew object!\n");
2849 return -1;
2850 }
2851
2852 objectcxx . . $ object# *obj = &Objectscxx . . $ Objects.[objnum];
2853
2854 PlayerSpewObjectcxx . . $ PlayerSpewObject(ffd507765906b057).(obj, timed, parent->roomnumcxx . . $ object#roomnum., &parent->poscxx . . $ object#pos., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2855
2856 // Send object to other players
2857 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
2858 if (Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
2859 MultiSendObjectcxx . . $ MultiSendObject(d7354c60e612ede5).(obj, 0);
2860 }
2861 }
2862
2863 // Setup the script used for this object
2864 InitObjectScriptscxx . . $ InitObjectScripts(674fac047436fc5b).(obj);
2865
2866 return objnum;
2867 }
2868
2869 // TEMP: this should be in a header file
2870 #define FIRST_SECONDARY_WEAPONcxx . . $ `Descent3/Player.cpp:2870:9`! MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!
2871
2872 // How many at most to spew of each secondary weapon
2873 #define MAX_SECONDARY_SPEWcxx . . $ `Descent3/Player.cpp:2873:9`! 3
2874
2875 // This is a terrible hack -- it maps powerup to multi-pack versions
2876 // This mapping should really be on the powerup page
2877 const char *powerup_multipackscxx . . $ powerup_multipacks.[] = {"Concussion", "4packConc", "Frag", "4packFrag",
2878 "Guided", "4packGuided", "Homing", "4packHoming"};
2879 #define N_POWERUP_MULTIPACKScxx . . $ `Descent3/Player.cpp:2879:9`! (sizeof(powerup_multipacks) / sizeof(*powerup_multipacks) / 2)
2880
2881 // Returns the index of the multipack version of the specified powerup, or -1 if none
2882 int FindMultipackPowerupcxx . . $ FindMultipackPowerup(7864480464b09eea).(int single_index) {
2883 for (int i = 0; i < N_POWERUP_MULTIPACKScxx . . $ `Descent3/Player.cpp:2879:9`!; i++) {
2884 if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(Object_info[single_index].name, powerup_multipacks[i * 2]) == 0)
2885 return FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).(powerup_multipackscxx . . $ powerup_multipacks.[i * 2 + 1]);
2886 }
2887
2888 return -1;
2889 }
2890
2891 // Spews the inventory of the passed in player object
2892 void PlayerSpewInventorycxx . . $ PlayerSpewInventory(80a724877f6428f2).(objectcxx . . $ object# *obj, bool spew_energy_and_shield, bool spew_nonspewable) {
2893 ASSERTcxx . . $ `misc/pserror.h:246:9`!(obj->type == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`! || obj->type == OBJ_GHOSTcxx . . $ `Descent3/object_external.h:172:9`! || obj->type == OBJ_OBSERVERcxx . . $ `Descent3/object_external.h:182:9`!);
2894 int slot = obj->idcxx . . $ object#id.;
2895 int id, type;
2896 playercxx . . $ player# *playp = &Playerscxx . . $ Players.[slot];
2897
2898 if (slot == Player_numcxx . . $ Player_num. || (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`! && Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!)) {
2899 // turn off quad firing flag (becuase they will be spewing quad fire here
2900 for (int weapon_battery = 0; weapon_battery < MAX_WBS_PER_OBJcxx . . $ `lib/robotfirestruct.h:32:9`!; weapon_battery++) {
2901 obj->dynamic_wbcxx . . $ object#dynamic_wb.[weapon_battery].flagscxx . . $ dynamic_wb_info#flags. &= ~DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!;
2902 }
2903 }
2904
2905 if (obj->typecxx . . $ object#type. == OBJ_OBSERVERcxx . . $ `Descent3/object_external.h:182:9`!)
2906 return; // don't do anything if observer
2907
2908 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
2909 if (Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. != LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
2910 playp->inventorycxx . . $ player#inventory..Resetcxx . . $ Inventory#Reset(b994e01f1c45a386).(true, (spew_nonspewable) ? INVRESET_ALLcxx . . $ `Descent3/Inventory.h:201:9`! : INVRESET_DEATHSPEWcxx . . $ `Descent3/Inventory.h:203:9`!);
2911 playp->counter_measurescxx . . $ player#counter_measures..Resetcxx . . $ Inventory#Reset(b994e01f1c45a386).(true, (spew_nonspewable) ? INVRESET_ALLcxx . . $ `Descent3/Inventory.h:201:9`! : INVRESET_DEATHSPEWcxx . . $ `Descent3/Inventory.h:203:9`!);
2912 return;
2913 }
2914 }
2915
2916 // spew a shield and energy
2917 if (spew_energy_and_shield) {
2918 id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Shield");
2919 if (id >= 0)
2920 PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, id, 1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2921
2922 id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Energy");
2923 if (id >= 0)
2924 PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, id, 1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2925 }
2926
2927 // Spew the primary weapon powerups
2928 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
2929 if (playp->weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!].indexcxx . . $ player_weapon#index. > 0) {
2930 id = Shipscxx . . $ Ships.[playp->ship_indexcxx . . $ player#ship_index.].spew_powerupcxx . . $ ship#spew_powerup.[playp->weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!].indexcxx . . $ player_weapon#index.];
2931 if (id != -1) {
2932 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Object_info[id].type == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!);
2933 PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, id, 2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2934 }
2935 }
2936
2937 // Spew the secondary weapon powerups
2938 id = Shipscxx . . $ Ships.[playp->ship_indexcxx . . $ player#ship_index.].spew_powerupcxx . . $ ship#spew_powerup.[playp->weaponcxx . . $ player#weapon.[PW_SECONDARYcxx . . $ `Descent3/player_external.h:109:9`!].indexcxx . . $ player_weapon#index.];
2939 if (id != -1) {
2940 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Object_info[id].type == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!);
2941 int count = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).<int>(playp->weapon_ammocxx . . $ player#weapon_ammo.[playp->weaponcxx . . $ player#weapon.[PW_SECONDARYcxx . . $ `Descent3/player_external.h:109:9`!].indexcxx . . $ player_weapon#index.], MAX_SECONDARY_SPEWcxx . . $ `Descent3/Player.cpp:2873:9`!);
2942 for (int t = 0; t < count; t++)
2943 PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, id, 2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2944 }
2945 } else // Single player
2946 {
2947 int w;
2948
2949 // Spew the primary weapon powerups
2950 for (w = 1; w < MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!; w++) {
2951 if (playp->weapon_flagscxx . . $ player#weapon_flags. & HAS_FLAGcxx . . $ `Descent3/weapon.h:215:9`!(w)) {
2952 id = Shipscxx . . $ Ships.[playp->ship_indexcxx . . $ player#ship_index.].spew_powerupcxx . . $ ship#spew_powerup.[w];
2953 if (id != -1) {
2954 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Object_info[id].type == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!);
2955 int objnum = PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, id, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2956
2957 // Set ammo
2958 if (objnum != -1) {
2959 objectcxx . . $ object# *objp = &Objectscxx . . $ Objects.[objnum];
2960 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->control_type == CT_POWERUPcxx . . $ `Descent3/object_external.h:224:9`!);
2961 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
2962 objp->ctypecxx . . $ object#ctype..powerup_infocxx . . $ object#$anonymous_type_9#powerup_info..countcxx . . $ powerup_info_s#count. = stdcxx . . $ std/::maxcxx . . $ std/max(2a338fce5842aa6a).<int>(objp->ctypecxx . . $ object#ctype..powerup_infocxx . . $ object#$anonymous_type_9#powerup_info..countcxx . . $ powerup_info_s#count. / 4, playp->weapon_ammocxx . . $ player#weapon_ammo.[w]);
2963 else
2964 objp->ctypecxx . . $ object#ctype..powerup_infocxx . . $ object#$anonymous_type_9#powerup_info..countcxx . . $ powerup_info_s#count. = playp->weapon_ammocxx . . $ player#weapon_ammo.[w];
2965 }
2966 }
2967 }
2968 }
2969
2970 // Spew the secondary weapon powerups
2971 for (w = FIRST_SECONDARY_WEAPONcxx . . $ `Descent3/Player.cpp:2870:9`!; w < FIRST_SECONDARY_WEAPONcxx . . $ `Descent3/Player.cpp:2870:9`! + MAX_SECONDARY_WEAPONScxx . . $ `Descent3/weapon.h:203:9`!; w++) {
2972 if ((playp->weapon_flagscxx . . $ player#weapon_flags. & HAS_FLAGcxx . . $ `Descent3/weapon.h:215:9`!(w)) && playp->weapon_ammocxx . . $ player#weapon_ammo.[w]) {
2973 id = Shipscxx . . $ Ships.[playp->ship_indexcxx . . $ player#ship_index.].spew_powerupcxx . . $ ship#spew_powerup.[w];
2974 if (id != -1) {
2975 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Object_info[id].type == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!);
2976
2977 // Check for multipack version
2978 int multi_id = FindMultipackPowerupcxx . . $ FindMultipackPowerup(7864480464b09eea).(id);
2979 if (multi_id != -1) {
2980 int objnum;
2981 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Object_info[multi_id].type == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!);
2982 objnum = PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, multi_id, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2983 if (objnum != -1)
2984 Objectscxx . . $ Objects.[objnum].ctypecxx . . $ object#ctype..powerup_infocxx . . $ object#$anonymous_type_9#powerup_info..countcxx . . $ powerup_info_s#count. = playp->weapon_ammocxx . . $ player#weapon_ammo.[w];
2985 } else {
2986 int count = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).<int>(playp->weapon_ammocxx . . $ player#weapon_ammo.[w], MAX_SECONDARY_SPEWcxx . . $ `Descent3/Player.cpp:2873:9`!);
2987 for (int t = 0; t < count; t++)
2988 PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, id, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2989 }
2990 }
2991 }
2992 }
2993 }
2994
2995 // Spew out the inventory items
2996 objectcxx . . $ object# *temp_obj;
2997 uint16_tcxx . . $ uint16_t# inven_flags;
2998 int object_flags;
2999 bool spew_it;
3000
3001 playp->inventorycxx . . $ player#inventory..ResetPoscxx . . $ Inventory#ResetPos(49f6e7a06ebc5aa8).();
3002 int count = playp->inventorycxx . . $ player#inventory..Sizecxx . . $ Inventory#Size(b126dc7c1de90089).();
3003 int i;
3004 for (i = 0; i < count; i++) {
3005 int limit = playp->inventorycxx . . $ player#inventory..GetPosCountcxx . . $ Inventory#GetPosCount(b126dc7c1de90089).();
3006 for (int t = 0; t < limit; t++) {
3007 playp->inventorycxx . . $ player#inventory..GetPosTypeIDcxx . . $ Inventory#GetPosTypeID(8a990ad1ed500b42).(type, id);
3008 playp->inventorycxx . . $ player#inventory..GetPosInfocxx . . $ Inventory#GetPosInfo(a9f116dbdd7af36d).(inven_flags, object_flags);
3009
3010 if (spew_nonspewable)
3011 spew_it = true;
3012 else {
3013 if (!(inven_flags & INVF_NOTSPEWABLEcxx . . $ `Descent3/Inventory.h:197:9`!)) {
3014 spew_it = true;
3015 } else {
3016 spew_it = false;
3017 }
3018 }
3019
3020 if (spew_it) {
3021 if (id == -1) {
3022 // this is an already exisiting object, no creating
3023 playp->inventorycxx . . $ player#inventory..Removecxx . . $ Inventory#Remove(cf9ef193275fa6d8).(type, id);
3024
3025 // type is really the object handle
3026 temp_obj = ObjGetcxx . . $ ObjGet(11672e354c0b263a).(type);
3027 ASSERTcxx . . $ `misc/pserror.h:246:9`!(temp_obj);
3028 if (temp_obj) {
3029 ObjUnGhostObjectcxx . . $ ObjUnGhostObject(d4f767463ce0a6b3).(OBJNUMcxx . . $ `Descent3/object.h:700:9`!(temp_obj));
3030 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
3031 // tell the clients to unghost
3032 MultiSendGhostObjectcxx . . $ MultiSendGhostObject(674fac047436fc5b).(temp_obj, false);
3033 }
3034
3035 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
3036 PlayerSpewObjectcxx . . $ PlayerSpewObject(ffd507765906b057).(temp_obj, (inven_flags & INVF_TIMEOUTONSPEWcxx . . $ `Descent3/Inventory.h:198:9`!) ? 2 : 0, obj->roomnumcxx . . $ object#roomnum., &obj->poscxx . . $ object#pos., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3037 else
3038 PlayerSpewObjectcxx . . $ PlayerSpewObject(ffd507765906b057).(temp_obj, 0, obj->roomnumcxx . . $ object#roomnum., &obj->poscxx . . $ object#pos., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3039 }
3040
3041 } else {
3042 ASSERTcxx . . $ `misc/pserror.h:246:9`!(type != OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!);
3043 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
3044 PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, type, id, (inven_flags & INVF_TIMEOUTONSPEWcxx . . $ `Descent3/Inventory.h:198:9`!) ? 2 : 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3045 else
3046 PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, type, id, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3047 playp->inventorycxx . . $ player#inventory..Removecxx . . $ Inventory#Remove(cf9ef193275fa6d8).(type, id);
3048 }
3049 }
3050 }
3051 playp->inventorycxx . . $ player#inventory..NextPoscxx . . $ Inventory#NextPos(b45ddcbc8423892c).(true);
3052 }
3053
3054 // Spew out the countermeasure items
3055 playp->counter_measurescxx . . $ player#counter_measures..ResetPoscxx . . $ Inventory#ResetPos(49f6e7a06ebc5aa8).();
3056 count = playp->counter_measurescxx . . $ player#counter_measures..Sizecxx . . $ Inventory#Size(b126dc7c1de90089).();
3057 int done = 0;
3058 int total_spewed = 0;
3059
3060 for (i = 0; i < count && !done; i++) {
3061 if (count < 2 || (ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 2)) {
3062 int limit = playp->counter_measurescxx . . $ player#counter_measures..GetPosCountcxx . . $ Inventory#GetPosCount(b126dc7c1de90089).();
3063 limit = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(2, limit);
3064 for (int t = 0; t < limit; t++) {
3065 playp->counter_measurescxx . . $ player#counter_measures..GetAuxPosTypeIDcxx . . $ Inventory#GetAuxPosTypeID(8a990ad1ed500b42).(type, id);
3066 playp->counter_measurescxx . . $ player#counter_measures..GetPosInfocxx . . $ Inventory#GetPosInfo(a9f116dbdd7af36d).(inven_flags, object_flags);
3067 ASSERTcxx . . $ `misc/pserror.h:246:9`!(id != -1);
3068 ASSERTcxx . . $ `misc/pserror.h:246:9`!(type != OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!);
3069
3070 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
3071 PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, type, id, (inven_flags & INVF_TIMEOUTONSPEWcxx . . $ `Descent3/Inventory.h:198:9`!) ? 2 : 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3072 else
3073 PlayerSpewObjectcxx . . $ PlayerSpewObject(6f47613ef3a8e019).(obj, type, id, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3074
3075 playp->counter_measurescxx . . $ player#counter_measures..GetPosTypeIDcxx . . $ Inventory#GetPosTypeID(8a990ad1ed500b42).(type, id);
3076 playp->counter_measurescxx . . $ player#counter_measures..Removecxx . . $ Inventory#Remove(cf9ef193275fa6d8).(type, id);
3077 }
3078
3079 total_spewed++;
3080 if (total_spewed >= 3)
3081 done = 1;
3082 }
3083 playp->counter_measurescxx . . $ player#counter_measures..NextPoscxx . . $ Inventory#NextPos(b45ddcbc8423892c).(true);
3084 }
3085 }
3086
3087 ///////////////////////////////////////////////////////////////////////////////
3088
3089 // Blow up the entire ship (all remaining subobjects.
3090 void PlayerShipExplodecxx . . $ PlayerShipExplode(4ebbd0c3cbf1b78a).(objectcxx . . $ object# *obj, float magnitude) {
3091 int visnum;
3092
3093 ASSERTcxx . . $ `misc/pserror.h:246:9`!(obj != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3094
3095 DLLInfocxx . . $ DLLInfo..me_handlecxx . . $ dllinfo#me_handle. = obj->handlecxx . . $ object#handle.;
3096 DLLInfocxx . . $ DLLInfo..it_handlecxx . . $ dllinfo#it_handle. = obj->handlecxx . . $ object#handle.;
3097 CallGameDLLcxx . . $ CallGameDLL(32ca0c0c7dbc2fcf).(EVT_GAMEPLAYEREXPLODEDcxx . . $ `lib/d3events.h:66:9`!, &DLLInfocxx . . $ DLLInfo.);
3098
3099 if (Deathcxx . . $ Death.[obj->idcxx . . $ object#id.].dying_modelcxx . . $ tDeathSeq#dying_model. && (Deathcxx . . $ Death.[obj->idcxx . . $ object#id.].dying_modelcxx . . $ tDeathSeq#dying_model.->n_modelscxx . . $ poly_model#n_models. > 1)) {
3100 int i;
3101
3102 // Create debris pieces from subobjects
3103 for (i = 1; i < Deathcxx . . $ Death.[obj->idcxx . . $ object#id.].dying_modelcxx . . $ tDeathSeq#dying_model.->n_modelscxx . . $ poly_model#n_models.; i++) {
3104 if (obj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..subobj_flagscxx . . $ polyobj_info#subobj_flags. & (1 << i)) {
3105 PlayerShipSpewPartcxx . . $ PlayerShipSpewPart(dc43bf10ea54b482).(obj, i, magnitude * 0.85f);
3106 }
3107 }
3108 }
3109
3110 CreateBlastRingcxx . . $ CreateBlastRing(956175ecd198205d).(&obj->poscxx . . $ object#pos., BLAST_RING_INDEXcxx . . $ `Descent3/fireball_external.h:31:9`!, DAMAGE_RING_TIMEcxx . . $ `Descent3/fireball.h:176:9`!, obj->sizecxx . . $ object#size. * 3, obj->roomnumcxx . . $ object#roomnum.);
3111
3112 obj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..subobj_flagscxx . . $ polyobj_info#subobj_flags. = 0;
3113
3114 // Player explosion sound
3115 Sound_systemcxx . . $ Sound_system..Play3dSoundcxx . . $ hlsSystem#Play3dSound(7fd84bfdbf757f76).(SOUND_BUILDING_EXPLODEcxx . . $ `Descent3/sounds.h:109:9`!, obj);
3116
3117 CreateRandomSparkscxx . . $ CreateRandomSparks(3e6b82e54d72ee3b).(80, &obj->poscxx . . $ object#pos., obj->roomnumcxx . . $ object#roomnum., HOT_SPARK_INDEXcxx . . $ `Descent3/fireball_external.h:37:9`!, (ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 3) + 2);
3118 visnum = CreateFireballcxx . . $ CreateFireball(2a769cac3223e33b).(&obj->poscxx . . $ object#pos., BIG_EXPLOSION_INDEXcxx . . $ `Descent3/fireball_external.h:26:9`!, obj->roomnumcxx . . $ object#roomnum., VISUAL_FIREBALLcxx . . $ `Descent3/fireball.h:165:9`!);
3119 if (visnum >= 0)
3120 VisEffectscxx . . $ VisEffects.[visnum].sizecxx . . $ vis_effect#size. *= (3.0f * (magnitude / MAX_EXPLOSION_MAGcxx . . $ `Descent3/Player.cpp:2002:9`!));
3121
3122 // Do badass damage
3123 obj->impact_timecxx . . $ object#impact_time. = 0;
3124 obj->impact_sizecxx . . $ object#impact_size. = obj->sizecxx . . $ object#size. * 3;
3125 obj->impact_forcecxx . . $ object#impact_force. = obj->impact_sizecxx . . $ object#impact_size. * 2;
3126 obj->impact_generic_damagecxx . . $ object#impact_generic_damage. = obj->impact_sizecxx . . $ object#impact_size. * 3;
3127 obj->impact_player_damagecxx . . $ object#impact_player_damage. = obj->impact_sizecxx . . $ object#impact_size. * 3;
3128 DoConcussiveForcecxx . . $ DoConcussiveForce(dc43bf10ea54b482).(obj, obj->handlecxx . . $ object#handle., 1.0);
3129
3130 // Spew out any weapons, powerups, inventory
3131 PlayerSpewInventorycxx . . $ PlayerSpewInventory(80a724877f6428f2).(obj);
3132
3133 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
3134 MultiMakePlayerGhostcxx . . $ MultiMakePlayerGhost(d4f767463ce0a6b3).(obj->idcxx . . $ object#id.);
3135
3136 obj->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. = 0;
3137
3138 // Stop sounds for this player
3139 PlayerStopSoundscxx . . $ PlayerStopSounds(d4f767463ce0a6b3).(obj->idcxx . . $ object#id.);
3140
3141 // Clear keyboard buffer
3142 if (obj->idcxx . . $ object#id. == Player_numcxx . . $ Player_num.) {
3143 ddio_KeyFlushcxx . . $ ddio_KeyFlush(49f6e7a06ebc5aa8).();
3144 Controllercxx . . $ Controller.->flushcxx . . $ gameController#flush(49f6e7a06ebc5aa8).();
3145 }
3146 }
3147
3148 // breaks off a random piece.
3149 void PlayerShipBreakupcxx . . $ PlayerShipBreakup(4ebbd0c3cbf1b78a).(objectcxx . . $ object# *obj, float magnitude) {
3150 int subobjnum, i, j, idx;
3151 unsigned test_flag;
3152 int n_models = Deathcxx . . $ Death.[obj->idcxx . . $ object#id.].dying_modelcxx . . $ tDeathSeq#dying_model. ? Deathcxx . . $ Death.[obj->idcxx . . $ object#id.].dying_modelcxx . . $ tDeathSeq#dying_model.->n_modelscxx . . $ poly_model#n_models. : 0;
3153 int n_remaining_models;
3154
3155 // don't break off object 0.
3156 if (n_models == 1)
3157 return;
3158
3159 // count number of valid subobjects skip 1st subobject
3160 n_remaining_models = 0;
3161 test_flag = obj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..subobj_flagscxx . . $ polyobj_info#subobj_flags.;
3162 for (i = 1; i < n_models; i++) {
3163 if (test_flag & (1 << i))
3164 n_remaining_models++;
3165 }
3166
3167 // this is an INDEX into the VALID subobjects in the polymodel. (skip 1st subobj)
3168 idx = (ps_randcxx . . $ ps_rand(b126dc7c1de90089).() * n_remaining_models / D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`!) + 1;
3169
3170 subobjnum = -1;
3171 for (i = 1, j = 1; i < n_models; i++) {
3172 if (test_flag & (1 << i)) { // valid subobject?
3173 if (idx == j) { // correct subobject index?
3174 test_flag &= ~(1 << i);
3175 subobjnum = i;
3176 break;
3177 }
3178 j++;
3179 }
3180 }
3181
3182 // okay, if no suboject found, blowup.
3183 if (subobjnum == -1) {
3184 StartPlayerExplosioncxx . . $ StartPlayerExplosion(d4f767463ce0a6b3).(obj->idcxx . . $ object#id.);
3185 } else {
3186 PlayerShipSpewPartcxx . . $ PlayerShipSpewPart(dc43bf10ea54b482).(obj, subobjnum, magnitude);
3187 }
3188 }
3189
3190 // spews a part of the player ship and all its child subobjects
3191 void PlayerShipSpewPartSubcxx . . $ PlayerShipSpewPartSub(90adb4dad75efd42).(objectcxx . . $ object# *obj, bsp_infocxx . . $ bsp_info# *submodel, float magnitude);
3192
3193 void PlayerShipSpewPartcxx . . $ PlayerShipSpewPart(dc43bf10ea54b482).(objectcxx . . $ object# *obj, int subobjnum, float magnitude) {
3194 PlayerShipSpewPartSubcxx . . $ PlayerShipSpewPartSub(90adb4dad75efd42).(obj, &Poly_modelscxx . . $ Poly_models.[obj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.].submodelcxx . . $ poly_model#submodel.[subobjnum], magnitude);
3195 }
3196
3197 void PlayerShipSpewPartSubcxx . . $ PlayerShipSpewPartSub(90adb4dad75efd42).(objectcxx . . $ object# *obj, bsp_infocxx . . $ bsp_info# *submodel, float magnitude) {
3198 vectorcxx . . $ vector# rand_vec;
3199 int subobjnum = submodel - Poly_modelscxx . . $ Poly_models.[obj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.].submodelcxx . . $ poly_model#submodel.;
3200 int i;
3201 int visnum;
3202
3203 ASSERTcxx . . $ `misc/pserror.h:246:9`!(subobjnum > -1 && subobjnum < Poly_models[obj->rtype.pobj_info.model_num].n_models);
3204
3205 // first go through all children.
3206 // find child index, and use that index into the submodel array of the polymodel to pass a new submodel down
3207 // the chain.
3208 i = 0;
3209 while (i < submodel->num_childrencxx . . $ bsp_info#num_children.) {
3210 PlayerShipSpewPartSubcxx . . $ PlayerShipSpewPartSub(90adb4dad75efd42).(obj, &Poly_modelscxx . . $ Poly_models.[obj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.].submodelcxx . . $ poly_model#submodel.[submodel->childrencxx . . $ bsp_info#children.[i]], magnitude);
3211 i++;
3212 }
3213
3214 rand_vec.xcxx . . $ vector#x. = (float)(D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`! / 2 - ps_randcxx . . $ ps_rand(b126dc7c1de90089).());
3215 if (obj->movement_typecxx . . $ object#movement_type. != MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!)
3216 rand_vec.ycxx . . $ vector#y. = (float)((float)ps_randcxx . . $ ps_rand(b126dc7c1de90089).() / 2.0); // A habit of moving upward
3217 else
3218 rand_vec.ycxx . . $ vector#y. = (float)((float)D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`! / 1.5f - (float)ps_randcxx . . $ ps_rand(b126dc7c1de90089).()); // A habit of moving upward
3219 rand_vec.zcxx . . $ vector#z. = (float)(D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`! / 2 - ps_randcxx . . $ ps_rand(b126dc7c1de90089).());
3220 vm_NormalizeVectorFastcxx . . $ vm_NormalizeVectorFast(4939a7e530383cd4).(&rand_vec);
3221
3222 objectcxx . . $ object# *subobj = CreateSubobjectDebrisDirectedcxx . . $ CreateSubobjectDebrisDirected(d18dfc33f94f2a92).(obj, subobjnum, &rand_vec, magnitude);
3223 if (subobj) {
3224 // create mini-explosion at start of debris fall.
3225 vectorcxx . . $ vector# newpos = subobj->poscxx . . $ object#pos. +cxx . . $ operator+(b77b703cd1e43e33). submodel->offsetcxx . . $ bsp_info#offset.;
3226 visnum = CreateFireballcxx . . $ CreateFireball(2a769cac3223e33b).(&newpos, MED_EXPLOSION_INDEXcxx . . $ `Descent3/fireball_external.h:24:9`!, subobj->roomnumcxx . . $ object#roomnum., VISUAL_FIREBALLcxx . . $ `Descent3/fireball.h:165:9`!);
3227 if (visnum >= 0) {
3228 VisEffectscxx . . $ VisEffects.[visnum].sizecxx . . $ vis_effect#size. *= (2.5f * (magnitude / MAX_EXPLOSION_MAGcxx . . $ `Descent3/Player.cpp:2002:9`!));
3229 VisEffectscxx . . $ VisEffects.[visnum].lifeleftcxx . . $ vis_effect#lifeleft. *= 2.0f;
3230 rand_vec =cxx . . $ vector#`operator=`(c0842353a20857d). (-cxx . . $ operator-(9e07539e219c6f20).rand_vec) *cxx . . $ `operator*`(252247219a31502c). (magnitude * 25.0f);
3231 phys_apply_forcecxx . . $ phys_apply_force(1d7af1ec00c1f7ea).(obj, &rand_vec);
3232 // mprintf(0, "Breakoff fireball size: %f, lifeleft: %f\n", Objects[objnum].size, Objects[objnum].lifeleft);
3233 }
3234 }
3235
3236 // mark subobject dead
3237 obj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..subobj_flagscxx . . $ polyobj_info#subobj_flags. &= (~(1 << subobjnum));
3238 // mprintf(0, "%d:sobj=%08x\n", subobjnum, obj->rtype.pobj_info.subobj_flags);
3239 }
3240
3241 // Moves death camera a certain distance based off of direction from vec from
3242 // the player. returns new dist
3243 //
3244 static vectorcxx . . $ vector# Death_cam_vectorscxx . . $ Death_cam_vectors.[] = {{0, 1, 0}, {0, 1, -1}, {0, 0, -1}, {0, -1, -1}, {0, -1, 0}, {0, -1, 1},
3245 {0, 0, 1}, {0, 1, 1}, {1, 0, 0}, {1, 0, -1}, {-1, 0, -1}, {-1, 0, 0},
3246 {-1, 0, 1}, {1, 0, 1}, {1, 1, 0}, {1, -1, 0}, {-1, -1, 0}, {-1, 1, 0}};
3247
3248 #define NUM_DEATH_VECScxx . . $ `Descent3/Player.cpp:3248:9`! (sizeof(Death_cam_vectors) / sizeof(vector))
3249
3250 float MoveDeathCamcxx . . $ MoveDeathCam(54709106d64c0257).(int slot, vectorcxx . . $ vector# *vec, float distance) {
3251 fvi_infocxx . . $ fvi_info# hit_data;
3252 fvi_querycxx . . $ fvi_query# fq;
3253 vectorcxx . . $ vector# best_vec, next_vec, cam_vec;
3254 float far_scale;
3255 int cur_vec_index, init_vec_index, loop_count;
3256 objectcxx . . $ object# *playobj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
3257
3258 // once we've reached our distance goal, then we stop, otherwise keep moving.
3259 // actually move the camera. make sure we don't leave the mine though.
3260 hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] = (OBJECT_OUTSIDEcxx . . $ `lib/object_external_struct.h:130:9`!(playobj) ? HIT_TERRAINcxx . . $ `lib/findintersection_external.h:48:9`! : HIT_WALLcxx . . $ `lib/findintersection_external.h:46:9`!);
3261 far_scale = 1.0f;
3262
3263 init_vec_index = ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % NUM_DEATH_VECScxx . . $ `Descent3/Player.cpp:3248:9`!;
3264 cur_vec_index = init_vec_index;
3265 loop_count = 0;
3266
3267 do {
3268 // randomize cam_vec just a little bit if possible.
3269 cam_vec =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). Death_cam_vectorscxx . . $ Death_cam_vectors.[cur_vec_index++];
3270 cam_vec.xcxx . . $ vector#x. += ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 5) - 2) * 0.1f;
3271 cam_vec.ycxx . . $ vector#y. += ((ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 5) - 2) * 0.1f;
3272 vm_NormalizeVectorcxx . . $ vm_NormalizeVector(4939a7e530383cd4).(&cam_vec);
3273
3274 cam_vec =cxx . . $ vector#`operator=`(c0842353a20857d). cam_vec *cxx . . $ `operator*`(252247219a31502c). distance;
3275 best_vec =cxx . . $ vector#`operator=`(c0842353a20857d). playobj->poscxx . . $ object#pos. +cxx . . $ operator+(b77b703cd1e43e33). cam_vec;
3276 cam_vec =cxx . . $ vector#`operator=`(c0842353a20857d). cam_vec *cxx . . $ `operator*`(252247219a31502c). far_scale;
3277 next_vec =cxx . . $ vector#`operator=`(c0842353a20857d). playobj->poscxx . . $ object#pos. +cxx . . $ operator+(b77b703cd1e43e33). cam_vec;
3278
3279 if (cur_vec_index == init_vec_index) {
3280 distance = distance / 1.25f;
3281 far_scale = far_scale * 1.05f;
3282 loop_count++;
3283 }
3284
3285 fq.p0cxx . . $ fvi_query#p0. = &playobj->poscxx . . $ object#pos.;
3286 fq.p1cxx . . $ fvi_query#p1. = &next_vec;
3287 fq.startroomcxx . . $ fvi_query#startroom. = playobj->roomnumcxx . . $ object#roomnum.;
3288 fq.radcxx . . $ fvi_query#rad. = .5;
3289 fq.thisobjnumcxx . . $ fvi_query#thisobjnum. = OBJNUMcxx . . $ `Descent3/object.h:700:9`!(playobj);
3290 fq.ignore_obj_listcxx . . $ fvi_query#ignore_obj_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3291 fq.flagscxx . . $ fvi_query#flags. = 0;
3292
3293 ASSERTcxx . . $ `misc/pserror.h:246:9`!(std::isfinite(next_vec.x));
3294 ASSERTcxx . . $ `misc/pserror.h:246:9`!(std::isfinite(next_vec.y));
3295 ASSERTcxx . . $ `misc/pserror.h:246:9`!(std::isfinite(next_vec.z));
3296
3297 fvi_FindIntersectioncxx . . $ fvi_FindIntersection(e1c4d7bd350effc8).(&fq, &hit_data);
3298
3299 if (hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] == HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`! || loop_count == 32) {
3300 // okay, we need to find the room that best_vec is in.
3301 fq.p0cxx . . $ fvi_query#p0. = &playobj->poscxx . . $ object#pos.;
3302 fq.p1cxx . . $ fvi_query#p1. = &best_vec;
3303 fq.startroomcxx . . $ fvi_query#startroom. = playobj->roomnumcxx . . $ object#roomnum.;
3304 fq.radcxx . . $ fvi_query#rad. = 0.75f;
3305 fq.thisobjnumcxx . . $ fvi_query#thisobjnum. = OBJNUMcxx . . $ `Descent3/object.h:700:9`!(playobj);
3306 fq.ignore_obj_listcxx . . $ fvi_query#ignore_obj_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3307 fq.flagscxx . . $ fvi_query#flags. = 0;
3308 fvi_FindIntersectioncxx . . $ fvi_FindIntersection(e1c4d7bd350effc8).(&fq, &hit_data);
3309
3310 if (hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] != HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`!)
3311 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera., &hit_data.hit_pntcxx . . $ fvi_info#hit_pnt., hit_data.hit_roomcxx . . $ fvi_info#hit_room., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, false);
3312 else
3313 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(Deathcxx . . $ Death.[slot].cameracxx . . $ tDeathSeq#camera., &best_vec, hit_data.hit_roomcxx . . $ fvi_info#hit_room., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, false);
3314 } else {
3315 float ray_dist = vm_VectorDistanceQuickcxx . . $ vm_VectorDistanceQuick(a0b9c8659ecc16b8).(&hit_data.hit_pntcxx . . $ fvi_info#hit_pnt., &playobj->poscxx . . $ object#pos.);
3316 if (ray_dist < distance) {
3317 hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] = HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`!;
3318 }
3319 }
3320
3321 // go back to start of list if at end.
3322 if (cur_vec_index == NUM_DEATH_VECScxx . . $ `Descent3/Player.cpp:3248:9`!)
3323 cur_vec_index = 0;
3324 } while (hit_data.hit_typecxx . . $ fvi_info#hit_type.[0] != HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`! && loop_count < 32);
3325
3326 *vec =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). cam_vec;
3327
3328 return distance;
3329 }
3330
3331 // Returns the goal room of the passed in team
3332 int GetGoalRoomForTeamcxx . . $ GetGoalRoomForTeam(7864480464b09eea).(int teamnum) {
3333 ASSERTcxx . . $ `misc/pserror.h:246:9`!(teamnum >= 0 && teamnum <= 3);
3334 int flags[] = {RF_GOAL1cxx . . $ `Descent3/room_external.h:178:9`!, RF_GOAL2cxx . . $ `Descent3/room_external.h:179:9`!, RF_GOAL3cxx . . $ `Descent3/room_external.h:182:9`!, RF_GOAL4cxx . . $ `Descent3/room_external.h:183:9`!};
3335
3336 for (int i = 0; i <= Highest_room_indexcxx . . $ Highest_room_index.; i++) {
3337 if (Roomscxx . . $ Rooms.[i].usedcxx . . $ room#used. && (Roomscxx . . $ Rooms.[i].flagscxx . . $ room#flags. & flags[teamnum])) {
3338 return i;
3339 }
3340 }
3341
3342 return -1; // No goal for this team!
3343 }
3344
3345 // Returns the goal room of the passed in player
3346 int GetGoalRoomForPlayercxx . . $ GetGoalRoomForPlayer(7864480464b09eea).(int slot) {
3347 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot >= 0 && slot <= MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!);
3348 int team = PlayerGetTeamcxx . . $ PlayerGetTeam(7864480464b09eea).(slot);
3349
3350 if (team == -1)
3351 return -1;
3352
3353 return (GetGoalRoomForTeamcxx . . $ GetGoalRoomForTeam(7864480464b09eea).(team));
3354 }
3355
3356 // Sets the maximum number of teams in a game
3357 void SetMaxTeamscxx . . $ SetMaxTeams(d4f767463ce0a6b3).(int num) {
3358 if (num > MAX_TEAMScxx . . $ `Descent3/player_external_struct.h:87:9`!)
3359 num = MAX_TEAMScxx . . $ `Descent3/player_external_struct.h:87:9`!;
3360
3361 if (num < 2)
3362 num = 1;
3363
3364 if (num >= 2)
3365 Team_gamecxx . . $ Team_game. = 1;
3366 else
3367 Team_gamecxx . . $ Team_game. = 0;
3368
3369 Num_teamscxx . . $ Num_teams. = num;
3370 }
3371
3372 int IncTeamScorecxx . . $ IncTeamScore(9b79fb6aee4c0440).(int teamnum, int add) {
3373 ASSERTcxx . . $ `misc/pserror.h:246:9`!(teamnum >= 0 && teamnum < Num_teams);
3374 Teamscxx . . $ Teams.[teamnum].scorecxx . . $ team#score. += add;
3375 return Teamscxx . . $ Teams.[teamnum].scorecxx . . $ team#score.;
3376 }
3377
3378 // Resets the teams scores to zero
3379 void ResetTeamScorescxx . . $ ResetTeamScores(49f6e7a06ebc5aa8).() {
3380 int i;
3381 for (i = 0; i < MAX_TEAMScxx . . $ `Descent3/player_external_struct.h:87:9`!; i++)
3382 Teamscxx . . $ Teams.[i].scorecxx . . $ team#score. = 0;
3383 }
3384
3385 // Sets the lighting that a player will cast
3386 void PlayerSetLightingcxx . . $ PlayerSetLighting(c31bc224e645f73e).(int slot, float dist, float r, float g, float b) {
3387 Playerscxx . . $ Players.[slot].light_distcxx . . $ player#light_dist. = dist;
3388 Playerscxx . . $ Players.[slot].rcxx . . $ player#r. = r;
3389 Playerscxx . . $ Players.[slot].gcxx . . $ player#g. = g;
3390 Playerscxx . . $ Players.[slot].bcxx . . $ player#b. = b;
3391 }
3392
3393 // Gets the position of a given ball in world coords
3394 void PlayerGetBallPositioncxx . . $ PlayerGetBallPosition(826a07231ea9ab7c).(vectorcxx . . $ vector# *dest, int slot, int num) {
3395 matrixcxx . . $ matrix# rotmat, tempm;
3396 objectcxx . . $ object# *obj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
3397
3398 // Get position in circle
3399 float ballspeed = Playerscxx . . $ Players.[slot].ballspeedcxx . . $ player#ballspeed. * 65536;
3400 float rot_temp = ballspeed / 65536.0;
3401 int int_game = Gametimecxx . . $ Gametime. / rot_temp;
3402 float diff = Gametimecxx . . $ Gametime. - (int_game * rot_temp);
3403 int rot_angle = (diff * 65536);
3404 rot_angle = (rot_angle + (num * 5000)) % 65536;
3405
3406 // Get matrix to multiply with
3407 if (num == 0)
3408 vm_AnglesToMatrixcxx . . $ vm_AnglesToMatrix(654fa9e3c9c3be99).(&rotmat, 0, 0, rot_angle);
3409 else if (num == 1)
3410 vm_AnglesToMatrixcxx . . $ vm_AnglesToMatrix(654fa9e3c9c3be99).(&rotmat, 0, rot_angle, 0);
3411 else
3412 vm_AnglesToMatrixcxx . . $ vm_AnglesToMatrix(654fa9e3c9c3be99).(&rotmat, rot_angle, 0, 0);
3413
3414 tempm =cxx . . $ matrix#`operator=`(e859ffc26b91394f). obj->orientcxx . . $ object#orient. *cxx . . $ `operator*`(683f8e040c904cb). rotmat;
3415
3416 // Get world position
3417 if (num == 1)
3418 *dest =cxx . . $ vector#`operator=`(c0842353a20857d). obj->poscxx . . $ object#pos. +cxx . . $ operator+(b77b703cd1e43e33). (tempm.fveccxx . . $ matrix#fvec. *cxx . . $ `operator*`(252247219a31502c). (obj->sizecxx . . $ object#size. + 1));
3419 else
3420 *dest =cxx . . $ vector#`operator=`(c0842353a20857d). obj->poscxx . . $ object#pos. +cxx . . $ operator+(b77b703cd1e43e33). (tempm.uveccxx . . $ matrix#uvec. *cxx . . $ `operator*`(252247219a31502c). (obj->sizecxx . . $ object#size. + 1));
3421 }
3422
3423 // Sets a wacky rotating ball around the player ship
3424 void PlayerSetRotatingBallcxx . . $ PlayerSetRotatingBall(1b6f5b7544e9c30d).(int slot, int num, float speed, float *r, float *g, float *b) {
3425 ASSERTcxx . . $ `misc/pserror.h:246:9`!(num >= 0 && num <= 3);
3426
3427 Playerscxx . . $ Players.[slot].ballspeedcxx . . $ player#ballspeed. = speed;
3428 Playerscxx . . $ Players.[slot].num_ballscxx . . $ player#num_balls. = num;
3429
3430 for (int i = 0; i < num; i++) {
3431 Playerscxx . . $ Players.[slot].ball_rcxx . . $ player#ball_r.[i] = r[i];
3432 Playerscxx . . $ Players.[slot].ball_gcxx . . $ player#ball_g.[i] = g[i];
3433 Playerscxx . . $ Players.[slot].ball_bcxx . . $ player#ball_b.[i] = b[i];
3434 }
3435
3436 if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) {
3437 DemoWritePlayerBallscxx . . $ DemoWritePlayerBalls(d4f767463ce0a6b3).(slot);
3438 }
3439 }
3440
3441 void ObjSetRenderPolyobjcxx . . $ ObjSetRenderPolyobj(a7790401ac9fc765).(objectcxx . . $ object# *objp, int model_num, int dying_model_num = -1);
3442
3443 // Changes the ship a particular player is flying
3444 void PlayerChangeShipcxx . . $ PlayerChangeShip(3e454b8ccf442868).(int slot, int ship_index) {
3445 shipcxx . . $ ship# *ship;
3446
3447 if (Playerscxx . . $ Players.[slot].start_roomnumcxx . . $ player#start_roomnum. == -1)
3448 return; // this player doesn't exist
3449
3450 objectcxx . . $ object# *objp = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
3451
3452 ship = &Shipscxx . . $ Ships.[ship_index];
3453
3454 if (!ship->usedcxx . . $ ship#used.) { // this ship doesn't exist
3455 Int3cxx . . $ `misc/pserror.h:247:9`!();
3456 ship_index = GetNextShipcxx . . $ GetNextShip(7864480464b09eea).(0);
3457 ASSERTcxx . . $ `misc/pserror.h:246:9`!(ship_index != -1);
3458 ship = &Shipscxx . . $ Ships.[ship_index];
3459 }
3460
3461 // Set size & shields
3462 objp->sizecxx . . $ object#size. = ship->sizecxx . . $ ship#size.;
3463 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info. =cxx . . $ physics_info#`operator=`(fa4a94890b261b64). ship->phys_infocxx . . $ ship#phys_info.;
3464
3465 // Set up render info, but save render type first
3466 int save_rt = objp->render_typecxx . . $ object#render_type.;
3467 ObjSetRenderPolyobjcxx . . $ ObjSetRenderPolyobj(a7790401ac9fc765).(objp, ship->model_handlecxx . . $ ship#model_handle., ship->dying_model_handlecxx . . $ ship#dying_model_handle.);
3468 objp->render_typecxx . . $ object#render_type. = save_rt;
3469
3470 objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num. = ship->model_handlecxx . . $ ship#model_handle.;
3471 objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..dying_model_numcxx . . $ polyobj_info#dying_model_num. = ship->dying_model_handlecxx . . $ ship#dying_model_handle.;
3472 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship->model_handlecxx . . $ ship#model_handle.);
3473 if (ship->dying_model_handlecxx . . $ ship#dying_model_handle. != -1)
3474 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship->dying_model_handlecxx . . $ ship#dying_model_handle.);
3475
3476 if (ship->lo_render_handlecxx . . $ ship#lo_render_handle. >= 0)
3477 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship->lo_render_handlecxx . . $ ship#lo_render_handle.);
3478 if (ship->med_render_handlecxx . . $ ship#med_render_handle. >= 0)
3479 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship->med_render_handlecxx . . $ ship#med_render_handle.);
3480
3481 ComputeDefaultSizecxx . . $ ComputeDefaultSize(30915566dd087c6c).(OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!, objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num., &objp->sizecxx . . $ object#size.);
3482
3483 WBClearInfocxx . . $ WBClearInfo(419c470199a90a97).(objp);
3484
3485 Playerscxx . . $ Players.[slot].ship_indexcxx . . $ player#ship_index. = ship_index;
3486 }
3487
3488 // Sets the FOV range at which the hud names will come on
3489 void PlayerSetHUDNameFOVcxx . . $ PlayerSetHUDNameFOV(d4f767463ce0a6b3).(int fov) {
3490 if (fov < 0) {
3491 HudNameTancxx . . $ HudNameTan. = -1;
3492 return;
3493 }
3494
3495 float rad = (float)(3.14 * (float)(fov / 2) / 180.0);
3496 HudNameTancxx . . $ HudNameTan. = tancxx . . $ tan(fbcf3211dfe1bfd1).(rad);
3497 }
3498
3499 // Switches a player object to observer mode
3500 void PlayerSwitchToObservercxx . . $ PlayerSwitchToObserver(b1146eedae1e1d0b).(int slot, int observer_mode, int piggy_objnum) {
3501 objectcxx . . $ object# *obj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
3502
3503 // call the event to the multiplayer DLL's so they can do what they need
3504 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
3505 DLLInfocxx . . $ DLLInfo..me_handlecxx . . $ dllinfo#me_handle. = obj->handlecxx . . $ object#handle.;
3506
3507 if (observer_mode == OBSERVER_MODE_PIGGYBACKcxx . . $ `Descent3/player_external.h:76:9`!) {
3508 DLLInfocxx . . $ DLLInfo..it_handlecxx . . $ dllinfo#it_handle. = Objectscxx . . $ Objects.[piggy_objnum].handlecxx . . $ object#handle.;
3509 } else {
3510 DLLInfocxx . . $ DLLInfo..it_handlecxx . . $ dllinfo#it_handle. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!;
3511 }
3512
3513 CallGameDLLcxx . . $ CallGameDLL(32ca0c0c7dbc2fcf).(EVT_CLIENT_GAMEPLAYERENTERSOBSERVERcxx . . $ `lib/d3events.h:116:9`!, &DLLInfocxx . . $ DLLInfo.);
3514 }
3515
3516 // Stop sounds for this player
3517 PlayerStopSoundscxx . . $ PlayerStopSounds(d4f767463ce0a6b3).(slot);
3518
3519 if (slot == Player_numcxx . . $ Player_num.) {
3520 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_ENTEROBScxx . . $ `Descent3/stringtable.h:718:9`!);
3521 SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).(HUD_OBSERVERcxx . . $ HUD_OBSERVER.);
3522 Playerscxx . . $ Players.[slot].movement_scalarcxx . . $ player#movement_scalar. = 2.0;
3523 } else
3524 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_PLYRENTEROBScxx . . $ `Descent3/stringtable.h:719:9`!, Playerscxx . . $ Players.[slot].callsigncxx . . $ player#callsign.);
3525
3526 CreateRandomSparkscxx . . $ CreateRandomSparks(3e6b82e54d72ee3b).(30, &obj->poscxx . . $ object#pos., obj->roomnumcxx . . $ object#roomnum., HOT_SPARK_INDEXcxx . . $ `Descent3/fireball_external.h:37:9`!, (ps_randcxx . . $ ps_rand(b126dc7c1de90089).() % 3) + 2);
3527
3528 if (Demo_flagscxx . . $ Demo_flags. != DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!) {
3529 PlayerSpewInventorycxx . . $ PlayerSpewInventory(80a724877f6428f2).(obj, false);
3530 }
3531
3532 obj->typecxx . . $ object#type. = OBJ_OBSERVERcxx . . $ `Descent3/object_external.h:182:9`!;
3533 obj->render_typecxx . . $ object#render_type. = RT_NONEcxx . . $ `Descent3/object_external.h:257:9`!;
3534
3535 if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) {
3536 DemoWritePlayerTypeChangecxx . . $ DemoWritePlayerTypeChange(e0a2f7eef77c900a).(slot, false, observer_mode, piggy_objnum);
3537 }
3538
3539 if (observer_mode == OBSERVER_MODE_ROAMcxx . . $ `Descent3/player_external.h:75:9`!) {
3540 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(obj, CT_FLYINGcxx . . $ `Descent3/object_external.h:219:9`!);
3541 Playerscxx . . $ Players.[slot].piggy_objnumcxx . . $ player#piggy_objnum. = -1;
3542 obj->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
3543 } else if (observer_mode == OBSERVER_MODE_PIGGYBACKcxx . . $ `Descent3/player_external.h:76:9`!) {
3544 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(obj, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
3545 Playerscxx . . $ Players.[slot].piggy_objnumcxx . . $ player#piggy_objnum. = piggy_objnum;
3546 Playerscxx . . $ Players.[slot].piggy_sigcxx . . $ player#piggy_sig. = Objectscxx . . $ Objects.[piggy_objnum].handlecxx . . $ object#handle. & HANDLE_COUNT_MASKcxx . . $ `Descent3/object.h:643:9`!;
3547 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Object %d is observing object %d!\n", obj - Objects, piggy_objnum);
3548 }
3549 }
3550
3551 // Stops a player from observing
3552 void PlayerStopObservingcxx . . $ PlayerStopObserving(d4f767463ce0a6b3).(int slot) {
3553 // call the event to the multiplayer DLL's so they can do what they need
3554 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
3555 DLLInfocxx . . $ DLLInfo..me_handlecxx . . $ dllinfo#me_handle. = Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.].handlecxx . . $ object#handle.;
3556 DLLInfocxx . . $ DLLInfo..it_handlecxx . . $ dllinfo#it_handle. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!;
3557 CallGameDLLcxx . . $ CallGameDLL(32ca0c0c7dbc2fcf).(EVT_CLIENT_GAMEPLAYEREXITSOBSERVERcxx . . $ `lib/d3events.h:117:9`!, &DLLInfocxx . . $ DLLInfo.);
3558 }
3559
3560 if (slot == Player_numcxx . . $ Player_num.) {
3561 uint8_tcxx . . $ uint8_t# hud_mode;
3562 Current_pilotcxx . . $ Current_pilot..get_hud_datacxx . . $ pilot#get_hud_data(c4a38c24677fe9fd).(&hud_mode);
3563 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_LEAVEOBScxx . . $ `Descent3/stringtable.h:720:9`!);
3564 SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).((tHUDModecxx . . $ tHUDMode#)hud_mode);
3565 } else
3566 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_PLYRLEAVEOBScxx . . $ `Descent3/stringtable.h:721:9`!, Playerscxx . . $ Players.[slot].callsigncxx . . $ player#callsign.);
3567
3568 // Stop sounds for this player
3569 PlayerStopSoundscxx . . $ PlayerStopSounds(d4f767463ce0a6b3).(slot);
3570
3571 objectcxx . . $ object# *obj = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[slot].objnumcxx . . $ player#objnum.];
3572
3573 obj->typecxx . . $ object#type. = OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!;
3574 Playerscxx . . $ Players.[slot].piggy_objnumcxx . . $ player#piggy_objnum. = -1;
3575
3576 InitPlayerNewShipcxx . . $ InitPlayerNewShip(3e454b8ccf442868).(slot, INVRESET_ALLcxx . . $ `Descent3/Inventory.h:201:9`!);
3577 ResetPlayerObjectcxx . . $ ResetPlayerObject(918ebd27a9ddbad3).(slot);
3578
3579 if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) {
3580 DemoWritePlayerTypeChangecxx . . $ DemoWritePlayerTypeChange(e0a2f7eef77c900a).(slot, true);
3581 }
3582 }
3583
3584 #define PLAYER_TEXTURE_FPScxx . . $ `Descent3/Player.cpp:3584:9`! 8.0f
3585 // Sets the players custom texture. If filename=NULL then sets to no texture
3586 // Returns 1 if filename was successfully loaded, else 0
3587 int PlayerSetCustomTexturecxx . . $ PlayerSetCustomTexture(3c8082c546dd2ea0).(int slot, char *filename) {
3588 // Free up previous vclip/bitmap if there is one
3589 texturecxx . . $ texture# *texp = &GameTexturescxx . . $ GameTextures.[Playerscxx . . $ Players.[slot].custom_texture_handlecxx . . $ player#custom_texture_handle.];
3590 int bm_handle = texp->bm_handlecxx . . $ texture#bm_handle.;
3591
3592 if (bm_handle != 0) {
3593 if (texp->flagscxx . . $ texture#flags. & TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!)
3594 FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(bm_handle);
3595 else
3596 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle);
3597
3598 texp->bm_handlecxx . . $ texture#bm_handle. = 0;
3599 }
3600
3601 // Now load the new one
3602 texp->bm_handlecxx . . $ texture#bm_handle. = 0;
3603 if (filename == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
3604 return 1;
3605
3606 int anim;
3607 int new_handle = LoadTextureImagecxx . . $ LoadTextureImage(f997a6335c8241fb).(filename, &anim, SMALL_TEXTUREcxx . . $ `Descent3/gametexture.h:240:9`!, 1, 0);
3608
3609 if (new_handle < 0)
3610 return 0;
3611
3612 texp->bm_handlecxx . . $ texture#bm_handle. = new_handle;
3613 if (anim)
3614 texp->flagscxx . . $ texture#flags. |= TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!;
3615 else
3616 texp->flagscxx . . $ texture#flags. &= ~TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!;
3617
3618 texp->flagscxx . . $ texture#flags. |= TF_TEXTURE_64cxx . . $ `Descent3/gametexture.h:214:9`!;
3619
3620 // Set texture speed
3621 if (texp->flagscxx . . $ texture#flags. & TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!) {
3622 vclipcxx . . $ vclip# *vc = &GameVClipscxx . . $ GameVClips.[texp->bm_handlecxx . . $ texture#bm_handle.];
3623 texp->speedcxx . . $ texture#speed. = vc->num_framescxx . . $ vclip#num_frames. * (1.0 / PLAYER_TEXTURE_FPScxx . . $ `Descent3/Player.cpp:3584:9`!);
3624 }
3625
3626 return 1;
3627 }
3628
3629 // Sets/Clears a permission for a ship on a given player
3630 // if pnum is -1 then all players will be set, else player is the player number
3631 // returns true on success
3632 bool PlayerSetShipPermissioncxx . . $ PlayerSetShipPermission(fb2bb0cf4ad3de37).(int pnum, char *ship_name, bool allowed) {
3633 ASSERTcxx . . $ `misc/pserror.h:246:9`!(ship_name);
3634
3635 if (pnum < -1 || pnum >= MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!) // illegal value
3636 return false;
3637
3638 int ship_index = FindShipNamecxx . . $ FindShipName(5c4306d8553b3696).(ship_name);
3639 if (ship_index == -1) {
3640 ASSERTcxx . . $ `misc/pserror.h:246:9`!(ship_index != -1);
3641 return false;
3642 }
3643 int bit = 0x01;
3644 bit = bit << ship_index;
3645
3646 if (pnum == -1) {
3647 // go through everyone
3648 for (int i = 0; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++) {
3649 if (allowed)
3650 Playerscxx . . $ Players.[i].ship_permissionscxx . . $ player#ship_permissions. |= bit;
3651 else
3652 Playerscxx . . $ Players.[i].ship_permissionscxx . . $ player#ship_permissions. &= ~bit;
3653 }
3654 } else {
3655 if (allowed)
3656 Playerscxx . . $ Players.[pnum].ship_permissionscxx . . $ player#ship_permissions. |= bit;
3657 else
3658 Playerscxx . . $ Players.[pnum].ship_permissionscxx . . $ player#ship_permissions. &= ~bit;
3659 }
3660 return true;
3661 }
3662
3663 // Resets the ship permissions for a given player
3664 // pass false for set_default if you don't want the default ship allowed
3665 bool PlayerResetShipPermissionscxx . . $ PlayerResetShipPermissions(9609253e83e89946).(int pnum, bool set_default) {
3666 if (pnum < -1 || pnum >= MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!)
3667 return false;
3668
3669 int perm;
3670
•3671 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Resetting ship permissions\n");
3672
3673 if (set_default)
3674 perm = Default_ship_permissioncxx . . $ Default_ship_permission.;
3675 else
3676 perm = 0;
3677
3678 if (pnum == -1) {
3679 for (int i = 0; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++) {
3680 Playerscxx . . $ Players.[i].ship_permissionscxx . . $ player#ship_permissions. = perm;
3681 }
3682 } else {
3683 Playerscxx . . $ Players.[pnum].ship_permissionscxx . . $ player#ship_permissions. = perm;
3684 }
3685
3686 return true;
3687 }
3688
3689 // Returns true if the given ship is allowed to be chosen for a pnum
3690 bool PlayerIsShipAllowedcxx . . $ PlayerIsShipAllowed(ceb9eed3194142b2).(int pnum, char *ship_name) {
3691 ASSERTcxx . . $ `misc/pserror.h:246:9`!(ship_name);
3692
3693 if (pnum < -1 || pnum >= MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!) // illegal value
3694 return false;
3695
3696 int ship_index = FindShipNamecxx . . $ FindShipName(5c4306d8553b3696).(ship_name);
3697 if (ship_index == -1) {
3698 ASSERTcxx . . $ `misc/pserror.h:246:9`!(ship_index != -1);
3699 return false;
3700 }
3701 int bit = 0x01;
3702 bit = bit << ship_index;
3703 return ((Playerscxx . . $ Players.[(pnum != -1) ? pnum : Player_numcxx . . $ Player_num.].ship_permissionscxx . . $ player#ship_permissions. & bit) != 0);
3704 }
3705 bool PlayerIsShipAllowedcxx . . $ PlayerIsShipAllowed(cf9ef193275fa6d8).(int pnum, int ship_index) {
3706 if (pnum < -1 || pnum >= MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!) // illegal value
3707 return false;
3708
3709 ASSERTcxx . . $ `misc/pserror.h:246:9`!(ship_index >= 0 && ship_index < MAX_SHIPScxx . . $ `Descent3/ship.h:122:9`!);
3710
3711 int bit = 0x01;
3712 bit = bit << ship_index;
3713 return ((Playerscxx . . $ Players.[pnum].ship_permissionscxx . . $ player#ship_permissions. & bit) != 0);
3714 }
3715
3716 void DoEnergyToShieldscxx . . $ DoEnergyToShields(d4f767463ce0a6b3).(int pnum) {
3717 float amount; // how much energy gets transfered
3718 static float last_play_time = 0;
3719
3720 if (Playerscxx . . $ Players.[pnum].energycxx . . $ player#energy. - INITIAL_ENERGYcxx . . $ `Descent3/player_external.h:68:9`! <= 0) {
3721 if (pnum == Player_numcxx . . $ Player_num.)
3722 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_NEEDMOREENERGYcxx . . $ `Descent3/stringtable.h:722:9`!, INITIAL_ENERGYcxx . . $ `Descent3/player_external.h:68:9`!);
3723 return;
3724 }
3725 if (Objectscxx . . $ Objects.[Playerscxx . . $ Players.[pnum].objnumcxx . . $ player#objnum.].shieldscxx . . $ object#shields. >= MAX_SHIELDScxx . . $ `Descent3/player_external.h:72:9`!) {
3726 if (pnum == Player_numcxx . . $ Player_num.)
3727 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_SHIELDSATMAXcxx . . $ `Descent3/stringtable.h:723:9`!);
3728 return;
3729 }
3730
3731 amount = stdcxx . . $ std/::mincxx . . $ std/min(7d979dd22a97e265).({Frametimecxx . . $ Frametime. * CONVERTER_RATEcxx . . $ `Descent3/player.h:386:9`!, Playerscxx . . $ Players.[pnum].energycxx . . $ player#energy. - INITIAL_ENERGYcxx . . $ `Descent3/player_external.h:68:9`!, (MAX_SHIELDScxx . . $ `Descent3/player_external.h:72:9`! - Objectscxx . . $ Objects.[Playerscxx . . $ Players.[pnum].objnumcxx . . $ player#objnum.].shieldscxx . . $ object#shields.) * CONVERTER_SCALEcxx . . $ `Descent3/player.h:387:9`!});
3732
3733 Playerscxx . . $ Players.[pnum].energycxx . . $ player#energy. -= amount;
3734
3735 if ((!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) || Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!)
3736 Objectscxx . . $ Objects.[Playerscxx . . $ Players.[pnum].objnumcxx . . $ player#objnum.].shieldscxx . . $ object#shields. += amount / CONVERTER_SCALEcxx . . $ `Descent3/player.h:387:9`!;
3737 else
3738 Multi_additional_shieldscxx . . $ Multi_additional_shields.[SHIELD_REQUEST_ENERGY_TO_SHIELDcxx . . $ `Descent3/multi.h:652:9`!] += Frametimecxx . . $ Frametime.;
3739
3740 if (pnum == Player_numcxx . . $ Player_num.) {
3741 if (last_play_time > Gametimecxx . . $ Gametime.)
3742 last_play_time = 0;
3743
3744 if (Gametimecxx . . $ Gametime. > last_play_time + CONVERTER_SOUND_DELAYcxx . . $ `Descent3/player.h:388:9`!) {
3745 Sound_systemcxx . . $ Sound_system..Play3dSoundcxx . . $ hlsSystem#Play3dSound(7fd84bfdbf757f76).(SOUND_ENERGY_CONVERTERcxx . . $ `Descent3/sounds.h:125:9`!, &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[pnum].objnumcxx . . $ player#objnum.], MAX_GAME_VOLUMEcxx . . $ `sndlib/ssl_lib.h:265:9`! / 2);
3746
3747 ain_hearcxx . . $ ain_hear# hear;
3748 hear.f_directly_playercxx . . $ ain_hear#f_directly_player. = true;
3749 hear.hostile_levelcxx . . $ ain_hear#hostile_level. = 0.3f;
3750 hear.curiosity_levelcxx . . $ ain_hear#curiosity_level. = 1.0f;
3751 hear.max_distcxx . . $ ain_hear#max_dist. = Soundscxx . . $ Sounds.[SOUND_ENERGY_CONVERTERcxx . . $ `Descent3/sounds.h:125:9`!].max_distancecxx . . $ sound_info#max_distance. * 0.5f;
3752 AINotifycxx . . $ AINotify(f32b5964aaa42c22).(&Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.], AIN_HEAR_NOISEcxx . . $ `Descent3/aistruct_external.h:297:9`!, (void *)&hear);
3753
3754 last_play_time = Gametimecxx . . $ Gametime.;
3755 }
3756 }
3757 }
3758
3759 // Sets the start position that the player will respawn at
3760 void PlayerAddWaypointcxx . . $ PlayerAddWaypoint(d4f767463ce0a6b3).(int index) {
3761 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Players[index].start_roomnum != -1); // Invalid start position specified
3762 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Current waypoint is now %d\n", index);
3763 Current_waypointcxx . . $ Current_waypoint. = index;
3764
3765 // A manual waypoint blows away all auto-waypoints
3766 for (int i = 0; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++)
3767 Playerscxx . . $ Players.[i].current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. = -1;
3768 }
3769
3770 // Resets the waypoints (for new level)
3771 void ResetWaypointcxx . . $ ResetWaypoint(49f6e7a06ebc5aa8).() {
3772 // Set global waypoint to first start position
3773 Current_waypointcxx . . $ Current_waypoint. = 0;
3774
3775 // Clear out all auto-waypoints
3776 for (int i = 0; i < MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!; i++)
3777 Playerscxx . . $ Players.[i].current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. = -1;
3778 }
3779
3780 struct waypointcxx . . $ waypoint# {
3781 vectorcxx . . $ vector# poscxx . . $ waypoint#pos.;
3782 int roomnumcxx . . $ waypoint#roomnum.;
3783 matrixcxx . . $ matrix# orientcxx . . $ waypoint#orient.;
3784 };
3785
3786 waypointcxx . . $ waypoint# Waypointscxx . . $ Waypoints.[MAX_WAYPOINTScxx . . $ `Descent3/player.h:381:9`!];
3787 int Num_waypointscxx . . $ Num_waypoints.;
3788
3789 // Find all the waypoint objects and add them to the list of waypoints
3790 void MakeAtuoWaypointListcxx . . $ MakeAtuoWaypointList(49f6e7a06ebc5aa8).() {
3791 int i;
3792 objectcxx . . $ object# *objp;
3793 roomcxx . . $ room# *rp;
3794
3795 Num_waypointscxx . . $ Num_waypoints. = 0;
3796
3797 // Clear room waypoint flags
3798 for (i = 0, rp = Roomscxx . . $ Rooms.; i <= Highest_room_indexcxx . . $ Highest_room_index.; i++, rp++)
3799 rp->flagscxx . . $ room#flags. &= ~RF_WAYPOINTcxx . . $ `Descent3/room_external.h:200:9`!;
3800
3801 // Look through objects for waypoints
3802 for (i = 0, objp = Objectscxx . . $ Objects.; i <= Highest_object_indexcxx . . $ Highest_object_index.; i++, objp++) {
3803 if (objp->typecxx . . $ object#type. == OBJ_WAYPOINTcxx . . $ `Descent3/object_external.h:185:9`!) {
3804 if (Num_waypointscxx . . $ Num_waypoints. < MAX_WAYPOINTScxx . . $ `Descent3/player.h:381:9`!) {
3805 Waypointscxx . . $ Waypoints.[Num_waypointscxx . . $ Num_waypoints.].poscxx . . $ waypoint#pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). objp->poscxx . . $ object#pos.;
3806 Waypointscxx . . $ Waypoints.[Num_waypointscxx . . $ Num_waypoints.].roomnumcxx . . $ waypoint#roomnum. = objp->roomnumcxx . . $ object#roomnum.;
3807 Waypointscxx . . $ Waypoints.[Num_waypointscxx . . $ Num_waypoints.].orientcxx . . $ waypoint#orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). objp->orientcxx . . $ object#orient.;
3808 Num_waypointscxx . . $ Num_waypoints.++;
3809
3810 if (OBJECT_OUTSIDEcxx . . $ `lib/object_external_struct.h:130:9`!(objp))
3811 ; // Terrain_seg[CELLNUM(objp->roomnum)].flags |= TF_WAYPOINT;
3812 else
3813 Roomscxx . . $ Rooms.[objp->roomnumcxx . . $ object#roomnum.].flagscxx . . $ room#flags. |= RF_WAYPOINTcxx . . $ `Descent3/room_external.h:200:9`!;
3814 }
3815
3816 ObjDeletecxx . . $ ObjDelete(d4f767463ce0a6b3).(i);
3817 }
3818 }
3819 }
3820
3821 // Sets the player's waypoint to the one in the specified room
3822 void SetAutoWaypointcxx . . $ SetAutoWaypoint(419c470199a90a97).(objectcxx . . $ object# *objp) {
3823 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->type == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!);
3824
3825 // Get the player we're setting
3826 playercxx . . $ player# *pp = &Playerscxx . . $ Players.[objp->idcxx . . $ object#id.];
3827
3828 if (!OBJECT_OUTSIDEcxx . . $ `lib/object_external_struct.h:130:9`!(objp)) {
3829 // delete the next two lines
3830 if (pp->current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. != objp->roomnumcxx . . $ object#roomnum.) {
3831 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Setting auto-waypoint in room %d\n", objp->roomnum);
3832 }
3833 pp->current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. = objp->roomnumcxx . . $ object#roomnum.;
3834 }
3835 }
3836
3837 // Moves the player to his last waypoint
3838 void MovePlayerToWaypointcxx . . $ MovePlayerToWaypoint(419c470199a90a97).(objectcxx . . $ object# *objp) {
3839 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->type == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`! || objp->type == OBJ_GHOSTcxx . . $ `Descent3/object_external.h:172:9`!);
3840
3841 playercxx . . $ player# *pp = &Playerscxx . . $ Players.[objp->idcxx . . $ object#id.];
3842
3843 // If this player has an auto-waypoint, use it. Else use global waypoint.
3844 if (pp->current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room. != -1) {
3845 waypointcxx . . $ waypoint# *wp;
3846 int i;
3847
3848 // Find the waypoint
3849 for (i = 0, wp = Waypointscxx . . $ Waypoints.; i < Num_waypointscxx . . $ Num_waypoints.; i++, wp++)
3850 if (wp->roomnumcxx . . $ waypoint#roomnum. == pp->current_auto_waypoint_roomcxx . . $ player#current_auto_waypoint_room.)
3851 break;
3852 ASSERTcxx . . $ `misc/pserror.h:246:9`!(i < Num_waypoints);
3853
3854 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(objp, &wp->poscxx . . $ waypoint#pos., wp->roomnumcxx . . $ waypoint#roomnum., &wp->orientcxx . . $ waypoint#orient., false);
3855 } else {
3856 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Current_waypoint != -1);
3857
3858 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Resetting player ship to waypoint %d\n", Current_waypoint);
3859 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(objp, &Playerscxx . . $ Players.[Current_waypointcxx . . $ Current_waypoint.].start_poscxx . . $ player#start_pos., Playerscxx . . $ Players.[Current_waypointcxx . . $ Current_waypoint.].start_roomnumcxx . . $ player#start_roomnum.,
3860 &Playerscxx . . $ Players.[Current_waypointcxx . . $ Current_waypoint.].start_orientcxx . . $ player#start_orient., false);
3861 }
3862 }
3863
3864 // Adds to the player's score & kill total
3865 void PlayerScoreAddcxx . . $ PlayerScoreAdd(3e454b8ccf442868).(int playernum, int points) {
3866 // Add score
3867 if (points) {
3868
3869 if (points > 0)
3870 Playerscxx . . $ Players.[playernum].num_kills_levelcxx . . $ player#num_kills_level.++;
3871 else
3872 Playerscxx . . $ Players.[playernum].friendly_kills_levelcxx . . $ player#friendly_kills_level.++;
3873
3874 if (!(playernum != Player_numcxx . . $ Player_num. || IsCheatercxx . . $ IsCheater.)) {
3875 Playerscxx . . $ Players.[playernum].scorecxx . . $ player#score. += points;
3876
3877 Score_addedcxx . . $ Score_added. = points;
3878 Score_added_timercxx . . $ Score_added_timer. = SCORE_ADDED_TIMEcxx . . $ `Descent3/player.h:445:9`!;
3879 }
3880 }
3881 }
3882
3883 ////////////////////////////////////////////////////
3884 // Thief interface functions
3885 ////////////////////////////////////////////////////
3886 extern uint8_tcxx . . $ uint8_t# AutomapVisMapcxx . . $ AutomapVisMap.[MAX_ROOMScxx . . $ `Descent3/room.h:377:9`!];
3887 void MakeObjectVisiblecxx . . $ MakeObjectVisible(419c470199a90a97).(objectcxx . . $ object# *obj);
3888
3889 // steals an item from the given player
3890 void ThiefStealItemcxx . . $ ThiefStealItem(3e454b8ccf442868).(int player_object_handle, int item) {
3891 objectcxx . . $ object# *pobj = ObjGetcxx . . $ ObjGet(11672e354c0b263a).(player_object_handle);
3892 ASSERTcxx . . $ `misc/pserror.h:246:9`!(pobj);
3893 ASSERTcxx . . $ `misc/pserror.h:246:9`!(pobj->type == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!);
3894
3895 int playernum = pobj->idcxx . . $ object#id.;
3896
3897 static int conv_id = -2;
3898 static int quad_id = -2;
3899
3900 bool is_multi = false;
3901 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
3902 is_multi = true;
3903
3904 if (is_multi) {
3905 ASSERTcxx . . $ `misc/pserror.h:246:9`!(item != THIEFITEM_AUTOMAPcxx . . $ `scripts/osiris_common.h:772:9`!);
3906 }
3907
3908 if (is_multi && Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
3909 // send it off
3910 MultiSendThiefStealcxx . . $ MultiSendThiefSteal(3e454b8ccf442868).(playernum, item);
3911 }
3912
3913 switch (item) {
3914 case THIEFITEM_AUTOMAPcxx . . $ `scripts/osiris_common.h:772:9`!:
3915 if (playernum == Player_numcxx . . $ Player_num.) {
3916 for (int i = 0; i < MAX_ROOMScxx . . $ `Descent3/room.h:377:9`!; i++) {
3917 if (AutomapVisMapcxx . . $ AutomapVisMap.[i] == 1)
3918 AutomapVisMapcxx . . $ AutomapVisMap.[i] = 2;
3919 }
3920 }
3921 break;
3922
3923 case THIEFITEM_HEADLIGHTcxx . . $ `scripts/osiris_common.h:773:9`!:
3924 Playerscxx . . $ Players.[playernum].flagscxx . . $ player#flags. &= ~PLAYER_FLAGS_HEADLIGHTcxx . . $ `Descent3/player_external.h:90:9`!;
3925 Playerscxx . . $ Players.[playernum].flagscxx . . $ player#flags. |= PLAYER_FLAGS_HEADLIGHT_STOLENcxx . . $ `Descent3/player_external.h:91:9`!;
3926 break;
3927
3928 case THIEFITEM_ETOSCONVcxx . . $ `scripts/osiris_common.h:774:9`!: {
3929 if (conv_id == -2)
3930 conv_id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Converter");
3931
3932 if (conv_id != -1) {
3933 Playerscxx . . $ Players.[playernum].inventorycxx . . $ player#inventory..Removecxx . . $ Inventory#Remove(cf9ef193275fa6d8).(OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, conv_id);
3934 }
3935 } break;
3936
3937 case THIEFITEM_CLOAKcxx . . $ `scripts/osiris_common.h:775:9`!: {
3938 if ((pobj->effect_infocxx . . $ object#effect_info.) && (pobj->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. & EF_FADING_OUTcxx . . $ `Descent3/object_external.h:207:9`!) ||
3939 (pobj->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. & EF_CLOAKEDcxx . . $ `Descent3/object_external.h:197:9`!)) {
3940 MakeObjectVisiblecxx . . $ MakeObjectVisible(419c470199a90a97).(pobj);
3941 }
3942 } break;
3943
3944 case THIEFITEM_INVULNcxx . . $ `scripts/osiris_common.h:776:9`!: {
3945 if (Playerscxx . . $ Players.[playernum].flagscxx . . $ player#flags. & PLAYER_FLAGS_INVULNERABLEcxx . . $ `Descent3/player_external.h:79:9`!) {
3946 MakePlayerVulnerablecxx . . $ MakePlayerVulnerable(d4f767463ce0a6b3).(playernum);
3947 }
3948 } break;
3949
3950 case THIEFITEM_QUADFIREcxx . . $ `scripts/osiris_common.h:778:9`!: {
3951 pobj->dynamic_wbcxx . . $ object#dynamic_wb.[LASER_INDEXcxx . . $ `Descent3/weapon_external.h:22:9`!].flagscxx . . $ dynamic_wb_info#flags. &= ~DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!;
3952 pobj->dynamic_wbcxx . . $ object#dynamic_wb.[SUPER_LASER_INDEXcxx . . $ `Descent3/weapon_external.h:27:9`!].flagscxx . . $ dynamic_wb_info#flags. &= ~DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!;
3953
3954 // remove from inventory
3955 if (quad_id == -2)
3956 quad_id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("QuadLaser");
3957
3958 if (quad_id > -1) {
3959 Playerscxx . . $ Players.[playernum].inventorycxx . . $ player#inventory..Removecxx . . $ Inventory#Remove(cf9ef193275fa6d8).(OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, quad_id);
3960 }
3961
3962 } break;
3963
3964 case THIEFITEM_RAPIDFIREcxx . . $ `scripts/osiris_common.h:777:9`!: {
3965 if (Playerscxx . . $ Players.[playernum].weapon_recharge_scalarcxx . . $ player#weapon_recharge_scalar. < 1.0f) {
3966 Playerscxx . . $ Players.[playernum].weapon_recharge_scalarcxx . . $ player#weapon_recharge_scalar. = 1.0f;
3967 }
3968 } break;
3969 }
3970 }
3971
3972 // returns a stolen item to a player
3973 void ThiefReturnItemcxx . . $ ThiefReturnItem(3e454b8ccf442868).(int player_object_handle, int item) {
3974 objectcxx . . $ object# *pobj = ObjGetcxx . . $ ObjGet(11672e354c0b263a).(player_object_handle);
3975 ASSERTcxx . . $ `misc/pserror.h:246:9`!(pobj);
3976 ASSERTcxx . . $ `misc/pserror.h:246:9`!(pobj->type == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!);
3977
3978 int playernum = pobj->idcxx . . $ object#id.;
3979
3980 switch (item) {
3981 case THIEFITEM_AUTOMAPcxx . . $ `scripts/osiris_common.h:772:9`!:
3982 if (playernum == Player_numcxx . . $ Player_num.) {
3983 for (int i = 0; i < MAX_ROOMScxx . . $ `Descent3/room.h:377:9`!; i++) {
3984 if (AutomapVisMapcxx . . $ AutomapVisMap.[i] == 2)
3985 AutomapVisMapcxx . . $ AutomapVisMap.[i] = 1;
3986 }
3987 }
3988 break;
3989 case THIEFITEM_HEADLIGHTcxx . . $ `scripts/osiris_common.h:773:9`!:
3990 Playerscxx . . $ Players.[playernum].flagscxx . . $ player#flags. &= ~PLAYER_FLAGS_HEADLIGHT_STOLENcxx . . $ `Descent3/player_external.h:91:9`!;
3991 break;
3992 // all others should be handled by their powerup
3993 }
3994 }
3995
3996 // returns true if a player has the specified item to be stolen
3997 bool ThiefPlayerHasItemcxx . . $ ThiefPlayerHasItem(cf9ef193275fa6d8).(int player_object_handle, int item) {
3998 objectcxx . . $ object# *pobj = ObjGetcxx . . $ ObjGet(11672e354c0b263a).(player_object_handle);
3999 ASSERTcxx . . $ `misc/pserror.h:246:9`!(pobj);
4000 ASSERTcxx . . $ `misc/pserror.h:246:9`!(pobj->type == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!);
4001
4002 int playernum = pobj->idcxx . . $ object#id.;
4003
4004 static int conv_id = -2;
4005
4006 bool is_multi = false;
4007 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
4008 is_multi = true;
4009
4010 if ((playernum < 0 || playernum >= MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!))
4011 return false;
4012 if (is_multi && !(NetPlayerscxx . . $ NetPlayers.[playernum].flagscxx . . $ netplayer#flags. & NPF_CONNECTEDcxx . . $ `Descent3/multi_external.h:165:9`!))
4013 return false;
4014
4015 switch (item) {
4016 case THIEFITEM_AUTOMAPcxx . . $ `scripts/osiris_common.h:772:9`!:
4017 return !is_multi;
4018 break;
4019 case THIEFITEM_HEADLIGHTcxx . . $ `scripts/osiris_common.h:773:9`!:
4020 if (Playerscxx . . $ Players.[playernum].flagscxx . . $ player#flags. & PLAYER_FLAGS_HEADLIGHT_STOLENcxx . . $ `Descent3/player_external.h:91:9`!)
4021 return false;
4022 return true;
4023 break;
4024 case THIEFITEM_ETOSCONVcxx . . $ `scripts/osiris_common.h:774:9`!: {
4025 if (conv_id == -2)
4026 conv_id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Converter");
4027
4028 if (conv_id != -1) {
4029 int inv_count = Playerscxx . . $ Players.[playernum].inventorycxx . . $ player#inventory..GetTypeIDCountcxx . . $ Inventory#GetTypeIDCount(9b79fb6aee4c0440).(OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, conv_id);
4030 if (inv_count > 0)
4031 return true;
4032 }
4033 return false;
4034 } break;
4035 case THIEFITEM_CLOAKcxx . . $ `scripts/osiris_common.h:775:9`!: {
4036 if (pobj->effect_infocxx . . $ object#effect_info.) {
4037 if (!((pobj->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. & EF_FADING_OUTcxx . . $ `Descent3/object_external.h:207:9`!) || (pobj->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. & EF_CLOAKEDcxx . . $ `Descent3/object_external.h:197:9`!))) {
4038 return false;
4039 } else {
4040 return true;
4041 }
4042 }
4043 return false;
4044 } break;
4045 case THIEFITEM_INVULNcxx . . $ `scripts/osiris_common.h:776:9`!: {
4046 if (Playerscxx . . $ Players.[playernum].flagscxx . . $ player#flags. & PLAYER_FLAGS_INVULNERABLEcxx . . $ `Descent3/player_external.h:79:9`!) {
4047 return true;
4048 }
4049 return false;
4050 } break;
4051 case THIEFITEM_QUADFIREcxx . . $ `scripts/osiris_common.h:778:9`!: {
4052 if (pobj->dynamic_wbcxx . . $ object#dynamic_wb.[LASER_INDEXcxx . . $ `Descent3/weapon_external.h:22:9`!].flagscxx . . $ dynamic_wb_info#flags. & DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!)
4053 return true;
4054 else
4055 return false;
4056 } break;
4057 case THIEFITEM_RAPIDFIREcxx . . $ `scripts/osiris_common.h:777:9`!: {
4058 if (Playerscxx . . $ Players.[playernum].weapon_recharge_scalarcxx . . $ player#weapon_recharge_scalar. < 1.0f) {
4059 return true;
4060 }
4061 return false;
4062 } break;
4063 }
4064
4065 return false;
4066 }