public override void Update2(GameTime gameTime)
        {
            if (Dead)
            {
                return;
            }

            if (Moveable && Solid)
            {
                TestCollision(gameTime);
            }

            Vector3 Position3 = new Vector3(Position.X(), Y, Position.Y());

            if (ShutDownTime > -1)
            {
                InstanceManager.EmitParticle(GetIntType(), Position3, ref RotationMatrix, 0, Size.X(), (Acceleration + 0.75f) / 2 * 1.5f * (1.75f - ((float)DragTime / MaxDragTime * 1.5f)));
            }
            WorldMatrix = Matrix.CreateScale(Size.X()) * Matrix.CreateFromYawPitchRoll(Rotation.getAsRadians() + RotationOffset.X, RotationOffset.Y, RotationOffset.Z) * Matrix.CreateTranslation(Position3);
            if (GetTeam() != NeutralManager.NeutralTeam)
            {
                ParticleManager.CreateRing(Position3, Size.X() * 1.75f * (1 - CloakAlpha), GetTeam());
            }

            if (FreezeTime > 0 && StunState != AttackType.None)
            {
                UpdateEmp();
            }

            base.Update2(gameTime);
        }
        public override void Update2(GameTime gameTime)
        {
            if (GetIntType() != -1)
            {
                InstanceManager.EmitParticle(GetIntType(), new Vector3(Position.X(), Y, Position.Y()), ref RotationMatrix, 0, Size.X(), 1);
            }
            Vector3 Position3 = new Vector3(Position.X(), Y, Position.Y());

            ParticleManager.CreateRing(Position3, Size.X() * BuildingRingSizeMult, GetTeam());
            WorldMatrix = Matrix.CreateScale(Size.X()) * Matrix.CreateFromYawPitchRoll(Rotation.getAsRadians() + RotationOffset.X, RotationOffset.Y, RotationOffset.Z) * Matrix.CreateTranslation(Position3);

            if (FreezeTime > 0 && StunState != AttackType.None)
            {
                switch (StunState)
                {
                case AttackType.Blue:
                    ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(0.25f, 0.25f, 1), Size.X() * 5 * Rand.F(), 1);
                    break;

                case AttackType.Red:
                    ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.25f, 0.25f), Size.X() * 5 * Rand.F(), 1);
                    break;

                case AttackType.Green:
                    ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(0.25f, 1, 0.25f), Size.X() * 5 * Rand.F(), 1);
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        public override void Update2(GameTime gameTime)
        {
            TestCollision(gameTime);

            Vector3 Position3 = new Vector3(Position.X(), Y, Position.Y());

            InstanceManager.EmitParticle(GetIntType(), Position3, ref RotationMatrix, 0, Size.X(), 1);
            WorldMatrix = Matrix.CreateScale(Size.X()) * Matrix.CreateFromYawPitchRoll(Rotation.getAsRadians() + RotationOffset.X, RotationOffset.Y, RotationOffset.Z) * Matrix.CreateTranslation(Position3);
            if (GetTeam() != NeutralManager.NeutralTeam)
            {
                ParticleManager.CreateRing(Position3, Size.X() * 1.75f * (1 - CloakAlpha), GetTeam());
            }

            UpdateEmp();
        }
        public override void Update3D(PlayerShip Ship)
        {
            if (Ship.CanPlaceTurret(TurretSize))
            {
                Vector2 PlacePosition = Ship.GetPlacePosition(TurretSize / 2);
                ParticleManager.CreateParticle(new Vector3(PlacePosition.X, 0, PlacePosition.Y), Vector3.Zero, TurretBlue, TurretSize * (10 + Rand.r.Next(5)), 1);
                ParticleManager.CreateRing(new Vector3(PlacePosition.X, 0, PlacePosition.Y), TurretSize * UnitBuilding.BuildingRingSizeMult, Ship.GetTeam());

                for (int i = 0; i < CircleGlows; i++)
                {
                    float   R = (float)(((float)i / CircleGlows * 2 * Math.PI) + (Level.Time % 2 / 2f * Math.PI));
                    Vector3 P = new Vector3((float)Math.Cos(R) * Radius + PlacePosition.X, 0, (float)Math.Sin(R) * Radius + PlacePosition.Y);
                    ParticleManager.CreateParticle(P, Vector3.Zero, Color.White, 64, 1);
                }
            }
        }
        public override void Update2(GameTime gameTime)
        {
            if (Alpha > 0 && !FactionManager.GetFaction(ParentShip.FactionNumber).PickingCards&& MarkerCount > 0)
            {
                Vector2 PlacePosition = ParentShip.GetPlacePosition(MyCard.TurretSize / 2);
                ParticleManager.CreateParticle(new Vector3(PlacePosition.X, 0, PlacePosition.Y), Vector3.Zero, MyColor * Alpha * RingAlpha * 0.25f, MyCard.TurretSize * (10 + Rand.r.Next(5)), 1);
                ParticleManager.CreateRing(new Vector3(PlacePosition.X, 0, PlacePosition.Y), MyCard.TurretSize * UnitBuilding.BuildingRingSizeMult * Alpha * RingAlpha, ParentShip.GetTeam());

                for (int i = 0; i < MyCard.CircleGlows; i++)
                {
                    float   R = (float)(((float)i / MyCard.CircleGlows * 2 * Math.PI) + (Level.Time % 2 / 2f * Math.PI));
                    Vector3 P = new Vector3((float)Math.Cos(R) * MyCard.Radius * Alpha * RingAlpha + PlacePosition.X, 0, (float)Math.Sin(R) * MyCard.Radius * Alpha * RingAlpha + PlacePosition.Y);
                    ParticleManager.CreateParticle(P, Vector3.Zero, MyColor, 64 * Alpha * RingAlpha, 1);
                }
            }

            base.Update2(gameTime);
        }