Skip to content

Commit ccf5942

Browse files
committed
Added two new commendations
1 parent 5cea986 commit ccf5942

3 files changed

Lines changed: 48 additions & 6 deletions

File tree

bin/data/Ruleset/Commendations.rul

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ extraStrings:
297297
STR_MEDAL_FLANKSHOT_DESCRIPTION: "Given to a soldier who has demonstratd great tactic, able to flank and kill enemies."
298298
STR_MEDAL_HEALER_NAME: "Hippocratic Star"
299299
STR_MEDAL_HEALER_DESCRIPTION: "Given to a soldier who has performed medical services in the field."
300+
STR_MEDAL_ALLUFOS_NAME: "UFO Recovery Citation"
301+
STR_MEDAL_ALLUFOS_DESCRIPTION: "Given to a soldier who has participated in missions involving every UFO type."
302+
STR_MEDAL_ALLMISSIONS_NAME: "To Hell and Back Medal"
303+
STR_MEDAL_ALLMISSIONS_DESCRIPTION: "Given to a soldier who as participated in every mission type."
300304
STR_AWARD_0: "First award"
301305
STR_AWARD_1: "Second award"
302306
STR_AWARD_2: "Third award"
@@ -445,6 +449,10 @@ extraStrings:
445449
STR_MEDAL_FLANKSHOT_DESCRIPTION: "Given to a soldier who has demonstratd great tactic, able to flank and kill enemies."
446450
STR_MEDAL_HEALER_NAME: "Hippocratic Star"
447451
STR_MEDAL_HEALER_DESCRIPTION: "Given to a soldier who has performed medical services in the field."
452+
STR_MEDAL_ALLUFOS_NAME: "UFO Recovery Citation"
453+
STR_MEDAL_ALLUFOS_DESCRIPTION: "Given to a soldier who has participated in missions involving every UFO type."
454+
STR_MEDAL_ALLMISSIONS_NAME: "To Hell and Back Medal"
455+
STR_MEDAL_ALLMISSIONS_DESCRIPTION: "Given to a soldier who as participated in every mission type."
448456
STR_AWARD_0: "First award"
449457
STR_AWARD_1: "Second award"
450458
STR_AWARD_2: "Third award"
@@ -947,9 +955,9 @@ extraStrings:
947955
# totalValientCrux
948956
# totalTrapKills
949957
# isDead
950-
# totalHeadShots
951-
# totalRearShots
952-
# totalFlankShots
958+
# totalAllMissionTypes
959+
# totalAllUFOs
960+
# totalWoundsHealed
953961
# The following criteria use a hardcoded noun for the name/description.
954962
# They are INCOMPATIBLE with eachother. If used together,
955963
# the commendation will be given out repeatedly.
@@ -1211,6 +1219,16 @@ commendations:
12111219
sprite: 32
12121220
criteria:
12131221
totalWoundsHealed: [3, 6, 9, 9, 9, 9, 12, 12, 12, 12]
1222+
- type: STR_MEDAL_ALLUFOS_NAME
1223+
description: STR_MEDAL_ALLUFOS_DESCRIPTION
1224+
sprite: 32
1225+
criteria:
1226+
totalAllUFOs: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
1227+
- type: STR_MEDAL_ALLMISSIONS_NAME
1228+
description: STR_MEDAL_ALLMISSIONS_DESCRIPTION
1229+
sprite: 32
1230+
criteria:
1231+
totalAllMissionTypes: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
12141232
ufopaedia:
12151233
- id: STR_MEDAL_MILITARY_CROSS_NAME
12161234
type_id: 7
@@ -1478,6 +1496,20 @@ ufopaedia:
14781496
text: STR_MEDAL_HEALER_MEDAL_UFOPEDIA
14791497
text_width: 164
14801498
listOrder: 6033
1499+
- id: STR_MEDAL_ALLUFOS_NAME
1500+
type_id: 7
1501+
section: STR_HEAVY_WEAPONS_PLATFORMS
1502+
image_id: NIKE_CROSS
1503+
text: STR_MEDAL_ALLUFOS_MEDAL_UFOPEDIA
1504+
text_width: 164
1505+
listOrder: 6033
1506+
- id: STR_MEDAL_ALLMISSIONS_NAME
1507+
type_id: 7
1508+
section: STR_HEAVY_WEAPONS_PLATFORMS
1509+
image_id: NIKE_CROSS
1510+
text: STR_MEDAL_ALLMISSIONS_MEDAL_UFOPEDIA
1511+
text_width: 164
1512+
listOrder: 6033
14811513
# entries below move the HWPs to the Craft Section of the UFOPedia
14821514
- id: STR_TANK_CANNON
14831515
section: STR_XCOM_CRAFT_ARMAMENT

