Exemplo n.º 1
0
        protected override void OnBattleEnded(DateTime when)
        {
            Winners = GetWinningTeams().ToArray();

            if (StatisticsCache.Count > 0)
            {
                /*foreach (PlayerMobile player in StatisticsCache.Keys)
                 * {
                 *  PlayerEventScoreProfile eventprofile = EventScores.EnsureProfile(player);
                 *  eventprofile.AddBattle(Name, (int) StatisticsCache[player].PointsGained, player);
                 * }*/

                foreach (BattleResultsGump g in
                         StatisticsCache.Keys.With(Spectators).Select(CreateResultsGump).Where(g => g != null))
                {
                    g.Send();
                }

                SendResultsToCameras();
            }

            if (GiveTrophies)
            {
                AwardTrophies();

                if (PlayerStarted)
                {
                    GiveTrophies = false;
                }
            }

            base.OnBattleEnded(when);

            Hidden = true;

            if (PlayerStarted)
            {
                //Hidden = !IgnoreCapacity && (Schedule == null || !Schedule.Enabled || !Schedule.Running);

                //Hidden will probably always be false anyways.  I cannot forsee a case where it will be playerstarted and not be hidden

                PlayerStarted = false;
            }

            if (ThrowableMode)
            {
                if (_Axes != null)
                {
                    foreach (KeyValuePair <PlayerMobile, ThrowableAxe> kvp in _Axes.Where(kvp => kvp.Value != null))
                    {
                        kvp.Value.Delete();
                    }
                    _Axes.Clear();
                }
            }

            ActionCams.ForceToNormalCams();
        }
Exemplo n.º 2
0
        protected override void OnBattleCancelled(DateTime when)
        {
            if (GiveTrophies && PlayerStarted)
            {
                GiveTrophies = false;
            }

            base.OnBattleCancelled(when);

            Hidden = true;

            if (PlayerStarted)
            {
                //Hidden = !IgnoreCapacity && (Schedule == null || !Schedule.Enabled || !Schedule.Running);

                PlayerStarted = false;
            }

            ActionCams.ForceToNormalCams();
        }