fix bug
parent
5ba0990bb0
commit
052a589225
|
@ -1307,7 +1307,7 @@ public class MapLogic {
|
||||||
if (hero == null) {
|
if (hero == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
heroForces += HeroLogic.getInstance().calHeoForce(user, hero);
|
heroForces += HeroLogic.getInstance().calHeoForce(user, hero,true);
|
||||||
crossInfo.getHeroIds().add(hero.getTemplateId());
|
crossInfo.getHeroIds().add(hero.getTemplateId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class ArenaLogic {
|
||||||
.build());
|
.build());
|
||||||
}else{
|
}else{
|
||||||
User user = UserManager.getUser(enemyId);
|
User user = UserManager.getUser(enemyId);
|
||||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE);
|
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false);
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE);
|
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE);
|
||||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||||
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
||||||
|
@ -169,7 +169,7 @@ public class ArenaLogic {
|
||||||
myscoreChange = calScore(myscore, defScore,fightResult);
|
myscoreChange = calScore(myscore, defScore,fightResult);
|
||||||
arenaRecord.setAttackId(uid);
|
arenaRecord.setAttackId(uid);
|
||||||
arenaRecord.setDefScore(defScoreChange);
|
arenaRecord.setDefScore(defScoreChange);
|
||||||
arenaRecord.setAttackForce( HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE));
|
arenaRecord.setAttackForce( HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false));
|
||||||
arenaRecord.setCreateTime((int)(System.currentTimeMillis()/1000));
|
arenaRecord.setCreateTime((int)(System.currentTimeMillis()/1000));
|
||||||
arenaRecord.setId(KeyGenUtils.produceIdByModule(UUIDEnum.ARENARECORD,Integer.toString(uid)));
|
arenaRecord.setId(KeyGenUtils.produceIdByModule(UUIDEnum.ARENARECORD,Integer.toString(uid)));
|
||||||
RedisUtil.getInstence().putMapEntry(RedisKey.ARENA_RRECORD,Integer.toString(challengeUid),arenaRecord.getId(),arenaRecord);
|
RedisUtil.getInstence().putMapEntry(RedisKey.ARENA_RRECORD,Integer.toString(challengeUid),arenaRecord.getId(),arenaRecord);
|
||||||
|
@ -398,7 +398,7 @@ public class ArenaLogic {
|
||||||
int score =item.getScore().intValue();
|
int score =item.getScore().intValue();
|
||||||
int uid = Integer.parseInt(value);
|
int uid = Integer.parseInt(value);
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE);
|
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false);
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE);
|
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE);
|
||||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||||
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
||||||
|
|
|
@ -929,9 +929,9 @@ public class HeroLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int calHeoForce(User user, Hero hero){
|
public int calHeoForce(User user, Hero hero,boolean isMyself){
|
||||||
Map<Integer, Integer> heroAllAttribute;
|
Map<Integer, Integer> heroAllAttribute;
|
||||||
if(user.getMapManager().getCurMapId() == 0){
|
if(isMyself && user.getMapManager().getCurMapId() == 0){
|
||||||
heroAllAttribute=calHeroNotBufferAttribute(user, hero);
|
heroAllAttribute=calHeroNotBufferAttribute(user, hero);
|
||||||
}else{
|
}else{
|
||||||
heroAllAttribute = calHeroFinalAttributeWhenInMap(user, hero);
|
heroAllAttribute = calHeroFinalAttributeWhenInMap(user, hero);
|
||||||
|
@ -1229,18 +1229,18 @@ public class HeroLogic {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int calTeamTotalForce(User user,int teamId){
|
public int calTeamTotalForce(User targetUser,int teamId,boolean isMyself){
|
||||||
int totalForce =0;
|
int totalForce =0;
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
List<TeamPosHeroInfo> teamPosHeroInfoList = targetUser.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||||
if(teamPosHeroInfoList == null || teamPosHeroInfoList.isEmpty()){
|
if(teamPosHeroInfoList == null || teamPosHeroInfoList.isEmpty()){
|
||||||
return totalForce;
|
return totalForce;
|
||||||
}
|
}
|
||||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfoList) {
|
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfoList) {
|
||||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
Hero hero = targetUser.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||||
if (hero == null) {
|
if (hero == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
totalForce +=calHeoForce(user, hero);
|
totalForce +=calHeoForce(targetUser, hero,isMyself);
|
||||||
}
|
}
|
||||||
return totalForce;
|
return totalForce;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue