地图修改

back_recharge
jiahuiwen 2019-01-28 18:54:17 +08:00
parent 102d9a1eae
commit 815cfcd3c4
5 changed files with 162 additions and 100 deletions

View File

@ -30,30 +30,38 @@ int mut,int#int,1
101028 101033
101029 101034
101030 101035
101029 101036#101037
101030 101036#101037
101031 101036#101037
101032 101036#101037
101033 101036#101037
101034 null
101035 null
101036 null
101037 null
101038 null
101039 null
101040 null
101041 null
101042 null
101043 null
101044 null
101045 null
101046 null
101047 null
101048 null
101049 null
101050 null
101051 null
101052 null
101053 null
101054 null
101055 null
101031 101036
101032 101037#101038
101033 101039#101040
101034 101041#101042
101035 101043#101044
101036 101045#101046
101037 101047
101038 101048
101039 101049#101050
101040 101051
101041 101052
101042 101053
101043 101054
101044 101055
101045 101056
101046 101057
101047 101058
101048 101059
101049 101060
101050 101061
101051 101062
101052 101063
101053 101064
101054 101065
101055 101066
101056 101067
101057 101068
101058 101069
101059 101070
101060 101071
101061 101072
101062 101073
101063 101074
101064 101075
101065 101076

View File

@ -7,11 +7,11 @@ int int int int int int
101005 3 2 1 0 101005
101006 4 2 1 0 101006
101007 5 3 1 0 101007
101008 5 4 1 0 101029
101009 5 3 1 0 101030
101010 5 3 1 0 101031
101011 5 3 1 0 101032
101012 5 3 1 0 101033
101008 5 4 1 0 101032
101009 5 3 1 0 101007
101010 5 3 1 0 101007
101011 5 3 1 0 101065
101012 5 3 1 0 101065
101013 8 2 1 0 0
102001 1 2 1 0 0
102002 1 2 1 0 0

View File

@ -1,7 +1,7 @@
Id Type Values
int int mut,int#int,2
1 2 1503#1
2 1 101008
2 1 101008#101031
0 0 null
0 0 null
0 0 null

View File

@ -1,10 +1,10 @@
Id AddConditionID BehaviorType BehaviorTypeValues Reward JumpType JumpTypeValues
int int int mut,int#int,2 mut,int#int,2 int mut,int#int,2
101001 1 2 1503#1 null 4 null
101001 1 2 1503#1 null 5 null
101002 0 0 null null 4 null
101003 0 0 null null 5 null
101003 0 5 0 null 4 null
101004 0 0 null null 4 null
101005 0 0 null null 6 102
101005 0 5 102 null 4 null
101006 0 0 null null 4 null
101007 0 0 null null 1 101008
101008 0 0 null null 4 null
@ -17,23 +17,62 @@ int int int mut,int#int,2 mut,int#int,2 int mut,int#int,2
101015 0 0 null null 1 101013
101016 0 0 null null 4 null
101017 0 0 null null 1 101014
101018 0 0 null null 3 101015#101028|2
101018 0 0 null null 3 101015#101031|1#2
101019 0 0 null null 4 null
101020 0 0 null null 3 101016
101021 0 0 null null 3 101017
101022 0 0 null null 3 101018
101023 0 0 null null 3 101019
101024 0 0 null null 3 101020
101025 0 0 null null 3 101021
101026 0 0 null null 3 101022
101027 0 0 null null 3 101023
101021 0 0 null null 1 101017
101022 0 0 null null 1 101018
101023 0 0 null null 1 101019
101024 0 0 null null 1 101020
101025 0 0 null null 1 101021
101026 0 0 null null 1 101022
101027 0 0 null null 1 101023
101028 0 0 null null 1 101024
101029 0 0 null null 3 101025
101030 0 0 null null 3 101026
101031 0 0 null null 3 101027
101032 0 0 null null 3 101028
101033 0 0 null null 3 101029
101034 0 0 null null 3 101030
101035 0 0 null null 5 null
101036 1 2 1503#1 null 4 null
101037 0 0 null null 4 null
101029 0 0 null null 1 101025
101030 0 0 null null 1 101026
101031 0 0 null null 1 101027
101032 0 0 null null 1 101028
101033 0 0 null null 1 101029
101034 0 0 null null 1 101030
101035 0 5 0 null 5 null
101036 0 0 null null 4 null
101037 0 0 null null 1 101033
101038 0 0 null null 4 null
101039 0 0 null null 1 101034
101040 0 0 null null 4 null
101041 0 0 null null 1 101035
101042 0 0 null null 4 null
101043 0 0 null null 1 101036
101044 0 0 null null 4 null
101045 0 0 null null 1 101037
101046 0 0 null null 4 null
101047 0 0 null null 1 101038
101048 0 0 null null 1 101039
101049 0 0 null null 1 101040
101050 0 0 null null 4 null
101051 0 0 null null 1 101041
101052 0 0 null null 1 101042
101053 0 0 null null 1 101043
101054 0 0 null null 1 101044
101055 0 0 null null 1 101045
101056 0 0 null null 1 101046
101057 0 0 null null 1 101047
101058 0 0 null null 1 101048
101059 0 0 null null 1 101049
101060 0 0 null null 1 101050
101061 0 0 null null 1 101051
101062 0 0 null null 1 101052
101063 0 0 null null 1 101053
101064 0 0 null null 1 101054
101065 0 0 null null 1 101055
101066 0 0 null null 1 101056
101067 0 0 null null 1 101057
101068 0 0 null null 1 101058
101069 0 0 null null 1 101059
101070 0 0 null null 1 101060
101071 0 0 null null 6 101061
101072 0 0 null null 1 101062
101073 0 0 null null 1 101063
101074 0 0 null null 1 101064
101075 0 0 null null 6 101061
101076 0 0 null null 4 null

View File

@ -1,9 +1,6 @@
package com.ljsd.jieling.handler.map;
import com.ljsd.jieling.config.SCMap;
import com.ljsd.jieling.config.MapPointConfig;
import com.ljsd.jieling.config.SEventPointConfig;
import com.ljsd.jieling.config.SOptionConfig;
import com.ljsd.jieling.config.*;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
@ -88,6 +85,9 @@ public class MapLogic {
List<CommonProto.Cell> cells = new ArrayList<>(mapManager.getMapInfo().size());
for (Map.Entry<Integer, Cell> entry : mapManager.getMapInfo().entrySet()) {
Cell cell = entry.getValue();
if (cell.getEventId() == -1) {
continue;
}
CommonProto.Cell cellProto = CommonProto.Cell
.newBuilder()
.setCellId(entry.getKey())
@ -240,7 +240,7 @@ public class MapLogic {
}
int bigEventId = cell.getEventId();
if (eventId != bigEventId) {
LOGGER.info("eventId != bigEventId =>{} {}", eventId, bigEventId);
LOGGER.info("eventId != bigEventId =>{} {}, xy=>{}", eventId, bigEventId, mapManager.getCurXY());
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
return;
}
@ -251,6 +251,11 @@ public class MapLogic {
return;
}
int[] option = sEventPointConfig.getOption();
if (option == null) {
LOGGER.info("option == null sEventPointConfig.getId()=>{}", sEventPointConfig.getId());
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
return;
}
boolean can = false;
for (int i = 0; i < option.length; i++) {
if (option[i] == optionId) {
@ -293,20 +298,6 @@ public class MapLogic {
isSuccess = true;
break;
}
// case EventType.attribute: {
// Set<String> heroes = mapManager.getHeroes();
// for (String heroId : heroes) {
// Hero hero = user.getHeroManager().getHero(heroId);
// if (hero == null || hero.getCurHp() == 0) {
// continue;
// }
// float hp = HeroLogic.getInstance().calHeroAttribute(hero, GlobalsDef.HP_TYPE);
//
//// eventArr[1]
// }
// isSuccess = true;
// break;
// }
case EventType.leave: {
int randomInt = MathUtils.randomInt(100) + 1;
if (randomInt <= behaviorTypeValues[0][0]) {
@ -319,7 +310,9 @@ public class MapLogic {
break;
}
case EventType.jump: {
isSuccess = true;
mapManager.setCurMapId(behaviorTypeValues[0][0]);
initMap(mapManager);
break;
}
default: {
@ -332,7 +325,9 @@ public class MapLogic {
int[][] jumpTypeValues = sOptionConfig.getJumpTypeValues();
switch (jumpType) {
// 1 无条件跳转,对应事件点
case 1:{
// 6 无条件跳转地图id
case 1:
case 6:{
nextPoint = jumpTypeValues[0][0];
break;
}
@ -348,19 +343,43 @@ public class MapLogic {
}
// 3 条件跳转 1001#1002|00或1为和#条件id#条件id
case 3:{
SOptionAddCondition sOptionAddConditions = SOptionAddCondition.sOptionAddConditionMap.get(jumpTypeValues[1][1]);
if (sOptionAddConditions == null) {
LOGGER.info("sOptionAddConditions == null jumpTypeValues[1][1]=>{}", jumpTypeValues[1][1]);
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
return;
}
// 1 完成事件点即进度100%
if (sOptionAddConditions.getType() == 1) {
int doneEvent = sOptionAddConditions.getValues()[0][0];
for (Cell cell1 : mapManager.getMapInfo().values()) {
if (cell.getEventId() == doneEvent) {
if (cell1.getPointId() >= sOptionAddConditions.getValues()[0][1]) {
nextPoint = jumpTypeValues[0][0];
}
break;
}
}
// 2 物品数量
} else if (sOptionAddConditions.getType() == 2) {
} else {
// 3 角色属性
}
if (nextPoint == 0) {
nextPoint = jumpTypeValues[0][1];
}
break;
}
// 4 不跳转,关闭界面
case 4:{
nextPoint = -1;
nextPoint = cell.getEventId();
break;
}
// 5 返回主城
// 5 不跳转,销毁地图点 -1
case 5:{
break;
}
// 6 无条件跳转地图id
case 6:{
nextPoint = -1;
break;
}
default:{
@ -368,27 +387,20 @@ public class MapLogic {
}
}
MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse = MapInfoProto.EventUpdateResponse.newBuilder();
cell.setEventId(nextPoint);
mapManager.addOrUpdateCell(mapManager.getCurXY(), cell);
int[][] reward = sOptionConfig.getReward();
List<CommonProto.Item> rewards = new ArrayList<>();
if (reward != null && reward.length > 0) {
// ItemUtil.drop()
Map<Integer, Integer> itemMap = new HashMap<>();
// ItemUtil.addItem(user, itemMap);
if (behaviorType != EventType.jump) {
cell.setEventId(nextPoint);
mapManager.addOrUpdateCell(mapManager.getCurXY(), cell);
}
int[][] reward = sOptionConfig.getReward();
CommonProto.Drop.Builder dropBuilder = null;
if (reward != null && reward.length > 0) {
Map<Integer, Integer> itemMap = new HashMap<>();
dropBuilder = CommonProto.Drop.newBuilder();
for (int i = 0; i < reward.length; i++) {
itemMap.put(reward[i][0], reward[i][1]);
}
ItemUtil.addItem(user, itemMap, dropBuilder);
}
// 如果是传送门开启跳转到下个关卡
// if (scMapEvent.getStyle() == EventType.exit) {
// Map<Integer, List<Integer>> crossMapInfos = cMap.getCrossMapInfos();
// if (!crossMapInfos.containsKey(cMap.getCurMapId())) {
// crossMapInfos.put(cMap.getCurMapId(), new ArrayList<>());
// }
// crossMapInfos.get(cMap.getCurMapId()).addAll(cell.getEventIds());
// }
// if (scMapEvent.getStyle() == EventType.portal) {
// user.getPlayerInfoManager().setMapId(user.getPlayerInfoManager().getMapId() + 1);
// return;
// }
List<CommonProto.EventBehaviorValues> eventBehaviorValuesList = new ArrayList<>();
for (int i = 0; i < sOptionConfig.getBehaviorTypeValues().length; i++) {
CommonProto.EventBehaviorValues.Builder eventBehaviorValues = CommonProto.EventBehaviorValues
@ -405,6 +417,9 @@ public class MapLogic {
.build();
eventUpdateResponse.setEventBehaviorCommon(eventBehaviorCommon);
eventUpdateResponse.setEventId(cell.getEventId());
if (dropBuilder != null) {
eventUpdateResponse.setDrop(dropBuilder);
}
LOGGER.info("updateEvent success xy=>{}, getPointId=>{} eventId={}", mapManager.getCurXY(), cell.getPointId(), cell.getEventId());
MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true);
}