装备套装
parent
e66fef396d
commit
12996dc439
|
@ -1252,6 +1252,7 @@ public class HeroLogic{
|
||||||
int equipForce=0;
|
int equipForce=0;
|
||||||
boolean needRemove = false;
|
boolean needRemove = false;
|
||||||
Iterator<Map.Entry<Integer, String>> iterator = hero.getEquipByPositionMap().entrySet().iterator();
|
Iterator<Map.Entry<Integer, String>> iterator = hero.getEquipByPositionMap().entrySet().iterator();
|
||||||
|
Map<Integer,Integer> suiteNumByIdMap = new HashMap<>();
|
||||||
while (iterator.hasNext()){
|
while (iterator.hasNext()){
|
||||||
Map.Entry<Integer, String> next = iterator.next();
|
Map.Entry<Integer, String> next = iterator.next();
|
||||||
String equipId = next.getValue();
|
String equipId = next.getValue();
|
||||||
|
@ -1267,6 +1268,18 @@ public class HeroLogic{
|
||||||
combinedAttribute(secondValueByIdMap,heroAllAttribute);
|
combinedAttribute(secondValueByIdMap,heroAllAttribute);
|
||||||
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(equip.getEquipId());
|
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(equip.getEquipId());
|
||||||
equipForce+=sEquipConfig.getScore();
|
equipForce+=sEquipConfig.getScore();
|
||||||
|
suiteNumByIdMap.put(sEquipConfig.getSuiteID(),suiteNumByIdMap.getOrDefault(sEquipConfig.getSuiteID(),0)+1);
|
||||||
|
}
|
||||||
|
if(!suiteNumByIdMap.isEmpty()){
|
||||||
|
suiteNumByIdMap.forEach((suiteId,suiteNums)->{
|
||||||
|
SEquipSuiteConfig sEquipSuiteConfig =SEquipSuiteConfig.config.get(suiteId);
|
||||||
|
if( null!=sEquipSuiteConfig){
|
||||||
|
Map<Integer, Integer> suitePropertyMap = sEquipSuiteConfig.getSuiteMap().get(suiteNums);
|
||||||
|
if(suitePropertyMap!=null){
|
||||||
|
combinedAttribute(suitePropertyMap,heroAllAttribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if(needRemove){
|
if(needRemove){
|
||||||
AyyncWorker ayyncWorker = new AyyncWorker(user,true,user1 -> {
|
AyyncWorker ayyncWorker = new AyyncWorker(user,true,user1 -> {
|
||||||
|
@ -2066,6 +2079,7 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
hero.setIsLock(lockState);
|
hero.setIsLock(lockState);
|
||||||
MessageUtil.sendMessage(session,1,responseMsgId,null,true);
|
MessageUtil.sendMessage(session,1,responseMsgId,null,true);
|
||||||
|
LOGGER.info("the force={}",calHeoForce(user,hero,0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,6 +13,8 @@ public class SEquipConfig implements BaseConfig {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
|
private int suiteID;
|
||||||
|
|
||||||
private int professionLimit;
|
private int professionLimit;
|
||||||
|
|
||||||
private int position;
|
private int position;
|
||||||
|
@ -166,4 +168,8 @@ public class SEquipConfig implements BaseConfig {
|
||||||
public int[][] getProperty() {
|
public int[][] getProperty() {
|
||||||
return property;
|
return property;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getSuiteID() {
|
||||||
|
return suiteID;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package config;
|
||||||
|
|
||||||
|
import manager.STableManager;
|
||||||
|
import manager.Table;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Table(name ="EquipSuiteConfig")
|
||||||
|
public class SEquipSuiteConfig implements BaseConfig {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private int[][] suiteValue;
|
||||||
|
|
||||||
|
private Map<Integer,Map<Integer,Integer>> suiteMap;
|
||||||
|
public static Map<Integer, SEquipSuiteConfig> config;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws Exception {
|
||||||
|
Map<Integer, SEquipSuiteConfig> configTmp = STableManager.getConfig(SEquipSuiteConfig.class);
|
||||||
|
configTmp.values().forEach(item->{
|
||||||
|
Map<Integer,Map<Integer,Integer>> suiteMapTmp = new HashMap<>();
|
||||||
|
int[][] suiteValue = item.getSuiteValue();
|
||||||
|
for(int[] suiteItem :suiteValue){
|
||||||
|
suiteMapTmp.putIfAbsent(suiteItem[0],suiteMapTmp.getOrDefault(suiteItem[0],new HashMap<>(suiteMapTmp.getOrDefault(suiteItem[0]-1,new HashMap<>()))));
|
||||||
|
suiteMapTmp.get(suiteItem[0]).put(suiteItem[1], suiteMapTmp.get(suiteItem[0]).getOrDefault(suiteItem[1],0) + suiteItem[2]);
|
||||||
|
}
|
||||||
|
item.setSuiteMap(suiteMapTmp);
|
||||||
|
});
|
||||||
|
config=configTmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Map<Integer, Map<Integer, Integer>> getSuiteMap() {
|
||||||
|
return suiteMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuiteMap(Map<Integer, Map<Integer, Integer>> suiteMap) {
|
||||||
|
this.suiteMap = suiteMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getSuiteValue() {
|
||||||
|
return suiteValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue