diff --git a/src/ScriptTests/Moves/AMoves/AnchorShot.cpp b/src/ScriptTests/Moves/AMoves/AnchorShot.cpp new file mode 100644 index 0000000..52e59e2 --- /dev/null +++ b/src/ScriptTests/Moves/AMoves/AnchorShot.cpp @@ -0,0 +1,25 @@ +#include +#include +#include +#include "../../../../extern/doctest.hpp" +#include "../../Macros/MoveMacros.hpp" + + +TEST_CASE("Anchor Shot - Locks pokemon in") { + SETUP_MOVE_TEST(Anchor_Shot) + + script->OnSecondaryEffect(executingMove, targetMon, 0); + REQUIRE(userMon->HasVolatileScript("PreventFoeRunning"_cnc)); + + auto preventRun = false; + auto runChoice = CreatureLib::Battling::FleeTurnChoice(targetMon); + auto aggregator = userMon->GetScriptIterator(); + while (aggregator.HasNext()) { + auto next = aggregator.GetNext(); + auto castNext = next.ForceAs(); + castNext->PreventOpponentRunAway(&runChoice, &preventRun); + } + CHECK(preventRun); + + CLEANUP_MOVE_TEST +}