turn crit capture odds into a ratio

This commit is contained in:
Evan 2020-11-03 08:57:11 -07:00
parent e7372e7c5b
commit b3d1e8b5b8
2 changed files with 11 additions and 11 deletions

View file

@ -124,16 +124,16 @@
#define B_SHOW_TARGETS TRUE // If set to TRUE, all available targets, for moves hitting 2 or 3 Pokémon, will be shown before selecting a move.
#define B_SHOW_SPLIT_ICON TRUE // If set to TRUE, it will show an icon in the summary showing the move's category split.
// Critical Capture
#define B_CRITICAL_CAPTURE TRUE // If set to TRUE, Critical Capture will be enabled.
#define B_CATCHING_CHARM_BOOST 20 // % boost in Critical Capture odds if player has the Catching Charm.
// Other
#define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter.
#define B_SLEEP_TURNS GEN_6 // In Gen5+, sleep lasts for 1-3 turns instead of 2-5 turns.
#define B_PARALYZE_ELECTRIC GEN_6 // In Gen6+, Electric type Pokémon can't be paralyzed.
#define B_POWDER_GRASS GEN_6 // In Gen6+, Grass type Pokémon are immune to powder and spore moves.
// Critical Capture
#define B_CRITICAL_CAPTURE TRUE // if set to TRUE, critical capture will be enabled
#define B_CATCHING_CHARM_BOOST 20 // % boost in critical capture odds if player has the catching charm
// Animation Settings
#define B_NEW_SWORD_PARTICLE TRUE // If set to TRUE, it updates Swords Dance's particle.
#define B_NEW_LEECH_SEED_PARTICLE TRUE // If set to TRUE, it updates Leech Seed's animation particle.

View file

@ -12390,17 +12390,17 @@ static void Cmd_metalburstdamagecalculator(void)
static bool32 CriticalCapture(u32 odds)
{
#if B_CRITICAL_CAPTURE == TRUE
u16 numCaught = GetNationalPokedexCount(FLAG_GET_CAUGHT);
u32 numCaught = GetNationalPokedexCount(FLAG_GET_CAUGHT);
if (numCaught <= 30)
if (numCaught <= (NUM_SPECIES * 30) / 650)
odds = 0;
else if (numCaught <= 150)
else if (numCaught <= (NUM_SPECIES * 150) / 650)
odds /= 2;
else if (numCaught <= 300)
;
else if (numCaught <= 450)
else if (numCaught <= (NUM_SPECIES * 300) / 650)
; // odds = (odds * 100) / 100;
else if (numCaught <= (NUM_SPECIES * 450) / 650)
odds = (odds * 150) / 100;
else if (numCaught <= 600)
else if (numCaught <= (NUM_SPECIES * 600) / 650)
odds *= 2;
else
odds = (odds * 250) / 100;