diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java index e63098b34..20f4245cf 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java @@ -3169,20 +3169,20 @@ public class MapLogic { User user = UserManager.getUser(session.getUid()); MapManager mapManager = user.getMapManager(); AbstractMap map = getMap(user); - CommonProto.Drop.Builder drop = null; //是否在试炼副本中 + MapInfoProto.GetTrialBoxRewardResponse.Builder response = null; + if(map instanceof TowerMap){ int curXY = mapManager.getCurXY(); int floor = mapManager.getTrialInfo().getFloor(); TreeMap sTrialConfigMap = (TreeMap)STrialConfig.sTrialConfigMap; STrialConfig sTrialConfig = sTrialConfigMap.ceilingEntry(floor).getValue(); - drop = getBoxReward(sTrialConfig.getBoxPosition(),sTrialConfig.getBoxReward(),user,curXY,type); + response = getBoxReward(sTrialConfig.getBoxPosition(),sTrialConfig.getBoxReward(),user,curXY,type); } - if(drop==null){ + if(response==null){ throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); } - MapInfoProto.GetTrialBoxRewardResponse response = MapInfoProto.GetTrialBoxRewardResponse.newBuilder().setBoxDrop(drop).build(); - MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true); + MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true); } /** @@ -3194,25 +3194,40 @@ public class MapLogic { * @return * @throws Exception */ - private CommonProto.Drop.Builder getBoxReward(int[][] boxPosition,int[][][] boxReward,User user,int curXY,int type) throws Exception { + private MapInfoProto.GetTrialBoxRewardResponse.Builder getBoxReward(int[][] boxPosition,int[][][] boxReward,User user,int curXY,int type) throws Exception { MapManager mapManager = user.getMapManager(); + MapInfoProto.GetTrialBoxRewardResponse.Builder response= MapInfoProto.GetTrialBoxRewardResponse.newBuilder(); CommonProto.Drop.Builder drop= null; + Map mapInfo = mapManager.getMapInfo(); if(type==1){ List reward = Arrays.asList(boxReward); drop = ItemUtil.drop(user,reward,BIReason.MAP_EVENET_REWARD); for(int[] position:boxPosition){ int xyPos = CellUtil.xy2Pos(position[0], position[1]); - Cell cell = mapManager.getMapInfo().get(xyPos); + Cell cell = mapInfo.get(xyPos); if(cell!=null&&cell.getPointId()==STrialSetting.sTrialSetting.getBoxPointId()) { cell.setPointId(0); mapManager.addOrUpdateCell(cell.getCellId(), cell); } } + + //判断添加buff + for(Cell cell:mapInfo.values()){ + if(MapPointConfig.getScMapEventMap().get(cell.getPointId()).getStyle()!=9){//9为地图点buff类型 + continue; + } + int optionId = STableManager.getConfig(SEventPointConfig.class).get(cell.getEventId()).getOption()[0]; + SOptionConfig sOptionConfig = SOptionConfig.sOptionConfigMap.get(optionId); + int behaviorType = sOptionConfig.getBehaviorType(); + BaseBehavior baseBehavior = baseBehaviorMap.get(behaviorType); + baseBehavior.process(optionId,user,sOptionConfig.getBehaviorTypeValues(),null); + response.addBuffIds(sOptionConfig.getBehaviorTypeValues()[0][0]); + } }else{ for(int i = 0 ; i(); } - List collect = configs.stream().filter(config -> config.getUnlockLv() < level).collect(Collectors.toList()); + List collect = configs.stream().filter(config -> config.getUnlockLv() <= level).collect(Collectors.toList()); return collect; } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index ffbe21899..bb49504d4 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -1707,9 +1707,9 @@ public class HeroLogic{ float score = sPropertyConfig.getScore(); result += propertyValue*score; - LOGGER.info("the propertyId={} the value is ={},propertyValue={},score={},result ={},the value={}",propertyId,propertyValue*score,propertyValue,score,result,propertyValue*score); +// LOGGER.info("the propertyId={} the value is ={},propertyValue={},score={},result ={},the value={}",propertyId,propertyValue*score,propertyValue,score,result,propertyValue*score); } - System.out.println(result); +// System.out.println(result); return (int)result; }