Catch rate/Capture method (Generation I)

The capture method in Generation I differs significantly from those of later generations. To determine whether a Pokémon is caught or not, the steps below are performed. If, at any point, the Pokémon is caught or breaks free, the steps following that point are not performed.
 * 1) If a Master Ball is used, the Pokémon is caught.
 * 2) Generate a random number, N, depending on the type of ball used.
 * 3) * For a : 0 to 255.
 * 4) * For a : 0 to 200.
 * 5) * Otherwise ( or ): 0 to 150.
 * 6) The Pokémon is caught if...
 * 7) * It is asleep or frozen and N is less than 25.
 * 8) * It is paralyzed, burned, or poisoned and N is less than 12.
 * 9) Otherwise, if N minus the status threshold (above) is greater than the Pokémon's catch rate, the Pokémon breaks free.
 * 10) If not, generate a random value, M, between 0 and 255.
 * 11) Calculate f:
 * 12) * f = (HPmax * 255 * 4) / (HPcurrent * Ball), where all divisions are rounded down to the nearest integer. The minimum value of f is 1 and its maximum value is 255. The value of Ball is 8 if a Great Ball is used or 12 otherwise.
 * 13) If f is greater than or equal to M, the Pokémon is caught. Otherwise, the Pokémon breaks free. In practical terms, lowering the target's HP to 1/3 of its maximum will guarantee capture with a Poké Ball, while lowering it to 1/2 will guarantee capture with a Great Ball.

If the Pokémon broke free, the steps below are performed to determine how many times the ball will shake.
 * 1) Calculate d:
 * 2) * d = Catch rate × 100 / Ball, where the value of Ball is 255 for the Poké Ball, 200 for the Great Ball, or 150 for other balls.
 * 3) If d is greater than or equal to 256, the ball shakes three times before the Pokémon breaks free.
 * 4) If not, calculate x = d × f / 255 + s, where s is 10 if the Pokémon is asleep or frozen or 5 if it is paralyzed, poisoned, or burned.
 * 5) If...
 * 6) * x < 10: the Ball misses the Pokémon completely.
 * 7) * x < 30: the Ball shakes once before the Pokémon breaks free.
 * 8) * x < 70: the Ball shakes twice before the Pokémon breaks free.
 * 9) * Otherwise, the Ball shakes three times before the Pokémon breaks free.

This algorithm thus has several curious properties that do not apply in later generations:
 * The amount of times a Poké Ball shakes before it breaks free (or not at all if it misses the Pokémon) is a rough approximation of the Pokémon's catch odds.
 * If a Pokémon will break free, a given combination of ball plus status condition plus HP will always result in the same number of shakes. This means that, if a given number of shakes is observed before the Pokémon breaks free for a given combination of these values, if the ball is ever observed to shake more times with the same combination of values, the Pokémon will be caught.
 * Under certain situations, a Great Ball is more effective than an Ultra Ball. In particular, Pokémon with high catch rates, no status, and above ½ HP may guarantee capture with a Great Ball but fail to do so with an Ultra Ball.
 * The effect of reducing HP diminishes with lower catch rates, and the effect of inflicting status diminishes with higher catch rates. Regardless of catch rate, reducing the HP does not increase chances of capture at less than ½ HP with Great Balls, and ⅓ HP with other balls.
 * Inflicting a status ailment gives the player a flat additional chance (from 4.6% to 16.6%) to catch the Pokémon regardless of all other factors, making certain Pokémon easier to catch in Generation I than they are in later generations: A sleeping with full HP may, on average, be caught in about six Ultra Balls in Generation I, but from Generation II onwards exactly the same circumstances would require an average of about 64 Ultra Balls— over ten times as many.
 * Due to the nature of the algorithm, Ultra Balls will only perform better than Great Balls on Pokémon whose capture rates are above 55 and below 200 in Generation I. Ultra Balls increase the overall chance of capture by as much as 20% in comparison to Great Balls for Pokémon near the center of that range.
 * Assuming the current HP of target Pokémon is less than or equal to ½ HP for Great Balls and ⅓ HP for Ultra Balls, Ultra Balls increase the overall chance to capture by 10% or more in comparison to Great Balls for the following Pokémon:
 * - Metapod, Kakuna, Pidgeotto, Raticate, Fearow, Arbok, Sandslash, Nidorina, Nidorino, Clefairy, Jigglypuff, Golbat, Gloom, Persian, Poliwhirl, Kadabra, Machoke, Weepinbell, Graveler, Haunter, Exeggcute, and Rhyhorn.

