Nest Ball modifier in config.

This commit is contained in:
Eduardo Quezada 2020-10-17 02:00:53 -03:00
parent 6676451353
commit 6af4425081
2 changed files with 18 additions and 6 deletions

View file

@ -22,5 +22,6 @@
#define P_LURE_BALL_MODIFIER GEN_7 // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3.
#define P_HEAVY_BALL_MODIFIER GEN_7 // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow.
#define P_NET_BALL_MODIFIER GEN_7 // In Gen7+, Net Ball's catch multiplier is x5 instead of x3.
#define P_NEST_BALL_MODIFIER GEN_7 // Nest Ball's formula varies depending on the Gen. See Cmd_handleballthrow.
#endif // GUARD_CONSTANTS_ITEM_CONFIG_H

View file

@ -9797,12 +9797,23 @@ static void Cmd_handleballthrow(void)
ballMultiplier = 35;
break;
case ITEM_NEST_BALL:
if (gBattleMons[gBattlerTarget].level < 40)
{
ballMultiplier = 40 - gBattleMons[gBattlerTarget].level;
if (ballMultiplier <= 9)
ballMultiplier = 10;
}
#if P_NEST_BALL_MODIFIER >= GEN_6
//((41 - Pokémon's level) ÷ 10)× if Pokémon's level is between 1 and 29, 1× otherwise.
if (gBattleMons[gBattlerTarget].level < 30)
ballMultiplier = 41 - gBattleMons[gBattlerTarget].level;
#elif P_NEST_BALL_MODIFIER == GEN_5
//((41 - Pokémon's level) ÷ 10)×, minimum 1×
if (gBattleMons[gBattlerTarget].level < 31)
ballMultiplier = 41 - gBattleMons[gBattlerTarget].level;
#else
//((40 - Pokémon's level) ÷ 10)×, minimum 1×
if (gBattleMons[gBattlerTarget].level < 40)
{
ballMultiplier = 40 - gBattleMons[gBattlerTarget].level;
if (ballMultiplier <= 9)
ballMultiplier = 10;
}
#endif
break;
case ITEM_REPEAT_BALL:
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT))