fix(combatlog): render instakill events explicitly

This commit is contained in:
Kelsi 2026-03-13 22:22:00 -07:00
parent 5be55b1b14
commit 3ef5b546fb
3 changed files with 19 additions and 5 deletions

View file

@ -53,7 +53,7 @@ struct CombatTextEntry {
MELEE_DAMAGE, SPELL_DAMAGE, HEAL, MISS, DODGE, PARRY, BLOCK,
CRIT_DAMAGE, CRIT_HEAL, PERIODIC_DAMAGE, PERIODIC_HEAL, ENVIRONMENTAL,
ENERGIZE, XP_GAIN, IMMUNE, ABSORB, RESIST, PROC_TRIGGER,
DISPEL, STEAL, INTERRUPT
DISPEL, STEAL, INTERRUPT, INSTAKILL
};
Type type;
int32_t amount = 0;

View file

@ -6376,11 +6376,9 @@ void GameHandler::handlePacket(network::Packet& packet) {
uint32_t ikSpell = (ik_rem() >= 4) ? packet.readUInt32() : 0;
// Show kill/death feedback for the local player
if (ikCaster == playerGuid) {
// We killed a target instantly — show a KILL combat text hit
addCombatText(CombatTextEntry::MELEE_DAMAGE, 0, ikSpell, true, 0, ikCaster, ikVictim);
addCombatText(CombatTextEntry::INSTAKILL, 0, ikSpell, true, 0, ikCaster, ikVictim);
} else if (ikVictim == playerGuid) {
// We were instantly killed — show a large incoming hit
addCombatText(CombatTextEntry::MELEE_DAMAGE, 0, ikSpell, false, 0, ikCaster, ikVictim);
addCombatText(CombatTextEntry::INSTAKILL, 0, ikSpell, false, 0, ikCaster, ikVictim);
addSystemChatMessage("You were killed by an instant-kill effect.");
}
LOG_DEBUG("SMSG_SPELLINSTAKILLLOG: caster=0x", std::hex, ikCaster,

View file

@ -8414,6 +8414,11 @@ void GameScreen::renderCombatText(game::GameHandler& gameHandler) {
color = ImVec4(1.0f, 0.6f, 0.9f, alpha);
break;
}
case game::CombatTextEntry::INSTAKILL:
snprintf(text, sizeof(text), outgoing ? "Kill!" : "Killed!");
color = outgoing ? ImVec4(1.0f, 0.25f, 0.25f, alpha)
: ImVec4(1.0f, 0.1f, 0.1f, alpha);
break;
default:
snprintf(text, sizeof(text), "%d", entry.amount);
color = ImVec4(1.0f, 1.0f, 1.0f, alpha);
@ -20315,6 +20320,17 @@ void GameScreen::renderCombatLog(game::GameHandler& gameHandler) {
snprintf(desc, sizeof(desc), "%s interrupted", tgt);
color = ImVec4(1.0f, 0.6f, 0.9f, 1.0f);
break;
case T::INSTAKILL:
if (spell && e.isPlayerSource)
snprintf(desc, sizeof(desc), "You instantly kill %s with %s", tgt, spell);
else if (spell)
snprintf(desc, sizeof(desc), "%s instantly kills %s with %s", src, tgt, spell);
else if (e.isPlayerSource)
snprintf(desc, sizeof(desc), "You instantly kill %s", tgt);
else
snprintf(desc, sizeof(desc), "%s instantly kills %s", src, tgt);
color = ImVec4(1.0f, 0.2f, 0.2f, 1.0f);
break;
default:
snprintf(desc, sizeof(desc), "Combat event (type %d, amount %d)", (int)e.type, e.amount);
color = ImVec4(0.7f, 0.7f, 0.7f, 1.0f);