Config for capture to appear critical if the pokemon is already caught (#7730)

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
FosterProgramming 2025-09-14 20:44:31 +02:00 committed by GitHub
parent 78a05c97ac
commit 5ce49f3cb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -289,6 +289,7 @@
#define B_CATCHING_CHARM_BOOST 20 // % boost in Critical Capture odds if player has the Catching Charm.
#define B_CRITICAL_CAPTURE TRUE // If set to TRUE, Critical Capture will be enabled.
#define B_CRITICAL_CAPTURE_LOCAL_DEX TRUE // If set to FALSE, Critical Capture % is based off of the National Pokedex estimated by enabled generations.
#define B_CRITICAL_CAPTURE_IF_OWNED GEN_LATEST // In Gen9, a capture appear critical if the pokemon you are trying to catch already has a dex entry (has already been caught)
#define B_LAST_USED_BALL TRUE // If TRUE, the "last used ball" feature from Gen 7 will be implemented
#define B_LAST_USED_BALL_BUTTON R_BUTTON // If last used ball is implemented, this button (or button combo) will trigger throwing the last used ball.

View File

@ -13674,9 +13674,13 @@ static void Cmd_handleballthrow(void)
if (shakes == maxShakes) // mon caught, copy of the code above
{
if (IsCriticalCapture())
enum NationalDexOrder natDexNo = SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species);
if ((B_CRITICAL_CAPTURE_IF_OWNED >= GEN_9 && GetSetPokedexFlag(natDexNo, FLAG_GET_CAUGHT))
|| IsCriticalCapture())
{
gBattleSpritesDataPtr->animationData->isCriticalCapture = TRUE;
gBattleSpritesDataPtr->animationData->criticalCaptureSuccess = TRUE;
}
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE);
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
struct Pokemon *caughtMon = GetBattlerMon(gBattlerTarget);