コード例 #1
0
        public IEnumerator ServerRespawnAsAntag(ConnectedPlayer connectedPlayer, Antagonist antagonist)
        {
            var antagOccupation = antagonist.AntagOccupation;

            if (antagOccupation != null)
            {
                connectedPlayer.Script.mind.occupation = antagonist.AntagOccupation;
            }

            if (antagonist.AntagJobType == JobType.SYNDICATE)
            {
                yield return(StartCoroutine(SubSceneManager.Instance.LoadSyndicate()));

                yield return(WaitFor.EndOfFrame);
            }

            if (antagonist.AntagJobType == JobType.WIZARD)
            {
                yield return(StartCoroutine(SubSceneManager.Instance.LoadWizard()));

                yield return(WaitFor.EndOfFrame);
            }

            PlayerSpawn.ServerRespawnPlayer(connectedPlayer.Script.mind);
            ServerFinishAntag(antagonist, connectedPlayer);
        }
コード例 #2
0
 private static void RespawnLocalPlayer()
 {
     if (CustomNetworkManager.Instance._isServer)
     {
         PlayerSpawn.ServerRespawnPlayer(PlayerManager.LocalPlayerScript.mind);
     }
 }
コード例 #3
0
 public void CmdRespawnPlayer()
 {
     if (GameManager.Instance.RespawnCurrentlyAllowed)
     {
         PlayerSpawn.ServerRespawnPlayer(playerScript.mind);
     }
 }
コード例 #4
0
        public IEnumerator ServerRespawnAsAntag(ConnectedPlayer connectedPlayer, Antagonist antagonist)
        {
            var antagOccupation = antagonist.AntagOccupation;

            if (antagOccupation != null)
            {
                connectedPlayer.Script.mind.occupation = antagonist.AntagOccupation;
            }

            //Can be null if respawning spectator ghost as they dont have an occupation and their antag occupation is null too
            if (connectedPlayer.Script.mind.occupation == null)
            {
                yield break;
            }

            if (antagonist.AntagJobType == JobType.SYNDICATE)
            {
                yield return(StartCoroutine(SubSceneManager.Instance.LoadSyndicate()));

                yield return(WaitFor.EndOfFrame);
            }

            if (antagonist.AntagJobType == JobType.WIZARD)
            {
                yield return(StartCoroutine(SubSceneManager.Instance.LoadWizard()));

                yield return(WaitFor.EndOfFrame);
            }

            PlayerSpawn.ServerRespawnPlayer(connectedPlayer.Script.mind);
            ServerFinishAntag(antagonist, connectedPlayer);
        }
コード例 #5
0
    IEnumerator CoRespawn()
    {
        if (playerScript.mind.occupation.JobType == JobType.SYNDICATE && !SubSceneManager.Instance.SyndicateLoaded)
        {
            //yield return StartCoroutine(SubSceneManager.Instance.LoadSyndicate());
        }

        PlayerSpawn.ServerRespawnPlayer(playerScript.mind);

        yield break;
    }
コード例 #6
0
        public void ServerRespawnAsAntag(ConnectedPlayer connectedPlayer, Antagonist antagonist)
        {
            SetAntagDetails(antagonist, connectedPlayer);
            var antagOccupation = antagonist.AntagOccupation;

            if (antagOccupation != null)
            {
                connectedPlayer.Script.mind.occupation = antagonist.AntagOccupation;
            }

            ServerFinishAntag(antagonist, connectedPlayer, connectedPlayer.GameObject);
            PlayerSpawn.ServerRespawnPlayer(connectedPlayer.Script.mind);
        }
コード例 #7
0
ファイル: AntagManager.cs プロジェクト: SanecMan/Reborn-RU-CM
        public IEnumerator ServerRespawnAsAntag(ConnectedPlayer connectedPlayer, Antagonist antagonist)
        {
            var antagOccupation = antagonist.AntagOccupation;

            if (antagOccupation != null)
            {
                connectedPlayer.Script.mind.occupation = antagonist.AntagOccupation;
            }

            if (antagonist.AntagJobType == JobType.WIZARD)
            {
                yield return(WaitFor.EndOfFrame);
            }

            PlayerSpawn.ServerRespawnPlayer(connectedPlayer.Script.mind);
            ServerFinishAntag(antagonist, connectedPlayer);
        }
コード例 #8
0
    public void ServerRespawnPlayer(string occupation = null)
    {
        if (occupation != null)
        {
            foreach (var job in SOAdminJobsList.Instance.AdminAvailableJobs)
            {
                if (job.name != occupation)
                {
                    continue;
                }

                playerScript.mind.occupation = job;
                break;
            }
        }

        PlayerSpawn.ServerRespawnPlayer(playerScript.mind);
    }
コード例 #9
0
    public void ServerRespawnPlayerSpecial(string occupation = null, Vector3Int?spawnPos = null)
    {
        if (occupation != null)
        {
            foreach (var job in SOAdminJobsList.Instance.SpecialJobs)
            {
                if (job.name != occupation)
                {
                    continue;
                }

                playerScript.mind.occupation = job;
                break;
            }
        }

        PlayerSpawn.ServerRespawnPlayer(playerScript.mind, spawnPos);
    }
コード例 #10
0
        public IEnumerator ServerRespawnAsAntag(ConnectedPlayer connectedPlayer, Antagonist antagonist)
        {
            var antagOccupation = antagonist.AntagOccupation;

            if (antagOccupation != null)
            {
                connectedPlayer.Script.mind.occupation = antagonist.AntagOccupation;
            }

            //Can be null if respawning spectator ghost as they dont have an occupation and their antag occupation is null too
            if (connectedPlayer.Script.mind.occupation == null)
            {
                yield break;
            }

            PlayerSpawn.ServerRespawnPlayer(connectedPlayer.Script.mind);
            ServerFinishAntag(antagonist, connectedPlayer);
        }
コード例 #11
0
    public void ServerRespawnPlayer(string occupation = null)
    {
        if (occupation != null)
        {
            foreach (var job in OccupationList.Instance.Occupations)
            {
                if (job.name != occupation)
                {
                    continue;
                }

                playerScript.mind.occupation = job;
                break;
            }
        }

        //Can be null if respawning spectator ghost as they dont have an occupation
        if (playerScript.mind.occupation == null)
        {
            return;
        }

        PlayerSpawn.ServerRespawnPlayer(playerScript.mind);
    }
コード例 #12
0
    public void ServerRespawnPlayer(string occupation = null)
    {
        if (occupation != null)
        {
            foreach (var job in OccupationList.Instance.Occupations)
            {
                if (job.name != occupation)
                {
                    continue;
                }

                playerScript.mind.occupation = job;
                break;
            }
        }

        if (playerScript.mind.occupation == null)
        {
            // Might be a spectator trying to respawn themselves (when server allows this), default to Assistant
            playerScript.mind.occupation = OccupationList.Instance.Occupations.First();
        }

        PlayerSpawn.ServerRespawnPlayer(playerScript.mind);
    }
コード例 #13
0
 public void ServerRespawnPlayer()
 {
     PlayerSpawn.ServerRespawnPlayer(playerScript.mind);
 }