无尽副本难度添加

lvxinran 2019-09-23 06:02:35 +08:00
parent 60862fa351
commit ab11d72809
6 changed files with 41 additions and 51 deletions

View File

@ -1,5 +1,6 @@
package com.ljsd.jieling.config;
import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.logic.STableManager;
import com.ljsd.jieling.logic.Table;
@ -10,7 +11,7 @@ import java.util.Map;
public class SEndlessDifficulty implements BaseConfig{
private int id;
private int worldLevel;
private int[] worldLevel;
private int[] monsterId;
@ -18,51 +19,52 @@ public class SEndlessDifficulty implements BaseConfig{
public static Map<Integer,SEndlessDifficulty> difficultyMap;
public static Map<Integer,Integer> baseDifficult;
public static Map<Integer,Integer> difficultyMonster;
public static Map<Integer,Integer> baseReward;
public static Map<Integer, Map<Integer,Integer>> difficultyMonster;
public static Map<Integer, Map<Integer,Integer>> difficultyReward;
public static Map<Integer,Integer> difficultyReward;
@Override
public void init() throws Exception {
difficultyMap = STableManager.getConfig(SEndlessDifficulty.class);
baseDifficult = new HashMap<>();
baseReward = new HashMap<>();
SEndlessDifficulty sEndlessDifficulty = difficultyMap.get(1);
for(int i = 0 ;i<sEndlessDifficulty.getMonsterId().length;i++){
baseDifficult.put(sEndlessDifficulty.getMonsterId()[i],i);
}
for(int i = 0 ;i<sEndlessDifficulty.getRewardId().length;i++){
baseReward.put(sEndlessDifficulty.getRewardId()[i],i);
setDifficult();
}
public static void setDifficult() throws Exception {
SEndlessDifficulty baseDiff = difficultyMap.get(1);
difficultyMonster = new HashMap<>();
difficultyReward = new HashMap<>();
for(Map.Entry<Integer,SEndlessDifficulty> entry:difficultyMap.entrySet()){
Map<Integer,Integer> tempMap = new HashMap<>(entry.getValue().getMonsterId().length);
for(int i = 0 ; i<entry.getValue().getMonsterId().length;i++){
tempMap.put(i,entry.getValue().getMonsterId()[i]);
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
if(serverConfigTmp.getWorldLevel()==0){
for(int i = 0 ;i<baseDiff.getMonsterId().length;i++){
difficultyMonster.put(baseDiff.getMonsterId()[i],baseDiff.getMonsterId()[i]);
}
difficultyMonster.put(entry.getValue().getWorldLevel(),tempMap);
tempMap = new HashMap<>();
for(int i = 0 ; i<entry.getValue().getRewardId().length;i++){
tempMap.put(i,entry.getValue().getRewardId()[i]);
for(int i = 0 ;i<baseDiff.getRewardId().length;i++){
difficultyReward.put(baseDiff.getRewardId()[i],baseDiff.getRewardId()[i]);
}
difficultyReward.put(entry.getValue().getWorldLevel(),tempMap);
}else{
for(Map.Entry<Integer,SEndlessDifficulty> entry:difficultyMap.entrySet()) {
if (serverConfigTmp.getWorldLevel() <= entry.getValue().getWorldLevel()[0] || serverConfigTmp.getWorldLevel() > entry.getValue().getWorldLevel()[1]) {
continue;
}
for(int i = 0 ;i<baseDiff.getMonsterId().length;i++){
difficultyMonster.put(baseDiff.getMonsterId()[i],entry.getValue().getMonsterId()[i]);
}
for(int i = 0 ;i<baseDiff.getRewardId().length;i++){
difficultyReward.put(baseDiff.getRewardId()[i],entry.getValue().getRewardId()[i]);
}
break;
}
}
}
public int getId() {
return id;
}
public int getWorldLevel() {
public int[] getWorldLevel() {
return worldLevel;
}

View File

@ -1215,7 +1215,7 @@ public class MapLogic {
}
int groupId = option[0];
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
groupId = SEndlessDifficulty.difficultyMonster.get(41).get(SEndlessDifficulty.baseDifficult.get(groupId));
groupId =SEndlessDifficulty.difficultyMonster.get(groupId);
}
int destoryXY = mapManager.getTriggerXY();
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(user, mapManager.getTeamId(), true);
@ -1394,8 +1394,8 @@ public class MapLogic {
String[] split = fightReady.split("#");
RedisUtil.getInstence().del(fightReadyKey);
groupId = Integer.parseInt(split[0]);
if(SEndlessDifficulty.baseDifficult.get(groupId)!=null){
groupId = SEndlessDifficulty.difficultyMonster.get(41).get(SEndlessDifficulty.baseDifficult.get(groupId));
if(SEndlessDifficulty.difficultyMonster.containsKey(groupId)){
groupId = SEndlessDifficulty.difficultyMonster.get(groupId);
}
if (split.length > 1) {
pointId = split[1];
@ -1409,7 +1409,7 @@ public class MapLogic {
}
groupId = option[0];
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
groupId = SEndlessDifficulty.difficultyMonster.get(41).get(SEndlessDifficulty.baseDifficult.get(groupId));
groupId =SEndlessDifficulty.difficultyMonster.get(groupId);
}
}
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();

View File

@ -2,6 +2,7 @@ package com.ljsd.jieling.logic;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.SDailyTasksConfig;
import com.ljsd.jieling.config.SEndlessDifficulty;
import com.ljsd.jieling.config.SGlobalSystemConfig;
import com.ljsd.jieling.config.ServerConfig;
import com.ljsd.jieling.config.json.KTSDKConstans;
@ -167,6 +168,7 @@ public class GlobalDataManaager {
case Endless:
MapLogic.getInstance().updateEndlessSeason(timeControllerOfFunction.getTimes());
serverConfigTmp.setWorldLevel(calWorldLevel());
SEndlessDifficulty.setDifficult();
MongoUtil.getLjsdMongoTemplate().save(serverConfigTmp);
MapLogic.getInstance().setEndlessMapId(getEndleeMapIdByLevel());
break;

View File

@ -70,21 +70,6 @@ public class MinuteTask extends Thread {
CoreLogic.getInstance().checkCoreCdk();
BuyGoodsLogic.minuteCheckReharge();
RedisUtil.getInstence().set(RedisKey.ONLINE_NUM+RedisKey.Delimiter_colon+GameApplication.serverId, String.valueOf(OnlineUserManager.sessionMap.entrySet().size()));
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
if(serverConfigTmp.getWorldLevel()==1){
Query query = new Query();
query.with(new Sort(Sort.Direction.DESC,"playerManager.level"));
query.fields().include("playerManager.level");
List<User> users = MongoUtil.getLjsdMongoTemplate().findAllByCondition(query, User.class);
int size = (int)(users.size()*0.85);
int level = 0;
for(int i = 0 ; i <size;i++){
level+=users.get(i).getPlayerInfoManager().getLevel();
}
LOGGER.info("计算世界等级为{}",level/size);
serverConfigTmp.setWorldLevel(level/size);
MongoUtil.getLjsdMongoTemplate().save(serverConfigTmp);
}
LOGGER.info("MinuteTask end...");
} catch (Exception e) {
LOGGER.error("e",e);

View File

@ -139,8 +139,8 @@ public class ItemUtil {
private static void combineRewardDropGroup(User user, int[] dropGroupIds, float dropRatio, Map<Integer, Integer> itemMap, Map<Integer, Integer> cardMap, Map<Integer, Integer> equipMap, Map<Integer, Integer> randomMap) {
for (int dropGroupId : dropGroupIds) {
if(SEndlessDifficulty.baseReward.containsKey(dropGroupId)){
dropGroupId = SEndlessDifficulty.difficultyReward.get(41).get(SEndlessDifficulty.baseReward.get(dropGroupId));
if(SEndlessDifficulty.difficultyReward.containsKey(dropGroupId)){
dropGroupId = SEndlessDifficulty.difficultyReward.get(dropGroupId);
}
SRewardGroup sRewardGroup = SRewardGroup.getsRewardItemMap().get(dropGroupId);
if (sRewardGroup == null) {

View File

@ -3,6 +3,7 @@ package com.ljsd.jieling.util;
import com.ljsd.jieling.config.SEndlessDifficulty;
import com.ljsd.jieling.config.SMonsterConfig;
import com.ljsd.jieling.config.SMonsterGroup;
import com.ljsd.jieling.handler.map.MapLogic;
import com.ljsd.jieling.protocols.CommonProto;
import java.util.ArrayList;
@ -78,8 +79,8 @@ public class MonsterUtil {
Map<Integer, SMonsterConfig> integerSMonsterConfigMap = SMonsterConfig.getsMonsterConfigMap();
int maxForce = 0;
for(int i = 0 ; i < groupIds.length;i++){
if(SEndlessDifficulty.baseDifficult.containsKey(groupIds[i])){
groupIds[i]=SEndlessDifficulty.difficultyMonster.get(41).get(SEndlessDifficulty.baseDifficult.get(groupIds[i]));
if(SEndlessDifficulty.difficultyMonster.containsKey(groupIds[i])){
groupIds[i]= SEndlessDifficulty.difficultyMonster.get(groupIds[i]);
}
SMonsterGroup sMonsterGroup = integerSMonsterGroupMap.get(groupIds[i]);
int[][] contents = sMonsterGroup.getContents();