20 #include <yaml-cpp/yaml.h> 21 #include "BattleUnit.h" 22 #include "SavedGame.h" 23 #include "../Mod/Mod.h" 29 struct BattleUnitKills;
37 std::string _type, _noun;
48 void load(
const YAML::Node& node);
50 YAML::Node
save()
const;
73 std::vector<SoldierCommendations*> _commendations;
74 std::vector<BattleUnitKills*> _killList;
75 std::vector<int> _missionIdList;
76 int _daysWoundedTotal, _totalShotByFriendlyCounter, _totalShotFriendlyCounter, _loneSurvivorTotal, _monthsService, _unconciousTotal, _shotAtCounterTotal,
77 _hitCounterTotal, _ironManTotal, _longDistanceHitCounterTotal, _lowAccuracyHitCounterTotal, _shotsFiredCounterTotal, _shotsLandedCounterTotal,
78 _shotAtCounter10in1Mission, _hitCounter5in1Mission, _timesWoundedTotal, _KIA, _allAliensKilledTotal, _allAliensStunnedTotal,
79 _woundsHealedTotal, _allUFOs, _allMissionTypes, _statGainTotal, _revivedUnitTotal, _wholeMedikitTotal, _braveryGainTotal, _bestOfRank, _MIA,
80 _martyrKillsTotal, _postMortemKills, _slaveKillsTotal;
81 bool _bestSoldier, _globeTrotter;
82 void manageModularCommendations(std::map<std::string, int> &nextCommendationLevel, std::map<std::string, int> &modularCommendations, std::pair<std::string, int> statTotal,
int criteria);
83 void awardCommendation(
const std::string& type,
const std::string& noun =
"noNoun");
92 void load(
const YAML::Node& node);
94 YAML::Node
save()
const;
106 std::map<std::string, int>
getRegionTotal(std::vector<MissionStatistics*>*)
const;
108 std::map<std::string, int>
getCountryTotal(std::vector<MissionStatistics*>*)
const;
110 std::map<std::string, int>
getTypeTotal(std::vector<MissionStatistics*>*)
const;
112 std::map<std::string, int>
getUFOTotal(std::vector<MissionStatistics*>*)
const;
118 int getWinTotal(std::vector<MissionStatistics*>*)
const;
138 std::vector<BattleUnitKills*> &
getKills();
~SoldierCommendations()
Cleans up the commendation.
Definition: SoldierDiary.cpp:1188
int getScoreTotal(std::vector< MissionStatistics *> *) const
Get the total score.
Definition: SoldierDiary.cpp:1107
std::string getType() const
Get commendation name.
Definition: SoldierDiary.cpp:1221
Definition: SoldierDiary.h:70
int getImportantMissionTotal(std::vector< MissionStatistics *> *) const
Get the total number of important missions.
Definition: SoldierDiary.cpp:1082
void addDecoration()
Increment decoration level.
Definition: SoldierDiary.cpp:1287
int getPanickTotal() const
Get the total number of psi panicks.
Definition: SoldierDiary.cpp:799
void load(const YAML::Node &node)
Loads the commendation information from YAML.
Definition: SoldierDiary.cpp:1196
SoldierDiary()
Construct a diary.
Definition: SoldierDiary.cpp:40
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
std::string getDecorationLevelName(int skipCounter) const
Get the commendation's decoration level's name.
Definition: SoldierDiary.cpp:1239
std::string getDecorationDescription() const
Get the commendation's decoration description.
Definition: SoldierDiary.cpp:1250
int getWinTotal(std::vector< MissionStatistics *> *) const
Get the total number of wins.
Definition: SoldierDiary.cpp:757
int getShotsLandedTotal() const
Get the total number of shots landed on target.
Definition: SoldierDiary.cpp:899
int getAlienBaseAssaultTotal(std::vector< MissionStatistics *> *) const
Get the total number of alien base assaults.
Definition: SoldierDiary.cpp:1057
void updateDiary(BattleUnitStatistics *, std::vector< MissionStatistics *> *, Mod *)
Update the diary statistics.
Definition: SoldierDiary.cpp:165
int getTerrorMissionTotal(std::vector< MissionStatistics *> *) const
Get the total number of terror missions.
Definition: SoldierDiary.cpp:956
std::vector< SoldierCommendations * > * getSoldierCommendations()
Get the solder's commendations.
Definition: SoldierDiary.cpp:241
void makeOld()
Set the commendation newness to false.
Definition: SoldierDiary.cpp:1278
int getValiantCruxTotal(std::vector< MissionStatistics *> *) const
Get the Valiant Crux total.
Definition: SoldierDiary.cpp:1129
std::map< std::string, int > getCountryTotal(std::vector< MissionStatistics *> *) const
Get the list of missions, mapped by country.
Definition: SoldierDiary.cpp:665
int getControlTotal() const
Get the total number of psi mind controls.
Definition: SoldierDiary.cpp:817
int getShotsFiredTotal() const
Get the total number of shots fired.
Definition: SoldierDiary.cpp:891
int getTrapKillTotal(Mod *) const
Get the total number of trap kills.
Definition: SoldierDiary.cpp:917
void awardOriginalEightCommendation()
Award special commendation to the original 8 soldiers.
Definition: SoldierDiary.cpp:859
void awardBestOfRank(SoldierRank rank)
Award post-humous best-of rank commendation.
Definition: SoldierDiary.cpp:867
std::string getNoun() const
Get commendation noun.
Definition: SoldierDiary.cpp:1230
int getMonthsService() const
Get the total months in service.
Definition: SoldierDiary.cpp:851
SoldierCommendations(const YAML::Node &node)
Creates a new commendation and loads its contents from YAML.
Definition: SoldierDiary.cpp:1173
std::map< std::string, int > getAlienRaceTotal()
Get the list of kills, mapped by race.
Definition: SoldierDiary.cpp:603
~SoldierDiary()
Deconstruct a diary.
Definition: SoldierDiary.cpp:52
void load(const YAML::Node &node)
Load a diary.
Definition: SoldierDiary.cpp:68
int getReactionFireKillTotal(Mod *) const
Get the total number of reaction fire kills.
Definition: SoldierDiary.cpp:936
int getAccuracy() const
Get the soldier's accuracy.
Definition: SoldierDiary.cpp:907
bool isNew() const
Get the newness of the commendation.
Definition: SoldierDiary.cpp:1270
void awardBestOverall()
Award post-humous best overall commendation.
Definition: SoldierDiary.cpp:875
int getDaysWoundedTotal() const
Get the total number of days wounded.
Definition: SoldierDiary.cpp:835
int getStunTotal() const
Get the total number of stuns.
Definition: SoldierDiary.cpp:781
int getKillTotal() const
Get the total number of kills.
Definition: SoldierDiary.cpp:730
int getLootValueTotal(std::vector< MissionStatistics *> *) const
Get the loot value total.
Definition: SoldierDiary.cpp:1151
int getNightMissionTotal(std::vector< MissionStatistics *> *) const
Get the total number of night missions.
Definition: SoldierDiary.cpp:982
std::vector< int > & getMissionIdList()
Get the mission id list.
Definition: SoldierDiary.cpp:572
std::map< std::string, int > getTypeTotal(std::vector< MissionStatistics *> *) const
Get the list of missions, mapped by type.
Definition: SoldierDiary.cpp:687
int getNightTerrorMissionTotal(std::vector< MissionStatistics *> *) const
Get the total number of night terror missions.
Definition: SoldierDiary.cpp:1007
Container for battle unit statistics.
Definition: BattleUnitStatistics.h:304
YAML::Node save() const
Saves the commendation information to YAML.
Definition: SoldierDiary.cpp:1208
void addMonthlyService()
Increment the soldier's service time.
Definition: SoldierDiary.cpp:843
int getDecorationLevelInt() const
Get the commendation's decoration level's int.
Definition: SoldierDiary.cpp:1261
void awardPostMortemKill(int kills)
Award post-humous kills commendation.
Definition: SoldierDiary.cpp:883
std::map< std::string, int > getAlienRankTotal()
Get the list of kills, mapped by rank.
Definition: SoldierDiary.cpp:590
std::map< std::string, int > getWeaponTotal()
Get the list of kills, mapped by weapon used.
Definition: SoldierDiary.cpp:616
bool manageCommendations(Mod *, std::vector< MissionStatistics *> *)
Manage commendations, return true if a medal is awarded.
Definition: SoldierDiary.cpp:251
std::map< std::string, int > getUFOTotal(std::vector< MissionStatistics *> *) const
Get the list of missions, mapped by UFO.
Definition: SoldierDiary.cpp:709
std::map< std::string, int > getWeaponAmmoTotal()
Get the list of kills, mapped by weapon ammo used.
Definition: SoldierDiary.cpp:629
std::vector< BattleUnitKills * > & getKills()
Get the kill list.
Definition: SoldierDiary.cpp:581
int getBaseDefenseMissionTotal(std::vector< MissionStatistics *> *) const
Get the total number of base defense missions.
Definition: SoldierDiary.cpp:1032
Each entry will be its own commendation.
Definition: SoldierDiary.h:34
int getMissionTotal() const
Get the total number of missions.
Definition: SoldierDiary.cpp:748
std::map< std::string, int > getRegionTotal(std::vector< MissionStatistics *> *) const
Get the list of missions, mapped by region.
Definition: SoldierDiary.cpp:643
YAML::Node save() const
Save a diary.
Definition: SoldierDiary.cpp:118
Definition: BaseInfoState.cpp:40