back_recharge
wangyuan 2020-04-13 11:26:32 +08:00
parent 11b28fab35
commit 55019f706a
2 changed files with 17 additions and 19 deletions

View File

@ -13,7 +13,6 @@ import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.event.*;
import com.ljsd.jieling.logic.activity.eventhandler.HeroFiveStarGetEventHandler;
import com.ljsd.jieling.logic.dao.*;
@ -1509,16 +1508,7 @@ public class HeroLogic{
if(equipIds.size()!=1){
throw new ErrorCodeException(ErrorCode.HERO_OPT_ONE);
}else{
int[] equipTalismanaUnlock = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getEquipTalismanaUnlock()[0];
if(equipTalismanaUnlock[0]==1){
if(user.getPlayerInfoManager().getLevel()<equipTalismanaUnlock[0]){
throw new ErrorCodeException(ErrorCode.HERO_USE_LEVE);
}
}else{
if(hero.getStar()<equipTalismanaUnlock[1]){
throw new ErrorCodeException(ErrorCode.HERO_LEVE_LOW);
}
}
checkAllowedOpt(1,user,hero.getStar());
// hero.updateEspecial(equipIds.get(0));
}
}
@ -2004,7 +1994,7 @@ public class HeroLogic{
User user = UserManager.getUser(uid);
String heroId = optHeroSoul.getHeroId();
Hero hero = user.getHeroManager().getHero(heroId);
checkAllowedOptSoul(user,hero.getLevel());
checkAllowedOpt(2,user,hero.getStar());
checkAllowedWear(user,hero.getTemplateId(),optHeroSoul.getSoulEquipIdsList(),unload);
optHeroSoul.getSoulEquipIdsList().forEach(e->{
hero.updateSoulEquipPositionMap(e.getPosition(),e.getEquipId());
@ -2130,15 +2120,23 @@ public class HeroLogic{
}
public static void checkAllowedOptSoul(User user,int heroLevel) throws ErrorCodeException {
public static void checkAllowedOpt(int type,User user, int heroStar) throws ErrorCodeException {
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
int[][] equipSignUnlock = gameSetting.getEquipSignUnlock();
for(int[] item : equipSignUnlock){
int[][] checkParms = null;
if(type == 1){
checkParms = gameSetting.getEquipTalismanaUnlock();
}else if(type == 2){
checkParms = gameSetting.getEquipSignUnlock();
}else {
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
}
for(int[] item : checkParms){
if(item[0] == 1 && user.getPlayerInfoManager().getLevel()<item[1]){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
throw new ErrorCodeException(ErrorCode.HERO_USE_LEVE);
}
if(item[0] == 2 && heroLevel<item[1]){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
if(item[0] == 2 && heroStar<item[1]){
throw new ErrorCodeException(ErrorCode.HERO_LEVE_LOW);
}
}
}

View File

@ -107,7 +107,7 @@ public class SGameSetting implements BaseConfig {
private int[][] equipSignUnlock;
private int[] heroReturn;
private int[][] heroReturn;
private int defaultHead;