sovereignx/test/battle/move_effect/octolock.c
2023-10-25 10:18:59 +02:00

133 lines
4.7 KiB
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Octolock decreases Defense and Sp. Def by at the end of the turn")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_OCTOLOCK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_OCTOLOCK, player);
MESSAGE("Foe Wobbuffet can no longer escape because of Octolock!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Wobbuffet's Defense fell!");
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Wobbuffet's Sp. Def fell!");
}
}
SINGLE_BATTLE_TEST("Octolock reduction is prevented by Clear Body, White Smoke and Full Metal Body")
{
u32 species;
u32 ability;
PARAMETRIZE { species = SPECIES_BELDUM; ability = ABILITY_CLEAR_BODY; }
PARAMETRIZE { species = SPECIES_TORKOAL; ability = ABILITY_WHITE_SMOKE; }
PARAMETRIZE { species = SPECIES_SOLGALEO; ability = ABILITY_FULL_METAL_BODY; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(species) { Ability(ability); }
} WHEN {
TURN { MOVE(player, MOVE_OCTOLOCK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_OCTOLOCK, player);
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
if (species == SPECIES_BELDUM)
{
MESSAGE("Foe Beldum can no longer escape because of Octolock!");
ABILITY_POPUP(opponent, ABILITY_CLEAR_BODY);
MESSAGE("Foe Beldum's Clear Body prevents stat loss!");
NONE_OF {
MESSAGE("Foe Beldum's Defense fell!");
MESSAGE("Foe Beldum's Sp. Def fell!");
}
}
else if (species == SPECIES_TORKOAL)
{
MESSAGE("Foe Torkoal can no longer escape because of Octolock!");
ABILITY_POPUP(opponent, ABILITY_WHITE_SMOKE);
MESSAGE("Foe Torkoal's White Smoke prevents stat loss!");
NONE_OF {
MESSAGE("Foe Torkoal's Defense fell!");
MESSAGE("Foe Torkoal's Sp. Def fell!");
}
}
else if (species == SPECIES_SOLGALEO)
{
MESSAGE("Foe Solgaleo can no longer escape because of Octolock!");
ABILITY_POPUP(opponent, ABILITY_FULL_METAL_BODY);
MESSAGE("Foe Solgaleo's Full Metal Body prevents stat loss!");
NONE_OF {
MESSAGE("Foe Solgaleo's Defense fell!");
MESSAGE("Foe Solgaleo's Sp. Def fell!");
}
}
}
}
SINGLE_BATTLE_TEST("Octolock Defense reduction is prevented by Big Pecks")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_PIDGEY) { Ability(ABILITY_BIG_PECKS); }
} WHEN {
TURN { MOVE(player, MOVE_OCTOLOCK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_OCTOLOCK, player);
MESSAGE("Foe Pidgey can no longer escape because of Octolock!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
NOT MESSAGE("Foe Pidgey's Defense fell!");
ABILITY_POPUP(opponent, ABILITY_BIG_PECKS);
MESSAGE("Foe Pidgey's Big Pecks prevents Defense loss!");
MESSAGE("Foe Pidgey's Sp. Def fell!");
}
}
SINGLE_BATTLE_TEST("Octolock reduction is prevented by Clear Amulet")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_CLEAR_AMULET); }
} WHEN {
TURN { MOVE(player, MOVE_OCTOLOCK); }
TURN {}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_OCTOLOCK, player);
MESSAGE("Foe Wobbuffet can no longer escape because of Octolock!");
MESSAGE("Foe Wobbuffet's Clear Amulet prevents its stats from being lowered!");
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Wobbuffet's Defense fell!");
MESSAGE("Foe Wobbuffet's Sp. Def fell!");
}
}
}
SINGLE_BATTLE_TEST("Octolock will not decrease Defense and Sp. Def further then minus six")
{
u8 j;
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_OCTOLOCK); }
for (j = 0; j < 6; j++)
TURN {}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_OCTOLOCK, player);
for (j = 0; j < 5; j++) {
MESSAGE("Foe Wobbuffet's Defense fell!");
MESSAGE("Foe Wobbuffet's Sp. Def fell!");
}
MESSAGE("Foe Wobbuffet's Defense won't go lower!");
MESSAGE("Foe Wobbuffet's Sp. Def won't go lower!");
NONE_OF {
MESSAGE("Foe Wobbuffet's Defense fell!");
MESSAGE("Foe Wobbuffet's Sp. Def fell!");
}
}
}