Debian Codegraph @

Descent3/player_external_struct.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/player_external_struct.h $
21 * $Revision: 13 $
22 * $Date: 5/20/99 2:48a $
23 * $Author: Matt $
24 *
25 * Contains the structs needed for player definition (for DLL export)
26 *
27 * $Log: /DescentIII/main/player_external_struct.h $
28 *
29 * 13 5/20/99 2:48a Matt
30 * Auto-waypoints now stored & used per player. Manual waypoints will all
31 * players, once Jason makes it work.
32 *
33 * 12 5/10/99 12:23a Chris
34 * Fixed another hearing/seeing case. :) Buddy bot now is in the player
35 * ship at respawn
36 *
37 * 11 5/03/99 2:36p Jason
38 * added start index
39 *
40 * 10 4/23/99 1:56a Matt
41 * Added system for counting kills of friendly objects
42 *
43 * 9 4/06/99 6:02p Matt
44 * Added score system
45 *
46 * 8 4/05/99 3:34p Matt
47 * Cleaned up player start flags
48 *
49 * 7 3/23/99 12:33p Kevin
50 * More post level results improvements
51 *
52 * 6 2/16/99 3:48p Jason
53 * added marker updates to multiplayer server stream
54 *
55 * 5 2/06/99 10:03p Matt
56 * Added keys system
57 *
58 * 4 2/02/99 7:06p Jason
59 * added ranking system
60 *
61 * 3 1/28/99 6:17p Jason
62 * added markers
63 *
64 * 2 1/21/99 11:15p Jeff
65 * pulled out some structs and defines from header files and moved them
66 * into seperate header files so that multiplayer dlls don't require major
67 * game headers, just those new headers. Side effect is a shorter build
68 * time. Also cleaned up some header file #includes that weren't needed.
69 * This affected polymodel.h, object.h, player.h, vecmat.h, room.h,
70 * manage.h and multi.h
71 *
72 * $NoKeywords: $
73 */
74
75 #ifndef _PLAYER_EXTERNAL_STRUCT_H_
76 #define _PLAYER_EXTERNAL_STRUCT_H_
77
78 #include <cstdint>
79
80 #include "pstypes.h"
81 #include "vecmat_external.h"
82 #include "object_external_struct.h"
83 #include "multi_external.h"
84 #include "Inventory.h"
85
86 #define MAX_PLAYERS MAX_NET_PLAYERS
87 #define MAX_TEAMS 4
88
89 #define CALLSIGN_LEN 19
90 // THIS CONSTANT MUST NEVER BE OVER 32!!!
91 #define MAX_PLAYER_WEAPONS MAX_WBS_PER_OBJ
92
93 #define TRACKER_ID_LEN 10 // if this is changed, make sure it's changed in pilottrack.h
94
95 // Info on player weapon firing.
96 // There is one of these each for the primary & secondary weapons
97 struct player_weapon {
98 int32_t index; // the index of the current primary or secondary weapon
99 float firing_time; // how long the current weapon has been firing
100 int32_t sound_handle; // the handle for the sound the firing weapon is making
101 };
102
103 // The structure for a player. Most of this data will be for multiplayer
104 struct player {
105
106 // positional data for player starts
107 int32_t start_index;
108 vector start_pos; // where the player starts
109 int32_t start_roomnum;
110 matrix start_orient;
111
112 int32_t startpos_flags; // these flags apply to the start position (used for teams)
113
114 int32_t ship_index; // the index into the Ships array that this player is flying
115
116 // Who am I data
117 char callsign[CALLSIGN_LEN + 1]; // The callsign of this player, for net purposes.
118
119 // Game data
120 uint32_t flags; // Powerup flags, see above...
121 int32_t score; // The player's current score
122 float damage_magnitude; // for shield effects
123 float edrain_magnitude; // for energy drain effects
124 float invul_magnitude; // for invulnerability effects
125 float energy; // Amount of energy remaining.
126 uint8_t lives; // Lives remaining, 0 = game over.
127 int8_t level; // Current level player is playing. (must be signed for secret levels)
128 int8_t starting_level; // What level the player started on.
129 uint8_t keys; // Which keys the player has
130 int16_t killer_objnum; // Who killed me.... (-1 if no one)
131 float invulnerable_time; // Time left invulnerable
132 float last_hit_wall_sound_time; // Last time we played a hit wall sound
133 float last_homing_warning_sound_time; // Obvious :)
134 float last_thrust_time; // Last time the player thrusted
135 float last_afterburner_time; // Last time the player used the afterburner
136 int16_t objnum; // The object number of this player
137 int8_t team; // The team number this guy is on
138
139 // The current auto-waypoint for this player
140 int32_t current_auto_waypoint_room; // the most recent auto-waypoint, or -1
141
142 // Statistics...
143 // int score; // Current score.
144 float time_level; // Level time played
145 float time_total; // Game time played (high word = seconds)
146
147 int32_t num_hits_level; // used for accuracy calculation.
148 int32_t num_discharges_level;
149
150 int16_t num_kills_level; // Number of kills this level
151 int16_t friendly_kills_level; // Number of friendly kills this level
152 int16_t num_kills_total; // Number of kills total
153
154 // Player weapon info
155 uint32_t weapon_flags; // Mask of currently owned weapons
156 uint16_t weapon_ammo[MAX_PLAYER_WEAPONS]; // Ammo for each weapon
157
158 // Weapons
159 player_weapon weapon[2]; // Info on the player weapons
160 uint8_t laser_level; // Current level of the laser.
161
162 // lighting
163 float light_dist;
164 float r, g, b;
165
166 float ballspeed;
167 uint8_t num_balls;
168 float ball_r[3], ball_g[3], ball_b[3];
169
170 // Room tracking
171 int32_t oldroom;
172
173 // Inventory
174 Inventory inventory;
175
176 // CounterMeasures Inventory
177 Inventory counter_measures;
178
179 // Last time the player fired a weapon
180 float last_fire_weapon_time;
181
182 // Afterburner stuff
183 float afterburner_mag; // How big the thrust is for the afterburner
184 float thrust_mag;
185 int32_t afterburner_sound_handle;
186 float afterburn_time_left;
187
188 int32_t thruster_sound_handle;
189 int32_t thruster_sound_state;
190
191 // For small views and external cameras
192 int32_t small_left_obj, small_right_obj, small_dll_obj;
193
194 // Multiplayer stuff
195 uint8_t multiplayer_flags;
196 uint8_t last_multiplayer_flags;
197 float last_guided_time;
198
199 char tracker_id[TRACKER_ID_LEN];
200 int32_t kills;
201 int32_t deaths;
202 int32_t suicides;
203 float rank;
204 float lateral_thrust; // total lateral movement over the whole game
205 float rotational_thrust; // total rotational movement over the whole game
206 uint32_t time_in_game; // seconds in game
207 object *guided_obj, *user_timeout_obj;
208
209 float zoom_distance;
210
211 // Scalar values
212 float movement_scalar;
213 float damage_scalar;
214 float armor_scalar;
215 float turn_scalar;
216 float weapon_recharge_scalar;
217 float weapon_speed_scalar;
218
219 // Observer stuff
220 int32_t piggy_objnum;
221 int32_t piggy_sig;
222
223 // Custom texture stuff
224 int32_t custom_texture_handle;
225
226 // Ship permissions (1 bit per ship)
227 int32_t ship_permissions;
228
229 // For invul hit effect
230 vector invul_vector;
231
232 // Used to disable various controller input from scripting
233 uint32_t controller_bitflags;
234
235 // Marker stuff
236 int16_t num_markers;
237
238 int16_t num_deaths_level; // Number of kills this level
239 int16_t num_deaths_total; // Number of kills total
240
241 };
242
243 #endif