Esempio n. 1
0
        public void tellStructureHealth(CSteamID steamID, byte x, byte y, ushort index, byte hp)
        {
            StructureRegion structureRegion;

            if (base.channel.checkServer(steamID) && StructureManager.tryGetRegion(x, y, out structureRegion))
            {
                if (!Provider.isServer && !structureRegion.isNetworked)
                {
                    return;
                }
                if ((int)index >= structureRegion.drops.Count)
                {
                    return;
                }
                Interactable2HP component = structureRegion.drops[(int)index].model.GetComponent <Interactable2HP>();
                if (component != null)
                {
                    component.hp = hp;
                }
            }
        }
        // Token: 0x0600347F RID: 13439 RVA: 0x001592FC File Offset: 0x001576FC
        public static Transform getStructure(ushort id, byte hp, ulong owner, ulong group, ItemStructureAsset asset)
        {
            if (asset != null)
            {
                Transform transform;
                if (Dedicator.isDedicated)
                {
                    transform = UnityEngine.Object.Instantiate <GameObject>(asset.clip).transform;
                }
                else
                {
                    transform = UnityEngine.Object.Instantiate <GameObject>(asset.structure).transform;
                }
                transform.name = id.ToString();
                if (Provider.isServer)
                {
                    Transform transform2 = UnityEngine.Object.Instantiate <GameObject>(asset.nav).transform;
                    transform2.name          = "Nav";
                    transform2.parent        = transform;
                    transform2.localPosition = Vector3.zero;
                    transform2.localRotation = Quaternion.identity;
                }
                if (!asset.isUnpickupable)
                {
                    Interactable2HP interactable2HP = transform.gameObject.AddComponent <Interactable2HP>();
                    interactable2HP.hp = hp;
                    Interactable2SalvageStructure interactable2SalvageStructure = transform.gameObject.AddComponent <Interactable2SalvageStructure>();
                    interactable2SalvageStructure.hp    = interactable2HP;
                    interactable2SalvageStructure.owner = owner;
                    interactable2SalvageStructure.group = group;
                }
                return(transform);
            }
            Transform transform3 = new GameObject().transform;

            transform3.name             = id.ToString();
            transform3.tag              = "Structure";
            transform3.gameObject.layer = LayerMasks.STRUCTURE;
            return(transform3);
        }
Esempio n. 3
0
        public static Transform getBarricade(Transform parent, byte hp, ulong owner, ulong group, Vector3 pos, Quaternion rot, ushort id, byte[] state, ItemBarricadeAsset asset)
        {
            if (asset != null)
            {
                Transform transform;
                if (Dedicator.isDedicated)
                {
                    transform = Object.Instantiate <GameObject>(asset.clip).transform;
                }
                else
                {
                    transform = Object.Instantiate <GameObject>(asset.barricade).transform;
                }
                transform.name          = id.ToString();
                transform.parent        = parent;
                transform.localPosition = pos;
                transform.localRotation = rot;
                if (Provider.isServer && asset.nav != null)
                {
                    Transform transform2 = Object.Instantiate <GameObject>(asset.nav).transform;
                    transform2.name = "Nav";
                    if (asset.build == EBuild.DOOR || asset.build == EBuild.GATE || asset.build == EBuild.SHUTTER || asset.build == EBuild.HATCH)
                    {
                        Transform transform3 = transform.FindChild("Skeleton").FindChild("Hinge");
                        if (transform3 != null)
                        {
                            transform2.parent = transform3;
                        }
                        else
                        {
                            transform2.parent = transform;
                        }
                    }
                    else
                    {
                        transform2.parent = transform;
                    }
                    transform2.localPosition = Vector3.zero;
                    transform2.localRotation = Quaternion.identity;
                }
                Transform transform4 = transform.FindChildRecursive("Burning");
                if (transform4 != null)
                {
                    transform4.gameObject.AddComponent <TemperatureTrigger>().temperature = EPlayerTemperature.BURNING;
                }
                Transform transform5 = transform.FindChildRecursive("Warm");
                if (transform5 != null)
                {
                    transform5.gameObject.AddComponent <TemperatureTrigger>().temperature = EPlayerTemperature.WARM;
                }
                if (asset.build == EBuild.DOOR || asset.build == EBuild.GATE || asset.build == EBuild.SHUTTER || asset.build == EBuild.HATCH)
                {
                    InteractableDoor interactableDoor = transform.gameObject.AddComponent <InteractableDoor>();
                    interactableDoor.updateState(asset, state);
                    Transform transform6 = transform.FindChild("Skeleton").FindChild("Hinge");
                    if (transform6 != null)
                    {
                        transform6.gameObject.AddComponent <InteractableDoorHinge>().door = interactableDoor;
                    }
                    Transform transform7 = transform.FindChild("Skeleton").FindChild("Left_Hinge");
                    if (transform7 != null)
                    {
                        transform7.gameObject.AddComponent <InteractableDoorHinge>().door = interactableDoor;
                    }
                    Transform transform8 = transform.FindChild("Skeleton").FindChild("Right_Hinge");
                    if (transform8 != null)
                    {
                        transform8.gameObject.AddComponent <InteractableDoorHinge>().door = interactableDoor;
                    }
                }
                else if (asset.build == EBuild.BED)
                {
                    transform.gameObject.AddComponent <InteractableBed>().updateState(asset, state);
                }
                else if (asset.build == EBuild.STORAGE || asset.build == EBuild.STORAGE_WALL)
                {
                    transform.gameObject.AddComponent <InteractableStorage>().updateState(asset, state);
                }
                else if (asset.build == EBuild.FARM)
                {
                    transform.gameObject.AddComponent <InteractableFarm>().updateState(asset, state);
                }
                else if (asset.build == EBuild.TORCH || asset.build == EBuild.CAMPFIRE)
                {
                    transform.gameObject.AddComponent <InteractableFire>().updateState(asset, state);
                }
                else if (asset.build == EBuild.OVEN)
                {
                    transform.gameObject.AddComponent <InteractableOven>().updateState(asset, state);
                }
                else if (asset.build == EBuild.SPIKE || asset.build == EBuild.WIRE)
                {
                    transform.FindChild("Trap").gameObject.AddComponent <InteractableTrap>().updateState(asset, state);
                }
                else if (asset.build == EBuild.CHARGE)
                {
                    InteractableCharge interactableCharge = transform.gameObject.AddComponent <InteractableCharge>();
                    interactableCharge.updateState(asset, state);
                    interactableCharge.owner = owner;
                    interactableCharge.group = group;
                }
                else if (asset.build == EBuild.GENERATOR)
                {
                    transform.gameObject.AddComponent <InteractableGenerator>().updateState(asset, state);
                }
                else if (asset.build == EBuild.SPOT || asset.build == EBuild.CAGE)
                {
                    transform.gameObject.AddComponent <InteractableSpot>().updateState(asset, state);
                }
                else if (asset.build == EBuild.SAFEZONE)
                {
                    transform.gameObject.AddComponent <InteractableSafezone>().updateState(asset, state);
                }
                else if (asset.build == EBuild.OXYGENATOR)
                {
                    transform.gameObject.AddComponent <InteractableOxygenator>().updateState(asset, state);
                }
                else if (asset.build == EBuild.SIGN || asset.build == EBuild.SIGN_WALL || asset.build == EBuild.NOTE)
                {
                    transform.gameObject.AddComponent <InteractableSign>().updateState(asset, state);
                }
                else if (asset.build == EBuild.CLAIM)
                {
                    InteractableClaim interactableClaim = transform.gameObject.AddComponent <InteractableClaim>();
                    interactableClaim.updateState(asset);
                    interactableClaim.owner = owner;
                    interactableClaim.group = group;
                }
                else if (asset.build == EBuild.BEACON)
                {
                    transform.gameObject.AddComponent <InteractableBeacon>().updateState(asset);
                }
                else if (asset.build == EBuild.BARREL_RAIN)
                {
                    transform.gameObject.AddComponent <InteractableRainBarrel>().updateState(asset, state);
                }
                else if (asset.build == EBuild.OIL)
                {
                    transform.gameObject.AddComponent <InteractableOil>().updateState(asset, state);
                }
                else if (asset.build == EBuild.TANK)
                {
                    transform.gameObject.AddComponent <InteractableTank>().updateState(asset, state);
                }
                else if (asset.build == EBuild.SENTRY)
                {
                    InteractableSentry interactableSentry = transform.gameObject.AddComponent <InteractableSentry>();
                    InteractablePower  power = transform.gameObject.AddComponent <InteractablePower>();
                    interactableSentry.power = power;
                    interactableSentry.updateState(asset, state);
                }
                else if (asset.build == EBuild.LIBRARY)
                {
                    transform.gameObject.AddComponent <InteractableLibrary>().updateState(asset, state);
                }
                else if (asset.build == EBuild.MANNEQUIN)
                {
                    transform.gameObject.AddComponent <InteractableMannequin>().updateState(asset, state);
                }
                else if (asset.build == EBuild.STEREO)
                {
                    transform.gameObject.AddComponent <InteractableStereo>().updateState(asset, state);
                }
                if (!asset.isUnpickupable)
                {
                    Interactable2HP interactable2HP = transform.gameObject.AddComponent <Interactable2HP>();
                    interactable2HP.hp = hp;
                    if (asset.build == EBuild.DOOR || asset.build == EBuild.GATE || asset.build == EBuild.SHUTTER || asset.build == EBuild.HATCH)
                    {
                        Transform transform9 = transform.FindChild("Skeleton").FindChild("Hinge");
                        if (transform9 != null)
                        {
                            Interactable2SalvageBarricade interactable2SalvageBarricade = transform9.gameObject.AddComponent <Interactable2SalvageBarricade>();
                            interactable2SalvageBarricade.root  = transform;
                            interactable2SalvageBarricade.hp    = interactable2HP;
                            interactable2SalvageBarricade.owner = owner;
                            interactable2SalvageBarricade.group = group;
                        }
                        Transform transform10 = transform.FindChild("Skeleton").FindChild("Left_Hinge");
                        if (transform10 != null)
                        {
                            Interactable2SalvageBarricade interactable2SalvageBarricade2 = transform10.gameObject.AddComponent <Interactable2SalvageBarricade>();
                            interactable2SalvageBarricade2.root  = transform;
                            interactable2SalvageBarricade2.hp    = interactable2HP;
                            interactable2SalvageBarricade2.owner = owner;
                            interactable2SalvageBarricade2.group = group;
                        }
                        Transform transform11 = transform.FindChild("Skeleton").FindChild("Right_Hinge");
                        if (transform11 != null)
                        {
                            Interactable2SalvageBarricade interactable2SalvageBarricade3 = transform11.gameObject.AddComponent <Interactable2SalvageBarricade>();
                            interactable2SalvageBarricade3.root  = transform;
                            interactable2SalvageBarricade3.hp    = interactable2HP;
                            interactable2SalvageBarricade3.owner = owner;
                            interactable2SalvageBarricade3.group = group;
                        }
                    }
                    else
                    {
                        Interactable2SalvageBarricade interactable2SalvageBarricade4 = transform.gameObject.AddComponent <Interactable2SalvageBarricade>();
                        interactable2SalvageBarricade4.root  = transform;
                        interactable2SalvageBarricade4.hp    = interactable2HP;
                        interactable2SalvageBarricade4.owner = owner;
                        interactable2SalvageBarricade4.group = group;
                    }
                }
                return(transform);
            }
            Transform transform12 = new GameObject().transform;

            transform12.name             = id.ToString();
            transform12.tag              = "Barricade";
            transform12.gameObject.layer = LayerMasks.BARRICADE;
            return(transform12);
        }
Esempio n. 4
0
        // Token: 0x060039D1 RID: 14801 RVA: 0x001B7FEC File Offset: 0x001B63EC
        private void fire()
        {
            float num = (float)base.player.equipment.quality / 100f;

            if (Provider.isServer)
            {
                AlertTool.alert(base.transform.position, ((ItemMeleeAsset)base.player.equipment.asset).alertRadius);
                if (Provider.modeConfigData.Items.Has_Durability && base.player.equipment.quality > 0 && UnityEngine.Random.value < ((ItemWeaponAsset)base.player.equipment.asset).durability)
                {
                    if (base.player.equipment.quality > ((ItemWeaponAsset)base.player.equipment.asset).wear)
                    {
                        PlayerEquipment equipment = base.player.equipment;
                        equipment.quality -= ((ItemWeaponAsset)base.player.equipment.asset).wear;
                    }
                    else
                    {
                        base.player.equipment.quality = 0;
                    }
                    base.player.equipment.sendUpdateQuality();
                }
            }
            if (base.channel.isOwner)
            {
                int num2;
                if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Shot", out num2))
                {
                    Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Shot", num2 + 1);
                }
                Ray         ray         = new Ray(base.player.look.aim.position, base.player.look.aim.forward);
                RaycastInfo raycastInfo = DamageTool.raycast(ray, ((ItemWeaponAsset)base.player.equipment.asset).range, RayMasks.DAMAGE_CLIENT);
                if (raycastInfo.player != null && ((ItemMeleeAsset)base.player.equipment.asset).playerDamageMultiplier.damage > 1f && !base.player.quests.isMemberOfSameGroupAs(raycastInfo.player) && Provider.isPvP)
                {
                    if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                    {
                        Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                    }
                    if (raycastInfo.limb == ELimb.SKULL && Provider.provider.statisticsService.userStatisticsService.getStatistic("Headshots", out num2))
                    {
                        Provider.provider.statisticsService.userStatisticsService.setStatistic("Headshots", num2 + 1);
                    }
                    PlayerUI.hitmark(0, raycastInfo.point, false, (raycastInfo.limb != ELimb.SKULL) ? EPlayerHit.ENTITIY : EPlayerHit.CRITICAL);
                }
                else if ((raycastInfo.zombie != null && ((ItemMeleeAsset)base.player.equipment.asset).zombieDamageMultiplier.damage > 1f) || (raycastInfo.animal != null && ((ItemMeleeAsset)base.player.equipment.asset).animalDamageMultiplier.damage > 1f))
                {
                    if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                    {
                        Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                    }
                    if (raycastInfo.limb == ELimb.SKULL && Provider.provider.statisticsService.userStatisticsService.getStatistic("Headshots", out num2))
                    {
                        Provider.provider.statisticsService.userStatisticsService.setStatistic("Headshots", num2 + 1);
                    }
                    PlayerUI.hitmark(0, raycastInfo.point, false, (raycastInfo.limb != ELimb.SKULL) ? EPlayerHit.ENTITIY : EPlayerHit.CRITICAL);
                }
                else if (raycastInfo.vehicle != null && ((ItemMeleeAsset)base.player.equipment.asset).vehicleDamage > 1f)
                {
                    if (((ItemMeleeAsset)base.player.equipment.asset).isRepair)
                    {
                        if (!raycastInfo.vehicle.isExploded && !raycastInfo.vehicle.isRepaired)
                        {
                            if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                            {
                                Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                            }
                            PlayerUI.hitmark(0, raycastInfo.point, false, EPlayerHit.BUILD);
                        }
                    }
                    else if (!raycastInfo.vehicle.isDead && raycastInfo.vehicle.asset != null && raycastInfo.vehicle.canBeDamaged && (raycastInfo.vehicle.asset.isVulnerable || ((ItemWeaponAsset)base.player.equipment.asset).isInvulnerable))
                    {
                        if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                        {
                            Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                        }
                        PlayerUI.hitmark(0, raycastInfo.point, false, EPlayerHit.BUILD);
                    }
                }
                else if (raycastInfo.transform != null && raycastInfo.transform.CompareTag("Barricade") && ((ItemMeleeAsset)base.player.equipment.asset).barricadeDamage > 1f)
                {
                    InteractableDoorHinge component = raycastInfo.transform.GetComponent <InteractableDoorHinge>();
                    if (component != null)
                    {
                        raycastInfo.transform = component.transform.parent.parent;
                    }
                    ushort id;
                    if (ushort.TryParse(raycastInfo.transform.name, out id))
                    {
                        ItemBarricadeAsset itemBarricadeAsset = (ItemBarricadeAsset)Assets.find(EAssetType.ITEM, id);
                        if (itemBarricadeAsset != null)
                        {
                            if (((ItemMeleeAsset)base.player.equipment.asset).isRepair)
                            {
                                Interactable2HP component2 = raycastInfo.transform.GetComponent <Interactable2HP>();
                                if (component2 != null && itemBarricadeAsset.isRepairable && component2.hp < 100)
                                {
                                    if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                                    {
                                        Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                                    }
                                    PlayerUI.hitmark(0, raycastInfo.point, false, EPlayerHit.BUILD);
                                }
                            }
                            else if (itemBarricadeAsset.isVulnerable || ((ItemWeaponAsset)base.player.equipment.asset).isInvulnerable)
                            {
                                if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                                {
                                    Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                                }
                                PlayerUI.hitmark(0, raycastInfo.point, false, EPlayerHit.BUILD);
                            }
                        }
                    }
                }
                else if (raycastInfo.transform != null && raycastInfo.transform.CompareTag("Structure") && ((ItemMeleeAsset)base.player.equipment.asset).structureDamage > 1f)
                {
                    ushort id2;
                    if (ushort.TryParse(raycastInfo.transform.name, out id2))
                    {
                        ItemStructureAsset itemStructureAsset = (ItemStructureAsset)Assets.find(EAssetType.ITEM, id2);
                        if (itemStructureAsset != null)
                        {
                            if (((ItemMeleeAsset)base.player.equipment.asset).isRepair)
                            {
                                Interactable2HP component3 = raycastInfo.transform.GetComponent <Interactable2HP>();
                                if (component3 != null && itemStructureAsset.isRepairable && component3.hp < 100)
                                {
                                    if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                                    {
                                        Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                                    }
                                    PlayerUI.hitmark(0, raycastInfo.point, false, EPlayerHit.BUILD);
                                }
                            }
                            else if (itemStructureAsset.isVulnerable || ((ItemWeaponAsset)base.player.equipment.asset).isInvulnerable)
                            {
                                if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                                {
                                    Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                                }
                                PlayerUI.hitmark(0, raycastInfo.point, false, EPlayerHit.BUILD);
                            }
                        }
                    }
                }
                else if (raycastInfo.transform != null && raycastInfo.transform.CompareTag("Resource") && ((ItemMeleeAsset)base.player.equipment.asset).resourceDamage > 1f)
                {
                    byte   x;
                    byte   y;
                    ushort index;
                    if (ResourceManager.tryGetRegion(raycastInfo.transform, out x, out y, out index))
                    {
                        ResourceSpawnpoint resourceSpawnpoint = ResourceManager.getResourceSpawnpoint(x, y, index);
                        if (resourceSpawnpoint != null && !resourceSpawnpoint.isDead && resourceSpawnpoint.asset.bladeID == ((ItemWeaponAsset)base.player.equipment.asset).bladeID)
                        {
                            if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                            {
                                Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                            }
                            PlayerUI.hitmark(0, raycastInfo.point, false, EPlayerHit.BUILD);
                        }
                    }
                }
                else if (raycastInfo.transform != null && ((ItemMeleeAsset)base.player.equipment.asset).objectDamage > 1f)
                {
                    InteractableObjectRubble component4 = raycastInfo.transform.GetComponent <InteractableObjectRubble>();
                    if (component4 != null)
                    {
                        raycastInfo.section = component4.getSection(raycastInfo.collider.transform);
                        if (!component4.isSectionDead(raycastInfo.section) && (component4.asset.rubbleIsVulnerable || ((ItemWeaponAsset)base.player.equipment.asset).isInvulnerable))
                        {
                            if (Provider.provider.statisticsService.userStatisticsService.getStatistic("Accuracy_Hit", out num2))
                            {
                                Provider.provider.statisticsService.userStatisticsService.setStatistic("Accuracy_Hit", num2 + 1);
                            }
                            PlayerUI.hitmark(0, raycastInfo.point, false, EPlayerHit.BUILD);
                        }
                    }
                }
                base.player.input.sendRaycast(raycastInfo);
            }
            if (Provider.isServer)
            {
                if (!base.player.input.hasInputs())
                {
                    return;
                }
                InputInfo input = base.player.input.getInput(true);
                if (input == null)
                {
                    return;
                }
                if ((input.point - base.player.look.aim.position).sqrMagnitude > Mathf.Pow(((ItemMeleeAsset)base.player.equipment.asset).range + 4f, 2f))
                {
                    return;
                }
                if (!((ItemMeleeAsset)base.player.equipment.asset).isRepair)
                {
                    DamageTool.impact(input.point, input.normal, input.material, input.type != ERaycastInfoType.NONE && input.type != ERaycastInfoType.OBJECT);
                }
                EPlayerKill eplayerKill = EPlayerKill.NONE;
                uint        num3        = 0u;
                float       num4        = 1f;
                num4 *= 1f + base.channel.owner.player.skills.mastery(0, 0) * 0.5f;
                num4 *= ((this.swingMode != ESwingMode.STRONG) ? 1f : ((ItemMeleeAsset)base.player.equipment.asset).strength);
                num4 *= ((num >= 0.5f) ? 1f : (0.5f + num));
                if (input.type == ERaycastInfoType.PLAYER)
                {
                    if (input.player != null && !base.player.quests.isMemberOfSameGroupAs(input.player) && Provider.isPvP)
                    {
                        DamageTool.damage(input.player, EDeathCause.MELEE, input.limb, base.channel.owner.playerID.steamID, input.direction, ((ItemMeleeAsset)base.player.equipment.asset).playerDamageMultiplier, num4, true, out eplayerKill);
                    }
                }
                else if (input.type == ERaycastInfoType.ZOMBIE)
                {
                    if (input.zombie != null)
                    {
                        DamageTool.damage(input.zombie, input.limb, input.direction, ((ItemMeleeAsset)base.player.equipment.asset).zombieDamageMultiplier, num4, true, out eplayerKill, out num3);
                        if (base.player.movement.nav != 255)
                        {
                            input.zombie.alert(base.transform.position, true);
                        }
                    }
                }
                else if (input.type == ERaycastInfoType.ANIMAL)
                {
                    if (input.animal != null)
                    {
                        DamageTool.damage(input.animal, input.limb, input.direction, ((ItemMeleeAsset)base.player.equipment.asset).animalDamageMultiplier, num4, out eplayerKill, out num3);
                        input.animal.alertPoint(base.transform.position, true);
                    }
                }
                else if (input.type == ERaycastInfoType.VEHICLE)
                {
                    if (input.vehicle != null && input.vehicle.asset != null && input.vehicle.canBeDamaged && (input.vehicle.asset.isVulnerable || ((ItemWeaponAsset)base.player.equipment.asset).isInvulnerable || ((ItemMeleeAsset)base.player.equipment.asset).isRepair))
                    {
                        if (((ItemMeleeAsset)base.player.equipment.asset).isRepair)
                        {
                            num4 *= 1f + base.channel.owner.player.skills.mastery(2, 6);
                        }
                        DamageTool.damage(input.vehicle, true, input.point, ((ItemMeleeAsset)base.player.equipment.asset).isRepair, ((ItemMeleeAsset)base.player.equipment.asset).vehicleDamage, num4, true, out eplayerKill);
                    }
                }
                else if (input.type == ERaycastInfoType.BARRICADE)
                {
                    ushort id3;
                    if (input.transform != null && input.transform.CompareTag("Barricade") && ushort.TryParse(input.transform.name, out id3))
                    {
                        ItemBarricadeAsset itemBarricadeAsset2 = (ItemBarricadeAsset)Assets.find(EAssetType.ITEM, id3);
                        if (itemBarricadeAsset2 != null)
                        {
                            if (((ItemMeleeAsset)base.player.equipment.asset).isRepair)
                            {
                                if (itemBarricadeAsset2.isRepairable)
                                {
                                    num4 *= 1f + base.channel.owner.player.skills.mastery(2, 6);
                                    DamageTool.damage(input.transform, true, ((ItemMeleeAsset)base.player.equipment.asset).barricadeDamage, num4, out eplayerKill);
                                }
                            }
                            else if (itemBarricadeAsset2.isVulnerable || ((ItemWeaponAsset)base.player.equipment.asset).isInvulnerable)
                            {
                                DamageTool.damage(input.transform, false, ((ItemMeleeAsset)base.player.equipment.asset).barricadeDamage, num4, out eplayerKill);
                            }
                        }
                    }
                }
                else if (input.type == ERaycastInfoType.STRUCTURE)
                {
                    ushort id4;
                    if (input.transform != null && input.transform.CompareTag("Structure") && ushort.TryParse(input.transform.name, out id4))
                    {
                        ItemStructureAsset itemStructureAsset2 = (ItemStructureAsset)Assets.find(EAssetType.ITEM, id4);
                        if (itemStructureAsset2 != null)
                        {
                            if (((ItemMeleeAsset)base.player.equipment.asset).isRepair)
                            {
                                if (itemStructureAsset2.isRepairable)
                                {
                                    num4 *= 1f + base.channel.owner.player.skills.mastery(2, 6);
                                    DamageTool.damage(input.transform, true, input.direction, ((ItemMeleeAsset)base.player.equipment.asset).structureDamage, num4, out eplayerKill);
                                }
                            }
                            else if (itemStructureAsset2.isVulnerable || ((ItemWeaponAsset)base.player.equipment.asset).isInvulnerable)
                            {
                                DamageTool.damage(input.transform, false, input.direction, ((ItemMeleeAsset)base.player.equipment.asset).structureDamage, num4, out eplayerKill);
                            }
                        }
                    }
                }
                else if (input.type == ERaycastInfoType.RESOURCE)
                {
                    if (input.transform != null && input.transform.CompareTag("Resource"))
                    {
                        num4 *= 1f + base.channel.owner.player.skills.mastery(2, 2) * 0.5f;
                        byte   x2;
                        byte   y2;
                        ushort index2;
                        if (ResourceManager.tryGetRegion(input.transform, out x2, out y2, out index2))
                        {
                            ResourceSpawnpoint resourceSpawnpoint2 = ResourceManager.getResourceSpawnpoint(x2, y2, index2);
                            if (resourceSpawnpoint2 != null && !resourceSpawnpoint2.isDead && resourceSpawnpoint2.asset.bladeID == ((ItemWeaponAsset)base.player.equipment.asset).bladeID)
                            {
                                DamageTool.damage(input.transform, input.direction, ((ItemMeleeAsset)base.player.equipment.asset).resourceDamage, num4, 1f + base.channel.owner.player.skills.mastery(2, 2) * 0.5f, out eplayerKill, out num3);
                            }
                        }
                    }
                }
                else if (input.type == ERaycastInfoType.OBJECT && input.transform != null && input.section < 255)
                {
                    InteractableObjectRubble component5 = input.transform.GetComponent <InteractableObjectRubble>();
                    if (component5 != null && !component5.isSectionDead(input.section) && (component5.asset.rubbleIsVulnerable || ((ItemWeaponAsset)base.player.equipment.asset).isInvulnerable))
                    {
                        DamageTool.damage(input.transform, input.direction, input.section, ((ItemMeleeAsset)base.player.equipment.asset).objectDamage, num4, out eplayerKill, out num3);
                    }
                }
                if (input.type != ERaycastInfoType.PLAYER && input.type != ERaycastInfoType.ZOMBIE && input.type != ERaycastInfoType.ANIMAL && !base.player.life.isAggressor)
                {
                    float num5 = ((ItemMeleeAsset)base.player.equipment.asset).range + Provider.modeConfigData.Players.Ray_Aggressor_Distance;
                    num5 *= num5;
                    float num6 = Provider.modeConfigData.Players.Ray_Aggressor_Distance;
                    num6 *= num6;
                    Vector3 forward = base.player.look.aim.forward;
                    for (int i = 0; i < Provider.clients.Count; i++)
                    {
                        if (Provider.clients[i] != base.channel.owner)
                        {
                            Player player = Provider.clients[i].player;
                            if (!(player == null))
                            {
                                Vector3 vector = player.look.aim.position - base.player.look.aim.position;
                                Vector3 a      = Vector3.Project(vector, forward);
                                if (a.sqrMagnitude < num5 && (a - vector).sqrMagnitude < num6)
                                {
                                    base.player.life.markAggressive(false, true);
                                }
                            }
                        }
                    }
                }
                if (Level.info.type == ELevelType.HORDE)
                {
                    if (input.zombie != null)
                    {
                        if (input.limb == ELimb.SKULL)
                        {
                            base.player.skills.askPay(10u);
                        }
                        else
                        {
                            base.player.skills.askPay(5u);
                        }
                    }
                    if (eplayerKill == EPlayerKill.ZOMBIE)
                    {
                        if (input.limb == ELimb.SKULL)
                        {
                            base.player.skills.askPay(50u);
                        }
                        else
                        {
                            base.player.skills.askPay(25u);
                        }
                    }
                }
                else
                {
                    if (eplayerKill == EPlayerKill.PLAYER && Level.info.type == ELevelType.ARENA)
                    {
                        base.player.skills.askPay(100u);
                    }
                    base.player.sendStat(eplayerKill);
                    if (num3 > 0u)
                    {
                        base.player.skills.askPay(num3);
                    }
                }
            }
        }