From d2ae4d8215edbbe1b0da362dbaa38a58ab4b2964 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 03:28:19 -0700 Subject: [PATCH] feat: show partial absorb/resist amounts in spell combat text handleSpellDamageLog now emits ABSORB/RESIST entries when data.absorbed or data.resisted are nonzero, so players see 'Absorbed 123' alongside damage numbers (e.g. vs. Power Word: Shield or Ice Barrier). handleSpellHealLog does the same for heal absorbs (e.g. Vampiric Embrace counter-absorbs). renderCombatText now formats amount when nonzero. --- src/game/game_handler.cpp | 9 ++++++++- src/ui/game_screen.cpp | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 34486b53..038f57f8 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -13548,7 +13548,12 @@ void GameHandler::handleSpellDamageLog(network::Packet& packet) { } auto type = data.isCrit ? CombatTextEntry::CRIT_DAMAGE : CombatTextEntry::SPELL_DAMAGE; - addCombatText(type, static_cast(data.damage), data.spellId, isPlayerSource); + if (data.damage > 0) + addCombatText(type, static_cast(data.damage), data.spellId, isPlayerSource); + if (data.absorbed > 0) + addCombatText(CombatTextEntry::ABSORB, static_cast(data.absorbed), data.spellId, isPlayerSource); + if (data.resisted > 0) + addCombatText(CombatTextEntry::RESIST, static_cast(data.resisted), data.spellId, isPlayerSource); } void GameHandler::handleSpellHealLog(network::Packet& packet) { @@ -13561,6 +13566,8 @@ void GameHandler::handleSpellHealLog(network::Packet& packet) { auto type = data.isCrit ? CombatTextEntry::CRIT_HEAL : CombatTextEntry::HEAL; addCombatText(type, static_cast(data.heal), data.spellId, isPlayerSource); + if (data.absorbed > 0) + addCombatText(CombatTextEntry::ABSORB, static_cast(data.absorbed), data.spellId, isPlayerSource); } // ============================================================ diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 4e8c29a5..5f213707 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -5204,11 +5204,17 @@ void GameScreen::renderCombatText(game::GameHandler& gameHandler) { color = ImVec4(0.9f, 0.9f, 0.9f, alpha); // White for immune break; case game::CombatTextEntry::ABSORB: - snprintf(text, sizeof(text), "Absorb"); + if (entry.amount > 0) + snprintf(text, sizeof(text), "Absorbed %d", entry.amount); + else + snprintf(text, sizeof(text), "Absorbed"); color = ImVec4(0.5f, 0.8f, 1.0f, alpha); // Light blue for absorb break; case game::CombatTextEntry::RESIST: - snprintf(text, sizeof(text), "Resist"); + if (entry.amount > 0) + snprintf(text, sizeof(text), "Resisted %d", entry.amount); + else + snprintf(text, sizeof(text), "Resisted"); color = ImVec4(0.7f, 0.7f, 0.7f, alpha); // Grey for resist break; default: