Planeshift
Public Member Functions | Public Attributes

Skill Struct Reference

A structure that holds the knowledge/practice/rank of each player skill. More...

#include <pscharacter.h>

List of all members.

Public Member Functions

void CalculateCosts (psCharacter *user)
bool CanTrain ()
 Checks to see if this skill can be trained any more at the current rank.
bool CheckDoRank (psCharacter *user)
 Check if skill will rank and rank it up.
void Clear ()
bool Practice (unsigned int amount, unsigned int &actuallyAdded, psCharacter *user)
 Practice this skill.
 Skill ()
void Train (int yIncrease)
 Train a skill by a particular amount.

Public Attributes

bool dirtyFlag
 Flag if this was changed after load from database.
psSkillInfoinfo
 Database information about the skill.
SkillRank rank
 Skill rank (buffable)
unsigned short y
 Knowledge Level.
unsigned short yCost
 Cost in y points.
unsigned short yCostNext
 Cost in y points of next level.
unsigned short z
 Practice value.
unsigned short zCost
 Cost in Z points.
unsigned short zCostNext
 Cost in Z points of next level.

Detailed Description

A structure that holds the knowledge/practice/rank of each player skill.

Definition at line 322 of file pscharacter.h.


Constructor & Destructor Documentation

Skill::Skill ( ) [inline]

Definition at line 336 of file pscharacter.h.


Member Function Documentation

void Skill::CalculateCosts ( psCharacter user)
bool Skill::CanTrain ( ) [inline]

Checks to see if this skill can be trained any more at the current rank.

Definition at line 352 of file pscharacter.h.

bool Skill::CheckDoRank ( psCharacter user)

Check if skill will rank and rank it up.

This checks a couple of things. 1) If the player has the required knowledge to allow for training. 2) If the amount of practice causes a rank change it will increase the rank of the skill and reset the knowledge/practice levels.

Parameters:
userThe character this was for.
Returns:
True if the practice causes a rank change, false if not.
void Skill::Clear ( ) [inline]

Definition at line 340 of file pscharacter.h.

bool Skill::Practice ( unsigned int  amount,
unsigned int actuallyAdded,
psCharacter user 
)

Practice this skill.

This checks a couple of things. 1) If the player has the required knowledge to allow for training. 2) If the amount of practice causes a rank change it will increase the rank of the skill and reset the knowledge/practice levels.

Parameters:
amountThe amount of practice on this skill.
actuallyAdded[CHANGES] If the amount added causes a rank change only the amount required is added and this variable stores that.
userThe character this was for.
Returns:
True if the practice causes a rank change, false if not.
void Skill::Train ( int  yIncrease)

Train a skill by a particular amount.

This does range checking on the training level and will cap it at the max allowable level.

Parameters:
yIncreaseThe amount to try to increase the skill by.

Member Data Documentation

Flag if this was changed after load from database.

Definition at line 332 of file pscharacter.h.

Database information about the skill.

Definition at line 334 of file pscharacter.h.

Skill rank (buffable)

Definition at line 326 of file pscharacter.h.

Knowledge Level.

Definition at line 325 of file pscharacter.h.

Cost in y points.

Definition at line 329 of file pscharacter.h.

Cost in y points of next level.

Definition at line 331 of file pscharacter.h.

Practice value.

Definition at line 324 of file pscharacter.h.

Cost in Z points.

Definition at line 328 of file pscharacter.h.

Cost in Z points of next level.

Definition at line 330 of file pscharacter.h.


The documentation for this struct was generated from the following file: