Wild Pokémon animate after breaking out of Poké Ball (#7339)

This commit is contained in:
Linathan 2025-08-01 12:14:42 -04:00 committed by GitHub
parent 73fd567520
commit 9faa5294ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 38 additions and 19 deletions

View File

@ -842,8 +842,9 @@
.byte 0x95
.endm
.macro unused_96
.macro animatewildpokemonafterfailedpokeball battler:req
.byte 0x96
.byte \battler
.endm
.macro tryinfatuating failInstr:req

View File

@ -211,6 +211,9 @@ BattleScript_WallyBallThrow::
finishturn
BattleScript_ShakeBallThrow::
animatewildpokemonafterfailedpokeball BS_TARGET
waitstate
waitmessage B_WAIT_TIME_LONG
printfromtable gBallEscapeStringIds
waitmessage B_WAIT_TIME_LONG
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd

View File

@ -426,6 +426,7 @@ void LinkPartnerBufferExecCompleted(u32 battler);
void TrySetBattlerShadowSpriteCallback(u32 battler);
void AnimateMonAfterPokeBallFail(u32 battler);
void TryShinyAnimAfterMonAnim(u32 battler);
void WaitForMonAnimAfterLoad(u32 battler);
void BtlController_HandleSwitchInWaitAndEnd(u32 battler);

View File

@ -267,21 +267,22 @@
#define B_NEW_TERRAIN_BACKGROUNDS FALSE // If set to TRUE, uses new terrain backgrounds for Electric, Misty, Grassy and Psychic Terrain.
// Interface settings
#define B_ABILITY_POP_UP TRUE // In Gen5+, the Pokémon abilities are displayed in a pop-up, when they activate in battle.
#define B_FAST_INTRO_PKMN_TEXT TRUE // If set to TRUE, battle intro texts print at the same time as animation of a Pokémon, as opposing to waiting for the animation to end.
#define B_FAST_INTRO_NO_SLIDE FALSE // If set to TRUE, the slide animation that happens at the beginning of the battle is skipped.
#define B_FAST_HP_DRAIN TRUE // If set to TRUE, HP bars will move faster.
#define B_FAST_EXP_GROW TRUE // If set to TRUE, EXP bars will move faster.
#define B_SHOW_TARGETS TRUE // If set to TRUE, all available targets, for moves hitting 2 or 3 Pokémon, will be shown before selecting a move.
#define B_SHOW_CATEGORY_ICON TRUE // If set to TRUE, it will show an icon in the summary and move relearner showing the move's category.
#define B_HIDE_HEALTHBOX_IN_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations.
#define B_WAIT_TIME_MULTIPLIER 16 // This determines how long text pauses in battle last. Vanilla is 16. Lower values result in faster battles.
#define B_QUICK_MOVE_CURSOR_TO_RUN FALSE // If set to TRUE, pushing B in the battle options against a wild encounter will move the cursor to the run option
#define B_RUN_TRAINER_BATTLE TRUE // If set to TRUE, players can run from Trainer battles. This is treated as a whiteout.
#define B_MOVE_DESCRIPTION_BUTTON L_BUTTON // If set to a button other than B_LAST_USED_BALL_BUTTON, pressing this button will open the move description menu
#define B_SHOW_USELESS_Z_MOVE_INFO FALSE // If set to TRUE, Z-moves without additional effects like newer gen status moves will say "no additional effect"
#define B_ANIMATE_MON_AFTER_KO TRUE // If set to TRUE, if a Pokémon on the opposite site faints, the non-fainted Pokemon will display a victory animation.
#define B_SHOW_DYNAMAX_MESSAGE FALSE // If set to TRUE, an additional battle message is shown after completing Dynamaxing/Gigantamaxing.
#define B_ABILITY_POP_UP TRUE // In Gen5+, the Pokémon abilities are displayed in a pop-up, when they activate in battle.
#define B_FAST_INTRO_PKMN_TEXT TRUE // If set to TRUE, battle intro texts print at the same time as animation of a Pokémon, as opposing to waiting for the animation to end.
#define B_FAST_INTRO_NO_SLIDE FALSE // If set to TRUE, the slide animation that happens at the beginning of the battle is skipped.
#define B_FAST_HP_DRAIN TRUE // If set to TRUE, HP bars will move faster.
#define B_FAST_EXP_GROW TRUE // If set to TRUE, EXP bars will move faster.
#define B_SHOW_TARGETS TRUE // If set to TRUE, all available targets, for moves hitting 2 or 3 Pokémon, will be shown before selecting a move.
#define B_SHOW_CATEGORY_ICON TRUE // If set to TRUE, it will show an icon in the summary and move relearner showing the move's category.
#define B_HIDE_HEALTHBOX_IN_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations.
#define B_WAIT_TIME_MULTIPLIER 16 // This determines how long text pauses in battle last. Vanilla is 16. Lower values result in faster battles.
#define B_QUICK_MOVE_CURSOR_TO_RUN FALSE // If set to TRUE, pushing B in the battle options against a wild encounter will move the cursor to the run option
#define B_RUN_TRAINER_BATTLE TRUE // If set to TRUE, players can run from Trainer battles. This is treated as a whiteout.
#define B_MOVE_DESCRIPTION_BUTTON L_BUTTON // If set to a button other than B_LAST_USED_BALL_BUTTON, pressing this button will open the move description menu
#define B_SHOW_USELESS_Z_MOVE_INFO FALSE // If set to TRUE, Z-moves without additional effects like newer gen status moves will say "no additional effect"
#define B_ANIMATE_MON_AFTER_KO TRUE // If set to TRUE, if a Pokémon on the opposite site faints, the non-fainted Pokemon will display a victory animation.
#define B_ANIMATE_MON_AFTER_FAILED_POKEBALL TRUE // If set to TRUE, if a Pokémon on the opposite side breaks out of a thrown Poké Ball, the wild Pokémon will display its animation.
#define B_SHOW_DYNAMAX_MESSAGE FALSE // If set to TRUE, an additional battle message is shown after completing Dynamaxing/Gigantamaxing.
// Catching settings
#define B_SEMI_INVULNERABLE_CATCH GEN_LATEST // In Gen4+, you cannot throw a ball against a Pokemon that is in a semi-invulnerable state (dig/fly/etc)

View File

@ -2860,6 +2860,15 @@ void BtlController_HandleBattleAnimation(u32 battler)
}
}
void AnimateMonAfterPokeBallFail(u32 battler)
{
if (B_ANIMATE_MON_AFTER_FAILED_POKEBALL == FALSE)
return;
LaunchKOAnimation(battler, ReturnAnimIdForBattler(TRUE, battler), TRUE);
TryShinyAnimation(gBattlerTarget, GetBattlerMon(gBattlerTarget));
}
static void AnimateMonAfterKnockout(u32 battler)
{
if (B_ANIMATE_MON_AFTER_KO == FALSE)

View File

@ -486,7 +486,7 @@ static void Cmd_setlightscreen(void);
static void Cmd_tryKO(void);
static void Cmd_checknonvolatiletrigger(void);
static void Cmd_copybidedmg(void);
static void Cmd_unused_96(void);
static void Cmd_animatewildpokemonafterfailedpokeball(void);
static void Cmd_tryinfatuating(void);
static void Cmd_updatestatusicon(void);
static void Cmd_setmist(void);
@ -745,7 +745,7 @@ void (*const gBattleScriptingCommandsTable[])(void) =
Cmd_tryKO, //0x93
Cmd_checknonvolatiletrigger, //0x94
Cmd_copybidedmg, //0x95
Cmd_unused_96, //0x96
Cmd_animatewildpokemonafterfailedpokeball, //0x96
Cmd_tryinfatuating, //0x97
Cmd_updatestatusicon, //0x98
Cmd_setmist, //0x99
@ -11016,8 +11016,12 @@ static void Cmd_copybidedmg(void)
gBattlescriptCurrInstr = cmd->nextInstr;
}
static void Cmd_unused_96(void)
static void Cmd_animatewildpokemonafterfailedpokeball(void)
{
CMD_ARGS(u8 battler);
u8 battler = GetBattlerForBattleScript(cmd->battler);
AnimateMonAfterPokeBallFail(battler);
gBattlescriptCurrInstr = cmd->nextInstr;
}
static void Cmd_tryinfatuating(void)