OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents a soldier hired by the player. More...
#include <Soldier.h>
Public Member Functions | |
Soldier (RuleSoldier *rules, Armor *armor, const std::vector< SoldierNamePool * > *names=0, int id=0) | |
Creates a new soldier. More... | |
~Soldier () | |
Cleans up the soldier. | |
void | load (const YAML::Node &node, const Ruleset *rule, SavedGame *save) |
Loads the soldier from YAML. More... | |
YAML::Node | save () const |
Saves the soldier to YAML. More... | |
std::wstring | getName (bool statstring=false, unsigned int maxLength=20) const |
Gets the soldier's name. More... | |
void | setName (const std::wstring &name) |
Sets the soldier's name. More... | |
Craft * | getCraft () const |
Gets the soldier's craft. More... | |
void | setCraft (Craft *craft) |
Sets the soldier's craft. More... | |
std::wstring | getCraftString (Language *lang) const |
Gets the soldier's craft string. More... | |
std::string | getRankString () const |
Gets a string version of the soldier's rank. More... | |
int | getRankSprite () const |
Gets a sprite version of the soldier's rank. More... | |
SoldierRank | getRank () const |
Gets the soldier's rank. More... | |
void | promoteRank () |
Increase the soldier's military rank. | |
int | getMissions () const |
Gets the soldier's missions. More... | |
int | getKills () const |
Gets the soldier's kills. More... | |
SoldierGender | getGender () const |
Gets the soldier's gender. More... | |
SoldierLook | getLook () const |
Gets the soldier's look. More... | |
RuleSoldier * | getRules () const |
Gets soldier rules. More... | |
int | getId () const |
Gets the soldier's unique ID. More... | |
void | addMissionCount () |
Add a mission to the counter. | |
void | addKillCount (int count) |
Add a kill to the counter. | |
UnitStats * | getInitStats () |
Get pointer to initial stats. | |
UnitStats * | getCurrentStats () |
Get pointer to current stats. | |
bool | isPromoted () |
Get whether the unit was recently promoted. More... | |
Armor * | getArmor () const |
Gets the soldier armor. More... | |
void | setArmor (Armor *armor) |
Sets the soldier armor. More... | |
int | getWoundRecovery () const |
Gets the soldier's wound recovery time. More... | |
void | setWoundRecovery (int recovery) |
Sets the soldier's wound recovery time. More... | |
void | heal () |
Heals wound recoveries. More... | |
std::vector < EquipmentLayoutItem * > * | getEquipmentLayout () |
Gets the soldier's equipment-layout. More... | |
void | trainPsi () |
Trains a soldier's psychic stats. More... | |
void | trainPsi1Day () |
Trains a soldier's psionic abilities (anytimePsiTraining option). More... | |
bool | isInPsiTraining () |
Returns whether the unit is in psi training or not. More... | |
void | setPsiTraining () |
set the psi training status More... | |
int | getImprovement () |
returns this soldier's psionic improvement score for this month. More... | |
SoldierDeath * | getDeath () const |
Gets the soldier death info. More... | |
void | die (SoldierDeath *death) |
Kills the soldier. More... | |
void | calcStatString (const std::vector< StatString * > &statStrings, bool psiStrengthEval) |
Calculate statString. More... | |
Represents a soldier hired by the player.
Soldiers have a wide variety of stats that affect their performance during battles.
OpenXcom::Soldier::Soldier | ( | RuleSoldier * | rules, |
Armor * | armor, | ||
const std::vector< SoldierNamePool * > * | names = 0 , |
||
int | id = 0 |
||
) |
void OpenXcom::Soldier::calcStatString | ( | const std::vector< StatString * > & | statStrings, |
bool | psiStrengthEval | ||
) |
Calculate statString.
Calculates the soldier's statString.
statStrings | List of statString rules. |
psiStrengthEval | Are psi stats available? |
void OpenXcom::Soldier::die | ( | SoldierDeath * | death | ) |
Kills the soldier.
Kills the soldier in the Geoscape.
death | Pointer to death data. |
Armor * OpenXcom::Soldier::getArmor | ( | ) | const |
Gets the soldier armor.
Returns the unit's current armor.
Craft * OpenXcom::Soldier::getCraft | ( | ) | const |
Gets the soldier's craft.
Returns the craft the soldier is assigned to.
std::wstring OpenXcom::Soldier::getCraftString | ( | Language * | lang | ) | const |
Gets the soldier's craft string.
Returns the soldier's craft string, which is either the soldier's wounded status, the assigned craft name, or none.
lang | Language to get strings from. |
SoldierDeath * OpenXcom::Soldier::getDeath | ( | ) | const |
Gets the soldier death info.
Returns the soldier's death details.
std::vector< EquipmentLayoutItem * > * OpenXcom::Soldier::getEquipmentLayout | ( | ) |
Gets the soldier's equipment-layout.
Returns the list of EquipmentLayoutItems of a soldier.
SoldierGender OpenXcom::Soldier::getGender | ( | ) | const |
Gets the soldier's gender.
Returns the soldier's gender.
int OpenXcom::Soldier::getId | ( | ) | const |
Gets the soldier's unique ID.
Returns the soldier's unique ID.
Each soldier can be identified by its ID. (not it's name)
int OpenXcom::Soldier::getImprovement | ( | ) |
returns this soldier's psionic improvement score for this month.
int OpenXcom::Soldier::getKills | ( | ) | const |
Gets the soldier's kills.
Returns the soldier's amount of kills.
SoldierLook OpenXcom::Soldier::getLook | ( | ) | const |
Gets the soldier's look.
Returns the soldier's look.
int OpenXcom::Soldier::getMissions | ( | ) | const |
Gets the soldier's missions.
Returns the soldier's amount of missions.
std::wstring OpenXcom::Soldier::getName | ( | bool | statstring = false , |
unsigned int | maxLength = 20 |
||
) | const |
Gets the soldier's name.
Returns the soldier's full name (and, optionally, statString).
statstring | Add stat string? |
maxLength | Restrict length to a certain value. |
SoldierRank OpenXcom::Soldier::getRank | ( | ) | const |
Gets the soldier's rank.
Returns the soldier's military rank.
int OpenXcom::Soldier::getRankSprite | ( | ) | const |
Gets a sprite version of the soldier's rank.
Returns a graphic representation of the soldier's military rank.
std::string OpenXcom::Soldier::getRankString | ( | ) | const |
Gets a string version of the soldier's rank.
Returns a localizable-string representation of the soldier's military rank.
RuleSoldier * OpenXcom::Soldier::getRules | ( | ) | const |
Gets soldier rules.
Returns the soldier's rules.
int OpenXcom::Soldier::getWoundRecovery | ( | ) | const |
Gets the soldier's wound recovery time.
Returns the amount of time until the soldier is healed.
void OpenXcom::Soldier::heal | ( | ) |
Heals wound recoveries.
Heals soldier wounds.
bool OpenXcom::Soldier::isInPsiTraining | ( | ) |
Returns whether the unit is in psi training or not.
returns whether or not the unit is in psi training
bool OpenXcom::Soldier::isPromoted | ( | ) |
Get whether the unit was recently promoted.
Returns the unit's promotion status and resets it.
Loads the soldier from YAML.
Loads the soldier from a YAML file.
node | YAML node. |
rule | Game ruleset. |
save | Pointer to savegame. |
YAML::Node OpenXcom::Soldier::save | ( | ) | const |
Saves the soldier to YAML.
Saves the soldier to a YAML file.
void OpenXcom::Soldier::setArmor | ( | Armor * | armor | ) |
Sets the soldier armor.
Changes the unit's current armor.
armor | Pointer to armor data. |
void OpenXcom::Soldier::setCraft | ( | Craft * | craft | ) |
Sets the soldier's craft.
Assigns the soldier to a new craft.
craft | Pointer to craft. |
void OpenXcom::Soldier::setName | ( | const std::wstring & | name | ) |
void OpenXcom::Soldier::setPsiTraining | ( | ) |
set the psi training status
toggles whether or not the unit is in psi training
void OpenXcom::Soldier::setWoundRecovery | ( | int | recovery | ) |
Sets the soldier's wound recovery time.
Changes the amount of time until the soldier is healed.
recovery | Number of days. |
void OpenXcom::Soldier::trainPsi | ( | ) |
Trains a soldier's psychic stats.
Trains a soldier's Psychic abilities after 1 month.
void OpenXcom::Soldier::trainPsi1Day | ( | ) |
Trains a soldier's psionic abilities (anytimePsiTraining option).
Trains a soldier's Psychic abilities after 1 day.
(anytimePsiTraining option)