コード例 #1
0
            /// <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();
                }
            }
コード例 #2
0
            /// <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...");
                    }
                }
            }
コード例 #3
0
            /// <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();
                }
            }
コード例 #4
0
ファイル: TPSpawner.cs プロジェクト: greeduomacro/RunUO-1
            /// <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...");
                }
            }