示例#1
0
        public void JoinTeam(ArenaClient client, int index)
        {
            if (Phase == GamePhase.FadeOut)
            {
                return;
            }

            if (index < 0 || index >= teams.Count)
            {
                return;
            }

            var team = teams[index];

            if (client.TDMTeam == team)
            {
                return;
            }

            if (client.TDMTeam != null)
            {
                client.KillCharacter();
                client.TDMTeam.Players.Remove(client);
                client.GMClass = null;
            }

            client.TDMTeam = team;
            team.Players.Add(client);
            client.SetTeamID((TeamIdent)index);
        }
示例#2
0
        public virtual void JoinAsSpectator(ArenaClient client)
        {
            client.KillCharacter();
            if (!players.Contains(client))
            {
                players.Add(client);
            }

            client.SetTeamID(TeamIdent.GMSpectator);
            if (SpawnWorld != null && Phase <= GamePhase.WarmUp)
            {
                client.SetToSpectator(SpawnWorld, Scenario.SpecPoint.Position, Scenario.SpecPoint.Angles);
            }
            else
            {
                client.SetToSpectator(World, Scenario.SpawnPos.Position, Scenario.SpawnPos.Angles);
            }
        }
示例#3
0
        public override void SelectClass(ArenaClient client, int index)
        {
            if (!Scenario.PlayerClasses.TryGet(index, out NPCClass pc))
            {
                return;
            }

            client.GMClass = pc;
            client.SetTeamID(TeamIdent.GMPlayer);

            if (Phase == GamePhase.WarmUp || Phase == GamePhase.None)
            {
                InitialSpawnClient(client, true);
            }
            else if (Phase != GamePhase.FadeOut)
            {
                RespawnClient(client);
            }
        }