fix force
parent
606a9c10d6
commit
734b7cb055
|
@ -115,11 +115,14 @@ public interface BIReason {
|
||||||
int EXPEDITION_DROP_REWARD = 66;//猎妖之路奖励
|
int EXPEDITION_DROP_REWARD = 66;//猎妖之路奖励
|
||||||
|
|
||||||
|
|
||||||
int UNLOAD_SOUL_REWARD = 67;//猎妖之路奖励
|
int UNLOAD_SOUL_REWARD = 67;//脱下魂印
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int COMPLEX_EQUIP = 68;//合成装备
|
int COMPLEX_EQUIP = 68;//合成装备
|
||||||
|
|
||||||
|
int REPLACE_SOUL_REWARD = 69;//替换魂印
|
||||||
|
|
||||||
|
|
||||||
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级
|
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级
|
||||||
int SECRETBOX_CONSUME = 1001;//秘盒抽卡
|
int SECRETBOX_CONSUME = 1001;//秘盒抽卡
|
||||||
|
|
|
@ -17,6 +17,8 @@ public class TeamPosManager extends MongoBase {
|
||||||
private int curTeamPosId;
|
private int curTeamPosId;
|
||||||
@Transient
|
@Transient
|
||||||
private Map<Integer,List<int[][]>> cacheTeamPro = new HashMap<>(5);
|
private Map<Integer,List<int[][]>> cacheTeamPro = new HashMap<>(5);
|
||||||
|
@Transient
|
||||||
|
private Map<Integer,List<Integer>> cachePassskill = new HashMap<>(5);
|
||||||
|
|
||||||
public TeamPosManager(){
|
public TeamPosManager(){
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
|
@ -96,6 +98,14 @@ public class TeamPosManager extends MongoBase {
|
||||||
cacheTeamPro.put(teamId,result);
|
cacheTeamPro.put(teamId,result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<Integer, List<Integer>> getCachePassskill() {
|
||||||
|
return cachePassskill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updatePassSkillTeamPos(int teamId, List<Integer> result){
|
||||||
|
cachePassskill.put(teamId,result);
|
||||||
|
}
|
||||||
|
|
||||||
public void updateTeamPosByTeamId(int teamId,List<TeamPosHeroInfo> infos){
|
public void updateTeamPosByTeamId(int teamId,List<TeamPosHeroInfo> infos){
|
||||||
teamPosForHero.put(teamId,infos);
|
teamPosForHero.put(teamId,infos);
|
||||||
updateString("teamPosForHero."+teamId,infos);
|
updateString("teamPosForHero."+teamId,infos);
|
||||||
|
|
|
@ -22,6 +22,7 @@ import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.activity.event.SecretEvent;
|
import com.ljsd.jieling.logic.activity.event.SecretEvent;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum;
|
||||||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||||
|
@ -735,6 +736,41 @@ public class CombatLogic {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> passiveskillEffect(User user,Hero targetHero,int teamId){
|
||||||
|
List<Integer> passiveskillEffect = new ArrayList<>();
|
||||||
|
if(teamId == 0){
|
||||||
|
List<Integer> heroSkillList = HeroLogic.getInstance().getHeroSkillList(user, targetHero);
|
||||||
|
heroSkillList.forEach(skill->{
|
||||||
|
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
||||||
|
if(config!=null &&config.getEffectiveRange()!=1 && PassiveskillCalEnum.contains(config.getType())){
|
||||||
|
passiveskillEffect.add(config.getId());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return passiveskillEffect;
|
||||||
|
}
|
||||||
|
List<Integer> result = user.getTeamPosManager().getCachePassskill().get(teamId);
|
||||||
|
if(result!=null){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||||
|
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||||
|
|
||||||
|
for(TeamPosHeroInfo teamPosHeroInfo :teamPosHeroInfos){
|
||||||
|
Hero hero = heroMap.get(teamPosHeroInfo.getHeroId());
|
||||||
|
List<Integer> heroSkillList = HeroLogic.getInstance().getHeroSkillList(user, hero);
|
||||||
|
heroSkillList.forEach(skill->{
|
||||||
|
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
||||||
|
if(config!=null &&config.getEffectiveRange()!=1 && PassiveskillCalEnum.contains(config.getType())){
|
||||||
|
passiveskillEffect.add(config.getId());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
user.getTeamPosManager().updatePassSkillTeamPos(teamId,passiveskillEffect);
|
||||||
|
return passiveskillEffect;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static List<int[][]> elementEffect(User user,int teamId){
|
public static List<int[][]> elementEffect(User user,int teamId){
|
||||||
List<int[][]> teamParm = user.getTeamPosManager().getCacheTeamPro().get(teamId);
|
List<int[][]> teamParm = user.getTeamPosManager().getCacheTeamPro().get(teamId);
|
||||||
if(teamParm!=null){
|
if(teamParm!=null){
|
||||||
|
@ -809,14 +845,14 @@ public class CombatLogic {
|
||||||
}
|
}
|
||||||
effect[0] = normalProperties;
|
effect[0] = normalProperties;
|
||||||
effect[1] = special;
|
effect[1] = special;
|
||||||
for(int i = 0 ; i<effect.length;i++){
|
/* for(int i = 0 ; i<effect.length;i++){
|
||||||
if(effect[i].length>2){
|
if(effect[i].length>2){
|
||||||
// LOGGER.info("生效的光环为{},{},{}",effect[i][0],effect[i][1],effect[i][2]);
|
// LOGGER.info("生效的光环为{},{},{}",effect[i][0],effect[i][1],effect[i][2]);
|
||||||
}else{
|
}else{
|
||||||
// LOGGER.info("生效的光环为{},{}",effect[i][0],effect[i][1]);
|
// LOGGER.info("生效的光环为{},{}",effect[i][0],effect[i][1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
List<int[][]> resultEffect = new ArrayList<>();
|
List<int[][]> resultEffect = new ArrayList<>();
|
||||||
for(int i = 0; i <effect.length;i++){
|
for(int i = 0; i <effect.length;i++){
|
||||||
for(Map.Entry<Integer,SElementalResonanceConfig> entry:configMap.entrySet()){
|
for(Map.Entry<Integer,SElementalResonanceConfig> entry:configMap.entrySet()){
|
||||||
|
@ -825,10 +861,10 @@ public class CombatLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Iterator<int[][]> it = resultEffect.iterator();
|
/* Iterator<int[][]> it = resultEffect.iterator();
|
||||||
while (it.hasNext()){
|
while (it.hasNext()){
|
||||||
int[][] next = it.next();
|
int[][] next = it.next();
|
||||||
}
|
}*/
|
||||||
user.getTeamPosManager().updateTeamPos(teamId,resultEffect);
|
user.getTeamPosManager().updateTeamPos(teamId,resultEffect);
|
||||||
return resultEffect;
|
return resultEffect;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.ljsd.jieling.logic.fight.passiveSkillCal;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.dao.Hero;
|
||||||
|
import config.SPassiveSkillLogicConfig;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface PassiveSkillProcessor {
|
||||||
|
void process(SPassiveSkillLogicConfig config, Hero hero, Map<Integer, Integer> sourceMap, Map<Integer, Integer> heroSkillAdMap);
|
||||||
|
}
|
|
@ -0,0 +1,116 @@
|
||||||
|
package com.ljsd.jieling.logic.fight.passiveSkillCal;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
|
import config.SPropertyConfig;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
//90 94 171
|
||||||
|
public enum PassiveskillCalEnum {
|
||||||
|
SingleAdd(90,(config,hero,sourceMap,heroSkillAdMap)->{
|
||||||
|
float[] value = config.getValue();
|
||||||
|
int battlePropertyId = (int) value[0];
|
||||||
|
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId);
|
||||||
|
int optCode = (int) value[2];
|
||||||
|
//转换
|
||||||
|
float parm = value[1];
|
||||||
|
if(optCode%2==0){
|
||||||
|
if( sPropertyConfig.getStyle()!= GlobalsDef.PERCENT_TYPE){
|
||||||
|
sPropertyConfig = SPropertyConfig.getsPropertyConfigByTargetPropertyId(sPropertyConfig.getPropertyId());
|
||||||
|
}
|
||||||
|
parm = value[1]*10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
int extreeValue = (int) cal(optCode, sourceMap.getOrDefault(sPropertyConfig.getPropertyId(), 0), parm);
|
||||||
|
heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(),0)+extreeValue);
|
||||||
|
}),
|
||||||
|
AllAdd(94,(config,hero,sourceMap,heroSkillAdMap)->{
|
||||||
|
float[] value = config.getValue();
|
||||||
|
int battlePropertyId = (int) value[1];
|
||||||
|
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId);
|
||||||
|
int optCode = (int) value[2];
|
||||||
|
//转换
|
||||||
|
float parm = value[0];
|
||||||
|
if(optCode%2==0){
|
||||||
|
if( sPropertyConfig.getStyle()!= GlobalsDef.PERCENT_TYPE){
|
||||||
|
sPropertyConfig = SPropertyConfig.getsPropertyConfigByTargetPropertyId(sPropertyConfig.getPropertyId());
|
||||||
|
}
|
||||||
|
parm = value[0]*10000;
|
||||||
|
}
|
||||||
|
int extreeValue = (int) cal(optCode, sourceMap.getOrDefault(sPropertyConfig.getPropertyId(), 0), parm);
|
||||||
|
heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(),0)+extreeValue);
|
||||||
|
}),
|
||||||
|
HEROAFTER100ADD(171,(config,hero,sourceMap,heroSkillAdMap)->{
|
||||||
|
float[] value = config.getValue();
|
||||||
|
int battlePropertyId = (int) value[0];
|
||||||
|
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId);
|
||||||
|
int level = hero.getLevel();
|
||||||
|
int times=level-100;
|
||||||
|
if(times<=0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int parm = (int) value[1]*times;
|
||||||
|
heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(),0)+parm);
|
||||||
|
}),//武将100级后每升一级[c]额外增加[d]
|
||||||
|
;
|
||||||
|
private int type;
|
||||||
|
private PassiveSkillProcessor passiveSkillProcessor;
|
||||||
|
|
||||||
|
|
||||||
|
PassiveskillCalEnum(int type,PassiveSkillProcessor passiveSkillProcessor) {
|
||||||
|
this.type = type;
|
||||||
|
this.passiveSkillProcessor = passiveSkillProcessor;
|
||||||
|
}
|
||||||
|
public static Map<Integer,PassiveskillCalEnum> calEnumMap = new HashMap<>();
|
||||||
|
static {
|
||||||
|
Arrays.stream(PassiveskillCalEnum.values()).forEach(e->{
|
||||||
|
calEnumMap.put(e.type,e);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public PassiveSkillProcessor getPassiveSkillProcessor() {
|
||||||
|
return passiveSkillProcessor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<Integer, PassiveskillCalEnum> getCalEnumMap() {
|
||||||
|
return calEnumMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean contains(int type){
|
||||||
|
return calEnumMap.containsKey(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param optCode
|
||||||
|
* @param source
|
||||||
|
* @param parm
|
||||||
|
* a(当前属性) oa(战斗初始属性)b(增量)
|
||||||
|
* 1 加算 a+b 增益
|
||||||
|
* 2 乘算 a+oa*b 增益 对基础属性其效果,不是当前属性
|
||||||
|
* 3 减算 a-b 减益
|
||||||
|
* 4 乘减算 a*(1-b) 减益 对当前属性其效果,不是基础属性
|
||||||
|
*/
|
||||||
|
public static float cal(int optCode,int source,float parm){
|
||||||
|
switch (optCode){
|
||||||
|
case 1:{
|
||||||
|
return parm;
|
||||||
|
}
|
||||||
|
case 2:{
|
||||||
|
return parm*10000;
|
||||||
|
}
|
||||||
|
case 3:{
|
||||||
|
return -parm;
|
||||||
|
}
|
||||||
|
case 4:{
|
||||||
|
return -parm*10000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -18,6 +18,7 @@ import com.ljsd.jieling.logic.activity.eventhandler.HeroFiveStarGetEventHandler;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||||
|
import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum;
|
||||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.logic.mission.MissionLoigc;
|
import com.ljsd.jieling.logic.mission.MissionLoigc;
|
||||||
|
@ -671,6 +672,7 @@ public class HeroLogic{
|
||||||
HeroInfoProto.UpHeroLevelResponse build = HeroInfoProto.UpHeroLevelResponse.newBuilder().setHeroId(heroId).setTargetLevel(hero.getLevel()).build();
|
HeroInfoProto.UpHeroLevelResponse build = HeroInfoProto.UpHeroLevelResponse.newBuilder().setHeroId(heroId).setTargetLevel(hero.getLevel()).build();
|
||||||
//发送成功消息
|
//发送成功消息
|
||||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_LEVEL_RESPONSE_VALUE,build,true);
|
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_LEVEL_RESPONSE_VALUE,build,true);
|
||||||
|
calHeoForce(user,hero);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -976,19 +978,12 @@ public class HeroLogic{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringBuilder getHeroSkills(User user,Hero hero, StringBuilder sb){
|
public List<Integer> getHeroSkillList(User user,Hero hero){
|
||||||
|
List<Integer> skillList = new ArrayList<>();
|
||||||
SCHero tempHero = SCHero.getsCHero().get(hero.getTemplateId());
|
SCHero tempHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||||
for (Integer skillId : tempHero.getSkillListByStar(hero.getStar())) {
|
skillList.addAll(tempHero.getSkillListByStar(hero.getStar()));
|
||||||
sb.append(skillId).append(DIVISION);
|
skillList.addAll( tempHero.getPassiveSkills(1,hero.getBreakId()));
|
||||||
}
|
skillList.addAll( tempHero.getPassiveSkills(2,hero.getStarBreakId()));
|
||||||
|
|
||||||
tempHero.getPassiveSkills(1,hero.getBreakId()).forEach(skillId->{
|
|
||||||
sb.append(skillId).append(DIVISION);
|
|
||||||
});
|
|
||||||
tempHero.getPassiveSkills(2,hero.getStarBreakId()).forEach(skillId->{
|
|
||||||
sb.append(skillId).append(DIVISION);
|
|
||||||
});
|
|
||||||
|
|
||||||
Map<Integer, String> equipByPositionMap = hero.getEquipByPositionMap();
|
Map<Integer, String> equipByPositionMap = hero.getEquipByPositionMap();
|
||||||
if(!equipByPositionMap.isEmpty()){
|
if(!equipByPositionMap.isEmpty()){
|
||||||
|
@ -1000,23 +995,31 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
int skillId = equipMap.get(equipId).getSkill();
|
int skillId = equipMap.get(equipId).getSkill();
|
||||||
if(skillId!=0){
|
if(skillId!=0){
|
||||||
sb.append(skillId).append(DIVISION);
|
skillList.add(skillId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//法宝技能
|
//法宝技能
|
||||||
int[] equipTalismana = tempHero.getEquipTalismana();
|
int[] equipTalismana = tempHero.getEquipTalismana();
|
||||||
if(hero.getStar()<equipTalismana[0]){
|
if(hero.getStar()<equipTalismana[0]){
|
||||||
return sb;
|
return skillList;
|
||||||
}
|
}
|
||||||
int especialEquipLevel = hero.getEspecialEquipLevel();
|
int especialEquipLevel = hero.getEspecialEquipLevel();
|
||||||
int especialEquipId = equipTalismana[1];
|
int especialEquipId = equipTalismana[1];
|
||||||
Map<Integer,SEquipTalismana> sEquipTalismana = SEquipTalismana.equipTalismanaStarMap.get(especialEquipId);
|
Map<Integer,SEquipTalismana> sEquipTalismana = SEquipTalismana.equipTalismanaStarMap.get(especialEquipId);
|
||||||
sEquipTalismana.forEach((k,v)->{
|
sEquipTalismana.forEach((k,v)->{
|
||||||
if(k<especialEquipLevel&&v.getOpenSkillRules()!=null){
|
if(k<especialEquipLevel&&v.getOpenSkillRules()!=null){
|
||||||
Arrays.stream(v.getOpenSkillRules()).forEach(i->sb.append(i).append(DIVISION));
|
Arrays.stream(v.getOpenSkillRules()).forEach(i->skillList.add(i));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return skillList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringBuilder getHeroSkills(User user,Hero hero, StringBuilder sb){
|
||||||
|
List<Integer> heroSkillList = getHeroSkillList(user, hero);
|
||||||
|
heroSkillList.forEach(skillId->{
|
||||||
|
sb.append(skillId).append(DIVISION);
|
||||||
|
});
|
||||||
return sb;
|
return sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1309,14 +1312,42 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//被动技能加成
|
||||||
|
List<Integer> heroSkillList = CombatLogic.getInstance().passiveskillEffect(user, hero,teamId);
|
||||||
|
Map<Integer, Integer> heroSkillAdMap = new HashMap<>();
|
||||||
|
heroSkillList.forEach(skill->{
|
||||||
|
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
||||||
|
if(config.getValue()[2] !=4){
|
||||||
|
PassiveskillCalEnum.calEnumMap.get(config.getType()).getPassiveSkillProcessor().process(config,hero,heroAllAttribute,heroSkillAdMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
if(!heroSkillAdMap.isEmpty()){
|
||||||
|
combinedAttribute(heroSkillAdMap,heroAllAttribute);
|
||||||
|
heroSkillAdMap.clear();
|
||||||
|
}
|
||||||
calInteractAdd(heroAllAttribute);
|
calInteractAdd(heroAllAttribute);
|
||||||
|
heroSkillList.forEach(skill->{
|
||||||
|
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
||||||
|
if(config.getValue()[2] ==4){
|
||||||
|
PassiveskillCalEnum.calEnumMap.get(config.getType()).getPassiveSkillProcessor().process(config,hero,heroAllAttribute,heroSkillAdMap);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(!heroSkillAdMap.isEmpty()){
|
||||||
|
combinedAttribute(heroSkillAdMap,heroAllAttribute);
|
||||||
|
calInteractAdd(heroAllAttribute);
|
||||||
|
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(),equipForce);
|
heroAllAttribute.put(HeroAttributeEnum.EquipForce.getPropertyId(),equipForce);
|
||||||
|
|
||||||
return heroAllAttribute;
|
return heroAllAttribute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Map<Integer,Integer> calRobotHeroAttribute(SCHero scHero,int heroLevel,int heroBrekId,int[] pokemonIds,int pokemonLevel,boolean isForce){
|
public Map<Integer,Integer> calRobotHeroAttribute(SCHero scHero,int heroLevel,int heroBrekId,int[] pokemonIds,int pokemonLevel,boolean isForce){
|
||||||
Map<Integer, Integer> heroAllAttribute = calRobotHeroAllAttribute(scHero.getId(),heroLevel,heroBrekId,isForce);
|
Map<Integer, Integer> heroAllAttribute = calRobotHeroAllAttribute(scHero.getId(),heroLevel,heroBrekId,isForce);
|
||||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
||||||
|
@ -1405,7 +1436,7 @@ public class HeroLogic{
|
||||||
Map<Integer, Integer> heroAllAttribute;
|
Map<Integer, Integer> heroAllAttribute;
|
||||||
heroAllAttribute = calHeroNotBufferAttribute(user, hero,true,0);
|
heroAllAttribute = calHeroNotBufferAttribute(user, hero,true,0);
|
||||||
//战力保存
|
//战力保存
|
||||||
int force = calForce(heroAllAttribute);
|
int force = calForce(heroAllAttribute);
|
||||||
return force + heroAllAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId());
|
return force + heroAllAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1996,32 +2027,58 @@ public class HeroLogic{
|
||||||
System.out.println(heroId);
|
System.out.println(heroId);
|
||||||
Hero hero = user.getHeroManager().getHero(heroId);
|
Hero hero = user.getHeroManager().getHero(heroId);
|
||||||
checkAllowedOpt(2,user,hero.getStar());
|
checkAllowedOpt(2,user,hero.getStar());
|
||||||
checkAllowedWear(user,hero.getTemplateId(),optHeroSoul.getSoulEquipIdsList(),unload);
|
checkAllowedWear(user,hero,optHeroSoul.getSoulEquipIdsList(),unload);
|
||||||
|
Map<Integer,Integer> returnItems = new HashMap<>();
|
||||||
|
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||||
optHeroSoul.getSoulEquipIdsList().forEach(e->{
|
optHeroSoul.getSoulEquipIdsList().forEach(e->{
|
||||||
|
if(soulEquipByPositionMap.containsKey(e.getPosition())){
|
||||||
|
returnItems.put(soulEquipByPositionMap.get(e.getPosition()),1);
|
||||||
|
}
|
||||||
hero.updateSoulEquipPositionMap(e.getPosition(),e.getEquipId());
|
hero.updateSoulEquipPositionMap(e.getPosition(),e.getEquipId());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
ItemUtil.dropMap(user,returnItems,BIReason.REPLACE_SOUL_REWARD);
|
||||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.SOUL_EQUIP_WEAR_RESPONSE_VALUE,null,true);
|
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.SOUL_EQUIP_WEAR_RESPONSE_VALUE,null,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void checkAllowedWear(User user,int targetHeroTid,List<HeroInfoProto.SoulEquipPos> soulEquipIdsList, HeroInfoProto.OptHeroSoul unload) throws Exception {
|
private void checkAllowedWear(User user,Hero targetHero,List<HeroInfoProto.SoulEquipPos> soulEquipIdsList, HeroInfoProto.OptHeroSoul unload) throws Exception {
|
||||||
|
int targetHeroTid = targetHero.getTemplateId();
|
||||||
List<Integer> equids = new ArrayList<>();
|
List<Integer> equids = new ArrayList<>();
|
||||||
|
Map<Integer, Integer> soulEquipByPositionMap = targetHero.getSoulEquipByPositionMap();
|
||||||
|
Collection<Integer> values = soulEquipByPositionMap.values();
|
||||||
|
for(HeroInfoProto.SoulEquipPos item:soulEquipIdsList){
|
||||||
|
if(values.contains(item.getEquipId()) && soulEquipByPositionMap.get(item.getPosition()) != item.getEquipId()){
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||||
|
}
|
||||||
|
}
|
||||||
soulEquipIdsList.forEach(e->equids.add(e.getEquipId()));
|
soulEquipIdsList.forEach(e->equids.add(e.getEquipId()));
|
||||||
List<Integer> unloadSoulIds = new ArrayList<>();
|
List<Integer> unloadSoulIds = new ArrayList<>();
|
||||||
if(unload!=null){
|
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||||
|
if(unload!=null && !StringUtil.isEmpty(unload.getHeroId())){
|
||||||
|
String heroId = unload.getHeroId();
|
||||||
List<HeroInfoProto.SoulEquipPos> soulEquipIdsListUnload = unload.getSoulEquipIdsList();
|
List<HeroInfoProto.SoulEquipPos> soulEquipIdsListUnload = unload.getSoulEquipIdsList();
|
||||||
soulEquipIdsListUnload.forEach(e->{
|
Map<Integer, Integer> unloadSoulEquipByPositionMap = heroMap.get(heroId).getSoulEquipByPositionMap();
|
||||||
unloadSoulIds.add(e.getEquipId());
|
for(HeroInfoProto.SoulEquipPos soulEquipPos:soulEquipIdsListUnload){
|
||||||
});
|
unloadSoulIds.add(soulEquipPos.getEquipId());
|
||||||
|
if(unloadSoulEquipByPositionMap.get(soulEquipPos.getPosition())!=soulEquipPos.getEquipId()){
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||||
|
}
|
||||||
|
}
|
||||||
equids.removeAll(unloadSoulIds);
|
equids.removeAll(unloadSoulIds);
|
||||||
}
|
}
|
||||||
//是否魂印能被本英雄佩戴
|
//是否魂印能被本英雄佩戴
|
||||||
//是否只能一名武将佩戴
|
//是否只能一名武将佩戴
|
||||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
|
||||||
Set<Integer> cacheIds = new HashSet<>();
|
Set<Integer> cacheIds = new HashSet<>();
|
||||||
|
int userLevel = user.getPlayerInfoManager().getLevel();
|
||||||
for(HeroInfoProto.SoulEquipPos item:soulEquipIdsList){
|
for(HeroInfoProto.SoulEquipPos item:soulEquipIdsList){
|
||||||
int equipId = item.getEquipId();
|
int equipId = item.getEquipId();
|
||||||
|
int[] sign_locations = SSpecialConfig.getOnceArrayValue("Sign_Location");
|
||||||
|
int position = item.getPosition();
|
||||||
|
if(position<sign_locations.length|| position>sign_locations.length-1 || userLevel < sign_locations[position]){
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||||
|
}
|
||||||
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(equipId);
|
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(equipId);
|
||||||
if(sEquipConfig.getRangeHeroTids()!=null && !sEquipConfig.getRangeHeroTids().contains(targetHeroTid)){
|
if(sEquipConfig.getRangeHeroTids()!=null && !sEquipConfig.getRangeHeroTids().contains(targetHeroTid)){
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||||
|
@ -2051,7 +2108,7 @@ public class HeroLogic{
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(unload!=null){
|
if(unload!=null&&!StringUtil.isEmpty(unload.getHeroId())){
|
||||||
Hero hero = user.getHeroManager().getHero(unload.getHeroId());
|
Hero hero = user.getHeroManager().getHero(unload.getHeroId());
|
||||||
List<HeroInfoProto.SoulEquipPos> soulEquipIdsListUnload = unload.getSoulEquipIdsList();
|
List<HeroInfoProto.SoulEquipPos> soulEquipIdsListUnload = unload.getSoulEquipIdsList();
|
||||||
soulEquipIdsListUnload.forEach(e->{
|
soulEquipIdsListUnload.forEach(e->{
|
||||||
|
@ -2101,6 +2158,9 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void unloadSoulEquipOpt(ISession iSession, String heroId, List<HeroInfoProto.SoulEquipPos> equipIdsList) throws Exception {
|
public static void unloadSoulEquipOpt(ISession iSession, String heroId, List<HeroInfoProto.SoulEquipPos> equipIdsList) throws Exception {
|
||||||
|
if(equipIdsList == null || equipIdsList.isEmpty()){
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
|
}
|
||||||
int uid = iSession.getUid();
|
int uid = iSession.getUid();
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
Hero hero = user.getHeroManager().getHero(heroId);
|
Hero hero = user.getHeroManager().getHero(heroId);
|
||||||
|
|
|
@ -18,6 +18,10 @@ public class SPassiveSkillLogicConfig implements BaseConfig {
|
||||||
|
|
||||||
private int weight;
|
private int weight;
|
||||||
|
|
||||||
|
private int effectiveRange;
|
||||||
|
|
||||||
|
private int coverID;
|
||||||
|
|
||||||
public static Map<Integer, SPassiveSkillLogicConfig> config;
|
public static Map<Integer, SPassiveSkillLogicConfig> config;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,4 +52,8 @@ public class SPassiveSkillLogicConfig implements BaseConfig {
|
||||||
public int getWeight() {
|
public int getWeight() {
|
||||||
return weight;
|
return weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getEffectiveRange() {
|
||||||
|
return effectiveRange;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -9,8 +9,6 @@ import java.util.Map;
|
||||||
@Table(name ="PropertyConfig")
|
@Table(name ="PropertyConfig")
|
||||||
public class SPropertyConfig implements BaseConfig {
|
public class SPropertyConfig implements BaseConfig {
|
||||||
|
|
||||||
private int id;
|
|
||||||
|
|
||||||
private int propertyId;
|
private int propertyId;
|
||||||
|
|
||||||
private int style;
|
private int style;
|
||||||
|
@ -21,19 +19,35 @@ public class SPropertyConfig implements BaseConfig {
|
||||||
|
|
||||||
private int ifFormula;
|
private int ifFormula;
|
||||||
|
|
||||||
|
private int propertyIdInBattle;
|
||||||
|
|
||||||
|
|
||||||
private static Map<Integer,SPropertyConfig> sPropertyConfigByPIDMap;
|
private static Map<Integer,SPropertyConfig> sPropertyConfigByPIDMap;
|
||||||
|
private static Map<Integer,SPropertyConfig> sPropertyIConfigByInBattleMap;
|
||||||
|
private static Map<Integer,SPropertyConfig> sPropertyConfigByTargetMap;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
Map<Integer,SPropertyConfig> sPropertyConfigByPIDMapTmp = new HashMap<>();
|
Map<Integer,SPropertyConfig> sPropertyConfigByPIDMapTmp = new HashMap<>();
|
||||||
|
Map<Integer,SPropertyConfig> sPropertyIConfigByInBattleMapTmp = new HashMap<>();
|
||||||
|
Map<Integer,SPropertyConfig> sPropertyConfigByTargetMapTmp = new HashMap<>();
|
||||||
Map<Integer, SPropertyConfig> config = STableManager.getConfig(SPropertyConfig.class);
|
Map<Integer, SPropertyConfig> config = STableManager.getConfig(SPropertyConfig.class);
|
||||||
for(SPropertyConfig sPropertyConfig : config.values()){
|
for(SPropertyConfig sPropertyConfig : config.values()){
|
||||||
int propertyId = sPropertyConfig.getPropertyId();
|
int propertyId = sPropertyConfig.getPropertyId();
|
||||||
sPropertyConfigByPIDMapTmp.put(propertyId,sPropertyConfig);
|
sPropertyConfigByPIDMapTmp.put(propertyId,sPropertyConfig);
|
||||||
|
int propertyIdInBattle = sPropertyConfig.getPropertyIdInBattle();
|
||||||
|
if(propertyIdInBattle!=0){
|
||||||
|
sPropertyIConfigByInBattleMapTmp.put(propertyIdInBattle,sPropertyConfig);
|
||||||
|
}
|
||||||
|
int targetPropertyId = sPropertyConfig.getTargetPropertyId();
|
||||||
|
if(targetPropertyId!=0){
|
||||||
|
sPropertyConfigByTargetMapTmp.put(targetPropertyId,sPropertyConfig);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sPropertyConfigByPIDMap = sPropertyConfigByPIDMapTmp;
|
sPropertyConfigByPIDMap = sPropertyConfigByPIDMapTmp;
|
||||||
|
sPropertyIConfigByInBattleMap = sPropertyIConfigByInBattleMapTmp;
|
||||||
|
sPropertyConfigByTargetMap = sPropertyConfigByTargetMapTmp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,10 +55,15 @@ public class SPropertyConfig implements BaseConfig {
|
||||||
return sPropertyConfigByPIDMap.get(propertyId);
|
return sPropertyConfigByPIDMap.get(propertyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public static SPropertyConfig getsPropertyConfigByBattlePID(int battlePropertyId) {
|
||||||
return id;
|
return sPropertyIConfigByInBattleMap .get(battlePropertyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SPropertyConfig getsPropertyConfigByTargetPropertyId(int targetPropertyId) {
|
||||||
|
return sPropertyConfigByTargetMap.get(targetPropertyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getPropertyId() {
|
public int getPropertyId() {
|
||||||
return propertyId;
|
return propertyId;
|
||||||
}
|
}
|
||||||
|
@ -64,4 +83,8 @@ public class SPropertyConfig implements BaseConfig {
|
||||||
public int getIfFormula() {
|
public int getIfFormula() {
|
||||||
return ifFormula;
|
return ifFormula;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPropertyIdInBattle() {
|
||||||
|
return propertyIdInBattle;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -54,6 +54,7 @@ public class SSpecialConfig implements BaseConfig {
|
||||||
public static final String TIME_LIMIT_RECRUITMENT_FREEINTEGRAL = "time_limit_recruitment_FreeIntegral";//东海寻仙每获得150分赠送一次免费招募
|
public static final String TIME_LIMIT_RECRUITMENT_FREEINTEGRAL = "time_limit_recruitment_FreeIntegral";//东海寻仙每获得150分赠送一次免费招募
|
||||||
public static final String HERO_RETURN_PERCENT = "hero_return_percent";//回溯返还材料比例 实际百分比为填写数值/10000
|
public static final String HERO_RETURN_PERCENT = "hero_return_percent";//回溯返还材料比例 实际百分比为填写数值/10000
|
||||||
public static final String HERO_SACRIFICE_PERCENT = "hero_sacrifice_percent";//献祭返还材料比例 实际百分比为填写数值/10000
|
public static final String HERO_SACRIFICE_PERCENT = "hero_sacrifice_percent";//献祭返还材料比例 实际百分比为填写数值/10000
|
||||||
|
public static final String Sign_Location = "Sign_Location";//魂印位置开启条件(玩家等级)
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue