示例#1
0
        private static void Prefix(GameObject zombie)
        {
            int num = 0;

            foreach (GameObject gameObject in global::PlayerManager.players)
            {
                if (Npc.Dictionary.ContainsKey(gameObject) && !Npc.Dictionary[gameObject].AffectRoundSummary)
                {
                    continue;
                }
                if (!(gameObject == zombie))
                {
                    global::ReferenceHub hub = global::ReferenceHub.GetHub(gameObject);
                    if (hub.characterClassManager.CurClass != global::RoleType.Scp079 && hub.characterClassManager.CurRole.team == global::Team.SCP)
                    {
                        num++;
                    }
                }
            }
            if (num <= 0 && global::Generator079.mainGenerator.totalVoltage < 4 && !global::Generator079.mainGenerator.forcedOvercharge)
            {
                global::Generator079.mainGenerator.forcedOvercharge = true;
                global::Recontainer079.BeginContainment(true);
                global::NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase("ALLSECURED . SCP 0 7 9 RECONTAINMENT SEQUENCE COMMENCING . FORCEOVERCHARGE", 0.1f, 0.07f);
            }
        }
示例#2
0
 private static bool Prefix(Scp049_2PlayerScript __instance, GameObject plyObj)
 {
     if (__instance._hub.gameObject.GetComponent <SCP457Controller>() != null)
     {
         Transform  playerCameraReference = __instance._hub.PlayerCameraReference;
         Collider[] array = Physics.OverlapSphere(playerCameraReference.position + playerCameraReference.forward * 1.25f, MainClass.singleton.Config.attack_settings.radius_attack, LayerMask.GetMask(new string[]
         {
             "PlyCenter"
         }));
         HashSet <GameObject> hashSet = new HashSet <GameObject>();
         foreach (Collider collider in array)
         {
             global::ReferenceHub componentInParent3 = collider.GetComponentInParent <global::ReferenceHub>();
             if (!(componentInParent3 == null) && !(componentInParent3 == __instance._hub) && !componentInParent3.characterClassManager.IsAnyScp() && hashSet.Add(componentInParent3.gameObject) && !Physics.Linecast(__instance._hub.transform.position, componentInParent3.transform.position, LayerMask.GetMask(new string[]
             {
                 "Default"
             })))
             {
                 var burningComponent = componentInParent3.gameObject.GetComponent <BurningComponent>();
                 if (burningComponent != null)
                 {
                     if (!Physics.Linecast(__instance._hub.playerMovementSync.RealModelPosition, componentInParent3.gameObject.transform.position, __instance._hub.playerMovementSync.CollidableSurfaces))
                     {
                         var burn = burningComponent.burningtime;
                         burn += MainClass.singleton.Config.attack_settings.burning_time;
                         burningComponent.burningAppliedBy = __instance._hub;
                         if (burn > MainClass.singleton.Config.attack_settings.burning_time_max)
                         {
                             burn = MainClass.singleton.Config.attack_settings.burning_time_max;
                         }
                         burningComponent.burningtime = burn;
                         burningComponent.colatime    = MainClass.singleton.Config.attack_settings.cola_duration;
                         burningComponent.hub.ReferenceHub.playerEffectsController.EnableEffect <CustomPlayerEffects.Scp207>(MainClass.singleton.Config.attack_settings.cola_duration);
                         burningComponent.hub.ReferenceHub.playerEffectsController.GetEffect <CustomPlayerEffects.Scp207>().ServerChangeIntensity(1);
                         burningComponent.hub.ReferenceHub.playerStats.HurtPlayer(new PlayerStats.HitInfo(MainClass.singleton.Config.attack_settings.dmg_amount, "SCP457", DamageTypes.Asphyxiation, 0), burningComponent.hub.GameObject);
                     }
                 }
             }
         }
         return(false);
     }
     return(true);
 }
示例#3
0
        private static bool Prefix(Scp096 __instance)
        {
            if (__instance._flash.Enabled)
            {
                return(false);
            }
            Exiled.API.Features.Player scp096 = Exiled.API.Features.Player.Get(__instance.Hub);
            if (scp096.IsNPC() && !NPCS.Npc.Dictionary[__instance.Hub.gameObject].ProcessSCPLogic)
            {
                return(false);
            }
            Vector3 vector = __instance.Hub.transform.TransformPoint(Scp096._headOffset);

            foreach (System.Collections.Generic.KeyValuePair <GameObject, global::ReferenceHub> keyValuePair in global::ReferenceHub.GetAllHubs())
            {
                global::ReferenceHub          value = keyValuePair.Value;
                global::CharacterClassManager characterClassManager = value.characterClassManager;
                NPCS.Npc npc = NPCS.Npc.Dictionary.ContainsKey(keyValuePair.Key) ? NPCS.Npc.Dictionary[keyValuePair.Key] : null;
                if (characterClassManager.CurClass != global::RoleType.Spectator && !(value == __instance.Hub) && !characterClassManager.IsAnyScp() && Vector3.Dot((value.PlayerCameraReference.position - vector).normalized, __instance.Hub.PlayerCameraReference.forward) >= 0.1f && (npc == null || npc.ShouldTrigger096))
                {
                    VisionInformation visionInformation = VisionInformation.GetVisionInformation(value, vector, -0.1f, 60f, true, true, __instance.Hub.localCurrentRoomEffects);
                    if (visionInformation.IsLooking)
                    {
                        float delay = visionInformation.LookingAmount / 0.25f * (visionInformation.Distance * 0.1f);
                        if (!__instance.Calming)
                        {
                            __instance.AddTarget(value.gameObject);
                        }
                        if (__instance.CanEnrage && value.gameObject != null)
                        {
                            __instance.PreWindup(delay);
                        }
                    }
                }
            }
            return(false);
        }
        public static bool Prefix(MicroHID __instance)
        {
            if (!NetworkServer.active)
            {
                return(false);
            }

            var baseObj = (NetworkBehaviour)__instance;

            __instance.damagePause += Time.deltaTime;
            if (__instance.damagePause < 0.2f)
            {
                return(false);
            }
            __instance.damagePause -= 0.2f;
            global::ReferenceHub referenceHub = __instance.refHub;

            __instance.beamStart.localRotation = Quaternion.Euler(referenceHub.playerMovementSync.Rotations.x, 0f, 0f);
            foreach (GameObject gameObject in global::PlayerManager.players)
            {
                if (gameObject != null && gameObject != baseObj.gameObject && Vector3.Distance(baseObj.transform.position, gameObject.transform.position) <= __instance.beamLength)
                {
                    Vector3    normalized = (__instance.beamStart.position - gameObject.transform.position).normalized;
                    RaycastHit raycastHit;
                    if (Vector3.Dot(__instance.beamStart.forward, normalized) < -0.95f && Physics.Raycast(new Ray(__instance.beamStart.position, -normalized), out raycastHit, __instance.beamLength, __instance.beamMask))
                    {
                        if (raycastHit.collider != __instance.lastVictim)
                        {
                            __instance.lastVictim     = raycastHit.collider;
                            __instance.lastVictimRefs = raycastHit.collider.GetComponentInParent <global::ReferenceHub>();
                        }
                        global::ReferenceHub referenceHub2 = __instance.lastVictimRefs;
                        if (referenceHub2 != null && referenceHub2.gameObject != baseObj.gameObject && referenceHub.weaponManager.GetShootPermission(referenceHub2.characterClassManager, false))
                        {
                            int damage = 0;
                            if (MicroHIDPlugin.instance.Config.mhid_damage_per_hit == -1)
                            {
                                float num = UnityEngine.Random.Range(-__instance.maxDamageVariationPercent, __instance.maxDamageVariationPercent) / 100f * __instance.damagePerSecond;
                                damage = Mathf.RoundToInt((__instance.damagePerSecond + num) * 0.2f);
                            }
                            else
                            {
                                damage = MicroHIDPlugin.instance.Config.mhid_damage_per_hit;
                            }
                            bool isAchievement = referenceHub2.characterClassManager.CurRole.team == global::Team.SCP;
                            if (!referenceHub.playerStats.HurtPlayer(new global::PlayerStats.HitInfo((float)damage, referenceHub.LoggedNameFromRefHub(), global::DamageTypes.MicroHid, referenceHub.queryProcessor.PlayerId), gameObject, false))
                            {
                                isAchievement = false;
                            }
                            __instance.TargetSendHitmarker(isAchievement);
                        }
                    }
                }
            }
            RaycastHit raycastHit2;

            if (Physics.Raycast(new Ray(__instance.beamStart.position, __instance.beamStart.forward), out raycastHit2, __instance.beamLength, __instance.beamMask))
            {
                global::BreakableWindow componentInParent = raycastHit2.collider.GetComponentInParent <global::BreakableWindow>();
                if (componentInParent != null && !componentInParent.isBroken)
                {
                    float num3 = UnityEngine.Random.Range(-__instance.maxDamageVariationPercent, __instance.maxDamageVariationPercent) / 100f * __instance.damagePerSecond;
                    int   num4 = Mathf.RoundToInt((__instance.damagePerSecond + num3) * 0.2f);
                    componentInParent.ServerDamageWindow((float)num4);
                }
            }

            return(false);
        }