Пример #1
0
    public override void SeatClippedWorld(BaseMountable mountable)
    {
        BasePlayer mounted = mountable.GetMounted();

        if (Object.op_Equality((Object)mounted, (Object)null))
        {
            return;
        }
        if (this.IsDriver(mounted))
        {
            this.steering = 0.0f;
            this.gasPedal = 0.0f;
        }
        Vector3 velocity = this.myRigidBody.get_velocity();
        float   num      = Mathf.InverseLerp(4f, 20f, ((Vector3) ref velocity).get_magnitude());

        if ((double)num > 0.0)
        {
            mounted.Hurt(num * 100f, DamageType.Blunt, (BaseEntity)this, false);
        }
        if (!Object.op_Inequality((Object)mounted, (Object)null) || !mounted.isMounted)
        {
            return;
        }
        base.SeatClippedWorld(mountable);
    }
Пример #2
0
    public override void SeatClippedWorld(BaseMountable mountable)
    {
        BasePlayer mounted = mountable.GetMounted();

        if (mounted == null)
        {
            return;
        }
        if (this.IsDriver(mounted))
        {
            this.steering = 0f;
            this.gasPedal = 0f;
        }
        Vector3 vector3 = this.myRigidBody.velocity;
        float   single  = Mathf.InverseLerp(4f, 20f, vector3.magnitude);

        if (single > 0f)
        {
            mounted.Hurt(single * 100f, DamageType.Blunt, this, false);
        }
        if (mounted != null && mounted.isMounted)
        {
            base.SeatClippedWorld(mountable);
        }
    }
        private static BasePlayer GetMountedPlayer(BaseMountable m)
        {
            if (m.GetMounted())
            {
                return(m.GetMounted());
            }

            if (m is BaseVehicle)
            {
                var vehicle = m as BaseVehicle;

                foreach (var point in vehicle.mountPoints)
                {
                    if (point.mountable.IsValid() && point.mountable.GetMounted())
                    {
                        return(point.mountable.GetMounted());
                    }
                }
            }

            return(null);
        }
Пример #4
0
    public int GetMountPointIndex(ulong playerID)
    {
        int num = -1;

        for (int i = 0; i < mountPoints.Count; i++)
        {
            BaseMountable mountable = mountPoints[i].mountable;
            if (mountable != null)
            {
                BasePlayer mounted = mountable.GetMounted();
                if (mounted != null && mounted.userID == playerID)
                {
                    num = i;
                }
            }
        }
        if (num < 0)
        {
            Debug.LogError(GetType().Name + ": Couldn't find mount point for this player.");
        }
        return(num);
    }
Пример #5
0
    public override void SeatClippedWorld(BaseMountable mountable)
    {
        BasePlayer mounted = mountable.GetMounted();

        if (!(mounted == null))
        {
            if (IsDriver(mounted))
            {
                steering = 0f;
                gasPedal = 0f;
            }
            float num = Mathf.InverseLerp(4f, 20f, rigidBody.velocity.magnitude);
            if (num > 0f)
            {
                mounted.Hurt(num * 100f, DamageType.Blunt, this, false);
            }
            if (mounted != null && mounted.isMounted)
            {
                base.SeatClippedWorld(mountable);
            }
        }
    }
Пример #6
0
 public virtual void SeatClippedWorld(BaseMountable mountable)
 {
     mountable.DismountPlayer(mountable.GetMounted(), false);
 }