车迟斗法优化,根据boss更换排行奖励
parent
9cc7bf8588
commit
0c4041c74d
|
@ -44,9 +44,14 @@ public class CarDelayFunction implements FunctionManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeAction() throws Exception {
|
public void closeAction() throws Exception {
|
||||||
Map<Integer, TreeMap<Integer, String>> rewardByTypeAndRankMap = SWorldBossRewardConfig.rewardByTypeAndRankMap;
|
// 获取车迟斗法当前boss的索引id
|
||||||
|
int indexId = GuildFightLogic.carDelayProgressIndication.getBossIndexId();
|
||||||
|
// 根据索引id取出当前的奖励配置
|
||||||
|
Map<Integer, TreeMap<Integer, String>> rewardByTypeAndRankMap = SWorldBossRewardConfig.rewardByBossIdMap.get(indexId);
|
||||||
|
|
||||||
TreeMap<Integer, String> personRewardConfigTreeMap = rewardByTypeAndRankMap.get(2);
|
TreeMap<Integer, String> personRewardConfigTreeMap = rewardByTypeAndRankMap.get(2);
|
||||||
TreeMap<Integer, String> guildRewardConfigTreeMap = rewardByTypeAndRankMap.get(1);
|
TreeMap<Integer, String> guildRewardConfigTreeMap = rewardByTypeAndRankMap.get(1);
|
||||||
|
|
||||||
Set<ZSetOperations.TypedTuple<String>> personRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CAR_DEALY_RANK, "", 0, -1);
|
Set<ZSetOperations.TypedTuple<String>> personRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CAR_DEALY_RANK, "", 0, -1);
|
||||||
int rank=0;
|
int rank=0;
|
||||||
String personTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_personreward_title");
|
String personTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_personreward_title");
|
||||||
|
|
|
@ -19,23 +19,36 @@ public class SWorldBossRewardConfig implements BaseConfig {
|
||||||
|
|
||||||
private int type;
|
private int type;
|
||||||
|
|
||||||
public static Map<Integer, TreeMap<Integer,String>> rewardByTypeAndRankMap = new HashMap<>();
|
private int bossId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型,排名,奖励
|
||||||
|
*/
|
||||||
|
public static Map<Integer,TreeMap<Integer,String>> rewardByTypeAndRankMap = new HashMap<>();
|
||||||
|
/**
|
||||||
|
* boss索引id,类型,排名,奖励
|
||||||
|
*/
|
||||||
|
public static Map<Integer,TreeMap<Integer, TreeMap<Integer,String>>> rewardByBossIdMap = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
Map<Integer, SWorldBossRewardConfig> config = STableManager.getConfig(SWorldBossRewardConfig.class);
|
Map<Integer, SWorldBossRewardConfig> config = STableManager.getConfig(SWorldBossRewardConfig.class);
|
||||||
Map<Integer, TreeMap<Integer,String>> rewardByTypeAndRankMapTmp = new HashMap<>();
|
Map<Integer, TreeMap<Integer,String>> rewardByTypeAndRankMapTmp = new HashMap<>();
|
||||||
|
Map<Integer,TreeMap<Integer, TreeMap<Integer,String>>> rewardByBossIdMapTmp = new HashMap<>();
|
||||||
config.forEach((id,item)->{
|
config.forEach((id,item)->{
|
||||||
rewardByTypeAndRankMapTmp.putIfAbsent(item.getType(),new TreeMap<>());
|
rewardByTypeAndRankMapTmp.putIfAbsent(item.getType(),new TreeMap<>());
|
||||||
rewardByTypeAndRankMapTmp.get(item.getType()).put(item.getSection()[0], StringUtil.parseArrayToString(item.getReward()));
|
rewardByTypeAndRankMapTmp.get(item.getType()).put(item.getSection()[0], StringUtil.parseArrayToString(item.getReward()));
|
||||||
});
|
|
||||||
rewardByTypeAndRankMap = rewardByTypeAndRankMapTmp;
|
|
||||||
|
|
||||||
|
rewardByBossIdMapTmp.putIfAbsent(item.getBossId(),new TreeMap<>());
|
||||||
|
rewardByBossIdMapTmp.get(item.getBossId()).putIfAbsent(item.getType(),new TreeMap<>());
|
||||||
|
rewardByBossIdMapTmp.get(item.getBossId()).get(item.getType()).put(item.getSection()[0], StringUtil.parseArrayToString(item.getReward()));
|
||||||
|
});
|
||||||
|
|
||||||
|
rewardByTypeAndRankMap = rewardByTypeAndRankMapTmp;
|
||||||
|
rewardByBossIdMap = rewardByBossIdMapTmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
public int getId() {
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,4 +63,8 @@ public class SWorldBossRewardConfig implements BaseConfig {
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getBossId() {
|
||||||
|
return bossId;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue