Пример #1
0
        private void RunShrinks(AvShot av)
        {
            var s = av.TracerShrinks.Dequeue();

            if (av.LastTick != Session.Tick)
            {
                if (!av.AmmoDef.Const.OffsetEffect)
                {
                    if (av.OnScreen != AvShot.Screen.None)
                    {
                        MyTransparentGeometry.AddLineBillboard(av.AmmoDef.Const.TracerTextures[0], s.Color, s.NewFront, av.PointDir, s.Length, s.Thickness);
                    }
                }
                else if (av.OnScreen != AvShot.Screen.None)
                {
                    av.DrawLineOffsetEffect(s.NewFront, -av.PointDir, s.Length, s.Thickness, s.Color);
                }

                if (av.Trail != AvShot.TrailState.Off && av.Back)
                {
                    av.RunGlow(ref s, true);
                }
            }

            if (av.TracerShrinks.Count == 0)
            {
                av.ResetHit();
            }
        }
Пример #2
0
        internal void Clean(uint expireTick)
        {
            Target.Reset(expireTick, Target.States.ProjectileClosed);
            HitList.Clear();

            if (PrimeEntity != null)
            {
                AmmoDef.Const.PrimeEntityPool.Return(PrimeEntity);
                PrimeEntity = null;
            }

            if (TriggerEntity != null)
            {
                Ai.Session.TriggerEntityPool.Return(TriggerEntity);
                TriggerEntity = null;
            }
            AvShot                 = null;
            System                 = null;
            Ai                     = null;
            AmmoDef                = null;
            WeaponCache            = null;
            LastHitShield          = false;
            IsShrapnel             = false;
            TriggeredPulse         = false;
            EwarActive             = false;
            ModelOnly              = false;
            LockOnFireState        = false;
            IsFiringPlayer         = false;
            ClientSent             = false;
            TriggerGrowthSteps     = 0;
            WeaponId               = 0;
            MuzzleId               = 0;
            Age                    = 0;
            ProjectileDisplacement = 0;
            MaxTrajectory          = 0;
            ShotFade               = 0;
            TracerLength           = 0;
            EnableGuidance         = true;
            Direction              = Vector3D.Zero;
            VisualDir              = Vector3D.Zero;
            Origin                 = Vector3D.Zero;
            ShooterVel             = Vector3D.Zero;
            TriggerMatrix          = MatrixD.Identity;
        }
Пример #3
0
        internal void Clean()
        {
            if (Monitors?.Count > 0)
            {
                for (int i = 0; i < Monitors.Count; i++)
                {
                    Monitors[i].Invoke(Target.FiringCube.EntityId, WeaponId, Id, Target.TargetId, Hit.LastHit, false);
                }

                System.Session.MonitoredProjectiles.Remove(Id);
            }
            Monitors = null;

            Target.Reset(System.Session.Tick, Target.States.ProjectileClosed);
            HitList.Clear();
            if (IsShrapnel)
            {
                if (VoxelCache != null && System.Session != null)
                {
                    System.Session.NewVoxelCache = VoxelCache;
                }
                else
                {
                    Log.Line($"IsShrapnel voxelcache return failure");
                }
            }

            if (PrimeEntity != null)
            {
                AmmoDef.Const.PrimeEntityPool.Return(PrimeEntity);
                PrimeEntity = null;
            }

            if (TriggerEntity != null)
            {
                System.Session.TriggerEntityPool.Return(TriggerEntity);
                TriggerEntity = null;
            }

            AvShot                 = null;
            System                 = null;
            Ai                     = null;
            MyPlanet               = null;
            MyShield               = null;
            AmmoDef                = null;
            WeaponCache            = null;
            VoxelCache             = null;
            IsShrapnel             = false;
            EwarAreaPulse          = false;
            EwarActive             = false;
            ModelOnly              = false;
            LockOnFireState        = false;
            IsFiringPlayer         = false;
            ClientSent             = false;
            InPlanetGravity        = false;
            TriggerGrowthSteps     = 0;
            WeaponId               = 0;
            MuzzleId               = 0;
            Age                    = 0;
            ProjectileDisplacement = 0;
            MaxTrajectory          = 0;
            ShotFade               = 0;
            TracerLength           = 0;
            FireCounter            = 0;
            AiVersion              = 0;
            UniqueMuzzleId         = 0;
            EnableGuidance         = true;
            Hit                    = new Hit();
            Direction              = Vector3D.Zero;
            VisualDir              = Vector3D.Zero;
            Origin                 = Vector3D.Zero;
            ShooterVel             = Vector3D.Zero;
            TriggerMatrix          = MatrixD.Identity;
        }