Esempio n. 1
0
        public void ProcessKillRoutine(Player player)
        {
            projectile.timeLeft = 2;

            MyPlayer modPlayer = player.GetModPlayer <MyPlayer>();

            if (!modPlayer.IsMouseLeftHeld)
            {
                ProjectileUtil.StartKillRoutine(projectile);
            }

            if (IsDetached && FiringTime == 0)
            {
                DetachmentTimer++;
                TailDistance += BeamSpeed;
                Distance     -= BeamSpeed;
            }

            if (FiringTime > 0)
            {
                FiringTime--;
            }

            if (player.dead || DetachmentTimer >= BeamFadeOutTime || (DetachmentTimer > 0 && Distance <= 0))
            {
                projectile.Kill();
            }
        }
Esempio n. 2
0
        public void KillBeam()
        {
            // set the cooldown
            CurrentFireTime = -InitialBeamCooldown;

            if (MyProjectile != null)
            {
                ProjectileUtil.StartKillRoutine(MyProjectile);
                MyProjectile = null;
            }
        }
Esempio n. 3
0
        public override bool PreAI()
        {
            // pre AI of the charge ball is responsible for telling us if the weapon has changed or the projectile should otherwise die

            bool isPassingPreAI = base.PreAI();

            if (!isPassingPreAI && MyProjectile != null)
            {
                ProjectileUtil.StartKillRoutine(MyProjectile);
            }
            return(isPassingPreAI);
        }