示例#1
0
        public void CheckOccupation()
        {
            if (!OnGoing)
            {
                return;
            }

            if (Participants.Count == 1)
            {
                Guild g = Participants[0];

                if (!GuildStats.ContainsKey(g))
                {
                    GuildStats[g] = new VvVGuildBattleStats(g);
                }

                GuildStats[g].Points += OccupyPoints;
                UpdateAllGumps();
                CheckScore();

                if (OnGoing && NextAnnouncement < DateTime.UtcNow)
                {
                    System.SendVvVMessage(1154957, g.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)
                {
                    System.SendVvVMessage(1154958); // The City is unoccupied! Slay opposing forces to claim the city for your guild!
                    NextAnnouncement = DateTime.UtcNow + TimeSpan.FromMinutes(Announcement);
                }
            }
        }
示例#2
0
        public void OnBattleEnd()
        {
            foreach (KeyValuePair <Guild, VvVGuildBattleStats> kvp in Battle.GuildStats)
            {
                Guild g = kvp.Key;

                if (!GuildStats.ContainsKey(g))
                {
                    GuildStats[g] = new VvVGuildStats(g);
                }

                int score = (int)kvp.Value.Points;

                GuildStats[g].Kills          += kvp.Value.Kills;
                GuildStats[g].ReturnedSigils += kvp.Value.ReturnedSigils;
                GuildStats[g].Score          += score;

                List <Mobile> list = g.Members.Where(mob => mob.NetState != null && mob.Region.IsPartOf(Battle.Region)).ToList();

                foreach (Mobile m in list)
                {
                    VvVPlayerEntry entry = GetPlayerEntry <VvVPlayerEntry>(m, true);

                    if (entry != null)
                    {
                        entry.Score += score;
                    }
                }
            }
        }
示例#3
0
        public VvVGuildBattleStats GetGuildStats(Guild g)
        {
            if (g == null)
            {
                return(null);
            }

            if (!GuildStats.ContainsKey(g))
            {
                GuildStats[g] = new VvVGuildBattleStats(g);
            }

            return(GuildStats[g]);
        }
示例#4
0
        /// <summary>
        /// Gets real time leader of battle, out parameter of their score
        /// </summary>
        /// <param name="score"></param>
        /// <returns></returns>
        public Guild GetLeader(out int score)
        {
            Guild leader = null;

            score = 0;

            foreach (Guild g in Participants)
            {
                if (!GuildStats.ContainsKey(g))
                {
                    GuildStats[g] = new VvVGuildBattleStats(g);
                }

                if (leader == null || GuildStats[g].Points > score)
                {
                    leader = g;
                    score  = (int)GuildStats[g].Points;
                }
            }

            return(leader);
        }