无尽副本难度添加
parent
60862fa351
commit
ab11d72809
|
@ -1,5 +1,6 @@
|
||||||
package com.ljsd.jieling.config;
|
package com.ljsd.jieling.config;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||||
import com.ljsd.jieling.logic.STableManager;
|
import com.ljsd.jieling.logic.STableManager;
|
||||||
import com.ljsd.jieling.logic.Table;
|
import com.ljsd.jieling.logic.Table;
|
||||||
|
|
||||||
|
@ -10,7 +11,7 @@ import java.util.Map;
|
||||||
public class SEndlessDifficulty implements BaseConfig{
|
public class SEndlessDifficulty implements BaseConfig{
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
private int worldLevel;
|
private int[] worldLevel;
|
||||||
|
|
||||||
private int[] monsterId;
|
private int[] monsterId;
|
||||||
|
|
||||||
|
@ -18,51 +19,52 @@ public class SEndlessDifficulty implements BaseConfig{
|
||||||
|
|
||||||
public static Map<Integer,SEndlessDifficulty> difficultyMap;
|
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,Integer> difficultyReward;
|
||||||
|
|
||||||
public static Map<Integer, Map<Integer,Integer>> difficultyMonster;
|
|
||||||
|
|
||||||
public static Map<Integer, Map<Integer,Integer>> difficultyReward;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
difficultyMap = STableManager.getConfig(SEndlessDifficulty.class);
|
difficultyMap = STableManager.getConfig(SEndlessDifficulty.class);
|
||||||
baseDifficult = new HashMap<>();
|
setDifficult();
|
||||||
baseReward = new HashMap<>();
|
}
|
||||||
SEndlessDifficulty sEndlessDifficulty = difficultyMap.get(1);
|
|
||||||
for(int i = 0 ;i<sEndlessDifficulty.getMonsterId().length;i++){
|
public static void setDifficult() throws Exception {
|
||||||
baseDifficult.put(sEndlessDifficulty.getMonsterId()[i],i);
|
SEndlessDifficulty baseDiff = difficultyMap.get(1);
|
||||||
}
|
|
||||||
for(int i = 0 ;i<sEndlessDifficulty.getRewardId().length;i++){
|
|
||||||
baseReward.put(sEndlessDifficulty.getRewardId()[i],i);
|
|
||||||
}
|
|
||||||
difficultyMonster = new HashMap<>();
|
difficultyMonster = new HashMap<>();
|
||||||
difficultyReward = new HashMap<>();
|
difficultyReward = new HashMap<>();
|
||||||
for(Map.Entry<Integer,SEndlessDifficulty> entry:difficultyMap.entrySet()){
|
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
|
||||||
Map<Integer,Integer> tempMap = new HashMap<>(entry.getValue().getMonsterId().length);
|
if(serverConfigTmp.getWorldLevel()==0){
|
||||||
for(int i = 0 ; i<entry.getValue().getMonsterId().length;i++){
|
for(int i = 0 ;i<baseDiff.getMonsterId().length;i++){
|
||||||
tempMap.put(i,entry.getValue().getMonsterId()[i]);
|
difficultyMonster.put(baseDiff.getMonsterId()[i],baseDiff.getMonsterId()[i]);
|
||||||
}
|
}
|
||||||
difficultyMonster.put(entry.getValue().getWorldLevel(),tempMap);
|
for(int i = 0 ;i<baseDiff.getRewardId().length;i++){
|
||||||
tempMap = new HashMap<>();
|
difficultyReward.put(baseDiff.getRewardId()[i],baseDiff.getRewardId()[i]);
|
||||||
for(int i = 0 ; i<entry.getValue().getRewardId().length;i++){
|
}
|
||||||
tempMap.put(i,entry.getValue().getRewardId()[i]);
|
}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;
|
||||||
}
|
}
|
||||||
difficultyReward.put(entry.getValue().getWorldLevel(),tempMap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWorldLevel() {
|
public int[] getWorldLevel() {
|
||||||
return worldLevel;
|
return worldLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1215,7 +1215,7 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
int groupId = option[0];
|
int groupId = option[0];
|
||||||
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
|
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();
|
int destoryXY = mapManager.getTriggerXY();
|
||||||
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(user, mapManager.getTeamId(), true);
|
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(user, mapManager.getTeamId(), true);
|
||||||
|
@ -1394,8 +1394,8 @@ public class MapLogic {
|
||||||
String[] split = fightReady.split("#");
|
String[] split = fightReady.split("#");
|
||||||
RedisUtil.getInstence().del(fightReadyKey);
|
RedisUtil.getInstence().del(fightReadyKey);
|
||||||
groupId = Integer.parseInt(split[0]);
|
groupId = Integer.parseInt(split[0]);
|
||||||
if(SEndlessDifficulty.baseDifficult.get(groupId)!=null){
|
if(SEndlessDifficulty.difficultyMonster.containsKey(groupId)){
|
||||||
groupId = SEndlessDifficulty.difficultyMonster.get(41).get(SEndlessDifficulty.baseDifficult.get(groupId));
|
groupId = SEndlessDifficulty.difficultyMonster.get(groupId);
|
||||||
}
|
}
|
||||||
if (split.length > 1) {
|
if (split.length > 1) {
|
||||||
pointId = split[1];
|
pointId = split[1];
|
||||||
|
@ -1409,7 +1409,7 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
groupId = option[0];
|
groupId = option[0];
|
||||||
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
|
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();
|
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic;
|
||||||
|
|
||||||
import com.ljsd.GameApplication;
|
import com.ljsd.GameApplication;
|
||||||
import com.ljsd.jieling.config.SDailyTasksConfig;
|
import com.ljsd.jieling.config.SDailyTasksConfig;
|
||||||
|
import com.ljsd.jieling.config.SEndlessDifficulty;
|
||||||
import com.ljsd.jieling.config.SGlobalSystemConfig;
|
import com.ljsd.jieling.config.SGlobalSystemConfig;
|
||||||
import com.ljsd.jieling.config.ServerConfig;
|
import com.ljsd.jieling.config.ServerConfig;
|
||||||
import com.ljsd.jieling.config.json.KTSDKConstans;
|
import com.ljsd.jieling.config.json.KTSDKConstans;
|
||||||
|
@ -167,6 +168,7 @@ public class GlobalDataManaager {
|
||||||
case Endless:
|
case Endless:
|
||||||
MapLogic.getInstance().updateEndlessSeason(timeControllerOfFunction.getTimes());
|
MapLogic.getInstance().updateEndlessSeason(timeControllerOfFunction.getTimes());
|
||||||
serverConfigTmp.setWorldLevel(calWorldLevel());
|
serverConfigTmp.setWorldLevel(calWorldLevel());
|
||||||
|
SEndlessDifficulty.setDifficult();
|
||||||
MongoUtil.getLjsdMongoTemplate().save(serverConfigTmp);
|
MongoUtil.getLjsdMongoTemplate().save(serverConfigTmp);
|
||||||
MapLogic.getInstance().setEndlessMapId(getEndleeMapIdByLevel());
|
MapLogic.getInstance().setEndlessMapId(getEndleeMapIdByLevel());
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -70,21 +70,6 @@ public class MinuteTask extends Thread {
|
||||||
CoreLogic.getInstance().checkCoreCdk();
|
CoreLogic.getInstance().checkCoreCdk();
|
||||||
BuyGoodsLogic.minuteCheckReharge();
|
BuyGoodsLogic.minuteCheckReharge();
|
||||||
RedisUtil.getInstence().set(RedisKey.ONLINE_NUM+RedisKey.Delimiter_colon+GameApplication.serverId, String.valueOf(OnlineUserManager.sessionMap.entrySet().size()));
|
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...");
|
LOGGER.info("MinuteTask end...");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("e",e);
|
LOGGER.error("e",e);
|
||||||
|
|
|
@ -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) {
|
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) {
|
for (int dropGroupId : dropGroupIds) {
|
||||||
if(SEndlessDifficulty.baseReward.containsKey(dropGroupId)){
|
if(SEndlessDifficulty.difficultyReward.containsKey(dropGroupId)){
|
||||||
dropGroupId = SEndlessDifficulty.difficultyReward.get(41).get(SEndlessDifficulty.baseReward.get(dropGroupId));
|
dropGroupId = SEndlessDifficulty.difficultyReward.get(dropGroupId);
|
||||||
}
|
}
|
||||||
SRewardGroup sRewardGroup = SRewardGroup.getsRewardItemMap().get(dropGroupId);
|
SRewardGroup sRewardGroup = SRewardGroup.getsRewardItemMap().get(dropGroupId);
|
||||||
if (sRewardGroup == null) {
|
if (sRewardGroup == null) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.util;
|
||||||
import com.ljsd.jieling.config.SEndlessDifficulty;
|
import com.ljsd.jieling.config.SEndlessDifficulty;
|
||||||
import com.ljsd.jieling.config.SMonsterConfig;
|
import com.ljsd.jieling.config.SMonsterConfig;
|
||||||
import com.ljsd.jieling.config.SMonsterGroup;
|
import com.ljsd.jieling.config.SMonsterGroup;
|
||||||
|
import com.ljsd.jieling.handler.map.MapLogic;
|
||||||
import com.ljsd.jieling.protocols.CommonProto;
|
import com.ljsd.jieling.protocols.CommonProto;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -78,8 +79,8 @@ public class MonsterUtil {
|
||||||
Map<Integer, SMonsterConfig> integerSMonsterConfigMap = SMonsterConfig.getsMonsterConfigMap();
|
Map<Integer, SMonsterConfig> integerSMonsterConfigMap = SMonsterConfig.getsMonsterConfigMap();
|
||||||
int maxForce = 0;
|
int maxForce = 0;
|
||||||
for(int i = 0 ; i < groupIds.length;i++){
|
for(int i = 0 ; i < groupIds.length;i++){
|
||||||
if(SEndlessDifficulty.baseDifficult.containsKey(groupIds[i])){
|
if(SEndlessDifficulty.difficultyMonster.containsKey(groupIds[i])){
|
||||||
groupIds[i]=SEndlessDifficulty.difficultyMonster.get(41).get(SEndlessDifficulty.baseDifficult.get(groupIds[i]));
|
groupIds[i]= SEndlessDifficulty.difficultyMonster.get(groupIds[i]);
|
||||||
}
|
}
|
||||||
SMonsterGroup sMonsterGroup = integerSMonsterGroupMap.get(groupIds[i]);
|
SMonsterGroup sMonsterGroup = integerSMonsterGroupMap.get(groupIds[i]);
|
||||||
int[][] contents = sMonsterGroup.getContents();
|
int[][] contents = sMonsterGroup.getContents();
|
||||||
|
|
Loading…
Reference in New Issue