parent
e1d8422416
commit
dc8e3b3c3c
|
@ -111,6 +111,10 @@ public class GetLuckWheelRandHandler extends BaseHandler<PlayerInfoProto.GetLuck
|
|||
luckWheelPosInfo.setProgrss(luckWheelPosInfo.getProgrss()+1);
|
||||
luckWheelMission.getPosInfoMap().put(lastpos, luckWheelPosInfo);
|
||||
|
||||
// 抽中稀有清空保底次数
|
||||
if (sDialRewardConfig.getMaxGoalCount() > 0){
|
||||
user.getPlayerInfoManager().putGmDialNum(activityId,0);
|
||||
}
|
||||
SItem sItem = SItem.getsItemMap().get(drops[i][0]);
|
||||
if(sItem.getQuantity()>=5){
|
||||
String nickName = user.getPlayerInfoManager().getNickName();
|
||||
|
|
|
@ -5387,7 +5387,7 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
/**
|
||||
* 装备排行榜处理
|
||||
* 英雄星级处理
|
||||
* @param user
|
||||
*/
|
||||
private void heroStarHandle(User user){
|
||||
|
@ -5400,19 +5400,25 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
/**
|
||||
* 计算主线编队装备评分
|
||||
* 计算英雄星级评分
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
private int heroStarCompute(User user){
|
||||
int num = 0;
|
||||
Map<Integer, SChongRankInformation> starMap = SChongRankInformation.getStarMap();
|
||||
Map<Integer, Map<Integer, SChongRankInformation>> naturalMap = SChongRankInformation.getNaturalMap();
|
||||
Map<Integer, SCHero> scHeroMap = SCHero.getsCHero();
|
||||
for (Hero hero : user.getHeroManager().getHeroMap().values()) {
|
||||
SChongRankInformation information = starMap.get(hero.getStar());
|
||||
if (information == null){
|
||||
continue;
|
||||
try {
|
||||
SCHero scHero = scHeroMap.get(hero.getTemplateId());
|
||||
SChongRankInformation information = naturalMap.get(scHero.getNatural()).get(hero.getStar());
|
||||
if (information == null){
|
||||
continue;
|
||||
}
|
||||
num += information.getScore();
|
||||
}catch (NullPointerException e){
|
||||
LOGGER.error("计算英雄星级评分报错,uid:{},英雄id:{},英雄模板id:{}",user.getId(),hero.getId(),hero.getTemplateId());
|
||||
}
|
||||
num += information.getScore();
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
|
|
@ -13,27 +13,35 @@ public class SChongRankInformation implements BaseConfig {
|
|||
|
||||
private int heroStar;
|
||||
|
||||
private int natural;
|
||||
|
||||
private int score;
|
||||
|
||||
private static Map<Integer, SChongRankInformation> starMap = new HashMap<>();
|
||||
private static Map<Integer, Map<Integer, SChongRankInformation>> naturalMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SChongRankInformation> config = STableManager.getConfig(SChongRankInformation.class);
|
||||
for (SChongRankInformation value : config.values()) {
|
||||
Map<Integer, SChongRankInformation> starMap = naturalMap.getOrDefault(value.getNatural(), new HashMap<>());
|
||||
starMap.put(value.getHeroStar(),value);
|
||||
naturalMap.put(value.getNatural(),starMap);
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<Integer, SChongRankInformation> getStarMap() {
|
||||
return starMap;
|
||||
public static Map<Integer, Map<Integer, SChongRankInformation>> getNaturalMap() {
|
||||
return naturalMap;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getHeroStar() {
|
||||
public int getNatural() {
|
||||
return natural;
|
||||
}
|
||||
|
||||
public int getHeroStar() {
|
||||
return heroStar;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue