四灵助战
parent
40b74dc476
commit
2378baddc2
|
@ -22,7 +22,6 @@ import com.ljsd.jieling.logic.fight.eventhandler.MainLineOrInnerDemonFightHandle
|
|||
import com.ljsd.jieling.logic.help.HelpHero;
|
||||
import com.ljsd.jieling.logic.help.HelpHeroLogic;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.ljsd.jieling.util.MonsterUtil;
|
||||
|
@ -244,27 +243,21 @@ public class BehaviorUtil {
|
|||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
|
||||
long teamForce = HeroLogic.getInstance().calTeamForce(user, teamId);
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
CommonProto.FightUnitInfo builder;
|
||||
if (hero != null){
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,new StringBuilder()).toString();
|
||||
String property = HeroLogic.getInstance().getHeroProperty(user,hero,new StringBuilder(),isMySelf,teamId).toString();
|
||||
builder = getFightUnitInfo(hero, heroSkill, property, teamPosHeroInfo.getPosition());
|
||||
builder = getFightUnitInfo(hero, heroSkill, property, teamPosHeroInfo.getPosition(), teamForce);
|
||||
}
|
||||
else if(FourChallengeLogic.isFourChallengeTeam(teamId)){
|
||||
HelpHero helpHero = HelpHeroLogic.getHelpHeroByHeroId(user.getId(), teamPosHeroInfo.getHeroId());
|
||||
if (helpHero == null || helpHero.getHero() == null){
|
||||
if (helpHero == null){
|
||||
continue;
|
||||
}
|
||||
User userByRpc = PlayerLogic.getInstance().getUserByRpc(helpHero.getUid());
|
||||
if (userByRpc == null){
|
||||
continue;
|
||||
}
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(userByRpc,helpHero.getHero(),new StringBuilder()).toString();
|
||||
String property = HeroLogic.getInstance().getHeroProperty(userByRpc,helpHero.getHero(),new StringBuilder(),isMySelf,teamId).toString();
|
||||
builder = getFightUnitInfo(helpHero.getHero(), heroSkill, property, teamPosHeroInfo.getPosition());
|
||||
builder = getFightUnitInfo(helpHero.getHero(), helpHero.getSkillSb(), helpHero.getPropertySb(), teamPosHeroInfo.getPosition(), teamForce);
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
|
@ -274,7 +267,7 @@ public class BehaviorUtil {
|
|||
return HeroLogic.getInstance().combinationFightTeam(user,teamId,heroFightInfos);
|
||||
}
|
||||
|
||||
private static CommonProto.FightUnitInfo getFightUnitInfo(Hero hero, String heroSkill, String property, int position){
|
||||
private static CommonProto.FightUnitInfo getFightUnitInfo(Hero hero, String heroSkill, String property, int position, long force){
|
||||
return CommonProto.FightUnitInfo.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
|
@ -282,6 +275,7 @@ public class BehaviorUtil {
|
|||
.setPosition(position)
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setForceScore(force)
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build();
|
||||
|
|
|
@ -71,6 +71,25 @@ public class FourChallengeLogic {
|
|||
return fourTeamList;
|
||||
}
|
||||
|
||||
public static int getTeamIdOfCamp(int camp){
|
||||
int teamId = 0;
|
||||
switch (camp){
|
||||
case 1:
|
||||
teamId = TeamEnum.FOURCHALLENGE_PEOPLE_TEAM.getTeamId();
|
||||
break;
|
||||
case 2:
|
||||
teamId = TeamEnum.FOURCHALLENGE_BUDDHA_TEAM.getTeamId();
|
||||
break;
|
||||
case 3:
|
||||
teamId = TeamEnum.FOURCHALLENGE_MONSTER_TEAM.getTeamId();
|
||||
break;
|
||||
case 4:
|
||||
teamId = TeamEnum.FOURCHALLENGE_MORALITY_TEAM.getTeamId();
|
||||
break;
|
||||
}
|
||||
return teamId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前试炼是否开启,0:未开,1:开启
|
||||
* 例子 0,1,1,1
|
||||
|
|
|
@ -23,13 +23,10 @@ import com.ljsd.jieling.logic.activity.event.NewWelfareEvent;
|
|||
import com.ljsd.jieling.logic.activity.event.NewWelfareTypeEnum;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SecretEvent;
|
||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.help.HelpHero;
|
||||
import com.ljsd.jieling.logic.help.HelpHeroLogic;
|
||||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
|
@ -38,9 +35,6 @@ import com.ljsd.jieling.logic.mission.MissionType;
|
|||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.FightInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
|
@ -48,6 +42,9 @@ import org.luaj.vm2.LuaValue;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.FightInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import util.MathUtils;
|
||||
import util.StringUtil;
|
||||
import util.TimeUtils;
|
||||
|
@ -766,33 +763,25 @@ public class CombatLogic {
|
|||
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
List<Integer> passiveTeamskillEffect = new ArrayList<>();
|
||||
for(TeamPosHeroInfo teamPosHeroInfo :teamPosHeroInfos){
|
||||
for(TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos){
|
||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null){
|
||||
//大闹天宫
|
||||
if (teamId==TeamEnum.EXPEDITION_TEAM.getTeamId()){
|
||||
if (user.getExpeditionManager().getHeroMap().containsKey(teamPosHeroInfo.getHeroId())){
|
||||
hero = user.getExpeditionManager().getHeroMap().get(teamPosHeroInfo.getHeroId());
|
||||
}else {
|
||||
continue;
|
||||
}
|
||||
}else if (FourChallengeLogic.isFourChallengeTeam(teamId)){
|
||||
// 四灵试炼,助战
|
||||
HelpHero helpHero = HelpHeroLogic.getHelpHeroByHeroId(user.getId(), teamPosHeroInfo.getHeroId());
|
||||
if (helpHero != null){
|
||||
hero = helpHero.getHero();
|
||||
}else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hero == null) {
|
||||
if (hero == null && teamId != TeamEnum.EXPEDITION_TEAM.getTeamId()){
|
||||
continue;
|
||||
}
|
||||
else{
|
||||
// 大脑天宫
|
||||
if (!user.getExpeditionManager().getHeroMap().containsKey(teamPosHeroInfo.getHeroId())){
|
||||
continue;
|
||||
}
|
||||
hero = user.getExpeditionManager().getHeroMap().get(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
List<Integer> heroSkillListTmp = HeroLogic.getInstance().getHeroSkillList(user, hero);
|
||||
for (Integer skill : heroSkillListTmp) {
|
||||
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
||||
if(config!=null &&config.getEffectiveRange()==3 && PassiveskillCalEnum.contains(config.getType())){
|
||||
if(config!=null && config.getEffectiveRange()==3 && PassiveskillCalEnum.contains(config.getType())){
|
||||
passiveTeamskillEffect.add(config.getId());
|
||||
}
|
||||
}
|
||||
|
@ -832,15 +821,10 @@ public class CombatLogic {
|
|||
heroFind.add(user.getExpeditionManager().getHeroMap().get(key.getHeroId()));
|
||||
continue;
|
||||
}
|
||||
// 四灵试炼
|
||||
if (FourChallengeLogic.isFourChallengeTeam(teamId)){
|
||||
HelpHero helpHero = HelpHeroLogic.getHelpHeroByHeroId(user.getId(), key.getHeroId());
|
||||
if (helpHero != null){
|
||||
heroFind.add(helpHero.getHero());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Hero hero = user.getHeroManager().getHero(key.getHeroId());
|
||||
if (hero == null){
|
||||
continue;
|
||||
}
|
||||
heroFind.add(hero);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
package com.ljsd.jieling.logic.fight.eventhandler;
|
||||
|
||||
import com.ljsd.fight.CheckFight;
|
||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.FightEvent;
|
||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||
import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.help.HelpHero;
|
||||
import com.ljsd.jieling.logic.help.HelpHeroLogic;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.util.FightDataUtil;
|
||||
import config.SCHero;
|
||||
|
@ -41,7 +37,7 @@ public class SevenWorldFightHandler implements IFightEventProcesor {
|
|||
if (user == null){
|
||||
return null;
|
||||
}
|
||||
CommonProto.FightTeamInfo fightTeamInfo = makePersonFightData(user, pveFightEvent.getTeamId());
|
||||
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(user, pveFightEvent.getTeamId(), true);
|
||||
int fightSeed = FightUtil.getFightSeed();
|
||||
//怪物剩余血量
|
||||
List<CommonProto.FightTeamInfo> monsterFightTeamInfos = makeMonsterFightData(user,pveFightEvent.getMonsterGroupId(),pveFightEvent.getNums());
|
||||
|
@ -67,53 +63,6 @@ public class SevenWorldFightHandler implements IFightEventProcesor {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 制作玩家的战斗信息
|
||||
* @param user
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo makePersonFightData(User user,int teamId){
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
// 四灵试炼,助战
|
||||
if (FourChallengeLogic.isFourChallengeTeam(teamId)){
|
||||
HelpHero helpHero = HelpHeroLogic.getHelpHeroByHeroId(user.getId(), teamPosHeroInfo.getHeroId());
|
||||
if (helpHero == null){
|
||||
continue;
|
||||
}
|
||||
hero = helpHero.getHero();
|
||||
}
|
||||
}
|
||||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,skillSb).toString();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
String property = HeroLogic.getInstance().getHeroProperty(user,hero,propertySb,true,teamId).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(String.valueOf(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.setPropertyId(hero.getPropertyId())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return HeroLogic.getInstance().combinationFightTeam(user,teamId,heroFightInfos);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 遗物技能
|
||||
* @param user
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package com.ljsd.jieling.logic.help;
|
||||
|
||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||
import com.ljsd.jieling.logic.dao.Baubles;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.PropertyItem;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import util.StringUtil;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -57,6 +62,10 @@ public class HelpHero {
|
|||
|
||||
private Set<Integer> heroGiftEquipList = new HashSet<>();//礼物装备列表
|
||||
|
||||
private String skillSb;
|
||||
|
||||
private String propertySb;
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
@ -156,4 +165,29 @@ public class HelpHero {
|
|||
public void setHeroGiftEquipList(Set<Integer> heroGiftEquipList) {
|
||||
this.heroGiftEquipList = heroGiftEquipList;
|
||||
}
|
||||
|
||||
public String getSkillSb() {
|
||||
if (StringUtil.isEmpty(skillSb)){
|
||||
User userByRpc = PlayerLogic.getInstance().getUserByRpc(uid);
|
||||
return HeroLogic.getInstance().getHeroSkills(userByRpc, hero, new StringBuilder()).toString();
|
||||
}
|
||||
return skillSb;
|
||||
}
|
||||
|
||||
public void setSkillSb(String skillSb) {
|
||||
this.skillSb = skillSb;
|
||||
}
|
||||
|
||||
public String getPropertySb() {
|
||||
if (StringUtil.isEmpty(propertySb)){
|
||||
User userByRpc = PlayerLogic.getInstance().getUserByRpc(uid);
|
||||
int teamIdOfCamp = FourChallengeLogic.getTeamIdOfCamp(hero.getPropertyId());
|
||||
return HeroLogic.getInstance().getHeroProperty(userByRpc,hero,new StringBuilder(),true,teamIdOfCamp).toString();
|
||||
}
|
||||
return propertySb;
|
||||
}
|
||||
|
||||
public void setPropertySb(String propertySb) {
|
||||
this.propertySb = propertySb;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ public class HelpHeroLogic {
|
|||
}
|
||||
HelpHero helpHeroForRedis = CBean2Proto.buildHelpHeroToRedis(user, hero);
|
||||
// 自己的助战列表添加
|
||||
addHelpHero(subKey,propertyName, helpHeroForRedis);
|
||||
addHelpHero(subKey, propertyName, helpHeroForRedis);
|
||||
// 类型助战列表添加,自己的助战列表没有该类型英雄,那么对应类型的助战列表也应该没有对应英雄,所以这里不再循环验证
|
||||
addHelpHero(String.valueOf(propertyName),user.getId(), helpHeroForRedis);
|
||||
|
||||
|
|
|
@ -1348,23 +1348,23 @@ public class HeroLogic {
|
|||
if (teamId == TeamEnum.EXPEDITION_TEAM.getTeamId()) {
|
||||
if (user.getHeroManager().getHero(heroId) == null && !user.getExpeditionManager().getHeroMap().containsKey(heroId)) {
|
||||
// 卡牌不存在
|
||||
result = "card not exists";
|
||||
result = "card not exists1";
|
||||
break;
|
||||
}
|
||||
} else if (teamId == TeamEnum.TRIAL_TEAM.getTeamId()) {
|
||||
if (!user.getMapManager().getTrialInfo().getHeroInfo().containsKey(heroId)) {
|
||||
result = "card not exists";
|
||||
result = "card not exists2";
|
||||
break;
|
||||
}
|
||||
} else if (FourChallengeLogic.isFourChallengeTeam(teamId)) {
|
||||
if (user.getHeroManager().getHero(heroId) == null && HelpHeroLogic.getHelpHeroByHeroId(user.getId(), heroId) == null) {
|
||||
result = "card not exists";
|
||||
result = "card not exists3";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (user.getHeroManager().getHero(heroId) == null) {
|
||||
// 卡牌不存在
|
||||
result = "card not exists";
|
||||
result = "card not exists4";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3243,13 +3243,7 @@ public class HeroLogic {
|
|||
*/
|
||||
private void applyJewelAttribute(Map<Integer, Long> heroAllAttribute, Hero hero, User user) {
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
Map<String, PropertyItem> equipMap;
|
||||
HelpHero helpHero = HelpHeroLogic.getHelpHeroByHeroId(user.getId(), hero.getId());
|
||||
if (helpHero != null) {
|
||||
equipMap = helpHero.getJewels().stream().collect(Collectors.toMap(PropertyItem::getId, Function.identity()));
|
||||
} else {
|
||||
equipMap = hero.getCreateType() == 1 ? user.getExpeditionManager().getEquipMap() : equipManager.getEquipMap();
|
||||
}
|
||||
Map<String, PropertyItem> equipMap = hero.getCreateType() == 1 ? user.getExpeditionManager().getEquipMap() : equipManager.getEquipMap();
|
||||
|
||||
Set<String> jewelInfo = hero.getJewelInfo();
|
||||
boolean flashing = jewelInfo.size() == 2;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.fight.ArenaRecord;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
|
@ -10,6 +9,7 @@ import com.ljsd.jieling.handler.map.Cell;
|
|||
import com.ljsd.jieling.handler.map.MapManager;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
|
@ -291,6 +291,11 @@ public class CBean2Proto {
|
|||
List<PropertyItem> jewels = buildPropertyItemList(equipManager, clone.getJewelInfo());
|
||||
// 法相
|
||||
List<PropertyItem> faxiangs = buildPropertyItemList(equipManager, clone.getFaxiangList());
|
||||
// 技能
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,new StringBuilder()).toString();
|
||||
// 属性
|
||||
int teamIdOfCamp = FourChallengeLogic.getTeamIdOfCamp(hero.getPropertyId());
|
||||
String property = HeroLogic.getInstance().getHeroProperty(user,hero,new StringBuilder(),true,teamIdOfCamp).toString();
|
||||
// 结果返回,援助类型不在这里写
|
||||
HelpHero helpHero = new HelpHero();
|
||||
helpHero.setUid(user.getId());
|
||||
|
@ -303,6 +308,8 @@ public class CBean2Proto {
|
|||
helpHero.setFourTotalTier(user.getPlayerInfoManager().getFourChallengeTotal());
|
||||
helpHero.setBaubles(equipManager.getBaubles(clone.getBauBlesId()));
|
||||
helpHero.setBaublesList(buildBaublesList(equipManager, clone.getBauBlesId()));
|
||||
helpHero.setSkillSb(heroSkill);
|
||||
helpHero.setPropertySb(property);
|
||||
return helpHero;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue