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;
            }
        }
Ejemplo n.º 2
0
 public TurretCheckBox(Turret turret)
 {
     Turret = turret;
     Turret.Wander = true;
     Turret.Disabled = false;
     Turret.ShowForm = false;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 5
0
        public void AddTurret(Turret t)
        {
            t.VisualPriority = VisualPriority - 0.01;
            t.Position = Position;
            t.EnemyWatched = Target;

            Turrets.Add(t);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 8
0
 public void DoTurretUpgraded(Turret turret, SimPlayer p)
 {
     Simulator.Scene.Animations.Add(new TurretMoneyAnimation(turret.BuyPrice, false, turret.Position, VisualPriorities.Default.TurretUpgradedAnimation));
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 10
0
 private void NotifySellTurretAsked(Turret turret, SimPlayer player)
 {
     if (SellTurretAsked != null)
         SellTurretAsked(turret, player);
 }
Ejemplo n.º 11
0
 private void NotifyTurretToPlaceDeselected(Turret turret, SimPlayer player)
 {
     if (TurretToPlaceDeselected != null)
         TurretToPlaceDeselected(turret, player);
 }
Ejemplo n.º 12
0
        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();
        }
Ejemplo n.º 13
0
 public void DoTurretWandered(Turret turret)
 {
     XACTAudio.PlayCue("SilentCue" /*turret.MovingSfx*/, "Sound Bank");
 }
Ejemplo n.º 14
0
 private void NotifyTurretBought(Turret turret, SimPlayer player)
 {
     if (TurretBought != null)
         TurretBought(turret, player);
 }
Ejemplo n.º 15
0
        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;
        }
Ejemplo n.º 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");
 }
Ejemplo n.º 17
0
 public void DoTurretReactivated(Turret turret)
 {
     if (!turret.BackActiveThisTickOverride)
         XACTAudio.PlayCue("TurretUpgraded", "Sound Bank");
 }
Ejemplo n.º 18
0
 private void NotifyTurretSold(Turret turret, SimPlayer player)
 {
     if (TurretSold != null)
         TurretSold(turret, player);
 }
Ejemplo n.º 19
0
        public void DoTurretSold(Turret turret, SimPlayer player)
        {
            CommonStash.Cash += turret.SellPrice;
            NotifyCommonStashChanged(CommonStash);

            foreach (var p in Players.Values)
                p.UpdateSelection();
        }
Ejemplo n.º 20
0
 private void NotifyTurretUpgraded(Turret turret, SimPlayer player)
 {
     if (TurretUpgraded != null)
         TurretUpgraded(turret, player);
 }
Ejemplo n.º 21
0
 public void DoTurretReactivated(Turret turret)
 {
     foreach (var player in Players.Values)
         player.UpdateSelection();
 }
Ejemplo n.º 22
0
 private void NotifyTurretReactivated(Turret turret)
 {
     if (TurretReactivated != null)
         TurretReactivated(turret);
 }
Ejemplo n.º 23
0
 private void NotifyBuyTurretAsked(Turret turret, SimPlayer player)
 {
     if (BuyTurretAsked != null)
         BuyTurretAsked(turret, player);
 }
Ejemplo n.º 24
0
 private void NotifyTurretWandered(Turret turret)
 {
     if (TurretWandered != null)
         TurretWandered(turret);
 }
Ejemplo n.º 25
0
 private void NotifyUpgradeTurretAsked(Turret turret, SimPlayer player)
 {
     if (UpgradeTurretAsked != null)
         UpgradeTurretAsked(turret, player);
 }
Ejemplo n.º 26
0
 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 30
0
        public void DoTurretSold(Turret turret, SimPlayer player)
        {
            if (Simulator.DemoMode)
                return;

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