示例#1
0
 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()
     });
 }
示例#2
0
 public static float Range(this ZergRandom rand, float min, float max)
 {
     return((float)rand.NextDouble() * (max - min) + min);
 }
示例#3
0
 public static bool ChancePercent(this ZergRandom rand, int percent)
 {
     return(rand.NextDouble() * 100 < percent);
 }
示例#4
0
 public static bool Chance(this ZergRandom rand, float chance)
 {
     return(rand.NextDouble() * 100 < chance);
 }