Esempio n. 1
0
        public EquipmentStorage Supply(Mobile m)
        {
            EquipmentStorage playerGear = new EquipmentStorage(m);

            playerGear.StoreEquip();

            //Supply the right type of gear
            SupplySystem.SupplyGear(m, this);
            return(playerGear);
        }
Esempio n. 2
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.Alive == false)
            {
                m.SendAsciiMessage("You cannot use that while dead.");
                return(true);
            }

            if (m.AccessLevel >= AccessLevel.Counselor)
            {
                m.SendAsciiMessage("This is not for staff members.");
                return(true);
            }

            if (m is BaseCreature)
            {
                return(Teleport(m));
            }
            else if (m is PlayerMobile)
            {
                if (!m.IsInEvent)
                {
                    if (SupplyType == SupplyType.Custom && !CanUseCustomGear)
                    {
                        PublicOverheadMessage(MessageType.Regular, 906, true, "Custom setup error.");
                        return(false);
                    }

                    //Store our equipment
                    EquipmentStorage playerGear = new EquipmentStorage(m);
                    playerGear.StoreEquip();

                    //Supply the right type of gear
                    SupplySystem.SupplyGear(m, this);

                    //Tag the mobile to be in the event and display a message

                    m.IsInEvent = true;
                    ((PlayerMobile)m).EventType = m_EventType;
                    m.SendAsciiMessage("You have been auto supplied.");
                    return(Teleport(m));
                }
                else
                {
                    m.IsInEvent = false;
                    ((PlayerMobile)m).EventType = EventType.NoEvent;
                    m.SendAsciiMessage("Your auto supply has been removed.");

                    SupplySystem.RemoveEventGear(m);
                    return(Teleport(m));
                }
            }
            return(true);
        }
Esempio n. 3
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m.AccessLevel >= AccessLevel.Counselor)
            {
                m.SendAsciiMessage("This is not for staff members.");
                return(true);
            }

            if (m is BaseCreature)
            {
                return(Teleport(m));
            }
            if (m is PlayerMobile)
            {
                if (!m.Alive)
                {
                    ((PlayerMobile)m).ForceResurrect();
                    return(false);
                }

                if (!m.IsInEvent || m_Game != null)
                {
                    if (m_Game != null && m_TeamID != -1)
                    {
                        //Store our equipment
                        EquipmentStorage playerGear = new EquipmentStorage(m);
                        playerGear.StoreEquip();

                        //Supply the right type of gear
                        SupplySystem.SupplyGear(m, this);

                        CWTeam team = (CWTeam)m_Game.Teams[m_TeamID - 1];
                        //m_Game.SwitchTeams(m, team);

                        m.SendMessage("You have joined {0}!", team.Name);

                        //Tag the mobile to be in the event and display a message
                        m.IsInEvent = true;
                        m.SendAsciiMessage("You have been auto supplied.");

                        if (m_Game != null && m_Game.Running)
                        {
                            return(Teleport(m));
                        }
                    }
                    else
                    {
                        m.SendMessage("The game has not started yet.");
                        return(false);
                    }
                }
                else
                {
                    m.IsInEvent = false;
                    m.SendAsciiMessage("Your auto supply has been removed.");

                    SupplySystem.RemoveEventGear(m);
                    return(Teleport(m));
                }
            }
            return(true);
        }
Esempio n. 4
0
        public void HandleDeath(Mobile m)
        {
            if (!m_Started)
            {
                return;
            }

            List <Mobile> opponents = new List <Mobile>();
            List <Mobile> referees  = new List <Mobile>();

            Rectangle2D area = GetArea(m);

            // Rob - remove and stop the Match or EndMatch timer
            if (m_MatchTimers.ContainsKey(area))
            {
                Timer t = m_MatchTimers[area];
                t.Stop();
                m_MatchTimers.Remove(area);
            }
            // end Rob
            IPooledEnumerable eable = JoinMap.GetMobilesInBounds(area);

            foreach (Mobile mob in eable)
            {
                if (mob != m && Contestants.Contains(mob))
                {
                    opponents.Add(mob);
                }
                else if (mob is Referee)
                {
                    referees.Add(mob);
                }
            }

            eable.Free();

            for (int i = 0; i < opponents.Count && opponents.Count <= 1; ++i)
            {
                Mobile mob = opponents[i];
                UpdateScores(m, mob);
                mob.MoveToWorld(WinLocation, WinMap);
                FixPlayer(mob);
                mob.Blessed = true;
                Fighting.Remove(mob);
                Winners.Add(mob);

                //Rob -re-add gear in case gear was removed
                if (ForceEnd == ForceEndType.ItemRemoval && NeedRestock.Contains(mob))
                {
                    SupplySystem.RemoveEventGear(mob);
                    SupplySystem.SupplyGear(mob, EventSupplier);
                    NeedRestock.Remove(mob);
                    mob.SendAsciiMessage("You have been resupplied!");
                }
            }

            NeedRestock.Remove(m); // loser doesn't need a restock
            // end - Rob

            for (int i = 0; i < referees.Count; ++i)
            {
                Mobile mob = referees[i];
                mob.Delete();
            }

            Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(ResurrectPlayer), m);

            HandleCorpse(m);

            Fighting.Remove(m);
            RemovePlayer(m, true, false);

            m.LastKiller = null;

            AddFighters(false);
        }