Beispiel #1
0
        // Player position gets sent if InSafe
        public void Event_PlayerPosition(SSPlayer p)
        {
            bool       InLobby = this.player_InRegion(p.Position, this.m_Lobby.BaseDimension);
            bool       InAlpha;
            BasePlayer b = this.m_CurrentPoint.getPlayer(p.PlayerName, out InAlpha);

            // add player here maybe if == null
            if (b == null)
            {
                if (player_InRegion(p.Position, this.m_CurrentBase.BaseDimension))
                {
                    if (this.m_Locked || (p.Frequency != this.m_AlphaFreq && p.Frequency != this.m_BravoFreq))
                    {
                        psyGame.Send(msg.pm(p.PlayerName, "?prize warp"));
                    }
                    else
                    {
                        BaseTeam team = p.Frequency == this.m_AlphaFreq ? this.m_CurrentPoint.AlphaTeam():this.m_CurrentPoint.BravoTeam();
                        team.playerJoin(p.PlayerName);
                    }
                }
                return;
            }

            if (this.m_Status == Misc.BaseGameStatus.InProgress)
            {
                b.inLobby(InLobby);

                if (InLobby)
                {
                    allOutCheck();
                }
                else
                {
                    if (this.m_Settings.SafeWin && this.player_InRegion(p.Position, (InAlpha ? this.m_CurrentBase.BravoSafe : this.m_CurrentBase.AlphaSafe)))
                    {
                        this.point_AwardWinner(Misc.WinType.SafeWin, InAlpha, p.PlayerName);
                    }
                }
            }
        }
Beispiel #2
0
        public BaseTeam getCopy()
        {
            BaseTeam copy = new BaseTeam();

            List <BasePlayer> players   = new List <BasePlayer>();
            List <BasePlayer> inactives = new List <BasePlayer>();

            foreach (BasePlayer b in this.m_Players)
            {
                players.Add(b.GetCopy());
            }
            foreach (BasePlayer b in this.m_Inactives)
            {
                inactives.Add(b.GetCopy());
            }

            copy.m_Players   = players;
            copy.m_Inactives = inactives;

            return(copy);
        }
Beispiel #3
0
        // Add everyone from the freq into corresponding team list
        private void freqDump(ushort Freq, BaseTeam team, bool IsAlpha)
        {
            // Grab names from freq
            List <SSPlayer> pList = this.m_Players.PlayerList.FindAll(item => item.Frequency == Freq);

            // Toss freqs into teams
            while (pList.Count > 0)
            {
                if (team.teamCount() == 0 && m_AllPoints.Count == 0)
                {
                    if (IsAlpha)
                    {
                        this.m_ATeamName = pList[0].SquadName == "~ no squad ~" ? "Alpha" : pList[0].SquadName;
                    }
                    else
                    {
                        this.m_BTeamName = pList[0].SquadName == "~ no squad ~" ? "Bravo" : pList[0].SquadName;
                    }
                }

                team.playerJoin(pList[0].PlayerName);
                pList.RemoveAt(0);
            }

            if (IsAlpha)
            {
                return;
            }

            if (this.m_ATeamName == this.m_BTeamName)
            {
                this.m_ATeamName = m_DefaultATeamName;
                this.m_BTeamName = m_DefaultBTeamName;
            }

            if (m_AllPoints.Count == 0)
            {
                this.m_CurrentPoint.SetTeamNames(this.m_ATeamName, this.m_BTeamName);
            }
        }