2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
16 * Structure information for the player
29 #define MAX_MULTI_PLAYERS MAX_PLAYERS+3
31 // Initial player stat values
32 #define INITIAL_ENERGY i2f(100) // 100% energy to start
33 #define INITIAL_SHIELDS i2f(100) // 100% shields to start
35 #define MAX_ENERGY i2f(200) // go up to 200
36 #define MAX_SHIELDS i2f(200)
38 #define INITIAL_LIVES 3 // start off with 3 lives
40 // Values for special flags
41 #define PLAYER_FLAGS_INVULNERABLE 1 // Player is invincible
42 #define PLAYER_FLAGS_BLUE_KEY 2 // Player has blue key
43 #define PLAYER_FLAGS_RED_KEY 4 // Player has red key
44 #define PLAYER_FLAGS_GOLD_KEY 8 // Player has gold key
45 #define PLAYER_FLAGS_FLAG 16 // Player has his team's flag
46 #define PLAYER_FLAGS_UNUSED 32 //
47 #define PLAYER_FLAGS_MAP_ALL 64 // Player can see unvisited areas on map
48 #define PLAYER_FLAGS_AMMO_RACK 128 // Player has ammo rack
49 #define PLAYER_FLAGS_CONVERTER 256 // Player has energy->shield converter
50 #define PLAYER_FLAGS_MAP_ALL_CHEAT 512 // Player can see unvisited areas on map normally
51 #define PLAYER_FLAGS_QUAD_LASERS 1024 // Player shoots 4 at once
52 #define PLAYER_FLAGS_CLOAKED 2048 // Player is cloaked for awhile
53 #define PLAYER_FLAGS_AFTERBURNER 4096 // Player's afterburner is engaged
54 #define PLAYER_FLAGS_HEADLIGHT 8192 // Player has headlight boost
55 #define PLAYER_FLAGS_HEADLIGHT_ON 16384 // is headlight on or off?
57 #define AFTERBURNER_MAX_TIME (F1_0*5) // Max time afterburner can be on.
58 #define CALLSIGN_LEN 8 // so can use as filename (was: 12)
60 // Amount of time player is cloaked.
61 #define CLOAK_TIME_MAX (F1_0*30)
62 #define INVULNERABLE_TIME_MAX (F1_0*30)
64 #define PLAYER_STRUCT_VERSION 17 // increment this every time player struct changes
70 // When this structure changes, increment the constant
71 // SAVE_FILE_VERSION in playsave.c
72 typedef struct player {
74 char callsign[CALLSIGN_LEN+1]; // The callsign of this player, for net purposes.
75 ubyte net_address[6]; // The network address of the player.
76 sbyte connected; // Is the player connected or not?
77 int objnum; // What object number this player is. (made an int by mk because it's very often referenced)
78 int n_packets_got; // How many packets we got from them
79 int n_packets_sent; // How many packets we sent to them
81 // -- make sure you're 4 byte aligned now!
84 uint flags; // Powerup flags, see below...
85 fix energy; // Amount of energy remaining.
86 fix shields; // shields remaining (protection)
87 ubyte lives; // Lives remaining, 0 = game over.
88 sbyte level; // Current level player is playing. (must be signed for secret levels)
89 ubyte laser_level; // Current level of the laser.
90 sbyte starting_level; // What level the player started on.
91 short killer_objnum; // Who killed me.... (-1 if no one)
92 ushort primary_weapon_flags; // bit set indicates the player has this weapon.
93 ushort secondary_weapon_flags; // bit set indicates the player has this weapon.
94 ushort primary_ammo[MAX_PRIMARY_WEAPONS]; // How much ammo of each type.
95 ushort secondary_ammo[MAX_SECONDARY_WEAPONS]; // How much ammo of each type.
97 ushort pad; // Pad because increased weapon_flags from byte to short -YW 3/22/95
99 // -- make sure you're 4 byte aligned now
102 int last_score; // Score at beginning of current level.
103 int score; // Current score.
104 fix time_level; // Level time played
105 fix time_total; // Game time played (high word = seconds)
107 fix cloak_time; // Time cloaked
108 fix invulnerable_time; // Time invulnerable
110 short KillGoalCount; // Num of players killed this level
111 short net_killed_total; // Number of times killed total
112 short net_kills_total; // Number of net kills total
113 short num_kills_level; // Number of kills this level
114 short num_kills_total; // Number of kills total
115 short num_robots_level; // Number of initial robots this level
116 short num_robots_total; // Number of robots total
117 ushort hostages_rescued_total; // Total number of hostages rescued.
118 ushort hostages_total; // Total number of hostages.
119 ubyte hostages_on_board; // Number of hostages on ship.
120 ubyte hostages_level; // Number of hostages on this level.
121 fix homing_object_dist; // Distance of nearest homing object.
122 sbyte hours_level; // Hours played (since time_total can only go up to 9 hours)
123 sbyte hours_total; // Hours played (since time_total can only go up to 9 hours)
126 #define N_PLAYER_GUNS 8
128 typedef struct player_ship {
132 fix max_thrust,reverse_thrust,brakes; //low_thrust
135 vms_vector gun_points[N_PLAYER_GUNS];
138 extern int N_players; // Number of players ( >1 means a net game, eh?)
139 extern int Player_num; // The player number who is on the console.
141 extern player Players[MAX_PLAYERS+4]; // Misc player info
142 extern player_ship *Player_ship;
145 //version 16 structure
147 #define MAX_PRIMARY_WEAPONS16 5
148 #define MAX_SECONDARY_WEAPONS16 5
150 typedef struct player16 {
152 char callsign[CALLSIGN_LEN+1]; // The callsign of this player, for net purposes.
153 ubyte net_address[6]; // The network address of the player.
154 sbyte connected; // Is the player connected or not?
155 int objnum; // What object number this player is. (made an int by mk because it's very often referenced)
156 int n_packets_got; // How many packets we got from them
157 int n_packets_sent; // How many packets we sent to them
159 // -- make sure you're 4 byte aligned now!
162 uint flags; // Powerup flags, see below...
163 fix energy; // Amount of energy remaining.
164 fix shields; // shields remaining (protection)
165 ubyte lives; // Lives remaining, 0 = game over.
166 sbyte level; // Current level player is playing. (must be signed for secret levels)
167 ubyte laser_level; // Current level of the laser.
168 sbyte starting_level; // What level the player started on.
169 short killer_objnum; // Who killed me.... (-1 if no one)
170 ubyte primary_weapon_flags; // bit set indicates the player has this weapon.
171 ubyte secondary_weapon_flags; // bit set indicates the player has this weapon.
172 ushort primary_ammo[MAX_PRIMARY_WEAPONS16]; // How much ammo of each type.
173 ushort secondary_ammo[MAX_SECONDARY_WEAPONS16];// How much ammo of each type.
175 // -- make sure you're 4 byte aligned now
178 int last_score; // Score at beginning of current level.
179 int score; // Current score.
180 fix time_level; // Level time played
181 fix time_total; // Game time played (high word = seconds)
183 fix cloak_time; // Time cloaked
184 fix invulnerable_time; // Time invulnerable
186 short net_killed_total; // Number of times killed total
187 short net_kills_total; // Number of net kills total
188 short num_kills_level; // Number of kills this level
189 short num_kills_total; // Number of kills total
190 short num_robots_level; // Number of initial robots this level
191 short num_robots_total; // Number of robots total
192 ushort hostages_rescued_total; // Total number of hostages rescued.
193 ushort hostages_total; // Total number of hostages.
194 ubyte hostages_on_board; // Number of hostages on ship.
195 ubyte hostages_level; // Number of hostages on this level.
196 fix homing_object_dist; // Distance of nearest homing object.
197 sbyte hours_level; // Hours played (since time_total can only go up to 9 hours)
198 sbyte hours_total; // Hours played (since time_total can only go up to 9 hours)
202 * reads a player_ship structure from a CFILE
204 void player_ship_read(player_ship *ps, CFILE *fp);