Ejemplo n.º 1
0
        public void Begin()
        {
            VvVCity newCity = City;

            OnGoing = true;

            do
            {
                newCity = (VvVCity)Utility.Random(8);
            }while (newCity == City);

            City = newCity;

            BeginTimer();

            StartTime      = DateTime.UtcNow;
            NextSigilSpawn = DateTime.UtcNow + TimeSpan.FromMinutes(Utility.RandomMinMax(1, 3));

            AltarIndex = 0;
            SpawnAltars();
            SpawnPriests(false);

            if (Region is GuardedRegion)
            {
                GuardedRegion.Disable((GuardedRegion)Region);
            }

            NextAltarActivate = DateTime.UtcNow + TimeSpan.FromMinutes(1);

            System.SendVvVMessage(1154721, String.Format("#{0}", ViceVsVirtueSystem.GetCityLocalization(City).ToString()));
            // A Battle between Vice and Virtue is active! To Arms! The City of ~1_CITY~ is besieged!
        }
Ejemplo n.º 2
0
        public void Begin()
        {
            OnGoing             = true;
            NextCombatHeatCycle = DateTime.UtcNow;
            VvVCity        newCity = City;
            List <VvVCity> cities  = new List <VvVCity>();

            Teams        = new List <BattleTeam>();
            KillCooldown = new Dictionary <Mobile, DateTime>();
            Messages     = new List <string>();
            Altars       = new List <VvVAltar>();
            Traps        = new List <VvVTrap>();
            Warned       = new List <Mobile>();
            Turrets      = new List <CannonTurret>();

            for (int i = 0; i < 8; i++)
            {
                if (!System.ExemptCities.Contains((VvVCity)i) && (VvVCity)i != newCity)
                {
                    cities.Add((VvVCity)i);
                }
            }

            if (cities.Count > 0)
            {
                newCity = cities[Utility.Random(cities.Count)];
            }
            else if (System.ExemptCities.Contains(newCity))
            {
                System.SendVvVMessage("All VvV cities are currently exempt.");
                return;
            }

            ColUtility.Free(cities);
            City = newCity;
            BeginTimer();

            StartTime      = DateTime.UtcNow;
            NextSigilSpawn = DateTime.UtcNow + TimeSpan.FromMinutes(Utility.RandomMinMax(1, 3));

            AltarIndex = 0;
            SpawnAltars();
            SpawnPriests(false);

            if (Region is GuardedRegion)
            {
                GuardedRegion.Disable((GuardedRegion)Region);
            }

            NextAltarActivate = DateTime.UtcNow + TimeSpan.FromMinutes(1);

            System.SendVvVMessage(1154721, String.Format("#{0}", ViceVsVirtueSystem.GetCityLocalization(City).ToString()));
            // A Battle between Vice and Virtue is active! To Arms! The City of ~1_CITY~ is besieged!
        }
Ejemplo n.º 3
0
        public void AddGumpLayout()
        {
            AddBackground(0, 0, 250, 300, 83);
            AddHtml(0, 15, 250, 60, "<basefont color=#FFFFFF><center>City Exempt List:<br>Check any cities that you do not want participating in VvV Battles.</center>", false, false);

            for (int i = 0; i < 8; i++)
            {
                VvVCity city   = (VvVCity)i;
                int     button = ViceVsVirtueSystem.Instance.ExemptCities.Contains(city) ? 211 : 210;

                AddButton(20, 80 + (i * 23), button, button, i + 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(44, 80 + (i * 23), 200, 20, ViceVsVirtueSystem.GetCityLocalization(city), 0xFFFF, false, false);
            }
        }
Ejemplo n.º 4
0
        public void CheckOccupation()
        {
            if (!OnGoing)
            {
                return;
            }

            if (Teams.Count == 1)
            {
                BattleTeam team = Teams[0];

                team.Score += (int)OccupyPoints;
                UpdateAllGumps();
                CheckScore();

                if (OnGoing && NextAnnouncement < DateTime.UtcNow)
                {
                    if (ViceVsVirtueSystem.EnhancedRules)
                    {
                        System.SendVvVMessage(String.Format("{0} is occupying {1}!", team.Guild.Name, City == VvVCity.SkaraBrae ? "Skara Brae" : City.ToString()));
                    }
                    else
                    {
                        System.SendVvVMessage(1154957, team.Guild.Name); // ~1_NAME~ is occupying the city!
                    }

                    NextAnnouncement = DateTime.UtcNow + TimeSpan.FromMinutes(Announcement);
                }
            }
            else // Is this a bug?  Verified on EA this is how it behaves
            {
                if (NextAnnouncement < DateTime.UtcNow)
                {
                    if (ViceVsVirtueSystem.EnhancedRules)
                    {
                        System.SendVvVMessage(1050039, String.Format("#{0}\tis unoccupied! Slay opposing forces to claim the city for your guild!", ViceVsVirtueSystem.GetCityLocalization(City).ToString()));
                    }
                    else
                    {
                        System.SendVvVMessage(1154958); // The City is unoccupied! Slay opposing forces to claim the city for your guild!
                    }

                    NextAnnouncement = DateTime.UtcNow + TimeSpan.FromMinutes(Announcement);
                }
            }
        }