英雄属性同步修改
parent
6890e0b2dc
commit
c7a9262a34
|
@ -0,0 +1,129 @@
|
||||||
|
package com.ljsd.jieling.logic.dao;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author hj
|
||||||
|
* @Date 2021/9/2 11:21:54
|
||||||
|
* @Description:
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public enum TeamEnum {
|
||||||
|
FORMATION_NORMAL(1,"主线编队",1,1),
|
||||||
|
TEAM_ARENA_DEFENSE(101,"竞技场防御编队",0,1),
|
||||||
|
TEAM_ARENA_ATTACH(201,"竞技场进攻编队(暂时不用)"),
|
||||||
|
TRIAL_TEAM(301,"森罗环境编队"),
|
||||||
|
ENDLESS_TEAM(401,"无尽编队"),
|
||||||
|
BLOODY_TEAM(701,"血战队伍"),
|
||||||
|
CHAMPION_ATTACK_TEAM(801,"巅峰赛进攻队伍(暂时不用)"),
|
||||||
|
EXPEDITION_TEAM(1001,"大闹天宫"),
|
||||||
|
CAR_DELAY_TEAM(1101,"车迟斗法",0,1),
|
||||||
|
DEATH_PATH_TEAM(1201,"十绝阵"),
|
||||||
|
CHAMPION_TEAM(1301,"巅峰赛",0,1),
|
||||||
|
WORLD_TEAM_ARENA_DEFENSE(1601,"跨服竞技场防御编队",1,1),
|
||||||
|
HARD_STAGE_TEAM(1701,"山河社稷图队伍"),
|
||||||
|
VICE_HARD_STAGE_TEAM(1801,"山河社稷图副关卡队伍"),
|
||||||
|
TASUILINGXIAO_CHALLENGE(1901,"踏碎凌霄挑战队伍"),
|
||||||
|
CROSS_YU_XU_LUN_DAO_ONE(2001,"玉虚论道第一编队",1,1),
|
||||||
|
CROSS_YU_XU_LUN_DAO_TWO(2002,"玉虚论道第二编队",1,1),
|
||||||
|
CROSS_YU_XU_LUN_DAO_THREE(2003,"玉虚论道第三编队",1,1),
|
||||||
|
FOURCHALLENGE_PEOPLE_TEAM(3001,"四灵试炼-人"),
|
||||||
|
FOURCHALLENGE_BUDDHA_TEAM(3002,"四灵试炼-佛"),
|
||||||
|
FOURCHALLENGE_MONSTER_TEAM(3003,"四灵试炼-妖"),
|
||||||
|
FOURCHALLENGE_MORALITY_TEAM(3004,"四灵试炼-道"),
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 队伍id
|
||||||
|
*/
|
||||||
|
private int teamId;
|
||||||
|
/**
|
||||||
|
* 是否跨服,0:否,1:是
|
||||||
|
*/
|
||||||
|
private int isCross;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remarks;
|
||||||
|
/**
|
||||||
|
* 是否是pvp,0:否,1:是
|
||||||
|
*/
|
||||||
|
private int isPvp;
|
||||||
|
|
||||||
|
private static Map<Integer,TeamEnum> enumMap = new TreeMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
Arrays.stream(TeamEnum.values()).forEach(v->enumMap.putIfAbsent(v.getTeamId(),v));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是跨服队伍
|
||||||
|
* @param teamId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isCrossTeam(int teamId){
|
||||||
|
TeamEnum anEnum = enumMap.get(teamId);
|
||||||
|
if (anEnum == null){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return anEnum.getIsCross() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是pvp队伍
|
||||||
|
* @param teamId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isPvpTeam(int teamId){
|
||||||
|
TeamEnum anEnum = enumMap.get(teamId);
|
||||||
|
if (anEnum == null){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return anEnum.getIsPvp() == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TeamEnum(int teamId, String remarks) {
|
||||||
|
this.teamId = teamId;
|
||||||
|
this.remarks = remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
TeamEnum(int teamId, String remarks, int isCross, int isPvp) {
|
||||||
|
this.teamId = teamId;
|
||||||
|
this.isCross = isCross;
|
||||||
|
this.remarks = remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTeamId() {
|
||||||
|
return teamId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTeamId(int teamId) {
|
||||||
|
this.teamId = teamId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIsCross() {
|
||||||
|
return isCross;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsCross(int isCross) {
|
||||||
|
this.isCross = isCross;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemarks() {
|
||||||
|
return remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemarks(String remarks) {
|
||||||
|
this.remarks = remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIsPvp() {
|
||||||
|
return isPvp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsPvp(int isPvp) {
|
||||||
|
this.isPvp = isPvp;
|
||||||
|
}
|
||||||
|
}
|
|
@ -162,7 +162,7 @@ public class CombatLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
|
HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
|
||||||
HeroLogic.getInstance().calInteractAdd(heroAllAttribute);
|
HeroLogic.getInstance().calInteractAdd(heroAllAttribute,false);
|
||||||
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
|
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
|
||||||
}
|
}
|
||||||
user.getMapManager().setHeroAllAttributeMap(heroAllAttributeMap);
|
user.getMapManager().setHeroAllAttributeMap(heroAllAttributeMap);
|
||||||
|
|
|
@ -2523,14 +2523,13 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//移除非pvp队伍加成
|
//pvp队伍加成
|
||||||
|
if(!isForce && !TeamEnum.isPvpTeam(teamId)){
|
||||||
if(teamId!=GlobalsDef.TEAM_ARENA_ATTACH&&teamId!=GlobalsDef.TEAM_ARENA_DEFENSE){
|
|
||||||
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageBocusFactor.getPropertyId());
|
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageBocusFactor.getPropertyId());
|
||||||
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageReduceFactor.getPropertyId());
|
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageReduceFactor.getPropertyId());
|
||||||
}
|
}
|
||||||
|
|
||||||
calInteractAdd(heroAllAttribute);
|
calInteractAdd(heroAllAttribute,isForce);
|
||||||
|
|
||||||
heroSkillList.forEach(skill->{
|
heroSkillList.forEach(skill->{
|
||||||
SPassiveSkillLogicConfig configTmp = SPassiveSkillLogicConfig.getConfig(skill);
|
SPassiveSkillLogicConfig configTmp = SPassiveSkillLogicConfig.getConfig(skill);
|
||||||
|
@ -2541,15 +2540,14 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!heroSkillAdMap.isEmpty()){
|
if(!heroSkillAdMap.isEmpty()){
|
||||||
combinedAttribute(heroSkillAdMap,heroAllAttribute);
|
combinedAttribute(heroSkillAdMap,heroAllAttribute);
|
||||||
calInteractAdd(heroAllAttribute);
|
calInteractAdd(heroAllAttribute,isForce);
|
||||||
heroSkillAdMap.clear();
|
heroSkillAdMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
||||||
//装备战力保存
|
|
||||||
heroAllAttribute.put(HeroAttributeEnum.EquipForce.getPropertyId(), (long) equipForce);
|
|
||||||
|
|
||||||
return heroAllAttribute;
|
return heroAllAttribute;
|
||||||
}
|
}
|
||||||
|
@ -2585,7 +2583,7 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
||||||
calInteractAdd(heroAllAttribute);
|
calInteractAdd(heroAllAttribute,isForce);
|
||||||
return heroAllAttribute;
|
return heroAllAttribute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2607,7 +2605,7 @@ public class HeroLogic{
|
||||||
* 先计算一级属性
|
* 先计算一级属性
|
||||||
*绝对值直接加 百分比统一之后加
|
*绝对值直接加 百分比统一之后加
|
||||||
*/
|
*/
|
||||||
public void calInteractAdd(Map<Integer, Long> heroAllAttribute){
|
public void calInteractAdd(Map<Integer, Long> heroAllAttribute,boolean judge){
|
||||||
Map<Integer,Integer> propertyPercentMap = new HashMap<>();
|
Map<Integer,Integer> propertyPercentMap = new HashMap<>();
|
||||||
Iterator<Map.Entry<Integer, Long>> iterator = heroAllAttribute.entrySet().iterator();
|
Iterator<Map.Entry<Integer, Long>> iterator = heroAllAttribute.entrySet().iterator();
|
||||||
Map<Integer, Long> newAddAttribute = new HashMap<>();
|
Map<Integer, Long> newAddAttribute = new HashMap<>();
|
||||||
|
@ -2641,7 +2639,9 @@ public class HeroLogic{
|
||||||
}else{
|
}else{
|
||||||
propertyPercentMap.put(targetPropertyId,effectValue);
|
propertyPercentMap.put(targetPropertyId,effectValue);
|
||||||
}
|
}
|
||||||
iterator.remove();
|
if (!judge){
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
heroAllAttribute.putAll(newAddAttribute);
|
heroAllAttribute.putAll(newAddAttribute);
|
||||||
|
@ -2676,7 +2676,7 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
Map<Integer, Long> heroAllAttributeCopy = new HashMap<>(heroAllAttribute);
|
Map<Integer, Long> heroAllAttributeCopy = new HashMap<>(heroAllAttribute);
|
||||||
combinedAttribute(foodAddMap,heroAllAttributeCopy);
|
combinedAttribute(foodAddMap,heroAllAttributeCopy);
|
||||||
calInteractAdd(heroAllAttributeCopy);
|
calInteractAdd(heroAllAttributeCopy,false);
|
||||||
return heroAllAttributeCopy;
|
return heroAllAttributeCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2685,16 +2685,16 @@ public class HeroLogic{
|
||||||
Map<Integer, Long> heroAllAttribute;
|
Map<Integer, Long> heroAllAttribute;
|
||||||
heroAllAttribute = calHeroNotBufferAttribute(user, hero,true,teamId);
|
heroAllAttribute = calHeroNotBufferAttribute(user, hero,true,teamId);
|
||||||
//战力保存
|
//战力保存
|
||||||
int force = calForce(heroAllAttribute);
|
return calForce(heroAllAttribute);
|
||||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
// Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||||
for (int sign:soulEquipByPositionMap.values()){
|
// for (int sign:soulEquipByPositionMap.values()){
|
||||||
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(sign);
|
// SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(sign);
|
||||||
if(sEquipConfig==null) {
|
// if(sEquipConfig==null) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
force+=sEquipConfig.getScore();
|
// force+=sEquipConfig.getScore();
|
||||||
}
|
// }
|
||||||
return force + heroAllAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId());
|
// return force + heroAllAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,7 @@ public abstract class AbstractRank implements IRank {
|
||||||
.setForce(query.getPlayerManager().getMaxFore())
|
.setForce(query.getPlayerManager().getMaxFore())
|
||||||
.setSex(query.getPlayerManager().getGender())
|
.setSex(query.getPlayerManager().getGender())
|
||||||
.setHead(query.getPlayerManager().getHead())
|
.setHead(query.getPlayerManager().getHead())
|
||||||
.setGuildName(mapEntry.getName())
|
.setGuildName(Optional.ofNullable(mapEntry).map(GuildCache::getName).orElse(""))
|
||||||
.setHeadFrame(query.getPlayerManager().getHeadFrame())
|
.setHeadFrame(query.getPlayerManager().getHeadFrame())
|
||||||
.setUserMount(query.getPlayerManager().getUserMount())
|
.setUserMount(query.getPlayerManager().getUserMount())
|
||||||
.setUserSkin(query.getPlayerManager().getSkin())
|
.setUserSkin(query.getPlayerManager().getSkin())
|
||||||
|
|
Loading…
Reference in New Issue