Beispiel #1
0
        // 初始化csv表
        protected void InitHeroTalentConfigPageCsv(string stPath)
        {
            ScpReader reader = new ScpReader(stPath, true, 2);

            allHeroTalentConfigPageTable = new Hashtable();
            int nIndex = 0;

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeHeroTalentConfig sConfig = new SSchemeHeroTalentConfig();
                sConfig.nHeroId                   = reader.GetInt(i, (int)HeroTalentConfig.EMT_HEROID, 0);
                sConfig.nTalentId                 = reader.GetInt(i, (int)HeroTalentConfig.EMT_TALENTID, 0);
                sConfig.nLevelLimit               = reader.GetInt(i, (int)HeroTalentConfig.EMT_LEVELPLIMIT, 0);
                sConfig.nTalentIconId             = reader.GetInt(i, (int)HeroTalentConfig.EMT_TALENTICONID, 0);
                sConfig.nRecommandShow            = reader.GetInt(i, (int)HeroTalentConfig.EMT_RECOMMAND_SHOW, 0);
                sConfig.nActiveType               = reader.GetInt(i, (int)HeroTalentConfig.EMT_ACTIVETYPE, 0);
                sConfig.nActiveStarLv             = reader.GetInt(i, (int)HeroTalentConfig.EMT_ACTIVESTARLEVEL, 0);
                sConfig.nOnlyActive               = reader.GetInt(i, (int)HeroTalentConfig.EMT_ONLYACTIVE, 0);
                sConfig.nShowType                 = reader.GetInt(i, (int)HeroTalentConfig.EMT_SHOWTYPE, 0);
                sConfig.nSlotId                   = reader.GetInt(i, (int)HeroTalentConfig.EMT_SLOTID, 0);
                sConfig.sTalentName               = reader.GetString(i, (int)HeroTalentConfig.EMT_TALENTNAME, "");
                sConfig.sTalentPrizeName          = reader.GetString(i, (int)HeroTalentConfig.EMT_TALENTPRIZENAME, "");
                sConfig.sTalenActiveDescInStatic  = reader.GetString(i, (int)HeroTalentConfig.EMT_TALENTACTIVEDESC, "");
                sConfig.sTalenDisableDescInStatic = reader.GetString(i, (int)HeroTalentConfig.EMT_TALENTDISABLEDESC, "");
                sConfig.sTalenDescInWar           = reader.GetString(i, (int)HeroTalentConfig.EMT_TALENTDESCINWAR, "");
                sConfig.nTalentTermId             = reader.GetInt(i, (int)HeroTalentConfig.EMT_TALENTTERMID, 0);

                if (sConfig.sTalenDisableDescInStatic == String.Empty)
                {
                    string str = String.Format(ULocalizationService.Instance.Get("UIView", "TalentView", "TalentUnActiveDesc"), sConfig.nActiveStarLv);
                    sConfig.sTalenDisableDescInStatic = sConfig.sTalenActiveDescInStatic + str;
                }

                if (sConfig.nActiveType == 0 && sConfig.nActiveStarLv == 0)
                {
                    string str = ULocalizationService.Instance.Get("UIView", "TalentView", "TalentUnActiveDescEx");
                    sConfig.sTalenDisableDescInStatic = sConfig.sTalenActiveDescInStatic + str;
                }

                if (allHeroTalentConfigPageTable.ContainsKey(sConfig.nHeroId))
                {
                    HeroDicTalentConfig dicConig = allHeroTalentConfigPageTable[sConfig.nHeroId] as HeroDicTalentConfig;
                    dicConig.dicTalentConfig[sConfig.nTalentId] = sConfig;
                }
                else
                {
                    HeroDicTalentConfig dicConig = new HeroDicTalentConfig();
                    dicConig.dicTalentConfig[sConfig.nTalentId]   = sConfig;
                    allHeroTalentConfigPageTable[sConfig.nHeroId] = dicConig;
                }

                if (m_MaxStarActiveLv < sConfig.nActiveStarLv)
                {
                    m_MaxStarActiveLv = sConfig.nActiveStarLv;
                }
            }
        }
Beispiel #2
0
        public HeroDicTalentConfig GetHeroTalentDicConfig(int nHeroId)
        {
            if (allHeroTalentConfigPageTable == null || !allHeroTalentConfigPageTable.ContainsKey(nHeroId))
            {
                return(null);
            }

            HeroDicTalentConfig dicConig = allHeroTalentConfigPageTable[nHeroId] as HeroDicTalentConfig;

            return(dicConig);
        }
Beispiel #3
0
        // 返回英雄升星等级奖励的天赋列表
        public List <SSchemeHeroTalentConfig> getHeroStarPrizeTalent(int nHeroID, int nLevel)
        {
            List <SSchemeHeroTalentConfig> result = new List <SSchemeHeroTalentConfig>();

            HeroDicTalentConfig dicConig = allHeroTalentConfigPageTable[nHeroID] as HeroDicTalentConfig;

            foreach (var item in dicConig.dicTalentConfig)
            {
                if (item.Value.nActiveStarLv == nLevel && item.Value.nActiveType == (int)TalentActiveType.ETAT_DefualtActive)
                {
                    result.Add(item.Value);
                }
            }

            return(result);
        }
Beispiel #4
0
        public SSchemeHeroTalentConfig GetHeroTalentConfig(int nHeroId, int nTalentId)
        {
            if (allHeroTalentConfigPageTable == null || !allHeroTalentConfigPageTable.ContainsKey(nHeroId))
            {
                return(null);
            }

            HeroDicTalentConfig dicConig = allHeroTalentConfigPageTable[nHeroId] as HeroDicTalentConfig;

            if (!dicConig.dicTalentConfig.ContainsKey(nTalentId))
            {
                return(null);
            }

            return(dicConig.dicTalentConfig[nTalentId]);
        }