pokeemerald/test/ability_own_tempo.c
Alex 20099274d8
Fix Clear Amulet visual bug + Tests (#3074)
* Fix Clear Amulet visual bug + Tests

TODO Tests, additional tests + Triple Kick pp bug

* Wonder Guard message, switch instead of if, misalignments
2023-06-28 12:26:03 -04:00

120 lines
4.3 KiB
C

#include "global.h"
#include "test_battle.h"
SINGLE_BATTLE_TEST("Own Tempo prevents intimidate")
{
s16 turnOneHit;
s16 turnTwoHit;
GIVEN {
ASSUME(B_UPDATED_INTIMIDATE >= GEN_8);
PLAYER(SPECIES_EKANS) { Ability(ABILITY_SHED_SKIN); };
PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); };
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); };
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE); }
TURN { SWITCH(player, 1); MOVE(opponent, MOVE_TACKLE); }
} SCENE {
HP_BAR(player, captureDamage: &turnOneHit);
ABILITY_POPUP(player, ABILITY_INTIMIDATE);
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); }
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO);
MESSAGE("Foe Slowpoke's Attack was not lowered!");
HP_BAR(player, captureDamage: &turnTwoHit);
} THEN {
EXPECT_EQ(turnOneHit, turnTwoHit);
}
}
SINGLE_BATTLE_TEST("Own Tempo prevents confusion from moves by the opponent")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); };
} WHEN {
TURN { MOVE(player, MOVE_CONFUSE_RAY); }
} SCENE {
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO);
MESSAGE("Foe Slowpoke's Own Tempo prevents confusion!");
}
}
SINGLE_BATTLE_TEST("Own Tempo prevents confusion from moves by the user")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_PETAL_DANCE].effect == EFFECT_RAMPAGE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); };
} WHEN {
TURN { MOVE(opponent, MOVE_PETAL_DANCE); }
TURN { MOVE(opponent, MOVE_PETAL_DANCE); }
TURN { MOVE(opponent, MOVE_PETAL_DANCE); }
TURN { MOVE(opponent, MOVE_PETAL_DANCE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_DANCE, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_DANCE, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_DANCE, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_DANCE, opponent);
NONE_OF { MESSAGE("Foe Slowpoke became confused due to fatigue!"); }
}
}
SINGLE_BATTLE_TEST("Own Tempo cures confusion obtained from an opponent with Mold Breaker")
{
KNOWN_FAILING;
GIVEN {
ASSUME(gBattleMoves[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE);
PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); };
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); };
} WHEN {
TURN { MOVE(player, MOVE_CONFUSE_RAY); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CONFUSE_RAY, player);
MESSAGE("Foe Slowpoke became confused!");
NONE_OF {
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponent);
}
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO);
MESSAGE("Foe Slowpoke's Own Tempo cured its confusion problem!");
}
}
SINGLE_BATTLE_TEST("Own Tempo cures confusion if it's obtained via Skill Swap")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE);
ASSUME(gBattleMoves[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP);
PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CONFUSE_RAY); }
TURN { MOVE(player, MOVE_SKILL_SWAP);
MOVE(opponent, MOVE_TACKLE);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CONFUSE_RAY, player);
MESSAGE("Foe Wobbuffet became confused!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_SKILL_SWAP, player);
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO);
MESSAGE("Foe Wobbuffet's Own Tempo cured its confusion problem!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
}
}
SINGLE_BATTLE_TEST("Own Tempo prevents confusion from items")
{
GIVEN {
ASSUME(gItems[ITEM_BERSERK_GENE].holdEffect == HOLD_EFFECT_BERSERK_GENE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); Item(ITEM_BERSERK_GENE); };
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO);
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
}
}