diff options
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index b12b00c08..33610e54b 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -753,7 +753,7 @@ void Being::takeDamage(Being *restrict const attacker, { if (this == localPlayer) { - if (attacker->mType == ActorType::Player || (amount != 0)) + if (amount != 0) { ChatWindow::battleChatLog(strprintf("%s : Hit you -%d", attacker->getName().c_str(), amount), @@ -761,16 +761,36 @@ void Being::takeDamage(Being *restrict const attacker, IgnoreRecord_false, TryRemoveColors_true); } + else + { + ChatWindow::battleChatLog(strprintf("%s : Missed you", + attacker->getName().c_str()), + ChatMsgType::BY_OTHER, + IgnoreRecord_false, + TryRemoveColors_true); + } } - else if (attacker == localPlayer && (amount != 0)) + else if (attacker == localPlayer) { - ChatWindow::battleChatLog(strprintf("%s : You hit %s -%d", - attacker->mName.c_str(), - mName.c_str(), - amount), - ChatMsgType::BY_PLAYER, - IgnoreRecord_false, - TryRemoveColors_true); + if (amount != 0) + { + ChatWindow::battleChatLog(strprintf("%s : You hit %s -%d", + attacker->mName.c_str(), + mName.c_str(), + amount), + ChatMsgType::BY_PLAYER, + IgnoreRecord_false, + TryRemoveColors_true); + } + else + { + ChatWindow::battleChatLog(strprintf("%s : You missed %s", + attacker->mName.c_str(), + mName.c_str()), + ChatMsgType::BY_PLAYER, + IgnoreRecord_false, + TryRemoveColors_true); + } } } if (font != nullptr && particleEngine != nullptr) |