Exemple #1
0
        public static RaycastInfo GenerateRaycast(GameObject Object, Vector3 Point, Collider col)
        {
            ELimb Limb = RaycastOptions.TargetLimb;

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

            EPhysicsMaterial mat = col == null ? EPhysicsMaterial.NONE : DamageTool.getMaterial(Point, Object.transform, col);

            if (RaycastOptions.UseTargetMaterial)
            {
                mat = RaycastOptions.TargetMaterial;
            }

            return(new RaycastInfo(Object.transform)
            {
                point = Point,
                direction = RaycastOptions.UseModifiedVector ? RaycastOptions.TargetRagdoll.ToVector() : OptimizationVariables.MainPlayer.look.aim.forward,
                limb = Limb,
                material = mat,
                player = Object.GetComponent <Player>(),
                zombie = Object.GetComponent <Zombie>(),
                vehicle = Object.GetComponent <InteractableVehicle>()
            });
        }
        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);
        }
Exemple #3
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);
        }
    public static RaycastInfo GenerateRaycast(GameObject Object, Vector3 Point, Collider col)
    {
        ELimb limb = RaycastOptions.TargetLimb;

        if (RaycastOptions.UseRandomLimb)
        {
            ELimb[] array = (ELimb[])Enum.GetValues(typeof(ELimb));
            limb = array[MathUtilities.Random.Next(0, array.Length)];
        }
        EPhysicsMaterial material = (col == null) ? EPhysicsMaterial.NONE : DamageTool.getMaterial(Point, Object.transform, col);

        return(new RaycastInfo(Object.transform)
        {
            point = Point,
            direction = OptimizationVariables.MainPlayer.look.aim.forward,
            limb = limb,
            material = material,
            player = Object.GetComponent <Player>(),
            zombie = Object.GetComponent <Zombie>(),
            vehicle = Object.GetComponent <InteractableVehicle>()
        });
    }
Exemple #5
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);
        }
Exemple #7
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);
        }
Exemple #8
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);
        }
Exemple #9
0
        // Token: 0x06000239 RID: 569 RVA: 0x00015518 File Offset: 0x00013718
        public static RaycastInfo GenerateRaycast(GameObject Object, Vector3 Point)
        {
            ELimb limb = RaycastOptions.TargetLimb;

            if (RaycastOptions.UseRandomLimb)
            {
                limb = MathUtilities.RandomEnumValue <ELimb>();
            }
            Collider         component = Object.GetComponent <Collider>();
            EPhysicsMaterial material  = (component == null) ? EPhysicsMaterial.NONE : DamageTool.getMaterial(Point, Object.transform, component);

            return(new RaycastInfo(Object.transform)
            {
                point = Point,
                direction = Player.player.look.aim.forward,
                limb = limb,
                material = material,
                player = Object.GetComponent <Player>(),
                zombie = Object.GetComponentInParent <Zombie>(),
                vehicle = Object.GetComponent <InteractableVehicle>(),
                animal = Object.GetComponentInParent <Animal>()
            });
        }