From f484859620b73ab4219fe201df35268eb375622d Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Thu, 14 Dec 2017 23:42:02 +0100 Subject: Terser combat messages. --- src/common.hpp | 1 - src/game/units.cpp | 16 +++++++++------- src/text.cpp | 8 +------- 3 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src') 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"; -- cgit