Skip to content

Commit

Permalink
Fix some ball multiplier configs (#3939)
Browse files Browse the repository at this point in the history
* Fix some ball multiplier configs

* Updated the comment of B_LURE_BALL_MODIFIER

* Specified the effects of B_LURE_BALL_MODIFIER in itsa state its effects in a more specific manner

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>

* Corrected the comments of B_DREAM_BALL_MODIFIER, B_SPORT_BALL_MODIFIER and B_SAFARI_BALL_MODIFIER

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>

* Turned the ternaries in the case for the Lure Ball's catch rate in Cmd_handleballthrow into a regular if/else if statement

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>

---------

Co-authored-by: LOuroboros <lunosouroboros@gmail.com>
Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
  • Loading branch information
3 people authored Jan 8, 2024
1 parent b077d92 commit d73c9b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
7 changes: 4 additions & 3 deletions include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@
#define B_TIMER_BALL_MODIFIER GEN_LATEST // In Gen5+, Timer Ball's effectiveness increases by x0.3 per turn instead of x0.1
#define B_DUSK_BALL_MODIFIER GEN_LATEST // In Gen7+, Dusk Ball's catch multiplier is x3 instead of x3.5.
#define B_QUICK_BALL_MODIFIER GEN_LATEST // In Gen5+, Quick Ball's catch multiplier is x5 instead of x4.
#define B_LURE_BALL_MODIFIER GEN_LATEST // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3.
#define B_LURE_BALL_MODIFIER GEN_LATEST // In Gen8+, Lure Ball's catch multiplier is x4. In Gen7, it's x5. In Gen6 and earlier, it's x3.
#define B_HEAVY_BALL_MODIFIER GEN_LATEST // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow.
#define B_DREAM_BALL_MODIFIER GEN_LATEST // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose.
#define B_SPORT_BALL_MODIFIER GEN_LATEST // In Gen8, Sport Ball's catch multiplier was reduced from x1.5 to x1.
#define B_DREAM_BALL_MODIFIER GEN_LATEST // In Gen8+, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose.
#define B_SPORT_BALL_MODIFIER GEN_LATEST // In Gen8+, Sport Ball's catch multiplier was reduced from x1.5 to x1.
#define B_SAFARI_BALL_MODIFIER GEN_LATEST // In Gen8+, Safari Ball's catch multiplier was reduced from x1.5 to x1.
#define B_SERENE_GRACE_BOOST GEN_LATEST // In Gen5+, Serene Grace boosts the added flinch chance of King's Rock and Razor Fang.

// Flag settings
Expand Down
15 changes: 13 additions & 2 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -14839,10 +14839,14 @@ static void Cmd_handleballthrow(void)
case ITEM_SPORT_BALL:
if (B_SPORT_BALL_MODIFIER <= GEN_7)
ballMultiplier = 150;
break;
case ITEM_GREAT_BALL:
case ITEM_SAFARI_BALL:
ballMultiplier = 150;
break;
case ITEM_SAFARI_BALL:
if (B_SAFARI_BALL_MODIFIER <= GEN_7)
ballMultiplier = 150;
break;
case ITEM_NET_BALL:
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG))
ballMultiplier = B_NET_BALL_MODIFIER >= GEN_7 ? 350 : 300;
Expand Down Expand Up @@ -14901,7 +14905,14 @@ static void Cmd_handleballthrow(void)
break;
case ITEM_LURE_BALL:
if (gIsFishingEncounter)
ballMultiplier = (B_LURE_BALL_MODIFIER >= GEN_7 ? 500 : 300);
{
if (B_LURE_BALL_MODIFIER >= GEN_8)
ballMultiplier = 400;
else if (B_LURE_BALL_MODIFIER >= GEN_7)
ballMultiplier = 500;
else
ballMultiplier = 300;
}
break;
case ITEM_MOON_BALL:
{
Expand Down

0 comments on commit d73c9b0

Please sign in to comment.