53 lines
1.6 KiB
C++
53 lines
1.6 KiB
C++
#include <CreatureLib/Battling/Models/ExecutingAttack.hpp>
|
|
#include <PkmnLib/Battling/Battle/Battle.hpp>
|
|
#include <PkmnLib/Battling/Pokemon/CreatePokemon.hpp>
|
|
#include "../../../../extern/catch.hpp"
|
|
#include "../../Macros/MoveMacros.hpp"
|
|
|
|
TEST_CASE("Acupressure - increases random stat by 2", "[moves]") {
|
|
SETUP_MOVE_TEST(Acupressure)
|
|
|
|
script->OnStatusMove(executingMove, targetMon, 0);
|
|
bool hasDoubleIncreasedStat = false;
|
|
for (auto stat: CreatureLib::Core::StatisticHelper::GetValues()){
|
|
auto statBoost = targetMon->GetStatBoost(stat);
|
|
|
|
if (statBoost == 0)
|
|
continue;
|
|
else if (statBoost == 2){
|
|
if (hasDoubleIncreasedStat){
|
|
FAIL("We already had an increased stat.");
|
|
}
|
|
hasDoubleIncreasedStat = true;
|
|
}
|
|
else{
|
|
FAIL("A stat did not have either 0 or 2 for a stat boost.");
|
|
}
|
|
}
|
|
REQUIRE(hasDoubleIncreasedStat);
|
|
|
|
CLEANUP_MOVE_TEST
|
|
}
|
|
|
|
TEST_CASE("Acupressure - fails if user is target", "[moves]") {
|
|
SETUP_MOVE_TEST(Acupressure)
|
|
|
|
script->OnStatusMove(executingMove, userMon, 0);
|
|
bool hasDoubleIncreasedStat = false;
|
|
for (auto stat: CreatureLib::Core::StatisticHelper::GetValues()){
|
|
auto statBoost = userMon->GetStatBoost(stat);
|
|
|
|
if (statBoost == 0)
|
|
continue;
|
|
else if (statBoost == 2){
|
|
hasDoubleIncreasedStat = true;
|
|
}
|
|
else{
|
|
FAIL("A stat did not have either 0 or 2 for a stat boost.");
|
|
}
|
|
}
|
|
REQUIRE_FALSE(hasDoubleIncreasedStat);
|
|
|
|
CLEANUP_MOVE_TEST
|
|
}
|