![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
Tests for the CC break-on-damage proc mechanism. More...
#include "AuraStub.h"#include "ProcChanceTestHelper.h"#include "ProcEventInfoHelper.h"#include "SpellMgr.h"#include "WorldMock.h"#include "gtest/gtest.h"Go to the source code of this file.
Classes | |
| class | BreakableCCProcTest |
Functions | |
| static bool | SimulateBreakableCCProc (AuraEffectStub *effect, int32_t damage) |
| Simulates HandleBreakableCCAuraProc logic. | |
| static int32_t | SimulateCCThreshold (uint8_t casterLevel) |
| Simulates CalculateAmount for CC auras. | |
| TEST_F (BreakableCCProcTest, SmallDamage_ReducesThreshold_AuraSurvives) | |
| TEST_F (BreakableCCProcTest, ExactThresholdDamage_RemovesAura) | |
| TEST_F (BreakableCCProcTest, ExceedThresholdDamage_RemovesAura) | |
| TEST_F (BreakableCCProcTest, MultipleDamageHits_AccumulateUntilBreak) | |
| TEST_F (BreakableCCProcTest, MultipleDamageHits_OvershootBreak) | |
| TEST_F (BreakableCCProcTest, OneDamage_ReducesThreshold) | |
| TEST_F (BreakableCCProcTest, Level80Threshold_IsReasonable) | |
| TEST_F (BreakableCCProcTest, LowerLevelCaster_LowerThreshold) | |
| TEST_F (BreakableCCProcTest, Level80Fear_BreaksOnModerateDamage) | |
| TEST_F (BreakableCCProcTest, Level80Fear_SurvivesSmallDots) | |
| TEST_F (BreakableCCProcTest, FearProcEntry_MatchesTakenMeleeDamage) | |
| TEST_F (BreakableCCProcTest, FearProcEntry_MatchesTakenSpellDamage) | |
| TEST_F (BreakableCCProcTest, FearProcEntry_DoesNotMatchHealEvent) | |
| TEST_F (BreakableCCProcTest, FearProcChance_Is100Percent) | |
| TEST_F (BreakableCCProcTest, GlyphOfFear_IncreasesThreshold) | |
Tests for the CC break-on-damage proc mechanism.
CC auras (Fear, Polymorph, Stun, Root, Transform) have a damage threshold set in CalculateAmount. When damage is taken, HandleBreakableCCAuraProc subtracts the damage from the threshold and removes the aura when it reaches zero.
The threshold is calculated as: BaseHealth(casterLevel, CLASS_WARRIOR) / 4.75
This gives level 80 a threshold of ~2648 HP (12588 / 4.75).
Definition in file BreakableCCProcTest.cpp.
|
static |
Simulates HandleBreakableCCAuraProc logic.
Mirrors AuraEffect::HandleBreakableCCAuraProc from SpellAuraEffects.cpp: damageLeft = GetAmount() - damage if (damageLeft <= 0) remove aura else SetAmount(damageLeft)
| effect | The CC aura effect stub (amount = damage threshold) |
| damage | Damage dealt to the CC'd target |
References AuraEffectStub::GetAmount(), and AuraEffectStub::SetAmount().
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
static |
Simulates CalculateAmount for CC auras.
Mirrors AuraEffect::CalculateAmount from SpellAuraEffects.cpp for MOD_FEAR/MOD_CONFUSE/MOD_STUN/MOD_ROOT/TRANSFORM: amount = BaseHealth(casterLevel, CLASS_WARRIOR) / 4.75
Uses known Warrior base health values from CreatureBaseStats DBC.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| TEST_F | ( | BreakableCCProcTest | , |
| ExactThresholdDamage_RemovesAura | |||
| ) |
References SimulateBreakableCCProc().
| TEST_F | ( | BreakableCCProcTest | , |
| ExceedThresholdDamage_RemovesAura | |||
| ) |
References SimulateBreakableCCProc().
| TEST_F | ( | BreakableCCProcTest | , |
| FearProcChance_Is100Percent | |||
| ) |
References SpellProcEntryBuilder::Build(), ProcChanceTestHelper::SimulateCalcProcChance(), and SpellProcEntryBuilder::WithChance().
| TEST_F | ( | BreakableCCProcTest | , |
| FearProcEntry_DoesNotMatchHealEvent | |||
| ) |
References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK, PROC_FLAG_TAKEN_PERIODIC, PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS, PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS, PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG, PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_TYPE_HEAL, sSpellMgr, SpellProcEntryBuilder::WithChance(), ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), ProcEventInfoBuilder::WithSpellPhaseMask(), SpellProcEntryBuilder::WithSpellPhaseMask(), ProcEventInfoBuilder::WithSpellTypeMask(), SpellProcEntryBuilder::WithSpellTypeMask(), and ProcEventInfoBuilder::WithTypeMask().
| TEST_F | ( | BreakableCCProcTest | , |
| FearProcEntry_MatchesTakenMeleeDamage | |||
| ) |
References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK, PROC_FLAG_TAKEN_PERIODIC, PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS, PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG, PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_DAMAGE, sSpellMgr, SpellProcEntryBuilder::WithChance(), ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), ProcEventInfoBuilder::WithSpellPhaseMask(), SpellProcEntryBuilder::WithSpellPhaseMask(), ProcEventInfoBuilder::WithSpellTypeMask(), SpellProcEntryBuilder::WithSpellTypeMask(), and ProcEventInfoBuilder::WithTypeMask().
| TEST_F | ( | BreakableCCProcTest | , |
| FearProcEntry_MatchesTakenSpellDamage | |||
| ) |
References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK, PROC_FLAG_TAKEN_PERIODIC, PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS, PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG, PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_DAMAGE, sSpellMgr, SpellProcEntryBuilder::WithChance(), ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), ProcEventInfoBuilder::WithSpellPhaseMask(), SpellProcEntryBuilder::WithSpellPhaseMask(), ProcEventInfoBuilder::WithSpellTypeMask(), SpellProcEntryBuilder::WithSpellTypeMask(), and ProcEventInfoBuilder::WithTypeMask().
| TEST_F | ( | BreakableCCProcTest | , |
| GlyphOfFear_IncreasesThreshold | |||
| ) |
References SimulateBreakableCCProc(), and SimulateCCThreshold().
| TEST_F | ( | BreakableCCProcTest | , |
| Level80Fear_BreaksOnModerateDamage | |||
| ) |
References SimulateBreakableCCProc(), and SimulateCCThreshold().
| TEST_F | ( | BreakableCCProcTest | , |
| Level80Fear_SurvivesSmallDots | |||
| ) |
References SimulateBreakableCCProc(), and SimulateCCThreshold().
| TEST_F | ( | BreakableCCProcTest | , |
| Level80Threshold_IsReasonable | |||
| ) |
References SimulateCCThreshold().
| TEST_F | ( | BreakableCCProcTest | , |
| LowerLevelCaster_LowerThreshold | |||
| ) |
References SimulateCCThreshold().
| TEST_F | ( | BreakableCCProcTest | , |
| MultipleDamageHits_AccumulateUntilBreak | |||
| ) |
References SimulateBreakableCCProc().
| TEST_F | ( | BreakableCCProcTest | , |
| MultipleDamageHits_OvershootBreak | |||
| ) |
References SimulateBreakableCCProc().
| TEST_F | ( | BreakableCCProcTest | , |
| OneDamage_ReducesThreshold | |||
| ) |
References SimulateBreakableCCProc().
| TEST_F | ( | BreakableCCProcTest | , |
| SmallDamage_ReducesThreshold_AuraSurvives | |||
| ) |
References SimulateBreakableCCProc().