2022-12-24 05:13:42 +00:00
|
|
|
#include "global.h"
|
2023-08-12 20:00:15 +01:00
|
|
|
#include "test/battle.h"
|
2022-12-24 05:13:42 +00:00
|
|
|
|
|
|
|
ASSUMPTIONS
|
|
|
|
{
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC);
|
2022-12-24 05:13:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Toxic inflicts bad poison")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_TOXIC); }
|
|
|
|
TURN {}
|
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, player);
|
|
|
|
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent);
|
|
|
|
STATUS_ICON(opponent, badPoison: TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Toxic cannot miss if used by a Poison-type")
|
|
|
|
{
|
|
|
|
u32 species;
|
|
|
|
bool32 hit;
|
|
|
|
PARAMETRIZE { species = SPECIES_WOBBUFFET; hit = FALSE; }
|
|
|
|
PARAMETRIZE { species = SPECIES_NIDORAN_M; hit = TRUE; }
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(B_TOXIC_NEVER_MISS >= GEN_6);
|
|
|
|
ASSUME(gSpeciesInfo[SPECIES_NIDORAN_M].types[0] == TYPE_POISON);
|
|
|
|
PLAYER(species);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_TOXIC, hit: FALSE); }
|
|
|
|
} SCENE {
|
|
|
|
if (hit) {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, player);
|
|
|
|
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent);
|
|
|
|
STATUS_ICON(opponent, badPoison: TRUE);
|
|
|
|
} else {
|
2023-10-24 08:55:32 +01:00
|
|
|
NONE_OF {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, player);
|
|
|
|
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent);
|
|
|
|
STATUS_ICON(opponent, badPoison: TRUE);
|
|
|
|
}
|
2022-12-24 05:13:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-07-03 09:48:31 +01:00
|
|
|
|
|
|
|
AI_SINGLE_BATTLE_TEST("AI avoids toxic when it can not poison target")
|
|
|
|
{
|
|
|
|
u32 species, ability;
|
|
|
|
|
|
|
|
PARAMETRIZE { species = SPECIES_SNORLAX; ability = ABILITY_IMMUNITY; }
|
|
|
|
PARAMETRIZE { species = SPECIES_KOMALA; ability = ABILITY_COMATOSE; }
|
|
|
|
PARAMETRIZE { species = SPECIES_NACLI; ability = ABILITY_PURIFYING_SALT; }
|
|
|
|
PARAMETRIZE { species = SPECIES_BULBASAUR; ability = ABILITY_OVERGROW; }
|
|
|
|
|
|
|
|
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_TOXIC); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { SCORE_EQ(opponent, MOVE_CELEBRATE, MOVE_TOXIC); } // Both get -10
|
|
|
|
}
|
|
|
|
}
|