Gravity fix + Sky Drop Test (#5780)
Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
This commit is contained in:
parent
a775098e83
commit
6e24b6af3d
2 changed files with 49 additions and 2 deletions
|
@ -2741,9 +2741,9 @@ BattleScript_GravityLoopDrop:
|
|||
printstring STRINGID_GRAVITYGROUNDING
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_GravityLoopEnd:
|
||||
moveendto MOVEEND_NEXT_TARGET
|
||||
moveendcase MOVEEND_TARGET_VISIBLE
|
||||
jumpifnexttargetvalid BattleScript_GravityLoop
|
||||
end
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectRoost::
|
||||
attackcanceler
|
||||
|
|
47
test/battle/move_effect/gravity.c
Normal file
47
test/battle/move_effect/gravity.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
#include "global.h"
|
||||
#include "test/battle.h"
|
||||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
ASSUME(gMovesInfo[MOVE_GRAVITY].effect == EFFECT_GRAVITY);
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Gravity cancels fly and sky drop if they are in the air")
|
||||
{
|
||||
u8 visibility;
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET) { Speed(100); }
|
||||
PLAYER(SPECIES_WYNAUT) { Speed(90); }
|
||||
OPPONENT(SPECIES_PIDGEY) { Speed(50); }
|
||||
OPPONENT(SPECIES_ROOKIDEE) { Speed(45); }
|
||||
} WHEN {
|
||||
TURN { MOVE(opponentLeft, MOVE_SKY_DROP, target: playerRight); MOVE(opponentRight, MOVE_FLY, target: playerLeft); }
|
||||
TURN { MOVE(playerLeft, MOVE_GRAVITY); SKIP_TURN(opponentRight); SKIP_TURN(opponentLeft); }
|
||||
} SCENE {
|
||||
// turn 1
|
||||
MESSAGE("The opposing Pidgey used Sky Drop!");
|
||||
MESSAGE("The opposing Pidgey took Wynaut into the sky!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SKY_DROP, opponentLeft);
|
||||
MESSAGE("The opposing Rookidee used Fly!");
|
||||
MESSAGE("The opposing Rookidee flew up high!");
|
||||
// turn 2
|
||||
MESSAGE("Wobbuffet used Gravity!");
|
||||
MESSAGE("Gravity intensified!");
|
||||
MESSAGE("The opposing Pidgey fell from the sky due to the gravity!");
|
||||
MESSAGE("The opposing Rookidee fell from the sky due to the gravity!");
|
||||
MESSAGE("The opposing Pidgey can't use Sky Drop because of gravity!");
|
||||
MESSAGE("The opposing Rookidee can't use Fly because of gravity!");
|
||||
} THEN {
|
||||
// all battlers should be visible. assign to var first because expect_eq not working with bitfield address
|
||||
visibility = gBattleSpritesDataPtr->battlerData[0].invisible;
|
||||
EXPECT_EQ(visibility, 0);
|
||||
visibility = gBattleSpritesDataPtr->battlerData[1].invisible;
|
||||
EXPECT_EQ(visibility, 0);
|
||||
visibility = gBattleSpritesDataPtr->battlerData[2].invisible;
|
||||
EXPECT_EQ(visibility, 0);
|
||||
visibility = gBattleSpritesDataPtr->battlerData[3].invisible;
|
||||
EXPECT_EQ(visibility, 0);
|
||||
// ensure moveend properly recorded
|
||||
EXPECT_EQ(gLastMoves[0], MOVE_GRAVITY);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue