diff options
author | Fedja Beader <fedja@protonmail.ch> | 2024-02-09 13:34:44 +0000 |
---|---|---|
committer | Jesusalva Jesusalva <jesusalva@themanaworld.org> | 2024-02-09 13:34:44 +0000 |
commit | 44c5afd424619e53ea168666d2977834d9c09e85 (patch) | |
tree | b66d975add9f36aee287b7e2c30f72e8f808147d | |
parent | 23ef2073c81f3c98075161ebd0ee6084967aefc5 (diff) | |
download | plus-44c5afd424619e53ea168666d2977834d9c09e85.tar.gz plus-44c5afd424619e53ea168666d2977834d9c09e85.tar.bz2 plus-44c5afd424619e53ea168666d2977834d9c09e85.tar.xz plus-44c5afd424619e53ea168666d2977834d9c09e85.zip |
Log misses in battle tab, alongside hits
-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) |