OpenXcom  1.0
Open-source clone of the original X-Com
Public Member Functions | List of all members
OpenXcom::SoldierDiary Class Reference

Public Member Functions

 SoldierDiary ()
 Construct a diary. More...
 
 ~SoldierDiary ()
 Deconstruct a diary.
 
void load (const YAML::Node &node, const Mod *mod)
 Load a diary. More...
 
YAML::Node save () const
 Save a diary. More...
 
void updateDiary (BattleUnitStatistics *, std::vector< MissionStatistics *> *, Mod *)
 Update the diary statistics. More...
 
std::map< std::string, int > getAlienRankTotal ()
 Get the list of kills, mapped by rank. More...
 
std::map< std::string, int > getAlienRaceTotal ()
 Get the list of kills, mapped by race.
 
std::map< std::string, int > getWeaponTotal ()
 Get the list of kills, mapped by weapon used.
 
std::map< std::string, int > getWeaponAmmoTotal ()
 Get the list of kills, mapped by weapon ammo used.
 
std::map< std::string, int > getRegionTotal (std::vector< MissionStatistics *> *) const
 Get the list of missions, mapped by region. More...
 
std::map< std::string, int > getCountryTotal (std::vector< MissionStatistics *> *) const
 Get the list of missions, mapped by country. More...
 
std::map< std::string, int > getTypeTotal (std::vector< MissionStatistics *> *) const
 Get the list of missions, mapped by type. More...
 
std::map< std::string, int > getUFOTotal (std::vector< MissionStatistics *> *) const
 Get the list of missions, mapped by UFO. More...
 
int getKillTotal () const
 Get the total number of kills.
 
int getMissionTotal () const
 Get the total number of missions.
 
int getWinTotal (std::vector< MissionStatistics *> *) const
 Get the total number of wins. More...
 
int getStunTotal () const
 Get the total number of stuns.
 
int getPanickTotal () const
 Get the total number of psi panicks.
 
int getControlTotal () const
 Get the total number of psi mind controls.
 
int getDaysWoundedTotal () const
 Get the total number of days wounded.
 
std::vector< SoldierCommendations * > * getSoldierCommendations ()
 Get the solder's commendations. More...
 
bool manageCommendations (Mod *, std::vector< MissionStatistics *> *)
 Manage commendations, return true if a medal is awarded. More...
 
void addMonthlyService ()
 Increment the soldier's service time. More...
 
int getMonthsService () const
 Get the total months in service. More...
 
std::vector< int > & getMissionIdList ()
 Get the mission id list. More...
 
std::vector< BattleUnitKills * > & getKills ()
 Get the kill list. More...
 
void awardOriginalEightCommendation ()
 Award special commendation to the original 8 soldiers.
 
void awardBestOfRank (int score)
 Award post-humous best-of rank commendation. More...
 
void awardBestOverall (int score)
 Award post-humous best overall commendation. More...
 
void awardPostMortemKill (int kills)
 Award post-humous kills commendation.
 
int getShotsFiredTotal () const
 Get the total number of shots fired.
 
int getShotsLandedTotal () const
 Get the total number of shots landed on target.
 
int getAccuracy () const
 Get the soldier's accuracy.
 
int getTrapKillTotal (Mod *) const
 Get the total number of trap kills. More...
 
int getReactionFireKillTotal (Mod *) const
 Get the total number of reaction fire kills. More...
 
int getTerrorMissionTotal (std::vector< MissionStatistics *> *) const
 Get the total number of terror missions. More...
 
int getNightMissionTotal (std::vector< MissionStatistics *> *) const
 Get the total number of night missions. More...
 
int getNightTerrorMissionTotal (std::vector< MissionStatistics *> *) const
 Get the total number of night terror missions. More...
 
int getBaseDefenseMissionTotal (std::vector< MissionStatistics *> *) const
 Get the total number of base defense missions. More...
 
int getAlienBaseAssaultTotal (std::vector< MissionStatistics *> *) const
 Get the total number of alien base assaults. More...
 
int getImportantMissionTotal (std::vector< MissionStatistics *> *) const
 Get the total number of important missions. More...
 
int getScoreTotal (std::vector< MissionStatistics *> *) const
 Get the total score. More...
 
int getValiantCruxTotal (std::vector< MissionStatistics *> *) const
 Get the Valiant Crux total. More...
 
int getLootValueTotal (std::vector< MissionStatistics *> *) const
 Get the loot value total. More...
 

Constructor & Destructor Documentation

◆ SoldierDiary()

OpenXcom::SoldierDiary::SoldierDiary ( )

Construct a diary.

Initializes a new blank diary.

Member Function Documentation

◆ addMonthlyService()

void OpenXcom::SoldierDiary::addMonthlyService ( )

Increment the soldier's service time.

Increment soldier's service time one month.

◆ awardBestOfRank()

void OpenXcom::SoldierDiary::awardBestOfRank ( int  score)

Award post-humous best-of rank commendation.

Award post-humous best-of commendation.

◆ awardBestOverall()

void OpenXcom::SoldierDiary::awardBestOverall ( int  score)

Award post-humous best overall commendation.

Award post-humous best-of commendation.

◆ getAlienBaseAssaultTotal()

int OpenXcom::SoldierDiary::getAlienBaseAssaultTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the total number of alien base assaults.

