pokeemerald/test/battle/hold_effect/micle_berry.c
Martin Griffin 5fe564f014
Detect 'NOT x; NOT y;' (#3459)
Fix Purifying Salt to be immune to statuses from secondary effects.
2023-10-24 09:55:32 +02:00

66 lines
2.3 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gItems[ITEM_MICLE_BERRY].holdEffect == HOLD_EFFECT_MICLE_BERRY);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_DRAGON_RAGE);
}
SINGLE_BATTLE_TEST("Micle Berry raises the holder's accuracy by 1.2 when HP drops to 1/4 or below")
{
u32 move;
PARAMETRIZE { move = MOVE_TACKLE; }
PARAMETRIZE { move = MOVE_DRAGON_RAGE; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { MaxHP(160); HP(80); Item(ITEM_MICLE_BERRY); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, move); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
if (move == MOVE_TACKLE) {
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet boosted the accuracy of its next move using Micle Berry!");
}
} else {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet boosted the accuracy of its next move using Micle Berry!");
}
}
}
SINGLE_BATTLE_TEST("Micle Berry raises the holder's accuracy by 1.2 when HP drops to 1/2 or below")
{
GIVEN {
PLAYER(SPECIES_BELLSPROUT) { MaxHP(80); HP(80); Ability(ABILITY_GLUTTONY); Item(ITEM_MICLE_BERRY); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_DRAGON_RAGE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_RAGE, opponent);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Bellsprout boosted the accuracy of its next move using Micle Berry!");
}
}
SINGLE_BATTLE_TEST("Micle Berry raises the holder's accuracy by 1.2")
{
PASSES_RANDOMLY(24, 25, RNG_ACCURACY);
GIVEN {
ASSUME(gBattleMoves[MOVE_SUBMISSION].accuracy == 80);
PLAYER(SPECIES_WOBBUFFET) { MaxHP(160); HP(80); Item(ITEM_MICLE_BERRY); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_DRAGON_RAGE); MOVE(player, MOVE_SUBMISSION); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_RAGE, opponent);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet boosted the accuracy of its next move using Micle Berry!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_SUBMISSION, player);
}
}