玉虚论道去除平衡属性

grimm 2024-06-22 15:56:10 +08:00
parent 8e027f181e
commit dd720d785e
5 changed files with 143 additions and 118 deletions

View File

@ -33,6 +33,7 @@ import config.SMServerArenaSetting;
import config.SMServerRankConfig;
import manager.STableManager;
import org.assertj.core.util.Lists;
import org.springframework.stereotype.Component;
import rpc.protocols.ArenaInfoProto;
import rpc.protocols.CommonProto;
import rpc.protocols.MessageTypeProto;
@ -44,6 +45,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component
public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.CrossYuXuLunDaoChallengeRequest> {
@ -350,6 +352,10 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
if (csPlayer == null){
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
}
User defUser = PlayerLogic.getInstance().getUserByRpc(csPlayer.getUserId());
if (defUser == null) {
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
}
String defServerName = CrossServiceLogic.simplifyServerName(csPlayer.getServerId());
arenaRecord.setCreateTime(TimeUtils.nowInt()); // 时间
arenaRecord.setAttackId(defUserUid); //id
@ -361,12 +367,12 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
arenaRecord.setServerName(defServerName);
for (int i = 0; i < 3; i++) {
//编队为空 判输赢
if (!updateResult(myUser,i, myteamId, defTeamId, result,csPlayer,arenaRecord)) {
if (!updateResult(myUser,i, myteamId, defTeamId, result, csPlayer, arenaRecord)) {
continue;
}
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(myUser, myteamId[i], null, null);
//对手 修行等级 区服名称 战斗类行 积分变化情况
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeYuxuCrossPersonData(csPlayer, defTeamId[i], arenaRecord);
CommonProto.FightTeamInfo defteamInfo = FightUtil.makePersonFightData(defUser, defTeamId[i], null, null);
//根据战力判断先后手
long myforce = 0,defforce = 0;
@ -423,9 +429,11 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
if (i == 2) {
arenaRecord.setYxldFightData3(snapRecord);
}
User defuser = PlayerLogic.getInstance().getUserByRpc(csPlayer.getUserId());
long addforce = HeroLogic.getInstance().calTeamTotalForce(defuser, myteamId[i]);
arenaRecord.getYxldDefForce().add(addforce);
CSPlayer player = CrossServiceLogic.getPlayerByRedis(csPlayer.getUserId());
if (player == null) {
return false;
}
arenaRecord.getYxldDefForce().add(player.getYuxuForce());
return false;
}
return true;

View File

@ -215,10 +215,10 @@ public class BehaviorUtil {
return FightUtil.getFightTeamInfo(user,teamId);
}
//玉虚论道队伍有统一的属性修正
if (teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId() || teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()
|| teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()) {
return FightUtil.getYuxuTeam(user, teamId, null,null);
}
// if (teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId() || teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()
// || teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()) {
// return FightUtil.getYuxuTeam(user, teamId, null,null);
// }
user.getTeamPosManager().setCurTeamPosId(teamId);
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);

View File

@ -227,7 +227,7 @@ public class CrossYuxulundaoLogic {
arenaRank.addAll(SArenaRobotConfig.getSArenaRobotConfigsByRangeAndCount(con.getScoreLow1(),con.getScoreUp1(),5));
}
//没有高分段机器人 从相近的里面取机器人
if(arenaRank.size() == 0){
if(arenaRank.isEmpty()){
for(int i= con.getId()-1;i>0;i--){
SMServerRankConfig serverRankConfig = SMServerRankConfig.serverRankConfig.get(i);
arenaRank.addAll(SArenaRobotConfig.getSArenaRobotConfigsByRangeAndCount(con.getScoreLow1(),con.getScoreUp1(),5));

View File

@ -6,7 +6,6 @@ import com.ljsd.fight.ArenaRecord;
import com.ljsd.fight.CheckFight;
import com.ljsd.fight.DefFightSnapData;
import com.ljsd.fight.FightType;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode;
@ -335,10 +334,10 @@ public class FightUtil {
return getEndlessTeam(user, teamId, attackBloodMap);
}
//玉虚论道队伍有统一的属性修正
if (teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId() || teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()
|| teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()) {
return getYuxuTeam(user, teamId, attackBloodMap,null);
}
// if (teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_ONE.getTeamId() || teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_TWO.getTeamId()
// || teamId == TeamEnum.CROSS_YU_XU_LUN_DAO_THREE.getTeamId()) {
// return getYuxuTeam(user, teamId, attackBloodMap,null);
// }
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
@ -634,49 +633,49 @@ public class FightUtil {
/**
*
*/
public static CommonProto.FightTeamInfo getYuxuTeam(User user, int teamId, Map<String, Integer> attackBloodMap,ArenaRecord arenaRecord) {
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
if(arenaRecord != null){
long addforce = HeroLogic.getInstance().calTeamTotalForce(user, teamId);
arenaRecord.setAttackForce(arenaRecord.getAttackForce() + addforce);
arenaRecord.getYxldDefForce().add(addforce);
}
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
if (hero == null) {
continue;
}
//玉虚英雄取通用属性
Hero yuxuHero = HeroLogic.getInstance().getYuHero(hero.getTemplateId());
if(yuxuHero == null){
continue;
}
Map<Integer, SEndlessHeroProp> config = STableManager.getConfig(SEndlessHeroProp.class);
SEndlessHeroProp sEndlessHeroProp = config.get(hero.getTemplateId());
Map<Integer, Long> heroAttributeMap = new HashMap<>();
for (int[] prop : sEndlessHeroProp.getProps()) {
heroAttributeMap.put(prop[0], (long) prop[1]);
}
if (attackBloodMap != null && attackBloodMap.containsKey(teamPosHeroInfo.getHeroId())) {
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) - attackBloodMap.get(teamPosHeroInfo.getHeroId()) * heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) / 100);
}
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(GlobalsDef.HP_TYPE));
StringBuilder stringBuilder = new StringBuilder();
StringBuilder propertySb = new StringBuilder();
String heroSkill = HeroLogic.getInstance().getYuxuHeroSkills(user, hero, yuxuHero,stringBuilder).toString();
getHeroPropertyBuid2(heroFightInfos, teamPosHeroInfo, hero, heroAttributeMap, propertySb, heroSkill, yuxuHero.getLevel(user), yuxuHero.getStar(), yuxuHero.getGodSoulLv());
}
//玉虚不继承任何英雄外的技能
return CommonProto.FightTeamInfo.
newBuilder()
.addAllFightUnitList(heroFightInfos)
.addAllPokemonUnitList( new ArrayList<>())
.setTeamPassiveList("")
.setSpecialPassive("")
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
}
// public static CommonProto.FightTeamInfo getYuxuTeam(User user, int teamId, Map<String, Integer> attackBloodMap,ArenaRecord arenaRecord) {
// List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
// if(arenaRecord != null){
// long addforce = HeroLogic.getInstance().calTeamTotalForce(user, teamId);
// arenaRecord.setAttackForce(arenaRecord.getAttackForce() + addforce);
// arenaRecord.getYxldDefForce().add(addforce);
// }
// List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
// for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
// Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
// if (hero == null) {
// continue;
// }
// //玉虚英雄取通用属性
// Hero yuxuHero = HeroLogic.getInstance().getYuHero(hero.getTemplateId());
// if(yuxuHero == null){
// continue;
// }
// Map<Integer, SEndlessHeroProp> config = STableManager.getConfig(SEndlessHeroProp.class);
// SEndlessHeroProp sEndlessHeroProp = config.get(hero.getTemplateId());
// Map<Integer, Long> heroAttributeMap = new HashMap<>();
// for (int[] prop : sEndlessHeroProp.getProps()) {
// heroAttributeMap.put(prop[0], (long) prop[1]);
// }
// if (attackBloodMap != null && attackBloodMap.containsKey(teamPosHeroInfo.getHeroId())) {
// heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) - attackBloodMap.get(teamPosHeroInfo.getHeroId()) * heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) / 100);
// }
// heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(GlobalsDef.HP_TYPE));
// StringBuilder stringBuilder = new StringBuilder();
// StringBuilder propertySb = new StringBuilder();
// String heroSkill = HeroLogic.getInstance().getYuxuHeroSkills(user, hero, yuxuHero,stringBuilder).toString();
// getHeroPropertyBuid2(heroFightInfos, teamPosHeroInfo, hero, heroAttributeMap, propertySb, heroSkill, yuxuHero.getLevel(user), yuxuHero.getStar(), yuxuHero.getGodSoulLv());
// }
// //玉虚不继承任何英雄外的技能
// return CommonProto.FightTeamInfo.
// newBuilder()
// .addAllFightUnitList(heroFightInfos)
// .addAllPokemonUnitList( new ArrayList<>())
// .setTeamPassiveList("")
// .setSpecialPassive("")
// .setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
// .build();
// }
/**
*
@ -739,11 +738,11 @@ public class FightUtil {
/**
*
*/
public static CommonProto.FightTeamInfo makeYuxuCrossPersonData(CSPlayer csPlayer, int teamId, ArenaRecord arenaRecord) {
if (csPlayer == null) {
return null;
}
User user = PlayerLogic.getInstance().getUserByRpc(csPlayer.getUserId());
return getYuxuTeam(user, teamId, null,arenaRecord);
}
// public static CommonProto.FightTeamInfo makeYuxuCrossPersonData(CSPlayer csPlayer, int teamId, ArenaRecord arenaRecord) {
// if (csPlayer == null) {
// return null;
// }
// User user = PlayerLogic.getInstance().getUserByRpc(csPlayer.getUserId());
// return getYuxuTeam(user, teamId, null,arenaRecord);
// }
}

