1 /* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
5 * PrBoom a Doom port merged with LxDoom and LSDLDoom
6 * based on BOOM, a modified and improved DOOM engine
7 * Copyright (C) 1999 by
8 * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
9 * Copyright (C) 1999-2000 by
10 * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28 * Player state structure.
30 *-----------------------------------------------------------------------------*/
37 // The player data structure depends on a number
38 // of other structs: items (internal inventory),
39 // animation states (closely tied to the sprites
40 // used to represent them, unfortunately).
44 // In addition, the player is just a special
45 // case of the generic moving object/actor.
48 // Finally, for odd reasons, the player input
49 // is buffered within the player data struct,
50 // as commands per game tick.
63 // Playing or camping.
65 // Dead on the ground, view follows killer.
67 // Ready to restart/respawn???
74 // Player internal flags, for cheats and debug.
78 // No clipping, walk through barriers.
80 // No damage, no health loss.
82 // Not really a cheat, just a debug aid.
89 // Extended player object info: player_t
91 typedef struct player_s
94 playerstate_t playerstate
;
98 // including viewpoint bobbing during movement.
99 // Focal origin above r.z
101 // Base height above floor for viewz.
104 fixed_t deltaviewheight
;
105 // bounded/scaled total momentum.
108 /* killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
109 * mo->momx and mo->momy represent true momenta experienced by player.
110 * This only represents the thrust that the player applies himself.
111 * This avoids anomolies with such things as Boom ice and conveyors.
113 fixed_t momx
, momy
; // killough 10/98
115 // This is only used between levels,
116 // mo->health is used during levels.
119 // Armor type is 0-2.
122 // Power ups. invinc and invis are tic counters.
123 int powers
[NUMPOWERS
];
124 boolean cards
[NUMCARDS
];
127 // Frags, kills of other players.
128 int frags
[MAXPLAYERS
];
129 weapontype_t readyweapon
;
131 // Is wp_nochange if not changing.
132 weapontype_t pendingweapon
;
134 boolean weaponowned
[NUMWEAPONS
];
136 int maxammo
[NUMAMMO
];
138 // True if button down last tic.
142 // Bit flags, for cheats and debug.
143 // See cheat_t, above.
146 // Refired shots are less accurate.
149 // For intermission stats.
154 // Hint messages. // CPhipps - const
157 // For screen flashing (red or bright).
161 // Who did damage (NULL for floors/ceilings).
164 // So gun flashes light up areas.
167 // Current PLAYPAL, ???
168 // can be set to REDCOLORMAP for pain, etc.
171 // Player skin colorshift,
172 // 0-3 for which color to draw player.
175 // Overlay view sprites (gun, etc).
176 pspdef_t psprites
[NUMPSPRITES
];
178 // True if secret level has been done.
186 // Structure passed e.g. to WI_Start(wb)
190 boolean in
; // whether the player is in game
192 // Player stats, kills, collected items etc.
198 int score
; // current score on entry, modified on return
204 int epsd
; // episode # (0-2)
206 // if true, splash the secret level
209 // previous and next levels, origin 0
221 // index of this player in game
224 wbplayerstruct_t plyr
[MAXPLAYERS
];
226 // CPhipps - total game time for completed levels so far