コード例 #1
0
 public override void OnDoubleClick(Mobile from)
 {
     if (m_Game != null)
     {
         if (m_Game.OpenJoin)
         {
             if (m_Game.IsInGame(from))
             {
                 from.SendGump(new GameTeamSelector(m_Game));
             }
             else
             {
                 if (from.AccessLevel == AccessLevel.Player)
                 {
                     from.SendGump(new GameJoinGump(m_Game, m_GameName));
                 }
                 else
                 {
                     from.SendMessage("It might not be wise for staff to be playing...");
                 }
             }
         }
         else
         {
             from.SendMessage("{0} join is closed.", m_GameName);
         }
     }
     else
     {
         from.SendMessage("This stone must be linked to a game stone.  Please contact a game master.");
     }
 }
コード例 #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from == null || from.Deleted)
            {
                return;
            }

            if (!from.InLOS(this.GetWorldLocation()))
            {
                from.SendLocalizedMessage(502800);                   // You can't see that.
            }
            else if (from.GetDistanceToSqrt(this.GetWorldLocation()) > 4)
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
            }
            else if (!IsNaked(from))
            {
                from.SendMessage("You must be naked to join.");
            }
            else if (from.Backpack == null)
            {
                from.SendMessage("You can not join without a backpack.");
            }
            else if (m_Game != null)
            {
                if (m_Game.OpenJoin)
                {
                    if (m_Game.IsInGame(from))
                    {
                        from.SendMessage("You are already playing!");
                        //from.SendGump( new GameTeamSelector( m_Game ) );
                    }
                    else
                    {
                        if (from.AccessLevel == AccessLevel.Player)
                        {
                            from.CloseGump(typeof(GameJoinGump));
                            from.SendGump(new GameJoinGump(m_Game, m_GameName, m_RandomTeam));
                        }
                        else
                        {
                            from.SendMessage("It might not be wise for staff to be playing...");
                        }
                    }
                }
                else
                {
                    from.SendMessage("{0} join is closed.", m_GameName);
                }
            }
            else
            {
                from.SendMessage("This stone must be linked to a game stone.  Please contact a game master.");
            }
        }