修行技能升级限制修改

back_recharge
yuanshuai 2021-10-22 13:38:56 +08:00
parent df41a517f9
commit 266fd9526b
2 changed files with 12 additions and 5 deletions

View File

@ -13,6 +13,8 @@ import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil;
import config.SFourQuadrantConfig;
import config.SPlayerSkill;
import config.SXiuXian;
import manager.STableManager;
import org.springframework.stereotype.Component;
import rpc.protocols.CommonProto;
import rpc.protocols.HeroInfoProto;
@ -39,10 +41,9 @@ public class PracticeSkillUpRequestHandler extends BaseHandler<HeroInfoProto.Pra
if (heroManager.getPracticeSkillMap().containsKey(skillId)){
skillLv=heroManager.getPracticeSkillMap().get(skillId);
}
int nextSkillLv=skillLv+1;
SPlayerSkill nextPlayerSkill=SPlayerSkill.GetSPlayerSkill(skillId,nextSkillLv);
if (nextPlayerSkill==null||practiceLv<nextPlayerSkill.getXiuxianId()){
LOGGER.error("修行等级不足");
SXiuXian xiuxianConfig= STableManager.getConfig(SXiuXian.class).get(practiceLv);
if (skillLv>=xiuxianConfig.getPlayerSkillLvMax()) {
LOGGER.error("修行技能等级已达上限");
throw new ErrorCodeException(ErrorCode.PRACTICE_LEVE_DOWN);
}
SPlayerSkill curPlayerSkill=SPlayerSkill.GetSPlayerSkill(skillId,skillLv);
@ -52,7 +53,7 @@ public class PracticeSkillUpRequestHandler extends BaseHandler<HeroInfoProto.Pra
LOGGER.error("修行技能升级材料不足");
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
}
heroManager.setPracticeSkillMap(skillId,nextSkillLv);
heroManager.setPracticeSkillMap(skillId,skillLv+1);
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.PRACTICE_SKILL_UP_RESPONSE_VALUE,null,true);
}
}

View File

@ -32,6 +32,8 @@ public class SXiuXian implements BaseConfig {
private float[][] proLevel;
private int playerSkillLvMax;
// 目前只为主角修行等级属性使用
public static Map<Integer, Map<Integer, SXiuXian>> sXiuXianMap;
@ -94,4 +96,8 @@ public class SXiuXian implements BaseConfig {
public float[][] getProLevel() {
return proLevel;
}
public int getPlayerSkillLvMax() {
return playerSkillLvMax;
}
}