Пример #1
0
        public void Cleanup()
        {
            if (Brazier1 != null)
            {
                Brazier1.Delete();
                Brazier1 = null;
            }

            if (Brazier2 != null)
            {
                Brazier2.Delete();
                Brazier2 = null;
            }

            if (Brazier3 != null)
            {
                Brazier3.Delete();
                Brazier3 = null;
            }

            if (Brazier4 != null)
            {
                Brazier4.Delete();
                Brazier4 = null;
            }

            FirstMaxTeam  = null;
            SecondMaxTeam = null;
        }
Пример #2
0
        protected override void OnBattleStarted(DateTime when)
        {
            base.OnBattleStarted(when);

            ToggleDoors(true);

            if (Crystal == null || Crystal.Deleted)
            {
                if (State != PvPBattleState.Running)
                {
                    if (Crystal != null && !Crystal.Deleted)
                    {
                        Crystal.Delete();
                    }

                    Crystal = null;
                    return;
                }

                Crystal         = Crystal != null && !Crystal.Deleted ? Crystal : new BoWCrystal(this);
                Crystal.Carrier = null;
                Crystal.Reset();
            }
            else
            {
                if (Crystal != null)
                {
                    Crystal.Delete();
                }

                Crystal = new BoWCrystal(this);
                Crystal.Reset();
            }

            //create new braziers
            if (Brazier1 != null || Brazier2 != null || Brazier3 != null || Brazier4 != null)
            {
                Cleanup();
            }

            Brazier1 = Brazier1 != null && !Brazier1.Deleted ? Brazier1 : new BoWBrazier(this);
            Brazier2 = Brazier2 != null && !Brazier2.Deleted ? Brazier2 : new BoWBrazier(this);
            Brazier3 = Brazier3 != null && !Brazier3.Deleted ? Brazier3 : new BoWBrazier(this);
            Brazier4 = Brazier4 != null && !Brazier4.Deleted ? Brazier4 : new BoWBrazier(this);

            //move them to locations
            Brazier1.MoveToWorld(Brazier1Loc, Map);
            Brazier2.MoveToWorld(Brazier2Loc, Map);
            Brazier3.MoveToWorld(Brazier3Loc, Map);
            Brazier4.MoveToWorld(Brazier4Loc, Map);

            if (WinGate != null)
            {
                WinGate.Delete();
            }
        }