71b49a114f
* Remove non-existent tilesets from label comments and alphabetize * Fixed braces style * gbagfx bit depth upconversion fix * jsonproc: filter out every non-alphanumeric character * fix(linking): link gflib/malloc.c at top of EWRAM in ld_script_modern.ld * Adds move Upper Hand * Requested changes - Tabs / spaces where proper - HitFromAtkString -> HitFromAccCheck - Actually compiles now lol - Moved assumes into relevant tests - Cleaned up the check for TryUpperHand * Fixed || positioning * Update upper_hand.c * Revert "Merge remote-tracking branch 'upstream/master' into upper-hand" This reverts commitb21275dfe9
, reversing changes made to89b1ad1ea1
. * AI logic and conflicts solved * Test fix * Fix Sheer Force test * Requested changes * Requested changes * Update battle_script_commands.c --------- Co-authored-by: GriffinR <griffin.g.richards@gmail.com> Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com> Co-authored-by: Sierraffinity <sierra@domoreaweso.me> Co-authored-by: sbird <sbird@no.tld>
118 lines
4.4 KiB
C
118 lines
4.4 KiB
C
#include "global.h"
|
|
#include "test/battle.h"
|
|
|
|
ASSUMPTIONS
|
|
{
|
|
ASSUME(gMovesInfo[MOVE_UPPER_HAND].effect == EFFECT_UPPER_HAND);
|
|
ASSUME(gMovesInfo[MOVE_UPPER_HAND].priority == 3);
|
|
ASSUME(MoveHasMoveEffect(MOVE_UPPER_HAND, MOVE_EFFECT_FLINCH) == TRUE);
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Upper Hand succeeds if the target is using a priority attacking move and causes it to flinch")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gMovesInfo[MOVE_EXTREME_SPEED].category == DAMAGE_CATEGORY_PHYSICAL);
|
|
ASSUME(gMovesInfo[MOVE_EXTREME_SPEED].priority == 2);
|
|
PLAYER(SPECIES_MIENSHAO);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_EXTREME_SPEED); MOVE(player, MOVE_UPPER_HAND); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_UPPER_HAND, player);
|
|
HP_BAR(opponent);
|
|
MESSAGE("Foe Wobbuffet flinched!");
|
|
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_EXTREME_SPEED, opponent);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Upper Hand fails if the target is using a status move")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gMovesInfo[MOVE_BABY_DOLL_EYES].category == DAMAGE_CATEGORY_STATUS);
|
|
ASSUME(gMovesInfo[MOVE_BABY_DOLL_EYES].priority == 1);
|
|
PLAYER(SPECIES_MIENSHAO);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_BABY_DOLL_EYES); MOVE(player, MOVE_UPPER_HAND); }
|
|
} SCENE {
|
|
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_UPPER_HAND, player);
|
|
MESSAGE("Mienshao used Upper Hand!");
|
|
MESSAGE("But it failed!");
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BABY_DOLL_EYES, opponent);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
|
MESSAGE("Mienshao's Attack fell!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Upper Hand fails if the target is not using a priority move")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gMovesInfo[MOVE_DRAINING_KISS].category == DAMAGE_CATEGORY_SPECIAL);
|
|
ASSUME(gMovesInfo[MOVE_DRAINING_KISS].priority == 0);
|
|
PLAYER(SPECIES_MIENSHAO);
|
|
OPPONENT(SPECIES_COMFEY) { Ability(ABILITY_FLOWER_VEIL); }
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_DRAINING_KISS); MOVE(player, MOVE_UPPER_HAND); }
|
|
} SCENE {
|
|
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_UPPER_HAND, player);
|
|
MESSAGE("Mienshao used Upper Hand!");
|
|
MESSAGE("But it failed!");
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAINING_KISS, opponent);
|
|
HP_BAR(player);
|
|
HP_BAR(opponent);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Upper Hand succeeds if the target's move is boosted in priority by an Ability")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gMovesInfo[MOVE_DRAINING_KISS].category == DAMAGE_CATEGORY_SPECIAL);
|
|
ASSUME(gMovesInfo[MOVE_DRAINING_KISS].priority == 0);
|
|
PLAYER(SPECIES_MIENSHAO) { Speed(10); }
|
|
OPPONENT(SPECIES_COMFEY) { Speed(5); Ability(ABILITY_TRIAGE); }
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_DRAINING_KISS); MOVE(player, MOVE_UPPER_HAND); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_UPPER_HAND, player);
|
|
HP_BAR(opponent);
|
|
MESSAGE("Foe Comfey flinched!");
|
|
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAINING_KISS, opponent);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Upper Hand fails if the target moves first")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gMovesInfo[MOVE_DRAINING_KISS].category == DAMAGE_CATEGORY_SPECIAL);
|
|
ASSUME(gMovesInfo[MOVE_DRAINING_KISS].priority == 0);
|
|
PLAYER(SPECIES_MIENSHAO) { Speed(5); }
|
|
OPPONENT(SPECIES_COMFEY) { Speed(10); Ability(ABILITY_TRIAGE); }
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_DRAINING_KISS); MOVE(player, MOVE_UPPER_HAND); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAINING_KISS, opponent);
|
|
HP_BAR(player);
|
|
HP_BAR(opponent);
|
|
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_UPPER_HAND, player);
|
|
MESSAGE("Mienshao used Upper Hand!");
|
|
MESSAGE("But it failed!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Upper Hand is boosted by Sheer Force")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gMovesInfo[MOVE_EXTREME_SPEED].category == DAMAGE_CATEGORY_PHYSICAL);
|
|
ASSUME(gMovesInfo[MOVE_EXTREME_SPEED].priority == 2);
|
|
ASSUME(gMovesInfo[MOVE_UPPER_HAND].sheerForceBoost == TRUE);
|
|
PLAYER(SPECIES_HARIYAMA) { Ability(ABILITY_SHEER_FORCE); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_EXTREME_SPEED); MOVE(player, MOVE_UPPER_HAND); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_UPPER_HAND, player);
|
|
HP_BAR(opponent);
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_EXTREME_SPEED, opponent);
|
|
HP_BAR(player);
|
|
}
|
|
}
|