山河社稷任务

back_recharge
xuexinpeng 2021-05-27 18:24:07 +08:00
parent d01dcff730
commit fecbddb920
3 changed files with 35 additions and 3 deletions

View File

@ -171,6 +171,14 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
//成就任务
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_STARS,starSum);
}
//大关卡通过成就+1
if(nodeConfig.getStageType() == 1){
//nodeConfig
int bigStageNumber = SHardStage.getBigStageNumberById(nodeConfig.getId());
if( bigStageNumber>0 ){
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_NODE,bigStageNumber);
}
}
}
}
//排行榜章节
@ -186,7 +194,6 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
fightStartResponse.setStars(node.getState());
}
}
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_NODE,hardStageId);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.HARD_STAGE_FIGHT_START_RESPONSE.getNumber(), fightStartResponse.build(), true);
//更新消息
HardStageLogic.sendHardStageIndication(user);

View File

@ -10,7 +10,9 @@ public class HardStageNodeDataManager implements BaseDataManager {
@Override
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
int nums = (int)parm[0];
data.setHardstage_node(nums);
if(data.getHardstage_node()< nums){
data.setHardstage_node(nums);
}
return new CumulationData.Result(missionType);
}
}

View File

@ -17,6 +17,8 @@ public class SHardStage implements BaseConfig {
private int section;
private int bigStageNumber;
private String picture;
private int repeat;
@ -44,6 +46,7 @@ public class SHardStage implements BaseConfig {
private static Map<Integer, SHardStage> configMap;
private static Map<Integer, List<SHardStage>> preConfigMap;
private static Map<Integer, Map<Integer,SHardStage>> chapterNodeMapConfig;//<章节id<节点id,数据>>
private static Map<Integer, Integer> bigMap;//<表id,第几个大关卡>
@ -52,6 +55,7 @@ public class SHardStage implements BaseConfig {
Map<Integer, SHardStage> tempConfig = STableManager.getConfig(SHardStage.class);
Map<Integer, List<SHardStage>> tempPreConfigMap = new HashMap<>();
Map<Integer, Map<Integer,SHardStage>> chapterNodeMap = new HashMap<Integer, Map<Integer,SHardStage>>();
Map<Integer, Integer> bmap = new HashMap<>();
for (SHardStage stage : tempConfig.values()) {
if (stage.getNextLevel() > 0) {
if (tempPreConfigMap.containsKey(stage.getNextLevel())) {
@ -66,11 +70,16 @@ public class SHardStage implements BaseConfig {
Map<Integer,SHardStage> chapterMap = chapterNodeMap.computeIfAbsent(stage.getChapter(),k-> new HashMap<Integer,SHardStage>());
chapterMap.computeIfAbsent(stage.getSection(),k ->stage);
if(!bmap.containsKey(stage.getId())&& stage.getBigStageNumber()!=0){
bmap.put(stage.getId(),stage.getBigStageNumber());
}
}
if (null == configMap) {
configMap = tempConfig;
preConfigMap = tempPreConfigMap;
chapterNodeMapConfig = chapterNodeMap;
bigMap = bmap;
}
}
@ -148,7 +157,15 @@ public class SHardStage implements BaseConfig {
return preConfigMap.get(id);
}
public static int getStageIdByChapterAndSection(int chapter,int section){
public int getBigStageNumber() {
return bigStageNumber;
}
public void setBigStageNumber(int bigStageNumber) {
this.bigStageNumber = bigStageNumber;
}
public static int getStageIdByChapterAndSection(int chapter, int section){
if(chapterNodeMapConfig.containsKey(chapter)){
if(chapterNodeMapConfig.get(chapter).containsKey(section)){
return chapterNodeMapConfig.get(chapter).get(section).getId();
@ -156,4 +173,10 @@ public class SHardStage implements BaseConfig {
}
return 0;
}
public static int getBigStageNumberById(int id){
if(bigMap.containsKey(id)){
return bigMap.get(id);
}
return 0;
}
}