From 14f3d69c83cdb06baae770c3b204a30079adf59f Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 23 Oct 2020 23:43:07 -0300 Subject: [PATCH] Beast ball effect. --- src/battle_script_commands.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b7a58a15c2..1f921d61f5 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9781,6 +9781,19 @@ static void Cmd_handleballthrow(void) else catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate; + + #ifdef POKEMON_EXPANSION + if (IS_ULTRA_BEAST(gBattleMons[gBattlerTarget].species)) + { + if (gLastUsedItem == ITEM_BEAST_BALL) + ballMultiplier = 50; + else + ballMultiplier = 1; + } + else + { + #endif + if (gLastUsedItem > ITEM_SAFARI_BALL) { switch (gLastUsedItem) @@ -9944,11 +9957,18 @@ static void Cmd_handleballthrow(void) ballMultiplier = 10; #endif break; + case ITEM_BEAST_BALL: + ballMultiplier = 1; + break; } } else ballMultiplier = sBallCatchBonuses[gLastUsedItem - ITEM_ULTRA_BALL]; + #ifdef POKEMON_EXPANSION + } + #endif + odds = ((catchRate + ballAddition) * ballMultiplier / 10) * (gBattleMons[gBattlerTarget].maxHP * 3 - gBattleMons[gBattlerTarget].hp * 2) / (3 * gBattleMons[gBattlerTarget].maxHP);