mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
feat: show blocked amount and reduced damage on VICTIMSTATE_BLOCKS
When an attack is partially blocked, the server sends the remaining damage in totalDamage and the blocked amount in data.blocked. Show both: the damage taken and a 'Block N' entry. When block amount is zero (full block with no damage), just show 'Block'.
This commit is contained in:
parent
d1c5e09127
commit
fb01361837
2 changed files with 8 additions and 2 deletions
|
|
@ -13543,7 +13543,10 @@ void GameHandler::handleAttackerStateUpdate(network::Packet& packet) {
|
|||
} else if (data.victimState == 2) {
|
||||
addCombatText(CombatTextEntry::PARRY, 0, 0, isPlayerAttacker);
|
||||
} else if (data.victimState == 4) {
|
||||
addCombatText(CombatTextEntry::BLOCK, 0, 0, isPlayerAttacker);
|
||||
// VICTIMSTATE_BLOCKS: show reduced damage and the blocked amount
|
||||
if (data.totalDamage > 0)
|
||||
addCombatText(CombatTextEntry::MELEE_DAMAGE, data.totalDamage, 0, isPlayerAttacker);
|
||||
addCombatText(CombatTextEntry::BLOCK, static_cast<int32_t>(data.blocked), 0, isPlayerAttacker);
|
||||
} else if (data.victimState == 5) {
|
||||
// VICTIMSTATE_EVADE: NPC evaded (out of combat zone). Show as miss.
|
||||
addCombatText(CombatTextEntry::MISS, 0, 0, isPlayerAttacker);
|
||||
|
|
|
|||
|
|
@ -5173,7 +5173,10 @@ void GameScreen::renderCombatText(game::GameHandler& gameHandler) {
|
|||
: ImVec4(0.4f, 0.9f, 1.0f, alpha);
|
||||
break;
|
||||
case game::CombatTextEntry::BLOCK:
|
||||
snprintf(text, sizeof(text), outgoing ? "Block" : "You Block");
|
||||
if (entry.amount > 0)
|
||||
snprintf(text, sizeof(text), outgoing ? "Block %d" : "You Block %d", entry.amount);
|
||||
else
|
||||
snprintf(text, sizeof(text), outgoing ? "Block" : "You Block");
|
||||
color = outgoing ? ImVec4(0.6f, 0.6f, 0.6f, alpha)
|
||||
: ImVec4(0.4f, 0.9f, 1.0f, alpha);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue