public int HadStudySkill() {//返回-1表示无 int vocation = (int)theOwner.vocation; int weaponType = (theOwner as EntityMyself).GetEquipSubType(); SkillData s = null; int rst = -1; List <int> ids = new List <int>(); ids.Add(skillMapping.normalAttack); ids.Add(skillMapping.spellOne); ids.Add(skillMapping.spellTwo); ids.Add(skillMapping.spellThree); ids.Add(skillMapping.powerupAttack); for (int idx = 0; idx < 5; idx++) { if (ids[idx] == 0) { s = SkillData.GetSkillByVWLP(vocation, weaponType, idx, 1); if (s == null) { continue; } if (skillMapping.hadStudy(s.id)) { continue; } if ((theOwner as EntityMyself).level >= s.limitLevel && (theOwner as EntityMyself).gold >= s.moneyCost) { rst = s.id; break; } } else { SkillData cur = SkillData.dataMap[ids[idx]]; s = SkillData.GetSkillByVWLP(vocation, weaponType, idx, cur.level + 1); if (s == null) { continue; } if (skillMapping.hadStudy(s.id)) { continue; } if ((theOwner as EntityMyself).level >= s.limitLevel && (theOwner as EntityMyself).gold >= s.moneyCost) { rst = s.id; break; } } if (rst != -1) {//找到 break; } } return(rst); }
private void UpdateSkillInfo() { int idx = currSkillTree; List <int> skillList = new List <int>(); skillList.Add(skills.normalAttack); skillList.Add(skills.spellOne); skillList.Add(skills.spellTwo); skillList.Add(skills.spellThree); skillList.Add(skills.maxPowerupAttack); int vocation = (int)MogoWorld.thePlayer.vocation; int weaponType = MogoWorld.thePlayer.GetEquipSubType(); List <int> l = vocationCfg[vocation]; if (clickedWeapon) { weaponType = l[weaponPos]; } SkillData s = SkillData.dataMap.GetValueOrDefault(skillList[idx], null); if (s == null) { if (skillList[idx] != 0) { return; } s = SkillData.GetSkillByVWLP(vocation, weaponType, idx, 1); if (s == null) { return; } } SkillData next = SkillData.GetSkillByVWLP(vocation, weaponType, s.posi, s.level + 1); SkillUIViewManager.Instance.SetLearnBtnText(LanguageData.GetContent(14602)); if (skillList[idx] == 0) { SkillUIViewManager.Instance.SetLearnBtnText(LanguageData.GetContent(14601)); next = s; } string name = LanguageData.dataMap[s.name].content; string desc; int gameMoney; //int horner; int limitLevel; if (next == null) { desc = LanguageData.GetContent(s.desc); gameMoney = s.moneyCost; //horner = s.pvpCreditCost; limitLevel = s.limitLevel; SkillUIViewManager.Instance.SetLearnBtnEnable(false); } else { desc = LanguageData.GetContent(s.desc); gameMoney = next.moneyCost; //horner = next.pvpCreditCost; limitLevel = next.limitLevel; SkillUIViewManager.Instance.SetLearnBtnEnable(true); } if (skills.hadStudy(s.id)) { //SkillUIViewManager.Instance.SetSkillName(name + " (" + LanguageData.GetContent(200003) + ")"); SkillUIViewManager.Instance.SetSkillName(name + " [ffffff]" + LanguageData.GetContent(168, s.level) + "[-]"); } else { SkillUIViewManager.Instance.SetSkillName(name); } SkillUIViewManager.Instance.SetSkillDamageRace(LanguageData.GetContent(14603), s.extraRate * 100 + "%"); SkillUIViewManager.Instance.SetSkillExtraDamage(LanguageData.GetContent(14604), s.extraHarm.ToString()); SkillUIViewManager.Instance.SetSkillDescripe(desc); SkillUIViewManager.Instance.SetSkillLearnCostGold(gameMoney); //SkillUIViewManager.Instance.SetSkillLearnCostHorner(horner); SkillUIViewManager.Instance.SetSkillNeedLevel(limitLevel); }