summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/units.cpp16
1 files changed, 9 insertions, 7 deletions
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);
}