神魂相关脚本提交
parent
d35f538ad2
commit
048adc9c64
|
|
@ -177,6 +177,7 @@ public enum ErrorCode implements IErrorCode {
|
||||||
RIDING_SWARD_BET_TWO(146,"一轮比赛最多押注两次!"),
|
RIDING_SWARD_BET_TWO(146,"一轮比赛最多押注两次!"),
|
||||||
PRACTICE_LEVE_DOWN(147,"修行等级不足"),
|
PRACTICE_LEVE_DOWN(147,"修行等级不足"),
|
||||||
GOD_SOUL_BIND(148,"选中英雄已被当前神魂绑定,操作失败"),
|
GOD_SOUL_BIND(148,"选中英雄已被当前神魂绑定,操作失败"),
|
||||||
|
HANDLE_FAILED(149,"操作失败"),
|
||||||
;
|
;
|
||||||
private static final Set<Integer> CodeSet = new HashSet<>();
|
private static final Set<Integer> CodeSet = new HashSet<>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.ljsd.jieling.logic.dao.Hero;
|
||||||
import com.ljsd.jieling.logic.dao.HeroManager;
|
import com.ljsd.jieling.logic.dao.HeroManager;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
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.network.session.ISession;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import config.SCHero;
|
import config.SCHero;
|
||||||
|
|
@ -33,8 +34,17 @@ public class HeroGodSoulBindRequestHandler extends BaseHandler<HeroInfoProto.Her
|
||||||
HeroManager heroManager= user.getHeroManager();
|
HeroManager heroManager= user.getHeroManager();
|
||||||
Hero upHero=heroManager.getHero(heroId);
|
Hero upHero=heroManager.getHero(heroId);
|
||||||
SCHero heroConfig=SCHero.getsCHero().get(upHero.getTemplateId());
|
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) {
|
for (String _heroId : bindHeroList) {
|
||||||
if (upHero.CheckGodSoulIsBind(_heroId)) {
|
if (upHero.CheckGodSoulIsBind(godSoulLv,_heroId)) {
|
||||||
LOGGER.error("选中的英雄已经被当前升级神魂英雄绑定");
|
LOGGER.error("选中的英雄已经被当前升级神魂英雄绑定");
|
||||||
throw new ErrorCodeException(ErrorCode.GOD_SOUL_BIND);
|
throw new ErrorCodeException(ErrorCode.GOD_SOUL_BIND);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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()) {
|
for (Map.Entry<Integer, List<String>> listEntry : godSoulBindMap.entrySet()) {
|
||||||
|
if (listEntry.getKey()==level)continue;
|
||||||
if (listEntry.getValue().contains(_heroId)){
|
if (listEntry.getValue().contains(_heroId)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,14 @@ public class CBean2Proto {
|
||||||
soulPoss.add(builder.build());
|
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
|
return CommonProto.Hero
|
||||||
.newBuilder()
|
.newBuilder()
|
||||||
.setId(hero.getId())
|
.setId(hero.getId())
|
||||||
|
|
@ -421,6 +428,7 @@ public class CBean2Proto {
|
||||||
.setCreatetype(hero.getCreateType())
|
.setCreatetype(hero.getCreateType())
|
||||||
.setChangeId(hero.getChangeId())
|
.setChangeId(hero.getChangeId())
|
||||||
.setSkinId(hero.getSkin())
|
.setSkinId(hero.getSkin())
|
||||||
|
.addAllGodSoulList(godSoulList)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,12 @@ public class SCHero implements BaseConfig{
|
||||||
|
|
||||||
private int joinWishDay;
|
private int joinWishDay;
|
||||||
|
|
||||||
|
private int[][] soul;
|
||||||
|
|
||||||
|
private int[][] soulSkill;
|
||||||
|
|
||||||
|
private int isSoulOpen;
|
||||||
|
|
||||||
private Map<Integer,Integer> secondaryFactorMap;
|
private Map<Integer,Integer> secondaryFactorMap;
|
||||||
|
|
||||||
private Map<Integer, List<Integer>> skillListByStar;
|
private Map<Integer, List<Integer>> skillListByStar;
|
||||||
|
|
@ -360,4 +366,16 @@ public class SCHero implements BaseConfig{
|
||||||
public int getJoinWishDay() {
|
public int getJoinWishDay() {
|
||||||
return joinWishDay;
|
return joinWishDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[][] getSoul() {
|
||||||
|
return soul;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getSoulSkill() {
|
||||||
|
return soulSkill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIsSoulOpen() {
|
||||||
|
return isSoulOpen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue