public SelectedCelestialBodyAnimation(Simulator simulator)
        {
            Simulator = simulator;

            Selection = Simulator.Scene.Particles.Get(@"selectionCorpsCeleste");
            Selection.VisualPriority = VisualPriorities.Default.CelestialBodySelection;
        }
Пример #2
0
        public override void Initialize()
        {
            base.Initialize();

            Rectangle.X = (int) Position.X - Rectangle.Width;
            Rectangle.Y = (int) Position.Y - Rectangle.Height;

            Image.Position = Position;
            Image.Rotation = MathHelper.Pi + (float)Math.Atan2(Direction.Y, Direction.X);
            Image.VisualPriority = VisualPriority + 0.001f;

            ExplodingEffect = Scene.Particles.Get(@"projectileMissileExplosion");
            ExplodingEffect.VisualPriority = VisualPriorities.Default.DefaultBullet;

            TrailEffect = Scene.Particles.Get(@"traineeMissile");
            TrailEffect.VisualPriority = Image.VisualPriority - 0.0001f;

            ConeEmitter emitter = (ConeEmitter)TrailEffect.Model[0];
            emitter.Direction = (float)Math.Atan2(Direction.Y, Direction.X) - MathHelper.Pi;

            LifePoints = 5;
            TrailEffectCounter = 400;
            Wander = false;
            Deflected = false;
        }
Пример #3
0
 public void Return(Particle particle)
 {
     if (particle.Model.ActiveParticlesCount != 0)
         particle.State = State.Dying;
     else
         particle.State = State.Dead;
 }
Пример #4
0
 public void Initialize()
 {
     Speed = Main.Random.Next(10, 20);
     RepresentationParticules = Scene.Particles.Get(Definition.ParticulesRepresentation);
     RepresentationParticules.VisualPriority = VisualPriority - 0.001f;
     TempsExistence = Definition.TimeAlive;
     Circle = new Circle(this, Definition.Radius);
     LifePoints = 1;
     SfxDie = (Type == MineralType.Life1) ? "sfxLifePack" : "sfxMoney" + Main.Random.Next(1, 4);
 }
Пример #5
0
        public void LoadContent()
        {
            if (!ContentLoaded)
            {
                Effect = Scene.Particles.Get(@"etoileFilante");
                Effect.VisualPriority = Preferences.PrioriteFondEcran - 0.01f;

                ContentLoaded = true;
            }
        }
Пример #6
0
 public PinkHoleLite(
     Scene scene,
     Vector3 position,
     Particle effect,
     double visualPriority)
 {
     Effect = effect;
     Scene = scene;
     Position = position;
     VisualPriority = visualPriority;
 }
Пример #7
0
        public override void Update()
        {
            base.Update();

            if (Glow == null)
            {
                Glow = Simulator.Scene.Particles.Get( "boosterTurret" );
                setGlow();
            }

            Vector3 pos = this.Position;
            Glow.Trigger( ref pos );
        }
Пример #8
0
 public PinkHole(
     Simulator simulator,
     string name,
     Vector3 path,
     Vector3 position,
     Size size,
     float speed,
     Particle effect,
     int startingPourc,
     double visualPriority)
     : base (simulator, name, path, position, 0, size, speed, null, startingPourc, visualPriority, false)
 {
     Effect = effect;
     Effect.VisualPriority = visualPriority;
 }
Пример #9
0
        public SpaceshipCursor(Scene scene, Vector3 initialPosition, float speed, double visualPriority, Color color, string image, bool visible)
            : base(scene, initialPosition, speed, visualPriority, image, false)
        {
            FrontImage.SizeX = 4;

            SetBackImage(image + "Back", 4, color);
            Circle.Radius = FrontImage.Size.X / 2;

            FiringCursor = new Image("FiringDirection")
            { 
                SizeX = 4,
                Alpha = 150,
                VisualPriority = visualPriority + 0.00001
            };


            FiringCursor.Origin = new Vector2(FiringCursor.Center.X, FrontImage.Center.Y + 7);

            Color = color;

            ShowTrail = true;

            TrailEffect = Scene.Particles.Get(@"spaceshipTrail");
            TrailEffect.Model[0].ReleaseColour = Color.ToVector3();
            TrailEffect.VisualPriority = BackImage.VisualPriority + 0.00001;

            TrailEffect2 = Scene.Particles.Get(@"spaceshipTrail2");
            TrailEffect2.VisualPriority = BackImage.VisualPriority + 0.00002;

            LastPosition = Position;

            NotMovingReleaseSpeed = new ProjectMercury.VariableFloat()
            {
                Value = 50,
                Variation = 0
            };

            MovingReleaseSpeed = new ProjectMercury.VariableFloat()
            {
                Value = 0,
                Variation = 25
            };

            TrailEffect.Model[0].ReleaseSpeed = NotMovingReleaseSpeed;
            TrailEffect2.Model[0].ReleaseSpeed = NotMovingReleaseSpeed;

            ShowFiringCursor = false;
        }
Пример #10
0
        public override void Initialize()
        {
            base.Initialize();

            Position = Target.Position;

            Rectangle.set((int) Position.X - 10, (int) Position.Y - 10, 20, 20);
            
            ExplodingEffect = Scene.Particles.Get(@"projectileBaseExplosion");
            ExplodingEffect.VisualPriority = VisualPriorities.Default.DefaultBullet;

            TurretEffect = Scene.Particles.Get(@"gunnerTurret");
            TurretEffect.Model[0].ReleaseColour = Turret.Color.ToVector3();
            TurretEffect.VisualPriority = Turret.VisualPriority + 0.0001f;

            LifePoints = Int16.MaxValue;
        }
Пример #11
0
        public Enemy()
        {
            Minerals = new List<Mineral>();

            MovingEffect = null;

            AttackPoints = 1;
            PointsValue = 1;

            Shape = Shape.Rectangle;
            Rectangle = new PhysicalRectangle(0, 0, 1, 1);
            Circle = new Circle(Vector3.Zero, 1);
            Type = EnemyType.Asteroid;
            Level = 0;
            WaveId = -1;
            EndOfPathReached = false;

            CashValueText = new Text(@"Pixelite") { SizeX = 2 };
            SfxHit = "";
            SfxDie = "";
            LastHitBy = null;
        }
        public void Initialize()
        {
            ShootingStars.Clear();

            if (Simulator.EditorMode && Simulator.EditorState == EditorState.Editing)
            {
                foreach (var c in CelestialBodies)
                    c.CanSelectOverride = true;
            }

            Path.CelestialBodies = CelestialBodies;
            Path.Initialize();

            PathPreview.CelestialBodies = CelestialBodies;
            PathPreview.Initialize();

            Stars = Simulator.Scene.Particles.Get(@"etoilesScintillantes");
            Stars.VisualPriority = Preferences.PrioriteGUIEtoiles;
            StarsEmitter = 0;

            DeadlyShootingStars = false;
        }
