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