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); }
private static void RespawnLocalPlayer() { if (CustomNetworkManager.Instance._isServer) { PlayerSpawn.ServerRespawnPlayer(PlayerManager.LocalPlayerScript.mind); } }
public void CmdRespawnPlayer() { if (GameManager.Instance.RespawnCurrentlyAllowed) { PlayerSpawn.ServerRespawnPlayer(playerScript.mind); } }
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); }
IEnumerator CoRespawn() { if (playerScript.mind.occupation.JobType == JobType.SYNDICATE && !SubSceneManager.Instance.SyndicateLoaded) { //yield return StartCoroutine(SubSceneManager.Instance.LoadSyndicate()); } PlayerSpawn.ServerRespawnPlayer(playerScript.mind); yield break; }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public void ServerRespawnPlayer() { PlayerSpawn.ServerRespawnPlayer(playerScript.mind); }