sovereignx/test/battle/status1/paralysis.c
Alex 594633aa15
Remove Duplicate ai code from battle_ai_util.c (#4883)
* Remove Duplicate ai code from battle_ai_util.c

* Add GetBattlerAbility in toxic self check
2024-07-03 10:48:31 +02:00

62 lines
2.1 KiB
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Paralysis reduces Speed by 50%")
{
u16 playerSpeed;
bool32 playerFirst;
PARAMETRIZE { playerSpeed = 98; playerFirst = FALSE; }
PARAMETRIZE { playerSpeed = 102; playerFirst = TRUE; }
GIVEN {
ASSUME(B_PARALYSIS_SPEED >= GEN_7);
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_PARALYSIS); Speed(playerSpeed); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(50); }
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_CELEBRATE); }
} SCENE {
if (playerFirst) {
ONE_OF {
MESSAGE("Wobbuffet used Celebrate!");
MESSAGE("Wobbuffet is paralyzed! It can't move!");
}
MESSAGE("Foe Wobbuffet used Celebrate!");
} else {
MESSAGE("Foe Wobbuffet used Celebrate!");
ONE_OF {
MESSAGE("Wobbuffet used Celebrate!");
MESSAGE("Wobbuffet is paralyzed! It can't move!");
}
}
}
}
SINGLE_BATTLE_TEST("Paralysis has a 25% chance of skipping the turn")
{
PASSES_RANDOMLY(25, 100, RNG_PARALYSIS);
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_PARALYSIS); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); }
} SCENE {
MESSAGE("Wobbuffet is paralyzed! It can't move!");
}
}
AI_SINGLE_BATTLE_TEST("AI avoids Thunder Wave when it can not paralyse target")
{
u32 species, ability;
PARAMETRIZE { species = SPECIES_HITMONLEE; ability = ABILITY_LIMBER; }
PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; }
PARAMETRIZE { species = SPECIES_NACLI; ability = ABILITY_PURIFYING_SALT; }
PARAMETRIZE { species = SPECIES_PIKACHU; ability = ABILITY_STATIC; }
GIVEN {
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_OMNISCIENT);
PLAYER(species) { Ability(ability); }
OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_CELEBRATE, MOVE_THUNDER_WAVE); }
} WHEN {
TURN { SCORE_EQ(opponent, MOVE_CELEBRATE, MOVE_THUNDER_WAVE); } // Both get -10
}
}