剧情关不需要战斗
parent
f929ea69db
commit
cff11e010c
|
@ -2140,9 +2140,13 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
LOGGER.info("关卡战斗end{},{}",uid,fightInfos);
|
LOGGER.info("关卡战斗end{},{}",uid,fightInfos);
|
||||||
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(fightId);
|
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(fightId);
|
||||||
FightEvent fightEvent = new FightEvent(uid, -1, sMainLevelConfig.getRankTime(),frames, GameFightType.StoryFight);
|
FightResult fightResult = null;
|
||||||
FightResult fightResult = FightDispatcher.dispatcher(fightEvent);
|
if (sMainLevelConfig.getPlotId() == 0) {
|
||||||
|
FightEvent fightEvent = new FightEvent(uid, -1, sMainLevelConfig.getRankTime(), frames, GameFightType.StoryFight);
|
||||||
|
fightResult = FightDispatcher.dispatcher(fightEvent);
|
||||||
|
}
|
||||||
//校验结果码 1:胜利
|
//校验结果码 1:胜利
|
||||||
|
if (fightResult != null) {
|
||||||
if (fightResult.getResult() == -1) {
|
if (fightResult.getResult() == -1) {
|
||||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||||
} else if (fightResult.getResult() == 0) {
|
} else if (fightResult.getResult() == 0) {
|
||||||
|
@ -2150,11 +2154,12 @@ public class MapLogic {
|
||||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true);
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sMainLevelConfig.getReward(), 1, 0, BIReason.LEVELDIFFICULTY_FIGHT_REWARD);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sMainLevelConfig.getReward(), 1, 0, BIReason.LEVELDIFFICULTY_FIGHT_REWARD);
|
||||||
openNextMainLevel(session,user, fightId);
|
openNextMainLevel(session,user, fightId);
|
||||||
FightInfoProto.FightEndResponse.Builder fightEndResponse = FightInfoProto.FightEndResponse.newBuilder();
|
FightInfoProto.FightEndResponse.Builder fightEndResponse = FightInfoProto.FightEndResponse.newBuilder();
|
||||||
fightEndResponse.setEnventDrop(drop);
|
fightEndResponse.setEnventDrop(drop);
|
||||||
fightEndResponse.setResult(fightResult.getResult());
|
fightEndResponse.setResult(fightResult == null ? 1 : fightResult.getResult());
|
||||||
fightEndResponse.build();
|
fightEndResponse.build();
|
||||||
MainLevelManager mainLevelManager = user.getMainLevelManager();
|
MainLevelManager mainLevelManager = user.getMainLevelManager();
|
||||||
FightInfoProto.MainLevelFightUpdateIndication build = FightInfoProto.MainLevelFightUpdateIndication.newBuilder().setState(mainLevelManager.getState()).setFightId(mainLevelManager.getFightId()).build();
|
FightInfoProto.MainLevelFightUpdateIndication build = FightInfoProto.MainLevelFightUpdateIndication.newBuilder().setState(mainLevelManager.getState()).setFightId(mainLevelManager.getFightId()).build();
|
||||||
|
|
|
@ -43,6 +43,8 @@ public class SMainLevelConfig implements BaseConfig {
|
||||||
|
|
||||||
private int sortId;
|
private int sortId;
|
||||||
|
|
||||||
|
private int storyId; // 大于 0 表示剧情关,无需战斗
|
||||||
|
|
||||||
public static Map<Integer, SMainLevelConfig> config;
|
public static Map<Integer, SMainLevelConfig> config;
|
||||||
public static Map<Integer, SMainLevelConfig> sMainLevelConfigByVirtureIdMap;
|
public static Map<Integer, SMainLevelConfig> sMainLevelConfigByVirtureIdMap;
|
||||||
public static Map<Integer,SMainLevelConfig> fightPreMap;
|
public static Map<Integer,SMainLevelConfig> fightPreMap;
|
||||||
|
@ -137,4 +139,8 @@ public class SMainLevelConfig implements BaseConfig {
|
||||||
public int getSortId() {
|
public int getSortId() {
|
||||||
return sortId;
|
return sortId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPlotId() {
|
||||||
|
return storyId;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue