Exemple #1
0
        protected override void OnMicroSync()
        {
            base.OnMicroSync();

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

            if (Battle == null || Battle.Deleted || Battle.State == PvPBattleState.Internal || Battle.Hidden)
            {
                Flag.Delete();
                Flag = null;
                return;
            }

            Flag.InvalidateCarrier();

            if (Flag.IsAtPodium())
            {
                return;
            }

            Flag.UpdateDamageIncrease();
            Flag.CheckReset();
        }
Exemple #2
0
        public override void Reset()
        {
            base.Reset();

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

            if (Attackers != null)
            {
                Attackers.Clear();
            }
            else
            {
                Attackers = new Dictionary <PlayerMobile, int>();
            }

            if (Defenders != null)
            {
                Defenders.Clear();
            }
            else
            {
                Defenders = new Dictionary <PlayerMobile, int>();
            }

            Caps = 0;
        }
Exemple #3
0
 // This callback is called when the flag is not retrieved for a period of time.
 private void OnFlagIsNotRetrievedPeriodOfTime(object sender, EventArgs e)
 {
     Flag.Delete();
     Flag.Create();
     Flag.IsPositionBase = true;
     PickupInfo.Dispose();
     BasePlayer.SendClientMessageToAll($"{OtherColor}[Auto-Return]: La bandera {NameColor} regresó a su posición inicial.");
 }
Exemple #4
0
        protected override void OnDeleted()
        {
            if (Flag != null)
            {
                Flag.Delete();
                Flag = null;
            }

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

            base.OnDeleted();
        }
Exemple #5
0
        public virtual void SpawnFlag()
        {
            if (Battle.State != PvPBattleState.Running)
            {
                if (Flag != null && !Flag.Deleted)
                {
                    Flag.Delete();
                }

                Flag = null;
                return;
            }

            Flag         = Flag != null && !Flag.Deleted ? Flag : new CTFFlag(this);
            Flag.Carrier = null;
            Flag.Reset();
        }