public virtual void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction)
        {
            m_shoot          = true;
            m_shootDirection = direction;
            m_lastTimeShoot  = MySandboxGame.TotalGamePlayTimeInMilliseconds;
            m_gunBase.ConsumeAmmo();

            NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME;
        }
        public virtual void Shoot(MyShootActionEnum action, Vector3 direction)
        {
            m_shoot          = true;
            m_shootDirection = direction;
            m_lastTimeShoot  = MySandboxGame.TotalGamePlayTimeInMilliseconds;

            if (Sync.IsServer && !MySession.Static.CreativeMode)
            {
                m_gunBase.ConsumeAmmo();
            }

            NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME;
        }
예제 #3
0
        public virtual void Shoot(MyShootActionEnum action, Vector3 direction, Vector3D?overrideWeaponPos, string gunAction)
        {
            m_shoot          = true;
            m_shootDirection = direction;
            m_gunBase.ConsumeAmmo();

            m_nextShootTime = MySandboxGame.TotalGamePlayTimeInMilliseconds + m_gunBase.ShootIntervalInMiliseconds;
            if (m_gunBase.ShotsInBurst > 0)
            {
                m_shotsLeftInBurst--;
                if (m_shotsLeftInBurst <= 0)
                {
                    m_nextShootTime    = MySandboxGame.TotalGamePlayTimeInMilliseconds + m_gunBase.ReloadTime;
                    m_shotsLeftInBurst = m_gunBase.ShotsInBurst;
                }
            }

            NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME;
        }