//----------------------------------------------------------------------// // Commands // //----------------------------------------------------------------------// public void command_GameStart(SSPlayer p) { if (this.m_Timer.Enabled || this.m_Status != Misc.BaseGameStatus.NotStarted) { psyGame.Send(msg.pm(p.PlayerName, "The game has already been started.")); return; } // Get freq counts int aCount = this.m_Players.PlayerList.FindAll(item => item.Frequency == this.m_AlphaFreq && item.Ship != ShipTypes.Spectator).Count; int bCount = this.m_Players.PlayerList.FindAll(item => item.Frequency == this.m_BravoFreq && item.Ship != ShipTypes.Spectator).Count; if (aCount > 0 && bCount > 0) { this.freqDump(this.m_AlphaFreq, this.m_CurrentPoint.AlphaTeam(), true); this.freqDump(this.m_BravoFreq, this.m_CurrentPoint.BravoTeam(), false); psyGame.Send(msg.arena("[ BaseDuel ] A game will begin in " + this.m_StartGameDelay + " seconds. [ " + this.m_CurrentPoint.AlphaCount() + " vs " + this.m_CurrentPoint.BravoCount() + " ]" + (this.m_MultiOn ? " - " + this.m_GameTag + " -" : "."))); psyGame.Send(msg.team_pm(this.m_AlphaFreq, "Welcome to Team: " + this.m_ATeamName + ". Good Luck!")); psyGame.Send(msg.team_pm(this.m_BravoFreq, "Welcome to Team: " + this.m_BTeamName + ". Good Luck!")); this.timer_Setup(Misc.TimerType.GameStart); return; } // Need one player on opfor psyGame.Send(msg.pm(p.PlayerName, "You need to have at least 1 player on each team to start. Please find an opponent and have them join Freq= " + (aCount == 0 ? this.m_AlphaFreq : this.m_BravoFreq) + ".")); }
//----------------------------------------------------------------------// // Race Game Function // //----------------------------------------------------------------------// private void race_EndRace() { if (this.m_Timer.Enabled) { this.m_Timer.Stop(); } if (this.m_RacerRecords != null && this.m_RacerRecords.Count > 0) { psyGame.Send(msg.team_pm(this.m_Freq, "?a Saving Race Scores . . . . ".PadRight(60))); this.m_FakeDB.BaseRace_SavePlayerTimes(this.m_RacerRecords, this.m_CurrentBase); psyGame.Send(msg.team_pm(this.m_Freq, "?a Scores Saved. ".PadRight(60))); if (this.m_RacerRecords.Count > 1) { psyGame.Send(msg.team_pm(this.m_Freq, "+---------------------------------------------------------------------+")); psyGame.Send(msg.team_pm(this.m_Freq, "| BaseID [ " + this.m_CurrentBase.BaseID.ToString().PadLeft(2, '0') + " ] |")); psyGame.Send(msg.team_pm(this.m_Freq, "+---------------------------------------------------------------------+")); for (int i = 0; i < this.m_RacerRecords.Count; i++) { psyGame.Send(msg.team_pm(this.m_Freq, "| " + (i + 1).ToString().PadLeft(2, '0') + ". " + m_RacerRecords[i].PlayerName.PadRight(22) + this.getFormattedTime(m_RacerRecords[i].Time).PadRight(27) + m_RacerRecords[i].Ship.ToString().PadRight(15) + "|")); } psyGame.Send(msg.team_pm(this.m_Freq, "+---------------------------------------------------------------------+")); psyGame.Send(msg.team_pm(this.m_Freq, "| To get all times for this base type : .br baseinfo " + this.m_CurrentBase.BaseID.ToString().PadLeft(2, '0') + " |")); psyGame.Send(msg.team_pm(this.m_Freq, "+---------------------------------------------------------------------+")); } else { List <BRPlayer> baseInfo = this.m_FakeDB.GetBaseRecords(m_CurrentBase.BaseID); psyGame.Send(msg.team_pm(this.m_Freq, "+---------------------------------------------------------------------+")); psyGame.Send(msg.team_pm(this.m_Freq, "| Base ID Number " + this.m_CurrentBase.BaseID.ToString().PadLeft(2, '0') + " Top Times |")); psyGame.Send(msg.team_pm(this.m_Freq, "+---------------------------------------------------------------------+")); psyGame.Send(msg.team_pm(this.m_Freq, "| Player".PadRight(25) + "Time".PadRight(22) + "Ship".PadRight(13) + "Date".PadRight(10) + "|")); psyGame.Send(msg.team_pm(this.m_Freq, "+----------------------^---------------------^------------^-----------+")); int i = 1; foreach (BRPlayer b in baseInfo) { psyGame.Send(msg.team_pm(this.m_Freq, (i++).ToString().PadLeft(2, '0') + ". " + b.PlayerName.PadRight(20) + this.getFormattedTime(b.Time).ToString().PadRight(22) + b.Ship.ToString().PadRight(13) + b.Date.ToShortDateString())); } psyGame.Send(msg.team_pm(this.m_Freq, "+---------------------------------------------------------------------+")); psyGame.Send(msg.team_pm(this.m_Freq, "| To race in the next base, type: !race or .race |")); psyGame.Send(msg.team_pm(this.m_Freq, "+---------------------------------------------------------------------+")); } } else { psyGame.Send(msg.arena("Race cancelled.")); } this.race_Reset(); }