优化地图代码
parent
99ca55edba
commit
32bbca91cd
|
@ -366,48 +366,7 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
// 1 完成事件点,即进度100%
|
||||
switch (sOptionAddConditions.getType()) {
|
||||
case 1:{
|
||||
int doneEvent = sOptionAddConditions.getValues()[0][0];
|
||||
for (Cell cell1 : mapManager.getMapInfo().values()) {
|
||||
if (cell1.getPointId() == doneEvent) {
|
||||
if (cell1.getEventId() >= sOptionAddConditions.getValues()[0][1]) {
|
||||
nextPoint = jumpTypeValues[0][0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
// 2 物品数量
|
||||
case 2:{
|
||||
break;
|
||||
}
|
||||
// 3 角色属性
|
||||
case 3:{
|
||||
break;
|
||||
}
|
||||
// 完成某个任务的第几步
|
||||
case 4:{
|
||||
Set<Integer> finishMissions = user.getMissionManager().getFinishMissions();
|
||||
Set<Integer> takeRewardMissions = user.getMissionManager().getTakeRewardMissions();
|
||||
if (finishMissions.contains(sOptionAddConditions.getValues()[0][0]) || takeRewardMissions.contains(sOptionAddConditions.getValues()[0][0])) {
|
||||
nextPoint = jumpTypeValues[0][0];
|
||||
}
|
||||
if (nextPoint == 0) {
|
||||
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
|
||||
Mission mission = doingMissions.get(sOptionAddConditions.getValues()[0][0]);
|
||||
if (mission == null || mission.getMissionStep() < jumpTypeValues[0][1]) {
|
||||
nextPoint = jumpTypeValues[0][1];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
nextPoint = jumpTypeValues[0][1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
nextPoint = getNextPoint(user, mapManager, jumpTypeValues, sOptionAddConditions);
|
||||
break;
|
||||
}
|
||||
// 4 不跳转,关闭界面
|
||||
|
@ -455,6 +414,53 @@ public class MapLogic {
|
|||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true);
|
||||
}
|
||||
|
||||
private int getNextPoint(User user, MapManager mapManager, int[][] jumpTypeValues, SOptionAddCondition sOptionAddConditions) {
|
||||
int nextPoint = 0;
|
||||
switch (sOptionAddConditions.getType()) {
|
||||
case 1:{
|
||||
int doneEvent = sOptionAddConditions.getValues()[0][0];
|
||||
for (Cell cell1 : mapManager.getMapInfo().values()) {
|
||||
if (cell1.getPointId() == doneEvent) {
|
||||
if (cell1.getEventId() >= sOptionAddConditions.getValues()[0][1]) {
|
||||
nextPoint = jumpTypeValues[0][0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
// 2 物品数量
|
||||
case 2:{
|
||||
break;
|
||||
}
|
||||
// 3 角色属性
|
||||
case 3:{
|
||||
break;
|
||||
}
|
||||
// 完成某个任务的第几步
|
||||
case 4:{
|
||||
Set<Integer> finishMissions = user.getMissionManager().getFinishMissions();
|
||||
Set<Integer> takeRewardMissions = user.getMissionManager().getTakeRewardMissions();
|
||||
if (finishMissions.contains(sOptionAddConditions.getValues()[0][0]) || takeRewardMissions.contains(sOptionAddConditions.getValues()[0][0])) {
|
||||
nextPoint = jumpTypeValues[0][0];
|
||||
}
|
||||
if (nextPoint == 0) {
|
||||
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
|
||||
Mission mission = doingMissions.get(sOptionAddConditions.getValues()[0][0]);
|
||||
if (mission == null || mission.getMissionStep() < jumpTypeValues[0][1]) {
|
||||
nextPoint = jumpTypeValues[0][1];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
nextPoint = jumpTypeValues[0][1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return nextPoint;
|
||||
}
|
||||
|
||||
public CommonProto.Mission getMission(Mission mission) {
|
||||
CommonProto.Mission openMission;
|
||||
StringBuilder state = null;
|
||||
|
|
Loading…
Reference in New Issue