예제 #1
0
 public BoWBrazier(BoWBattle battle)
     : base(3633)
 {
     Name    = "a magical brazier";
     Movable = false;
     Battle  = battle;
 }
예제 #2
0
		public BoWBrazier(BoWBattle battle)
			: base(3633)
		{
			Name = "a magical brazier";
			Movable = false;
			Battle = battle;
		}
예제 #3
0
		public BoWCrystal(BoWBattle battle)
			: base(8738)
		{
			Battle = battle;

			Name = "the Crystal of Power";
			Hue = 2498;
			Movable = false;
		}
예제 #4
0
		public BoWWinPortal(BoWBattle battle)
			: base(3948)
		{
			Name = "a dimensional gateway";
			Movable = false;
			Battle = battle;
			Hue = 1266;
			DoesNotDecay = true;
		}
예제 #5
0
 public BoWWinPortal(BoWBattle battle)
     : base(3948)
 {
     Name         = "a dimensional gateway";
     Movable      = false;
     Battle       = battle;
     Hue          = 1266;
     DoesNotDecay = true;
 }
예제 #6
0
        public BoWCrystal(BoWBattle battle)
            : base(8738)
        {
            Battle = battle;

            Name    = "the Crystal of Power";
            Hue     = 2498;
            Movable = false;
        }
예제 #7
0
        public override void OnMemberDeath(PlayerMobile pm)
        {
            BoWBattle bow = BoWBattle;

            if (bow != null && !bow.Deleted)
            {
                bow.Teams.OfType <BoWTeam>()
                .Where(t => t != this && bow.Crystal != null && bow.Crystal.Carrier == pm)
                .ForEach(t => bow.Crystal.Carrier = null);
            }

            InvalidateSolidHueOverride(pm);

            base.OnMemberDeath(pm);
        }
예제 #8
0
        public override void OnMemberAdded(PlayerMobile pm)
        {
            if (pm == null)
            {
                return;
            }

            BoWBattle bow = BoWBattle;

            if (bow != null && bow.IsFaction)
            {
                CapacityBalance();
            }

            base.OnMemberAdded(pm);

            InvalidateSolidHueOverride(pm);
        }
예제 #9
0
        protected override void OnMicroSync()
        {
            base.OnMicroSync();

            BoWBattle bow = BoWBattle;

            if (bow != null && !bow.Deleted && bow.State == PvPBattleState.Running && !bow.Hidden)
            {
                if (bow.Crystal != null && !bow.Crystal.Deleted)
                {
                    bow.Crystal.InvalidateCarrier();
                }

                if (bow.Crystal != null && !bow.Crystal.Deleted && bow.Crystal.Carrier != null)
                {
                    bow.Crystal.UpdatePoints();
                }

                if (bow.Crystal == null || DateTime.UtcNow < _NextArrowUpdate)
                {
                    return;
                }

                foreach (PlayerMobile player in Members.Keys.Where(player => player != bow.Crystal.Carrier))
                {
                    player.QuestArrow = bow.Crystal.Carrier != null
                                                                                        ? new BoWArrow(player, bow.Crystal.Carrier, -1, false)
                                                                                        : new BoWArrow(player, bow.Crystal, -1, false);
                }

                if (bow.Crystal.Carrier != null && bow.Crystal.Carrier.QuestArrow != null)
                {
                    bow.Crystal.Carrier.QuestArrow.Stop();
                }
            }

            _NextArrowUpdate = DateTime.UtcNow + _OneSecond;
        }
예제 #10
0
        public override void OnMemberRemoved(PlayerMobile pm)
        {
            if (pm == null)
            {
                return;
            }

            BoWBattle bow = BoWBattle;

            if (bow != null && bow.IsFaction)
            {
                CapacityBalance();
            }

            base.OnMemberRemoved(pm);

            if (bow != null && !bow.Deleted && bow.Crystal != null && !bow.Crystal.Deleted && bow.Crystal.Carrier == pm)
            {
                bow.Crystal.Reset();
            }

            InvalidateSolidHueOverride(pm);
        }
예제 #11
0
        public void CapacityBalance()
        {
            BoWBattle bow = BoWBattle;

            if (bow == null || bow.Deleted)
            {
                return;
            }

            foreach (BoWTeam bowTeam in Battle.Teams.OfType <BoWTeam>())
            {
                if (bow.FirstMaxTeam == null)
                {
                    bow.FirstMaxTeam = bowTeam;
                }
                else if (bowTeam.Members.Count > bow.FirstMaxTeam.Count)
                {
                    if (bow.SecondMaxTeam != null && bow.FirstMaxTeam.Count > bow.SecondMaxTeam.Count || bow.SecondMaxTeam == null)
                    {
                        bow.SecondMaxTeam = bow.FirstMaxTeam;
                    }
                    bow.FirstMaxTeam = bowTeam;
                }

                if (bow.FirstMaxTeam == bow.SecondMaxTeam)
                {
                    bow.SecondMaxTeam = null;
                }

                if (bow.SecondMaxTeam == null && bow.FirstMaxTeam != bowTeam)
                {
                    bow.SecondMaxTeam = bowTeam;
                }
                else if (bow.SecondMaxTeam != null && bowTeam.Count > bow.SecondMaxTeam.Count && bowTeam != bow.FirstMaxTeam)
                {
                    bow.SecondMaxTeam = bowTeam;
                }
            }

            foreach (BoWTeam bowTeam in Battle.Teams.OfType <BoWTeam>())
            {
                if (bow.SecondMaxTeam != null)
                {
                    bowTeam.MaxCapacity = bow.SecondMaxTeam.Count + 2;
                }
                else if (bow.SecondMaxTeam == null)
                {
                    bowTeam.MaxCapacity = 7;
                }
            }

            if (bow.FirstMaxTeam != null && bow.FirstMaxTeam.Count < 7)
            {
                bow.FirstMaxTeam = null;
            }

            if (bow.SecondMaxTeam != null && bow.SecondMaxTeam.Count < 5)
            {
                bow.SecondMaxTeam = null;
            }
        }