mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Fixes form change when using switch moves (#3463)
* Fixes form change with switch moves
This commit is contained in:
parent
5fe564f014
commit
591ef71e3b
@ -7045,6 +7045,7 @@ static void Cmd_returntoball(void)
|
||||
u32 battler = GetBattlerForBattleScript(cmd->battler);
|
||||
BtlController_EmitReturnMonToBall(battler, BUFFER_A, TRUE);
|
||||
MarkBattlerForControllerExec(battler);
|
||||
TryBattleFormChange(battler, FORM_CHANGE_BATTLE_SWITCH);
|
||||
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ DOUBLE_BATTLE_TEST("Flower Gift increases the attack of Cherrim and its allies b
|
||||
} WHEN {
|
||||
if (sunny)
|
||||
TURN { MOVE(playerLeft, MOVE_SUNNY_DAY); }
|
||||
TURN { MOVE(playerLeft, MOVE_TACKLE, target: opponentLeft);
|
||||
TURN { MOVE(playerLeft, MOVE_TACKLE, target: opponentLeft);
|
||||
MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); }
|
||||
} SCENE {
|
||||
// sun activates
|
||||
@ -126,4 +126,46 @@ DOUBLE_BATTLE_TEST("Flower Gift increases the Sp. Def of Cherrim and its allies
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back when it switches out")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(B_WEATHER_FORMS >= GEN_5);
|
||||
PLAYER(SPECIES_CHERRIM) { Ability(ABILITY_FLOWER_GIFT); }
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_SUNNY_DAY); }
|
||||
TURN { SWITCH(player, 1); }
|
||||
} SCENE {
|
||||
// transforms in sun
|
||||
ABILITY_POPUP(player, ABILITY_FLOWER_GIFT);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||
MESSAGE("Cherrim transformed!");
|
||||
MESSAGE("Cherrim, that's enough! Come back!");
|
||||
} THEN {
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_CHERRIM);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back when it uses a move that forces it to switch out")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(B_WEATHER_FORMS >= GEN_5);
|
||||
PLAYER(SPECIES_CHERRIM) { Ability(ABILITY_FLOWER_GIFT); }
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_SUNNY_DAY); }
|
||||
TURN { MOVE(player, MOVE_U_TURN); SEND_OUT(player, 1); }
|
||||
} SCENE {
|
||||
// transforms in sun
|
||||
ABILITY_POPUP(player, ABILITY_FLOWER_GIFT);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||
MESSAGE("Cherrim transformed!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_U_TURN, player);
|
||||
} THEN {
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_CHERRIM);
|
||||
}
|
||||
}
|
||||
|
||||
TO_DO_BATTLE_TEST("Flower Gift does not transform Cherrim back to normal when suppressed if Cherrim is Dynamaxed");
|
||||
|
@ -353,3 +353,45 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when its ability
|
||||
EXPECT_EQ(player->species, SPECIES_CASTFORM);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Forecast transforms Castform back when it switches out")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(B_WEATHER_FORMS >= GEN_5);
|
||||
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); }
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_SUNNY_DAY); }
|
||||
TURN { SWITCH(player, 1); }
|
||||
} SCENE {
|
||||
// transforms in sun
|
||||
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||
MESSAGE("Castform transformed!");
|
||||
MESSAGE("Castform, that's enough! Come back!");
|
||||
} THEN {
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_CASTFORM);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Forecast transforms Castform back when it uses a move that forces it to switch out")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(B_WEATHER_FORMS >= GEN_5);
|
||||
PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); }
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(opponent, MOVE_SUNNY_DAY); }
|
||||
TURN { MOVE(player, MOVE_U_TURN); SEND_OUT(player, 1); }
|
||||
} SCENE {
|
||||
// transforms in sun
|
||||
ABILITY_POPUP(player, ABILITY_FORECAST);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
|
||||
MESSAGE("Castform transformed!");
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_U_TURN, player);
|
||||
} THEN {
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_CASTFORM);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user