Planeshift
Public Member Functions | Protected Attributes

SkillSet Class Reference

A list of skills. More...

#include <pscharacter.h>

List of all members.

Public Member Functions

int AddSkillPractice (psSkillInfo *skill, unsigned int val)
 Add skill practice.
int AddSkillPractice (PSSKILL skill, unsigned int val)
 Add skill practice.
bool AddToSkillPractice (PSSKILL skill, unsigned int val, unsigned int &added)
 Add some practice to a skill.
void Calculate ()
 Update the costs for all the skills.
bool CanTrain (PSSKILL skill)
 Figure out if this skill can be trained.
void CheckDoRank (PSSKILL skill)
 Checks if a skill should rank and ranks it.
SkillGet (PSSKILL skill)
unsigned int GetBestSkillSlot (bool withBuff)
 Get the slot that is the best skill in the set.
unsigned int GetSkillKnowledge (PSSKILL skill)
 Get the current knowledge level of a skill.
unsigned int GetSkillPractice (PSSKILL skill)
 Get the current practice level of a skill.
SkillRankGetSkillRank (PSSKILL which)
 Get the current rank of a skill.
void SetSkillInfo (PSSKILL which, psSkillInfo *info, bool recalculatestats=true)
 Sets the common skill info for this skill ( data from the database ).
void SetSkillKnowledge (PSSKILL which, int y_value)
 Set a skill knowledge level.
void SetSkillPractice (PSSKILL which, int z_value)
 Sets the practice level for the skill.
void SetSkillRank (PSSKILL which, unsigned int rank, bool recalculatestats=true)
 Set a skill rank level.
 SkillSet (psCharacter *self)
 Constructor.
void Train (PSSKILL skill, int yIncrease)
 Trains a skill.

Protected Attributes

csArray< Skillskills
 Array to store all the skills.

Detailed Description

A list of skills.

This maintains a list of all the skills and the player's current levels in them.

Definition at line 407 of file pscharacter.h.


Constructor & Destructor Documentation

SkillSet::SkillSet ( psCharacter self)

Constructor.

Parameters:
selfThe psCharacter this skillset is associated with.

Member Function Documentation

int SkillSet::AddSkillPractice ( psSkillInfo skill,
unsigned int  val 
)

Add skill practice.

int SkillSet::AddSkillPractice ( PSSKILL  skill,
unsigned int  val 
)

Add skill practice.

bool SkillSet::AddToSkillPractice ( PSSKILL  skill,
unsigned int  val,
unsigned int added 
)

Add some practice to a skill.

Parameters:
skillThe skill we want to practice
valThe amount we want to practice the skill by. This value could be capped if the amount of practice causes a rank up.
added[CHANGES] The amount the skill changed by ( if any )
Returns:
True if practice caused a rank up.
void SkillSet::Calculate ( )

Update the costs for all the skills.

bool SkillSet::CanTrain ( PSSKILL  skill)

Figure out if this skill can be trained.

Checks the current knowledge of the skill. If it is already maxed out then can train no more.

Parameters:
skillThe skill we want to train.
Returns:
True if the skill still requires Y credits before it is fully trained.
void SkillSet::CheckDoRank ( PSSKILL  skill)

Checks if a skill should rank and ranks it.

It checks if practice and knowledge is reached to rank the skill.

Parameters:
skillThe skill we want to check.
Skill& SkillSet::Get ( PSSKILL  skill)
unsigned int SkillSet::GetBestSkillSlot ( bool  withBuff)

Get the slot that is the best skill in the set.

Parameters:
withBuffApply any skill buffs?
Returns:
The slot the best skill is in.
unsigned int SkillSet::GetSkillKnowledge ( PSSKILL  skill)

Get the current knowledge level of a skill.

Parameters:
skillthe enum of the skill that we want.
Returns:
The Y value of that skill.
unsigned int SkillSet::GetSkillPractice ( PSSKILL  skill)

Get the current practice level of a skill.

Parameters:
skillthe enum of the skill that we want.
Returns:
The Z value of that skill.
SkillRank& SkillSet::GetSkillRank ( PSSKILL  which)

Get the current rank of a skill.

Parameters:
whichThe skill that we want the rank for.
Returns:
The rank of the requested skill.
void SkillSet::SetSkillInfo ( PSSKILL  which,
psSkillInfo info,
bool  recalculatestats = true 
)

Sets the common skill info for this skill ( data from the database ).

Parameters:
whichThe skill we want to set
infoThe info structure to assign to this skill.
recalculatestatsif true, stats of player will be recalculated taking into account the new skill
void SkillSet::SetSkillKnowledge ( PSSKILL  which,
int  y_value 
)

Set a skill knowledge level.

Sets a skill to a particular knowledge level. This does no checking of allowed values. It just sets it to a particular value.

Parameters:
whichSkill name. One of the PSSKILL enum values.
y_valueThe value to set this skill knowledge at.
void SkillSet::SetSkillPractice ( PSSKILL  which,
int  z_value 
)

Sets the practice level for the skill.

Does no error or range checking on the z value. Simply assigns.

Parameters:
whichThe skill we want to set.
z_valueThe practice level of that skill.
void SkillSet::SetSkillRank ( PSSKILL  which,
unsigned int  rank,
bool  recalculatestats = true 
)

Set a skill rank level.

Sets a skill to a particular rank level. This does no checking of allowed values. It just sets it to a particular value.

Parameters:
whichSkill name. One of the PSSKILL enum values.
rankThe value to set this skill rank at.
recalculatestatsif true, stats of player will be recalculated taking into account the new skill rank
void SkillSet::Train ( PSSKILL  skill,
int  yIncrease 
)

Trains a skill.

It will only train up to the cost of the next rank. So the yIncrease is capped by the cost and anything over will be lost.

Parameters:
skillThe skill we want to train.
yIncreaseThe amount we want to train this skill by.

Member Data Documentation

Array to store all the skills.

Definition at line 410 of file pscharacter.h.


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