Esempio n. 1
0
        /// <summary>
        /// 进入战场后初始化怒气
        /// </summary>
        private void InitFightPower()
        {
            int nSelf_value = ObjectSelf.GetInstance().GetInitPowerValue();

            int nHero_value = 0;

            for (int i = 0; i < SceneObjectManager.GetInstance().GetObjectHeroCount(); i++)
            {
                ObjectHero pHero               = SceneObjectManager.GetInstance().GetHeroObject(i);
                int        nCurLevel           = pHero.GetHeroData().Level;
                int        nInitFuryTemplateID = pHero.GetHeroRow().getEntranceFury() - 1;

//                 HerofuryTemplate pRow = (HerofuryTemplate)DataTemplate.GetInstance().m_HeroFuryTable.getTableData(nCurLevel);
//                 if (nInitFuryTemplateID >= 0 && nInitFuryTemplateID < GlobalMembers.MAX_HEROFURY_PARAM_COUNT)
//                 {
//                     nHero_value += (int)((float)pRow.getTemplate()[nInitFuryTemplateID] * (1f + pHero.GetInitPowerAddition() + pHero.GetInitPowerAdditionRate()));
//                 }
                for (int n = 0; n < pHero.GetHeroData().HeroCabalaDB.CabalaList.Count; ++n)
                {
                    int        _tableID = pHero.GetHeroData().HeroCabalaDB.CabalaList[n].TableID;
                    MsTemplate _row     = (MsTemplate)DataTemplate.GetInstance().m_MsTable.getTableData(_tableID);
                    if (_row.getMstype() == 1)//开场怒气额外增加
                    {
                        int nLev = pHero.GetHeroData().HeroCabalaDB.CabalaList[n].IntensifyLev;
                        if (nLev <= 0)
                        {
                            continue;
                        }
                        nHero_value += _row.getValue()[nLev - 1];
                    }
                }
                //释放一次英雄的被动技能。此逻辑只需执行一次,且需要所有英雄都已实例化完成并添加到场景对象管理器中 [7/31/2015 Zmy]
                pHero.UpdateSpellEffectValue();
            }
            //主角等级影响 + 英雄等级影响 * (1 + 初始加成怒气) [3/3/2015 Zmy]
            //int nSum = nSelf_value + nHero_value;
            m_HeroPower.OnUpdatePowerValue(nHero_value);
        }