Пример #13
0
        public Turret(Simulator simulator)
        {
            Simulator = simulator;
            TimeLastBullet = 0;
            Type = TurretType.None;
            Name = "Unknown";
            Description = @"Unknown";
            CanSell = true;
            CanSelect = true;
            DisabledCounter = 0;
            CanUpdateOverride = true;
            DisabledOverride = true;
            Watcher = true;
            VisualPriorityBackup = VisualPriorities.Default.Turret;
            BackActiveThisTickOverride = false;
            BackActiveThisTick = false;
            Visible = true;
            Shape = Core.Physics.Shape.Circle;
            Circle = new Circle(this, 30);
            ToPlaceMode = false;
            CelestialBody = null;
            RangeAlpha = 100;
            RangePreviewAlpha = 50;
            RangeImage = new Image("CercleBlanc", Vector3.Zero)
            {
                Color = new Color(Color.R, Color.G, Color.B, RangeAlpha),
                VisualPriority = VisualPriorities.Default.TurretRange
            };
            RangePreviewImage = new Image("CercleBlanc", Vector3.Zero)
            {
                Color = new Color(Color.R, Color.G, Color.B, RangePreviewAlpha),
                VisualPriority = VisualPriorities.Default.TurretRange + 0.000001
            };
            ShowRange = false;
            ShowRangePreview = false;
            CanPlace = true;
            FormImage = new Image("CercleBlanc", Vector3.Zero)
            {
                Color = new Color(Color.R, Color.G, Color.B, 100),
                VisualPriority = VisualPriorities.Default.Turret + 0.001f
            };
            ShowForm = true;
            BoostMultiplier = 0;
            Wander = true;
            PlayerControlled = false;
            UpdatePosition = true;

            BoostGlow = Simulator.Scene.Particles.Get(@"boosterTurret");
            BoostGlow.VisualPriority = this.VisualPriorityBackup + 0.006f;

            CircleEmitter emitter = (CircleEmitter) BoostGlow.Model[0];

            emitter.Radius = this.Circle.Radius;
            emitter.ReleaseScale.Value = 50;
            emitter.ReleaseScale.Variation = 10;
            emitter.Term = this.Circle.Radius / 300f;
            emitter.ReleaseColour = this.Color.ToVector3();

            PlayerCheckedIn = null;

            Alive = true;

            RangeEffect = -1;

            DisableBar = new DisableBar(Simulator.Scene);
            DisabledAnnounciationCounter = float.NaN;
            NewWanderThisTick = false;
        }
Пример #14
0
            public Missile(Scene scene, IDestroyable followedObject, double visualPriority, Vector3 position, double delay, DestroyableHandler targetReachedCallback)
            {
                FollowedObject = followedObject;
                TargetReachedCallback = targetReachedCallback;

                Image = new Image("PixelBlanc")
                {
                    Position = position,
                    VisualPriority = 1,
                    Alpha = 0,
                    SizeX = 50
                };

                Effect = scene.Particles.Get(@"mothershipMissile");
                Effect.VisualPriority = visualPriority;

                FollowEffect follow = new FollowEffect()
                {
                    Delay = delay,
                    Length = 15000,
                    FollowedObject = FollowedObject,
                    Speed = 1.5f,
                    Progress = Core.Utilities.Effect<IPhysical>.ProgressType.Linear
                };

                scene.PhysicalEffects.Add(this.Image, follow);
            }
Пример #15
0
        public Mothership(Simulator simulator, double visualPriority)
            : base(simulator)
        {
            Aliens = new Image(@"MothershipAliens")
            {
                VisualPriority = visualPriority + 0.000008
            };

            Image = new Image(@"MothershipBase")
            {
                VisualPriority = visualPriority + 0.000009
            };

            Bubble = new Image(@"MothershipBubble")
            {
                Blend = BlendType.Add,
                Alpha = 200,
                VisualPriority = visualPriority + 0.000005

            };

            Deadly = new Image(@"MothershipDeadly")
            {
                Alpha = 0,
                VisualPriority = visualPriority + 0.000004

            };

            Eyes = new NewSprite(@"MothershipEyesSprite", new List<int>()
            {
                0, 0, 0, 0, 0, 0, 0, 1,
                0, 0, 0, 0, 2, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 3,
                0, 0, 0, 0, 0, 0, 4, 0
            }, 200, true)
            {
                VisualPriority = visualPriority + 0.000005
            };

            InvasionShips = new Image(@"MothershipInvasionShips")
            {
                Alpha = 0,
                VisualPriority = visualPriority + 0.000006

            };

            Lights = new Image(@"MothershipLights")
            {
                VisualPriority = visualPriority + 0.000007
            
            };

            Tentacles = new Image(@"MothershipTentacles")
            {
                VisualPriority = visualPriority + 0.000010
            };

            SizeX = 16;
            Circle.Radius = Image.AbsoluteSize.X / 2;

            Missiles = new List<Missile>();

            AbductionEffect = Simulator.Scene.Particles.Get(@"mothershipAbduction");
            ((RadialGravityModifier) AbductionEffect.Model[0].Modifiers[0]).Radius = 2000;
            ((RadialGravityModifier) AbductionEffect.Model[0].Modifiers[0]).Strength = 700;
            AbductionLength = 5000;
            AbductionElapsed = 0;
            Abducting = false;
        }
Пример #16
0
        public void Initialize()
        {
            if (Image == null)
                LoadAssets();

            MultipleLasersEffect = Simulator.Scene.Particles.Get(@"etincelleLaser");
            MissileEffect = Simulator.Scene.Particles.Get(@"etincelleMissile");
            LaserEffect = Simulator.Scene.Particles.Get(@"etincelleLaserSimple");
            SlowMotionEffect = Simulator.Scene.Particles.Get(@"etincelleSlowMotionTouche");
            ExplodingEffect = Simulator.Scene.Particles.Get(@"explosionEnnemi");
            NanobotsInfectionEffect = Simulator.Scene.Particles.Get(@"nanobots");
            NanobotsInfectionEffect.Model[0].ReleaseColour = Color.Red.ToVector3();

            VisualPriority = Simulator.TweakingController.EnemiesFactory.GetVisualPriority(Type, 0);
            Image.VisualPriority = VisualPriority;
            ExplodingEffect.VisualPriority = VisualPriority - 0.001f;
            MultipleLasersEffect.VisualPriority = VisualPriority - 0.001f;
            MissileEffect.VisualPriority = VisualPriority - 0.001f;
            LaserEffect.VisualPriority = VisualPriority - 0.001f;
            SlowMotionEffect.VisualPriority = VisualPriority - 0.001f;
            NanobotsInfectionEffect.VisualPriority = VisualPriority - 0.001f;

            Resistance = 0;

            Path.Position(Displacement, ref position);

            Rectangle.Width = Rectangle.Height = Simulator.TweakingController.EnemiesFactory.GetSize(Type);
            Circle.Radius = Rectangle.Width / 2;

            Rectangle.X = (int)Position.X - Rectangle.Width / 2;
            Rectangle.Y = (int)Position.Y - Rectangle.Height / 2;
            Circle.Position.X = Position.X - Circle.Radius;
            Circle.Position.Y = Position.Y - Circle.Radius;

            ExplodingEffect.Model[0].ReleaseColour = Color.ToVector3();
            MovingEffect = null;

            RotationSpeed = Main.Random.Next(-5, 6) / 100.0f;

            Minerals.Clear();

            NanobotsInfectionTime = 0;
            NanobotsInfectionHitPoints = 0;
            NanobotsInfectionLastPosition = Position;

            EndOfPathReached = false;

            BeingHitCounter = 0;

            SfxHit = Simulator.TweakingController.EnemiesFactory.GetSfxHit(Type);
            SfxDie = Simulator.TweakingController.EnemiesFactory.GetSfxDie(Type);

            LastHitBy = null;
        }
        public override void Initialize()
        {
            Selection = Scene.Particles.Get(@"selectionCorpsCeleste");

            ((CircleEmitter) Selection.Model[0]).Radius = DecrementCircle.Radius + 5;
        }
Пример #18
0
 public virtual void Initialize()
 {
     TrailEffect = Simulator.Scene.Particles.Get(@"spaceshipTrail");
     TrailEffect.VisualPriority = Image.VisualPriority + 0.00001f;
 }
Пример #19
0
        public void DoDie()
        {
            Alive = false;

            DieEffect1 = Simulator.Scene.Particles.Get(@"bouleTerreMeurt");
            DieEffect2 = Simulator.Scene.Particles.Get(Simulator.CutsceneMode ? @"anneauTerreMeurt2" : @"anneauTerreMeurt");

            DieEffect1.VisualPriority = VisualPriority - 0.000001;
            DieEffect2.VisualPriority = VisualPriority - 0.000001;

            var p = Position;

            DieEffect1.Trigger(ref p);
            DieEffect2.Trigger(ref p);

            Simulator.Scene.Particles.Return(DieEffect1);
            Simulator.Scene.Particles.Return(DieEffect2);
        }