Get the total of alien base assaults.

Parameters
MissionStatistics

◆ getAlienRankTotal()

std::map< std::string, int > OpenXcom::SoldierDiary::getAlienRankTotal ( )

Get the list of kills, mapped by rank.

Get list of kills sorted by rank.

Returns

◆ getBaseDefenseMissionTotal()

int OpenXcom::SoldierDiary::getBaseDefenseMissionTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the total number of base defense missions.

Get the total of base defense missions.

Parameters
MissionStatistics

◆ getCountryTotal()

std::map< std::string, int > OpenXcom::SoldierDiary::getCountryTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the list of missions, mapped by country.

Get a map of the amount of missions done in each country.

Parameters
MissionStatistics

◆ getImportantMissionTotal()

int OpenXcom::SoldierDiary::getImportantMissionTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the total number of important missions.

Get the total of important missions.

Parameters
MissionStatistics

◆ getKills()

std::vector< BattleUnitKills * > & OpenXcom::SoldierDiary::getKills ( )

Get the kill list.

Get vector of kills.

Returns
vector of BattleUnitKills

◆ getLootValueTotal()

int OpenXcom::SoldierDiary::getLootValueTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the loot value total.

Parameters
MissionStatistics

◆ getMissionIdList()

std::vector< int > & OpenXcom::SoldierDiary::getMissionIdList ( )

Get the mission id list.

Get vector of mission ids.

Returns
Vector of mission ids.

◆ getMonthsService()

int OpenXcom::SoldierDiary::getMonthsService ( ) const

Get the total months in service.

Returns the total months this soldier has been in service.

◆ getNightMissionTotal()

int OpenXcom::SoldierDiary::getNightMissionTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the total number of night missions.

Get the total of night missions.

Parameters
MissionStatistics

◆ getNightTerrorMissionTotal()

int OpenXcom::SoldierDiary::getNightTerrorMissionTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the total number of night terror missions.

Get the total of night terror missions.

Parameters
MissionStatistics

◆ getReactionFireKillTotal()

int OpenXcom::SoldierDiary::getReactionFireKillTotal ( Mod mod) const

Get the total number of reaction fire kills.

Get reaction kill total.

◆ getRegionTotal()

std::map< std::string, int > OpenXcom::SoldierDiary::getRegionTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the list of missions, mapped by region.

Get a map of the amount of missions done in each region.

Parameters
MissionStatistics

◆ getScoreTotal()

int OpenXcom::SoldierDiary::getScoreTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the total score.

Parameters
MissionStatistics

◆ getSoldierCommendations()

std::vector< SoldierCommendations * > * OpenXcom::SoldierDiary::getSoldierCommendations ( )

Get the solder's commendations.

Get soldier commendations.

Returns
SoldierCommendations list of soldier's commendations.

◆ getTerrorMissionTotal()

int OpenXcom::SoldierDiary::getTerrorMissionTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the total number of terror missions.

Get the total of terror missions.

Parameters
MissionStatistics

Not a UFO, not the base, not the alien base or colony

◆ getTrapKillTotal()

int OpenXcom::SoldierDiary::getTrapKillTotal ( Mod mod) const

Get the total number of trap kills.

Get trap kills total.

◆ getTypeTotal()

std::map< std::string, int > OpenXcom::SoldierDiary::getTypeTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the list of missions, mapped by type.

Get a map of the amount of missions done in each type.

Parameters
MissionStatistics

◆ getUFOTotal()

std::map< std::string, int > OpenXcom::SoldierDiary::getUFOTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the list of missions, mapped by UFO.

Get a map of the amount of missions done in each UFO.

Parameters
MissionStatistics

◆ getValiantCruxTotal()

int OpenXcom::SoldierDiary::getValiantCruxTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the Valiant Crux total.

Get the Valient Crux total.

Parameters
MissionStatistics

◆ getWinTotal()

int OpenXcom::SoldierDiary::getWinTotal ( std::vector< MissionStatistics *> *  missionStatistics) const

Get the total number of wins.

Get the total if wins.

Parameters
MissionStatistics

◆ load()

void OpenXcom::SoldierDiary::load ( const YAML::Node &  node,
const Mod mod 
)

Load a diary.

Loads the diary from a YAML file.

Parameters
nodeYAML node.

◆ manageCommendations()

bool OpenXcom::SoldierDiary::manageCommendations ( Mod mod,
std::vector< MissionStatistics *> *  missionStatistics 
)

Manage commendations, return true if a medal is awarded.

Manage the soldier's commendations.

Award new ones, if deserved.

Returns
bool Has a commendation been awarded?

End of DETAIL loop.

End of KILLs loop.

End of AND loop.

End of OR loop.

◆ save()

YAML::Node OpenXcom::SoldierDiary::save ( ) const

Save a diary.

Saves the diary to a YAML file.

Returns
YAML node.

◆ updateDiary()

void OpenXcom::SoldierDiary::updateDiary ( BattleUnitStatistics unitStatistics,
std::vector< MissionStatistics *> *  allMissionStatistics,
Mod rules 
)

Update the diary statistics.

Update soldier diary statistics.

Parameters
unitStatisticsBattleUnitStatistics to get stats from.
missionStatisticsMissionStatistics to get stats from.

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