/// <summary> /// Action to be taken upon each tick of the timer /// </summary> protected override void OnTick() { if (DateTime.Now > m_EndTime) { foreach (Mobile m in m_Spawner.GetMobilesInRange(m_Spawner.PlayerRange)) { m.SendMessage("The enemy is upon you!"); } m_Spawner.Spawn(); Stop(); } }
/// <summary> /// Constructor /// </summary> /// <param name="delay">Amount of time for recuperating</param> /// <param name="spawner">TPSpawner tied this timer is tied to</param> public RecupeTimer(TimeSpan delay, TPSpawner spawner) : base(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1)) { m_EndTime = DateTime.Now + delay; m_Spawner = spawner; foreach (Mobile m in m_Spawner.GetMobilesInRange(m_Spawner.PlayerRange)) { if (m_Spawner.CurrentLevel == m_Spawner.LevelAmt) { m.SendMessage("The enemy is preparing its final attack..."); } else { m.SendMessage("The enemy is gathering strength..."); } } }
/// <summary> /// Action to be taken upon each tick of the timer /// </summary> protected override void OnTick() { if (DateTime.Now > m_EndTime) { if (!m_Spawner.SuccessfulWave()) { m_Spawner.SpawnStarted = false; m_Spawner.RechargeDelay = DateTime.Now + m_Spawner.RechargeTime; foreach (Mobile m in m_Spawner.GetMobilesInRange(m_Spawner.PlayerRange)) { m.SendMessage("The enemy has abandoned the fight and has closed the strange portal."); } m_Spawner.Visible = false; } Stop(); } }
/// <summary> /// Constructor /// </summary> /// <param name="delay">Amount of time for recuperating</param> /// <param name="spawner">TPSpawner tied this timer is tied to</param> public RecupeTimer(TimeSpan delay, TPSpawner spawner) : base(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1)) { m_EndTime = DateTime.Now + delay; m_Spawner = spawner; foreach (Mobile m in m_Spawner.GetMobilesInRange(m_Spawner.PlayerRange)) { if (m_Spawner.CurrentLevel == m_Spawner.LevelAmt) m.SendMessage("The enemy is preparing its final attack..."); else m.SendMessage("The enemy is gathering strength..."); } }