mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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.
This commit is contained in:
parent
e902375763
commit
d2ae4d8215
2 changed files with 16 additions and 3 deletions
|
|
@ -13548,7 +13548,12 @@ void GameHandler::handleSpellDamageLog(network::Packet& packet) {
|
|||
}
|
||||
|
||||
auto type = data.isCrit ? CombatTextEntry::CRIT_DAMAGE : CombatTextEntry::SPELL_DAMAGE;
|
||||
addCombatText(type, static_cast<int32_t>(data.damage), data.spellId, isPlayerSource);
|
||||
if (data.damage > 0)
|
||||
addCombatText(type, static_cast<int32_t>(data.damage), data.spellId, isPlayerSource);
|
||||
if (data.absorbed > 0)
|
||||
addCombatText(CombatTextEntry::ABSORB, static_cast<int32_t>(data.absorbed), data.spellId, isPlayerSource);
|
||||
if (data.resisted > 0)
|
||||
addCombatText(CombatTextEntry::RESIST, static_cast<int32_t>(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<int32_t>(data.heal), data.spellId, isPlayerSource);
|
||||
if (data.absorbed > 0)
|
||||
addCombatText(CombatTextEntry::ABSORB, static_cast<int32_t>(data.absorbed), data.spellId, isPlayerSource);
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue