Files
ForeverCore/tests/game/ClassicRageSwing.cpp
Karrz1 ff699fb5cf Sync with WoW Forever 0.1.34: Blizzlike core
Brings forever up to date with our 0.1.34 code for the WoW Forever client 1.60.1.70862.
Blizzlike only: fixes from real game data (packet captures, live hotfixes, player caches, Wowhead and Questie data,
VMaNGOS for the vanilla world) and server fixes. No custom items or custom content; every rate and option defaults
to Blizzard's behaviour.

What is new since 2ae1313e, in short:
- Clients 70790, 70840 and 70862: message numbers, mail, guild window, charters, contact list, add-on whispers.
- Crash and exploit fixes: guild ranks, loot of emptied veins, quest lookups, taxi mask, battleground templates,
  vendor free buys, item sell price, auction house, falling out of the world, bnetserver request limit.
- Classes, talents, pets and buffs from the live game data and Blizzard's hotfixes of November.
- Quests, NPCs, spawns, trainers, loot, fishing, events, Merchant's Favor crates and writs, sealed crate turn-ins.
- Dungeon and raid scripts (Molten Core, Blackwing Lair, Zul'Gurub, Ahn'Qiraj, Shadowfang Keep, Deadmines ...).
- Pathing fixes that help pets and NPCs.
- Russian creature names, quest titles and quest texts.
- README: Blizzlike stance, branches, repack.
2026-11-09 17:27:57 +00:00

55 lines
2.3 KiB
C++

/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tc_catch2.h"
#include "../../src/server/game/Entities/Unit/ClassicRage.h"
using namespace ClassicRage;
TEST_CASE("Dual Wield Specialization adds its bonus on small off-hand hits", "[ClassicRageSwing]")
{
// 5/5 Dual Wield Specialization (+50%): a 3 damage off-hand hit counts as 4.5, not 4
CHECK(SwingRageDamage(false, 3, 3, 50.0f) == Catch::Approx(4.5f));
// 1/5 (+10%): every hit under 10 damage used to get no bonus at all
for (uint32_t dmg = 1; dmg < 10; ++dmg)
{
INFO("damage " << dmg);
CHECK(SwingRageDamage(false, dmg, dmg, 10.0f) > float(dmg));
CHECK(RageFromDamage(SwingRageDamage(false, dmg, dmg, 10.0f), 20.0f, true) > RageFromDamage(float(dmg), 20.0f, true));
}
}
TEST_CASE("A swing without the talent counts its damage plus absorb", "[ClassicRageSwing]")
{
CHECK(SwingRageDamage(false, 999, 120, 0.0f) == Catch::Approx(120.0f));
}
TEST_CASE("A dodged or parried swing counts 75% of its damage, fraction kept", "[ClassicRageSwing]")
{
CHECK(SwingRageDamage(true, 10, 0, 0.0f) == Catch::Approx(7.5f));
CHECK(SwingRageDamage(true, 1, 0, 0.0f) == Catch::Approx(0.75f));
CHECK(SwingRageDamage(true, 10, 0, 20.0f) == Catch::Approx(9.0f));
}
TEST_CASE("Rage conversion is unchanged: damage / conversion * 7.5 dealt, * 2.5 taken", "[ClassicRageSwing]")
{
float const c60 = 0.0091107836f * 3600.0f + 3.225598133f * 60.0f + 4.2652911f;
CHECK(Conversion(60.0f) == Catch::Approx(c60));
CHECK(RageFromDamage(c60, 60.0f, true) == Catch::Approx(7.5f));
CHECK(RageFromDamage(c60, 60.0f, false) == Catch::Approx(2.5f));
}