diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-14 23:42:02 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-14 23:42:02 +0100 |
commit | f484859620b73ab4219fe201df35268eb375622d (patch) | |
tree | e27ca88f73ba2428fd10050a460f252eaa21b6b4 | |
parent | ac86313ae58e8274454aa5999d8bdd4d91faa04e (diff) |
Terser combat messages.
-rw-r--r-- | src/common.hpp | 1 | ||||
-rw-r--r-- | src/game/units.cpp | 16 | ||||
-rw-r--r-- | src/text.cpp | 8 |
3 files changed, 10 insertions, 15 deletions
diff --git a/src/common.hpp b/src/common.hpp index d4cebf5..6ce6c11 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -347,7 +347,6 @@ namespace text { UNIT_ATTACK, UNIT_MISS, UNIT_CRITICAL_MISS, - UNIT_HIT, UNIT_CRITICAL_HIT, UNIT_DAMAGE } index_t; diff --git a/src/game/units.cpp b/src/game/units.cpp index 201b7be..0f992f9 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -209,16 +209,18 @@ void unit_t::try_attack(unit_t *target) return; } - ss << " (" << text::get((hit_roll == 20 ? text::UNIT_CRITICAL_HIT : text::UNIT_HIT)) << ")"; - game->interface->print(ss.str()); - dmg_roll = game->roll(&cs.damage_roll); - ss.str(std::string()); - ss << name << " " << text::get(text::UNIT_DAMAGE) << " " << target->name << ": "; - ss << dmg_roll - cs.damage_roll.bonus << " + " << cs.damage_roll.bonus << " = " << dmg_roll; - game->interface->print(ss.str()); + if (hit_roll < 20) { + ss << ", " << text::get(text::UNIT_DAMAGE) << ": "; + ss << dmg_roll - cs.damage_roll.bonus << " + " << cs.damage_roll.bonus << " = " << dmg_roll; + } else { + ss << " (" << text::get(text::UNIT_CRITICAL_HIT) << ")" << ", " << text::get(text::UNIT_DAMAGE) << ": "; + ss << "(" << dmg_roll - cs.damage_roll.bonus << " + " << cs.damage_roll.bonus << ") x 2 = " << dmg_roll * 2; + dmg_roll *= 2; + } + game->interface->print(ss.str()); target->damage(dmg_roll, this); } diff --git a/src/text.cpp b/src/text.cpp index de335eb..898466f 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -43,14 +43,11 @@ static std::string get_english(index_t index) case UNIT_CRITICAL_MISS: return "critical miss"; - case UNIT_HIT: - return "hit"; - case UNIT_CRITICAL_HIT: return "critical hit"; case UNIT_DAMAGE: - return "deals damage to"; + return "deals damage"; default: abort(); @@ -90,9 +87,6 @@ static std::string get_polish(index_t index) case UNIT_CRITICAL_MISS: return "chybienie krytyczne"; - case UNIT_HIT: - return "trafienie"; - case UNIT_CRITICAL_HIT: return "trafienie krytyczne"; |