Ejemplo n.º 1
0
 private static void StopEvent_Target(Mobile from, object o, object state)
 {
     if (o is BaseGame)
     {
         BaseGame game = (BaseGame)o;
         try
         {
             game.EndGameCommand();
             from.SendMessage("The game has been stopped.");
         }
         catch (EventException e)
         {
             from.SendMessage(e.ToString());
         }
     }
     else if (o is DMStone)
     {
         DMStone game = (DMStone)o;
         game.Started = false;
     }
     else if (o is TournamentStone)
     {
         TournamentStone game = (TournamentStone)o;
         game.Started = false;
     }
     else
     {
         from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(StopEvent_Target), false);
         from.SendMessage("Target the game stone.");
     }
 }
Ejemplo n.º 2
0
 private static void CloseEvent_Target(Mobile from, object o, object state)
 {
     if (o is BaseGame)
     {
         BaseGame game = (BaseGame)o;
         if (game.Open)
         {
             game.Open = false;
             from.SendMessage("The game has been closed.");
         }
         else
         {
             from.SendMessage("The game already closed.");
         }
     }
     else if (o is DMStone)
     {
         DMStone game = (DMStone)o;
         if (game.Started)
         {
             game.AcceptingContestants = false;
             from.SendAsciiMessage("The game is now closed for players");
         }
         else
         {
             from.SendAsciiMessage("This game is not running");
         }
     }
     else if (o is TournamentStone)
     {
         TournamentStone game = (TournamentStone)o;
         if (game.Started)
         {
             game.AcceptingContestants = false;
             from.SendAsciiMessage("The game is now closed for players");
         }
         else
         {
             from.SendAsciiMessage("This game is not running");
         }
     }
     else
     {
         from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(CloseEvent_Target), false);
         from.SendMessage("Target the game stone.");
     }
 }
Ejemplo n.º 3
0
 private static void OpenEvent_Target(Mobile from, object o, object state)
 {
     if (o is BaseGame)
     {
         BaseGame game = (BaseGame)o;
         if (!game.Open)
         {
             game.Open = true;
             from.SendMessage("The game has been opened.");
         }
         else
         {
             from.SendMessage("The game is already open.");
         }
     }
     else if (o is DMStone)
     {
         DMStone game = (DMStone)o;
         if (game.Started)
         {
             game.AcceptingContestants = true;
             from.SendAsciiMessage("The game is now open for players");
         }
         else
         {
             from.SendAsciiMessage("You must start the game first");
         }
     }
     else if (o is TournamentStone)
     {
         TournamentStone game = (TournamentStone)o;
         if (game.Started)
         {
             game.AcceptingContestants = true;
             from.SendAsciiMessage("The game is now open for players");
         }
         else
         {
             from.SendAsciiMessage("You must start the game first");
         }
     }
     else
     {
         from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(OpenEvent_Target), false);
         from.SendMessage("Target the game stone.");
     }
 }
Ejemplo n.º 4
0
        public static bool TryJoinTournament(Mobile from, TournamentStone tStone)
        {
            if (Factions.Sigil.ExistsOn(from))
                from.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            else if (IsInTournament(from))
                from.SendMessage("You are already in a tournament. Type .leavetour to leave.");
            else if (from.IsInEvent)
                from.SendMessage("You cannot join a tournament while in an event");
            else if (from.Spell != null)
                from.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
            else if (!from.Alive)
                from.SendMessage("You cannot join a tournament while dead.");
            else if (from.IsBodyMod && !from.Body.IsHuman)
                from.SendMessage("You cannot join a tournament while polymorphed.");
            else if (TournamentStones.Count < 1)
                from.SendMessage("No tournament system exists on the server.");
            else if (from.AccessLevel > AccessLevel.Player)
                from.SendMessage("You cannot join a tournament as staff.");
            else
                return AllowTournamentJoin(from, tStone);

            return false;
        }
Ejemplo n.º 5
0
 private static void StartEvent_Target(Mobile from, object o, object state)
 {
     if (o is BaseGame)
     {
         BaseGame game = (BaseGame)o;
         if (game.Open)
         {
             try
             {
                 game.StartCommand(from);
             }
             catch (EventException e)
             {
                 from.SendMessage(e.ToString());
             }
         }
         else
         {
             from.SendMessage("You have to open the game first.");
         }
     }
     else if (o is DMStone)
     {
         DMStone game = (DMStone)o;
         game.Started = true;
     }
     else if (o is TournamentStone)
     {
         TournamentStone game = (TournamentStone)o;
         game.Started = true;
     }
     else
     {
         from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(StartEvent_Target), false);
         from.SendMessage("Target the game stone.");
     }
 }
Ejemplo n.º 6
0
 public DisconnectTimer(TournamentStone stone, Mobile m) : base(TimeSpan.FromMinutes(3.0))
 {
     m_Mobile = m;
     m_Stone = stone;
 }
Ejemplo n.º 7
0
        /*
        public static void TryShowScoreBoard(Mobile from)
        {
            if (IsInTournament(from))
            {
                TournamentStone ts = GetPlayerStone(from);

                if (ts != null)
                    ts.ShowScore(from);
            }
        }
        */
        private static bool AllowTournamentJoin(Mobile from, TournamentStone stone)
        {
            if (stone != null)
            {
                if (stone.EventSupplier != null)
                {
                    stone.AddPlayer(from);
                    return true;
                }

                from.SendAsciiMessage("There is no event supplier connected to the death match");
            }
            else
                from.SendMessage("Either a tournament has not been started or it's not accepting more players.");

            return false;
        }