Rearange menu of mpegplayer. Add new menu with "settings" and "quit", and remove...
[kugel-rb.git] / apps / plugins / doom / d_player.h
blobf86b68f9bed9013d4ec194ee75c0d73d7af91e8b
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 typedef 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
70 } playerstate_t;
74 // Player internal flags, for cheats and debug.
76 typedef enum
78 // No clipping, walk through barriers.
79 CF_NOCLIP = 1,
80 // No damage, no health loss.
81 CF_GODMODE = 2,
82 // Not really a cheat, just a debug aid.
83 CF_NOMOMENTUM = 4
85 } cheat_t;
89 // Extended player object info: player_t
91 typedef struct player_s
93 mobj_t* mo;
94 playerstate_t playerstate;
95 ticcmd_t cmd;
97 // Determine POV,
98 // including viewpoint bobbing during movement.
99 // Focal origin above r.z
100 fixed_t viewz;
101 // Base height above floor for viewz.
102 fixed_t viewheight;
103 // Bob/squat speed.
104 fixed_t deltaviewheight;
105 // bounded/scaled total momentum.
106 fixed_t bob;
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.
117 int health;
118 int armorpoints;
119 // Armor type is 0-2.
120 int armortype;
122 // Power ups. invinc and invis are tic counters.
123 int powers[NUMPOWERS];
124 boolean cards[NUMCARDS];
125 boolean backpack;
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];
135 int ammo[NUMAMMO];
136 int maxammo[NUMAMMO];
138 // True if button down last tic.
139 int attackdown;
140 int usedown;
142 // Bit flags, for cheats and debug.
143 // See cheat_t, above.
144 int cheats;
146 // Refired shots are less accurate.
147 int refire;
149 // For intermission stats.
150 int killcount;
151 int itemcount;
152 int secretcount;
154 // Hint messages. // CPhipps - const
155 const char* message;
157 // For screen flashing (red or bright).
158 int damagecount;
159 int bonuscount;
161 // Who did damage (NULL for floors/ceilings).
162 mobj_t* attacker;
164 // So gun flashes light up areas.
165 int extralight;
167 // Current PLAYPAL, ???
168 // can be set to REDCOLORMAP for pain, etc.
169 int fixedcolormap;
171 // Player skin colorshift,
172 // 0-3 for which color to draw player.
173 int colormap;
175 // Overlay view sprites (gun, etc).
176 pspdef_t psprites[NUMPSPRITES];
178 // True if secret level has been done.
179 boolean didsecret;
181 } player_t;
185 // INTERMISSION
186 // Structure passed e.g. to WI_Start(wb)
188 typedef struct
190 boolean in; // whether the player is in game
192 // Player stats, kills, collected items etc.
193 int skills;
194 int sitems;
195 int ssecret;
196 int stime;
197 int frags[4];
198 int score; // current score on entry, modified on return
200 } wbplayerstruct_t;
202 typedef struct
204 int epsd; // episode # (0-2)
206 // if true, splash the secret level
207 boolean didsecret;
209 // previous and next levels, origin 0
210 int last;
211 int next;
213 int maxkills;
214 int maxitems;
215 int maxsecret;
216 int maxfrags;
218 // the par time
219 int partime;
221 // index of this player in game
222 int pnum;
224 wbplayerstruct_t plyr[MAXPLAYERS];
226 // CPhipps - total game time for completed levels so far
227 int totaltimes;
229 } wbstartstruct_t;
232 #endif