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???
71 typedef unsigned playerstate_t
;
75 // Player internal flags, for cheats and debug.
79 // No clipping, walk through barriers.
81 // No damage, no health loss.
83 // Not really a cheat, just a debug aid.
87 typedef unsigned cheat_t
;
91 // Extended player object info: player_t
93 typedef struct player_s
96 playerstate_t playerstate
;
100 // including viewpoint bobbing during movement.
101 // Focal origin above r.z
103 // Base height above floor for viewz.
106 fixed_t deltaviewheight
;
107 // bounded/scaled total momentum.
110 /* killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
111 * mo->momx and mo->momy represent true momenta experienced by player.
112 * This only represents the thrust that the player applies himself.
113 * This avoids anomolies with such things as Boom ice and conveyors.
115 fixed_t momx
, momy
; // killough 10/98
117 // This is only used between levels,
118 // mo->health is used during levels.
121 // Armor type is 0-2.
124 // Power ups. invinc and invis are tic counters.
125 int powers
[NUMPOWERS
];
126 boolean cards
[NUMCARDS
];
129 // Frags, kills of other players.
130 int frags
[MAXPLAYERS
];
131 weapontype_t readyweapon
;
133 // Is wp_nochange if not changing.
134 weapontype_t pendingweapon
;
136 boolean weaponowned
[NUMWEAPONS
];
138 int maxammo
[NUMAMMO
];
140 // True if button down last tic.
144 // Bit flags, for cheats and debug.
145 // See cheat_t, above.
148 // Refired shots are less accurate.
151 // For intermission stats.
156 // Hint messages. // CPhipps - const
159 // For screen flashing (red or bright).
163 // Who did damage (NULL for floors/ceilings).
166 // So gun flashes light up areas.
169 // Current PLAYPAL, ???
170 // can be set to REDCOLORMAP for pain, etc.
173 // Player skin colorshift,
174 // 0-3 for which color to draw player.
177 // Overlay view sprites (gun, etc).
178 pspdef_t psprites
[NUMPSPRITES
];
180 // True if secret level has been done.
188 // Structure passed e.g. to WI_Start(wb)
192 boolean in
; // whether the player is in game
194 // Player stats, kills, collected items etc.
200 int score
; // current score on entry, modified on return
206 int epsd
; // episode # (0-2)
208 // if true, splash the secret level
211 // previous and next levels, origin 0
223 // index of this player in game
226 wbplayerstruct_t plyr
[MAXPLAYERS
];
228 // CPhipps - total game time for completed levels so far