Skip to content

Commit e83e567

Browse files
committed
Added new Hellraiser medal
1 parent 8a481b5 commit e83e567

5 files changed

Lines changed: 23 additions & 4 deletions

File tree

196 Bytes
Loading

bin/data/Ruleset/Commendations.rul

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ extraStrings:
8383
STR_MEDAL_LONGEST_NIGHT_DESCRIPTION: "Given to a soldier who has witnessed the horrors of alien terror missions at night."
8484
STR_MEDAL_MEDAL_OF_HEROISM_NAME: "Medal of Heroism"
8585
STR_MEDAL_MEDAL_OF_HEROISM_DESCRIPTION: "Given to a soldier who has fought to the last ounce of strength."
86+
STR_MEDAL_HELLRAISER_MEDAL_NAME: "Hellraiser Medal"
87+
STR_MEDAL_HELLRAISER_MEDAL_DESCRIPITON: "Given to a soldier who has used incendiary weapons to kill aliens."
8688
STR_AWARD_0: "First award"
8789
STR_AWARD_1: "Second award"
8890
STR_AWARD_2: "Third award"
@@ -180,6 +182,8 @@ extraStrings:
180182
STR_MEDAL_LONGEST_NIGHT_DESCRIPTION: "Given to a soldier who has witnessed the horrors of alien terror missions at night."
181183
STR_MEDAL_MEDAL_OF_HEROISM_NAME: "Medal of Heroism"
182184
STR_MEDAL_MEDAL_OF_HEROISM_DESCRIPTION: "Given to a soldier who has fought to the last ounce of strength."
185+
STR_MEDAL_HELLRAISER_MEDAL_NAME: "Hellraiser Medal"
186+
STR_MEDAL_HELLRAISER_MEDAL_DESCRIPITON: "Given to a soldier who has used incendiary weapons to kill aliens."
183187
STR_AWARD_0: "First award"
184188
STR_AWARD_1: "Second award"
185189
STR_AWARD_2: "Third award"
@@ -221,6 +225,7 @@ extraStrings:
221225
# total_night_terror_missions
222226
# total_monthly_service
223227
# total_fell_unconcious
228+
# total_kills_with_fire (only Incendiary Rockets...)
224229
# The following criteria use a hardcoded noun for the name/description.
225230
# They are INCOMPATIBLE with eachother. If used together,
226231
# the commendation will be given out repeatedly.
@@ -282,5 +287,10 @@ commendations:
282287
- type: STR_MEDAL_MEDAL_OF_HEROISM_NAME
283288
description: STR_MEDAL_MEDAL_OF_HEROISM_DESCRIPTION
284289
sprite: 10
290+
criteria:
291+
total_fell_unconcious: [1, 2, 3, 4, 5, 7, 9, 11, 15, 20]
292+
- type: STR_MEDAL_HELLRAISER_MEDAL_NAME
293+
description: STR_MEDAL_HELLRAISER_MEDAL_DESCRIPTION
294+
sprite: 11
285295
criteria:
286296
total_fell_unconcious: [1, 2, 3, 4, 5, 7, 9, 11, 15, 20]

src/Battlescape/BattlescapeGame.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,10 @@ void BattlescapeGame::checkForCasualties(BattleItem *murderweapon, BattleUnit *m
582582
if (murderer->getGeoscapeSoldier() && murderer->getFaction() == FACTION_PLAYER)
583583
{
584584
murderer->getMissionStatistics()->kills.push_back(new SoldierDiaryKills(_alienRank, _alienRace, _weapon, _weaponAmmo, _alienState));
585+
if (_weaponAmmo == "STR_INCENDIARY_ROCKET")
586+
{
587+
murderer->getMissionStatistics()->killsWithFire++;
588+
}
585589
}
586590
murderer->addKillCount();
587591
victim->killedBy(murderer->getFaction());

src/Savegame/SoldierDiary.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void Statistics::load(const YAML::Node& node)
3333
for (YAML::const_iterator i = YAMLkills.begin(); i != YAMLkills.end(); ++i)
3434
kills.push_back(new SoldierDiaryKills(*i));
3535
}
36+
killsWithFire = node["killsWithFire"].as<int>(killsWithFire);
3637
}
3738

3839
YAML::Node Statistics::save() const
@@ -44,6 +45,7 @@ YAML::Node Statistics::save() const
4445
for (std::vector<SoldierDiaryKills*>::const_iterator i = kills.begin() ; i != kills.end() ; ++i)
4546
node["kills"].push_back((*i)->save());
4647
}
48+
node["killsWithFire"] = killsWithFire;
4749
return node;
4850
}
4951

@@ -185,7 +187,8 @@ void SoldierDiary::updateDiary()
185187
if (latestEntry->getMissionStatistics()->wasUnconcious)
186188
{
187189
_unconciousTotal++;
188-
}
190+
}
191+
_killsWithFireTotal += latestEntry->getMissionStatistics()->killsWithFire;
189192
}
190193

191194
/**
@@ -402,7 +405,8 @@ bool SoldierDiary::manageCommendations(Ruleset *rules)
402405
((*j).first == "total_night_missions" && getNightMissionTotal() < (*j).second.at(_nextCommendationLevel[""])) ||
403406
((*j).first == "total_night_terror_missions" && getNightTerrorMissionTotal() < (*j).second.at(_nextCommendationLevel[""])) ||
404407
((*j).first == "total_monthly_service" && _monthsService < (*j).second.at(_nextCommendationLevel[""])) ||
405-
((*j).first == "total_fell_unconcious" && _unconciousTotal < (*j).second.at(_nextCommendationLevel[""])) )
408+
((*j).first == "total_fell_unconcious" && _unconciousTotal < (*j).second.at(_nextCommendationLevel[""])) ||
409+
((*j).first == "total_kills_with_fire" && _killsWithFireTotal < (*j).second.at(_nextCommendationLevel[""])) )
406410
{
407411
_awardCommendation = false;
408412
break;

src/Savegame/SoldierDiary.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ struct Statistics
7373
{
7474
bool wasUnconcious; // Tracks if the soldier fell unconcious
7575
std::vector<SoldierDiaryKills*> kills; // Tracks kills
76+
int killsWithFire; // Tracks kills with fire (currently only Incendiary Rockets)
7677

7778
void load(const YAML::Node& node); // Load function
7879
YAML::Node save() const; // Save function
7980
Statistics(const YAML::Node& node) { load(node); } // Constructor from YAML (needed?)
80-
Statistics() : wasUnconcious(false), kills() { } // Default constructor
81+
Statistics() : wasUnconcious(false), kills(), killsWithFire(0) { } // Default constructor
8182
~Statistics(); // Deconstructor
8283
};
8384

@@ -193,7 +194,7 @@ class SoldierDiary
193194
RuleCommendations *_rules;
194195
std::map<std::string, int> _alienRankTotal, _alienRaceTotal, _weaponTotal, _weaponAmmoTotal, _regionTotal, _countryTotal, _typeTotal, _UFOTotal;
195196
int _scoreTotal, _killTotal, _missionTotal, _winTotal, _stunTotal, _daysWoundedTotal, _baseDefenseMissionTotal,
196-
_terrorMissionTotal, _nightMissionTotal, _nightTerrorMissionTotal, _monthsService, _unconciousTotal;
197+
_terrorMissionTotal, _nightMissionTotal, _nightTerrorMissionTotal, _monthsService, _unconciousTotal, _killsWithFireTotal;
197198

198199
void manageModularCommendations(std::map<std::string, int> nextCommendationLevel, std::map<std::string, int> modularCommendations, std::pair<std::string, int> statTotal, int criteria);
199200
public:

0 commit comments

Comments
 (0)