探索优化

back_recharge
xuexinpeng 2022-04-08 18:29:30 +08:00
parent 6f805a716f
commit fbd3281ca6
2 changed files with 6 additions and 1 deletions

View File

@ -99,6 +99,7 @@ public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.Explore
if ((int) fightResult.getCheckResult()[0] == 1) {
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_REPELMONSTER_NUM,
1);
eventList.remove(index);
}
} else if (exploreEventConfig.get(id).getType() == 2) {
int defUid = user.getPlayerInfoManager().getExploreEventMatchDefUid();
@ -131,14 +132,15 @@ public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.Explore
if ((int) fightResult.getCheckResult()[0] == 1) {
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_REPELXINMO_NUM,
1);
eventList.remove(index);
}
} else if (exploreEventConfig.get(id).getType() == 3) {
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[]{exploreEventConfig.get(id).getRewardGroup()}, 1, 0, BIReason.EXPLORE_EVENT_BOX);
builder.setDrop(drop);
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_PICKYM_NUM,
1);
eventList.remove(index);
}
eventList.remove(index);
user.getPlayerInfoManager().setExploreEvent(eventList);
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapEventResponse.getNumber(), builder.build(), true);
}

View File

@ -228,6 +228,9 @@ public class ExplorerMapLogic {
Random random = new Random();
int randomMapId = random.nextInt(limitConfig.size());
SExplore rankExplore = limitConfig.get(randomMapId);
if(rankExplore.getEventList().length == 0){
return;
}
int randomEventId = random.nextInt(rankExplore.getEventList().length);
int eventId = rankExplore.getEventList()[randomEventId];
LOGGER.info("explore add eventId:" + eventId + " randomMapId: " + randomMapId + 1);