View File

@ -5137,6 +5137,24 @@ public class HeroLogic {
for (Integer equip : equipManager.getSoulGealList()) {
builder.addEquipGot(equip);
}
if (!user.getItemManager().getIsAbsEquip()) {
for (Map.Entry<Integer, Item> equipEntry : user.getItemManager().getItemMap().entrySet()) {
SItem sItem = SItem.getsItemMap().get(equipEntry.getKey());
if (sItem == null) {
LOGGER.error("item not found:{}", equipEntry.getKey());
continue;
}
if (sItem.getItemType() == 3) {
user.getItemManager().setEquipBookMap(equipEntry.getValue().getItemId(), equipEntry.getValue().getItemNum());
}
}
for (Map.Entry<String, Hero> stringHeroEntry : user.getHeroManager().getHeroMap().entrySet()) {
for (Map.Entry<Integer, Integer> entry : stringHeroEntry.getValue().getEquipByPositionMap().entrySet()) {
user.getItemManager().setEquipBookMap(entry.getValue(), 1);
}
}
user.getItemManager().setAbsEquip(true);
}
for (Map.Entry<Integer, Long> entry : user.getItemManager().getEquipBookMap().entrySet()) {
CommonProto.EquipBookInfo equipBook = CommonProto.EquipBookInfo.newBuilder()
.setEquipId(entry.getKey())
@ -6814,22 +6832,22 @@ public class HeroLogic {
* @param sb
* @return
*/
public StringBuilder getYuxuHeroSkills(User user, Hero hero, Hero yuxuHero, StringBuilder sb) {
List<Integer> heroSkillList = getYuxuHeroSkillList(user, hero, yuxuHero);
coverSkill(heroSkillList);
for (int i = 0; i < heroSkillList.size(); i++) {
Integer skill = heroSkillList.get(i);
if (i < 2) {
sb.append(skill).append(DIVISION);
continue;
}
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
if (config != null && config.getEffectiveRange() == 1) {
sb.append(skill).append(DIVISION);
}
}
return sb;
}
// public StringBuilder getYuxuHeroSkills(User user, Hero hero, Hero yuxuHero, StringBuilder sb) {
// List<Integer> heroSkillList = getYuxuHeroSkillList(user, hero, yuxuHero);
// coverSkill(heroSkillList);
// for (int i = 0; i < heroSkillList.size(); i++) {
// Integer skill = heroSkillList.get(i);
// if (i < 2) {
// sb.append(skill).append(DIVISION);
// continue;
// }
// SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
// if (config != null && config.getEffectiveRange() == 1) {
// sb.append(skill).append(DIVISION);
// }
// }
// return sb;
// }
/**
* , ,
@ -6839,43 +6857,43 @@ public class HeroLogic {
* @param yuxuHero
* @return
*/
public List<Integer> getYuxuHeroSkillList(User user, Hero hero, Hero yuxuHero) {
List<Integer> skillList = new ArrayList<>();
SCHero tempHero = SCHero.getsCHero().get(hero.getTemplateId());
//英雄技能取统一的玉虚配置英雄
List<Integer> skillListByStar = tempHero.getSkillListByStar(yuxuHero.getStar());
if (skillListByStar != null) {
skillList.addAll(skillListByStar);
}
// 大于10星觉醒技
if (yuxuHero.getStar() > HERO_MAX_STAR) {
skillList.addAll(tempHero.getAwakSkills(1, yuxuHero.getBreakId()));
skillList.addAll(tempHero.getAwakSkills(2, yuxuHero.getStarBreakId()));
} else {
skillList.addAll(tempHero.getPassiveSkills(1, yuxuHero.getBreakId()));
skillList.addAll(tempHero.getPassiveSkills(2, yuxuHero.getStarBreakId()));
}
// 角色初始被动
int[] skillLogicConfig = tempHero.getInitialPassiveSkillLogicConfig();
if (skillLogicConfig != null) {
for (int skill : skillLogicConfig) {
skillList.add(skill);
}
}
Map<Integer, SEquipConfig> config = STableManager.getConfig(SEquipConfig.class);
//魂印取统一配置
Map<Integer, Integer> soulEquipByPositionMap = yuxuHero.getSoulEquipByPositionMap();
soulEquipByPositionMap.values().forEach(e -> Arrays.stream(config.get(e).getPassiveSkill()).forEach(skillList::add));
//神印取统一配置
Map<Integer, Integer> godSealByPositionMap = yuxuHero.getGodSealByPositionMap();
godSealByPositionMap.values().forEach(e -> Arrays.stream(config.get(e).getPassiveSkill()).forEach(skillList::add));
return skillList;
}
// public List<Integer> getYuxuHeroSkillList(User user, Hero hero, Hero yuxuHero) {
// List<Integer> skillList = new ArrayList<>();
// SCHero tempHero = SCHero.getsCHero().get(hero.getTemplateId());
// //英雄技能取统一的玉虚配置英雄
// List<Integer> skillListByStar = tempHero.getSkillListByStar(yuxuHero.getStar());
// if (skillListByStar != null) {
// skillList.addAll(skillListByStar);
// }
// // 大于10星觉醒技
// if (yuxuHero.getStar() > HERO_MAX_STAR) {
// skillList.addAll(tempHero.getAwakSkills(1, yuxuHero.getBreakId()));
// skillList.addAll(tempHero.getAwakSkills(2, yuxuHero.getStarBreakId()));
// } else {
// skillList.addAll(tempHero.getPassiveSkills(1, yuxuHero.getBreakId()));
// skillList.addAll(tempHero.getPassiveSkills(2, yuxuHero.getStarBreakId()));
// }
//
// // 角色初始被动
// int[] skillLogicConfig = tempHero.getInitialPassiveSkillLogicConfig();
// if (skillLogicConfig != null) {
// for (int skill : skillLogicConfig) {
// skillList.add(skill);
// }
// }
//
// Map<Integer, SEquipConfig> config = STableManager.getConfig(SEquipConfig.class);
//
// //魂印取统一配置
// Map<Integer, Integer> soulEquipByPositionMap = yuxuHero.getSoulEquipByPositionMap();
// soulEquipByPositionMap.values().forEach(e -> Arrays.stream(config.get(e).getPassiveSkill()).forEach(skillList::add));
//
// //神印取统一配置
// Map<Integer, Integer> godSealByPositionMap = yuxuHero.getGodSealByPositionMap();
// godSealByPositionMap.values().forEach(e -> Arrays.stream(config.get(e).getPassiveSkill()).forEach(skillList::add));
//
// return skillList;
// }
/**
* , ,