static Planet NewPlanet(PlanetConfig config, int id) { return(new Planet { config = config, id = id, rotationPhase = (float)random.NextDouble() * 10, rocketUsed = GameConfig.instance.rockets.RandomElement(random), hp = config.maxHp, currentRocketCooldown = random.NextFloat() }); }
public static float Range(this ZergRandom rand, float min, float max) { return((float)rand.NextDouble() * (max - min) + min); }
public static bool ChancePercent(this ZergRandom rand, int percent) { return(rand.NextDouble() * 100 < percent); }
public static bool Chance(this ZergRandom rand, float chance) { return(rand.NextDouble() * 100 < chance); }