コード例 #1
0
ファイル: DungeonEffect.cs プロジェクト: Nikolai-415/dungeon
        /// <summary>Активирует эффект</summary>
        public void TurnEffectOn()
        {
            if (!m_is_active)
            {
                if (m_creature != null)
                {
                    m_creature.AddEffect(this);
                    if (m_duration != -1)
                    {
                        m_usage_time = m_duration * 1000; // ms
                        m_timer_usage.Start();
                        m_timer_usage_is_working = true;
                    }
                    m_is_active = true;

                    m_creature.DungeonLevel.Form.CalculateInterfaceHeroActivePotions();
                }
                else
                {
                    throw new Exception("Владелец эффекта не задан");
                }
            }
        }