好感度技能
parent
6d87330796
commit
7ed038d124
|
@ -171,10 +171,6 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
rpcArenaManager.setFaBaoGongMingSkillMap(user.getHeroManager().getFaBaoGongMingSkillMap());
|
||||
rpcArenaManager.setMaxHistoryForce(user.getPlayerInfoManager().getMaxForce());
|
||||
// 身外化身数据
|
||||
/*List<Integer> list = user.getHeroManager().getTransformationList().values().stream()
|
||||
.filter(v -> v.getStatus() == 1)
|
||||
.mapToInt(TransformationInfo::getCardId)
|
||||
.boxed().collect(Collectors.toList());*/
|
||||
List<Integer> list = new ArrayList<>();
|
||||
user.getHeroManager().getTransformationList().values().stream().filter(v -> v.getStatus() == 1).forEach(n->{
|
||||
Map<Integer, SChangingCard> cardMap = STableManager.getConfig(SChangingCard.class);
|
||||
|
@ -376,9 +372,6 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
if (user != null) {
|
||||
String userStr = gson.toJson(user);
|
||||
JSONObject jsonObject = JSONObject.parseObject(userStr);
|
||||
// JSONObject activityManager = (JSONObject) jsonObject.get("activityManager");
|
||||
// activityManager.remove("activityMissionMapLog");
|
||||
// jsonObject.put("activityManager", activityManager);
|
||||
jsonObject.remove("activityManager");
|
||||
jsonObject.remove("bloodyInfo");
|
||||
jsonObject.getJSONObject("itemManager").put("itemMap",new HashMap<>());
|
||||
|
|
|
@ -124,8 +124,7 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
|||
config = SLodeConfig.lodeConfig.get(myLingmaiId);
|
||||
//int minute = ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60) > 10 ? 10 : ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60);
|
||||
int minute = ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60);
|
||||
int second =((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) % 60) >60 ?
|
||||
60 : ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) % 60);
|
||||
int second = Math.min(((TimeUtils.nowInt() - (int) myLingmai.getGetAwardTimeOrOccupyTime()) % 60), 60);
|
||||
myLingmai.setScore1(myLingmai.getScore1() + minute*config.getRewardList()[0][1]+(second*config.getRewardList()[0][1]/60));
|
||||
//myLingmai.setGetAwardTimeOrOccupyTime(TimeUtils.nowInt());
|
||||
LOGGER.info("uid:"+uid+"first occupy myLingmaiId: "+myLingmaiId+" minute:"+minute+"second:"+second);
|
||||
|
@ -167,21 +166,15 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
|||
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
|
||||
}
|
||||
//其他服玩家rpc 数据调用
|
||||
CrossArenaManager crossArenaManager = null;
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), false);
|
||||
int defforce = 0;
|
||||
if (GameApplication.serverId != csPlayer.getServerId()) {
|
||||
crossArenaManager = PlayerLogic.getInstance().getCrossArenaManagerData(csPlayer);
|
||||
defforce = crossArenaManager.getTotalForceByTeam().getOrDefault(TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), 0);
|
||||
}else{
|
||||
User defuser = UserManager.getUser(defUid);
|
||||
defforce = HeroLogic.getInstance().calTeamTotalForce(defuser, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), false);
|
||||
}
|
||||
|
||||
User defuser = PlayerLogic.getInstance().getUserByRpc(defUid);
|
||||
int defforce = HeroLogic.getInstance().calTeamTotalForce(defuser, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), false);
|
||||
// 本人
|
||||
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(user, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), null, null);
|
||||
//对手
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeCrossPersonData(csPlayer, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), null, crossArenaManager);
|
||||
FightResult fightResult = GetWorldArenaChallengeRequestHandler.getFightForPVP(uid, defUid,
|
||||
fightTeamInfo, defteamInfo, FightUtil.getFightSeed(), myforce < defforce,FightType.CrossLingMaiSecretFight);
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makePersonFightData(defuser, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), null, null);
|
||||
FightResult fightResult = GetWorldArenaChallengeRequestHandler.getFightForPVP(uid, defUid, fightTeamInfo, defteamInfo, FightUtil.getFightSeed(), myforce < defforce, FightType.CrossLingMaiSecretFight);
|
||||
int seed = fightResult.getSeed();
|
||||
CommonProto.FightData build = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(SArenaSetting.getSArenaSetting().getMostTime())
|
||||
|
@ -202,9 +195,8 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
|||
LingMaiSecretArea oldOwner = lingMaiMap.get(String.valueOf(id));//上一个占领者
|
||||
//int minute = ((TimeUtils.nowInt() - (int)oldOwner.getGetAwardTimeOrOccupyTime()) / 60) > 10 ? 10 : ((TimeUtils.nowInt() - (int)oldOwner.getGetAwardTimeOrOccupyTime()) / 60);
|
||||
int minute = ((TimeUtils.nowInt() - (int)oldOwner.getGetAwardTimeOrOccupyTime()) / 60);
|
||||
int second =((TimeUtils.nowInt() - (int)oldOwner.getGetAwardTimeOrOccupyTime()) % 60) >60 ?
|
||||
60 : ((TimeUtils.nowInt() - (int)oldOwner.getGetAwardTimeOrOccupyTime()) % 60);
|
||||
long tempScore = second*config.getRewardList()[0][1]/60;
|
||||
int second = Math.min(((TimeUtils.nowInt() - (int) oldOwner.getGetAwardTimeOrOccupyTime()) % 60), 60);
|
||||
long tempScore = (long) second * config.getRewardList()[0][1] / 60;
|
||||
LOGGER.info("uid:"+uid+"pvp other occupy id:"+id+" minute:"+minute+"second:"+second);
|
||||
//oldOwner.setScore1(oldOwner.getScore1()+minute*config.getRewardList()[0][1]+(int)tempScore);
|
||||
int score1 =oldOwner.getScore1()+minute*config.getRewardList()[0][1]+(int)tempScore;
|
||||
|
@ -217,10 +209,9 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
|||
config = SLodeConfig.lodeConfig.get(myLingmaiId);
|
||||
//minute = ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60) > 10 ? 10 : ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60);
|
||||
minute = ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60);
|
||||
second =((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) % 60) >60 ?
|
||||
60 : ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) % 60);
|
||||
second = Math.min(((TimeUtils.nowInt() - (int) myLingmai.getGetAwardTimeOrOccupyTime()) % 60), 60);
|
||||
LOGGER.info("uid:"+uid+"pvp owner occupy id:"+myLingmaiId+" minute:"+minute+"second:"+second);
|
||||
tempScore =(second*config.getRewardList()[0][1]/60);
|
||||
tempScore =((long) second * config.getRewardList()[0][1] / 60);
|
||||
score1 = myLingmai.getScore1()+minute*config.getRewardList()[0][1]+(int)tempScore;
|
||||
//long newScore = score1+
|
||||
//myLingmai.setScore1(myLingmai.getScore1()+minute*config.getRewardList()[0][1]+(int)tempScore);
|
||||
|
@ -284,14 +275,8 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
|||
ArenaInfoProto.CrossLingmaiIndicationResponse.Builder indication = ArenaInfoProto.CrossLingmaiIndicationResponse.newBuilder();
|
||||
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.CrossLingmaiIndicationResponse_VALUE, indication.build(), true);
|
||||
}else{
|
||||
//CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(proto.getChallengeUid());
|
||||
if (csPlayer == null){
|
||||
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
|
||||
}else{
|
||||
boolean hongdian = PlayerLogic.getInstance().sendCrossLingmaiHongdian(csPlayer);
|
||||
LOGGER.info("跨服灵脉红点:"+hongdian);
|
||||
}
|
||||
|
||||
boolean hongdian = PlayerLogic.getInstance().sendCrossLingmaiHongdian(csPlayer);
|
||||
LOGGER.info("跨服灵脉红点:"+hongdian);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -413,25 +413,12 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
}
|
||||
|
||||
public static boolean updateResult(User user,int i, int[] myteamId, int[] defTeamId, int[] result,CSPlayer csPlayer,CrossArenaManager crossArenaManager, ArenaRecord arenaRecord) throws Exception{
|
||||
/*if (myteamId[i] == 0 || defTeamId[i] == 0) {
|
||||
if (myteamId[i] == 0 && defTeamId[i] == 0) {
|
||||
result[i] = 0;
|
||||
}
|
||||
if (myteamId[i] == 1 && defTeamId[i] == 0) {
|
||||
result[i] = 1;
|
||||
}
|
||||
if (myteamId[i] == 0 && defTeamId[i] == 1) {
|
||||
result[i] = 0;
|
||||
}
|
||||
return false;
|
||||
}*/
|
||||
//没有队伍时候 直接断定对方赢
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
|
||||
if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).size() == 0){
|
||||
result[i] = 0;
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeCrossPersonData(csPlayer, defTeamId[i], arenaRecord, crossArenaManager);
|
||||
CommonProto.FightData build = CommonProto.FightData.newBuilder()
|
||||
.addMonsterList(defteamInfo).build();
|
||||
CommonProto.FightData build = CommonProto.FightData.newBuilder().addMonsterList(defteamInfo).build();
|
||||
//数据互换
|
||||
byte[] snapRecord = build.toByteArray();
|
||||
if (i == 0) {
|
||||
|
@ -446,7 +433,6 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
|
|||
int addforce = HeroLogic.getInstance().calTeamTotalForce(defuser, myteamId[i], false);
|
||||
arenaRecord.getYxldDefForce().add(addforce);
|
||||
}else{
|
||||
List<com.ljsd.jieling.thrift.idl.TeamPosHeroInfo> teamPosHeroInfos = crossArenaManager.getTeams().getOrDefault(myteamId[i], new ArrayList<>());
|
||||
int addforcerpc = crossArenaManager.getTotalForceByTeam().get(myteamId[i]);
|
||||
arenaRecord.getYxldDefForce().add(addforcerpc);
|
||||
}
|
||||
|
|
|
@ -146,18 +146,36 @@ public class HeroManager extends MongoBase {
|
|||
//所有神将总好感度带来的属性加成(包含特权加成) 20220812修改,好感度加成属性读表计算,不再记录到数据库
|
||||
private Map<Integer,Integer> allLikablePropAddMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 获取单个英雄好感度加成属性
|
||||
* @param heroTId
|
||||
* @return
|
||||
*/
|
||||
public Map<Integer,Integer> getHeroLikablePropAddMap(int heroTId) {
|
||||
Integer curHeroLikableNum = getHeroLikableMap().getOrDefault(heroTId, 0);
|
||||
int curLv = HeroUpLikableRequestHandler.GetHeroLikableLvByLikaNum(curHeroLikableNum);
|
||||
return HeroUpLikableRequestHandler.GetHeroLikableAddPeop(curLv);
|
||||
}
|
||||
|
||||
public Map<Integer,Integer> getAllLikablePropAddMap() {
|
||||
/**
|
||||
* 获取总好感度加成属性
|
||||
* @return
|
||||
*/
|
||||
public Map<Integer,Integer> getAllLikablePropAddMap() {
|
||||
int allHeroLikableNum = HeroUpLikableRequestHandler.GetAllHeroLikableNum(getHeroLikableMap());
|
||||
int curAllLikeLv = HeroUpLikableRequestHandler.GetAllLikableLvByLikaNum(allHeroLikableNum);
|
||||
return HeroUpLikableRequestHandler.GetAllHeroLikableAddPeop(curAllLikeLv);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取总好感度等级
|
||||
* @return
|
||||
*/
|
||||
public int getTotalLikeLv() {
|
||||
int allHeroLikableNum = HeroUpLikableRequestHandler.GetAllHeroLikableNum(getHeroLikableMap());
|
||||
return HeroUpLikableRequestHandler.GetAllLikableLvByLikaNum(allHeroLikableNum);
|
||||
}
|
||||
|
||||
private int likableSendTime;//好感度已赠送次数
|
||||
|
||||
public int getLikableSendTime() { return likableSendTime; }
|
||||
|
|
|
@ -28,13 +28,13 @@ public class HeroVo {
|
|||
private int HMEspecialEquipLevel;
|
||||
private int propertyId;
|
||||
private int godSoulLv;
|
||||
private int likeLv;
|
||||
private Map<Integer, Integer> soulEquipByPositionMap = new HashMap<>();
|
||||
private Map<Integer, Integer> godSealByPositionMap = new HashMap<>();
|
||||
private Map<Integer, PurpleMansionSeal> purpleMansionSealMap = new HashMap<>();
|
||||
private Map<Integer, Integer> HMEquipPositionMap = new HashMap<>();
|
||||
private Map<Integer, Integer> faBaoGongMingSkillMap = new HashMap<>();
|
||||
private Map<Integer, Long> userMountValidTime = new HashMap<>();
|
||||
|
||||
private Map<String, Jewel> jewelMap = new HashMap<>();
|
||||
|
||||
public HeroVo(User user, Hero hero) {
|
||||
|
@ -47,6 +47,7 @@ public class HeroVo {
|
|||
this.HMEspecialEquipLevel = hero.getEspecialEquipLevelByHongmeng(heroManager,hero.getId());
|
||||
this.propertyId = hero.getPropertyId();
|
||||
this.godSoulLv = hero.getGodSoulLv();
|
||||
this.likeLv = heroManager.getTotalLikeLv();
|
||||
this.soulEquipByPositionMap = new HashMap<>(hero.getSoulEquipByPositionMap());
|
||||
this.godSealByPositionMap = new HashMap<>(hero.getGodSealByPositionMap());
|
||||
this.purpleMansionSealMap = new HashMap<>(heroManager.getPurpleMansionSeal());
|
||||
|
@ -56,26 +57,6 @@ public class HeroVo {
|
|||
this.jewelMap = new HashMap<>(CBean2Proto.jewelOfLocal(user,hero));
|
||||
}
|
||||
|
||||
public HeroVo(CrossArenaManager arena, ArenaOfHero hero) {
|
||||
this.id = hero.getId();
|
||||
this.templateId = hero.getTemplateId();
|
||||
this.star = hero.getStar();
|
||||
this.HMBreakId = hero.getBreakId();
|
||||
this.starBreakId = hero.getStarBreakId();
|
||||
this.HMEspecialEquipLevel = hero.getEspecialEquipLevel();
|
||||
this.propertyId = hero.getPropertyId();
|
||||
this.godSoulLv = hero.getGodSoulLv();
|
||||
this.soulEquipByPositionMap = new HashMap<>(hero.getSoulEquipByPositionMap());
|
||||
this.godSealByPositionMap = new HashMap<>(hero.getGodSealByPositionMap());
|
||||
this.purpleMansionSealMap = CBean2Proto.sealOfCross(arena.getSeals());
|
||||
this.HMEquipPositionMap = new HashMap<>(hero.getEquipByPositionMap());
|
||||
this.faBaoGongMingSkillMap = new HashMap<>(arena.getFaBaoGongMingSkillMap());
|
||||
this.userMountValidTime = new HashMap<>();
|
||||
this.jewelMap = new HashMap<>(CBean2Proto.jewelOfCross(arena,hero));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -84,6 +65,10 @@ public class HeroVo {
|
|||
return godSoulLv;
|
||||
}
|
||||
|
||||
public int getLikeLv() {
|
||||
return likeLv;
|
||||
}
|
||||
|
||||
public int getPropertyId() {
|
||||
if (propertyId == 0) {
|
||||
SCHero scHero = SCHero.getsCHero().get(templateId);
|
||||
|
|
|
@ -712,88 +712,43 @@ public class FightUtil {
|
|||
return null;//throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
if (GameApplication.serverId == csPlayer.getServerId()) {
|
||||
//本服玩家
|
||||
User user = UserManager.getUser(csPlayer.getUserId());
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().getOrDefault(teamId, new ArrayList<>());
|
||||
int addforce = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
|
||||
if(arenaRecord != null){
|
||||
arenaRecord.setAttackForce(arenaRecord.getAttackForce() + addforce);
|
||||
arenaRecord.getYxldDefForce().add(addforce);
|
||||
}
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero hero = user.getHeroManager().getHeroMap().get(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user, hero, skillSb).toString();
|
||||
Map<Integer, Long> attributeMap = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, false, teamId);
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb, hero.getPropertyId(), hero.getLevel(user.getHeroManager()), attributeMap).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0, heroSkill.length() - 1))
|
||||
.setProperty(property.substring(0, property.length() - 1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv((hero.getGodSoulLv()))
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.addAllPokemonUnitList(HeroLogic.getInstance().getCrossPokemonSkills(user))
|
||||
.setTeamPassiveList("")
|
||||
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
|
||||
.build();
|
||||
} else {
|
||||
//其他服玩家
|
||||
if (crossArenaManager == null) {
|
||||
LOGGER.error("Exception::=>{}", "rpc data is empty");
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
List<com.ljsd.jieling.thrift.idl.TeamPosHeroInfo> teamPosHeroInfos = crossArenaManager.getTeams().getOrDefault(teamId, new ArrayList<>());
|
||||
int addforcerpc = crossArenaManager.getTotalForceByTeam().get(teamId);
|
||||
if(arenaRecord != null){
|
||||
arenaRecord.getYxldDefForce().add(addforcerpc);
|
||||
arenaRecord.setAttackForce(arenaRecord.getAttackForce() + addforcerpc);
|
||||
}
|
||||
//Collection<PurpleMansionSeal> seals = crossArenaManager.getSeals().values();
|
||||
for (com.ljsd.jieling.thrift.idl.TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
com.ljsd.jieling.thrift.idl.ArenaOfHero hero = crossArenaManager.getHeros().get(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getCrossHeroSkillStr(crossArenaManager, hero).toString();
|
||||
Map<Integer, Long> attributeMap = crossArenaManager.getHeros().get(hero.getId()).getAttributeMapByTeamBattle().get(teamId);
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb, hero.getPropertyId(), hero.getLevel(), attributeMap).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0, heroSkill.length() - 1))
|
||||
.setProperty(property.substring(0, property.length() - 1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.addAllPokemonUnitList(HeroLogic.getInstance().getCrossPokemon(crossArenaManager,csPlayer))
|
||||
.setTeamPassiveList("")
|
||||
.setForceScore(crossArenaManager.getMaxHistoryForce())
|
||||
.build();
|
||||
User userByRpc = PlayerLogic.getInstance().getUserByRpc(csPlayer.getUserId());
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = userByRpc.getTeamPosManager().getTeamPosForHero().getOrDefault(teamId, new ArrayList<>());
|
||||
int addforce = HeroLogic.getInstance().calTeamTotalForce(userByRpc, teamId, false);
|
||||
if(arenaRecord != null){
|
||||
arenaRecord.setAttackForce(arenaRecord.getAttackForce() + addforce);
|
||||
arenaRecord.getYxldDefForce().add(addforce);
|
||||
}
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero hero = userByRpc.getHeroManager().getHeroMap().get(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(userByRpc, hero, skillSb).toString();
|
||||
Map<Integer, Long> attributeMap = HeroLogic.getInstance().calHeroNotBufferAttribute(userByRpc, hero, false, teamId);
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb, hero.getPropertyId(), hero.getLevel(userByRpc.getHeroManager()), attributeMap).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0, heroSkill.length() - 1))
|
||||
.setProperty(property.substring(0, property.length() - 1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv((hero.getGodSoulLv()))
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.addAllPokemonUnitList(HeroLogic.getInstance().getCrossPokemonSkills(userByRpc))
|
||||
.setTeamPassiveList("")
|
||||
.setForceScore(HeroLogic.getInstance().calTeamForce(userByRpc,teamId))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2236,6 +2236,12 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
|
||||
// 好感度技能
|
||||
SLikeAbilityConfig abilityConfig = SLikeAbilityConfig.allLikeAbilityConfigMap.get(heroVo.getLikeLv());
|
||||
for (int skill : abilityConfig.getSkill()) {
|
||||
skillList.add(skill);
|
||||
}
|
||||
|
||||
return skillList;
|
||||
}
|
||||
|
||||
|
@ -2250,33 +2256,6 @@ public class HeroLogic {
|
|||
return originGetHeroSkillList(heroVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨服获取英雄技能
|
||||
* @param crossArenaManager
|
||||
* @param hero
|
||||
* @return
|
||||
*/
|
||||
public StringBuilder getCrossHeroSkillStr(CrossArenaManager crossArenaManager, com.ljsd.jieling.thrift.idl.ArenaOfHero hero) {
|
||||
|
||||
HeroVo heroVo = new HeroVo(crossArenaManager, hero);
|
||||
List<Integer> skillList = originGetHeroSkillList(heroVo);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
coverSkill(skillList);
|
||||
for (int i = 0; i < skillList.size(); i++) {
|
||||
Integer skill = skillList.get(i);
|
||||
if (i < 2) {
|
||||
sb.append(skill).append(DIVISION);
|
||||
continue;
|
||||
}
|
||||
SPassiveSkillLogicConfig config1 = SPassiveSkillLogicConfig.getConfig(skill);
|
||||
if (config1 != null && config1.getEffectiveRange() == 1) {
|
||||
sb.append(skill).append(DIVISION);
|
||||
}
|
||||
}
|
||||
return sb;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取紫府神印技能
|
||||
*
|
||||
|
|
|
@ -22,6 +22,7 @@ public class SLikeAbilityConfig implements BaseConfig {
|
|||
|
||||
private int[][] privilegeProperty;
|
||||
|
||||
private int[] skill;
|
||||
|
||||
public static Map<Integer, SLikeAbilityConfig> sLikeAbilityConfigMap;
|
||||
|
||||
|
@ -77,5 +78,9 @@ public class SLikeAbilityConfig implements BaseConfig {
|
|||
public int[][] getPrivilegeProperty() {
|
||||
return privilegeProperty;
|
||||
}
|
||||
|
||||
public int[] getSkill() {
|
||||
return skill;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue