试炼副本buff修改

back_recharge
lvxinran 2020-07-03 12:04:03 +08:00
parent cc1d26d842
commit 87a619edf2
3 changed files with 29 additions and 13 deletions

View File

@ -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<Integer, STrialConfig> sTrialConfigMap = (TreeMap<Integer,STrialConfig>)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<Integer, Cell> mapInfo = mapManager.getMapInfo();
if(type==1){
List<int[][]> 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<boxPosition.length;i++){
int xyPos = CellUtil.xy2Pos(boxPosition[i][0], boxPosition[i][1]);
Cell cell = mapManager.getMapInfo().get(xyPos);
Cell cell = mapInfo.get(xyPos);
if(xyPos==curXY){
if(cell!=null&&cell.getPointId()==STrialSetting.sTrialSetting.getBoxPointId()) {
cell.setPointId(0);
@ -3226,7 +3241,8 @@ public class MapLogic {
}
}
}
return drop;
response.setBoxDrop(drop);
return response;
}
public void getMiniGameEvent(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
@ -3248,7 +3264,7 @@ public class MapLogic {
for(int id:ids){
idList.add(id);
}
BehaviorUtil.destoryCurPoint(user);
// BehaviorUtil.destoryCurPoint(user);
MapInfoProto.MapGameResponse response = MapInfoProto.MapGameResponse.newBuilder().setType(mapGameInfo.getType()).addAllParam(idList).build();
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
}

View File

@ -31,7 +31,7 @@ public abstract class ColorGame implements MapGame {
if(configs==null||configs.isEmpty()){
return new ArrayList<>();
}
List<STrialGameConfig> collect = configs.stream().filter(config -> config.getUnlockLv() < level).collect(Collectors.toList());
List<STrialGameConfig> collect = configs.stream().filter(config -> config.getUnlockLv() <= level).collect(Collectors.toList());
return collect;
}
}

View File

@ -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;
}