神魂相关脚本提交

back_recharge
yuanshuai 2021-10-22 16:56:32 +08:00
parent d35f538ad2
commit 048adc9c64
5 changed files with 41 additions and 3 deletions

View File

@ -177,6 +177,7 @@ public enum ErrorCode implements IErrorCode {
RIDING_SWARD_BET_TWO(146,"一轮比赛最多押注两次!"),
PRACTICE_LEVE_DOWN(147,"修行等级不足"),
GOD_SOUL_BIND(148,"选中英雄已被当前神魂绑定,操作失败"),
HANDLE_FAILED(149,"操作失败"),
;
private static final Set<Integer> CodeSet = new HashSet<>();

View File

@ -6,6 +6,7 @@ import com.ljsd.jieling.logic.dao.Hero;
import com.ljsd.jieling.logic.dao.HeroManager;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.util.MessageUtil;
import config.SCHero;
@ -33,8 +34,17 @@ public class HeroGodSoulBindRequestHandler extends BaseHandler<HeroInfoProto.Her
HeroManager heroManager= user.getHeroManager();
Hero upHero=heroManager.getHero(heroId);
SCHero heroConfig=SCHero.getsCHero().get(upHero.getTemplateId());
for (int[] ints : heroConfig.getSoul()) {
if (ints[0]==godSoulLv){
boolean isCheckCondition=HeroLogic.getInstance().CheckHeroBindCondition(user,heroId,bindHeroList,ints[2],ints[3]);
if (!isCheckCondition){
LOGGER.error("选中的英雄不满足激活神魂条件");
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
}
}
}
for (String _heroId : bindHeroList) {
if (upHero.CheckGodSoulIsBind(_heroId)) {
if (upHero.CheckGodSoulIsBind(godSoulLv,_heroId)) {
LOGGER.error("选中的英雄已经被当前升级神魂英雄绑定");
throw new ErrorCodeException(ErrorCode.GOD_SOUL_BIND);
}

View File

@ -502,8 +502,9 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
}
///检测该英雄是否已经被当前英雄绑定
public boolean CheckGodSoulIsBind(String _heroId){
public boolean CheckGodSoulIsBind(int level,String _heroId){
for (Map.Entry<Integer, List<String>> listEntry : godSoulBindMap.entrySet()) {
if (listEntry.getKey()==level)continue;
if (listEntry.getValue().contains(_heroId)){
return true;
}

View File

@ -403,7 +403,14 @@ public class CBean2Proto {
soulPoss.add(builder.build());
}
}
List<CommonProto.HeroGodSoulInfo>godSoulList=new ArrayList<>();
for (Map.Entry<Integer, List<String>> godSoul : hero.getGodSoulBindMap().entrySet()) {
CommonProto.HeroGodSoulInfo godSoulInfo=CommonProto.HeroGodSoulInfo.newBuilder()
.setLevel(godSoul.getKey())
.addAllHeros(godSoul.getValue())
.build();
godSoulList.add(godSoulInfo);
}
return CommonProto.Hero
.newBuilder()
.setId(hero.getId())
@ -421,6 +428,7 @@ public class CBean2Proto {
.setCreatetype(hero.getCreateType())
.setChangeId(hero.getChangeId())
.setSkinId(hero.getSkin())
.addAllGodSoulList(godSoulList)
.build();
}

View File

@ -64,6 +64,12 @@ public class SCHero implements BaseConfig{
private int joinWishDay;
private int[][] soul;
private int[][] soulSkill;
private int isSoulOpen;
private Map<Integer,Integer> secondaryFactorMap;
private Map<Integer, List<Integer>> skillListByStar;
@ -360,4 +366,16 @@ public class SCHero implements BaseConfig{
public int getJoinWishDay() {
return joinWishDay;
}
public int[][] getSoul() {
return soul;
}
public int[][] getSoulSkill() {
return soulSkill;
}
public int getIsSoulOpen() {
return isSoulOpen;
}
}