无尽商店

lvxinran 2019-10-05 08:41:39 +08:00
parent d54dbb502f
commit 3214ede819
2 changed files with 51 additions and 36 deletions

View File

@ -2,6 +2,7 @@ package com.ljsd.jieling.handler.map;
import com.googlecode.protobuf.format.JsonFormat; import com.googlecode.protobuf.format.JsonFormat;
import com.ljsd.jieling.config.*; import com.ljsd.jieling.config.*;
import com.ljsd.jieling.core.FunctionIdEnum;
import com.ljsd.jieling.core.VipPrivilegeType; import com.ljsd.jieling.core.VipPrivilegeType;
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType; import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
import com.ljsd.jieling.dataReport.reportBeans_37.Repot37EventUtil; import com.ljsd.jieling.dataReport.reportBeans_37.Repot37EventUtil;
@ -17,6 +18,7 @@ import com.ljsd.jieling.handler.mission.Mission;
import com.ljsd.jieling.ktbeans.KTGameType; import com.ljsd.jieling.ktbeans.KTGameType;
import com.ljsd.jieling.ktbeans.KtEventUtils; import com.ljsd.jieling.ktbeans.KtEventUtils;
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean; import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.OnlineUserManager; import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.STableManager; import com.ljsd.jieling.logic.STableManager;
import com.ljsd.jieling.logic.activity.event.Poster; import com.ljsd.jieling.logic.activity.event.Poster;
@ -216,7 +218,8 @@ public class MapLogic {
} }
EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo(); EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo();
if(endlessMapInfo.getSeason()!=endlessSeason){ if(endlessMapInfo.getSeason()!=endlessSeason){
StoreLogic.initOneStore(user,SEndlessMapConfig.sEndlessMapConfigMap.get(endlessMapId).getMapStoreId()); TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Endless);
StoreLogic.initOnsStoereWithTime(user,SEndlessMapConfig.sEndlessMapConfigMap.get(endlessMapId).getMapStoreId(),openTimeOfFuntionCacheByType.getStartTime(),openTimeOfFuntionCacheByType.getEndTime());
mapManager.updateEndlessSeason(endlessSeason); mapManager.updateEndlessSeason(endlessSeason);
mapManager.updateEndlessMapId(0); mapManager.updateEndlessMapId(0);
mapManager.endlessWalkCellSave(new HashSet<>()); mapManager.endlessWalkCellSave(new HashSet<>());
@ -1269,14 +1272,16 @@ public class MapLogic {
mapManager.updateEndlessFightCount(1+mapManager.getEndlessMapInfo().getFightCount()); mapManager.updateEndlessFightCount(1+mapManager.getEndlessMapInfo().getFightCount());
} }
if (resultCode == 0) { if (resultCode == 0) {
//todo 无尽副本不复活记得改回去
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) { if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
//无尽副本复活消耗 // //无尽副本复活消耗
reviveConsumeExecution(user); reviveConsumeExecution(user);
for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
mapManager.updateEndlessHeroHp(entry.getKey(),0);
} }
}else { // for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
// mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
// mapManager.updateEndlessHeroHp(entry.getKey(),0);
// }
// }else {
// 失败需要等待n秒后复活所有英雄 // 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount(); int dieCount = user.getMapManager().getDieCount();
dieCount++; dieCount++;
@ -1300,7 +1305,7 @@ public class MapLogic {
remainHp.add(heroAttributeMap.get(HeroAttributeEnum.CurHP.getPropertyId())); remainHp.add(heroAttributeMap.get(HeroAttributeEnum.CurHP.getPropertyId()));
} }
} }
} // }
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder(); CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
FightInfoProto.FastFightResponse build = FightInfoProto.FastFightResponse FightInfoProto.FastFightResponse build = FightInfoProto.FastFightResponse
.newBuilder() .newBuilder()
@ -1504,14 +1509,16 @@ public class MapLogic {
mapManager.setLastFightResult(resultCode); mapManager.setLastFightResult(resultCode);
if (resultCode == 0 || dropout == 1) { if (resultCode == 0 || dropout == 1) {
//todo 无尽副本复活
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){ if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){
//无尽副本复活消耗 //无尽副本复活消耗
reviveConsumeExecution(user); reviveConsumeExecution(user);
for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){ // for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0); // mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
mapManager.updateEndlessHeroHp(entry.getKey(),0); // mapManager.updateEndlessHeroHp(entry.getKey(),0);
// }
} }
}else{ // else{
// 失败需要等待n秒后复活所有英雄 // 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount(); int dieCount = user.getMapManager().getDieCount();
dieCount++; dieCount++;
@ -1535,7 +1542,6 @@ public class MapLogic {
remainHp.add(heroAllAttributeMap.get(hero.getId()).get(HeroAttributeEnum.CurHP.getPropertyId())); remainHp.add(heroAllAttributeMap.get(hero.getId()).get(HeroAttributeEnum.CurHP.getPropertyId()));
} }
} }
}
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder(); CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
FightInfoProto.FightEndResponse.Builder fightEndResponse = FightInfoProto.FightEndResponse FightInfoProto.FightEndResponse.Builder fightEndResponse = FightInfoProto.FightEndResponse
.newBuilder(); .newBuilder();

View File

@ -375,7 +375,16 @@ public class GlobalDataManaager {
} }
private static int getEndleeMapIdByLevel() throws Exception { private static int getEndleeMapIdByLevel() throws Exception {
ServerConfig config = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class); ServerConfig config = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
int mapId = config.getWorldLevel() * 0 + 4002; // Map<Integer, SEndlessDifficulty> difficultyMap = SEndlessDifficulty.difficultyMap;
// for(Map.Entry<Integer, SEndlessDifficulty> entry:difficultyMap.entrySet()){
// if(entry.getValue().getWorldLevel())
//
// }
int mapId = config.getWorldLevel() * 0 + 4001;
return mapId; return mapId;
} }
public TimeControllerOfFunction getOpenTimeOfFuntionCacheByType(FunctionIdEnum functionIdEnum ) {
return openTimeOfFuntionCache.get(functionIdEnum.getFunctionId());
}
} }