diff --git a/gamecommon/src/main/java/util/MathUtils.java b/gamecommon/src/main/java/util/MathUtils.java index 1963c91df..8854f1b86 100644 --- a/gamecommon/src/main/java/util/MathUtils.java +++ b/gamecommon/src/main/java/util/MathUtils.java @@ -174,9 +174,15 @@ public class MathUtils { * @return */ public static List randomForOneArray(int sourceArray[], int randomNums) { + List result = new ArrayList<>(); + if(randomNums==0){ + return result; + } int length = sourceArray.length; Set cacheIndexs = new HashSet<>(); + + // 这种while循环我觉得还是尽量避免下 或者一定要有个循环上限 while (randomNums>0){ int randomPos = randomInt(length); if(cacheIndexs.contains(randomPos)){ diff --git a/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java b/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java index 9cfb2b3e8..1aaa25f84 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java @@ -115,11 +115,14 @@ public interface BIReason { int EXPEDITION_DROP_REWARD = 66;//猎妖之路奖励 - int UNLOAD_SOUL_REWARD = 67;//猎妖之路奖励 + int UNLOAD_SOUL_REWARD = 67;//脱下魂印 + int COMPLEX_EQUIP = 68;//合成装备 + int REPLACE_SOUL_REWARD = 69;//替换魂印 + int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级 int SECRETBOX_CONSUME = 1001;//秘盒抽卡 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/TeamPosManager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/TeamPosManager.java index 172db0f0a..963528c92 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/TeamPosManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/TeamPosManager.java @@ -17,6 +17,8 @@ public class TeamPosManager extends MongoBase { private int curTeamPosId; @Transient private Map> cacheTeamPro = new HashMap<>(5); + @Transient + private Map> cachePassskill = new HashMap<>(5); public TeamPosManager(){ this.setRootCollection(User._COLLECTION_NAME); @@ -96,6 +98,14 @@ public class TeamPosManager extends MongoBase { cacheTeamPro.put(teamId,result); } + public Map> getCachePassskill() { + return cachePassskill; + } + + public void updatePassSkillTeamPos(int teamId, List result){ + cachePassskill.put(teamId,result); + } + public void updateTeamPosByTeamId(int teamId,List infos){ teamPosForHero.put(teamId,infos); updateString("teamPosForHero."+teamId,infos); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java index 344cf1b88..292dc38e6 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java @@ -22,6 +22,7 @@ import com.ljsd.jieling.logic.activity.event.Poster; import com.ljsd.jieling.logic.activity.event.SecretEvent; import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum; import com.ljsd.jieling.logic.hero.HeroAttributeEnum; import com.ljsd.jieling.logic.hero.HeroLogic; import com.ljsd.jieling.logic.mail.MailLogic; @@ -735,6 +736,41 @@ public class CombatLogic { return ""; } + public List passiveskillEffect(User user,Hero targetHero,int teamId){ + List passiveskillEffect = new ArrayList<>(); + if(teamId == 0){ + List heroSkillList = HeroLogic.getInstance().getHeroSkillList(user, targetHero); + heroSkillList.forEach(skill->{ + SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill); + if(config!=null &&config.getEffectiveRange()!=1 && PassiveskillCalEnum.contains(config.getType())){ + passiveskillEffect.add(config.getId()); + } + }); + return passiveskillEffect; + } + List result = user.getTeamPosManager().getCachePassskill().get(teamId); + if(result!=null){ + return result; + } + Map heroMap = user.getHeroManager().getHeroMap(); + List teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId); + + for(TeamPosHeroInfo teamPosHeroInfo :teamPosHeroInfos){ + Hero hero = heroMap.get(teamPosHeroInfo.getHeroId()); + List heroSkillList = HeroLogic.getInstance().getHeroSkillList(user, hero); + heroSkillList.forEach(skill->{ + SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill); + if(config!=null &&config.getEffectiveRange()!=1 && PassiveskillCalEnum.contains(config.getType())){ + passiveskillEffect.add(config.getId()); + } + }); + } + user.getTeamPosManager().updatePassSkillTeamPos(teamId,passiveskillEffect); + return passiveskillEffect; + } + + + public static List elementEffect(User user,int teamId){ List teamParm = user.getTeamPosManager().getCacheTeamPro().get(teamId); if(teamParm!=null){ @@ -809,14 +845,14 @@ public class CombatLogic { } effect[0] = normalProperties; effect[1] = special; - for(int i = 0 ; i2){ // LOGGER.info("生效的光环为{},{},{}",effect[i][0],effect[i][1],effect[i][2]); }else{ // LOGGER.info("生效的光环为{},{}",effect[i][0],effect[i][1]); } - } + }*/ List resultEffect = new ArrayList<>(); for(int i = 0; i entry:configMap.entrySet()){ @@ -825,10 +861,10 @@ public class CombatLogic { } } } - Iterator it = resultEffect.iterator(); + /* Iterator it = resultEffect.iterator(); while (it.hasNext()){ int[][] next = it.next(); - } + }*/ user.getTeamPosManager().updateTeamPos(teamId,resultEffect); return resultEffect; } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/passiveSkillCal/PassiveSkillProcessor.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/passiveSkillCal/PassiveSkillProcessor.java new file mode 100644 index 000000000..84175ee03 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/passiveSkillCal/PassiveSkillProcessor.java @@ -0,0 +1,10 @@ +package com.ljsd.jieling.logic.fight.passiveSkillCal; + +import com.ljsd.jieling.logic.dao.Hero; +import config.SPassiveSkillLogicConfig; + +import java.util.Map; + +public interface PassiveSkillProcessor { + void process(SPassiveSkillLogicConfig config, Hero hero, Map sourceMap, Map heroSkillAdMap); +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/passiveSkillCal/PassiveskillCalEnum.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/passiveSkillCal/PassiveskillCalEnum.java new file mode 100644 index 000000000..9e366ad5f --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/passiveSkillCal/PassiveskillCalEnum.java @@ -0,0 +1,116 @@ +package com.ljsd.jieling.logic.fight.passiveSkillCal; + +import com.ljsd.jieling.core.GlobalsDef; +import config.SPropertyConfig; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +//90 94 171 +public enum PassiveskillCalEnum { + SingleAdd(90,(config,hero,sourceMap,heroSkillAdMap)->{ + float[] value = config.getValue(); + int battlePropertyId = (int) value[0]; + SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId); + int optCode = (int) value[2]; + //转换 + float parm = value[1]; + if(optCode%2==0){ + if( sPropertyConfig.getStyle()!= GlobalsDef.PERCENT_TYPE){ + sPropertyConfig = SPropertyConfig.getsPropertyConfigByTargetPropertyId(sPropertyConfig.getPropertyId()); + } + parm = value[1]*10000; + } + + int extreeValue = (int) cal(optCode, sourceMap.getOrDefault(sPropertyConfig.getPropertyId(), 0), parm); + heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(),0)+extreeValue); + }), + AllAdd(94,(config,hero,sourceMap,heroSkillAdMap)->{ + float[] value = config.getValue(); + int battlePropertyId = (int) value[1]; + SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId); + int optCode = (int) value[2]; + //转换 + float parm = value[0]; + if(optCode%2==0){ + if( sPropertyConfig.getStyle()!= GlobalsDef.PERCENT_TYPE){ + sPropertyConfig = SPropertyConfig.getsPropertyConfigByTargetPropertyId(sPropertyConfig.getPropertyId()); + } + parm = value[0]*10000; + } + int extreeValue = (int) cal(optCode, sourceMap.getOrDefault(sPropertyConfig.getPropertyId(), 0), parm); + heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(),0)+extreeValue); + }), + HEROAFTER100ADD(171,(config,hero,sourceMap,heroSkillAdMap)->{ + float[] value = config.getValue(); + int battlePropertyId = (int) value[0]; + SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId); + int level = hero.getLevel(); + int times=level-100; + if(times<=0){ + return; + } + int parm = (int) value[1]*times; + heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(),0)+parm); + }),//武将100级后每升一级[c]额外增加[d] + ; + private int type; + private PassiveSkillProcessor passiveSkillProcessor; + + + PassiveskillCalEnum(int type,PassiveSkillProcessor passiveSkillProcessor) { + this.type = type; + this.passiveSkillProcessor = passiveSkillProcessor; + } + public static Map calEnumMap = new HashMap<>(); + static { + Arrays.stream(PassiveskillCalEnum.values()).forEach(e->{ + calEnumMap.put(e.type,e); + }); + } + + public PassiveSkillProcessor getPassiveSkillProcessor() { + return passiveSkillProcessor; + } + + public static Map getCalEnumMap() { + return calEnumMap; + } + + + public static boolean contains(int type){ + return calEnumMap.containsKey(type); + } + + + + /** + * @param optCode + * @param source + * @param parm + * a(当前属性) oa(战斗初始属性)b(增量) + * 1 加算 a+b 增益 + * 2 乘算 a+oa*b 增益 对基础属性其效果,不是当前属性 + * 3 减算 a-b 减益 + * 4 乘减算 a*(1-b) 减益 对当前属性其效果,不是基础属性 + */ + public static float cal(int optCode,int source,float parm){ + switch (optCode){ + case 1:{ + return parm; + } + case 2:{ + return parm*10000; + } + case 3:{ + return -parm; + } + case 4:{ + return -parm*10000; + } + } + return 0f; + } + +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index 6d0eef624..be8781135 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -18,6 +18,7 @@ import com.ljsd.jieling.logic.activity.eventhandler.HeroFiveStarGetEventHandler; import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.fight.CombatLogic; +import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum; import com.ljsd.jieling.logic.item.ItemLogic; import com.ljsd.jieling.logic.mission.GameEvent; import com.ljsd.jieling.logic.mission.MissionLoigc; @@ -678,6 +679,7 @@ public class HeroLogic{ HeroInfoProto.UpHeroLevelResponse build = HeroInfoProto.UpHeroLevelResponse.newBuilder().setHeroId(heroId).setTargetLevel(hero.getLevel()).build(); //发送成功消息 MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_LEVEL_RESPONSE_VALUE,build,true); + calHeoForce(user,hero); } @@ -983,19 +985,12 @@ public class HeroLogic{ return result; } - public StringBuilder getHeroSkills(User user,Hero hero, StringBuilder sb){ - + public List getHeroSkillList(User user,Hero hero){ + List skillList = new ArrayList<>(); SCHero tempHero = SCHero.getsCHero().get(hero.getTemplateId()); - for (Integer skillId : tempHero.getSkillListByStar(hero.getStar())) { - sb.append(skillId).append(DIVISION); - } - Map>> passiveSkillMap = tempHero.getPassiveSkillMap(); - passiveSkillMap.get(1).getOrDefault(hero.getBreakId(),new ArrayList<>()).forEach(skillId->{ - sb.append(skillId).append(DIVISION); - }); - passiveSkillMap.get(2).getOrDefault(hero.getBreakId(),new ArrayList<>()).forEach(skillId->{ - sb.append(skillId).append(DIVISION); - }); + skillList.addAll(tempHero.getSkillListByStar(hero.getStar())); + skillList.addAll( tempHero.getPassiveSkills(1,hero.getBreakId())); + skillList.addAll( tempHero.getPassiveSkills(2,hero.getStarBreakId())); Map equipByPositionMap = hero.getEquipByPositionMap(); if(!equipByPositionMap.isEmpty()){ @@ -1007,21 +1002,40 @@ public class HeroLogic{ } int skillId = equipMap.get(equipId).getSkill(); if(skillId!=0){ - sb.append(skillId).append(DIVISION); + skillList.add(skillId); } } } + //魂印 + Map soulEquipByPositionMap = hero.getSoulEquipByPositionMap(); + Map config = STableManager.getConfig(SEquipConfig.class); + soulEquipByPositionMap.values().forEach(e->{ + if(config.get(e).getPassiveSkill()!=0){ + skillList.add(config.get(e).getPassiveSkill()); + } + }); //法宝技能 int[] equipTalismana = tempHero.getEquipTalismana(); if(hero.getStar() sEquipTalismana = SEquipTalismana.equipTalismanaStarMap.get(especialEquipId); sEquipTalismana.forEach((k,v)->{ if(ksb.append(i).append(DIVISION)); + Arrays.stream(v.getOpenSkillRules()).forEach(i->skillList.add(i)); + } + }); + return skillList; + } + + public StringBuilder getHeroSkills(User user,Hero hero, StringBuilder sb){ + List heroSkillList = getHeroSkillList(user, hero); + heroSkillList.forEach(skill->{ + SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill); + if(config!=null &&config.getEffectiveRange()==1){ + sb.append(skill).append(DIVISION); } }); return sb; @@ -1305,6 +1319,12 @@ public class HeroLogic{ combinedAttribute(property,heroAllAttribute); } + Map soulEquipByPositionMap = hero.getSoulEquipByPositionMap(); + Map equipConfigMap = STableManager.getConfig(SEquipConfig.class); + soulEquipByPositionMap.values().forEach(e->{ + combinedAttribute( equipConfigMap.get(e).getProperty(),heroAllAttribute); + }); + //阵营光环加成 if(!isForce){ if(teamId!=0){ @@ -1316,14 +1336,43 @@ public class HeroLogic{ } } } + + //被动技能加成 + List heroSkillList = CombatLogic.getInstance().passiveskillEffect(user, hero,teamId); + Map heroSkillAdMap = new HashMap<>(); + heroSkillList.forEach(skill->{ + SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill); + if(config.getValue()[2] !=4){ + PassiveskillCalEnum.calEnumMap.get(config.getType()).getPassiveSkillProcessor().process(config,hero,heroAllAttribute,heroSkillAdMap); + } + + }); + if(!heroSkillAdMap.isEmpty()){ + combinedAttribute(heroSkillAdMap,heroAllAttribute); + heroSkillAdMap.clear(); + } calInteractAdd(heroAllAttribute); + heroSkillList.forEach(skill->{ + SPassiveSkillLogicConfig configTmp = SPassiveSkillLogicConfig.getConfig(skill); + if(configTmp.getValue()[2] ==4){ + PassiveskillCalEnum.calEnumMap.get(configTmp.getType()).getPassiveSkillProcessor().process(configTmp,hero,heroAllAttribute,heroSkillAdMap); + } + }); + if(!heroSkillAdMap.isEmpty()){ + combinedAttribute(heroSkillAdMap,heroAllAttribute); + calInteractAdd(heroAllAttribute); + heroSkillAdMap.clear(); + } + heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE)); //装备战力保存 heroAllAttribute.put(HeroAttributeEnum.EquipForce.getPropertyId(),equipForce); + return heroAllAttribute; } + public Map calRobotHeroAttribute(SCHero scHero,int heroLevel,int heroBrekId,int[] pokemonIds,int pokemonLevel,boolean isForce){ Map heroAllAttribute = calRobotHeroAllAttribute(scHero.getId(),heroLevel,heroBrekId,isForce); heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE)); @@ -1412,7 +1461,7 @@ public class HeroLogic{ Map heroAllAttribute; heroAllAttribute = calHeroNotBufferAttribute(user, hero,true,0); //战力保存 - int force = calForce(heroAllAttribute); + int force = calForce(heroAllAttribute); return force + heroAllAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId()); } @@ -2017,34 +2066,61 @@ public class HeroLogic{ int uid = iSession.getUid(); User user = UserManager.getUser(uid); String heroId = optHeroSoul.getHeroId(); + System.out.println(heroId); Hero hero = user.getHeroManager().getHero(heroId); checkAllowedOpt(2,user,hero.getStar()); - checkAllowedWear(user,hero.getTemplateId(),optHeroSoul.getSoulEquipIdsList(),unload); + checkAllowedWear(user,hero,optHeroSoul.getSoulEquipIdsList(),unload); + Map returnItems = new HashMap<>(); + Map soulEquipByPositionMap = hero.getSoulEquipByPositionMap(); optHeroSoul.getSoulEquipIdsList().forEach(e->{ + if(soulEquipByPositionMap.containsKey(e.getPosition())){ + returnItems.put(soulEquipByPositionMap.get(e.getPosition()),1); + } hero.updateSoulEquipPositionMap(e.getPosition(),e.getEquipId()); + }); + ItemUtil.dropMap(user,returnItems,BIReason.REPLACE_SOUL_REWARD); MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.SOUL_EQUIP_WEAR_RESPONSE_VALUE,null,true); } - private void checkAllowedWear(User user,int targetHeroTid,List soulEquipIdsList, HeroInfoProto.OptHeroSoul unload) throws Exception { - + private void checkAllowedWear(User user,Hero targetHero,List soulEquipIdsList, HeroInfoProto.OptHeroSoul unload) throws Exception { + int targetHeroTid = targetHero.getTemplateId(); List equids = new ArrayList<>(); + Map soulEquipByPositionMap = targetHero.getSoulEquipByPositionMap(); + Collection values = soulEquipByPositionMap.values(); + for(HeroInfoProto.SoulEquipPos item:soulEquipIdsList){ + if(values.contains(item.getEquipId()) && soulEquipByPositionMap.get(item.getPosition()) != item.getEquipId()){ + throw new ErrorCodeException(ErrorCode.SERVER_DEFINE); + } + } soulEquipIdsList.forEach(e->equids.add(e.getEquipId())); List unloadSoulIds = new ArrayList<>(); - if(unload!=null){ + Map heroMap = user.getHeroManager().getHeroMap(); + if(unload!=null && !StringUtil.isEmpty(unload.getHeroId())){ + String heroId = unload.getHeroId(); List soulEquipIdsListUnload = unload.getSoulEquipIdsList(); - soulEquipIdsListUnload.forEach(e->{ - equids.remove(e.getEquipId()); - unloadSoulIds.add(e.getEquipId()); - }); + Map unloadSoulEquipByPositionMap = heroMap.get(heroId).getSoulEquipByPositionMap(); + for(HeroInfoProto.SoulEquipPos soulEquipPos:soulEquipIdsListUnload){ + unloadSoulIds.add(soulEquipPos.getEquipId()); + if(unloadSoulEquipByPositionMap.get(soulEquipPos.getPosition())!=soulEquipPos.getEquipId()){ + throw new ErrorCodeException(ErrorCode.SERVER_DEFINE); + } + } + equids.removeAll(unloadSoulIds); } //是否魂印能被本英雄佩戴 //是否只能一名武将佩戴 - Map heroMap = user.getHeroManager().getHeroMap(); + Set cacheIds = new HashSet<>(); + int userLevel = user.getPlayerInfoManager().getLevel(); for(HeroInfoProto.SoulEquipPos item:soulEquipIdsList){ int equipId = item.getEquipId(); + int[] sign_locations = SSpecialConfig.getOnceArrayValue("Sign_Location"); + int position = item.getPosition(); + if(positionsign_locations.length-1 || userLevel < sign_locations[position]){ + throw new ErrorCodeException(ErrorCode.SERVER_DEFINE); + } SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(equipId); if(sEquipConfig.getRangeHeroTids()!=null && !sEquipConfig.getRangeHeroTids().contains(targetHeroTid)){ throw new ErrorCodeException(ErrorCode.SERVER_DEFINE); @@ -2074,7 +2150,7 @@ public class HeroLogic{ throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH); } } - if(unload!=null){ + if(unload!=null&&!StringUtil.isEmpty(unload.getHeroId())){ Hero hero = user.getHeroManager().getHero(unload.getHeroId()); List soulEquipIdsListUnload = unload.getSoulEquipIdsList(); soulEquipIdsListUnload.forEach(e->{ @@ -2124,6 +2200,9 @@ public class HeroLogic{ } public static void unloadSoulEquipOpt(ISession iSession, String heroId, List equipIdsList) throws Exception { + if(equipIdsList == null || equipIdsList.isEmpty()){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); + } int uid = iSession.getUid(); User user = UserManager.getUser(uid); Hero hero = user.getHeroManager().getHero(heroId); diff --git a/tablemanager/src/main/java/config/SCHero.java b/tablemanager/src/main/java/config/SCHero.java index cd0766949..6f010b25b 100644 --- a/tablemanager/src/main/java/config/SCHero.java +++ b/tablemanager/src/main/java/config/SCHero.java @@ -60,7 +60,7 @@ public class SCHero implements BaseConfig{ private Map> consumeMaterialInfoOfPositionByStar; - private Map>> passiveSkillMap; + private Map>> passiveSkillMap; private static Map piecesMap; @@ -147,9 +147,9 @@ public class SCHero implements BaseConfig{ } scHero.setSkillListByStar(skillTmp); - Map>> passiveSkillMapTmp = new HashMap<>(); - passiveSkillMapTmp.put(1,new HashMap<>()); - passiveSkillMapTmp.put(2,new HashMap<>()); + Map>> passiveSkillMapTmp = new HashMap<>(); + passiveSkillMapTmp.put(1,new TreeMap<>()); + passiveSkillMapTmp.put(2,new TreeMap<>()); for(int[] openSkillRule : scHero.getOpenPassiveSkillRules()){ int type = openSkillRule[0]; @@ -292,11 +292,15 @@ public class SCHero implements BaseConfig{ return equipTalismana; } - public Map>> getPassiveSkillMap() { - return passiveSkillMap; + + public List getPassiveSkills(int type,int id){ + if( passiveSkillMap.get(type).floorEntry(id)==null){ + return new ArrayList<>(0); + } + return passiveSkillMap.get(type).floorEntry(id).getValue(); } - public void setPassiveSkillMap(Map>> passiveSkillMap) { + public void setPassiveSkillMap(Map>> passiveSkillMap) { this.passiveSkillMap = passiveSkillMap; } } diff --git a/tablemanager/src/main/java/config/SEquipConfig.java b/tablemanager/src/main/java/config/SEquipConfig.java index 8e2d1651a..a4438045c 100644 --- a/tablemanager/src/main/java/config/SEquipConfig.java +++ b/tablemanager/src/main/java/config/SEquipConfig.java @@ -19,6 +19,8 @@ public class SEquipConfig implements BaseConfig { private int[] propertyMin; + private int[][] property; + private int[] propertyMax; private int[] pool; @@ -160,4 +162,8 @@ public class SEquipConfig implements BaseConfig { public int getPassiveSkill() { return passiveSkill; } + + public int[][] getProperty() { + return property; + } } \ No newline at end of file diff --git a/tablemanager/src/main/java/config/SPassiveSkillLogicConfig.java b/tablemanager/src/main/java/config/SPassiveSkillLogicConfig.java index 49153f4c5..02c1b254d 100644 --- a/tablemanager/src/main/java/config/SPassiveSkillLogicConfig.java +++ b/tablemanager/src/main/java/config/SPassiveSkillLogicConfig.java @@ -18,6 +18,10 @@ public class SPassiveSkillLogicConfig implements BaseConfig { private int weight; + private int effectiveRange; + + private int coverID; + public static Map config; @Override @@ -48,4 +52,8 @@ public class SPassiveSkillLogicConfig implements BaseConfig { public int getWeight() { return weight; } + + public int getEffectiveRange() { + return effectiveRange; + } } \ No newline at end of file diff --git a/tablemanager/src/main/java/config/SPropertyConfig.java b/tablemanager/src/main/java/config/SPropertyConfig.java index d392799aa..f75793a1b 100644 --- a/tablemanager/src/main/java/config/SPropertyConfig.java +++ b/tablemanager/src/main/java/config/SPropertyConfig.java @@ -9,8 +9,6 @@ import java.util.Map; @Table(name ="PropertyConfig") public class SPropertyConfig implements BaseConfig { - private int id; - private int propertyId; private int style; @@ -21,19 +19,35 @@ public class SPropertyConfig implements BaseConfig { private int ifFormula; + private int propertyIdInBattle; + private static Map sPropertyConfigByPIDMap; + private static Map sPropertyIConfigByInBattleMap; + private static Map sPropertyConfigByTargetMap; @Override public void init() throws Exception { Map sPropertyConfigByPIDMapTmp = new HashMap<>(); + Map sPropertyIConfigByInBattleMapTmp = new HashMap<>(); + Map sPropertyConfigByTargetMapTmp = new HashMap<>(); Map config = STableManager.getConfig(SPropertyConfig.class); for(SPropertyConfig sPropertyConfig : config.values()){ int propertyId = sPropertyConfig.getPropertyId(); sPropertyConfigByPIDMapTmp.put(propertyId,sPropertyConfig); + int propertyIdInBattle = sPropertyConfig.getPropertyIdInBattle(); + if(propertyIdInBattle!=0){ + sPropertyIConfigByInBattleMapTmp.put(propertyIdInBattle,sPropertyConfig); + } + int targetPropertyId = sPropertyConfig.getTargetPropertyId(); + if(targetPropertyId!=0){ + sPropertyConfigByTargetMapTmp.put(targetPropertyId,sPropertyConfig); + } } sPropertyConfigByPIDMap = sPropertyConfigByPIDMapTmp; + sPropertyIConfigByInBattleMap = sPropertyIConfigByInBattleMapTmp; + sPropertyConfigByTargetMap = sPropertyConfigByTargetMapTmp; } @@ -41,10 +55,15 @@ public class SPropertyConfig implements BaseConfig { return sPropertyConfigByPIDMap.get(propertyId); } - public int getId() { - return id; + public static SPropertyConfig getsPropertyConfigByBattlePID(int battlePropertyId) { + return sPropertyIConfigByInBattleMap .get(battlePropertyId); } + public static SPropertyConfig getsPropertyConfigByTargetPropertyId(int targetPropertyId) { + return sPropertyConfigByTargetMap.get(targetPropertyId); + } + + public int getPropertyId() { return propertyId; } @@ -64,4 +83,8 @@ public class SPropertyConfig implements BaseConfig { public int getIfFormula() { return ifFormula; } + + public int getPropertyIdInBattle() { + return propertyIdInBattle; + } } \ No newline at end of file diff --git a/tablemanager/src/main/java/config/SSpecialConfig.java b/tablemanager/src/main/java/config/SSpecialConfig.java index 96b55f7c1..d124f2705 100644 --- a/tablemanager/src/main/java/config/SSpecialConfig.java +++ b/tablemanager/src/main/java/config/SSpecialConfig.java @@ -55,6 +55,7 @@ public class SSpecialConfig implements BaseConfig { public static final String HERO_RETURN_PERCENT = "hero_return_percent";//回溯返还材料比例 实际百分比为填写数值/10000 public static final String HERO_SACRIFICE_PERCENT = "hero_sacrifice_percent";//献祭返还材料比例 实际百分比为填写数值/10000 public static final String HERO_RESOLVE_LICENCE = "hero_resolve_licence";//分解英雄时,处于编队中会有提示 + public static final String Sign_Location = "Sign_Location";//魂印位置开启条件(玩家等级) @Override public void init() throws Exception {