抽卡获取同阵营修改
parent
d6cf251701
commit
90f8cba220
|
|
@ -1608,15 +1608,16 @@ public class ActivityLogic implements IEventHandler{
|
||||||
int count = mission.getV();
|
int count = mission.getV();
|
||||||
// up奖励id
|
// up奖励id
|
||||||
int upRewardId = mission.getChoiceRewardId();
|
int upRewardId = mission.getChoiceRewardId();
|
||||||
|
|
||||||
// 排序权重map
|
|
||||||
Map<Integer, Integer> weight = new TreeMap<>(SWishActivityPool.weight);
|
|
||||||
// 常驻卡池
|
|
||||||
Map<Integer, SWishActivityPool> poolMap = SWishActivityPool.map;
|
|
||||||
// 根据活动获取本期得全部up信息
|
// 根据活动获取本期得全部up信息
|
||||||
Map<Integer, int[]> up = SWishActivityUp.upMap.get(activityId);
|
Map<Integer, int[]> up = SWishActivityUp.upMap.get(activityId);
|
||||||
// 根据玩家选取得up奖励id获取详细信息
|
// 根据玩家选取得up奖励id获取详细信息
|
||||||
int[] incs = up.get(upRewardId);
|
int[] incs = up.get(upRewardId);
|
||||||
|
//拿到当前阵营
|
||||||
|
int camp = incs[3];
|
||||||
|
// 排序权重map
|
||||||
|
Map<Integer, Integer> weight = new TreeMap<>(SWishActivityPool.weight.get(camp));
|
||||||
|
// 常驻卡池
|
||||||
|
Map<Integer, SWishActivityPool> poolMap = SWishActivityPool.map;
|
||||||
// 讲up奖励id得权重加入到整个卡池权重中
|
// 讲up奖励id得权重加入到整个卡池权重中
|
||||||
weight.put(weight.size()+1,incs[2]);
|
weight.put(weight.size()+1,incs[2]);
|
||||||
// 计算总权重
|
// 计算总权重
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,7 @@ package config;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
import manager.Table;
|
import manager.Table;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
@Table(name ="WishActivityPool")
|
@Table(name ="WishActivityPool")
|
||||||
public class SWishActivityPool implements BaseConfig {
|
public class SWishActivityPool implements BaseConfig {
|
||||||
|
|
@ -16,17 +14,29 @@ public class SWishActivityPool implements BaseConfig {
|
||||||
|
|
||||||
private int getRate;
|
private int getRate;
|
||||||
|
|
||||||
public static Map<Integer,Integer> weight = new TreeMap<>();
|
private int camp;
|
||||||
|
|
||||||
|
public static Map<Integer,Map<Integer,Integer>> weight = new TreeMap<>();
|
||||||
|
|
||||||
public static Map<Integer,SWishActivityPool> map = new HashMap<>();
|
public static Map<Integer,SWishActivityPool> map = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
Map<Integer, SWishActivityPool> config = STableManager.getConfig(SWishActivityPool.class);
|
Map<Integer, SWishActivityPool> config = STableManager.getConfig(SWishActivityPool.class);
|
||||||
|
List<Integer> allCamp = new ArrayList<>(10);
|
||||||
|
Map<Integer,Map<Integer,Integer>> mapTemp = new HashMap<>();
|
||||||
config.values().forEach(v->{
|
config.values().forEach(v->{
|
||||||
map.put(v.getId(),v);
|
map.put(v.getId(),v);
|
||||||
weight.put(v.getId(),v.getGetRate());
|
//weight修改成只有当前卡池和对应权重
|
||||||
|
if(v.getCamp()!=0){
|
||||||
|
mapTemp.putIfAbsent(v.getCamp(),new HashMap<>());
|
||||||
|
mapTemp.get(v.getCamp()).put(v.getId(),v.getGetRate());
|
||||||
|
}else{
|
||||||
|
allCamp.add(v.getId());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
//把0权重的放进去
|
||||||
|
allCamp.forEach(i->mapTemp.forEach((k,v)->v.put(i,map.get(i).getGetRate())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -42,5 +52,7 @@ public class SWishActivityPool implements BaseConfig {
|
||||||
return getRate;
|
return getRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getCamp() {
|
||||||
|
return camp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue