Exemple #1
0
        public bool UpdateCoolDown(bool bForce = false)
        {
            LogManager.LogAssert(m_pHolder);
            if (bForce)
            {
                CoolDownList pCoolDown = m_pHolder.GetCoolDownList();
                LogManager.LogAssert(pCoolDown);
                pCoolDown.ResetCommonCD((uint)DataTemplate.GetInstance().m_GameConfig.getPersonPublicCD());
                if (m_pSpellInfo.GetInterruptCooldownTime() > 0)
                {
                    return(true);
                }

                bool bRet = pCoolDown.AddElement(m_pSpellInfo.GetSpellID(), m_pSpellInfo.GetInterruptCooldownTime());
                if (!bRet)
                {
                    LogManager.LogAssert(0);
                }
            }
            CoolDownList _pCoolDown = m_pHolder.GetCoolDownList();

            LogManager.LogAssert(_pCoolDown);
            _pCoolDown.ResetCommonCD((uint)DataTemplate.GetInstance().m_GameConfig.getPersonPublicCD());
            if (m_pSpellInfo.GetCoolDownTime() > 0)
            {
                return(true);
            }

            bool _bRet = _pCoolDown.AddElement(m_pSpellInfo.GetSpellID(), m_pSpellInfo.GetCoolDownTime());

            if (!_bRet)
            {
                LogManager.LogAssert(0);
            }

            return(true);
        }