阵营光环修改
parent
12d354559e
commit
7ab0a3642a
|
|
@ -16,7 +16,7 @@ public class TeamPosManager extends MongoBase {
|
||||||
@Transient
|
@Transient
|
||||||
private int curTeamPosId;
|
private int curTeamPosId;
|
||||||
@Transient
|
@Transient
|
||||||
private Map<Integer,List<int[][]>> cacheTeamPro = new HashMap<>(5);
|
private Map<Integer,int[][]> cacheTeamPro = new HashMap<>(5);
|
||||||
@Transient
|
@Transient
|
||||||
private Map<Integer,List<Integer>> cachePassskill = new HashMap<>(5);
|
private Map<Integer,List<Integer>> cachePassskill = new HashMap<>(5);
|
||||||
|
|
||||||
|
|
@ -92,11 +92,11 @@ public class TeamPosManager extends MongoBase {
|
||||||
cachePassskill.remove(curTeamPosId);
|
cachePassskill.remove(curTeamPosId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Integer, List<int[][]>> getCacheTeamPro() {
|
public Map<Integer, int[][]> getCacheTeamPro() {
|
||||||
return cacheTeamPro;
|
return cacheTeamPro;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateTeamPos(int teamId,List<int[][]> result){
|
public void updateTeamPos(int teamId,int[][] result){
|
||||||
cacheTeamPro.put(teamId,result);
|
cacheTeamPro.put(teamId,result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -779,8 +779,8 @@ public class CombatLogic {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static List<int[][]> elementEffect(User user,int teamId){
|
public int[][] elementEffect(User user,int teamId){
|
||||||
List<int[][]> teamParm = user.getTeamPosManager().getCacheTeamPro().get(teamId);
|
int[][] teamParm = user.getTeamPosManager().getCacheTeamPro().get(teamId);
|
||||||
if(teamParm!=null){
|
if(teamParm!=null){
|
||||||
return teamParm;
|
return teamParm;
|
||||||
}
|
}
|
||||||
|
|
@ -814,67 +814,32 @@ public class CombatLogic {
|
||||||
for(Map.Entry<Integer,Integer> entry :propertiesMap.entrySet()){
|
for(Map.Entry<Integer,Integer> entry :propertiesMap.entrySet()){
|
||||||
LOGGER.info("{}系类型数量为{}",entry.getKey(),entry.getValue());
|
LOGGER.info("{}系类型数量为{}",entry.getKey(),entry.getValue());
|
||||||
}
|
}
|
||||||
int[][] effect = new int[2][];
|
int[] normalProperties = new int[6];
|
||||||
int[] normalProperties = new int[3];
|
|
||||||
int[] special = new int[2];
|
|
||||||
|
|
||||||
|
|
||||||
//暗属性判断
|
|
||||||
if(propertiesMap.containsKey(6)){
|
|
||||||
special[0] = 2;
|
|
||||||
special[1] = propertiesMap.get(6);
|
|
||||||
}
|
|
||||||
propertiesMap.remove(6);
|
|
||||||
//光属性判断
|
|
||||||
if(propertiesMap.size()>1){
|
|
||||||
if(propertiesMap.containsKey(5)) {
|
|
||||||
int allRoundProperCount = propertiesMap.get(5);
|
|
||||||
propertiesMap.remove(5);
|
|
||||||
if(allRoundProperCount<5){ //光属性小于5
|
|
||||||
for (Map.Entry<Integer,Integer> entry:propertiesMap.entrySet()){
|
|
||||||
if(entry.getKey()!=6&&entry.getKey()!=5){
|
|
||||||
propertiesMap.put(entry.getKey(), entry.getValue()+allRoundProperCount);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//普通属性判断
|
//普通属性判断
|
||||||
normalProperties[0] = 1;
|
int nomalIndex = 0;
|
||||||
int nomalIndex = 1;
|
|
||||||
for(Map.Entry<Integer,Integer> entry:propertiesMap.entrySet()){
|
for(Map.Entry<Integer,Integer> entry:propertiesMap.entrySet()){
|
||||||
if(entry.getKey()!=6){
|
normalProperties[nomalIndex] = entry.getValue();
|
||||||
if(entry.getValue()!=1){
|
nomalIndex++;
|
||||||
normalProperties[nomalIndex] = entry.getValue();
|
}
|
||||||
nomalIndex++;
|
int elementId = 0;
|
||||||
|
outer:for(Map.Entry<Integer,SElementalResonanceConfig> entry:configMap.entrySet()){
|
||||||
|
if(entry.getValue().getType().length!=normalProperties.length){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for(int i = 0 ; i<normalProperties.length;){
|
||||||
|
if(normalProperties[i]<entry.getValue().getType()[i]){
|
||||||
|
continue outer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elementId = elementId>entry.getKey()?elementId:entry.getKey();
|
||||||
}
|
}
|
||||||
effect[0] = normalProperties;
|
if(elementId==0){
|
||||||
effect[1] = special;
|
return null;
|
||||||
/* for(int i = 0 ; i<effect.length;i++){
|
|
||||||
if(effect[i].length>2){
|
|
||||||
// LOGGER.info("生效的光环为{},{},{}",effect[i][0],effect[i][1],effect[i][2]);
|
|
||||||
}else{
|
|
||||||
// LOGGER.info("生效的光环为{},{}",effect[i][0],effect[i][1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
}*/
|
|
||||||
List<int[][]> resultEffect = new ArrayList<>();
|
|
||||||
for(int i = 0; i <effect.length;i++){
|
|
||||||
for(Map.Entry<Integer,SElementalResonanceConfig> entry:configMap.entrySet()){
|
|
||||||
if(Arrays.equals(effect[i],entry.getValue().getType())){
|
|
||||||
resultEffect.add(entry.getValue().getContent());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* Iterator<int[][]> it = resultEffect.iterator();
|
LOGGER.info("触发光环的ID为{}",elementId);
|
||||||
while (it.hasNext()){
|
int[][] resultElement = configMap.get(elementId).getContent();
|
||||||
int[][] next = it.next();
|
user.getTeamPosManager().updateTeamPos(teamId, resultElement);
|
||||||
}*/
|
return resultElement;
|
||||||
user.getTeamPosManager().updateTeamPos(teamId,resultEffect);
|
|
||||||
return resultEffect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <K, V extends Comparable<? super V>> Map<K, V> sortByValueDescending(Map<K, V> map)
|
public static <K, V extends Comparable<? super V>> Map<K, V> sortByValueDescending(Map<K, V> map)
|
||||||
|
|
|
||||||
|
|
@ -1348,11 +1348,10 @@ public class HeroLogic{
|
||||||
//阵营光环加成
|
//阵营光环加成
|
||||||
if(!isForce){
|
if(!isForce){
|
||||||
if(teamId!=0){
|
if(teamId!=0){
|
||||||
List<int[][]> elementEffect = CombatLogic.getInstance().elementEffect(user,teamId);
|
int[][] elementEffect = CombatLogic.getInstance().elementEffect(user,teamId);
|
||||||
Iterator it = elementEffect.iterator();
|
|
||||||
while (it.hasNext()){
|
if (elementEffect!=null&&elementEffect.length>0){
|
||||||
int[][] effect = (int[][])it.next();
|
combinedAttribute(elementEffect,heroAllAttribute);
|
||||||
combinedAttribute(effect,heroAllAttribute);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue