公会科技等级加入等级限制

main
grimm 2025-03-23 19:00:06 +08:00
parent 65d4c814e2
commit f387a07e9a
2 changed files with 13 additions and 0 deletions

View File

@ -484,6 +484,7 @@ public enum ErrorCode implements IErrorCode {
POWER_CENTER_LINK_POS_LIMIT(30305, "异能中心链接栏位上限"), POWER_CENTER_LINK_POS_LIMIT(30305, "异能中心链接栏位上限"),
POWER_CENTER_EXIST_SAME_HERO(30306, "异能中心已存在同名卡"), POWER_CENTER_EXIST_SAME_HERO(30306, "异能中心已存在同名卡"),
HERO_IS_LINKED(30307, "英雄链接中,不能进行此操作"), HERO_IS_LINKED(30307, "英雄链接中,不能进行此操作"),
GUILD_SKILL_HIGH(30308, "科技技能等级不能超过其他科技技能20级"),
; ;

View File

@ -1551,6 +1551,18 @@ public class GuildLogic{
consume = typeMap.get(1).get(0).getConsume(); consume = typeMap.get(1).get(0).getConsume();
} else { } else {
level = skillInfo.get(type); level = skillInfo.get(type);
for(int i=1;i<=4;i++){
if(i == type){
continue;
}
int otherLevel = 0;
if (skillInfo.containsKey(i)) {
otherLevel = skillInfo.get(i);
}
if (level - otherLevel >= 20) {
throw new ErrorCodeException(ErrorCode.GUILD_SKILL_HIGH);
}
}
consume = typeMap.get(level % size + 1).get(level / size).getConsume(); consume = typeMap.get(level % size + 1).get(level / size).getConsume();
if (typeMap.get(level % size + 1).get(level / size + 1) == null) { if (typeMap.get(level % size + 1).get(level / size + 1) == null) {
throw new ErrorCodeException(ErrorCode.HERO_LEVE_MAX); throw new ErrorCodeException(ErrorCode.HERO_LEVE_MAX);