Example #1
0
 public static void ApplyLlamaGunPowerup(Player player, Vehicle vehicle, LlamaGunPowerup powerup)
 {
     foreach (Weapon weapon in vehicle.Weapons)
     {
         if (weapon is LlamaGun)
         {
             return;
         }
     }
     player.HasLlama = true;
     vehicle.Weapons.Add(new LlamaGun(player.simulator));
 }
Example #2
0
        protected virtual void CreateNextPowerup()
        {
            this.powerupIntervalCount = 0;
            int random = Randomizer.Random.Next(0, 100);
            Powerup powerup = null;

            if (random > 88)
            {
                powerup = new BurstPowerup(this.simulator);
            }
            else if (random > 75)
            {
                if (this.game.Player.HasLlama)
                {
                    this.CreateNextPowerup();
                    return;
                }
                powerup = new LlamaGunPowerup(this.simulator);
            }
            else if (random > 63)
            {
                powerup = new RateOfFirePowerup(this.simulator);
            }
            else if (random > 50)
            {
                if (this.game.Player.HasUzi)
                {
                    this.CreateNextPowerup();
                    return;
                }
                powerup = new UziPowerup(this.simulator);
            }
            else if (random > 38)
            {
                powerup = new DamagePowerup(this.simulator);
            }
            else if (random > 25)
            {
                powerup = new MaxHealthPowerup(this.simulator);
            }
            else if (random > 12)
            {
                powerup = new HealthPowerup(this.simulator);
            }
            else
            {
                powerup = new AccuracyPowerup(this.simulator);
            }

            float x = (float)Randomizer.Random.Next(100, Screen.Width - 100);
            powerup.Position = new Vector2(x, 100);
            this.RegisterPowerup(powerup);
        }