public DamageData(string damage_id, SysSkillDamageVo damage_vo) { if (damage_vo == null) { Debug.LogError("Error damage_id=" + damage_id); return; } this.config = damage_vo; this.damageId = this.config.damage_id; this.Parse(this.config); }
public DamageData(string damage_id) { this.config = BaseDataMgr.instance.GetDataById <SysSkillDamageVo>(damage_id); this.damageId = this.config.damage_id; if (this.config == null) { Debug.LogError("Error damageId=" + this.damageId); return; } this.Parse(this.config); }
public void Parse(SysSkillDamageVo damage_vo) { if (damage_vo == null) { return; } try { if (StringUtils.CheckValid(damage_vo.formula)) { string[] array = StringUtils.SplitVoString(damage_vo.formula, "|"); this.damageCalType = int.Parse(array[0]); this.damageParam1 = ((array.Length <= 1) ? 0f : float.Parse(array[1])); this.damageParam2 = ((array.Length <= 2) ? 0f : float.Parse(array[2])); this.damageParam3 = ((array.Length <= 3) ? 0f : float.Parse(array[3])); this.damageParam4 = ((array.Length <= 4) ? 0f : float.Parse(array[4])); this.damageParam5 = ((array.Length <= 5) ? 0f : float.Parse(array[5])); this.damageParam6 = ((array.Length <= 6) ? 0f : float.Parse(array[6])); } if (StringUtils.CheckValid(damage_vo.effectGain)) { string[] stringValue = StringUtils.GetStringValue(damage_vo.effectGain, '|'); if (stringValue.Length > 0) { this.DataType.MagicType = (EffectMagicType)int.Parse(stringValue[0]); } if (stringValue.Length > 1) { this.DataType.GainType = (EffectGainType)int.Parse(stringValue[1]); } if (stringValue.Length > 2) { this.DataType.ImmuneType = (EffectImmuneType)int.Parse(stringValue[2]); } } } catch (Exception ex) { Debug.LogError(string.Concat(new object[] { " ==> DamageVo Parse Error : ", damage_vo.damage_id, " ", ex.Message })); } }
private string DamageValueReturn(string ID) { if (string.IsNullOrEmpty(ID)) { return(string.Empty); } string text = string.Empty; string[] array = new string[0]; SysSkillDamageVo dataById = BaseDataMgr.instance.GetDataById <SysSkillDamageVo>(ID); array = dataById.formula.Split(new char[] { '|' }); if (array.Length >= 3) { if (array[0].CompareTo("4") == 0) { if (array.Length > 3) { if (array[3].CompareTo("1") == 0) { text = float.Parse(array[2]).ToString("P0"); text = text.Replace(" ", string.Empty); } } else { text = array[2]; } } else { text = array[3]; } } return(text.TrimStart(new char[] { '-' })); }
private string CheckMana(string costID) { if (costID.CompareTo("[]") == 0 || string.IsNullOrEmpty(costID)) { Singleton <TipView> .Instance.ShowViewSetText(this.heroNPC + "下的levelup表或skillmain中的‘damage’字段为空!!!", 1f); return(string.Empty); } string result = string.Empty; SysSkillDamageVo dataById = BaseDataMgr.instance.GetDataById <SysSkillDamageVo>(costID); string[] array = new string[0]; array = dataById.formula.Split(new char[] { '|' }); if (array.Length > 2) { result = array[2]; } return(result); }
private int CheckType(string costID) { if (costID.CompareTo("[]") == 0 || string.IsNullOrEmpty(costID)) { return(0); } int result = 0; SysSkillDamageVo dataById = BaseDataMgr.instance.GetDataById <SysSkillDamageVo>(costID); string[] array = new string[0]; array = dataById.formula.Split(new char[] { '|' }); if (array.Length > 1) { int num = int.Parse(array[0]); if ((num == 2 || num == 3 || num == 21 || num == 25 || num == 28) && array.Length > 4) { result = int.Parse(array[4]); } } return(result); }
public void ParseTables() { if (!this.isParseTable) { Dictionary <string, object> dicByType = BaseDataMgr.instance.GetDicByType <SysSkillDamageVo>(); if (dicByType == null) { Debug.LogError("==> SysSkillDamageVo is NULL !!"); return; } this.isParseTable = true; this._dataVos.Clear(); Dictionary <string, object> .Enumerator enumerator = dicByType.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <string, object> current = enumerator.Current; string key = current.Key; KeyValuePair <string, object> current2 = enumerator.Current; SysSkillDamageVo damage_vo = current2.Value as SysSkillDamageVo; DamageData value = new DamageData(key, damage_vo); this._dataVos.Add(int.Parse(key), value); } } }