From 9a0a759b3ffd484fb6b8acc2ada4ae43674dcb41 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Wed, 6 Jul 2022 22:34:01 -0400 Subject: [PATCH] Fixed multihit odds. --- src/battle_script_commands.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 15915c71a6b1..a6718babba9f 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10494,19 +10494,20 @@ static void Cmd_setmultihitcounter(void) } else if (B_MULTI_HIT_CHANCE >= GEN_5) { - // 2 and 3 hits: 33.3% - // 4 and 5 hits: 16.7% - gMultiHitCounter = Random() % 4; - if (gMultiHitCounter > 2) - { - gMultiHitCounter = (Random() % 3); - if (gMultiHitCounter < 2) - gMultiHitCounter = 2; - else - gMultiHitCounter = 3; - } + // Based on Gen 5's odds + // 35% for 2 hits + // 35% for 3 hits + // 15% for 4 hits + // 15% for 5 hits + gMultiHitCounter = Random() % 100; + if (gMultiHitCounter < 35) + gMultiHitCounter = 2; + else if (gMultiHitCounter < 35 + 35) + gMultiHitCounter = 3; + else if (gMultiHitCounter < 35 + 35 + 15) + gMultiHitCounter = 4; else - gMultiHitCounter += 3; + gMultiHitCounter = 5; } else {