Ejemplo n.º 1
0
 public void DoPowerUpStarted(PowerUp powerUp, SimPlayer player)
 {
     switch (powerUp.Type)
     {
         case PowerUpType.Collector: DoAddSpaceshipAsked(((PowerUpCollector) powerUp).Collector);                break;
         case PowerUpType.Spaceship: DoAddSpaceshipAsked(((PowerUpSpaceship) powerUp).SpaceshipSpaceship);       break;
         case PowerUpType.Miner: DoAddSpaceshipAsked(((PowerUpMiner) powerUp).Miner);                            break;
         case PowerUpType.AutomaticCollector: DoAddSpaceshipAsked(((PowerUpAutomaticCollector) powerUp).AutomaticCollector);  break;
     }
 }
Ejemplo n.º 2
0
        public void DoPowerUpStopped(PowerUp powerUp, SimPlayer p)
        {
            var player = Players[p];

            if (powerUp.NeedInput)
            {
                player.Cursor.FadeIn();
                player.PowerUpInputMode = false;

                if (powerUp.Crosshair != "")
                    player.Crosshair.FadeOut();

                if (powerUp.Type == PowerUpType.FinalSolution)
                {
                    PowerUpLastSolution pls = (PowerUpLastSolution) powerUp;

                    if (pls.GoAhead)
                        PathPreviewing.Commit(player);

                    player.PowerUpFinalSolution = false;
                }
            }
        }
Ejemplo n.º 3
0
        public void DoPowerUpStarted(PowerUp powerUp, SimPlayer p)
        {
            var player = Players[p];

            if (powerUp.NeedInput)
            {
                player.Cursor.FadeOut();
                player.PowerUpInputMode = true;

                if (powerUp.Crosshair != "")
                {
                    player.Crosshair.SetFrontImage(powerUp.Crosshair, powerUp.CrosshairSize, p.Color);
                    player.Crosshair.Alpha = 0;
                    player.Crosshair.FadeIn();
                }

                if (powerUp.Type == PowerUpType.FinalSolution)
                    player.PowerUpFinalSolution = true;
            }
        }
Ejemplo n.º 4
0
        public void DoPowerUpStopped(PowerUp powerUp, SimPlayer p)
        {
            if (powerUp.NeedInput)
            {
                p.Position = powerUp.Position;
                NotifyPlayerMoved(p);
            }

            if (powerUp.Type == PowerUpType.FinalSolution && ((PowerUpLastSolution) powerUp).GoAhead)
                DoPowerUpUse(p);

            p.UpdateSelection();
        }
Ejemplo n.º 5
0
        public void DoPowerUpStarted(PowerUp powerUp, SimPlayer p)
        {
            if (powerUp.Type == PowerUpType.FinalSolution)
                ((PowerUpLastSolution) powerUp).Selection = p.ActualSelection;

            p.UpdateSelection();
        }
Ejemplo n.º 6
0
 public void DoPowerUpInputPressed(PowerUp powerUp, SimPlayer player)
 {
     if (powerUp.Type == PowerUpType.RailGun)
         XACTAudio.PlayCue("SilentCue" /*"sfxRailGunCharging"*/, "Sound Bank");
 }
Ejemplo n.º 7
0
 private void NotifyPowerUpStopped(PowerUp powerUp, SimPlayer player)
 {
     if (PowerUpStopped != null)
         PowerUpStopped(powerUp, player);
 }
Ejemplo n.º 8
0
        private void InitializeImagesPowerUps(int index, PowerUp p)
        {
            Vector3 gridPosition = new Vector3(index % (int) PowerUpsLayout.X, index / (int) PowerUpsLayout.Y, 0);
            Vector3 position = this.Position + gridPosition * DistanceBetweenTwoChoices - new Vector3(300, 75, 0);

            p.BuyPosition = this.Position + gridPosition * DistanceBetweenTwoChoices;

            Image image = new Image(p.BuyImage)
            {
                VisualPriority = this.VisualPriority + 0.003f,
                SizeX = ImageSize,
                Position = position
            };
            ImagesPowerUpsBuy.Add(p.Type, image);

            Image placeHolder = new Image("powerUpPlaceHolder")
            {
                VisualPriority = this.VisualPriority + 0.004f,
                SizeX = ImageSize,
                Position = position
            };
            ImagesPlaceHolders.Add(p.Type, placeHolder);
        }
Ejemplo n.º 9
0
 public void DoPowerUpStopped(PowerUp powerUp, SimPlayer player)
 {
     XACTAudio.PlayCue("SilentCue" /*powerUp.SfxOut*/, "Sound Bank");
 }
Ejemplo n.º 10
0
 public void DoPowerUpStopped(PowerUp powerUp, SimPlayer player)
 {
     //todo
 }
        public void DoPowerUpStopped(PowerUp powerUp, SimPlayer player)
        {
            if (powerUp.Type != PowerUpType.FinalSolution)
                return;

            PowerUpLastSolution p = (PowerUpLastSolution) powerUp;

            if (!p.GoAhead)
                return;

            p.CelestialBody.ZoneImpactDestruction = p.ZoneImpactDestruction;
            p.CelestialBody.AttackPoints = p.AttackPoints;
            p.CelestialBody.LifePoints = 0;
        }
        public void DoPowerUpStarted(PowerUp powerUp, SimPlayer player)
        {
            if (powerUp.Type == PowerUpType.Pulse)
                ((PowerUpPulse) powerUp).Path = Path;

            if (powerUp.Type == PowerUpType.DarkSide)
                foreach (var c in CelestialBodies)
                    c.DarkSide = true;

            if (powerUp.Type == PowerUpType.DeadlyShootingStars)
            {
                DeadlyShootingStars = true;

                Vector3 newColor = Color.Red.ToVector3();
                Vector4 newColor2 = Color.Red.ToVector4();

                var stars = Stars.Model[0];

                stars.ReleaseColour = newColor;

                for (int i = 0; i < stars.ActiveParticlesCount; i++)
                {
                    var star = stars.Particles[i];

                    star.Colour = newColor2;

                    var effect = Simulator.Scene.Particles.Get(@"starExplosion");
                    effect.Model[0].ReleaseColour = newColor;
                    effect.Trigger(ref star.Position);
                    effect.VisualPriority = Preferences.PrioriteFondEcran - 0.00001f;
                    Simulator.Scene.Particles.Return(effect);
                }
            }
        }
Ejemplo n.º 13
0
 public void DoPowerUpStarted(PowerUp powerUp, SimPlayer player)
 {
     if (powerUp is PowerUpDeadlyShootingStars)
         ObjectsCollisions.DeadlyShootingStars = true;
     else if (powerUp is PowerUpDarkSide)
         ObjectsCollisions.DarkSide = true;
 }
Ejemplo n.º 14
0
 private void NotifyPowerUpInputPressed(PowerUp powerUp, SimPlayer player)
 {
     if (PowerUpInputPressed != null)
         PowerUpInputPressed(powerUp, player);
 }
Ejemplo n.º 15
0
 public void DoPowerUpStarted(PowerUp powerUp, SimPlayer player)
 {
     if (powerUp.Type == PowerUpType.Pulse)
         Bullets.Add(((PowerUpPulse) powerUp).Bullet);
     else if (powerUp.Type == PowerUpType.Shield)
         Bullets.Add(((PowerUpShield) powerUp).Bullet);
 }
Ejemplo n.º 16
0
        public void DoPowerUpInputCanceled(PowerUp powerUp, SimPlayer player)
        {

        }
Ejemplo n.º 17
0
 public void DoPowerUpStopped(PowerUp powerUp, SimPlayer player)
 {
     if (powerUp.Type == PowerUpType.Pulse)
         ((PowerUpPulse) powerUp).Bullet.LifePoints = 0;
     else if (powerUp.Type == PowerUpType.Shield)
         ((PowerUpShield) powerUp).Bullet.LifePoints = 0;
 }
Ejemplo n.º 18
0
 public void DoPowerUpInputReleased(PowerUp powerUp, SimPlayer player)
 {
     if (powerUp.Type == PowerUpType.Miner)
         XACTAudio.PlayCue("SilentCue" /*"sfxMineGround"*/, "Sound Bank");
 }
Ejemplo n.º 19
0
        private void InitializeTurretsPowerUps(PowerUp p)
        {
            if (p.Type == PowerUpType.RailGun)
            {
                RailGunTurret rgt = new RailGunTurret(Simulator)
                {
                    Position = HumanBattleship.Position + new Vector3(130, 30, 0),
                    VisualPriority = this.VisualPriority + 0.004f,
                    PlayerControlled = true,
                    UpdatePosition = false,
                    Watcher = false,
                    TimeLastBullet = double.MaxValue,
                    RangeAlpha = 0,
                    ShowRange = false,
                    ShowForm = false
                };

                p.BuyPosition = rgt.Position + new Vector3(300, 75, 0);
                HumanBattleship.RailGun = rgt;
                Turrets.Add(rgt);

                ImagesTurretsPowerUps.Add(p.Type, rgt);
            }
        }
Ejemplo n.º 20
0
 public void DoPowerUpStarted(PowerUp powerUp, SimPlayer player)
 {
     if (powerUp.Type == PowerUpType.Shield)
     {
         ((PowerUpShield) powerUp).ToProtect = CelestialBodyToProtect;
         ((PowerUpShield) powerUp).Bullet.Position = CelestialBodyToProtect.Position;
     }
 }