src/Savegame/SoldierDiary.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ SoldierDiary::SoldierDiary() : _killList(), _regionTotal(), _countryTotal(), _ty
4040
_totalShotByFriendlyCounter(0), _totalShotFriendlyCounter(0), _ironManTotal(0), _importantMissionTotal(0), _longDistanceHitCounterTotal(0),
4141
_lowAccuracyHitCounterTotal(0), _shotsFiredCounterTotal(0), _shotsLandedCounterTotal(0), _shotAtCounter10in1Mission(0), _hitCounter5in1Mission(0),
4242
_reactionFireTotal(0), _timesWoundedTotal(0), _valiantCruxTotal(0), _KIA(0), _trapKillTotal(0), _alienBaseAssaultTotal(0), _allAliensKilledTotal(0), _allAliensStunnedTotal(0),
43-
_woundsHealedTotal(0)
43+
_woundsHealedTotal(0), _allUFOs(0), _allMissionTypes(0)
4444
{
4545
}
4646
/**
@@ -110,6 +110,8 @@ void SoldierDiary::load(const YAML::Node& node)
110110
_allAliensKilledTotal = node["allAliensKilledTotal"].as<int>(_allAliensKilledTotal);
111111
_allAliensStunnedTotal = node["_allAliensStunnedTotal"].as<int>(_allAliensStunnedTotal);
112112
_woundsHealedTotal = node["_woundsHealedTotal"].as<int>(_woundsHealedTotal);
113+
_allUFOs = node["_allUFOs"].as<int>(_allUFOs);
114+
_allMissionTypes = node["_allMissionTypes"].as<int>(_allMissionTypes);
113115
}
114116
/**
115117
* Saves the diary to a YAML file.
@@ -159,6 +161,8 @@ YAML::Node SoldierDiary::save() const
159161
if (_allAliensKilledTotal) node["allAliensKilledTotal"] = _allAliensKilledTotal;
160162
if (_allAliensStunnedTotal) node["_allAliensStunnedTotal"] = _allAliensStunnedTotal;
161163
if (_woundsHealedTotal) node["_woundsHealedTotal"] = _woundsHealedTotal;
164+
if (_allUFOs) node["_allUFOs"] = _allUFOs;
165+
if (_allMissionTypes) node["_allMissionTypes"] = _allMissionTypes;
162166
return node;
163167
}
164168
/**
@@ -245,6 +249,10 @@ void SoldierDiary::updateDiary(BattleUnitStatistics *unitStatistics, MissionStat
245249
if (unitStatistics->nikeCross)
246250
_allAliensStunnedTotal++;
247251
_woundsHealedTotal = unitStatistics->woundsHealed++;
252+
if (_UFOTotal.size() >= rules->getUfosList().size())
253+
_allUFOs = 1;
254+
if ((_UFOTotal.size() + _typeTotal.size()) == (rules->getUfosList().size() + rules->getDeploymentsList().size() - 2))
255+
_allMissionTypes = 1;
248256
_missionIdList.push_back(missionStatistics->id);
249257
}
250258
/**
@@ -324,7 +332,9 @@ bool SoldierDiary::manageCommendations(Ruleset *rules)
324332
((*j).first == "totalAlienBaseAssaults" && _alienBaseAssaultTotal < (*j).second.at(nextCommendationLevel["noNoun"])) ||
325333
((*j).first == "totalAllAliensKilled" && _allAliensKilledTotal < (*j).second.at(nextCommendationLevel["noNoun"])) ||
326334
((*j).first == "totalAllAliensStunned" && _allAliensStunnedTotal < (*j).second.at(nextCommendationLevel["noNoun"])) ||
327-
((*j).first == "totalWoundsHealed" && _woundsHealedTotal < (*j).second.at(nextCommendationLevel["noNoun"])) )
335+
((*j).first == "totalWoundsHealed" && _woundsHealedTotal < (*j).second.at(nextCommendationLevel["noNoun"])) ||
336+
((*j).first == "totalAllUFOs" && _allUFOs < (*j).second.at(nextCommendationLevel["noNoun"])) ||
337+
((*j).first == "totalAllMissionTypes" && _allMissionTypes < (*j).second.at(nextCommendationLevel["noNoun"])) )
328338
{
329339
awardCommendationBool = false;
330340
break;

src/Savegame/SoldierDiary.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class SoldierDiary
7676
_terrorMissionTotal, _nightMissionTotal, _nightTerrorMissionTotal, _monthsService, _unconciousTotal, _shotAtCounterTotal, _hitCounterTotal, _ironManTotal,
7777
_importantMissionTotal, _longDistanceHitCounterTotal, _lowAccuracyHitCounterTotal, _shotsFiredCounterTotal, _shotsLandedCounterTotal, _shotAtCounter10in1Mission,
7878
_hitCounter5in1Mission, _reactionFireTotal, _timesWoundedTotal, _valiantCruxTotal, _KIA, _trapKillTotal, _alienBaseAssaultTotal, _allAliensKilledTotal, _allAliensStunnedTotal,
79-
_woundsHealedTotal;
79+
_woundsHealedTotal, _allUFOs, _allMissionTypes;
8080
void manageModularCommendations(std::map<std::string, int> &nextCommendationLevel, std::map<std::string, int> &modularCommendations, std::pair<std::string, int> statTotal, int criteria);
8181
void awardCommendation(std::string type, std::string noun = "noNoun");
8282
public:

0 commit comments

Comments
 (0)