探索修改
parent
ab96501d1c
commit
4ba216f2e3
|
@ -1,4 +1,5 @@
|
|||
Id OpenRule MapTime ReviveTime
|
||||
int mut,int#int,2 int mut,int#int,1
|
||||
100 0#0 600 0#0#0#10
|
||||
101 0#0 600 0#0#0#10
|
||||
102 0#0 600 0#0#0#10
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
Id MissionNum Reward
|
||||
int int int
|
||||
1 3 2000
|
||||
2 5 2001
|
||||
3 4 2024
|
||||
4 3 2002
|
||||
5 6 2025
|
||||
6 3 2003
|
||||
7 5 2004
|
||||
8 3 2005
|
||||
9 2 2006
|
||||
10 2 2007
|
||||
11 1 2008
|
||||
12 2 2009
|
||||
101 4 2002
|
||||
102 3 2002
|
||||
103 1 2002
|
||||
104 8 2002
|
||||
0 0 0
|
|
@ -5,7 +5,7 @@ import com.ljsd.jieling.logic.Table;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="MissionEventsConfig")
|
||||
@Table(name ="ChallengeMissionEventsConfig")
|
||||
public class SMissionEventsConfig implements BaseConfig {
|
||||
|
||||
public static Map<Integer, SMissionEventsConfig> sMissionEventsConfigMap;
|
||||
|
|
|
@ -93,6 +93,17 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
SChallengeMapConfig scMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
|
||||
if (scMapConfig == null) {
|
||||
LOGGER.info("enterMap() uid=>{} sChallengeConfig == null =>{} ", uid, mapId);
|
||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "该地图不存在");
|
||||
return;
|
||||
}
|
||||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapId);
|
||||
if (sChallengeConfig == null) {
|
||||
LOGGER.info("enterMap() uid=>{} sChallengeConfig == null =>{} ", uid, mapId);
|
||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "该地图不存在");
|
||||
return;
|
||||
}
|
||||
// if (scMapConfig == null || scMapConfig.getOpenRule() == null || scMapConfig.getOpenRule().length == 0) {
|
||||
// LOGGER.info("enterMap() uid=>{} mapId=>{}, scMapConfig.getOpenRule()=>{}", uid, mapId, scMapConfig == null ? "" : scMapConfig.getOpenRule());
|
||||
// MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
|
||||
|
@ -281,6 +292,11 @@ public class MapLogic {
|
|||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
return;
|
||||
}
|
||||
if (mapManager.getStartExporeTime() == 0) {
|
||||
LOGGER.info("mapManager.getStartExporeTime() == 0");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "未开始探索");
|
||||
return;
|
||||
}
|
||||
if (getLeftTime(user) <= 0) {
|
||||
LOGGER.info("updateMap() uid=>{}, no step=>{}", uid, getLeftTime(user));
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
|
@ -326,6 +342,11 @@ public class MapLogic {
|
|||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
return;
|
||||
}
|
||||
if (mapManager.getStartExporeTime() == 0) {
|
||||
LOGGER.info("mapManager.getStartExporeTime() == 0");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "未开始探索");
|
||||
return;
|
||||
}
|
||||
Cell cell = mapManager.getMapInfo().get(mapManager.getTriggerXY());
|
||||
if (cell == null) {
|
||||
LOGGER.info("cell == null xy is wrong =>{} triggerXY=>{}", mapManager.getCurXY(), mapManager.getTriggerXY());
|
||||
|
@ -484,7 +505,7 @@ public class MapLogic {
|
|||
}
|
||||
// LOGGER.info("updateEvent =====>success<====== xy=>{}, getPointId=>{} eventId={}, mission=>{}, nextEventId=>{}, eventBehaviorCommon=>{} {} sOptionConfig.getReward()=>{}", mapManager.getCurXY(), cell == null ? 0 : cell.getPointId(),
|
||||
// cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMissionList(), nextEventId, eventBehaviorCommon,eventUpdateResponse.getDrop(), sOptionConfig.getReward());
|
||||
LOGGER.info("updatEvent() uid=>{},nextEventId={},eventId={}", uid, nextEventId, cell == null ? 0 : cell.getEventId());
|
||||
LOGGER.info("updatEvent() uid=>{},nextEventId={},eventId={},mission=>{}", uid, nextEventId, cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMission());
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true);
|
||||
}
|
||||
|
||||
|
@ -665,6 +686,7 @@ public class MapLogic {
|
|||
mapManager.setTriggerXY(0);
|
||||
mapManager.setFoodBufferMap(new HashMap<>());
|
||||
TemporaryItems temporaryItems = mapManager.getTemporaryItems();
|
||||
mapManager.setMission(null);
|
||||
if (temporaryItems != null) {
|
||||
ItemUtil.addTemporaryItemToBag(user, temporaryItems, needTemporaryItem);
|
||||
mapManager.setTemporaryItems(null);
|
||||
|
@ -819,7 +841,7 @@ public class MapLogic {
|
|||
if (missionId != 0) {
|
||||
MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse = MapInfoProto.EventUpdateResponse.newBuilder();
|
||||
BehaviorUtil.updateMission(user, missionId, eventUpdateResponse);
|
||||
fightEndResponse.addAllMission(eventUpdateResponse.getMissionList());
|
||||
fightEndResponse.setMission(eventUpdateResponse.getMission());
|
||||
}
|
||||
if (destoryId != 0) {
|
||||
BehaviorUtil.destoryPoint(user, user.getMapManager().getCurMapId(), destoryId);
|
||||
|
@ -1033,7 +1055,7 @@ public class MapLogic {
|
|||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(user.getMapManager().getCurMapId());
|
||||
long startExporeTime = user.getMapManager().getStartExporeTime();
|
||||
if (startExporeTime == 0) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
int useTime = (int) ((TimeUtils.now() - startExporeTime) / 1000);
|
||||
if (useTime >= sChallengeConfig.getMapTime()) {
|
||||
|
@ -1058,7 +1080,7 @@ public class MapLogic {
|
|||
} else {
|
||||
user.getMapManager().setMission(mission);
|
||||
}
|
||||
checkMissionReturn.missions.add(mission);
|
||||
checkMissionReturn.mission = mission;
|
||||
return checkMissionReturn;
|
||||
}
|
||||
|
||||
|
@ -1072,8 +1094,13 @@ public class MapLogic {
|
|||
User user = UserManager.getUser(uid);
|
||||
MapManager mapManager = user.getMapManager();
|
||||
if (mapManager.getMapInfo() == null) {
|
||||
LOGGER.info("mapManager.getMapInfo() == null");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
LOGGER.info("startExplorte mapManager.getMapInfo() == null");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "未进入地图");
|
||||
return;
|
||||
}
|
||||
if (mapManager.getStartExporeTime() > 0) {
|
||||
LOGGER.info("startExplorte mapManager.getStartExporeTime() > 0 =>{}", mapManager.getStartExporeTime());
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "已开始探索");
|
||||
return;
|
||||
}
|
||||
mapManager.setStartExporeTime(TimeUtils.now());
|
||||
|
|
|
@ -44,7 +44,7 @@ public class MapManager extends MongoBase {
|
|||
|
||||
private long startExporeTime;
|
||||
|
||||
private boolean missionIsFinish;
|
||||
private int userTime;
|
||||
|
||||
private Mission mission;
|
||||
|
||||
|
@ -249,13 +249,13 @@ public class MapManager extends MongoBase {
|
|||
this.startExporeTime = startExporeTime;
|
||||
}
|
||||
|
||||
public boolean isMissionIsFinish() {
|
||||
return missionIsFinish;
|
||||
public int getUserTime() {
|
||||
return userTime;
|
||||
}
|
||||
|
||||
public void setMissionIsFinish(boolean missionIsFinish) {
|
||||
updateString("missionIsFinish", missionIsFinish);
|
||||
this.missionIsFinish = missionIsFinish;
|
||||
public void setUserTime(int userTime) {
|
||||
updateString("userTime", userTime);
|
||||
this.userTime = userTime;
|
||||
}
|
||||
|
||||
public Mission getMission() {
|
||||
|
|
|
@ -162,16 +162,14 @@ public class BehaviorUtil {
|
|||
/**
|
||||
* 更新任务
|
||||
*/
|
||||
public static boolean updateMission(User user, int missionId, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception{
|
||||
public static boolean updateMission(User user, int missionId, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||
Mission mission = user.getMapManager().getMission();
|
||||
if (mission == null) {
|
||||
return false;
|
||||
}
|
||||
CheckMissionReturn checkMissionReturn = MapLogic.getInstance().checkMission(mission, user);
|
||||
for (Mission missions : checkMissionReturn.missions) {
|
||||
CommonProto.Mission missionProto = MapLogic.getInstance().getMission(missions);
|
||||
eventUpdateResponse.addMission(missionProto);
|
||||
}
|
||||
CommonProto.Mission missionProto = MapLogic.getInstance().getMission(checkMissionReturn.mission);
|
||||
eventUpdateResponse.setMission(missionProto);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ import com.ljsd.jieling.protocols.CommonProto;
|
|||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class DestroyMissionBehavior extends BaseBehavior {
|
||||
@Override
|
||||
|
@ -26,10 +24,8 @@ public class DestroyMissionBehavior extends BaseBehavior {
|
|||
}
|
||||
CheckMissionReturn checkMissionReturn = MapLogic.getInstance().checkMission(mission, user);
|
||||
BehaviorUtil.destoryCurPoint(user);
|
||||
for (Mission cmission : checkMissionReturn.missions){
|
||||
CommonProto.Mission missionProto = MapLogic.getInstance().getMission(cmission);
|
||||
eventUpdateResponse.addMission(missionProto);
|
||||
}
|
||||
CommonProto.Mission missionProto = MapLogic.getInstance().getMission(checkMissionReturn.mission);
|
||||
eventUpdateResponse.setMission(missionProto);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ import java.util.List;
|
|||
|
||||
public class CheckMissionReturn {
|
||||
public String newEventId;
|
||||
public List<Mission> missions = new ArrayList<>();
|
||||
public Mission mission;
|
||||
public CommonProto.Drop.Builder drop;
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ public class PlayerManager extends MongoBase {
|
|||
}
|
||||
|
||||
public void setMaxStamina(int maxStamina) {
|
||||
updateString("maxStamina.", maxStamina);
|
||||
updateString("maxStamina", maxStamina);
|
||||
this.maxStamina = maxStamina;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue