无尽提交

lvxinran 2019-10-18 03:13:06 +08:00
parent 32ba425900
commit 60862fa351
4 changed files with 94 additions and 1 deletions

View File

@ -0,0 +1,76 @@
package com.ljsd.jieling.config;
import com.ljsd.jieling.logic.STableManager;
import com.ljsd.jieling.logic.Table;
import java.util.HashMap;
import java.util.Map;
@Table(name="EndlessDifficulty")
public class SEndlessDifficulty implements BaseConfig{
private int id;
private int worldLevel;
private int[] monsterId;
private int[] rewardId;
public static Map<Integer,SEndlessDifficulty> difficultyMap;
public static Map<Integer,Integer> baseDifficult;
public static Map<Integer,Integer> baseReward;
public static Map<Integer, Map<Integer,Integer>> difficultyMonster;
public static Map<Integer, 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);
}
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]);
}
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]);
}
difficultyReward.put(entry.getValue().getWorldLevel(),tempMap);
}
}
public int getId() {
return id;
}
public int getWorldLevel() {
return worldLevel;
}
public int[] getMonsterId() {
return monsterId;
}
public int[] getRewardId() {
return rewardId;
}
}

View File

@ -257,7 +257,7 @@ public class MapLogic {
mapEnterResponse.setLeftTime(getLeftTime(user, true));
for (Map.Entry<Integer, Integer> buffEntry : mapManager.getFoodBufferMap().entrySet()) {
if (buffEntry.getValue()==0) {
if (buffEntry.getValue()==0||buffEntry.getValue()==-1) {
continue;
}
CommonProto.FoodBuffer foodBuffer = CBean2Proto.getFoodBuffer(buffEntry.getKey(), buffEntry.getValue());
@ -1020,6 +1020,7 @@ public class MapLogic {
MapManager mapManager = user.getMapManager();
SChallengeConfig challengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
if(mapManager.getCurMapId()==0){
mapManager.setCurXY(0);
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
return;
}
@ -1213,6 +1214,9 @@ public class MapLogic {
return;
}
int groupId = option[0];
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
groupId = SEndlessDifficulty.difficultyMonster.get(41).get(SEndlessDifficulty.baseDifficult.get(groupId));
}
int destoryXY = mapManager.getTriggerXY();
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(user, mapManager.getTeamId(), true);
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = MonsterUtil.getMonsterByGroup(groupId);
@ -1390,6 +1394,9 @@ 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 (split.length > 1) {
pointId = split[1];
}
@ -1401,6 +1408,9 @@ public class MapLogic {
return;
}
groupId = option[0];
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
groupId = SEndlessDifficulty.difficultyMonster.get(41).get(SEndlessDifficulty.baseDifficult.get(groupId));
}
}
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());

View File

@ -139,6 +139,9 @@ 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));
}
SRewardGroup sRewardGroup = SRewardGroup.getsRewardItemMap().get(dropGroupId);
if (sRewardGroup == null) {
continue;

View File

@ -1,5 +1,6 @@
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.protocols.CommonProto;
@ -77,6 +78,9 @@ 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]));
}
SMonsterGroup sMonsterGroup = integerSMonsterGroupMap.get(groupIds[i]);
int[][] contents = sMonsterGroup.getContents();
int totalMonsterForce = 0;