Gen7Tests/src/ScriptTests/Moves/AMoves/Absorb.cpp

29 lines
1.0 KiB
C++
Raw Normal View History

2020-02-16 12:08:04 +00:00
#include <CreatureLib/Battling/Models/ExecutingAttack.hpp>
2020-02-17 16:45:10 +00:00
#include <PkmnLib/Battling/Battle/Battle.hpp>
2020-02-17 17:17:10 +00:00
#include <PkmnLib/Battling/Pokemon/CreatePokemon.hpp>
#include "../../../../extern/catch.hpp"
#include "../../Macros/MoveMacros.hpp"
2020-02-16 12:08:04 +00:00
TEST_CASE("Absorb - Heals on use", "[moves]") {
2020-02-17 16:45:10 +00:00
SETUP_MOVE_TEST(Absorb)
2020-02-16 12:08:04 +00:00
userMon->Damage(50, CreatureLib::Battling::DamageSource::AttackDamage);
2021-03-28 12:57:00 +00:00
executingMove->GetHitData(targetMon, 0).SetDamage(50);
2020-02-17 16:45:10 +00:00
script->OnSecondaryEffect(executingMove, targetMon, 0);
2020-02-16 12:08:04 +00:00
CHECK(userMon->GetCurrentHealth() == userMon->GetMaxHealth() - 25);
2020-02-17 16:45:10 +00:00
CLEANUP_MOVE_TEST
2020-02-16 12:08:04 +00:00
}
TEST_CASE("Absorb - Heals more with big root", "[moves]") {
2020-02-17 16:45:10 +00:00
SETUP_MOVE_TEST(Absorb)
2020-02-16 12:08:04 +00:00
userMon->Damage(50, CreatureLib::Battling::DamageSource::AttackDamage);
2021-03-28 12:57:00 +00:00
executingMove->GetHitData(targetMon, 0).SetDamage(50);
userMon->SetHeldItem("big_root"_cnc.GetHash());
2020-02-17 16:45:10 +00:00
script->OnSecondaryEffect(executingMove, targetMon, 0);
2020-02-16 12:08:04 +00:00
CHECK(userMon->GetCurrentHealth() == userMon->GetMaxHealth() - 18);
2020-02-17 16:45:10 +00:00
CLEANUP_MOVE_TEST
2020-02-16 12:08:04 +00:00
}