Prepare new maemo release
[maemo-rb.git] / apps / plugins / doom / d_player.h
blob974d0b22bab7fa07634cd2d41e522d61c4610a58
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
25 * 02111-1307, USA.
27 * DESCRIPTION:
28 * Player state structure.
30 *-----------------------------------------------------------------------------*/
33 #ifndef __D_PLAYER__
34 #define __D_PLAYER__
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).
41 #include "d_items.h"
42 #include "p_pspr.h"
44 // In addition, the player is just a special
45 // case of the generic moving object/actor.
46 #include "p_mobj.h"
48 // Finally, for odd reasons, the player input
49 // is buffered within the player data struct,
50 // as commands per game tick.
51 #include "d_ticcmd.h"
53 #ifdef __GNUG__
54 #pragma interface
55 #endif
59 // Player states.
61 enum
63 // Playing or camping.
64 PST_LIVE,
65 // Dead on the ground, view follows killer.
66 PST_DEAD,
67 // Ready to restart/respawn???
68 PST_REBORN
71 typedef unsigned playerstate_t;
75 // Player internal flags, for cheats and debug.
77 enum
79 // No clipping, walk through barriers.
80 CF_NOCLIP = 1,
81 // No damage, no health loss.
82 CF_GODMODE = 2,
83 // Not really a cheat, just a debug aid.
84 CF_NOMOMENTUM = 4
87 typedef unsigned cheat_t;
91 // Extended player object info: player_t
93 typedef struct player_s
95 mobj_t* mo;
96 playerstate_t playerstate;
97 ticcmd_t cmd;
99 // Determine POV,
100 // including viewpoint bobbing during movement.
101 // Focal origin above r.z
102 fixed_t viewz;
103 // Base height above floor for viewz.
104 fixed_t viewheight;
105 // Bob/squat speed.
106 fixed_t deltaviewheight;
107 // bounded/scaled total momentum.
108 fixed_t bob;
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.
119 int health;
120 int armorpoints;
121 // Armor type is 0-2.
122 int armortype;
124 // Power ups. invinc and invis are tic counters.
125 int powers[NUMPOWERS];
126 boolean cards[NUMCARDS];
127 boolean backpack;
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];
137 int ammo[NUMAMMO];
138 int maxammo[NUMAMMO];
140 // True if button down last tic.
141 int attackdown;
142 int usedown;
144 // Bit flags, for cheats and debug.
145 // See cheat_t, above.
146 int cheats;
148 // Refired shots are less accurate.
149 int refire;
151 // For intermission stats.
152 int killcount;
153 int itemcount;
154 int secretcount;
156 // Hint messages. // CPhipps - const
157 const char* message;
159 // For screen flashing (red or bright).
160 int damagecount;
161 int bonuscount;
163 // Who did damage (NULL for floors/ceilings).
164 mobj_t* attacker;
166 // So gun flashes light up areas.
167 int extralight;
169 // Current PLAYPAL, ???
170 // can be set to REDCOLORMAP for pain, etc.
171 int fixedcolormap;
173 // Player skin colorshift,
174 // 0-3 for which color to draw player.
175 int colormap;
177 // Overlay view sprites (gun, etc).
178 pspdef_t psprites[NUMPSPRITES];
180 // True if secret level has been done.
181 boolean didsecret;
183 } player_t;
187 // INTERMISSION
188 // Structure passed e.g. to WI_Start(wb)
190 typedef struct
192 boolean in; // whether the player is in game
194 // Player stats, kills, collected items etc.
195 int skills;
196 int sitems;
197 int ssecret;
198 int stime;
199 int frags[4];
200 int score; // current score on entry, modified on return
202 } wbplayerstruct_t;
204 typedef struct
206 int epsd; // episode # (0-2)
208 // if true, splash the secret level
209 boolean didsecret;
211 // previous and next levels, origin 0
212 int last;
213 int next;
215 int maxkills;
216 int maxitems;
217 int maxsecret;
218 int maxfrags;
220 // the par time
221 int partime;
223 // index of this player in game
224 int pnum;
226 wbplayerstruct_t plyr[MAXPLAYERS];
228 // CPhipps - total game time for completed levels so far
229 int totaltimes;
231 } wbstartstruct_t;
234 #endif