Class Player Stats


This class is designed as a companion class to player class and player sprite class. This class holds the variables and stats that are relevant to the player; these are often changed in the other companion classes to this.

The variables are grouped and organized into structs

HRESULT c_PlayerStats::LoadStats(LPCSTR file);

Loads the stats according to a script located at the 'file' location. If this is not run, default values will be used.

void c_PlayerStats::GroundSpeedReduce(double v)

Helper function to reduce the ground speed by a ceartain amount. This is done to simplfy the code elsewhere; v will always bring the speed closer to 0 regardless of whether the speed is negative or positive.


Player ID

int num: numeric ID of the player. Determines which controller to use for input
int fighter : numeric ID of the selected figther.


SPoint pos : current location of the player
SPoint vel : current velocity in vector form
SPoint accl : accleration vector, applied & cleared once per turn
SPoint move : vector to immediately reposition the fighter, checked and cleared once per turn
SPoint lastPos; position of the player last frame.


double max : maximum guard arc possible with this fighter
double arc : current guard arc
double dir : current direction of guard


double loopStart : time to loop the walk animation, if applicable
double vel; velocity a player will walk at
double maxSpeed : maximum speed obtainable by walking
STimer shuffle : timer past which a player cannot quickly pivot and shuffle back. Active at the start of a walk or run, and after each pivot
SPoint slopeAng : angle of the slope the player is walking on
double gndSpeed :ground speed of the player, if not airborne
double dirInf :directional influence, this is a meter that depletes as it is used


double climbDist : distance the player will end up past the edge on a climb.
double rollDist : Same as above, applies to edge rolls
STimer edgeTmr; : Timer determines how long a player may hang on the edge
STimer delayTmr : time the grabbox is deactivated when dropping
double hgt, wid; : define the grabbox
bool flag : keep track of and untranslate edgegrabs


STimer pTimer : timer to assist in keeping track of pivoting
bool slowPivot : flag to identify a slower than normal pivot, active in certain cases


double vel : up velocity of a jump
double airJumpVel : up velocity of an aerial jump
int maxJumps : maximum number of jumps possible
STimer tmr timer to delay the jump by
int airJumps : tracker to mark the number of airjumps made.


STimer tmr timer until tumble ends
double thresh ; used to calculate rebounding
bool loop : flag to determine whether or not the tumble animation need to be looped
int rbdCount : keep track of number of rebounds made

Other Variables

double defence : player defence; influences the rate magnitude will ramp up by based on current damage given
double grav : gravity of player; downward acceleration per second
double fric : ground friction of player
double damage : damage taken
int stocks : stocks remaining
bool running; : flag set to true when moving too fast to quick pivot
bool mBusy : flag to determine if the character is too busy to move
bool aBusy :same as above, applies to attacks
bool invuln : true when in invulnerability frames