英雄属性同步修改

back_recharge
duhui 2021-09-02 18:10:50 +08:00
parent 6890e0b2dc
commit c7a9262a34
4 changed files with 152 additions and 23 deletions

View File

@ -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;
/**
* 01
*/
private int isCross;
/**
*
*/
private String remarks;
/**
* pvp01
*/
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;
}
}

View File

@ -162,7 +162,7 @@ public class CombatLogic {
}
}
HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
HeroLogic.getInstance().calInteractAdd(heroAllAttribute);
HeroLogic.getInstance().calInteractAdd(heroAllAttribute,false);
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
}
user.getMapManager().setHeroAllAttributeMap(heroAllAttributeMap);

View File

@ -2523,14 +2523,13 @@ public class HeroLogic{
}
}
//移除非pvp队伍加成
if(teamId!=GlobalsDef.TEAM_ARENA_ATTACH&&teamId!=GlobalsDef.TEAM_ARENA_DEFENSE){
//pvp队伍加成
if(!isForce && !TeamEnum.isPvpTeam(teamId)){
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageBocusFactor.getPropertyId());
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageReduceFactor.getPropertyId());
}
calInteractAdd(heroAllAttribute);
calInteractAdd(heroAllAttribute,isForce);
heroSkillList.forEach(skill->{
SPassiveSkillLogicConfig configTmp = SPassiveSkillLogicConfig.getConfig(skill);
@ -2541,15 +2540,14 @@ public class HeroLogic{
}
}
});
if(!heroSkillAdMap.isEmpty()){
combinedAttribute(heroSkillAdMap,heroAllAttribute);
calInteractAdd(heroAllAttribute);
calInteractAdd(heroAllAttribute,isForce);
heroSkillAdMap.clear();
}
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE));
//装备战力保存
heroAllAttribute.put(HeroAttributeEnum.EquipForce.getPropertyId(), (long) equipForce);
return heroAllAttribute;
}
@ -2585,7 +2583,7 @@ public class HeroLogic{
}
}
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE));
calInteractAdd(heroAllAttribute);
calInteractAdd(heroAllAttribute,isForce);
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<>();
Iterator<Map.Entry<Integer, Long>> iterator = heroAllAttribute.entrySet().iterator();
Map<Integer, Long> newAddAttribute = new HashMap<>();
@ -2641,7 +2639,9 @@ public class HeroLogic{
}else{
propertyPercentMap.put(targetPropertyId,effectValue);
}
iterator.remove();
if (!judge){
iterator.remove();
}
}
heroAllAttribute.putAll(newAddAttribute);
@ -2676,7 +2676,7 @@ public class HeroLogic{
}
Map<Integer, Long> heroAllAttributeCopy = new HashMap<>(heroAllAttribute);
combinedAttribute(foodAddMap,heroAllAttributeCopy);
calInteractAdd(heroAllAttributeCopy);
calInteractAdd(heroAllAttributeCopy,false);
return heroAllAttributeCopy;
}
@ -2685,16 +2685,16 @@ public class HeroLogic{
Map<Integer, Long> heroAllAttribute;
heroAllAttribute = calHeroNotBufferAttribute(user, hero,true,teamId);
//战力保存
int force = calForce(heroAllAttribute);
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
for (int sign:soulEquipByPositionMap.values()){
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(sign);
if(sEquipConfig==null) {
continue;
}
force+=sEquipConfig.getScore();
}
return force + heroAllAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId());
return calForce(heroAllAttribute);
// Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
// for (int sign:soulEquipByPositionMap.values()){
// SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(sign);
// if(sEquipConfig==null) {
// continue;
// }
// force+=sEquipConfig.getScore();
// }
// return force + heroAllAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId());
}

View File

@ -283,7 +283,7 @@ public abstract class AbstractRank implements IRank {
.setForce(query.getPlayerManager().getMaxFore())
.setSex(query.getPlayerManager().getGender())
.setHead(query.getPlayerManager().getHead())
.setGuildName(mapEntry.getName())
.setGuildName(Optional.ofNullable(mapEntry).map(GuildCache::getName).orElse(""))
.setHeadFrame(query.getPlayerManager().getHeadFrame())
.setUserMount(query.getPlayerManager().getUserMount())
.setUserSkin(query.getPlayerManager().getSkin())