XenevaOS
Loading...
Searching...
No Matches
d_player.h
Go to the documentation of this file.
1//
2// Copyright(C) 1993-1996 Id Software, Inc.
3// Copyright(C) 2005-2014 Simon Howard
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 2
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// DESCRIPTION:
16//
17//
18
19
20#ifndef __D_PLAYER__
21#define __D_PLAYER__
22
23
24// The player data structure depends on a number
25// of other structs: items (internal inventory),
26// animation states (closely tied to the sprites
27// used to represent them, unfortunately).
28#include "d_items.h"
29#include "p_pspr.h"
30
31// In addition, the player is just a special
32// case of the generic moving object/actor.
33#include "p_mobj.h"
34
35// Finally, for odd reasons, the player input
36// is buffered within the player data struct,
37// as commands per game tick.
38#include "d_ticcmd.h"
39
40#include "net_defs.h"
41
42
43
44
45//
46// Player states.
47//
48typedef enum
49{
50 // Playing or camping.
52 // Dead on the ground, view follows killer.
54 // Ready to restart/respawn???
56
58
59
60//
61// Player internal flags, for cheats and debug.
62//
63typedef enum
64{
65 // No clipping, walk through barriers.
67 // No damage, no health loss.
69 // Not really a cheat, just a debug aid.
71
73
74
75//
76// Extended player object info: player_t
77//
78typedef struct player_s
79{
83
84 // Determine POV,
85 // including viewpoint bobbing during movement.
86 // Focal origin above r.z
88 // Base height above floor for viewz.
90 // Bob/squat speed.
92 // bounded/scaled total momentum.
94
95 // This is only used between levels,
96 // mo->health is used during levels.
97 int health;
99 // Armor type is 0-2.
101
102 // Power ups. invinc and invis are tic counters.
104 boolean cards[NUMCARDS];
105 boolean backpack;
106
107 // Frags, kills of other players.
110
111 // Is wp_nochange if not changing.
113
117
118 // True if button down last tic.
121
122 // Bit flags, for cheats and debug.
123 // See cheat_t, above.
124 int cheats;
125
126 // Refired shots are less accurate.
127 int refire;
128
129 // For intermission stats.
133
134 // Hint messages.
135 char* message;
136
137 // For screen flashing (red or bright).
140
141 // Who did damage (NULL for floors/ceilings).
143
144 // So gun flashes light up areas.
146
147 // Current PLAYPAL, ???
148 // can be set to REDCOLORMAP for pain, etc.
150
151 // Player skin colorshift,
152 // 0-3 for which color to draw player.
154
155 // Overlay view sprites (gun, etc).
157
158 // True if secret level has been done.
159 boolean didsecret;
160
162
163
164//
165// INTERMISSION
166// Structure passed e.g. to WI_Start(wb)
167//
168typedef struct
169{
170 boolean in; // whether the player is in game
171
172 // Player stats, kills, collected items etc.
176 int stime;
177 int frags[4];
178 int score; // current score on entry, modified on return
179
181
182typedef struct
183{
184 int epsd; // episode # (0-2)
185
186 // if true, splash the secret level
187 boolean didsecret;
188
189 // previous and next levels, origin 0
190 int last;
191 int next;
192
197
198 // the par time
200
201 // index of this player in game
202 int pnum;
203
205
207
208
209#endif
cheat_t
Definition d_player.h:64
@ CF_NOMOMENTUM
Definition d_player.h:70
@ CF_NOCLIP
Definition d_player.h:66
@ CF_GODMODE
Definition d_player.h:68
playerstate_t
Definition d_player.h:49
@ PST_DEAD
Definition d_player.h:53
@ PST_LIVE
Definition d_player.h:51
@ PST_REBORN
Definition d_player.h:55
struct player_s player_t
weapontype_t
Definition doomdef.h:107
@ NUMWEAPONS
Definition doomdef.h:118
@ NUMAMMO
Definition doomdef.h:133
#define MAXPLAYERS
Definition doomdef.h:45
@ NUMCARDS
Definition doomdef.h:97
@ NUMPOWERS
Definition doomdef.h:148
int fixed_t
Definition m_fixed.h:32
@ NUMPSPRITES
Definition p_pspr.h:58
Definition p_mobj.h:202
Definition d_player.h:79
mobj_t * mo
Definition d_player.h:80
int attackdown
Definition d_player.h:119
int itemcount
Definition d_player.h:131
int killcount
Definition d_player.h:130
int powers[NUMPOWERS]
Definition d_player.h:103
int extralight
Definition d_player.h:145
int usedown
Definition d_player.h:120
int bonuscount
Definition d_player.h:139
boolean backpack
Definition d_player.h:105
fixed_t viewz
Definition d_player.h:87
int colormap
Definition d_player.h:153
boolean didsecret
Definition d_player.h:159
int health
Definition d_player.h:97
boolean weaponowned[NUMWEAPONS]
Definition d_player.h:114
mobj_t * attacker
Definition d_player.h:142
int armortype
Definition d_player.h:100
fixed_t bob
Definition d_player.h:93
int secretcount
Definition d_player.h:132
weapontype_t pendingweapon
Definition d_player.h:112
int maxammo[NUMAMMO]
Definition d_player.h:116
int armorpoints
Definition d_player.h:98
int cheats
Definition d_player.h:124
fixed_t viewheight
Definition d_player.h:89
int fixedcolormap
Definition d_player.h:149
int damagecount
Definition d_player.h:138
int ammo[NUMAMMO]
Definition d_player.h:115
fixed_t deltaviewheight
Definition d_player.h:91
pspdef_t psprites[NUMPSPRITES]
Definition d_player.h:156
playerstate_t playerstate
Definition d_player.h:81
weapontype_t readyweapon
Definition d_player.h:109
char * message
Definition d_player.h:135
boolean cards[NUMCARDS]
Definition d_player.h:104
ticcmd_t cmd
Definition d_player.h:82
int refire
Definition d_player.h:127
int frags[MAXPLAYERS]
Definition d_player.h:108
Definition p_pspr.h:63
Definition d_ticcmd.h:33
Definition d_player.h:169
int skills
Definition d_player.h:173
int stime
Definition d_player.h:176
int ssecret
Definition d_player.h:175
boolean in
Definition d_player.h:170
int sitems
Definition d_player.h:174
int score
Definition d_player.h:178
Definition d_player.h:183
int next
Definition d_player.h:191
boolean didsecret
Definition d_player.h:187
int maxkills
Definition d_player.h:193
int maxfrags
Definition d_player.h:196
int epsd
Definition d_player.h:184
int maxitems
Definition d_player.h:194
int partime
Definition d_player.h:199
int last
Definition d_player.h:190
int pnum
Definition d_player.h:202
int maxsecret
Definition d_player.h:195