public void Initialize()
        {
            LastPositionCelestialBody = Vector3.Zero;
            LastPositionTurret = Vector3.Zero;

            if (Turret != null)
            {
                Turret.PlayerCheckedIn = null;
                Turret = null;
            }

            if (PreviousTurret != null)
            {
                PreviousTurret.PlayerCheckedIn = null;
                PreviousTurret = null;
            }

            if (CelestialBody != null)
            {
                CelestialBody.PlayerCheckedIn = null;
                CelestialBody = null;
            }

            if (PreviousCelestialBody != null)
            {
                PreviousCelestialBody.PlayerCheckedIn = null;
                PreviousCelestialBody = null;
            }
        }
Example #2
0
 public TurretCheckBox(Turret turret)
 {
     Turret = turret;
     Turret.Wander = true;
     Turret.Disabled = false;
     Turret.ShowForm = false;
 }
Example #3
0
 public EnemyInRange()
 {
     Output = new List<KeyValuePair<Turret, Enemy>>();
     Handler = new IntegerHandler(CheckEnemyIsInRange);
     CurrentTurret = null;
     CurrentTurretRectangle = new PhysicalRectangle();
     CurrentTurretRange = new Circle(Vector3.Zero, 0);
 }
Example #4
0
 public BoostedTurrets()
 {
     Output = new List<KeyValuePair<Turret, Turret>>();
     Handler = new IntegerHandler(CheckTurretIsBoosted);
     CurrentTurret = null;
     CurrentTurretRectangle = new PhysicalRectangle();
     CurrentTurretRange = new Circle(Vector3.Zero, 0);
 }
        public void AddTurret(Turret t)
        {
            t.VisualPriority = VisualPriority - 0.01;
            t.Position = Position;
            t.EnemyWatched = Target;

            Turrets.Add(t);
        }
Example #6
0
        public void Sync()
        {
            Output.Clear();

            for (int i = 0; i < Turrets.Count; i++)
            {
                CurrentTurret = Turrets[i];

                if (CurrentTurret.Type != TurretType.Booster)
                    continue;

                SyncRectangleAndCircle();

                TurretsGrid.GetItems(CurrentTurretRectangle, Handler);
            }
        }
Example #7
0
        public void Sync()
        {
            Output.Clear();

            for (int i = 0; i < Turrets.Count; i++)
            {
                NearestEnemy = null;

                CurrentTurret = Turrets[i];

                if (CurrentTurret.Type == TurretType.Gravitational || CurrentTurret.Type == TurretType.Booster)
                    continue;

                SyncRectangleAndCircle();

                EnemiesGrid.GetItems(CurrentTurretRectangle, Handler);

                if (NearestEnemy != null)
                    Output.Add(new KeyValuePair<Turret, Enemy>(CurrentTurret, NearestEnemy));
            }
        }
Example #8
0
 public void DoTurretUpgraded(Turret turret, SimPlayer p)
 {
     Simulator.Scene.Animations.Add(new TurretMoneyAnimation(turret.BuyPrice, false, turret.Position, VisualPriorities.Default.TurretUpgradedAnimation));
 }
Example #9
0
        public void DoTurretToPlaceSelected(Turret turret, SimPlayer p)
        {
            var player = Players[p];

            player.Cursor.FadeOut();
            turret.CelestialBody.ShowTurretsZone = true;
            turret.ShowRange = true;
            turret.ShowForm = true;

            foreach (var turret2 in turret.CelestialBody.Turrets)
                turret2.ShowForm = true;

            HelpBar.ShowMessage(HelpBarMessage.InstallTurret, p.BasePlayer.InputType);
        }
 private void NotifySellTurretAsked(Turret turret, SimPlayer player)
 {
     if (SellTurretAsked != null)
         SellTurretAsked(turret, player);
 }
 private void NotifyTurretToPlaceDeselected(Turret turret, SimPlayer player)
 {
     if (TurretToPlaceDeselected != null)
         TurretToPlaceDeselected(turret, player);
 }
        public void DoTurretUpgraded(Turret turret, SimPlayer player)
        {
            CommonStash.Cash -= turret.BuyPrice; //parce qu'effectue une fois la tourelle mise a jour
            NotifyCommonStashChanged(CommonStash);

            foreach (var p in Players.Values)
                p.UpdateSelection();
        }
Example #13
0
 public void DoTurretWandered(Turret turret)
 {
     XACTAudio.PlayCue("SilentCue" /*turret.MovingSfx*/, "Sound Bank");
 }
 private void NotifyTurretBought(Turret turret, SimPlayer player)
 {
     if (TurretBought != null)
         TurretBought(turret, player);
 }
        public void DoTurretBoosted(Turret boosting, Turret boosted)
        {
            int value = -1;
            bool contained = BoostedTurretsThisTick.TryGetValue(boosted, out value);

            if (!contained)
                BoostedTurretsThisTick.Add(boosted, boosting.Level);
            else if (value < boosting.Level)
                BoostedTurretsThisTick[boosted] = boosted.Level;
        }
Example #16
0
 public void DoTurretFired(Turret turret)
 {
     if (turret.Type == TurretType.Basic || turret.Type == TurretType.Laser ||
         turret.Type == TurretType.Missile || turret.Type == TurretType.MultipleLasers)
         XACTAudio.PlayCue(turret.FiringSfx, "Sound Bank");
 }
Example #17
0
 public void DoTurretReactivated(Turret turret)
 {
     if (!turret.BackActiveThisTickOverride)
         XACTAudio.PlayCue("TurretUpgraded", "Sound Bank");
 }
 private void NotifyTurretSold(Turret turret, SimPlayer player)
 {
     if (TurretSold != null)
         TurretSold(turret, player);
 }
        public void DoTurretSold(Turret turret, SimPlayer player)
        {
            CommonStash.Cash += turret.SellPrice;
            NotifyCommonStashChanged(CommonStash);

            foreach (var p in Players.Values)
                p.UpdateSelection();
        }
 private void NotifyTurretUpgraded(Turret turret, SimPlayer player)
 {
     if (TurretUpgraded != null)
         TurretUpgraded(turret, player);
 }
 public void DoTurretReactivated(Turret turret)
 {
     foreach (var player in Players.Values)
         player.UpdateSelection();
 }
 private void NotifyTurretReactivated(Turret turret)
 {
     if (TurretReactivated != null)
         TurretReactivated(turret);
 }
 private void NotifyBuyTurretAsked(Turret turret, SimPlayer player)
 {
     if (BuyTurretAsked != null)
         BuyTurretAsked(turret, player);
 }
 private void NotifyTurretWandered(Turret turret)
 {
     if (TurretWandered != null)
         TurretWandered(turret);
 }
 private void NotifyUpgradeTurretAsked(Turret turret, SimPlayer player)
 {
     if (UpgradeTurretAsked != null)
         UpgradeTurretAsked(turret, player);
 }
 public void Sync(SimPlayerSelection other)
 {
     celestialBody = other.celestialBody;
     powerUpToBuy = other.powerUpToBuy;
     turret = other.turret;
     turretChoice = other.turretChoice;
     turretToBuy = other.turretToBuy;
     turretToPlace = other.turretToPlace;
     pausedGameChoice = other.pausedGameChoice;
     newGameChoice = other.newGameChoice;
     editingState = other.editingState;
 }
Example #27
0
        public void DoTurretToPlaceDeselected(Turret turret, SimPlayer p)
        {
            var player = Players[p];

            player.Cursor.FadeIn();
            turret.CelestialBody.ShowTurretsZone = false;
            turret.ShowRange = false;

            HelpBar.HideMessage(HelpBarMessage.InstallTurret);
        }
Example #28
0
        public void DoTurretUpgraded(Turret turret, SimPlayer player)
        {
            if (Simulator.DemoMode)
                return;

            if (turret.Type == TurretType.Gravitational)
                XACTAudio.PlayCue("GravitationalTurretUpgrade", "Sound Bank");
            else
                XACTAudio.PlayCue("TurretUpgraded", "Sound Bank");
        }
Example #29
0
        public void DoTurretSold(Turret turret, SimPlayer p)
        {
            var player = Players[p];

            if (PathPreviewing != null &&
                turret.Type == TurretType.Gravitational)
                PathPreviewing.Commit(player);

            HelpBar.HideMessage(HelpBarMessage.TurretMenu);

            Simulator.Scene.Animations.Add(new TurretMoneyAnimation(turret.SellPrice, true, turret.Position, VisualPriorities.Default.TurretUpgradedAnimation));
        }
Example #30
0
        public void DoTurretSold(Turret turret, SimPlayer player)
        {
            if (Simulator.DemoMode)
                return;

            XACTAudio.PlayCue("TurretSold", "Sound Bank");
        }