コード例 #1
0
        public override void OnUpdate()
        {
            MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation));

            MultiplayerPlayerScript[] multiplayerPlayerScript = (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript));
            Color colour = Main.cycleColour;

            if (multiplayerPlayerScript.Length > 0)
            {
                foreach (var clients in multiplayerPlayerScript)
                {
                    if (rainbowEveryone.Value)
                    {
                        clients.modelmat.SetColor("_PrimaryMaskColor", colour);
                        clients.modelmat.SetColor("_SecondaryMaskColor", colour);
                        clients.modelmat.SetColor("_DetailMaskColor", colour);
                    }
                    else
                    {
                        if (clients.name == multiplayerPlayerInformation.myplayer.name)
                        {
                            clients.modelmat.SetColor("_PrimaryMaskColor", colour);
                            clients.modelmat.SetColor("_SecondaryMaskColor", colour);
                            clients.modelmat.SetColor("_DetailMaskColor", colour);
                        }
                    }
                }
            }
        }
コード例 #2
0
ファイル: GodMode.cs プロジェクト: TheReal3rd/CometVTwo
        public override void OnUpdate()
        {
            playerHealthManagement = (PlayerHealthManagement)GameObject.Find("Player").GetComponent(typeof(PlayerHealthManagement));
            MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation));

            MultiplayerPlayerScript[] multiplayerPlayerScripts = (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript));
            switch (modes.Selected)
            {
            case "BUILTIN":    //Shitty built in godmode when health reaches 0 and below you go invisible.
                if (!playerHealthManagement.Equals(null))
                {
                    playerHealthManagement.godmode = true;
                }
                break;

            case "PICKUP":    //Now works when none host. Just annoying with its sound and stuff.
                if (!playerHealthManagement.Equals(null) && playerHealthManagement.myhealth < 200f)
                {
                    PlayerPickupScript script = (PlayerPickupScript)GameObject.Find("Player").GetComponent(typeof(PlayerPickupScript));
                    if (!script.Equals(null))
                    {
                        fakeHealth = new GameObject();
                        fakeHealth.AddComponent <DummyClass>();
                        fakeHealth.tag = "HolyHealthTag";
                        fakeHealth.transform.position = multiplayerPlayerInformation.myplayer.transform.position;
                        script.pickupholyhealth(fakeHealth);
                    }
                }
                break;

            case "CLIENT":    //Works only when host.
                if (multiplayerPlayerScripts.Length > 0)
                {
                    foreach (var clients in multiplayerPlayerScripts)
                    {
                        if (clients.name == multiplayerPlayerInformation.myplayer.name)
                        {
                            clients.myhealth = health.GetValueFloat();
                            clients.myarmor  = armour.GetValueFloat();
                        }
                    }
                }
                break;

            case "CLIENTPICKUP":    //Works none host and no annoying sounds plus other players can't hear it.
                if (multiplayerPlayerScripts.Length > 0 && !playerHealthManagement.Equals(null) && playerHealthManagement.myhealth < 200f)
                {
                    foreach (var clients in multiplayerPlayerScripts)
                    {
                        if (clients.name == multiplayerPlayerInformation.myplayer.name)
                        {
                            clients.CallCmdSetHealth(health.GetValueFloat(), armour.GetValueFloat());
                        }
                    }
                }
                break;
            }
        }
コード例 #3
0
        public override void OnUpdate()
        {
            targetPos.Clear();
            playerPos = ((MyControllerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MyControllerScript)))[0].transform.position;
            MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation));

            foreach (var client in (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript)))
            {
                if (multiplayerPlayerInformation.myplayer.name != client.myplayer.name)
                {
                    targetPos.Add(client.transform.position);
                }
            }
        }
コード例 #4
0
ファイル: Username.cs プロジェクト: TheReal3rd/CometVTwo
        public override void OnUpdate()
        {
            MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation));

            MultiplayerPlayerScript[] multiplayerPlayerScripts = (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript));
            if (multiplayerPlayerScripts.Length > 0)
            {
                foreach (var clients in multiplayerPlayerScripts)
                {
                    if (!everyone.Value && multiplayerPlayerInformation.myplayer.name != clients.name)
                    {
                        continue;
                    }
                    switch (mode.Selected)
                    {
                    case "SNAKE":
                        if (frameCounter >= snake.Length)
                        {
                            frameCounter = 0;
                        }
                        FrameIncrease(snake, clients);
                        break;

                    case "BUBBLES":
                        if (frameCounter >= bubbles.Length)
                        {
                            frameCounter = 0;
                        }
                        FrameIncrease(bubbles, clients);
                        break;

                    case "RAINBOW":
                        //TODO make rainbow names.
                        break;

                    case "SET":
                        clients.Networkplayername = setName.Value;
                        clients.Networkplainname  = setName.Value;
                        break;
                    }
                }
            }
        }
コード例 #5
0
 public override void OnEnable()
 {
     multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation));
     MultiplayerPlayerScripts     = (MultiplayerPlayerScript[])UnityEngine.Object.FindObjectsOfType(typeof(MultiplayerPlayerScript));
     foreach (var clients in MultiplayerPlayerScripts)
     {
         if (clients.name == multiplayerPlayerInformation.myplayer.name)
         {
             if (noneHost.Value)
             {
                 clients.CmdIncreaseKills(116123);
             }
             clients.CmdWinRound(multiplayerPlayerInformation.myplayer.name);
             clients.CmdSendChatMessage("ez!");
             clients.CmdSendChatMessage("So ez!!!1!");
         }
     }
     Main.ModuleManager.Toggle(this);
 }
コード例 #6
0
ファイル: SpoofSteam.cs プロジェクト: TheReal3rd/CometVTwo
        public override void OnUpdate()
        {
            MultiplayerPlayerInformation multiplayerPlayerInformation = (MultiplayerPlayerInformation)GameObject.Find("Player").GetComponent(typeof(MultiplayerPlayerInformation));

            NetworkPlayer[] networkPlayers = (NetworkPlayer[])UnityEngine.Object.FindObjectsOfType(typeof(NetworkPlayer));
            if (networkPlayers.Length > 0 && !multiplayerPlayerInformation.Equals(null))
            {
                foreach (NetworkPlayer player in networkPlayers)
                {
                    if (!player.Equals(null) && !string.IsNullOrEmpty(player.igName))
                    {
                        if (player.igName == multiplayerPlayerInformation.myplayer.name)
                        {
                            player.NetworksteamId = UInt64.MaxValue;
                            player.steamName      = "player";
                        }
                    }
                }
            }
        }