mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
fix(combattext): render evade results explicitly
This commit is contained in:
parent
6095170167
commit
57265bfa4f
3 changed files with 17 additions and 5 deletions
|
|
@ -51,7 +51,7 @@ struct ActionBarSlot {
|
|||
struct CombatTextEntry {
|
||||
enum Type : uint8_t {
|
||||
MELEE_DAMAGE, SPELL_DAMAGE, HEAL, MISS, DODGE, PARRY, BLOCK,
|
||||
CRIT_DAMAGE, CRIT_HEAL, PERIODIC_DAMAGE, PERIODIC_HEAL, ENVIRONMENTAL,
|
||||
EVADE, CRIT_DAMAGE, CRIT_HEAL, PERIODIC_DAMAGE, PERIODIC_HEAL, ENVIRONMENTAL,
|
||||
ENERGIZE, XP_GAIN, IMMUNE, ABSORB, RESIST, DEFLECT, REFLECT, PROC_TRIGGER,
|
||||
DISPEL, STEAL, INTERRUPT, INSTAKILL
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2721,7 +2721,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
CombatTextEntry::DODGE, // 1=DODGE
|
||||
CombatTextEntry::PARRY, // 2=PARRY
|
||||
CombatTextEntry::BLOCK, // 3=BLOCK
|
||||
CombatTextEntry::MISS, // 4=EVADE
|
||||
CombatTextEntry::EVADE, // 4=EVADE
|
||||
CombatTextEntry::IMMUNE, // 5=IMMUNE
|
||||
CombatTextEntry::DEFLECT, // 6=DEFLECT
|
||||
CombatTextEntry::ABSORB, // 7=ABSORB
|
||||
|
|
@ -16380,8 +16380,8 @@ void GameHandler::handleAttackerStateUpdate(network::Packet& packet) {
|
|||
addCombatText(CombatTextEntry::MELEE_DAMAGE, data.totalDamage, 0, isPlayerAttacker, 0, data.attackerGuid, data.targetGuid);
|
||||
addCombatText(CombatTextEntry::BLOCK, static_cast<int32_t>(data.blocked), 0, isPlayerAttacker, 0, data.attackerGuid, data.targetGuid);
|
||||
} else if (data.victimState == 5) {
|
||||
// VICTIMSTATE_EVADE: NPC evaded (out of combat zone). Show as miss.
|
||||
addCombatText(CombatTextEntry::MISS, 0, 0, isPlayerAttacker, 0, data.attackerGuid, data.targetGuid);
|
||||
// VICTIMSTATE_EVADE: NPC evaded (out of combat zone).
|
||||
addCombatText(CombatTextEntry::EVADE, 0, 0, isPlayerAttacker, 0, data.attackerGuid, data.targetGuid);
|
||||
} else if (data.victimState == 6) {
|
||||
// VICTIMSTATE_IS_IMMUNE: Target is immune to this attack.
|
||||
addCombatText(CombatTextEntry::IMMUNE, 0, 0, isPlayerAttacker, 0, data.attackerGuid, data.targetGuid);
|
||||
|
|
@ -16997,7 +16997,7 @@ void GameHandler::handleSpellGo(network::Packet& packet) {
|
|||
CombatTextEntry::DODGE, // 1=DODGE
|
||||
CombatTextEntry::PARRY, // 2=PARRY
|
||||
CombatTextEntry::BLOCK, // 3=BLOCK
|
||||
CombatTextEntry::MISS, // 4=EVADE
|
||||
CombatTextEntry::EVADE, // 4=EVADE
|
||||
CombatTextEntry::IMMUNE, // 5=IMMUNE
|
||||
CombatTextEntry::DEFLECT, // 6=DEFLECT
|
||||
CombatTextEntry::ABSORB, // 7=ABSORB
|
||||
|
|
|
|||
|
|
@ -8342,6 +8342,11 @@ void GameScreen::renderCombatText(game::GameHandler& gameHandler) {
|
|||
color = outgoing ? ImVec4(0.6f, 0.6f, 0.6f, alpha)
|
||||
: ImVec4(0.4f, 0.9f, 1.0f, alpha);
|
||||
break;
|
||||
case game::CombatTextEntry::EVADE:
|
||||
snprintf(text, sizeof(text), outgoing ? "Evade" : "You Evade");
|
||||
color = outgoing ? ImVec4(0.6f, 0.6f, 0.6f, alpha)
|
||||
: ImVec4(0.4f, 0.9f, 1.0f, alpha);
|
||||
break;
|
||||
case game::CombatTextEntry::PERIODIC_DAMAGE:
|
||||
snprintf(text, sizeof(text), "-%d", entry.amount);
|
||||
color = outgoing ?
|
||||
|
|
@ -20262,6 +20267,13 @@ void GameScreen::renderCombatLog(game::GameHandler& gameHandler) {
|
|||
snprintf(desc, sizeof(desc), "%s blocks %s's attack (%d blocked)", tgt, src, e.amount);
|
||||
color = ImVec4(0.65f, 0.75f, 0.65f, 1.0f);
|
||||
break;
|
||||
case T::EVADE:
|
||||
if (spell)
|
||||
snprintf(desc, sizeof(desc), "%s evades %s's %s", tgt, src, spell);
|
||||
else
|
||||
snprintf(desc, sizeof(desc), "%s evades %s's attack", tgt, src);
|
||||
color = ImVec4(0.65f, 0.65f, 0.65f, 1.0f);
|
||||
break;
|
||||
case T::IMMUNE:
|
||||
if (spell)
|
||||
snprintf(desc, sizeof(desc), "%s is immune to %s", tgt, spell);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue