public override void OnDoubleClick(Mobile from) { if (m_Bounds.Width == 0) { // Not configured yet if (from.AccessLevel >= AccessLevel.GameMaster) { from.Target = new ChessTarget(from, "Target the north west corner of the chessboard you wish to create", OnBoardTarget); } else { from.SendMessage(0x40, "This chess board isn't ready for a game yet. Please contact a game master for assistance with its configuration."); } } else if (m_Game != null) { if (m_Game.IsPlayer(from) && m_Game.AllowGame) { m_Game.SendAllGumps(null, null); } else { from.SendMessage(0x40, "A chess game is currently in progress. Please try again later."); } } else { m_Game = new ChessGame(this, from, m_Bounds, m_BoardHeight); InvalidateProperties(); } }
public override void OnSpeech(SpeechEventArgs args) { if (m_Game != null && m_Game.IsPlayer(args.Mobile) && m_Game.AllowTarget) { if (args.Speech.ToLower().IndexOf(ChessConfig.ResetKeyword.ToLower()) > -1) { m_Game.SendAllGumps(null, null); } } base.OnSpeech(args); }