Skip to content

Commit 5e75a95

Browse files
committed
Merge pull request OpenXcom#1005 from IvanDogovich/patch-3
Add melee availability to statstring conditions
2 parents bba09c9 + eca6849 commit 5e75a95

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

bin/standard/XcomUtil_Statstrings/XcomUtil_Statstrings.rul

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Based on XcomUtil by Scott Jones and BladeFireLight
22
# See http://ufopaedia.org/index.php?title=Statstrings
33
# These are the default statStrings from XcomUtil.
4+
# Melee has been added as a value that can be reported by statstrings. Use "melee:" as the criteria.
45
statStrings:
56
- string: "x"
67
psiStrength: [~, 30]
@@ -31,4 +32,4 @@
3132
- string: "R"
3233
reactions: [60, ~]
3334
- string: "r"
34-
reactions: [50, 59]
35+
reactions: [50, 59]

src/Ruleset/StatString.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ StatString::~StatString()
4343
*/
4444
void StatString::load(const YAML::Node &node)
4545
{
46-
std::string conditionNames[] = {"psiStrength", "psiSkill", "bravery", "strength", "firing", "reactions", "stamina", "tu", "health", "throwing"};
46+
std::string conditionNames[] = {"psiStrength", "psiSkill", "bravery", "strength", "firing", "reactions", "stamina", "tu", "health", "throwing", "melee"};
4747
_stringToBeAddedIfAllConditionsAreMet = node["string"].as<std::string>(_stringToBeAddedIfAllConditionsAreMet);
4848
for (size_t i = 0; i < sizeof(conditionNames)/sizeof(conditionNames[0]); i++)
4949
{
@@ -160,8 +160,9 @@ std::map<std::string, int> StatString::getCurrentStats(UnitStats &currentStats)
160160
currentStatsMap["tu"] = currentStats.tu;
161161
currentStatsMap["health"] = currentStats.health;
162162
currentStatsMap["throwing"] = currentStats.throwing;
163+
currentStatsMap["melee"] = currentStats.melee;
163164
return currentStatsMap;
164165
}
165166

166167

167-
}
168+
}

0 commit comments

Comments
 (0)