示例#1
0
        public void NormalBattleSaveCurSpawn(string playerId, int curSpawn)
        {
            string filePath = string.Format("{0}/NormalBattle", playerId);

            ES3.Save <int>("CurSpawn", curSpawn, filePath);
            SyncCurSpawn(curSpawn);
            NormalBattleSaveCurWave(playerId, 0);

            filePath = string.Format("{0}/NormalBattle", playerId);
            if (curSpawn > ES3.Load <int>("HighestSpawn", filePath))
            {
                ES3.Save <int>("HighestSpawn", curSpawn, filePath);
                ConfigTable tbl = ConfigData.GetValue("NormalTask_Client");
                if (tbl.m_Data.ContainsKey(curSpawn.ToString()))
                {
                    ConfigRow row = tbl.GetRow(curSpawn.ToString());
                    switch (row.GetValue("Type"))
                    {
                    case "1":
                    {
                        int heroId = int.Parse(row.GetValue("Value"));
                        AddHero(playerId, heroId);
                        SyncHero(playerId, heroId);

                        break;
                    }
                    }
                    SyncBattleTask(curSpawn);
                }
            }
        }
        private static void SetMonsterData(CharHandler charHandler)
        {
            int lv = SpawnHandler.GetInst().CurSpawnIndex * 10 + SpawnHandler.GetInst().CurWave;

            CharData charData = charHandler.m_CharData;

            charData.m_eSide = BattleEnum.Enum_CharSide.Enemy;
            charData.m_eType = BattleEnum.Enum_CharType.Monster;

            ConfigRow monsterInfo = ConfigData.GetValue("Monster_Client", charData.m_iCharID.ToString());

            charData.m_fAtkX       = float.Parse(monsterInfo.GetValue("AttackX"));
            charData.m_fAtkRange   = float.Parse(monsterInfo.GetValue("AtkRange"));
            charData.m_fBodyRange  = float.Parse(monsterInfo.GetValue("BodyRange"));
            charData.m_fMoveSpeed  = float.Parse(monsterInfo.GetValue("MoveSpeed"));
            charData.CurAttack     = float.Parse(monsterInfo.GetValue("Attack")) * (1 + 0.2f * lv);
            charData.OriAtk        = charData.CurAttack;
            charData.CurDefence    = float.Parse(monsterInfo.GetValue("Defence")) * (1 + 0.2f * lv);
            charData.OriDef        = charData.CurDefence;
            charData.CriticalRatio = float.Parse(monsterInfo.GetValue("CriticalRatio"));
            charData.BlockRatio    = float.Parse(monsterInfo.GetValue("BlockRatio"));
            charData.MaxHP         = float.Parse(monsterInfo.GetValue("Hp")) * (1 + 0.2f * lv);
            charData.CurHP         = charData.MaxHP;
            charData.OriHP         = charData.MaxHP;
            charData.CurStar       = BattleManager.GetInst().m_iEnemyPlayerLevel;

            charHandler.m_CharDefence.m_fBackwardClock = 0;
        }
示例#3
0
        private void SetLanData(int skillId, ConfigRow row)
        {
            ConfigRow LanguageRow  = ConfigData.GetValue("Lan_Skill_Client", skillId.ToString());
            string    sDisplayName = LanguageRow.GetValue("DisplayName");

            m_sDisplayName = sDisplayName;
            m_sExplain     = LanguageRow.GetValue("Explain");
            m_sExplain2    = LanguageRow.GetValue("Explain2");
            m_sNote        = LanguageRow.GetValue("Note");
            m_sType        = LanguageRow.GetValue("SkillTypeName");
        }
        public void Show(int taskId)
        {
            ConfigRow row = ConfigData.GetValue("NormalTask_Client", taskId.ToString());

            switch (row.GetValue("Type"))
            {
            case "1":
            {
                ShowHero(int.Parse(row.GetValue("Value")));
                break;
            }
            }
        }
