Beispiel #1
0
 // Token: 0x06002E2C RID: 11820 RVA: 0x000AEA80 File Offset: 0x000ACC80
 private void OnLocallyAppended(IDMain main)
 {
     if (!this._motor)
     {
         this._motor = main.GetRemote <global::CCMotor>();
     }
 }
Beispiel #2
0
 private void OnLocallyAppended(IDMain main)
 {
     if (this._motor == null)
     {
         this._motor = main.GetRemote <CCMotor>();
     }
 }
 public void Set(IDMain idMain, ref Vector3 localPoint, ref Angle2 localNormal, byte bodyPart, ref uLink.NetworkMessageInfo info)
 {
     if (idMain is Character)
     {
         this.Set((Character)idMain, ref localPoint, ref localNormal, bodyPart, ref info);
     }
     else
     {
         this.Set(idMain.GetRemote <HitBoxSystem>(), ref localPoint, ref localNormal, bodyPart, ref info);
     }
 }
 public void Set(IDMain idMain, ref Vector3 localPoint, ref Angle2 localNormal, byte bodyPart, ref uLink.NetworkMessageInfo info)
 {
     if (!(idMain is Character))
     {
         this.Set(idMain.GetRemote<HitBoxSystem>(), ref localPoint, ref localNormal, bodyPart, ref info);
     }
     else
     {
         this.Set((Character)idMain, ref localPoint, ref localNormal, bodyPart, ref info);
     }
 }
    protected virtual void ReadHitInfo(uLink.BitStream stream, out GameObject hitObj, out bool hitNetworkObj, out bool hitBodyPart, out BodyPart bodyPart, out IDRemoteBodyPart remoteBodyPart, out NetEntityID hitViewID, out Transform fromTransform, out Vector3 endPos, out Vector3 offset, out bool isHeadshot)
    {
        HitBoxSystem hitBoxSystem;
        bool         flag;
        byte         num = stream.ReadByte();

        if (num >= 255)
        {
            hitNetworkObj = false;
            hitBodyPart   = false;
            bodyPart      = BodyPart.Undefined;
        }
        else
        {
            hitNetworkObj = true;
            if (num >= 120)
            {
                hitBodyPart = false;
                bodyPart    = BodyPart.Undefined;
            }
            else
            {
                hitBodyPart = true;
                bodyPart    = (BodyPart)num;
            }
        }
        if (!hitNetworkObj)
        {
            hitViewID      = NetEntityID.unassigned;
            hitObj         = null;
            remoteBodyPart = null;
        }
        else
        {
            hitViewID = stream.Read <NetEntityID>(new object[0]);
            if (hitViewID.isUnassigned)
            {
                hitObj         = null;
                remoteBodyPart = null;
            }
            else
            {
                hitObj = hitViewID.gameObject;
                if (!hitObj)
                {
                    remoteBodyPart = null;
                }
                else
                {
                    IDBase dBase = IDBase.Get(hitObj);
                    if (!dBase)
                    {
                        remoteBodyPart = null;
                    }
                    else
                    {
                        IDMain dMain = dBase.idMain;
                        if (!dMain)
                        {
                            remoteBodyPart = null;
                        }
                        else
                        {
                            hitBoxSystem = (!(dMain is Character) ? dMain.GetRemote <HitBoxSystem>() : ((Character)dMain).hitBoxSystem);
                            if (!hitBoxSystem)
                            {
                                remoteBodyPart = null;
                            }
                            else
                            {
                                hitBoxSystem.bodyParts.TryGetValue((BodyPart)((int)bodyPart), out remoteBodyPart);
                            }
                        }
                    }
                }
            }
        }
        endPos = stream.ReadVector3();
        offset = Vector3.zero;
        if (remoteBodyPart)
        {
            flag          = false;
            fromTransform = remoteBodyPart.transform;
            BodyPart bodyPart1 = (BodyPart)((int)bodyPart);
            switch (bodyPart1)
            {
            case BodyPart.Brain:
            case BodyPart.L_Eye:
            case BodyPart.R_Eye:
            {
Label0:
                isHeadshot = true;
                break;
            }

            default:
            {
                switch (bodyPart1)
                {
                case BodyPart.Head:
                case BodyPart.Jaw:
                {
                    goto Label0;
                }

                case BodyPart.Scalp:
                case BodyPart.Nostrils:
                {
                    isHeadshot = false;
                    break;
                }

                default:
                {
                    goto case BodyPart.Nostrils;
                }
                }
                break;
            }
            }
        }
        else if (!hitObj)
        {
            fromTransform = null;
            flag          = false;
            isHeadshot    = false;
        }
        else
        {
            fromTransform = hitObj.transform;
            flag          = true;
            isHeadshot    = false;
        }
        if (fromTransform)
        {
            offset = endPos;
            endPos = fromTransform.TransformPoint(endPos);
        }
    }
Beispiel #6
0
    // Token: 0x06003319 RID: 13081 RVA: 0x000C0CA0 File Offset: 0x000BEEA0
    protected virtual void ReadHitInfo(BitStream stream, out GameObject hitObj, out bool hitNetworkObj, out bool hitBodyPart, out BodyPart bodyPart, out IDRemoteBodyPart remoteBodyPart, out global::NetEntityID hitViewID, out Transform fromTransform, out Vector3 endPos, out Vector3 offset, out bool isHeadshot)
    {
        byte b = stream.ReadByte();

        if (b < 255)
        {
            hitNetworkObj = true;
            if (b < 120)
            {
                hitBodyPart = true;
                bodyPart    = (int)b;
            }
            else
            {
                hitBodyPart = false;
                bodyPart    = 0;
            }
        }
        else
        {
            hitNetworkObj = false;
            hitBodyPart   = false;
            bodyPart      = 0;
        }
        if (hitNetworkObj)
        {
            hitViewID = stream.Read <global::NetEntityID>(new object[0]);
            if (!hitViewID.isUnassigned)
            {
                hitObj = hitViewID.gameObject;
                if (hitObj)
                {
                    IDBase idbase = IDBase.Get(hitObj);
                    if (idbase)
                    {
                        IDMain idMain = idbase.idMain;
                        if (idMain)
                        {
                            global::HitBoxSystem hitBoxSystem;
                            if (idMain is global::Character)
                            {
                                hitBoxSystem = ((global::Character)idMain).hitBoxSystem;
                            }
                            else
                            {
                                hitBoxSystem = idMain.GetRemote <global::HitBoxSystem>();
                            }
                            if (hitBoxSystem)
                            {
                                hitBoxSystem.bodyParts.TryGetValue(bodyPart, ref remoteBodyPart);
                            }
                            else
                            {
                                remoteBodyPart = null;
                            }
                        }
                        else
                        {
                            remoteBodyPart = null;
                        }
                    }
                    else
                    {
                        remoteBodyPart = null;
                    }
                }
                else
                {
                    remoteBodyPart = null;
                }
            }
            else
            {
                hitObj         = null;
                remoteBodyPart = null;
            }
        }
        else
        {
            hitViewID      = global::NetEntityID.unassigned;
            hitObj         = null;
            remoteBodyPart = null;
        }
        endPos = stream.ReadVector3();
        offset = Vector3.zero;
        if (remoteBodyPart)
        {
            fromTransform = remoteBodyPart.transform;
            BodyPart bodyPart2 = bodyPart;
            switch (bodyPart2)
            {
            case 16:
            case 20:
            case 21:
                break;

            default:
                switch (bodyPart2)
                {
                case 9:
                case 12:
                    goto IL_1A3;
                }
                isHeadshot = false;
                goto IL_1B5;
            }
IL_1A3:
            isHeadshot = true;
            IL_1B5 :;
        }
        else if (hitObj)
        {
            fromTransform = hitObj.transform;
            isHeadshot    = false;
        }
        else
        {
            fromTransform = null;
            isHeadshot    = false;
        }
        if (fromTransform)
        {
            offset = endPos;
            endPos = fromTransform.TransformPoint(endPos);
        }
    }
Beispiel #7
0
    protected virtual void ReadHitInfo(BitStream stream, out GameObject hitObj, out bool hitNetworkObj, out bool hitBodyPart, out BodyPart bodyPart, out IDRemoteBodyPart remoteBodyPart, out NetEntityID hitViewID, out Transform fromTransform, out Vector3 endPos, out Vector3 offset, out bool isHeadshot)
    {
        bool flag;
        byte num = stream.ReadByte();

        if (num < 0xff)
        {
            hitNetworkObj = true;
            if (num < 120)
            {
                hitBodyPart = true;
                bodyPart    = (BodyPart)num;
            }
            else
            {
                hitBodyPart = false;
                bodyPart    = BodyPart.Undefined;
            }
        }
        else
        {
            hitNetworkObj = false;
            hitBodyPart   = false;
            bodyPart      = BodyPart.Undefined;
        }
        if (hitNetworkObj)
        {
            hitViewID = stream.Read <NetEntityID>(new object[0]);
            if (!hitViewID.isUnassigned)
            {
                hitObj = hitViewID.gameObject;
                if (hitObj != null)
                {
                    IDBase base2 = IDBase.Get(hitObj);
                    if (base2 != null)
                    {
                        IDMain idMain = base2.idMain;
                        if (idMain != null)
                        {
                            HitBoxSystem hitBoxSystem;
                            if (idMain is Character)
                            {
                                hitBoxSystem = ((Character)idMain).hitBoxSystem;
                            }
                            else
                            {
                                hitBoxSystem = idMain.GetRemote <HitBoxSystem>();
                            }
                            if (hitBoxSystem != null)
                            {
                                hitBoxSystem.bodyParts.TryGetValue(bodyPart, out remoteBodyPart);
                            }
                            else
                            {
                                remoteBodyPart = null;
                            }
                        }
                        else
                        {
                            remoteBodyPart = null;
                        }
                    }
                    else
                    {
                        remoteBodyPart = null;
                    }
                }
                else
                {
                    remoteBodyPart = null;
                }
            }
            else
            {
                hitObj         = null;
                remoteBodyPart = null;
            }
        }
        else
        {
            hitViewID      = NetEntityID.unassigned;
            hitObj         = null;
            remoteBodyPart = null;
        }
        endPos = stream.ReadVector3();
        offset = Vector3.zero;
        if (remoteBodyPart == null)
        {
            if (hitObj != null)
            {
                fromTransform = hitObj.transform;
                flag          = true;
                isHeadshot    = false;
            }
            else
            {
                fromTransform = null;
                flag          = false;
                isHeadshot    = false;
            }
        }
        else
        {
            flag          = false;
            fromTransform = remoteBodyPart.transform;
            BodyPart part = bodyPart;
            switch (part)
            {
            case BodyPart.Brain:
            case BodyPart.L_Eye:
            case BodyPart.R_Eye:
                break;

            default:
                switch (part)
                {
                case BodyPart.Head:
                case BodyPart.Jaw:
                    break;

                case BodyPart.Scalp:
                case BodyPart.Nostrils:
                    goto Label_01AC;

                default:
                    goto Label_01AC;
                }
                break;
            }
            isHeadshot = true;
        }
        goto Label_01E7;
Label_01AC:
        isHeadshot = false;
Label_01E7:
        if (fromTransform != null)
        {
            offset = endPos;
            endPos = fromTransform.TransformPoint(endPos);
        }
    }
Beispiel #8
0
 private void OnLocallyAppended(IDMain main)
 {
     if (!this._motor)
     {
         this._motor = main.GetRemote<CCMotor>();
     }
 }