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; }
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")); }
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); } } }
public void AddSkillData(int sonId, ConfigRow rowData) { if (!_dicSkillDataSon.ContainsKey(sonId)) { _dicSkillDataSon.Add(sonId, new SkillDataSon(rowData, this)); } _dicSkillDataSon[sonId].AddSkillData(sonId, rowData); }
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"); }
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; }
public void AddRow(string rowKey, ConfigRow rowData) { try { rowData.SetColKeys(m_dicColKeys); m_Data.Add(rowKey, rowData); } catch (System.Exception e) { throw new System.Exception(string.Format("{0}.行名:{1}", e, rowKey)); } }
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; } } }
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; }
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); } }
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")); }
//处理技能类型 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); }
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")); }
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); }
//结构化配置表数据 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); } }
public void AddSkillData(int sonId, ConfigRow rowData) { SkillData skillData = new SkillData(sonId, rowData, this); _lstSkillData.Add(skillData); }
public static void ParseConfig(byte[] bConfig) { m_ConfigData.Clear(); EncryptTool.Decrypt(ref bConfig, 20); string sConfig = Decompress(bConfig); int valuePos = 0; int pos = 0; while (true) { pos = sConfig.IndexOf("------@", valuePos); if (-1 == pos) { break; } pos += 7; int nPos = sConfig.IndexOf('\n', pos); string cfgName = sConfig.Substring(pos, nPos - pos); try { ConfigTable cfgTbl = new ConfigTable(); m_ConfigData.Add(cfgName, cfgTbl); pos = nPos + 1; nPos = sConfig.IndexOf("\n", pos); bool bFlag = true; while (bFlag) { try { cfgTbl.AddColKey(GetNextValue(ref pos, ref nPos, ref bFlag, ref sConfig)); } catch (System.Exception e) { Debug.LogError(String.Format("{0} 表名:{1}", e, cfgName)); } } nPos = sConfig.IndexOf("\n", pos); bFlag = true; valuePos = nPos + 1; while (bFlag) { string rowName = GetNextValue(ref pos, ref nPos, ref bFlag, ref sConfig); int valueNPos = sConfig.IndexOf("\n", valuePos); bool valueFlag = true; int a = 0; ConfigRow rowData = new ConfigRow(); rowData.AddValue(rowName); while (valueFlag) { string value = GetNextValue(ref valuePos, ref valueNPos, ref valueFlag, ref sConfig); value = value.Replace("#r", "\n"); rowData.AddValue(value); ++a; } cfgTbl.AddRow(rowName, rowData); } } catch (System.Exception e) { Debug.LogError(string.Format("{0}.配置表名:{1}", e, cfgName)); } } }
public SkillDataWhole(int skillId, ConfigRow row) { SetLanData(skillId, row); SetData(skillId, row); }