sovereignx/test/battle/move_effect/fillet_away.c
kittenchilly 94a650a203
Add Fillet Away + Belly Drum tweaks (#3616)
* Add Fillet Away

* Fillet Away and Belly Drum tests

* More tests

* Update fillet_away.c

* Update fillet_away.c

* Newlines

* Update battle_scripts_1.s

* Update belly_drum.c

* Address reviews

* Fix order

* Swords Dance assume

* Update belly_drum.c

* Try some stuff

* Fix hp not being halved in certain cases

* Update battle_scripts_1.s

* AI stuff
2023-12-28 23:27:09 +01:00

58 lines
1.7 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_FILLET_AWAY].effect == EFFECT_FILLET_AWAY);
}
SINGLE_BATTLE_TEST("Fillet Away cuts the user's HP in half")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_FILLET_AWAY); }
} SCENE {
s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP);
HP_BAR(player, hp: maxHP / 2);
}
}
SINGLE_BATTLE_TEST("Fillet Away sharply raises Attack, Sp. Atk, and Speed")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_FILLET_AWAY); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_FILLET_AWAY, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Attack sharply rose!");
MESSAGE("Wobbuffet's Sp. Atk sharply rose!");
MESSAGE("Wobbuffet's Speed sharply rose!");
HP_BAR(player);
} THEN {
EXPECT_EQ(player->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 2);
EXPECT_EQ(player->statStages[STAT_SPATK], DEFAULT_STAT_STAGE + 2);
EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 2);
}
}
SINGLE_BATTLE_TEST("Fillet Away fails if user's current HP is half or less than half its maximum")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(50);}
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_FILLET_AWAY); }
} SCENE {
MESSAGE("But it failed!");
NONE_OF {
ANIMATION(ANIM_TYPE_MOVE, MOVE_FILLET_AWAY, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
HP_BAR(player);
}
}
}