mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
d73ab0246f
* Fix Explosion and Mind Blown * Use battler ability in jumpifabilitypresent
94 lines
2.6 KiB
C
94 lines
2.6 KiB
C
#include "global.h"
|
|
#include "test_battle.h"
|
|
|
|
ASSUMPTIONS
|
|
{
|
|
ASSUME(gBattleMoves[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION);
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Explosion causes the user to faint")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_EXPLOSION); }
|
|
} SCENE {
|
|
HP_BAR(player, hp: 0);
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player);
|
|
MESSAGE("Wobbuffet fainted!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Explosion causes the user & the target to faint")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_EXPLOSION); }
|
|
} SCENE {
|
|
HP_BAR(player, hp: 0);
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player);
|
|
HP_BAR(opponent, hp: 0);
|
|
MESSAGE("Foe Wobbuffet fainted!");
|
|
MESSAGE("Wobbuffet fainted!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Explosion causes the user to faint even if it misses")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_EXPLOSION, hit: FALSE); }
|
|
} SCENE {
|
|
HP_BAR(player, hp: 0);
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player);
|
|
MESSAGE("Wobbuffet fainted!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Explosion causes the user to faint even if it has no effect")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_EXPLOSION].type == TYPE_NORMAL);
|
|
ASSUME(gSpeciesInfo[SPECIES_GASTLY].types[0] == TYPE_GHOST);
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_GASTLY);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_EXPLOSION); }
|
|
} SCENE {
|
|
HP_BAR(player, hp: 0);
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, player);
|
|
MESSAGE("It doesn't affect Foe Gastly…");
|
|
NOT HP_BAR(opponent);
|
|
MESSAGE("Wobbuffet fainted!");
|
|
}
|
|
}
|
|
|
|
DOUBLE_BATTLE_TEST("Explosion causes everyone to faint in a double battle")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
PLAYER(SPECIES_WYNAUT) { HP(1); }
|
|
OPPONENT(SPECIES_ABRA) { HP(1); }
|
|
OPPONENT(SPECIES_KADABRA) { HP(1); }
|
|
OPPONENT(SPECIES_KADABRA);
|
|
} WHEN {
|
|
TURN { MOVE(playerLeft, MOVE_EXPLOSION); }
|
|
} SCENE {
|
|
HP_BAR(playerLeft, hp: 0);
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft);
|
|
HP_BAR(opponentLeft, hp: 0);
|
|
MESSAGE("Foe Abra fainted!");
|
|
HP_BAR(playerRight, hp: 0);
|
|
MESSAGE("Wynaut fainted!");
|
|
HP_BAR(opponentRight, hp: 0);
|
|
MESSAGE("Foe Kadabra fainted!");
|
|
MESSAGE("Wobbuffet fainted!");
|
|
}
|
|
}
|