神王3.0
parent
96f7accafc
commit
43d0c66bc6
|
@ -131,7 +131,7 @@ public class TasuilingxiaoHandler extends BaseHandler<ActivityProto.Tasuilingxia
|
|||
Map<Integer, TaSuiHero> heroMap = new HashMap<>();
|
||||
for(TeamPosHeroInfo hero:teamPosForHero){
|
||||
Hero myHero = user.getHeroManager().getHero(hero.getHeroId());
|
||||
TaSuiHero taSuiHero = new TaSuiHero(myHero.getTemplateId(),myHero.getOriginalLevel(),myHero.getStar(),myHero.getGodSoulLv(),myHero.getPropertyId());
|
||||
TaSuiHero taSuiHero = new TaSuiHero(myHero.getTemplateId(),myHero.getOriginalLevel(),myHero.getStar(),myHero.getGodSoulLv(),myHero.getPropertyId(),myHero.getShenwangLv());
|
||||
heroMap.put(hero.getPosition(),taSuiHero);
|
||||
}
|
||||
user.getHeroManager().setTaSuiHeroMap(heroMap);
|
||||
|
|
|
@ -50,7 +50,7 @@ public class BloodLogic {
|
|||
HeroManager heroManager = user.getHeroManager();
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(teamId);
|
||||
if(teamPosHeroInfos==null||teamPosHeroInfos.size()<1){
|
||||
if(teamPosHeroInfos==null || teamPosHeroInfos.isEmpty()){
|
||||
teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1);
|
||||
teamId = 1;
|
||||
}
|
||||
|
|
|
@ -672,7 +672,7 @@ public class ChampionshipLogic {
|
|||
fightInfo.setHeroAttribute(heroAllAttribute);
|
||||
fightInfo.setForce(force);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(snapTeamId);
|
||||
if (teamPosHeroInfoList == null || teamPosHeroInfoList.size() < 1) {
|
||||
if (teamPosHeroInfoList == null || teamPosHeroInfoList.isEmpty()) {
|
||||
teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(1);
|
||||
}
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
|
@ -884,15 +884,7 @@ public class ChampionshipLogic {
|
|||
// int i = 1;
|
||||
for (Map.Entry<String, FamilyHeroInfo> entry : fightInfo.getHeroAttribute().entrySet()) {
|
||||
FamilyHeroInfo familyHeroInfo = entry.getValue();
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(entry.getKey())
|
||||
.setHeroTid(familyHeroInfo.getTempleteId())
|
||||
.setStar(familyHeroInfo.getStar())
|
||||
.setLevel(familyHeroInfo.getLevel())
|
||||
.setPosition(familyHeroInfo.getPosition())
|
||||
.setGodSoulLv(familyHeroInfo.getGodSoulLv())
|
||||
.build()
|
||||
);
|
||||
teamInfo.addTeam(CBean2Proto.getSimpleTeamInfoByFamily(entry.getKey(), familyHeroInfo));
|
||||
}
|
||||
oneInfo.setTeam(teamInfo);
|
||||
builder = oneInfo;
|
||||
|
|
|
@ -17,6 +17,8 @@ public class TaSuiHero {
|
|||
|
||||
private int propertyId;
|
||||
|
||||
private int shenwangLv;
|
||||
|
||||
public int getTempId() {
|
||||
return tempId;
|
||||
}
|
||||
|
@ -37,14 +39,19 @@ public class TaSuiHero {
|
|||
return propertyId;
|
||||
}
|
||||
|
||||
public int getShenwangLv() {
|
||||
return shenwangLv;
|
||||
}
|
||||
|
||||
public TaSuiHero() {
|
||||
}
|
||||
|
||||
public TaSuiHero(int tempId, int leve, int star, int godSoulLv,int propertyId) {
|
||||
public TaSuiHero(int tempId, int leve, int star, int godSoulLv,int propertyId,int shenwangLv) {
|
||||
this.tempId = tempId;
|
||||
this.leve = leve;
|
||||
this.star = star;
|
||||
this.godSoulLv=godSoulLv;
|
||||
this.propertyId=propertyId;
|
||||
this.shenwangLv=shenwangLv;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,14 +123,7 @@ public class GuildFightLogic {
|
|||
if(fightInfo!=null){
|
||||
for(Map.Entry<String, FamilyHeroInfo> entry:fightInfo.getHeroAttribute().entrySet()){
|
||||
FamilyHeroInfo familyHeroInfo = entry.getValue();
|
||||
oneInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(entry.getKey())
|
||||
.setHeroTid(familyHeroInfo.getTempleteId())
|
||||
.setStar(familyHeroInfo.getStar())
|
||||
.setLevel(familyHeroInfo.getLevel())
|
||||
.setGodSoulLv(familyHeroInfo.getGodSoulLv())
|
||||
.build()
|
||||
);
|
||||
oneInfo.addTeam(CBean2Proto.getSimpleTeamInfoByFamily(entry.getKey(), familyHeroInfo));
|
||||
Map<Integer, Long> attribute = entry.getValue().getAttribute();
|
||||
if(status==3){
|
||||
long remainHp = attribute.get(HeroAttributeEnum.CurHP.getPropertyId())*10000/attribute.get(HeroAttributeEnum.Hp.getPropertyId());
|
||||
|
|
|
@ -634,14 +634,7 @@ public class PlayerLogic {
|
|||
Map<Integer, TaSuiHero> taSuiHeroMap = user.getHeroManager().getTaSuiHeroMap();
|
||||
for(Map.Entry<Integer,TaSuiHero> entry:taSuiHeroMap.entrySet()){
|
||||
TaSuiHero hero = entry.getValue();
|
||||
CommonProto.TeamSimpleInfo info = CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroTid(hero.getTempId())
|
||||
.setLevel(hero.getLeve())
|
||||
.setStar(hero.getStar())
|
||||
.setPosition(entry.getKey())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build();
|
||||
CommonProto.TeamSimpleInfo info = CBean2Proto.getSimpleTeamInfoByTaSui(hero, entry.getKey());
|
||||
teamInfo.addTeam(info);
|
||||
}
|
||||
teamInfo.setTotalForce(user.getHeroManager().getTaSuiLingXiaoRankForce());
|
||||
|
@ -726,16 +719,10 @@ public class PlayerLogic {
|
|||
int position = 1;
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList().entrySet()){
|
||||
Integer heroTid = item.getKey();
|
||||
int heroStar = item.getValue().getStar();
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(String.valueOf(heroTid))
|
||||
.setHeroTid(heroTid)
|
||||
.setLevel(sArenaRobotConfig.getRoleLv())
|
||||
.setStar(heroStar)
|
||||
.setPosition(position++)
|
||||
.setGodSoulLv( item.getValue().getGodSoulLv())
|
||||
.setPropertyId(item.getValue().getPropertyId())
|
||||
.build());
|
||||
CommonProto.Hero hero = item.getValue();
|
||||
CommonProto.TeamSimpleInfo info = CBean2Proto.getSimpleTeamInfoByRobot(heroTid, position, sArenaRobotConfig.getRobotLevel(), hero.getStar(), hero.getPropertyId(), hero.getGodSoulLv());
|
||||
teamInfo.addTeam(info);
|
||||
position++;
|
||||
}
|
||||
oneInfo.setTeam(teamInfo);
|
||||
return oneInfo;
|
||||
|
@ -765,58 +752,51 @@ public class PlayerLogic {
|
|||
return oneInfo;
|
||||
}
|
||||
|
||||
public CommonProto.TeamOneInfo.Builder getYuxuRobotTeamInfo(SArenaRobotConfig sArenaRobotConfig,List<Integer> crossTeamId){
|
||||
public CommonProto.TeamOneInfo.Builder getYuxuRobotTeamInfo(SArenaRobotConfig robotConfig,List<Integer> crossTeamId){
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
if (crossGroup == -1) {
|
||||
return CommonProto.TeamOneInfo.newBuilder();
|
||||
}
|
||||
CommonProto.TeamOneInfo.Builder oneInfo = CommonProto.TeamOneInfo.newBuilder()
|
||||
.setLevel(sArenaRobotConfig.getRobotLevel())
|
||||
.setName(sArenaRobotConfig.getRobotName())
|
||||
.setUid(sArenaRobotConfig.getId()).setCrossTeamScore(sArenaRobotConfig.getMsScroe()).setServerName("");
|
||||
.setLevel(robotConfig.getRobotLevel())
|
||||
.setName(robotConfig.getRobotName())
|
||||
.setUid(robotConfig.getId()).setCrossTeamScore(robotConfig.getMsScroe()).setServerName("");
|
||||
//玉虚论道三队伍
|
||||
for(int id :crossTeamId){
|
||||
int position = 1;
|
||||
CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
if(id ==TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId()){
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList().entrySet()){
|
||||
position = getPosition(sArenaRobotConfig, position, teamInfo, item);
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : robotConfig.getHeroMapList().entrySet()){
|
||||
CommonProto.Hero hero = item.getValue();
|
||||
CommonProto.TeamSimpleInfo robot = CBean2Proto.getSimpleTeamInfoByRobot(item.getKey(), position, robotConfig.getRobotLevel(), hero.getStar(), hero.getPropertyId(),hero.getGodSoulLv());
|
||||
teamInfo.addTeam(robot);
|
||||
position++;
|
||||
}
|
||||
teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce1());
|
||||
|
||||
}else if(id ==TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()){
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList2().entrySet()){
|
||||
position = getPosition(sArenaRobotConfig, position, teamInfo, item);
|
||||
teamInfo.setTotalForce(robotConfig.getYxldTotalForce1());
|
||||
}
|
||||
teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce2());
|
||||
|
||||
}else if(id ==TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()){
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList3().entrySet()){
|
||||
position = getPosition(sArenaRobotConfig, position, teamInfo, item);
|
||||
else if(id ==TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()){
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : robotConfig.getHeroMapList2().entrySet()){
|
||||
CommonProto.Hero hero = item.getValue();
|
||||
CommonProto.TeamSimpleInfo robot = CBean2Proto.getSimpleTeamInfoByRobot(item.getKey(), position, robotConfig.getRobotLevel(), hero.getStar(), hero.getPropertyId(),hero.getGodSoulLv());
|
||||
teamInfo.addTeam(robot);
|
||||
position++;
|
||||
}
|
||||
teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce3());
|
||||
teamInfo.setTotalForce(robotConfig.getYxldTotalForce2());
|
||||
}
|
||||
else if(id ==TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()){
|
||||
for(Map.Entry<Integer,CommonProto.Hero> item : robotConfig.getHeroMapList3().entrySet()){
|
||||
CommonProto.Hero hero = item.getValue();
|
||||
CommonProto.TeamSimpleInfo robot = CBean2Proto.getSimpleTeamInfoByRobot(item.getKey(), position, robotConfig.getRobotLevel(), hero.getStar(), hero.getPropertyId(),hero.getGodSoulLv());
|
||||
teamInfo.addTeam(robot);
|
||||
position++;
|
||||
}
|
||||
teamInfo.setTotalForce(robotConfig.getYxldTotalForce3());
|
||||
}
|
||||
oneInfo.addCrossTeam(teamInfo);
|
||||
}
|
||||
return oneInfo;
|
||||
}
|
||||
|
||||
public int getPosition(SArenaRobotConfig sArenaRobotConfig, int position, CommonProto.TeamOneTeamInfo.Builder teamInfo, Map.Entry<Integer, CommonProto.Hero> item) {
|
||||
Integer heroTid = item.getKey();
|
||||
CommonProto.Hero hero = item.getValue();
|
||||
CommonProto.TeamSimpleInfo build = CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.setHeroid(String.valueOf(heroTid))
|
||||
.setHeroTid(heroTid)
|
||||
.setLevel(sArenaRobotConfig.getRoleLv())
|
||||
.setStar(hero.getStar())
|
||||
.setPosition(position++)
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
teamInfo.addTeam(build);
|
||||
return position;
|
||||
}
|
||||
|
||||
//获取跨服玩家信息
|
||||
public CommonProto.TeamOneInfo getCrossYxldMyTeamInfo(User user,List<Integer> team) throws Exception{
|
||||
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(user.getId());
|
||||
|
@ -852,16 +832,7 @@ public class PlayerLogic {
|
|||
// if(yuxuHero == null){
|
||||
// continue;
|
||||
// }
|
||||
teamOneTeamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(hero.getId())
|
||||
.setHeroTid(hero.getTemplateId())
|
||||
.setLevel(hero.getLevel(user))
|
||||
.setStar(hero.getStar())
|
||||
.setPosition(heroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build());
|
||||
teamOneTeamInfo.addTeam(CBean2Proto.getSimpleTeamInfoByHero(user, hero, heroInfo.getPosition()));
|
||||
}
|
||||
}
|
||||
// 灵兽
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import com.ljsd.fight.ArenaRecord;
|
||||
import com.ljsd.fight.FamilyHeroInfo;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
|
@ -1098,28 +1099,18 @@ public class CBean2Proto {
|
|||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.setShenwangLv(hero.getShenwangLv())
|
||||
.build();
|
||||
}
|
||||
|
||||
// public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByHero(com.ljsd.jieling.thrift.idl.ArenaOfHero hero, int position){
|
||||
// return CommonProto.TeamSimpleInfo.newBuilder()
|
||||
// .setHeroid(hero.getId())
|
||||
// .setHeroTid(hero.getTemplateId())
|
||||
// .setLevel(hero.getLevel())
|
||||
// .setStar(hero.getStar())
|
||||
// .setPosition(position)
|
||||
// .setSkinId(hero.getSkin())
|
||||
// .setGodSoulLv(hero.getGodSoulLv())
|
||||
// .setPropertyId(hero.getPropertyId())
|
||||
// .build();
|
||||
// }
|
||||
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByPokeMon(Pokemon pokemon,int position){
|
||||
return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(pokemon.getId()).setHeroTid(pokemon.getTmpId()).setLevel(pokemon.getLevel()).setStar(pokemon.getStar()).setPosition(position).build();
|
||||
return CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(pokemon.getId())
|
||||
.setHeroTid(pokemon.getTmpId())
|
||||
.setLevel(pokemon.getLevel())
|
||||
.setStar(pokemon.getStar())
|
||||
.setPosition(position)
|
||||
.build();
|
||||
}
|
||||
// public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByPokeMon( com.ljsd.jieling.thrift.idl.Pokemon pokemon,int position){
|
||||
// return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(pokemon.getId()).setHeroTid(pokemon.getTmpId()).setLevel(pokemon.getLevel()).setStar(pokemon.getStar()).setPosition(position).build();
|
||||
// }
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByMagicSoldier(MagicSoldier soldier){
|
||||
return CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(soldier.getId())
|
||||
|
@ -1129,6 +1120,39 @@ public class CBean2Proto {
|
|||
.setPosition(soldier.getPoint())
|
||||
.build();
|
||||
}
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByTaSui(TaSuiHero hero, int position) {
|
||||
return CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroTid(hero.getTempId())
|
||||
.setLevel(hero.getLeve())
|
||||
.setStar(hero.getStar())
|
||||
.setPosition(position)
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.setShenwangLv(hero.getShenwangLv())
|
||||
.build();
|
||||
}
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByRobot(int heroTid, int position, int level, int star, int propertId, int godSoulLv) {
|
||||
return CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setPropertyId(propertId)
|
||||
.setHeroid(String.valueOf(heroTid))
|
||||
.setHeroTid(heroTid)
|
||||
.setLevel(level)
|
||||
.setStar(star)
|
||||
.setPosition(position)
|
||||
.setGodSoulLv(godSoulLv)
|
||||
.build();
|
||||
}
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByFamily(String heroTid, FamilyHeroInfo familyHeroInfo) {
|
||||
return CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroid(heroTid)
|
||||
.setHeroTid(familyHeroInfo.getTempleteId())
|
||||
.setStar(familyHeroInfo.getStar())
|
||||
.setLevel(familyHeroInfo.getLevel())
|
||||
.setPosition(familyHeroInfo.getPosition())
|
||||
.setGodSoulLv(familyHeroInfo.getGodSoulLv())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
public static CommonProto.HardStagePlayerInfo getHardStagePlayerInfo(com.ljsd.jieling.logic.dao.root.ArenaRecord arenaRecord,int type,User user)throws Exception {
|
||||
CommonProto.FightData fightDataProto = CommonProto.FightData.parseFrom(arenaRecord.getFightData());
|
||||
|
|
Loading…
Reference in New Issue