神印套装修改
parent
59b425a73e
commit
c07e035c17
|
@ -2058,36 +2058,7 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
// 神印套装
|
||||
Iterator<Map.Entry<Integer, Integer>> godSealIterator = godSealByPositionMap.entrySet().iterator();
|
||||
ArrayList<SEquipConfig> godSealSuiteNumList = new ArrayList<>();
|
||||
while (godSealIterator.hasNext()) {
|
||||
Map.Entry<Integer, Integer> next = godSealIterator.next();
|
||||
SEquipConfig sEquipConfig = config.get(next.getValue());
|
||||
// 添加到套装list
|
||||
godSealSuiteNumList.add(sEquipConfig);
|
||||
}
|
||||
// 记录当前长度(位置)
|
||||
int godSealNum = godSealSuiteNumList.size();
|
||||
if (godSealNum > 0) {
|
||||
// 根据品质正序排序
|
||||
godSealSuiteNumList.sort(Comparator.comparingInt(SEquipConfig::getQuality));
|
||||
// 遍历套装list
|
||||
for (SEquipConfig item : godSealSuiteNumList) {
|
||||
//根据星级读取配置表,为空表示不是套装
|
||||
SEquipSuiteConfig sEquipSuiteConfig = SEquipSuiteConfig.config.get(item.getSuiteID1());
|
||||
if (null != sEquipSuiteConfig) {
|
||||
// 根据套装数量读表,为空标是套装数量不足
|
||||
Integer integer = sEquipSuiteConfig.getSuiteSkills().get(godSealNum);
|
||||
if (integer == null) {
|
||||
godSealNum -= 1;
|
||||
continue;
|
||||
}
|
||||
skillList.add(integer);
|
||||
}
|
||||
// 不管是否是套装,都要-1
|
||||
godSealNum -= 1;
|
||||
}
|
||||
}
|
||||
getGodSealSuiteSkill(godSealByPositionMap, skillList);
|
||||
|
||||
// 魂灵宝
|
||||
Map<Integer, SJewelConfig> map = STableManager.getConfig(SJewelConfig.class);
|
||||
|
@ -2132,35 +2103,7 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
// 装备套装list初始化
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator = heroVo.getHMEquipPositionMap().entrySet().iterator();
|
||||
ArrayList<SEquipConfig> suiteNumList = new ArrayList<>();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<Integer, Integer> next = iterator.next();
|
||||
SEquipConfig sEquipConfig = config.get(next.getValue());
|
||||
// 添加到套装list
|
||||
suiteNumList.add(sEquipConfig);
|
||||
}
|
||||
Collections.sort(suiteNumList);
|
||||
// 记录当前长度(位置)
|
||||
int num = suiteNumList.size();
|
||||
if (!suiteNumList.isEmpty()) {
|
||||
// 遍历套装list
|
||||
for (SEquipConfig item : suiteNumList) {
|
||||
//根据星级读取配置表,为空表示不是套装
|
||||
SEquipSuiteConfig sEquipSuiteConfig = SEquipSuiteConfig.config.get(item.getStar());
|
||||
if (null != sEquipSuiteConfig) {
|
||||
// 根据套装数量读表,为空标是套装数量不足
|
||||
Integer integer = sEquipSuiteConfig.getSuiteSkills().get(num);
|
||||
if (integer == null) {
|
||||
num -= 1;
|
||||
continue;
|
||||
}
|
||||
skillList.add(integer);
|
||||
}
|
||||
// 不管是否是套装,都要-1
|
||||
num -= 1;
|
||||
}
|
||||
}
|
||||
getEquipSuiteSkill(heroVo.getHMEquipPositionMap(), skillList);
|
||||
|
||||
// 坐骑技能
|
||||
for (Map.Entry<Integer, Long> entry : heroVo.getUserMountValidTime().entrySet()) {
|
||||
|
@ -2222,6 +2165,78 @@ public class HeroLogic {
|
|||
return skillList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取神印技能列表
|
||||
* @param godSealMap 神印map
|
||||
* @param skillList 技能列表
|
||||
*/
|
||||
private void getGodSealSuiteSkill(Map<Integer, Integer> godSealMap, List<Integer> skillList){
|
||||
int suiteLimit = 4;
|
||||
HashMap<Integer, List<SEquipConfig>> godTypeOfMap = new HashMap<>();
|
||||
for (Integer id : godSealMap.values()) {
|
||||
SEquipConfig config = SEquipConfig.equipConfigMap.get(id);
|
||||
if (config == null){
|
||||
continue;
|
||||
}
|
||||
List<SEquipConfig> list = godTypeOfMap.getOrDefault(config.getShenYinType(), new ArrayList<>());
|
||||
list.add(config);
|
||||
godTypeOfMap.put(config.getShenYinType(), list);
|
||||
}
|
||||
|
||||
for (Map.Entry<Integer, List<SEquipConfig>> entry : godTypeOfMap.entrySet()) {
|
||||
List<SEquipConfig> equipList = entry.getValue();
|
||||
if (equipList.size() < suiteLimit){
|
||||
continue;
|
||||
}
|
||||
Integer suiteId = equipList.stream().min(Comparator.comparing(SEquipConfig::getQuality)).map(SEquipConfig::getSuiteID1).orElse(0);
|
||||
SEquipSuiteConfig suiteConfig = SEquipSuiteConfig.config.get(suiteId);
|
||||
if (suiteConfig == null){
|
||||
continue;
|
||||
}
|
||||
Integer skillId = suiteConfig.getSuiteSkills().get(suiteLimit);
|
||||
if (skillId == null){
|
||||
continue;
|
||||
}
|
||||
skillList.add(skillId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取装备套装技能
|
||||
* @param equipMap 装备map
|
||||
* @param skillList 技能list
|
||||
*/
|
||||
private void getEquipSuiteSkill(Map<Integer, Integer> equipMap, List<Integer> skillList){
|
||||
ArrayList<SEquipConfig> suiteNumList = new ArrayList<>();
|
||||
for (Integer id : equipMap.values()) {
|
||||
SEquipConfig sEquipConfig = SEquipConfig.equipConfigMap.get(id);
|
||||
// 添加到套装list
|
||||
suiteNumList.add(sEquipConfig);
|
||||
}
|
||||
Collections.sort(suiteNumList);
|
||||
// 记录当前长度(位置)
|
||||
int num = suiteNumList.size();
|
||||
if (!suiteNumList.isEmpty()) {
|
||||
// 遍历套装list
|
||||
for (SEquipConfig item : suiteNumList) {
|
||||
//根据星级读取配置表,为空表示不是套装
|
||||
SEquipSuiteConfig sEquipSuiteConfig = SEquipSuiteConfig.config.get(item.getStar());
|
||||
if (null != sEquipSuiteConfig) {
|
||||
// 根据套装数量读表,为空标是套装数量不足
|
||||
Integer integer = sEquipSuiteConfig.getSuiteSkills().get(num);
|
||||
if (integer == null) {
|
||||
num -= 1;
|
||||
continue;
|
||||
}
|
||||
skillList.add(integer);
|
||||
}
|
||||
// 不管是否是套装,都要-1
|
||||
num -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 神将置换
|
||||
*/
|
||||
|
@ -2709,12 +2724,6 @@ public class HeroLogic {
|
|||
|
||||
/**
|
||||
* 计算队伍战力
|
||||
*
|
||||
* @param user
|
||||
* @param hero
|
||||
* @param isForce
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
public Map<Integer, Long> calHeroNotBufferAttribute(User user, Hero hero, boolean isForce, int teamId) {
|
||||
Map<Integer, Long> heroAllAttribute = calHeroAllAttribute(user, hero, isForce);
|
||||
|
@ -2903,65 +2912,8 @@ public class HeroLogic {
|
|||
combinedAttribute(SChangingForce.get(user.getHeroManager().getTransformationForce()).getPropList(), heroAllAttribute);
|
||||
}
|
||||
|
||||
//装备总战力评分
|
||||
int equipForce = 0;
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator = hero.getEquipByHongmengPositionMap(heroManager).entrySet().iterator();
|
||||
|
||||
Map<Integer, SEquipStrengthen> strengthenMap = SEquipStrengthen.lvMap;
|
||||
Map<Integer, SEquipRankUp> rankUpMap = SEquipRankUp.lvMap;
|
||||
Map<Integer, HeroEquipStrong> strongMap = hero.getEquipStrongMap();
|
||||
int advanceLv = hero.getEquipAdvanceLv();
|
||||
|
||||
// 套装list初始化
|
||||
ArrayList<SEquipConfig> suiteNumList = new ArrayList<>();
|
||||
Map<Integer, SEquipConfig> equipConfigMap = STableManager.getConfig(SEquipConfig.class);
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<Integer, Integer> next = iterator.next();
|
||||
SEquipConfig sEquipConfig = equipConfigMap.get(next.getValue());
|
||||
int[][] property = sEquipConfig.getProperty();
|
||||
Map<Integer, Long> propertyValueByIdMap = new HashMap<>();
|
||||
for (int[] prop : property) {
|
||||
long value = prop[1];
|
||||
SPropertyConfig config = SPropertyConfig.getsPropertyConfigByPID(prop[0]);
|
||||
// 家园装备强化属性,只增加基础属性
|
||||
if (config != null && config.getStyle() == 1){
|
||||
double buff = 0;
|
||||
int strongLv = strongMap.getOrDefault(sEquipConfig.getPosition(),new HeroEquipStrong(sEquipConfig.getPosition())).getStrongLv();
|
||||
buff += Optional.ofNullable(strengthenMap.get(strongLv)).map(SEquipStrengthen::getRate).orElse(0);
|
||||
// 突破
|
||||
buff += Optional.ofNullable(rankUpMap.get(advanceLv)).map(v -> v.getRate()[sEquipConfig.getPosition() - 1]).orElse(0);
|
||||
value = value + (long) Math.ceil(buff/10000*value);
|
||||
}
|
||||
propertyValueByIdMap.put(prop[0], value);
|
||||
}
|
||||
combinedAttribute(propertyValueByIdMap, heroAllAttribute);
|
||||
equipForce += sEquipConfig.getScore();
|
||||
// 添加到套装list
|
||||
suiteNumList.add(sEquipConfig);
|
||||
}
|
||||
|
||||
/*========== 开始处理套装 ============*/
|
||||
// 根据升序顺序排列list
|
||||
Collections.sort(suiteNumList);
|
||||
// 记录当前长度(位置)
|
||||
int num = suiteNumList.size();
|
||||
if (!suiteNumList.isEmpty()) {
|
||||
// 遍历套装list
|
||||
for (SEquipConfig item : suiteNumList) {
|
||||
//根据星级读取配置表,为空表示不是套装
|
||||
SEquipSuiteConfig sEquipSuiteConfig = SEquipSuiteConfig.config.get(item.getStar());
|
||||
if (null != sEquipSuiteConfig) {
|
||||
// 根据套装数量读表,为空标是套装数量不足
|
||||
Map<Integer, Long> suitePropertyMap = sEquipSuiteConfig.getSuiteMap().get(num);
|
||||
if (suitePropertyMap != null) {
|
||||
// 计算战力
|
||||
combinedAttribute(suitePropertyMap, heroAllAttribute);
|
||||
}
|
||||
}
|
||||
// 不管是否是套装,都要-1
|
||||
num -= 1;
|
||||
}
|
||||
}
|
||||
// 装备套装属性
|
||||
getEquipSuiteAttr(hero, heroAllAttribute);
|
||||
|
||||
//工坊科技树加成
|
||||
Map<Integer, Integer> techProfressionMap = user.getWorkShopController().getTechnologyMap().get(scHero.getProfession());
|
||||
|
@ -3112,6 +3064,8 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
|
||||
Map<Integer, SEquipConfig> equipConfigMap = STableManager.getConfig(SEquipConfig.class);
|
||||
|
||||
//魂印
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
soulEquipByPositionMap.forEach((k, v) -> {
|
||||
|
@ -3277,22 +3231,81 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
||||
//魂印战力保存
|
||||
heroAllAttribute.put(HeroAttributeEnum.EquipForce.getPropertyId(), (long) equipForce);
|
||||
|
||||
return heroAllAttribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取装备套装属性
|
||||
* @param hero 英雄信息
|
||||
* @param heroAllAttribute 总属性
|
||||
*/
|
||||
private void getEquipSuiteAttr(Hero hero, Map<Integer, Long> heroAllAttribute){
|
||||
//装备总战力评分
|
||||
long equipForce = 0;
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator = hero.getEquipByPositionMap().entrySet().iterator();
|
||||
|
||||
Map<Integer, SEquipStrengthen> strengthenMap = SEquipStrengthen.lvMap;
|
||||
Map<Integer, SEquipRankUp> rankUpMap = SEquipRankUp.lvMap;
|
||||
Map<Integer, HeroEquipStrong> strongMap = hero.getEquipStrongMap();
|
||||
int advanceLv = hero.getEquipAdvanceLv();
|
||||
|
||||
// 套装list初始化
|
||||
ArrayList<SEquipConfig> suiteNumList = new ArrayList<>();
|
||||
Map<Integer, SEquipConfig> equipConfigMap = STableManager.getConfig(SEquipConfig.class);
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<Integer, Integer> next = iterator.next();
|
||||
SEquipConfig sEquipConfig = equipConfigMap.get(next.getValue());
|
||||
int[][] property = sEquipConfig.getProperty();
|
||||
Map<Integer, Long> propertyValueByIdMap = new HashMap<>();
|
||||
for (int[] prop : property) {
|
||||
long value = prop[1];
|
||||
SPropertyConfig config = SPropertyConfig.getsPropertyConfigByPID(prop[0]);
|
||||
// 家园装备强化属性,只增加基础属性
|
||||
if (config != null && config.getStyle() == 1){
|
||||
double buff = 0;
|
||||
int strongLv = strongMap.getOrDefault(sEquipConfig.getPosition(),new HeroEquipStrong(sEquipConfig.getPosition())).getStrongLv();
|
||||
buff += Optional.ofNullable(strengthenMap.get(strongLv)).map(SEquipStrengthen::getRate).orElse(0);
|
||||
// 突破
|
||||
buff += Optional.ofNullable(rankUpMap.get(advanceLv)).map(v -> v.getRate()[sEquipConfig.getPosition() - 1]).orElse(0);
|
||||
value = value + (long) Math.ceil(buff/10000*value);
|
||||
}
|
||||
propertyValueByIdMap.put(prop[0], value);
|
||||
}
|
||||
combinedAttribute(propertyValueByIdMap, heroAllAttribute);
|
||||
equipForce += sEquipConfig.getScore();
|
||||
// 添加到套装list
|
||||
suiteNumList.add(sEquipConfig);
|
||||
}
|
||||
|
||||
/*========== 开始处理套装 ============*/
|
||||
// 根据升序顺序排列list
|
||||
Collections.sort(suiteNumList);
|
||||
// 记录当前长度(位置)
|
||||
int num = suiteNumList.size();
|
||||
if (!suiteNumList.isEmpty()) {
|
||||
// 遍历套装list
|
||||
for (SEquipConfig item : suiteNumList) {
|
||||
//根据星级读取配置表,为空表示不是套装
|
||||
SEquipSuiteConfig sEquipSuiteConfig = SEquipSuiteConfig.config.get(item.getStar());
|
||||
if (null != sEquipSuiteConfig) {
|
||||
// 根据套装数量读表,为空标是套装数量不足
|
||||
Map<Integer, Long> suitePropertyMap = sEquipSuiteConfig.getSuiteMap().get(num);
|
||||
if (suitePropertyMap != null) {
|
||||
// 计算战力
|
||||
combinedAttribute(suitePropertyMap, heroAllAttribute);
|
||||
}
|
||||
}
|
||||
// 不管是否是套装,都要-1
|
||||
num -= 1;
|
||||
}
|
||||
}
|
||||
//魂印战力保存
|
||||
heroAllAttribute.put(HeroAttributeEnum.EquipForce.getPropertyId(), equipForce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算机器人英雄熟悉
|
||||
*
|
||||
* @param scHero
|
||||
* @param heroLevel
|
||||
* @param heroBrekId 调用方法calRobotHeroAllAttribute未使用该参数,所以可以传0
|
||||
* @param pokemonIds
|
||||
* @param pokemonLevel
|
||||
* @param isForce
|
||||
* @return
|
||||
*/
|
||||
public Map<Integer, Long> calRobotHeroAttribute(SCHero scHero, int heroLevel, int heroBrekId, int[] pokemonIds, int pokemonLevel, boolean isForce) {
|
||||
Map<Integer, Long> heroAllAttribute = calRobotHeroAllAttribute(scHero.getId(), heroLevel, heroBrekId, isForce);
|
||||
|
|
|
@ -76,7 +76,7 @@ public class ArchitectureUnLockHandler implements IEventHandler {
|
|||
}
|
||||
Integer level = Optional.ofNullable(levelMap.get(beforeInfo.getId())).map(SHomeLandLevel::getlevel).orElse(0);
|
||||
if (level < land.getUnlockLevel()[1]){
|
||||
LOGGER.info("建筑解锁,前置条件浮生殿等级不足,poolId:{}",land.getId());
|
||||
// LOGGER.info("建筑解锁,前置条件浮生殿等级不足,poolId:{}",land.getId());
|
||||
continue;
|
||||
}
|
||||
ArchitectureInfo architectureInfo = new ArchitectureInfo(id, nowInt, 0);
|
||||
|
|
|
@ -668,7 +668,7 @@ public class ItemUtil {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return itemType;
|
||||
return itemType;
|
||||
}
|
||||
|
||||
private static void putCountMap(int itemId,int itemNum, Map<Integer, Integer> map) {
|
||||
|
|
|
@ -57,6 +57,8 @@ public class SEquipConfig implements BaseConfig,Comparable<SEquipConfig> {
|
|||
|
||||
private int[] passiveSkill;
|
||||
|
||||
private int shenYinType;
|
||||
|
||||
/**
|
||||
* 位置,星级,装备信息
|
||||
*/
|
||||
|
@ -65,16 +67,18 @@ public class SEquipConfig implements BaseConfig,Comparable<SEquipConfig> {
|
|||
* 星级,位置,装备id
|
||||
*/
|
||||
public static Map<Integer,Map<Integer,Integer>> starByPositionMap;
|
||||
|
||||
public static Map<Integer, SEquipConfig> equipConfigMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer,Map<Integer,SEquipConfig>> tempMap = new HashMap<>();
|
||||
Map<Integer,Map<Integer,Integer>> startMap = new HashMap<>();
|
||||
Map<Integer, SEquipConfig> config = STableManager.getConfig(SEquipConfig.class);
|
||||
config.forEach((k,v)->{
|
||||
equipConfigMap = STableManager.getConfig(SEquipConfig.class);
|
||||
equipConfigMap.forEach((k,v)->{
|
||||
if(v.getRange()!=null && v.getRange().length>0 && v.getRange()[0]!=0){
|
||||
Set<Integer> rangeTemp = new HashSet<>();
|
||||
Arrays.stream(v.getRange()).forEach(e->rangeTemp.add(e));
|
||||
Arrays.stream(v.getRange()).forEach(rangeTemp::add);
|
||||
v.setRangeHeroTids(rangeTemp);
|
||||
}
|
||||
if(v.getPosition()!=5){
|
||||
|
@ -193,6 +197,10 @@ public class SEquipConfig implements BaseConfig,Comparable<SEquipConfig> {
|
|||
return suiteID1;
|
||||
}
|
||||
|
||||
public int getShenYinType() {
|
||||
return shenYinType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(SEquipConfig o) {
|
||||
return this.getStar() - o.getStar();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class SEquipSuiteConfig implements BaseConfig {
|
|||
suiteMapTmp.put(suiteItem[0],map);
|
||||
}
|
||||
int[][] suiteSkill = value.getSuiteSkill();
|
||||
if (suiteSkill != null && suiteSkill.length > 0) {
|
||||
if (suiteSkill != null) {
|
||||
for (int[] ints : suiteSkill) {
|
||||
suiteSkills.put(ints[0], ints[1]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue