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