Changed ballMultiplier to account for future Hisuian ball multipliers

This commit is contained in:
Eduardo Quezada 2022-10-04 20:39:45 -03:00
parent d0895a7c32
commit e8ed0bd9f2

View file

@ -13880,7 +13880,7 @@ u8 GetCatchingBattler(void)
static void Cmd_handleballthrow(void)
{
u8 ballMultiplier = 10;
u16 ballMultiplier = 100;
s8 ballAddition = 0;
if (gBattleControllerExecFlags)
@ -13915,30 +13915,30 @@ static void Cmd_handleballthrow(void)
if (gBaseStats[gBattleMons[gBattlerTarget].species].flags & FLAG_ULTRA_BEAST)
{
if (gLastUsedItem == ITEM_BEAST_BALL)
ballMultiplier = 50;
ballMultiplier = 500;
else
ballMultiplier = 1;
ballMultiplier = 10;
}
else
{
switch (gLastUsedItem)
{
case ITEM_ULTRA_BALL:
ballMultiplier = 20;
ballMultiplier = 200;
break;
#if B_SPORT_BALL_MODIFIER <= GEN_7
case ITEM_SPORT_BALL:
#endif
case ITEM_GREAT_BALL:
case ITEM_SAFARI_BALL:
ballMultiplier = 15;
ballMultiplier = 150;
break;
case ITEM_NET_BALL:
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG))
#if B_NET_BALL_MODIFIER >= GEN_7
ballMultiplier = 35;
ballMultiplier = 350;
#else
ballMultiplier = 30;
ballMultiplier = 300;
#endif
break;
case ITEM_DIVE_BALL:
@ -13947,75 +13947,75 @@ static void Cmd_handleballthrow(void)
|| gIsFishingEncounter || gIsSurfingEncounter
#endif
)
ballMultiplier = 35;
ballMultiplier = 350;
break;
case ITEM_NEST_BALL:
#if B_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;
ballMultiplier = 410 - (gBattleMons[gBattlerTarget].level * 10);
#elif B_NEST_BALL_MODIFIER == GEN_5
//((41 - Pokémon's level) ÷ 10)×, minimum 1×
if (gBattleMons[gBattlerTarget].level < 31)
ballMultiplier = 41 - gBattleMons[gBattlerTarget].level;
ballMultiplier = 410 - (gBattleMons[gBattlerTarget].level * 10);
#else
//((40 - Pokémon's level) ÷ 10)×, minimum 1×
if (gBattleMons[gBattlerTarget].level < 40)
{
ballMultiplier = 40 - gBattleMons[gBattlerTarget].level;
if (ballMultiplier <= 9)
ballMultiplier = 10;
ballMultiplier = 400 - (gBattleMons[gBattlerTarget].level * 10);
if (ballMultiplier <= 90)
ballMultiplier = 100;
}
#endif
break;
case ITEM_REPEAT_BALL:
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT))
#if B_REPEAT_BALL_MODIFIER >= GEN_7
ballMultiplier = 35;
ballMultiplier = 350;
#else
ballMultiplier = 30;
ballMultiplier = 300;
#endif
break;
case ITEM_TIMER_BALL:
#if B_TIMER_BALL_MODIFIER >= GEN_5
ballMultiplier = (gBattleResults.battleTurnCounter * 3) + 10;
ballMultiplier = (gBattleResults.battleTurnCounter * 30) + 100;
#else
ballMultiplier = gBattleResults.battleTurnCounter + 10;
ballMultiplier = (gBattleResults.battleTurnCounter * 10) + 100;
#endif
if (ballMultiplier > 40)
ballMultiplier = 40;
if (ballMultiplier > 400)
ballMultiplier = 400;
break;
case ITEM_DUSK_BALL:
RtcCalcLocalTime();
if ((gLocalTime.hours >= 20 && gLocalTime.hours <= 3) || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND)
#if B_DUSK_BALL_MODIFIER >= GEN_7
ballMultiplier = 30;
ballMultiplier = 300;
#else
ballMultiplier = 35;
ballMultiplier = 350;
#endif
break;
case ITEM_QUICK_BALL:
if (gBattleResults.battleTurnCounter == 0)
#if B_QUICK_BALL_MODIFIER >= GEN_5
ballMultiplier = 50;
ballMultiplier = 500;
#else
ballMultiplier = 40;
ballMultiplier = 400;
#endif
break;
case ITEM_LEVEL_BALL:
if (gBattleMons[gBattlerAttacker].level >= 4 * gBattleMons[gBattlerTarget].level)
ballMultiplier = 80;
ballMultiplier = 800;
else if (gBattleMons[gBattlerAttacker].level > 2 * gBattleMons[gBattlerTarget].level)
ballMultiplier = 40;
ballMultiplier = 400;
else if (gBattleMons[gBattlerAttacker].level > gBattleMons[gBattlerTarget].level)
ballMultiplier = 20;
ballMultiplier = 200;
break;
case ITEM_LURE_BALL:
if (gIsFishingEncounter)
#if B_LURE_BALL_MODIFIER >= GEN_7
ballMultiplier = 50;
ballMultiplier = 500;
#else
ballMultiplier = 30;
ballMultiplier = 300;
#endif
break;
case ITEM_MOON_BALL:
@ -14023,7 +14023,7 @@ static void Cmd_handleballthrow(void)
{
if (gEvolutionTable[gBattleMons[gBattlerTarget].species][i].method == EVO_ITEM
&& gEvolutionTable[gBattleMons[gBattlerTarget].species][i].param == ITEM_MOON_STONE)
ballMultiplier = 40;
ballMultiplier = 400;
}
break;
case ITEM_LOVE_BALL:
@ -14033,12 +14033,12 @@ static void Cmd_handleballthrow(void)
u8 gender2 = GetMonGender(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]);
if (gender1 != gender2 && gender1 != MON_GENDERLESS && gender2 != MON_GENDERLESS)
ballMultiplier = 80;
ballMultiplier = 800;
}
break;
case ITEM_FAST_BALL:
if (gBaseStats[gBattleMons[gBattlerTarget].species].baseSpeed >= 100)
ballMultiplier = 40;
ballMultiplier = 400;
break;
case ITEM_HEAVY_BALL:
i = GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1);
@ -14076,13 +14076,13 @@ static void Cmd_handleballthrow(void)
case ITEM_DREAM_BALL:
#if B_DREAM_BALL_MODIFIER >= GEN_8
if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE)
ballMultiplier = 40;
ballMultiplier = 400;
#else
ballMultiplier = 10;
ballMultiplier = 100;
#endif
break;
case ITEM_BEAST_BALL:
ballMultiplier = 1;
ballMultiplier = 10;
break;
}
}
@ -14093,7 +14093,7 @@ static void Cmd_handleballthrow(void)
else
catchRate = catchRate + ballAddition;
odds = (catchRate * ballMultiplier / 10)
odds = (catchRate * ballMultiplier / 100)
* (gBattleMons[gBattlerTarget].maxHP * 3 - gBattleMons[gBattlerTarget].hp * 2)
/ (3 * gBattleMons[gBattlerTarget].maxHP);