示例#5
0
 public void ResetInfo(ConfigRow row)
 {
     m_lstCharID.Clear();
     m_lstCharCount.Clear();
     string[] ids   = row.GetValue("CharID").Split('|');
     string[] count = row.GetValue("CharCount").Split('|');
     for (int i = 0; i < ids.Length; ++i)
     {
         string[] v1 = ids[i].Split(',');
         m_lstCharID.Add(v1);
         string[] v2 = count[i].Split(',');
         m_lstCharCount.Add(v2);
     }
     TotalWaves = ids.Length;
 }
示例#6
0
        public SkillEnum.SkillSonType m_eSkillSonType;                  //子技能类型


        public SkillData(int sonSkillId, ConfigRow rowData, SkillDataSon parent)
        {
            m_Parent      = parent;
            m_iSonSkillID = sonSkillId;
            HandleSkillType(rowData);
            SetEffectExpress(rowData.GetValue("EffectExpress"));
        }
示例#7
0
        private void SetData(int skillId, ConfigRow rowData)
        {
            m_iSkillID    = skillId;
            m_iSkillIndex = skillId % 100;
            m_sIcon       = string.Format("SkillIcon{0}", m_iSkillIndex < 4 ? skillId : m_iSkillIndex);
            m_iActionID   = rowData.GetValue("ActionID").Equals(String.Empty) ? -1 : int.Parse(rowData.GetValue("ActionID"));
            m_sEffectRate = rowData.GetValue("RateExpress");
            m_sEffectRate = m_sEffectRate.Equals(string.Empty) ? "1" : m_sEffectRate;

            string[] arrUpExpress = rowData.GetValue("UpExpress").Split('|');
            m_sUpExpress    = arrUpExpress[0];
            m_fUpExpressMax = arrUpExpress.Length > 1 ? float.Parse(arrUpExpress[1]) : 0.0f;

            m_bHitBackward = "1" == rowData.GetValue("Backward");
            m_sBulletPath  = ConfigData.GetValue("SkillEffect_Client", skillId.ToString(), "BulletPath");

            SetSkillKind(rowData.GetValue("Condition"));
        }
示例#8
0
 private void SetConfigInfo()
 {
     _heroRow     = ConfigData.GetValue("Hero_Common", m_iCharID.ToString());
     m_fAtkRange  = float.Parse(_heroRow.GetValue("AttackRange"));
     m_fBodyRange = float.Parse(_heroRow.GetValue("BodyRange"));
     m_fMoveSpeed = float.Parse(_heroRow.GetValue("RunSpeed"));
     m_fAtkRadian = float.Parse(_heroRow.GetValue("AttackRad"));
     m_iAtkCount  = int.Parse(_heroRow.GetValue("AttackCount"));
     m_fAtkX      = float.Parse(_heroRow.GetValue("AttackX"));
     m_sHeroName  = _heroRow.GetValue("HeroName");
     m_eAtkType   = "0" == _heroRow.GetValue("AttackType") ? BattleEnum.Enum_AttackType.Close : BattleEnum.Enum_AttackType.Distant;
 }
示例#9
0
        //结构化配置表数据
        private void FormatSkillCommon()
        {
            ConfigTable _skillCommonCfg = ConfigData.GetValue("Skill_Common");

            foreach (KeyValuePair <string, ConfigRow> pair in _skillCommonCfg.m_Data)
            {
                if (pair.Key.Trim().Length == 0)
                {
                    continue;
                }

                ConfigRow rowData  = pair.Value;
                int       iSkillID = int.Parse(rowData.GetValue("SkillID"));
                int       iSonID   = int.Parse(rowData.GetValue("SonSkillID"));

                if (!_dicSkill.ContainsKey(iSkillID))
                {
                    _dicSkill.Add(iSkillID, new SkillDataWhole(iSkillID, rowData));
                }

                _dicSkill[iSkillID].AddSkillData(iSonID, rowData);
            }
        }
示例#10
0
        public void SetSpawnInfo(int curSpawnIndex)
        {
            CurSpawnIndex = curSpawnIndex;
            ConfigRow row = ConfigData.GetValue("NormalScene_Client", curSpawnIndex.ToString());

            if (row == null)
            {
                CurSpawnId = -1;
            }
            else
            {
                CurSpawnId = int.Parse(row.GetValue("SpawnId"));
                Spawns[CurSpawnId].ResetInfo(row);
            }
        }
示例#11
0
        //处理技能类型
        private void HandleSkillType(ConfigRow rowData)
        {
            string hurtType = rowData.GetValue("HurtType");

            if (hurtType.IndexOf("Add") > -1)
            {
                hurtType        = hurtType.Replace("Add", "");
                m_iHurtTypeSign = 1;
            }
            else if (hurtType.IndexOf("Reduce") > -1)
            {
                hurtType        = hurtType.Replace("Reduce", "");
                m_iHurtTypeSign = -1;
            }

            m_eSkillSonType = (SkillEnum.SkillSonType)Enum.Parse(typeof(SkillEnum.SkillSonType), hurtType);
        }
示例#12
0
        public SkillDataSon(ConfigRow rowData, SkillDataWhole parent)
        {
            m_Parent   = parent;
            m_bDeliver = false;
            string sSkillType = rowData.GetValue("SkillType");

            m_eSkillType = string.Empty == sSkillType ? SkillEnum.SkillType.Property : (SkillEnum.SkillType)Enum.Parse(typeof(SkillEnum.SkillType), sSkillType);
            string[] temp = rowData.GetValue("Camp_AimType").Split('_');
            m_eAimSide     = (SkillEnum.AimSide)Enum.Parse(typeof(SkillEnum.AimSide), temp[0]);
            m_eAimSideType = (SkillEnum.AimSideType)Enum.Parse(typeof(SkillEnum.AimSideType), temp[1]);
            m_eCatchType   = rowData.GetValue("CatchType").Length > 0 ? (SkillEnum.CatchType)Enum.Parse(typeof(SkillEnum.CatchType), rowData.GetValue("CatchType")) : SkillEnum.CatchType.All;

            SetCatchScope(rowData.GetValue("CatchScope"));
            SetBuffTime(rowData.GetValue("EffectExpress"));
            SetReceptorEffect(rowData.GetValue("ReceptorEffect"));
        }
示例#13
0
        public void AddHero(string playerId, int heroId)
        {
            ConfigRow row      = ConfigData.GetValue("Hero_Common", heroId.ToString());
            string    filePath = string.Format("{0}/HeroInfo/{1}", playerId, heroId);

            ES3.Save <int>("ID", heroId, filePath);
            ES3.Save <int>("Star", 0, filePath);
            ES3.Save <int>("MaxPower", int.Parse(row.GetValue("MaxPower")), filePath);
            ES3.Save <float>("Attack", float.Parse(row.GetValue("Attack")), filePath);
            ES3.Save <float>("Defence", float.Parse(row.GetValue("Defence")), filePath);
            ES3.Save <float>("HP", float.Parse(row.GetValue("Hp")), filePath);
            ES3.Save <float>("CriticalRatio", float.Parse(row.GetValue("BlockRatio")), filePath);
            ES3.Save <float>("BlockRatio", float.Parse(row.GetValue("BlockRatio")), filePath);
            ES3.Save <float>("Force", float.Parse(row.GetValue("Force")), filePath);
            ES3.Save <float>("Strategy", float.Parse(row.GetValue("Strategy")), filePath);
            ES3.Save <float>("Rule", float.Parse(row.GetValue("Rule")), filePath);
            ES3.Save <float>("Polity", float.Parse(row.GetValue("Polity")), filePath);
            ES3.Save <float>("Charm", float.Parse(row.GetValue("Charm")), filePath);
        }