fix bug
parent
5ba0990bb0
commit
052a589225
|
@ -1307,7 +1307,7 @@ public class MapLogic {
|
|||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
heroForces += HeroLogic.getInstance().calHeoForce(user, hero);
|
||||
heroForces += HeroLogic.getInstance().calHeoForce(user, hero,true);
|
||||
crossInfo.getHeroIds().add(hero.getTemplateId());
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public class ArenaLogic {
|
|||
.build());
|
||||
}else{
|
||||
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);
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
List<Integer> heroTids = new ArrayList<>(teamPosHeroInfoList.size());
|
||||
|
@ -169,7 +169,7 @@ public class ArenaLogic {
|
|||
myscoreChange = calScore(myscore, defScore,fightResult);
|
||||
arenaRecord.setAttackId(uid);
|
||||
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.setId(KeyGenUtils.produceIdByModule(UUIDEnum.ARENARECORD,Integer.toString(uid)));
|
||||
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 uid = Integer.parseInt(value);
|
||||
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);
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
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;
|
||||
if(user.getMapManager().getCurMapId() == 0){
|
||||
if(isMyself && user.getMapManager().getCurMapId() == 0){
|
||||
heroAllAttribute=calHeroNotBufferAttribute(user, hero);
|
||||
}else{
|
||||
heroAllAttribute = calHeroFinalAttributeWhenInMap(user, hero);
|
||||
|
@ -1229,18 +1229,18 @@ public class HeroLogic {
|
|||
return false;
|
||||
}
|
||||
|
||||
public int calTeamTotalForce(User user,int teamId){
|
||||
public int calTeamTotalForce(User targetUser,int teamId,boolean isMyself){
|
||||
int totalForce =0;
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = targetUser.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
if(teamPosHeroInfoList == null || teamPosHeroInfoList.isEmpty()){
|
||||
return totalForce;
|
||||
}
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfoList) {
|
||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
Hero hero = targetUser.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
totalForce +=calHeoForce(user, hero);
|
||||
totalForce +=calHeoForce(targetUser, hero,isMyself);
|
||||
}
|
||||
return totalForce;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue