public static int GetRandomScalar(this PokeSize size) { return(size switch { PokeSize.XS => (Util.Rand.Next(0x10) + 0x00), PokeSize.S => (Util.Rand.Next(0x20) + 0x10), PokeSize.AV => (Util.Rand.Next(0xA0) + 0x30), PokeSize.L => (Util.Rand.Next(0x20) + 0xD0), PokeSize.XL => (Util.Rand.Next(0x10) + 0xF0), _ => GetRandomPokeSize() // Official code sums two randoms for triangular distribution. });
public static int GetRandomScalar(this PokeSize size) { return(size switch { PokeSize.XS => (Util.Rand.Next(0x10) + 0x00), PokeSize.S => (Util.Rand.Next(0x20) + 0x10), PokeSize.AV => (Util.Rand.Next(0xA0) + 0x30), PokeSize.L => (Util.Rand.Next(0x20) + 0xD0), PokeSize.XL => (Util.Rand.Next(0x10) + 0xF0), _ => GetRandomScalar() });