User:Monster Iestyn/Source Code Documentation/d_player.h

From SRB2 Wiki
Jump to navigation Jump to search
This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article.
Online link GitHub entry
File type C header file
#include guard __D_PLAYER__

Includes

Typedefs

Name Type Description
skinflags_t enum Skin flags
charability_t enum Primary character abilities
charability2_t enum Secondary character abilities
playerstate_t enum Player states
pflags_t enum Internal player flags
panim_t enum Player animations
shieldtype_t enum Shield types
powertype_t enum Player powers
ringweapons_t enum Ring weapon flags
player_t
struct player_s
struct The structure of a player

Enumerations

skinflags_t

Main article: S_SKIN > flags

charability_t

Value Name Description
0 CA_NONE No ability
1 CA_THOK Sonic Speed Thok
2 CA_FLY Tails Fly
3 CA_GLIDEANDCLIMB Knuckles Glide/Climb
4 CA_HOMINGTHOK Homing Attack
5 CA_SWIM Swim
6 CA_DOUBLEJUMP Double Jump
7 CA_FLOAT Super Sonic Float
8 CA_SLOWFALL Float with Slow Decent
9 CA_TELEKINESIS Telekinesis
10 CA_FALLSWITCH Fall switch
11 CA_JUMPBOOST Jump boost
12 CA_AIRDRILL Air drill
13 CA_JUMPTHOK Jump thok

charability2_t

Value Name Description
0 CA2_NONE No ability
1 CA2_SPINDASH Spindash
2 CA2_MULTIABILITY Multiability

playerstate_t

Value Name Description
0 PST_LIVE Playing or camping
1 PST_DEAD Dead on the ground, view follows killer
2 PST_REBORN Ready to restart/respawn???

pflags_t

panim_t

Value Name Description
0 PA_ETC Animations that don't fit into the below
1 PA_IDLE "Idle" animations (standing, waiting, teetering, and tails carry)
2 PA_WALK Walking animation (S_PLAY_RUN1–S_PLAY_RUN8)
3 PA_RUN Running animation (S_PLAY_SPD1–S_PLAY_SPD4)
4 PA_ROLL Spinning animation (S_PLAY_ATK1–S_PLAY_ATK4)
5 PA_FALL Falling animation (S_PLAY_FALL1 and S_PLAY_FALL2)
6 PA_ABILITY Ability animation (S_PLAY_ABL1 and S_PLAY_ABL2)

shieldtype_t

powertype_t

Main article: Powers
Value Name Description
23 NUMPOWERS Total number of player powers

ringweapons_t

Main article: A_GiveWeapon

Macros

Weapon types

Macro Defined as Description
WEP_AUTO 1 Automatic Ring
WEP_BOUNCE 2 Bounce Ring
WEP_SCATTER 3 Scatter Ring
WEP_GRENADE 4 Grenade Ring
WEP_EXPLODE 5 Explosion Ring
WEP_RAIL 6 Rail Ring
NUM_WEAPONS 7 Total number of weapons

player_t

