Skip to content

Commit

Permalink
Fix appearance of HP/SP recovery message
Browse files Browse the repository at this point in the history
* Skill: Recovery messages always appear
* Item: Only appear if HP/SP recovered > 0
* Item that triggers skill: Same as skill
* Does not need to check death state as other code must ensure no hp healed.
  • Loading branch information
fmatthew5876 committed Nov 29, 2018
1 parent 662938f commit 24f6a03
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/game_battlealgorithm.cpp
Expand Up @@ -439,7 +439,7 @@ void Game_BattleAlgorithm::AlgorithmBase::GetResultMessages(std::vector<std::str
if (GetAffectedHp() != -1) {

if (IsPositive()) {
if (!GetTarget()->IsDead()) {
if (GetAffectedHp() > 0 || GetType() != Type::Item) {
out_replace.push_back(0);
out.push_back(GetHpSpRecoveredMessage(GetAffectedHp(), Data::terms.health_points));
}
Expand Down Expand Up @@ -481,9 +481,10 @@ void Game_BattleAlgorithm::AlgorithmBase::GetResultMessages(std::vector<std::str
if (GetAffectedSp() != -1) {
out_replace.push_back(0);
if (IsPositive()) {
out.push_back(GetHpSpRecoveredMessage(GetAffectedSp(), Data::terms.spirit_points));
}
else if (GetAffectedSp() > 0) {
if (GetAffectedSp() > 0 || GetType() != Type::Item) {
out.push_back(GetHpSpRecoveredMessage(GetAffectedSp(), Data::terms.spirit_points));
}
} else if (GetAffectedSp() > 0) {
if (IsAbsorb()) {
out.push_back(GetHpSpAbsorbedMessage(GetAffectedSp(), Data::terms.spirit_points));
}
Expand Down

0 comments on commit 24f6a03

Please sign in to comment.