public static RaycastInfo OriginalRaycast(Ray ray, float range, int mask)
        {
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            if (raycastInfo.transform != null)
            {
                if (raycastInfo.transform.CompareTag("Barricade"))
                {
                    raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
                }

                else if (raycastInfo.transform.CompareTag("Structure"))
                {
                    raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
                }

                if (raycastInfo.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }

                if (raycastInfo.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }

                if (raycastInfo.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }

                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);

                if (raycastInfo.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }

                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
                }
            }
            return(raycastInfo);
        }
Beispiel #2
0
        public static RaycastInfo raycast(Ray ray, float range, int mask)
        {
            RaycastHit hit;
            int        msk = RayMasks.ENEMY | RayMasks.ENTITY | RayMasks.VEHICLE;

            if (ComponentManager.hack_Weapons.meleeThroughWalls)
            {
                Physics.Raycast(ray, out hit, range, msk);
            }
            else
            {
                Physics.Raycast(ray, out hit, range, mask);
            }
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            if (hit.transform != null)
            {
                if (hit.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                if (hit.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, hit.transform, hit.collider);
                }
            }
            return(raycastInfo);
        }
Beispiel #3
0
        public static RaycastInfo GenerateOriginalRaycast(Ray ray, float range, int mask)
        {
            PhysicsUtility.raycast(ray, out RaycastHit hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit)
            {
                direction = ray.direction
            };

            if (hit.transform == null)
            {
                return(raycastInfo);
            }

            if (raycastInfo.transform.CompareTag("Barricade"))
            {
                raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
            }

            else if (raycastInfo.transform.CompareTag("Structure"))
            {
                raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
            }

            if (raycastInfo.transform.CompareTag("Enemy"))
            {
                raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
            }

            if (raycastInfo.transform.CompareTag("Zombie"))
            {
                raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
            }

            if (raycastInfo.transform.CompareTag("Animal"))
            {
                raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
            }

            raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);

            if (RaycastOptions.UseCustomLimb)
            {
                raycastInfo.limb = RaycastOptions.TargetLimb;
            }

            else if (RaycastOptions.UseRandomLimb)
            {
                ELimb[] Limbs = (ELimb[])Enum.GetValues(typeof(ELimb));
                raycastInfo.limb = Limbs[MathUtilities.Random.Next(0, Limbs.Length)];
            }

            if (raycastInfo.transform.CompareTag("Vehicle"))
            {
                raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
            }

            if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
            {
                raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
            }
            else
            {
                raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
            }

            return(raycastInfo);
        }
        // Token: 0x06000094 RID: 148 RVA: 0x000068DC File Offset: 0x00004ADC
        public static RaycastInfo GenerateOriginalRaycast(Ray ray, float range, int mask)
        {
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            bool        flag = !(raycastInfo.transform == null);
            RaycastInfo result;

            if (flag)
            {
                bool flag2 = raycastInfo.transform.CompareTag("Barricade");
                if (flag2)
                {
                    raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
                }
                else
                {
                    bool flag3 = raycastInfo.transform.CompareTag("Structure");
                    if (flag3)
                    {
                        raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
                    }
                }
                bool flag4 = raycastInfo.transform.CompareTag("Enemy");
                if (flag4)
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
                bool flag5 = raycastInfo.transform.CompareTag("Zombie");
                if (flag5)
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                bool flag6 = raycastInfo.transform.CompareTag("Animal");
                if (flag6)
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                bool flag7 = !RaycastOptions.UseRandomLimb;
                if (flag7)
                {
                    bool useCustomLimb = RaycastOptions.UseCustomLimb;
                    if (useCustomLimb)
                    {
                        raycastInfo.limb = RaycastOptions.TargetLimb;
                    }
                }
                else
                {
                    ELimb[] array = (ELimb[])Enum.GetValues(typeof(ELimb));
                    raycastInfo.limb = array[MathUtilities.Random.Next(0, array.Length)];
                }
                bool flag8 = raycastInfo.transform.CompareTag("Vehicle");
                if (flag8)
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                else
                {
                    bool flag9 = raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive;
                    if (flag9)
                    {
                        raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                    }
                    else
                    {
                        raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
                    }
                }
                bool alwaysHitHead = RaycastOptions.AlwaysHitHead;
                if (alwaysHitHead)
                {
                    raycastInfo.limb = ELimb.SKULL;
                }
                result = raycastInfo;
            }
            else
            {
                result = raycastInfo;
            }
            return(result);
        }
        public static RaycastInfo OV_raycast(Ray ray, float range, int mask)
        {
            ItemWeaponAsset weapon = (ItemWeaponAsset)Player.player.equipment.asset;

            /*if (MenuGUI.instance.LongRangeMelee && weapon == null)
             * {
             *  range = MenuGUI.instance.MeleeRange;
             * }*/
            range = Mathf.Infinity;
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, 0);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            if (MenuGUI.instance.silentAim)
            {
                if (hit.transform == null && Functions.GetDistance(Functions.GetNearestPlayer().transform.position) >= Functions.GetGunDistance())
                {
                    return(raycastInfo);
                }
            }

            if (hit.transform.CompareTag("Zombie"))
            {
                raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
            }
            if (hit.transform.CompareTag("Animal"))
            {
                raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
            }
            raycastInfo.direction = new Vector3(0, MenuGUI.instance.launchAmount, 0);

            if (MenuGUI.instance.silentAim && !hit.transform.CompareTag("Zombie"))
            {
                if (Functions.GetDistFrom(Functions.GetNearestPlayer().transform.position, Player.player.look.aim.position) <= 15.5)
                {
                    raycastInfo.point = Player.player.transform.position;
                }
                else
                {
                    raycastInfo.point = Functions.GetLimbPosition(Functions.GetNearestPlayer().transform, "Skull");
                }
                if (MenuGUI.instance.randomLimb)
                {
                    ELimb[] array = (ELimb[])Enum.GetValues(typeof(ELimb));
                    raycastInfo.limb = array[Random.Next(0, array.Length)];
                }
                else
                {
                    raycastInfo.limb = ELimb.SKULL;
                }
                raycastInfo.player = Functions.GetNearestPlayer();
            }
            else
            {
                raycastInfo.limb = DamageTool.getLimb(hit.transform);
                if (hit.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
            }

            if (hit.transform.CompareTag("Vehicle"))
            {
                raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
            }
            if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
            {
                raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
            }
            else
            {
                raycastInfo.material = EPhysicsMaterial.NONE;
            }
            return(raycastInfo);
        }
Beispiel #6
0
        public static RaycastInfo raycast(Ray ray, float range, int mask)
        {
            int num;

            if (MP_Weapons.attackThroughWalls)
            {
                num = RayMasks.VEHICLE | RayMasks.ENEMY | RayMasks.ENTITY;
            }
            else
            {
                num = mask;
            }

            RaycastHit hit;

            Physics.Raycast(ray, out hit, range, num);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            if (hit.transform != null)
            {
                if (hit.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                if (hit.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, hit.transform, hit.collider);
                }

                if (MP_Weapons.alwaysHitHead) // idk if it should interfere with silentaim so i just put it above silent aim :\
                {
                    raycastInfo.limb = ELimb.SKULL;
                }

                #region SilentAim
                if (MP_Aimbot.silentAim)
                {
                    Player p = ((SteamPlayer)MP_Aimbot.attackNext).player;

                    if (p == null || raycastInfo.zombie != null)
                    {
                        return(raycastInfo);
                    }

                    raycastInfo.player = p;
                    raycastInfo.limb   = MP_Aimbot.aimLocation;
                }
                #endregion
            }
            return(raycastInfo);
        }
Beispiel #7
0
        // Token: 0x06000237 RID: 567 RVA: 0x000152E4 File Offset: 0x000134E4
        public static RaycastInfo GenerateOriginalRaycast(Ray ray, float range, int mask, Player ignorePlayer = null)
        {
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit)
            {
                direction = ray.direction
            };

            if (!(raycastInfo.transform == null))
            {
                if (!raycastInfo.transform.CompareTag("Barricade"))
                {
                    if (raycastInfo.transform.CompareTag("Structure"))
                    {
                        raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
                    }
                }
                else
                {
                    raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
                }
                if (raycastInfo.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                    if (raycastInfo.player == ignorePlayer)
                    {
                        raycastInfo.player = null;
                    }
                }
                if (raycastInfo.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                if (raycastInfo.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                if (!RaycastOptions.UseRandomLimb)
                {
                    if (RaycastOptions.UseCustomLimb)
                    {
                        raycastInfo.limb = RaycastOptions.TargetLimb;
                    }
                }
                else
                {
                    raycastInfo.limb = MathUtilities.RandomEnumValue <ELimb>();
                }
                if (raycastInfo.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
                }
                return(raycastInfo);
            }
            return(raycastInfo);
        }