修行技能战斗相关脚本修改

back_recharge
yuanshuai 2021-10-20 18:24:43 +08:00
parent e9350ef9e3
commit 578cc29315
5 changed files with 56 additions and 5 deletions

View File

@ -159,9 +159,10 @@ public class GetWorldArenaChallengeRequestHandler extends BaseHandler<WorldProto
int defendForce = 0;
if (proto.getChallengeUid()>1000) {
ArenaOfUser arenaOfUser = CrossServiceLogic.getInstance().query(proto.getChallengeUid());
teamInfo = FightUtil.makeCrossPersonData(arenaOfUser,proto.getTeamId());
arenaEnemys =ArenaLogic.getInstance().getUserCrossArenaEnemy(crossGroup,arenaOfUser,proto.getChallengeRank(),false).build();
defendForce = arenaOfUser.getHeroManager().getTotalForceByTeam().get(proto.getTeamId());
teamInfo = FightUtil.makeCrossPersonData(arenaOfUser,proto.getTeamId(),defendForce);
arenaEnemys =ArenaLogic.getInstance().getUserCrossArenaEnemy(crossGroup,arenaOfUser,proto.getChallengeRank(),false).build();
} else {
//机器人

View File

@ -277,6 +277,7 @@ public class BehaviorUtil {
.addAllFightUnitList(heroFightInfos)
.addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user,teamId))
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
}

View File

@ -670,7 +670,7 @@ public class ArenaLogic {
//跨服切磋
ArenaOfUser user = CrossServiceLogic.getInstance().query(challengeUid);
deforce = user.getHeroManager().getTotalForceByTeam().get(myteamId);
deffightTeamInfo = FightUtil.makeCrossPersonData(user,myteamId);
deffightTeamInfo = FightUtil.makeCrossPersonData(user,myteamId,deforce);
}
if(myforce<deforce){
deffightTeamInfo = CommonProto.FightTeamInfo.newBuilder().mergeFrom(deffightTeamInfo).setFirstCamp(1).build();

View File

@ -293,6 +293,7 @@ public class FightUtil {
newBuilder()
.addAllFightUnitList(heroFightInfos)
.addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
}
@ -339,6 +340,7 @@ public class FightUtil {
.addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user, teamId))
.setSpecialPassive(SpecialForTeamBuildEnum.toParm(teamId, user))
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
}
@ -405,6 +407,7 @@ public class FightUtil {
.addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user, teamId))
.setSpecialPassive(SpecialForTeamBuildEnum.toParm(teamId, user))
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
}
@ -444,6 +447,7 @@ public class FightUtil {
.addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user, teamId))
.setSpecialPassive(SpecialForTeamBuildEnum.toParm(teamId, user))
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
}
@ -486,6 +490,7 @@ public class FightUtil {
.addAllFightUnitList(heroFightInfos)
.addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user, teamId))
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
}
@ -533,6 +538,7 @@ public class FightUtil {
.addAllFightUnitList(heroFightInfos)
// .addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
.setTeamPassiveList(HeroLogic.getInstance().getRobotPokenmonPassiveSkills(sArenaRobotConfig))
.setForceScore(sArenaRobotConfig.getTotalForce())
.build();
}
@ -588,6 +594,7 @@ public class FightUtil {
.addAllFightUnitList(heroFightInfos)
// .addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
.setTeamPassiveList(HeroLogic.getInstance().getRobotPokenmonPassiveSkills(sArenaRobotConfig))
.setForceScore(sArenaRobotConfig.getTotalForce())
.build();
}
@ -633,7 +640,7 @@ public class FightUtil {
return robotInfo;
}
public static CommonProto.FightTeamInfo makeCrossPersonData(ArenaOfUser arenaOfUser, int teamId) {
public static CommonProto.FightTeamInfo makeCrossPersonData(ArenaOfUser arenaOfUser, int teamId,long deforce) {
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
ArenaOfHeroManager heroManager = arenaOfUser.getHeroManager();
List<TeamPosHeroInfo> teamPosHeroInfos = heroManager.getTeams().get(teamId);
@ -662,6 +669,7 @@ public class FightUtil {
.addAllFightUnitList(heroFightInfos)
.addAllPokemonUnitList(HeroLogic.getInstance().getCrossPokemonSkills(arenaOfUser))
.setTeamPassiveList("")
.setForceScore(deforce)
.build();
}
@ -704,6 +712,7 @@ public class FightUtil {
.addAllFightUnitList(heroFightInfos)
.addAllPokemonUnitList(HeroLogic.getInstance().getCrossPokemonSkills(user))
.setTeamPassiveList("")
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
} else {
//其他服玩家
@ -741,6 +750,7 @@ public class FightUtil {
.addAllFightUnitList(heroFightInfos)
.addAllPokemonUnitList(HeroLogic.getInstance().getCrossPokemon(crossArenaManager))
.setTeamPassiveList("")
.setForceScore(addforcerpc)
.build();
}
}

View File

@ -55,6 +55,7 @@ import config.*;
import manager.STableManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.mongodb.core.aggregation.ArithmeticOperators;
import rpc.protocols.*;
import sun.security.ssl.Debug;
import util.MathUtils;
@ -2380,9 +2381,29 @@ public class HeroLogic{
.setPosition(entry.getKey())
.setStar(pokemon.getStar())
.setProperty(propertyBuilder.toString())
.setUnitId(String.valueOf(pokemon.getTmpId())).setUnitSkillIds(String.valueOf(sSpiritAnimalSkill.getId())).build();
.setUnitId(String.valueOf(pokemon.getTmpId()))
.setUnitSkillIds(String.valueOf(sSpiritAnimalSkill.getId()))
.build();
pokemonInfos.add(info);
}
String skillStr="";
for (Map.Entry<Integer, Integer> entry : user.getHeroManager().getPracticeSkillMap().entrySet()) {
int skillId=SPlayerSkill.GetSPlayerSkill(entry.getKey(),entry.getValue()).getId();
if (skillStr.isEmpty()){
skillStr+= skillId;
}else{
skillStr+= "#"+skillId;
}
}
CommonProto.FightUnitInfo skillInfo = CommonProto.FightUnitInfo
.newBuilder()
.setUnitId("0")
.setUnitSkillIds(skillStr)
.setProperty("0")
.setPosition(100)
.setSkinId(0)
.build();
pokemonInfos.add(skillInfo);
return pokemonInfos;
}
@ -3106,6 +3127,24 @@ public class HeroLogic{
return l;
}
///获取最高战斗力
public long calTeamForce(User user,int teamId){
return user.getPlayerInfoManager().getMaxForce();
//之前是当前编队战斗力
/*long teamForce = 0;
List<TeamPosHeroInfo> teamHeros = user.getTeamPosManager().getTeamPosForHero().get(teamId);
if (teamHeros==null||teamHeros.isEmpty()) {
return teamForce;
}
for (TeamPosHeroInfo teamHero : teamHeros) {
Hero _hero = user.getHeroManager().getHero(teamHero.getHeroId());
long heroForce = calHeoForce(user, _hero, teamId);
teamForce += heroForce;
}
LOGGER.info("编队id{} 战斗力:{}",teamId,teamForce);
return teamForce;*/
}
public int calForce( Map<Integer, Long> heroAllAttribute ){
double result = 0;