/// <summary> /// 获取设置状态 /// </summary> public static void SetSkillStatus(ref List <SkillStatusInfo> lstatus, string strStatus) { if (lstatus == null) { lstatus = new List <SkillStatusInfo>(); } if (string.IsNullOrEmpty(strStatus) == true || strStatus == "0") { return; } int length = NdUtil.GetLength(strStatus); for (int i = 0; i < length; ++i) { int statusid = NdUtil.GetIntValue(strStatus, i); s_statusInfo stainfo = GetSkillStatus(statusid); if (stainfo != null) { SkillStatusInfo ss = new SkillStatusInfo(); if (SetSkillStatus(stainfo, ref ss) == true) { lstatus.Add(ss); } } } }
/// <summary> /// 确认是否为初始品阶 /// </summary> public static bool CheckStartQuality(int Quality) { List <int> l = new List <int>(); string value = GetParaStr(24, 1); if (string.IsNullOrEmpty(value) == true) { return(false); } int length = NdUtil.GetLength(value); for (int i = 0; i < length; i++) { l.Add(NdUtil.GetIntValue(value, i)); } if (l[0] == Quality) { return(true); } else { return(false); } }
/// <summary> /// 获取下一个品阶 /// </summary> public static int GetNextQuality(int Quality) { List <int> l = new List <int>(); string value = GetParaStr(24, 1); if (string.IsNullOrEmpty(value) == true) { return(10); } int length = NdUtil.GetLength(value); for (int i = 0; i < length; i++) { l.Add(NdUtil.GetIntValue(value, i)); } for (int i = 0; i < l.Count; i++) { if (l[i] == Quality) { if (i == l.Count - 1) { return(l[l.Count - 1]); } else { return(l[i + 1]); } } } return(0); }
private void SetParam() { m_lParam.Clear(); List <int> l = new List <int>(); if (string.IsNullOrEmpty(m_param) == true) { return; } if (m_param != null) { int length = NdUtil.GetLength(m_param); for (int i = 0; i < length; i++) { l.Add(NdUtil.GetIntValue(m_param, i)); } } //m_shape 0表示无需触发,只需cd状态到后可触发。1=目标攻击,2=圆形攻击,3=环形攻击,4=矩形攻击,5=目标范围圆形攻击 if (m_shape == 1 || m_shape == 5) { if (l.Count == 1) { m_lParam.Add(l[0] * MapGrid.m_width / MapGrid.m_Pixel); } } //按圆形 else if (m_shape == 2) { if (l.Count == 3) { m_lParam.Add(l[0] * 1.0f); m_lParam.Add(l[1] * 1.0f); m_lParam.Add(l[2] * MapGrid.m_width / MapGrid.m_Pixel); } } //按环形 else if (m_shape == 3) { if (l.Count == 4) { m_lParam.Add(l[0] * 1.0f); m_lParam.Add(l[1] * 1.0f); m_lParam.Add(l[2] * MapGrid.m_width / MapGrid.m_Pixel); m_lParam.Add(l[3] * MapGrid.m_width / MapGrid.m_Pixel); } } //按矩形 else if (m_shape == 4) { if (l.Count == 2) { m_lParam.Add(l[0] * MapGrid.m_width / MapGrid.m_Pixel); m_lParam.Add(l[1] * MapGrid.m_width / MapGrid.m_Pixel); } } }
/// <summary> /// 设置状态 /// </summary> private static bool SetSkillStatus(s_statusInfo stainfo, ref SkillStatusInfo Info) { if (stainfo == null || Info == null) { return(false); } Info.m_persistence = stainfo.persistence; Info.m_id = stainfo.id; Info.m_name = stainfo.name; Info.m_type = stainfo.type; if (string.IsNullOrEmpty(stainfo.effect) == false && stainfo.effect != "0") { int length = NdUtil.GetLength(stainfo.effect); for (int i = 0; i < length; ++i) { Info.m_effect.Add(NdUtil.GetIntValue(stainfo.effect, i)); } } Info.m_effectlevel = stainfo.effectlevel; Info.m_time = stainfo.time; Info.m_timeinterval = stainfo.timeinterval; Info.m_effectid = stainfo.effectid; Info.m_condition = stainfo.condition; Info.m_position = stainfo.position; Info.m_data0 = stainfo.data0; Info.m_data1 = stainfo.data1; Info.m_skill1type = stainfo.skill1type; Info.m_level1 = stainfo.level1; Info.m_skill2type = stainfo.skill2type; Info.m_level2 = stainfo.level2; Info.m_bufftype = stainfo.bufftype; s_statusreplaceInfo replace = GetSkillStatusReplace(Info.m_type, Info.m_effect.Count > 0 ? Info.m_effect[0] : 0, Info.m_bufftype); if (replace != null) { Info.m_RelpaceInfo = new SkillStatusReplaceInfo(); Info.m_RelpaceInfo.m_id = replace.id; Info.m_RelpaceInfo.m_statustype = replace.statustype; Info.m_RelpaceInfo.m_effect = replace.effect; Info.m_RelpaceInfo.m_name = replace.name; Info.m_RelpaceInfo.m_type = replace.type; Info.m_RelpaceInfo.m_compatible = replace.compatible; Info.m_RelpaceInfo.m_reppriority = replace.reppriority; Info.m_RelpaceInfo.m_spepriority = replace.spepriority; Info.m_RelpaceInfo.m_bufftype = replace.bufftype; Info.m_RelpaceInfo.m_isaction = replace.isaction; } else { Debug.Log("xxxx " + Info.m_name); } return(true); }
//获取雷达消耗 public static int GetRadarDiamond(int times) { string value = GetParaStr(23, 1); int length = NdUtil.GetLength(value); if (times < length) { return(NdUtil.GetIntValue(value, times)); } else { return(NdUtil.GetIntValue(value, length - 1)); } }
/// <summary> /// 获取商店在第n次刷新所消耗的代币量 /// </summary> public static int GetShopRefreshCost(int shopType, int times) { s_shop_manual_refreshInfo info = GetShopManualRefresh(shopType); if (info != null) { string costStr = info.cost; int costCount = NdUtil.GetLength(costStr); if (times >= costCount) { times = costCount - 1; } return(NdUtil.GetIntValue(costStr, times)); } return(-1); }
/// <summary> /// 购买10个技能点费用(钻石) /// </summary> /// <param name="time">第几次购买</param> public static int GetBuyResumeSkill(int time) { string value = GetParaStr(27, 1); if (string.IsNullOrEmpty(value) == true) { return(0); } int length = NdUtil.GetLength(value); if (time >= length) { time = length - 1; } return(GetParaStrToInt(27, 1, time)); }
/// <summary> /// 金银岛金库等级加成. /// </summary> /// <returns>The treasure vault grow.</returns> /// <param name="VaultLevel">Vault level.</param> public static int GetTreasureVaultGrow(int VaultLevel) { string value = GetParaStr(37, 1); if (string.IsNullOrEmpty(value) == true) { return(0); } int length = NdUtil.GetLength(value); if (VaultLevel <= length && VaultLevel > 0) { return(NdUtil.GetIntValue(value, VaultLevel - 1)); } return(NdUtil.GetIntValue(value, length - 1)); }
/// <summary> /// 获取技能开启的阶数 /// </summary> public static int GetEnableSkillQuatlity(int index) { string value = GetParaStr(28, 1); if (string.IsNullOrEmpty(value) == true) { return(0); } int length = NdUtil.GetLength(value); if (index <= length && index > 0) { return(NdUtil.GetIntValue(value, index - 1)); } return(10); }
/// <summary> /// 获取所有的阶 /// </summary> public static List <int> GetQualityList() { List <int> l = new List <int>(); string value = GetParaStr(24, 1); if (string.IsNullOrEmpty(value) == true) { return(l); } int length = NdUtil.GetLength(value); for (int i = 0; i < length; i++) { l.Add(NdUtil.GetIntValue(value, i)); } return(l); }
/// <summary> /// 设置技能属性 /// </summary> private static void SetSkillAttributeType(ref AttributeType SkillType, string StrValue) { SkillType = AttributeType.NONE; if (string.IsNullOrEmpty(StrValue) == true) { SkillType = AttributeType.NONE; } else { int length = NdUtil.GetLength(StrValue); for (int i = 0; i < length; i++) { int value = NdUtil.GetIntValue(StrValue, i); AttributeType type = GetBuildAttributeType(value); SkillType = SkillType | type; } } }
public static void GetGodSkill(int type, int level, int star, ref GodSkillInfo info) { GetGodSkill(type, level, ref info); foreach (sdata.s_godskillstarInfo gs in m_lGodSkillStar) { if (gs.godskilltype == type && gs.godskillstar == star) { info.m_needbook = gs.needbook; info.m_needbooknum = gs.needbooknum; info.m_stardescription = gs.description; SetGrowData(gs.growtype0, gs.grownum0, ref info); SetGrowData(gs.growtype1, gs.grownum1, ref info); SetGrowData(gs.growtype2, gs.grownum2, ref info); int lentime = NdUtil.GetLength(gs.statustime); int lentype = NdUtil.GetLength(gs.statustype); for (int i = 0; i < info.m_own_status_info.Count; i++) { if (gs.statustime != "" && i < lentime) { info.m_own_status_info[i].m_time += NdUtil.GetIntValue(gs.statustime, i); } if (info.m_own_status_info[i].m_effect.Count > 1 && gs.statustype != "") { for (int j = 0; j < info.m_own_status_info[i].m_effect.Count; j += 2) { for (int k = 0; k < lentype; k++) { if (NdUtil.GetIntValue(gs.statustype, i) == info.m_own_status_info[i].m_effect[j]) { info.m_own_status_info[i].m_effect[j + 1] += NdUtil.GetIntValue(gs.statusvalue, i); } } } } } break; /*info.m_statustime = gs.statustime; * info.m_statustype = gs.statustype; * info.m_statusvalue = gs.statusvalue;*/ } } }
public static void GetGodSkill(int type, int level, ref GodSkillInfo info) { foreach (sdata.s_godskilltypeInfo gs in m_lgodskill) { if (gs.type == type && gs.level == level) { info.m_id = gs.id; info.m_type = gs.type; info.m_level = gs.level; info.m_name = gs.name; info.m_action = gs.action; info.m_target = gs.target; info.m_multiple = gs.multiple; info.m_range = gs.range * 0.01f; info.m_power = gs.power; info.m_power2 = gs.power2; info.m_selectTarget = gs.selecttarget; info.m_own_status_info = new List <SkillStatusInfo>(); info.m_enemy_status_info = new List <SkillStatusInfo>(); info.m_mana = new List <int>(); SkillM.SetSkillStatus(ref info.m_own_status_info, gs.own_status); SkillM.SetSkillStatus(ref info.m_enemy_status_info, gs.enemy_status); int length = NdUtil.GetLength(gs.mana); if (length > 0) { for (int i = 0; i < length; ++i) { info.m_mana.Add(NdUtil.GetIntValue(gs.mana, i)); } } info.m_times = gs.times; info.m_blackscreentime = gs.blackscreentime * 0.001f; info.m_crystalneed = gs.crystalneed; info.m_coinneed = gs.coinneed; info.m_woodneed = gs.woodneed; info.m_explain = gs.explain; break; } } }
/// <summary> /// 获取当前阶开启的技能. /// </summary> public static int GetEnableSkill(int quality) { string value = GetParaStr(28, 1); if (string.IsNullOrEmpty(value) == true) { return(0); } int length = NdUtil.GetLength(value); for (int i = 0; i < length; i++) { int v = NdUtil.GetIntValue(value, i); if (v == quality) { return(i); } } return(-1); }
/// <summary> /// 获取品质属于第几个顺位 第一个为1 /// </summary> public static int GetQualityIndex(int Quality) { string value = GetParaStr(24, 1); List <int> l = new List <int>(); if (string.IsNullOrEmpty(value) == true) { return(0); } int length = NdUtil.GetLength(value); for (int i = 0; i < length; i++) { int q = NdUtil.GetIntValue(value, i); if (q == Quality) { return(i + 1); } } return(0); }
/// <summary> /// 设置附加属性 /// </summary> public void SetAddAttrInfo(s_summonprosInfo prosinfo) { if (prosinfo == null) { Debug.LogError("SetAddAttrInfo is null"); return; } int datalength = NdUtil.GetLength(prosinfo.data); int valuelength = NdUtil.GetLength(prosinfo.value); if (datalength != valuelength) { return; } for (int i = 0; i < datalength; i++) { int data = NdUtil.GetIntValue(prosinfo.data, i); int value = NdUtil.GetIntValue(prosinfo.value, i); AddAttr(AddAttrType.Main, data, value); } }
/// <summary> /// 获取之前更小的阶数列表 /// </summary> public static List <int> GetPrevQuality(int Quality) { List <int> lResult = new List <int>(); string value = GetParaStr(24, 1); if (string.IsNullOrEmpty(value) == true) { return(lResult); } int length = NdUtil.GetLength(value); for (int i = 0; i < length; i++) { int v = NdUtil.GetIntValue(value, i); if (v < Quality) { lResult.Add(v); } } return(lResult); }
/// <summary> /// 海神杯购买门票次数对应的钻石花费. /// </summary> /// <returns>The arena add times cost.</returns> /// <param name="times">Times.</param> public static int GetArenaAddTimesCost(int times) { string value = GetParaStr(34, 1); if (string.IsNullOrEmpty(value) == true) { return(0); } int length = NdUtil.GetLength(value); if (times < length && times > 0) { return(NdUtil.GetIntValue(value, times - 1)); } else if (length > 0 && times == 0) { return(NdUtil.GetIntValue(value, 0)); } else { return(NdUtil.GetIntValue(value, length - 1)); } }