Task 【ID1006033】【新战斗版本】后端装备合成系统

back_recharge
zhangshanxue 2020-04-03 11:45:33 +08:00
parent 790273b96f
commit 8e8cc31b08
6 changed files with 60 additions and 4 deletions

View File

@ -1,11 +1,15 @@
package com.ljsd.jieling.config.clazzStaticCfg;
import com.ljsd.jieling.util.ItemUtil;
import config.SEquipConfig;
import config.SRewardGroup;
import config.SRewardItem;
import manager.AbstractClassStaticConfig;
import manager.STableManager;
import manager.Table;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
@ -15,12 +19,13 @@ import java.util.Set;
*/
public class ItemStaticConfig extends AbstractClassStaticConfig {
private Map<Integer,Map<Integer,Integer>> euipTppes;
@Override
public void registConfigs(Set<String> registConfigs) {
registConfigs.add(SRewardItem.class.getAnnotation(Table.class).name());
registConfigs.add(SRewardGroup.class.getAnnotation(Table.class).name());
registConfigs.add(SEquipConfig.class.getAnnotation(Table.class).name());
}
@Override
@ -31,5 +36,30 @@ public class ItemStaticConfig extends AbstractClassStaticConfig {
} catch (Exception e) {
LOGGER.error("SRewardItem|SRewardGroup init fail");
}
try {
euipTppes = new HashMap<>();
Map<Integer, SEquipConfig> config = STableManager.getConfig(SEquipConfig.class);
config.forEach((k,v)->{
int type = v.getPosition();
Map<Integer, Integer> orDefault = euipTppes.getOrDefault(type, new HashMap<>());
orDefault.putIfAbsent(v.getStar(),k);
euipTppes.putIfAbsent(type,orDefault);
});
}catch (Exception e){
LOGGER.error("exception");
}
}
public Map<Integer, Map<Integer, Integer>> getEuipTppes() {
return euipTppes;
}
public int getEquipByStar(int type, int star){
Map<Integer, Integer> integerIntegerMap = euipTppes.get(type);
if(null == integerIntegerMap){
return 0;
}
return integerIntegerMap.getOrDefault(star,0);
}
}

View File

@ -113,7 +113,7 @@ public interface BIReason {
int EXPEDITION_BOX_REWARD = 65;//猎妖之路宝箱奖励
int EXPEDITION_DROP_REWARD = 66;//猎妖之路奖励
int COMPLEX_EQUIP = 67;//合成装备
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级
int SECRETBOX_CONSUME = 1001;//秘盒抽卡
@ -209,6 +209,8 @@ public interface BIReason {
int CHAMPIONM_EXCHANGE_CONSUME = 1050;//巅峰赛兑换
int COMPLEX_EQUIP_CONSUME = 1051; //合成英雄

View File

@ -65,7 +65,9 @@ public class HotfixUtil implements IEventHandler {
}
LOGGER.debug("HotfixUtil->currVerion={},version={}", currVerion, version);
if (SysUtil.isWindows()) {
return;
}
//版本发生了变化,热更新

View File

@ -246,7 +246,7 @@ public class RechargeInfo extends MongoBase{
public void setMonthSaveAmt(int monthSaveAmt) {
this.monthSaveAmt = monthSaveAmt;
updateString("monthSaveAmt",smonthSaveAmt);
updateString("monthSaveAmt",monthSaveAmt);
}
public int getSmonthSaveAmt() {

View File

@ -562,4 +562,17 @@ public class ItemLogic {
ItemLogUtil.addLogQueue(itemLog);
}
/**
* 穿
* @param user
* @param equipid
* @return
*/
public static TreeSet<String> getEquipByID(User user, int equipid) {
TreeSet<String> equiplist = new TreeSet<>();
user.getEquipManager().getEquipMap().entrySet().stream().filter(stringEquipEntry ->
StringUtil.isEmpty(stringEquipEntry.getValue().getHeroId()) && stringEquipEntry.getValue().getEquipId() == equipid
).forEach(stringEquipEntry -> equiplist.add(stringEquipEntry.getKey()));
return equiplist;
}
}

View File

@ -33,6 +33,7 @@ public class SEquipConfig implements BaseConfig {
private int score;
private int star;
@Override
public void init() throws Exception {
@ -92,4 +93,12 @@ public class SEquipConfig implements BaseConfig {
}
public int getIfShow(){return ifShow; }
public int getStar() {
return star;
}
public void setStar(int star) {
this.star = star;
}
}