class CatchRateCalculator
Console.WriteLine("Catch Rate Calculator");
Console.Write("Enter the Pokémon's max HP: ");
int maxHP = int.Parse(Console.ReadLine());
Console.Write("Enter the Pokémon's current HP: ");
int currentHP = int.Parse(Console.ReadLine());
Console.Write("Enter the catch rate (e.g., 255 for easy, 45 for rare): ");
int baseCatchRate = int.Parse(Console.ReadLine());
Console.Write("Enter the ball modifier (e.g., 1 for Poké Ball, 1.5 for Great Ball): ");
double ballModifier = double.Parse(Console.ReadLine());
Console.Write("Enter the status modifier (e.g., 1 for none, 1.5 for sleep/paralysis): ");
double statusModifier = double.Parse(Console.ReadLine());
double catchProbability = CalculateCatchRate(maxHP, currentHP, baseCatchRate, ballModifier, statusModifier);
Console.WriteLine($"\nCatch Probability: {catchProbability:F2}%");
static double CalculateCatchRate(int maxHP, int currentHP, int catchRate, double ballMod, double statusMod)
double a = ((3 * maxHP - 2 * currentHP) * catchRate * ballMod * statusMod) / (3 * maxHP);
double probability = Math.Min(a, 255) / 255.0 * 100;