fix
parent
55f5ee6eb5
commit
55301d2894
|
@ -809,7 +809,7 @@ public class MapLogic {
|
|||
}
|
||||
int groupId = option[0];
|
||||
int destoryXY = mapManager.getTriggerXY();
|
||||
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(user, mapManager.getTeamId());
|
||||
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(user, mapManager.getTeamId(),true);
|
||||
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = MonsterUtil.getMonsterByGroup(groupId);
|
||||
List<CommonProto.FightTeamInfo> monsterTeamList = new ArrayList<>(3);
|
||||
List<CommonProto.FightTeamInfo> monsterGroupList = BehaviorUtil.getFightTeamInfos(groupId,monsterByGroup, Global.MONSTER_1);
|
||||
|
@ -953,7 +953,7 @@ public class MapLogic {
|
|||
}
|
||||
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
|
||||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
|
||||
BehaviorUtil.getFightInfo(user, groupId, fightStartResponse, pointId,sChallengeConfig.getMostTime());
|
||||
BehaviorUtil.getFightInfo(user, groupId, fightStartResponse, pointId,sChallengeConfig.getMostTime(),true);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightStartResponse.build(), true);
|
||||
}
|
||||
|
||||
|
|
|
@ -98,12 +98,12 @@ public class BehaviorUtil {
|
|||
* @param fightStartRespons
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void getFightInfo(User user, int groupId, FightInfoProto.FightStartResponse.Builder fightStartRespons, String pointId,int maxTime) throws Exception {
|
||||
public static void getFightInfo(User user, int groupId, FightInfoProto.FightStartResponse.Builder fightStartRespons, String pointId,int maxTime,boolean isMyself) throws Exception {
|
||||
MapManager mapManager = user.getMapManager();
|
||||
|
||||
int teamId = mapManager.getTeamId();
|
||||
CommonProto.FightData.Builder fightData = CommonProto.FightData.newBuilder();
|
||||
CommonProto.FightTeamInfo fightTeamInfo = getFightTeamInfo(user, teamId);
|
||||
CommonProto.FightTeamInfo fightTeamInfo = getFightTeamInfo(user, teamId,isMyself);
|
||||
fightData.setHeroFightInfos(fightTeamInfo);
|
||||
//monster
|
||||
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = MonsterUtil.getMonsterByGroup(groupId);
|
||||
|
@ -146,7 +146,7 @@ public class BehaviorUtil {
|
|||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId) {
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId,boolean isMySelf) {
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
|
@ -157,7 +157,7 @@ public class BehaviorUtil {
|
|||
StringBuilder skillSb = new StringBuilder();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,skillSb).toString();
|
||||
String property = HeroLogic.getInstance().getHeroProperty(user,hero,propertySb).toString();
|
||||
String property = HeroLogic.getInstance().getHeroProperty(user,hero,propertySb,isMySelf).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
|
@ -272,7 +272,7 @@ public class BehaviorUtil {
|
|||
|
||||
public static void getLevelDifficultyifficuFightInfo(User user,int groupId,int teamId, int maxTime,FightInfoProto.FightStartResponse.Builder fightStartRespons) {
|
||||
CommonProto.FightData.Builder fightData = CommonProto.FightData.newBuilder();
|
||||
CommonProto.FightTeamInfo fightTeamInfo = getFightTeamInfo(user, teamId);
|
||||
CommonProto.FightTeamInfo fightTeamInfo = getFightTeamInfo(user, teamId,true);
|
||||
fightData.setHeroFightInfos(fightTeamInfo);
|
||||
//monster
|
||||
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = MonsterUtil.getMonsterByGroup(groupId);
|
||||
|
|
|
@ -213,8 +213,8 @@ public class ArenaLogic {
|
|||
|
||||
|
||||
public static int getFightResultByPersonToPerson(User mine, int myteamId, User defUser, int defTeamId, ArenaRecord arenaRecord, int skipFight, ArenaInfoProto.ArenaChallengeResponse.Builder builder){
|
||||
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(mine,myteamId);
|
||||
CommonProto.FightTeamInfo deffightTeamInfo = BehaviorUtil.getFightTeamInfo(defUser,defTeamId);
|
||||
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(mine,myteamId,true);
|
||||
CommonProto.FightTeamInfo deffightTeamInfo = BehaviorUtil.getFightTeamInfo(defUser,defTeamId,false);
|
||||
//设置战斗随机种子
|
||||
int seed = (int)(System.currentTimeMillis()/1000);
|
||||
|
||||
|
@ -244,7 +244,7 @@ public class ArenaLogic {
|
|||
|
||||
|
||||
public int getFightResultByPersonToRobot(User mine, int myteamId, SArenaRobotConfig sArenaRobotConfig, int skipFight, ArenaInfoProto.ArenaChallengeResponse.Builder builder){
|
||||
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(mine,myteamId);
|
||||
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(mine,myteamId,true);
|
||||
CommonProto.FightTeamInfo deffightTeamInfo = BehaviorUtil.getRobotFightTeamInfo(sArenaRobotConfig);
|
||||
//设置战斗随机种子
|
||||
int seed = (int)(System.currentTimeMillis()/1000);
|
||||
|
|
|
@ -736,10 +736,10 @@ public class HeroLogic {
|
|||
return sb;
|
||||
}
|
||||
|
||||
public StringBuilder getHeroProperty(User user, Hero hero, StringBuilder sb){
|
||||
public StringBuilder getHeroProperty(User user, Hero hero, StringBuilder sb,boolean isMySelf){
|
||||
int curMapId = user.getMapManager().getCurMapId();
|
||||
Map<Integer, Integer> heroAttributeMap;
|
||||
if(curMapId == 0){
|
||||
if(!isMySelf || curMapId == 0){
|
||||
heroAttributeMap=calHeroNotBufferAttribute(user, hero);
|
||||
}else {
|
||||
heroAttributeMap=calHeroFinalAttributeWhenInMap(user, hero);
|
||||
|
@ -792,14 +792,6 @@ public class HeroLogic {
|
|||
return sb;
|
||||
}
|
||||
|
||||
|
||||
public String getOneHeroFightInfo(User user, Hero hero){
|
||||
StringBuilder sb = new StringBuilder(hero.getTemplateId()).append(DIVISION);
|
||||
getHeroSkills(user,hero,sb);
|
||||
getHeroProperty(user,hero,sb);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getPokenmonSkills(User user,int teamId){
|
||||
StringBuilder pokenSkillResult = new StringBuilder();
|
||||
List<TeamPosForPokenInfo> teamPosForPokenInfos = user.getTeamPosManager().getTeamPosForPoken().get(teamId);
|
||||
|
|
Loading…
Reference in New Issue