Merge branch 'master_test_hw' of http://60.1.1.230/backend/jieling_server into master_test_hw

lvxinran 2020-09-04 10:38:01 +08:00
commit c8cc9af30e
3 changed files with 44 additions and 5 deletions

View File

@ -75,6 +75,7 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
}
user.getTeamPosManager().setCurTeamPosId(teamId);
ArenaInfoProto.ArenaChallengeResponse.Builder builder = ArenaInfoProto.ArenaChallengeResponse.newBuilder();
User defUser = null;
if( enemyType == GlobalsDef.ARENA_PLAYER_TYPE){
ArenaRecord arenaRecord = new ArenaRecord();
@ -94,7 +95,6 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
if(defUser.getArenaManager().getCount()!=0 && defUser.getArenaManager().getSeason() == curSeason){
arenaRecord.setAttackId(uid);
arenaRecord.setDefScore(defScoreChange);
arenaRecord.setAttackForce( HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false));
arenaRecord.setCreateTime((int)(System.currentTimeMillis()/1000));
arenaRecord.setId(KeyGenUtils.produceIdByModule(UUIDEnum.ARENARECORD,uid));
arenaRecord.setFightResult(fightResult^1);

View File

@ -163,6 +163,12 @@ public class ArenaLogic {
public static int getFightResultByPersonToPerson(User mine, int myteamId, User defUser, int defTeamId, ArenaRecord arenaRecord, ArenaInfoProto.ArenaChallengeResponse.Builder builder) throws Exception {
PVPFightEvent pvpFightEvent = new PVPFightEvent(mine.getId(),myteamId,SArenaSetting.getSArenaSetting().getMostTime(),"", GameFightType.ArenaPersonFight,defUser.getId(),defTeamId);
int myforce = HeroLogic.getInstance().calTeamTotalForce(mine, GlobalsDef.TEAM_ARENA_DEFENSE, false);
int defForce = HeroLogic.getInstance().calTeamTotalForce(defUser, GlobalsDef.TEAM_ARENA_DEFENSE, false);
arenaRecord.setAttackForce(myforce);
if(myforce<defForce){
pvpFightEvent.setRever(true);
}
FightResult fightResult = FightDispatcher.dispatcher(pvpFightEvent);
CommonProto.FightTeamInfo fightTeamInfo =fightResult.getFightTeamInfo();
CommonProto.FightTeamInfo deffightTeamInfo = fightResult.getDefFightTeamInfo();
@ -185,6 +191,11 @@ public class ArenaLogic {
public int getFightResultByPersonToRobot(User mine, int myteamId, int challengeUid,ArenaInfoProto.ArenaChallengeResponse.Builder builder) throws Exception {
PVPFightEvent pvpFightEvent = new PVPFightEvent(mine.getId(),myteamId,SArenaSetting.getSArenaSetting().getMostTime(),"", GameFightType.ArenaRobotFight,challengeUid,-1);
int myforce = HeroLogic.getInstance().calTeamTotalForce(mine, GlobalsDef.TEAM_ARENA_DEFENSE, false);
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(myteamId);
if(sArenaRobotConfig!=null&&myforce<sArenaRobotConfig.getTotalForce()){
pvpFightEvent.setRever(true);
}
FightResult fightResult = FightDispatcher.dispatcher(pvpFightEvent);
CommonProto.FightTeamInfo fightTeamInfo =fightResult.getFightTeamInfo();
CommonProto.FightTeamInfo deffightTeamInfo = fightResult.getDefFightTeamInfo();
@ -519,8 +530,15 @@ public class ArenaLogic {
throw new ErrorCodeException(ErrorCode.newDefineCode("对方未设置阵容"));
}
int myforce = HeroLogic.getInstance().calTeamTotalForce(mine, myteamId, false);
int deforce = HeroLogic.getInstance().calTeamTotalForce(defUser, 1, false);
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(mine,myteamId,true);
CommonProto.FightTeamInfo deffightTeamInfo = BehaviorUtil.getFightTeamInfo(defUser,1,false);
if(myforce<deforce){
deffightTeamInfo = CommonProto.FightTeamInfo.newBuilder().mergeFrom(deffightTeamInfo).setFirstCamp(1).build();
}
//设置战斗随机种子
int seed = (int)(System.currentTimeMillis()/1000);
CommonProto.FightData build = CommonProto.FightData.newBuilder()

View File

@ -620,18 +620,39 @@ public class ChampionshipLogic {
MemberInfo attackMemberInfo = memberInfoMap.get(attackId);
MemberInfo defMemberInfo = memberInfoMap.get(defUid);
int minForce = 0;
int defForce = 0;
if (defMemberInfo.getType() == 0) {
FamilyFightInfo fightInfo = defMemberInfo.getFightInfo();
pvpFightEvent.setDefFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills()));
defForce = fightInfo.getForce();
}else {
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(defUid);
if(sArenaRobotConfig!=null){
defForce = sArenaRobotConfig.getTotalForce();
}
}
if (attackMemberInfo.getType() == 0) {
FamilyFightInfo fightInfo = attackMemberInfo.getFightInfo();
pvpFightEvent.setAttackFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills()));
minForce = fightInfo.getForce();
}else {
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(attackId);
if(sArenaRobotConfig!=null){
minForce = sArenaRobotConfig.getTotalForce();
}
}
if(minForce>defForce){
if(arenaRecord.getTurn()==2){
pvpFightEvent.setRever(true);
}
}else {
if(arenaRecord.getTurn()==1||arenaRecord.getTurn()==3){
pvpFightEvent.setRever(true);
}
}
}
if(arenaRecord.getTurn()==2){
pvpFightEvent.setRever(true);
}
FightDispatcher.dispatcherAsync(pvpFightEvent, id);
}