コード例 #1
0
        private void SpawnContestants()
        {
            for (int i = 0; i < Contestants.Count; ++i)
            {
                if (Fighting.Contains(Contestants[i]) || Winners.Contains(Contestants[i]))
                {
                    continue;
                }

                SpawnMobile(Contestants[i]);
            }

            Timer.DelayCall(TimeSpan.FromSeconds(3), new TimerCallback(CheckAloneFighter));
        }
コード例 #2
0
        public void RemovePlayer(Mobile m, bool defeated, bool kicked)
        {
            SupplySystem.RemoveEventGear(m);
            m.IsInEvent = false;
            m.Blessed   = false;

            m.MoveToWorld(LeaveLocation, LeaveMap);

            if (Contestants.Contains(m))
            {
                Contestants.Remove(m);
            }

            if (Fighting.Contains(m))
            {
                Fighting.Remove(m);
            }

            if (Winners.Contains(m))
            {
                Winners.Remove(m);
            }

            // Rob
            if (NeedRestock.Contains(m))
            {
                NeedRestock.Remove(m);
            }
            // end Rob

            if (m.NetState != null)
            {
                if (defeated)
                {
                    m.SendAsciiMessage(38, "You have been defeated");
                }
                else if (kicked)
                {
                    m.SendAsciiMessage(38, "You have been kicked from the tournament");
                }
                else
                {
                    m.SendAsciiMessage(38, "You have left the tournament");
                }
            }

            //Only print the message if the match is onging
            if (!m_Started)
            {
                return;
            }

            string leaveMessage;

            if (defeated)
            {
                leaveMessage = string.Format("{0} has been defeated", m.Name);
            }
            else if (kicked)
            {
                leaveMessage = string.Format("{0} has been kicked from a tournament", m.Name);
            }
            else
            {
                leaveMessage = string.Format("{0} has left a tournament", m.Name);
            }

            TournamentCore.SendMessage(Contestants, leaveMessage, true);
        }