See also: player_t
Data name Data type Description
Main
*mo mobj_t Player's mobj properties
cmd ticcmd_t Player's ticcmd properties
playerstate playerstate_t Player state (See #playerstate_t)
viewz fixed_t 1st-person viewing height (absolute)
viewheight fixed_t 1st-person viewing height (relative to player, default is set by viewheight)
deltaviewheight fixed_t Amount to increase viewheight by; used when viewheight is too low, when the player is stepping up, or after the player hits the floor
bob fixed_t 1st-person view bobbing height factor; value depends on player speed
aiming angle_t Vertical viewing angle
health INT32 Player "health" displayed on the HUD (number of rings + 1)
pity SINT8 The player's "pity" hit counter for Match/CTF modes
currentweapon INT32 Current weapon selected (See #Weapon types)
ringweapons INT32 Weapons currently obtained (See #ringweapons_t)
powers[NUMPOWERS] UINT16 Player powers
pflags pflags_t Internal player flags (See #pflags_t)
flashcount UINT16
flashpal UINT16
skincolor UINT8 Player's skin color number, unaffected by super/fireflower/mario invincibility
skin INT32 Character skin number the player is currently playing as
score UINT32 Player's score
dashspeed fixed_t Spin-dashing speed; charges up when holding Spin button
dashtime INT32
Skin stats
normalspeed fixed_t normalspeed for player's current skin
runspeed fixed_t runspeed for player's current skin
thrustfactor UINT8 thrustfactor for player's current skin
accelstart UINT8 accelstart for player's current skin
acceleration UINT8 acceleration for player's current skin
charability UINT8 ability for player's current skin
charability2 UINT8 ability2 for player's current skin
charflags UINT32 flags for player's current skin (See #skinflags_t)
thokitem mobjtype_t thokitem for player's current skin
spinitem mobjtype_t spinitem for player's current skin
revitem mobjtype_t revitem for player's current skin
actionspd fixed_t actionspd for player's current skin
mindash fixed_t mindash for player's current skin
maxdash fixed_t mindash for player's current skin
jumpfactor fixed_t jumpfactor for player's current skin
General stats
lives SINT8 Number of lives left
continues SINT8 Number of continues left
xtralife SINT8 Number of extra lives from ring count
gotcontinue UINT8
speed fixed_t Player speed (rmomx and rmomy combined)
jumping UINT8 Player jumping – when set to 1, letting go of jump button can cut jump momentum, and when set to 0 this does nothing
secondjump UINT8
fly1 UINT8 Timer for Tails Flight boost; boost ends when it reaches 0
scoreadd UINT8 Number of enemies destroyed in a chain; increases the score awarded per enemy
glidetime tic_t Time in tics spent gliding; increases gliding speed over time
climbing UINT8 Knuckles climbing; 0 = not climbing, 1 = climbing on wall, 2-5 = shoving up against the wall
deadtimer INT32 Death timer; used to reset the player/level after a while
exiting tic_t Timer for exiting the level
homing UINT8 Homing thok ability timer – normally set to 3*TICRATE (3 seconds) when used
skidtime tic_t
cmomx fixed_t Conveyor momx
cmomy fixed_t Conveyor momy
rmomx fixed_t "Real" momx (momx - cmomx)
rmomy fixed_t "Real" momy (momy - cmomy)
Gametype-specific stats
numboxes INT16
totalring INT16
realtime tic_t
laps UINT8
ctfteam INT32 0 = Spectator, 1 = Red, 2 = Blue
gotflag UINT16 0 = No flag obtained, 1 = Red flag, 2 = Blue flag
weapondelay INT32 Weapon delay timer; player cannot fire weapons again until this has reached 0
tossdelay INT32 Toss delay timer; player cannot toss emeralds/flags again until this has reached 0
starpostx INT16
starposty INT16
starpostz INT16
starpostnum INT32
starposttime tic_t
starpostangle angle_t
NiGHTS
angle_pos angle_t
old_angle_pos angle_t
*axis1 mobj_t
*axis2 mobj_t
bumpertime tic_t
flyangle INT32
drilltimer tic_t
linkcount INT32
linktimer tic_t
anotherflyangle INT32
nightstime tic_t
drillmeter INT32
drilldelay UINT8
bonustime boolean
*capsule mobj_t
mare UINT8
marebegunat tic_t
startedtime tic_t
finishedtime tic_t
finishedrings INT16
marescore UINT32
lastmarescore UINT32
lastmare UINT8
maxlink INT32
texttimer UINT8
textvar UINT8
Miscellaneous
lastsidehit
lastlinehit
INT16
losstime tic_t
timeshit UINT8
onconveyor INT32
*awayviewmobj mobj_t
awayviewtics INT32
awayviewaiming angle_t Vertical viewing angle for Cut-Away View
spectator boolean
bot UINT8
jointime tic_t
fovadd fixed_t This member is declared only if HWRENDER is defined