战斗修改 点金bug 猎妖之路bug
parent
78905f7b0b
commit
177454ffed
|
@ -69,6 +69,7 @@ public interface Global {
|
|||
|
||||
|
||||
int VIPSTORID = 20; //vip商店id
|
||||
int GODSTORID = 57; //vip商店id
|
||||
int LUXURYMONTHCARDID =11;//6豪华月卡 废弃 改版
|
||||
int WEEKCARDID = 10; //月卡
|
||||
|
||||
|
|
|
@ -89,18 +89,7 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
|||
|
||||
SnapFightInfo deffightInfo = nodeInfo.getSnapFightInfo();
|
||||
|
||||
//添加被动技能
|
||||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||
Set<SExpeditionHolyConfig> expeditionHolyConfigs = ExpeditionLogic.getFirstRankHoly(expeditionManager);
|
||||
|
||||
StringBuilder passiveSkillResult = new StringBuilder();
|
||||
if(deffightInfo.getPassiveSkills().length()!=0){
|
||||
passiveSkillResult.append("|");
|
||||
}
|
||||
for (SExpeditionHolyConfig config:expeditionHolyConfigs) {
|
||||
passiveSkillResult.append(String.valueOf(config.getPassiveSkillId())).append("|");
|
||||
}
|
||||
String holySkill = passiveSkillResult.length()!=0?passiveSkillResult.substring(0,passiveSkillResult.length()-1):"";
|
||||
|
||||
LuaValue getFightData;
|
||||
if(ExpeditionLogic.isHardNode(nodeInfo.getType())){
|
||||
|
|
|
@ -73,15 +73,15 @@ public class HeroNodeRequestHandler extends BaseHandler<Expedition.HeroNodeReque
|
|||
Hero hero = expeditionManager.getHeroMapTemp(nodeId).get(heroId);
|
||||
expeditionManager.addHero(hero);
|
||||
|
||||
Map<String, PropertyItem> equipMapTemp = expeditionManager.getEquipMapTemp();
|
||||
for (Map.Entry<Integer, String> next : hero.getEquipByPositionMap().entrySet()) {
|
||||
String equipId = next.getValue();
|
||||
PropertyItem equip = equipMapTemp.get(equipId);
|
||||
if (equip == null) {
|
||||
continue;
|
||||
}
|
||||
user.getExpeditionManager().addEquip(user, equip);
|
||||
}
|
||||
// Map<String, PropertyItem> equipMapTemp = expeditionManager.getEquipMapTemp();
|
||||
// for (Map.Entry<Integer, String> next : hero.getEquipByPositionMap().entrySet()) {
|
||||
// String equipId = next.getValue();
|
||||
// PropertyItem equip = equipMapTemp.get(equipId);
|
||||
// if (equip == null) {
|
||||
// continue;
|
||||
// }
|
||||
// user.getExpeditionManager().addEquip(user, equip);
|
||||
// }
|
||||
|
||||
|
||||
Set<String> jewelInfo = hero.getJewelInfo();
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.googlecode.protobuf.format.JsonFormat;
|
|||
import com.ljsd.fight.FightType;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.handler.map.TrailHero;
|
||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||
import com.ljsd.jieling.logic.fight.specialparm.SpecialForTeamBuildEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
|
@ -220,7 +221,7 @@ public class BehaviorUtil {
|
|||
*/
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId,boolean isMySelf) {
|
||||
if(teamId==GlobalsDef.TRIAL_TEAM){
|
||||
return getFightTeamInfo(user,teamId);
|
||||
return FightUtil.getFightTeamInfo(user,teamId);
|
||||
}
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
|
@ -252,181 +253,6 @@ public class BehaviorUtil {
|
|||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取FightUnitInfo
|
||||
* @param user
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId) {
|
||||
//无尽副本使用镜像来战斗
|
||||
if(teamId!= GlobalsDef.TRIAL_TEAM){
|
||||
return getFightTeamInfo(user,teamId,true);
|
||||
}
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
Map<String, TrailHero> heroInfo = user.getMapManager().getTrialInfo().getHeroInfo();
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
if (heroInfo.isEmpty()||!heroInfo.containsKey(teamPosHeroInfo.getHeroId())) {
|
||||
continue;
|
||||
}
|
||||
TrailHero trailHero = heroInfo.get(teamPosHeroInfo.getHeroId());
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
//存起来
|
||||
String heroSkill = trailHero.getHeroSkills();
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb,trailHero.getTmpId(),trailHero.getLevel(),trailHero.getProperty()).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(trailHero.getTmpId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(trailHero.getStar())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
// .setTeamSkillList(HeroLogic.getInstance().getPokenmonSkills(user,teamId))
|
||||
// .setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user,teamId))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取FightUnitInfo
|
||||
* @param user
|
||||
* @param teamId
|
||||
* @param attackBloodMap 血量百分比
|
||||
* @return
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId, Map<String, Integer> attackBloodMap) {
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
Map<Integer, Integer> heroAttributeMap = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, false, teamId);
|
||||
if(attackBloodMap.containsKey(teamPosHeroInfo.getHeroId())){
|
||||
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId())-attackBloodMap.get(teamPosHeroInfo.getHeroId())*heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId())/100);
|
||||
}
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,skillSb).toString();
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb, hero.getTemplateId(),hero.getLevel(), heroAttributeMap).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setStar(hero.getStar())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.setTeamSkillList(HeroLogic.getInstance().getPokenmonSkills(user,teamId))
|
||||
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user,teamId))
|
||||
.setSpecialPassive(SpecialForTeamBuildEnum.toParm(teamId,user))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取FightUnitInfo
|
||||
* @param user
|
||||
* @param teamId
|
||||
* @param attackBloodMap 血量百分比
|
||||
* @return
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfoWithDouble(User user, int teamId, Map<String, Double> attackBloodMap) {
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
int i=0;
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
Map<Integer, Integer> heroAttributeMap = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, false, teamId);
|
||||
if(attackBloodMap.containsKey(teamPosHeroInfo.getHeroId())){
|
||||
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(),(int)(attackBloodMap.getOrDefault(teamPosHeroInfo.getHeroId(),1d)*heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId())));
|
||||
}
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,skillSb).toString();
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb, hero.getTemplateId(),hero.getLevel(), heroAttributeMap).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(++i)
|
||||
.setStar(hero.getStar())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.setTeamSkillList(HeroLogic.getInstance().getPokenmonSkills(user,teamId))
|
||||
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user,teamId))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
public static CommonProto.FightTeamInfo getRobotFightTeamInfo(SArenaRobotConfig sArenaRobotConfig) {
|
||||
return getRobotFightTeamInfo(sArenaRobotConfig,null);
|
||||
}
|
||||
public static CommonProto.FightTeamInfo getRobotFightTeamInfo(SArenaRobotConfig sArenaRobotConfig,Map<String,Double> remainHp) {
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
Map<Integer,Integer> heroStarsMap = sArenaRobotConfig.getStarOfHeroMap();
|
||||
int i=0;
|
||||
for(Map.Entry<Integer,Integer> item : heroStarsMap.entrySet()){
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
Integer heroTid = item.getKey();
|
||||
Integer heroStar = item.getValue();
|
||||
SCHero scHero = SCHero.getsCHero().get(heroTid);
|
||||
List<Integer> skillIds = scHero.getSkillListByStar(heroStar);
|
||||
String heroSkill = HeroLogic.getInstance().getRobotHeroSkills(skillIds,skillSb).toString();
|
||||
|
||||
int[] differDemonsId = sArenaRobotConfig.getDifferDemonsId();
|
||||
int differDemonsLv = sArenaRobotConfig.getDifferDemonsLv();
|
||||
int robotLevel = sArenaRobotConfig.getRoleLv();
|
||||
Map<Integer, Integer> robotHeroAttribute =HeroLogic.getInstance(). calRobotHeroAttribute(scHero, robotLevel, sArenaRobotConfig.getBreakId(), differDemonsId, differDemonsLv,false);
|
||||
|
||||
if(remainHp!=null&&remainHp.containsKey(heroTid.toString())){
|
||||
robotHeroAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),(int)(remainHp.getOrDefault(heroTid.toString(),1d)*robotHeroAttribute.get(HeroAttributeEnum.Hp.getPropertyId())));
|
||||
}
|
||||
|
||||
String property = HeroLogic.getInstance().getRobotHeroProperty(sArenaRobotConfig,scHero,propertySb,robotHeroAttribute).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(heroTid))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(++i)
|
||||
.setStar(heroStar)
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.setTeamSkillList(HeroLogic.getInstance().getRobotPokenmonSkills(sArenaRobotConfig))
|
||||
.setTeamPassiveList(HeroLogic.getInstance().getRobotPokenmonPassiveSkills(sArenaRobotConfig))
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新事件时 更新任务
|
||||
*/
|
||||
|
|
|
@ -43,6 +43,8 @@ import java.util.stream.Collectors;
|
|||
* Description: 远征 猎妖之路
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/1/7 11:46
|
||||
*
|
||||
*TODO fix 清除临时的节点装备
|
||||
*/
|
||||
public class ExpeditionLogic {
|
||||
|
||||
|
@ -863,11 +865,11 @@ public class ExpeditionLogic {
|
|||
Jewel j = (Jewel) propertyItem;
|
||||
Jewel newequip = new Jewel(user.getId(), j.getEquipId());
|
||||
|
||||
if(isTemp){
|
||||
user.getExpeditionManager().addEquipToTemp(user, newequip);
|
||||
}else {
|
||||
// if(isTemp){
|
||||
// user.getExpeditionManager().addEquipToTemp(user, newequip);
|
||||
// }else {
|
||||
user.getExpeditionManager().addEquip(user, newequip);
|
||||
}
|
||||
// }
|
||||
newHero.addJewel(newequip.getId());
|
||||
}
|
||||
if(isTemp){
|
||||
|
@ -902,28 +904,7 @@ public class ExpeditionLogic {
|
|||
}
|
||||
|
||||
|
||||
public static TreeSet<Integer> getRandomTidWithPro(int type,int size)throws ErrorCodeException{
|
||||
|
||||
//select collections
|
||||
Map<Integer, Integer> cfg = STableManager.getFigureConfig(CommonStaticConfig.class).type2Recruitcfgs.getOrDefault(type, new HashMap<>());
|
||||
|
||||
//check limit
|
||||
if(cfg.size()<size){
|
||||
throw new ErrorCodeException(ErrorCode.UNKNOWN);
|
||||
}
|
||||
if(cfg.size() ==size){
|
||||
return new TreeSet<>(cfg.keySet());
|
||||
}
|
||||
|
||||
//random ids
|
||||
TreeSet<Integer> tempid = new TreeSet<>();
|
||||
while (tempid.size()<size){
|
||||
int i1 = ranndomFromWeight(cfg);
|
||||
tempid.add(i1);
|
||||
}
|
||||
return tempid;
|
||||
|
||||
}
|
||||
|
||||
public static List<CommonProto.FightTeamInfo> getGropFightTeamInfoWithDouble(int gropid, Map<String, Double> attackBloodMap) {
|
||||
Map<Integer,List<Double>> hps = new HashMap<>();
|
||||
|
@ -934,6 +915,10 @@ public class ExpeditionLogic {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 猎妖之路 使用
|
||||
* 需要添加被动
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfoWithDouble(User user, int teamId, Map<String, Double> attackBloodMap) {
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
|
|
|
@ -2,19 +2,27 @@ package com.ljsd.jieling.logic.fight;
|
|||
|
||||
import com.googlecode.protobuf.format.JsonFormat;
|
||||
import com.ljsd.fight.CheckFight;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.map.TrailHero;
|
||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.logic.blood.BloodLogic;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.fight.specialparm.SpecialForTeamBuildEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.util.FightDataUtil;
|
||||
import com.ljsd.jieling.util.MonsterUtil;
|
||||
import config.SArenaRobotConfig;
|
||||
import config.SCHero;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -27,14 +35,14 @@ public class FightUtil {
|
|||
if(attackBloodMap ==null || attackBloodMap.isEmpty()){
|
||||
return BehaviorUtil.getFightTeamInfo(player,teamId,true);
|
||||
}
|
||||
return BehaviorUtil.getFightTeamInfo(player,teamId,attackBloodMap);
|
||||
return getFightTeamInfo(player,teamId,attackBloodMap);
|
||||
}
|
||||
|
||||
public static CommonProto.FightTeamInfo makePersonFightDataWithDouble(User player,int teamId,Map<String, Double> attackBloodMap){
|
||||
if(attackBloodMap ==null || attackBloodMap.isEmpty()){
|
||||
return BehaviorUtil.getFightTeamInfo(player,teamId,true);
|
||||
}
|
||||
return BehaviorUtil.getFightTeamInfoWithDouble(player,teamId,attackBloodMap);
|
||||
return getFightTeamInfoWithDouble(player,teamId,attackBloodMap);
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,7 +81,7 @@ public class FightUtil {
|
|||
//防守方是机器人(目前是竞技场适用)
|
||||
public static CommonProto.FightTeamInfo makeRobotFightData(int robotId){
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(robotId);
|
||||
return BehaviorUtil.getRobotFightTeamInfo(sArenaRobotConfig);
|
||||
return getRobotFightTeamInfo(sArenaRobotConfig);
|
||||
}
|
||||
|
||||
public static FightResult getFightForPVE(FightEvent fightEvent){
|
||||
|
@ -180,4 +188,173 @@ public class FightUtil {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取FightUnitInfo
|
||||
*/
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId) {
|
||||
//无尽副本使用镜像来战斗
|
||||
if(teamId!= GlobalsDef.TRIAL_TEAM){
|
||||
return BehaviorUtil.getFightTeamInfo(user,teamId,true);
|
||||
}
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
Map<String, TrailHero> heroInfo = user.getMapManager().getTrialInfo().getHeroInfo();
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
if (heroInfo.isEmpty()||!heroInfo.containsKey(teamPosHeroInfo.getHeroId())) {
|
||||
continue;
|
||||
}
|
||||
TrailHero trailHero = heroInfo.get(teamPosHeroInfo.getHeroId());
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
//存起来
|
||||
String heroSkill = trailHero.getHeroSkills();
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb,trailHero.getTmpId(),trailHero.getLevel(),trailHero.getProperty()).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(trailHero.getTmpId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(trailHero.getStar())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
// .setTeamSkillList(HeroLogic.getInstance().getPokenmonSkills(user,teamId))
|
||||
// .setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user,teamId))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取FightUnitInfo
|
||||
* @param attackBloodMap 血量百分比
|
||||
*/
|
||||
private static CommonProto.FightTeamInfo getFightTeamInfo(User user, int teamId, Map<String, Integer> attackBloodMap) {
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
Map<Integer, Integer> heroAttributeMap = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, false, teamId);
|
||||
if(attackBloodMap.containsKey(teamPosHeroInfo.getHeroId())){
|
||||
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId())-attackBloodMap.get(teamPosHeroInfo.getHeroId())*heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId())/100);
|
||||
}
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,skillSb).toString();
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb, hero.getTemplateId(),hero.getLevel(), heroAttributeMap).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setStar(hero.getStar())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.setTeamSkillList(HeroLogic.getInstance().getPokenmonSkills(user,teamId))
|
||||
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user,teamId))
|
||||
.setSpecialPassive(SpecialForTeamBuildEnum.toParm(teamId,user))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取FightUnitInfo
|
||||
* @param attackBloodMap 血量百分比 double
|
||||
*/
|
||||
private static CommonProto.FightTeamInfo getFightTeamInfoWithDouble(User user, int teamId, Map<String, Double> attackBloodMap) {
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
int i=0;
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
Map<Integer, Integer> heroAttributeMap = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, false, teamId);
|
||||
if(attackBloodMap.containsKey(teamPosHeroInfo.getHeroId())){
|
||||
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(),(int)(attackBloodMap.getOrDefault(teamPosHeroInfo.getHeroId(),1d)*heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId())));
|
||||
}
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,skillSb).toString();
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb, hero.getTemplateId(),hero.getLevel(), heroAttributeMap).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.setTeamSkillList(HeroLogic.getInstance().getPokenmonSkills(user,teamId))
|
||||
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user,teamId))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
private static CommonProto.FightTeamInfo getRobotFightTeamInfo(SArenaRobotConfig sArenaRobotConfig) {
|
||||
return getRobotFightTeamInfo(sArenaRobotConfig,null);
|
||||
}
|
||||
private static CommonProto.FightTeamInfo getRobotFightTeamInfo(SArenaRobotConfig sArenaRobotConfig,Map<String,Double> remainHp) {
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
Map<Integer,Integer> heroStarsMap = sArenaRobotConfig.getStarOfHeroMap();
|
||||
int i=0;
|
||||
for(Map.Entry<Integer,Integer> item : heroStarsMap.entrySet()){
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
Integer heroTid = item.getKey();
|
||||
Integer heroStar = item.getValue();
|
||||
SCHero scHero = SCHero.getsCHero().get(heroTid);
|
||||
List<Integer> skillIds = scHero.getSkillListByStar(heroStar);
|
||||
String heroSkill = HeroLogic.getInstance().getRobotHeroSkills(skillIds,skillSb).toString();
|
||||
|
||||
int[] differDemonsId = sArenaRobotConfig.getDifferDemonsId();
|
||||
int differDemonsLv = sArenaRobotConfig.getDifferDemonsLv();
|
||||
int robotLevel = sArenaRobotConfig.getRoleLv();
|
||||
Map<Integer, Integer> robotHeroAttribute =HeroLogic.getInstance(). calRobotHeroAttribute(scHero, robotLevel, sArenaRobotConfig.getBreakId(), differDemonsId, differDemonsLv,false);
|
||||
|
||||
if(remainHp!=null&&remainHp.containsKey(heroTid.toString())){
|
||||
robotHeroAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),(int)(remainHp.getOrDefault(heroTid.toString(),1d)*robotHeroAttribute.get(HeroAttributeEnum.Hp.getPropertyId())));
|
||||
}
|
||||
|
||||
String property = HeroLogic.getInstance().getRobotHeroProperty(sArenaRobotConfig,scHero,propertySb,robotHeroAttribute).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(heroTid))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(++i)
|
||||
.setStar(heroStar)
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.setTeamSkillList(HeroLogic.getInstance().getRobotPokenmonSkills(sArenaRobotConfig))
|
||||
.setTeamPassiveList(HeroLogic.getInstance().getRobotPokenmonPassiveSkills(sArenaRobotConfig))
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@ public enum HeroAttributeEnum {
|
|||
DifferDemonsBocusFactor(66),
|
||||
CurHpExtra(67),
|
||||
CurHpSpecialExtra(68),
|
||||
PVPDamageBocusFactor(69),
|
||||
PVPDamageReduceFactor(70),
|
||||
FireDamageBonusFactor(101),
|
||||
WindDamageBonusFactor(102),
|
||||
WaterDamageBonusFactor(103),
|
||||
|
|
|
@ -1083,6 +1083,7 @@ public class HeroLogic{
|
|||
}
|
||||
return getHeroPropertyBuilder(sb,hero.getTemplateId(),hero.getLevel(),heroAttributeMap);
|
||||
}
|
||||
|
||||
public StringBuilder getHeroPropertyBuilder(StringBuilder sb,int tempId,int heroLevel,Map<Integer, Integer> heroAttributeMap){
|
||||
sb.append(heroLevel).append(DIVISION);
|
||||
SCHero scHero = SCHero.getsCHero().get(tempId);
|
||||
|
@ -1109,31 +1110,10 @@ public class HeroLogic{
|
|||
}
|
||||
|
||||
public StringBuilder getHeroPropertyBuilder(StringBuilder sb,FamilyHeroInfo hero,Map<Integer, Integer> heroAttributeMap){
|
||||
int heroLevel = hero.getLevel();
|
||||
sb.append(heroLevel).append(DIVISION);
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTempleteId());
|
||||
List<Integer> templatePropetyIds = transTemplateByHeroPropertyName.get(scHero.getPropertyName());
|
||||
for(Integer templatePropetyId:templatePropetyIds){
|
||||
Integer propertyValue = heroAttributeMap.get(templatePropetyId);
|
||||
if(propertyValue == null){
|
||||
propertyValue =0;
|
||||
}
|
||||
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByPID(templatePropetyId);
|
||||
if(sPropertyConfig.getIfFormula() == 1){
|
||||
sb.append(propertyValue/(heroLevel+10)/100).append(DIVISION);
|
||||
}else{
|
||||
if(sPropertyConfig.getStyle() == GlobalsDef.PERCENT_TYPE){
|
||||
sb.append(propertyValue/10000f).append(DIVISION);
|
||||
|
||||
}else{
|
||||
sb.append(propertyValue).append(DIVISION);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return sb;
|
||||
return getHeroPropertyBuilder(sb, hero.getTempleteId(), hero.getLevel(), heroAttributeMap);
|
||||
}
|
||||
|
||||
|
||||
public StringBuilder getRobotHeroProperty(SArenaRobotConfig sArenaRobotConfig,SCHero scHero, StringBuilder sb,Map<Integer, Integer> robotHeroAttribute){
|
||||
|
||||
int robotLevel = sArenaRobotConfig.getRoleLv();
|
||||
|
@ -1524,6 +1504,11 @@ public class HeroLogic{
|
|||
return heroAllAttribute;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 属性数值计算
|
||||
* @param heroAllAttribute
|
||||
*/
|
||||
public void calInteractAdd(Map<Integer, Integer> heroAllAttribute){
|
||||
Map<Integer,Integer> propertyPercentMap = new HashMap<>();
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator = heroAllAttribute.entrySet().iterator();
|
||||
|
|
|
@ -458,7 +458,7 @@ public class StoreLogic implements IEventHandler {
|
|||
if(SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId).getStoreType() == 10){
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BUY_SEVEN_GIFT,storeId,itemNum);
|
||||
}
|
||||
if(itemId==10005){
|
||||
if(storeId==Global.GODSTORID){
|
||||
Poster.getPoster().dispatchEvent(new GoldEvent(user.getId(),itemNum));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue