Esempio n. 1
0
        public static bool Prefix(Intercom __instance, GameObject spk)
        {
            if (spk != null)
            {
                return(true);
            }

            if (Intercom.host.speaker == null)
            {
                return(true);
            }

            CharacterClassManager ccm = Intercom.host.speaker.GetComponent <CharacterClassManager>();

            if (!ccm.CurClass.Is939())
            {
                return(true);
            }
            Scp939PlayerScript script = Intercom.host.speaker.GetComponent <Scp939PlayerScript>();

            if (!script.NetworkusingHumanChat)
            {
                __instance.Networkspeaker = null;
            }
            return(false);
        }
Esempio n. 2
0
        public static void Postfix(Scp939PlayerScript __instance, GameObject target)
        {
            Player player = Player.Get(target);

            if (player.Role == RoleType.Tutorial && !SerpentsHand.instance.Config.FriendlyFire)
            {
                player.ReferenceHub.playerEffectsController.DisableEffect <CustomPlayerEffects.Amnesia>();
            }
        }
Esempio n. 3
0
        public IEnumerator <float> CheckFor939Intercom()
        {
            while (true)
            {
                yield return(Timing.WaitForSeconds(0.1f));

                if (Intercom.host.speaker != null || Intercom.host.speaking)
                {
                    continue;
                }

                foreach (ReferenceHub rh in GetHubs())
                {
                    try
                    {
                        if (!rh.characterClassManager.CurClass.Is939())
                        {
                            continue;
                        }

                        GameObject         player   = rh.gameObject;
                        Intercom           intercom = player.GetComponent <Intercom>();
                        Scp939PlayerScript script   = player.GetComponent <Scp939PlayerScript>();

                        if (Vector3.Distance(player.transform.position, IntercomArea.position) > intercom.triggerDistance)
                        {
                            continue;
                        }

                        if (!script.NetworkusingHumanChat)
                        {
                            continue;
                        }

                        Intercom.host.RequestTransmission(player);
                    }
                    catch (Exception e)
                    {
                        while (e != null)
                        {
                            plugin.Error(e.ToString());
                            e = e.InnerException;
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        private static bool Prefix(Scp939PlayerScript __instance, GameObject target)
        {
            try
            {
                if (target == null || !__instance.iAm939 || __instance.cooldown > 0f)
                {
                    return(false);
                }
                var scp    = __instance.GetPlayer();
                var player = target.GetPlayer();
                if (Vector3.Distance(player.Position, scp.Position) >= __instance.attackDistance * 1.2f)
                {
                    return(false);
                }

                if (!scp.WeaponManager.GetShootPermission(player.ClassManager))
                {
                    return(false);
                }

                ev.Get.Scp.InvokeScpAttack(scp, player, Api.Enum.ScpAttackType.Scp939_Bite, out var allow);

                if (!allow)
                {
                    return(false);
                }

                __instance.cooldown = 1f;
                player.Hurt(65, DamageTypes.Scp939, scp);
                player.GiveEffect(Api.Enum.Effect.Amnesia, 1, 3f);
                __instance.RpcShoot();
                return(false);
            }
            catch (Exception e)
            {
                Synapse.Api.Logger.Get.Error($"Synapse-Event: ScpAttackEvent(Scp939) failed!!\n{e}\nStackTrace:\n{e.StackTrace}");
                return(true);
            }
        }
        private static void Postfix(Scp939PlayerScript __instance, GameObject target)
        {
            if (!HardcoreSl.Instance.Config.Enable939BiteBleed)
            {
                return;
            }

            if (target == null || __instance.gameObject == null)
            {
                return;
            }

            PlayerHardcoreComponent instanceComponent = __instance.GetComponent <PlayerHardcoreComponent>();
            PlayerHardcoreComponent targetComponent   = target.GetComponent <PlayerHardcoreComponent>();

            if (instanceComponent == null || targetComponent == null)
            {
                return;
            }

            targetComponent.Bleed(HardcoreSl.Instance.Config.Scp939BleedAmount, HardcoreSl.Instance.Config.Scp939BleedDelay);
        }
Esempio n. 6
0
        public void Update()
        {
            if (Input.GetKeyDown(KeyCode.LeftAlt))
            {
                if (!isAltDown)
                {
                    isAltDown = true;
                    isTrace   = true;
                }
            }
            else if (isAltDown && Input.GetKeyUp(KeyCode.LeftAlt))
            {
                isAltDown = false;
                isTrace   = false;
            }

            if (Input.GetKeyDown(KeyCode.Delete))
            {
                if (!isDelDown)
                {
                    isDelDown = true;
                }
            }
            else if (isDelDown && Input.GetKeyUp(KeyCode.Delete))
            {
                isDelDown = false;
                isSpin    = !isSpin;
            }

            if (Input.GetKeyDown(KeyCode.End))
            {
                if (!isEndDown)
                {
                    isEndDown = true;
                }
            }
            else if (isEndDown && Input.GetKeyUp(KeyCode.End))
            {
                isEndDown = false;
                isBlink   = !isBlink;
            }


            if (Input.GetKeyDown(KeyCode.Mouse2))
            {
                if (!isNDown)
                {
                    isNDown  = true;
                    isNoclip = true;
                }
            }
            else if (isNDown && Input.GetKeyUp(KeyCode.Mouse2))
            {
                isNDown  = false;
                isNoclip = false;
            }

            GameObject lp = PlayerManager.localPlayer;

            if (isNoclip && blinkCd < 1)
            {
                if (isBlink)
                {
                    //lp.transform.position += 2.5f * (Camera.main.transform.forward * (Input.GetAxis("Vertical") == 0 ? 1.0f : Input.GetAxis("Vertical")) + Camera.main.transform.right * Input.GetAxis("Horizontal"));
                    //blinkCd = 3000;
                    Vector3 myPos = lp.transform.position;
                    myPos += 10.0f * Camera.main.transform.forward * (Input.GetAxis("Vertical") == 0 ? 1.0f : Input.GetAxis("Vertical")) + Camera.main.transform.right * Input.GetAxis("Horizontal");
                    PlyMovementSync move = lp.GetComponent <PlyMovementSync>();
                    move.CallCmdSyncData(y, myPos, x);
                }
                else
                {
                    lp.transform.position += 0.5f * Camera.main.transform.forward * (Input.GetAxis("Vertical") == 0 ? 1.0f : Input.GetAxis("Vertical")) + Camera.main.transform.right * Input.GetAxis("Horizontal");
                }
            }

            int myhealth = lp.GetComponent <PlayerStats>().health;

            if (blinkCd > 0)
            {
                blinkCd -= 1;
            }

            if (myhealth > 0)
            {
                // little hacks
                CharacterClassManager ccm = lp.GetComponent <CharacterClassManager>();
                if (ccm && !isSpeedhack)
                {
                    for (int j = 0; j < ccm.klasy.Length; j++)
                    {
                        ccm.klasy[j].runSpeed *= 1.3f;
                    }
                    //lp.GetComponent<Scp096PlayerScript>.ragemultiplier_coodownduration = 5.1f;
                    isSpeedhack = true;
                }

                // pocket shoot!
                if (Input.GetKeyDown(KeyCode.H))
                {
                    foreach (GameObject gameObject2 in GameObject.FindGameObjectsWithTag("Player"))
                    {
                        gameObject2.GetComponent <Scp173PlayerScript>().CallRpcSyncAudio();
                    }
                }
                if (Input.GetKeyDown(KeyCode.G))
                {
                    RaycastHit hit;
                    if (Physics.Raycast(new Ray(Camera.main.transform.position, Camera.main.transform.forward), out hit))
                    {
                        CharacterClassManager component = hit.transform.GetComponent <CharacterClassManager>();
                        if (component != null)
                        {
                            /*Scp106PlayerScript oldman = lp.GetComponent<Scp106PlayerScript>();
                             * if (!oldman) lp.AddComponent<Scp106PlayerScript>();
                             * oldman.CallCmdMovePlayer(hit.transform.gameObject, ServerTime.time);
                             * Hitmarker.Hit(1.5f);*/

                            //lp.GetComponent<PlayerStats>().HurtPlayer(new PlayerStats.HitInfo(40f, base.GetComponent<NicknameSync>().myNick + " (" + base.GetComponent<CharacterClassManager>().SteamId + ")", DamageTypes.Scp106, base.GetComponent<QueryProcessor>().PlayerId), ply);
                            //ply.GetComponent<PlyMovementSync>().SetPosition(UnityEngine.Vector3.down * 1997f);
                            //gameObject.GetComponent<PlayerStats>().HurtPlayer(new PlayerStats.HitInfo(1f, "WORLD", "POCKET", base.GetComponent<QueryProcessor>().PlayerId), gameObject);
                            //gameObject.GetComponent<PlayerStats>().HurtPlayer(new PlayerStats.HitInfo(1f, gameObject.GetComponent<NicknameSync>().myNick + " (" + gameObject.GetComponent<CharacterClassManager>().SteamId + ")", DamageTypes.Scp106, gameObject.GetComponent<RemoteAdmin.QueryProcessor>().PlayerId), hit.transform.gameObject);

                            bool was = false;
                            Scp939PlayerScript dog = lp.GetComponent <Scp939PlayerScript>();
                            if (dog && dog.enabled)
                            {
                                was = true;
                            }
                            if (!dog)
                            {
                                dog = lp.AddComponent <Scp939PlayerScript>();
                            }
                            if (!dog.enabled)
                            {
                                dog.enabled = true;
                            }
                            dog.CallCmdShoot(hit.transform.gameObject);
                            if (!was)
                            {
                                dog.enabled = false;
                            }

                            lp.GetComponent <Scp173PlayerScript>().CallRpcSyncAudio();
                            Hitmarker.Hit(1.5f);
                        }
                        else
                        {
                            /*ccm.CallRpcPlaceBlood(lp.transform.position, 1, 2f);
                             *
                             * lp.GetComponent<FallDamage>().CallRpcDoSound(lp.transform.position, 50);
                             * ccm.CallRpcPlaceBlood(lp.transform.position, 0, UnityEngine.Mathf.Clamp(50 / 30f, 0.8f, 2f));*/
                            lp.GetComponent <FootstepSync>().CallCmdSyncFoot(true);
                        }
                    }
                }
                // hack movement

                /*PlyMovementSync move = lp.GetComponent<PlyMovementSync>();
                 * move.isGrounded = true;
                 * float rot = lp.transform.rotation.eulerAngles.y;
                 * Vector3 pos = lp.transform.position;
                 * move.CallCmdSyncData(rot, pos, lp.GetComponent<PlayerInteract>().playerCamera.transform.localRotation.eulerAngles.x);*/

                // hack radio
                // Radio radio = lp.GetComponent<Radio>();

                // activate wallhack
                //Camera wallhackCam = lp.GetComponent<Scp049PlayerScript>().plyCam.GetComponent<UnityEngine.Camera>();
                // Scp939PlayerScript dog = lp.GetComponent<Scp939PlayerScript>();
                CheckpointKiller shit = lp.GetComponent <CheckpointKiller>();
                if (shit.enabled)
                {
                    shit.enabled = false;
                }
                Camera.main.renderingPath = UnityEngine.RenderingPath.VertexLit;       // : UnityEngine.RenderingPath.VertexLit);
                Camera.main.cullingMask   = Scp939PlayerScript.instances[0].scpVision; //this.normalVision : this.scpVision);
                Recoil recoil = lp.GetComponent <Recoil>();
                if (recoil.enabled)
                {
                    recoil.enabled = false;
                }
                //dog.visionCamera.gameObject.SetActive(this.iAm939);
                //dog.visionCamera.fieldOfView = this.plyCam.fieldOfView;
                //dog.visionCamera.farClipPlane = this.plyCam.farClipPlane;
            }
        }
Esempio n. 7
0
        private static void SCPMode()
        {
            var ccm = PlayerManager.localPlayer.GetComponent <CharacterClassManager>();
            Scp173PlayerScript   peanut   = ccm.GetComponent <Scp173PlayerScript>();
            Scp049PlayerScript   doctor   = ccm.GetComponent <Scp049PlayerScript>();
            Scp049_2PlayerScript zombie   = ccm.GetComponent <Scp049_2PlayerScript>();
            Scp939PlayerScript   dogo     = ccm.GetComponent <Scp939PlayerScript>();
            Scp096PlayerScript   shyguy   = ccm.GetComponent <Scp096PlayerScript>();
            Scp106PlayerScript   larry    = ccm.GetComponent <Scp106PlayerScript>();
            Scp079PlayerScript   computer = ccm.GetComponent <Scp079PlayerScript>();


            if (peanut.iAm173)
            {
                foreach (GameObject player in PlayerManager.singleton.players)
                {
                    if (Vector3.Distance(PlayerManager.localPlayer.transform.position, player.transform.position) < 4f + peanut.boost_teleportDistance.Evaluate(PlayerManager.localPlayer.GetComponent <PlayerStats>().GetHealthPercent()))
                    {
                        peanut.GetType().GetMethod("HurtPlayer", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(peanut, new object[]
                        {
                            player,
                            "123"
                        });
                    }
                }
            }
            if (doctor.iAm049)
            {
                foreach (GameObject player in PlayerManager.singleton.players)
                {
                    if ((player != PlayerManager.localPlayer) && (Vector3.Distance(PlayerManager.localPlayer.transform.position, player.transform.position) < 3.5f))
                    {
                        doctor.GetType().GetMethod("InfectPlayer", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(doctor, new object[]
                        {
                            player,
                            "123"
                        });
                    }
                }
            }
            if (zombie.iAm049_2)
            {
                foreach (GameObject player in PlayerManager.singleton.players)
                {
                    if ((player != PlayerManager.localPlayer) && (Vector3.Distance(PlayerManager.localPlayer.transform.position, player.transform.position) < 4f))
                    {
                        zombie.CallCmdHurtPlayer(player, "123");
                    }
                }
            }
            if (dogo.iAm939)
            {
                foreach (GameObject player in PlayerManager.singleton.players)
                {
                    // ccm.klasy[player.GetComponent<CharacterClassManager>().curClass].team != Team.SCP
                    if ((player != PlayerManager.localPlayer) && (Vector3.Distance(Camera.main.transform.position, player.transform.position) < 1.3 * dogo.attackDistance))
                    {
                        dogo.CallCmdShoot(player);
                    }
                }
            }
            if (shyguy.iAm096)
            {
                foreach (GameObject player in PlayerManager.singleton.players)
                {
                    if ((Vector3.Distance(Camera.main.transform.position, player.transform.position) < 3.5f))
                    {
                        shyguy.GetType().GetMethod("CallCmdHurtPlayer", BindingFlags.Instance | BindingFlags.Public).Invoke(shyguy, new object[]
                        {
                            player
                        });
                    }
                }
            }
            if (larry.iAm106)
            {
                foreach (GameObject player in PlayerManager.singleton.players)
                {
                    if (Vector3.Distance(Camera.main.transform.position, player.transform.position) < 3.5f)
                    {
                        larry.CallCmdMovePlayer(player, ServerTime.time);
                    }
                }
            }
            if (computer.iAm079)
            {
            }
        }