宝器战力问题

back_recharge
duhui 2023-04-18 15:06:18 +08:00
parent 7a02f3271b
commit 3e04227362
3 changed files with 31 additions and 10 deletions

View File

@ -374,11 +374,29 @@ public class CoreService implements RPCRequestIFace.Iface {
jsonObject.getJSONObject("itemManager").put("itemMap",new HashMap<>()); jsonObject.getJSONObject("itemManager").put("itemMap",new HashMap<>());
jsonObject.remove("mailManager"); jsonObject.remove("mailManager");
jsonObject.remove("storeManager"); jsonObject.remove("storeManager");
jsonObject.getJSONObject("equipManager").put("jewelMap", getJewelManager(user));
return jsonObject.toString(); return jsonObject.toString();
} }
return ""; return "";
} }
public HashMap<String, Jewel> getJewelManager(User user){
HashMap<String, Jewel> jewelMap = new HashMap<>();
try {
Map<String, com.ljsd.jieling.logic.dao.PropertyItem> equipMap = user.getEquipManager().getEquipMap();
for (Map.Entry<String, com.ljsd.jieling.logic.dao.PropertyItem> entry : equipMap.entrySet()) {
com.ljsd.jieling.logic.dao.PropertyItem propertyItem = entry.getValue();
if (propertyItem instanceof Jewel){
Jewel jewel = (Jewel) propertyItem;
jewelMap.put(entry.getKey(), jewel);
}
}
}catch (Exception e){
e.printStackTrace();
}
return jewelMap;
}
@Override @Override
public void updateUserInfoByRpc(int uid, String userStr, int type) throws TException { public void updateUserInfoByRpc(int uid, String userStr, int type) throws TException {
User thisUser = null; User thisUser = null;

View File

@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.dao;
import com.ljsd.common.mogodb.MongoBase; import com.ljsd.common.mogodb.MongoBase;
import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.dao.root.User;
import org.springframework.data.annotation.Transient;
import java.util.*; import java.util.*;
@ -11,9 +12,8 @@ public class EquipManager extends MongoBase {
private final Map<String,Faxiang> faxiangMap = new HashMap<>(); private final Map<String,Faxiang> faxiangMap = new HashMap<>();
private final Set<Integer> equipBookEnabled = new HashSet<>(); private final Set<Integer> equipBookEnabled = new HashSet<>();
private final Set<Integer> equipList = new HashSet<>(); private final Set<Integer> equipList = new HashSet<>();
@Transient
// private Equip unDetermined; private final Map<String,Jewel> jewelMap = new HashMap<>();
private final Map<Integer,Integer> equipHandBook; private final Map<Integer,Integer> equipHandBook;
private int soulEquipPool;//占星装备卡池 private int soulEquipPool;//占星装备卡池
@ -56,6 +56,10 @@ public class EquipManager extends MongoBase {
} }
} }
public Map<String, Jewel> getJewelMap() {
return jewelMap;
}
public Map<String, PropertyItem> getEquipMap() { public Map<String, PropertyItem> getEquipMap() {
return equipMap; return equipMap;
} }

View File

@ -27,12 +27,10 @@ import com.ljsd.jieling.logic.activity.eventhandler.PokemonFiveStarGetEventHandl
import com.ljsd.jieling.logic.activity.eventhandler.SaveHeroForceEventHandler; import com.ljsd.jieling.logic.activity.eventhandler.SaveHeroForceEventHandler;
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic; import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.dao.vo.HeroVo; import com.ljsd.jieling.logic.dao.vo.HeroVo;
import com.ljsd.jieling.logic.expedition.ExpeditionLogic; import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
import com.ljsd.jieling.logic.fight.CombatLogic; import com.ljsd.jieling.logic.fight.CombatLogic;
import com.ljsd.jieling.logic.fight.DuoduiTowerLogic;
import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum; import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum;
import com.ljsd.jieling.logic.fight.specialparm.SpecialForTeamBuildEnum; import com.ljsd.jieling.logic.fight.specialparm.SpecialForTeamBuildEnum;
import com.ljsd.jieling.logic.help.HelpHero; import com.ljsd.jieling.logic.help.HelpHero;
@ -3090,11 +3088,12 @@ public class HeroLogic {
if (propertyItem instanceof Jewel){ if (propertyItem instanceof Jewel){
jewel = (Jewel) propertyItem; jewel = (Jewel) propertyItem;
}else { }else {
jewel = new Jewel(); Map<String, Jewel> jewelMap = equipManager.getJewelMap();
jewel.setHeroId(propertyItem.getHeroId()); jewel = jewelMap.get(jewelId);
jewel.setLevel(propertyItem.getLevel()); if (jewel == null){
jewel.setEquipId(propertyItem.getEquipId()); LOGGER.error("计算战力,英雄:{}-{},宝器:{},数据库内找不到",hero.getId(),hero.getTemplateId(),jewelId);
jewel.setBuildLevel(1); continue;
}
} }
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(jewel.getEquipId()); SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(jewel.getEquipId());
// 进阶 // 进阶