巅峰赛加入灵兽
parent
aa6133e571
commit
5dc5ab2ae5
|
@ -98,10 +98,10 @@ public class BloodLogic {
|
|||
* @param heroInfo
|
||||
* @return
|
||||
*/
|
||||
public CommonProto.FightTeamInfo fightDataMakeUp(Map<String ,String> heroSkills ,Map<String, FamilyHeroInfo> heroInfo,String pokmanSkill,String passiveSkill){
|
||||
return fightDataMakeUp(heroSkills, heroInfo, pokmanSkill, passiveSkill,null);
|
||||
public CommonProto.FightTeamInfo fightDataMakeUp(Map<String ,String> heroSkills ,Map<String, FamilyHeroInfo> heroInfo,String pokmanSkill,String passiveSkill,int uid) throws Exception {
|
||||
return fightDataMakeUp(heroSkills, heroInfo, pokmanSkill, passiveSkill,null,uid);
|
||||
}
|
||||
public CommonProto.FightTeamInfo fightDataMakeUp(Map<String ,String> heroSkills ,Map<String, FamilyHeroInfo> heroInfo,String pokmanSkill,String passiveSkill,Map<String,Double> remainHp){
|
||||
public CommonProto.FightTeamInfo fightDataMakeUp(Map<String ,String> heroSkills ,Map<String, FamilyHeroInfo> heroInfo,String pokmanSkill,String passiveSkill,Map<String,Double> remainHp,int uid) throws Exception {
|
||||
List<CommonProto.FightUnitInfo> heroDefendFightInfos = new ArrayList<>();
|
||||
int index=0;
|
||||
for (Map.Entry<String, FamilyHeroInfo> entry : heroInfo.entrySet()) {
|
||||
|
@ -123,10 +123,15 @@ public class BloodLogic {
|
|||
.build();
|
||||
heroDefendFightInfos.add(heroFightInfo);
|
||||
}
|
||||
List<CommonProto.FightUnitInfo> pokemonSkills = null;
|
||||
User user = UserManager.getUser(uid, true);
|
||||
if(user!=null&&!user.getPokemonManager().getPokemonTeamMap().isEmpty()){
|
||||
pokemonSkills = HeroLogic.getInstance().getPokemonSkills(UserManager.getUser(uid));
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroDefendFightInfos)
|
||||
// .addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
|
||||
.addAllPokemonUnitList(pokemonSkills)
|
||||
.setTeamPassiveList(passiveSkill)
|
||||
.build();
|
||||
}
|
||||
|
|
|
@ -647,7 +647,7 @@ public class ChampionshipLogic {
|
|||
|
||||
if (defMemberInfo.getType() == 0) {
|
||||
FamilyFightInfo fightInfo = defMemberInfo.getFightInfo();
|
||||
pvpFightEvent.setDefFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills()));
|
||||
pvpFightEvent.setDefFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills(),defUid));
|
||||
defForce = fightInfo.getForce();
|
||||
}else {
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(defUid);
|
||||
|
@ -657,7 +657,7 @@ public class ChampionshipLogic {
|
|||
}
|
||||
if (attackMemberInfo.getType() == 0) {
|
||||
FamilyFightInfo fightInfo = attackMemberInfo.getFightInfo();
|
||||
pvpFightEvent.setAttackFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills()));
|
||||
pvpFightEvent.setAttackFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills(),attackId));
|
||||
minForce = fightInfo.getForce();
|
||||
}else {
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(attackId);
|
||||
|
|
|
@ -54,7 +54,12 @@ public class AreFightPro implements EndFightProcessor {
|
|||
|
||||
|
||||
int warTime = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting().getWarTime();
|
||||
CommonProto.FightData build = CommonProto.FightData.newBuilder().setFightType(9).setHeroFightInfos(fightResult.getFightTeamInfo()).addMonsterList(fightResult.getDefFightTeamInfo()).setFightSeed(fightResult.getSeed()).setFightMaxTime(warTime).build();
|
||||
CommonProto.FightData build = CommonProto.FightData.newBuilder()
|
||||
.setFightType(9)
|
||||
.setHeroFightInfos(fightResult.getFightTeamInfo())
|
||||
.addMonsterList(fightResult.getDefFightTeamInfo())
|
||||
.setFightSeed(fightResult.getSeed())
|
||||
.setFightMaxTime(warTime).build();
|
||||
arenaRecord.setFightData(build.toByteArray());
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.CHAMPION_ARENA_RECORD,"",arenaRecord.getId(),arenaRecord);
|
||||
|
||||
|
|
|
@ -10,7 +10,15 @@ public class DefFightSnapData {
|
|||
private Map<String, String> heroSkills = new HashMap<>();
|
||||
private String pokenmonSkills;
|
||||
private String passiveSkills;
|
||||
private int uid;
|
||||
|
||||
public DefFightSnapData(Map<String, FamilyHeroInfo> heroAttribute, Map<String, String> heroSkills, String pokenmonSkills, String passiveSkills, int uid) {
|
||||
this.heroAttribute = heroAttribute;
|
||||
this.heroSkills = heroSkills;
|
||||
this.pokenmonSkills = pokenmonSkills;
|
||||
this.passiveSkills = passiveSkills;
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public DefFightSnapData(Map<String, FamilyHeroInfo> heroAttribute, Map<String, String> heroSkills, String pokenmonSkills, String passiveSkills) {
|
||||
this.heroAttribute = heroAttribute;
|
||||
|
@ -19,6 +27,15 @@ public class DefFightSnapData {
|
|||
this.passiveSkills = passiveSkills;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
|
||||
public Map<String, FamilyHeroInfo> getHeroAttribute() {
|
||||
return heroAttribute;
|
||||
}
|
||||
|
|
|
@ -54,12 +54,12 @@ public class FightUtil {
|
|||
}
|
||||
|
||||
|
||||
public static CommonProto.FightTeamInfo makeFightWithSnapData(DefFightSnapData defFightSnapData){
|
||||
return BloodLogic.getInstance().fightDataMakeUp(defFightSnapData.getHeroSkills(),defFightSnapData.getHeroAttribute(),defFightSnapData.getPokenmonSkills(),defFightSnapData.getPassiveSkills());
|
||||
public static CommonProto.FightTeamInfo makeFightWithSnapData(DefFightSnapData defFightSnapData) throws Exception {
|
||||
return BloodLogic.getInstance().fightDataMakeUp(defFightSnapData.getHeroSkills(),defFightSnapData.getHeroAttribute(),defFightSnapData.getPokenmonSkills(),defFightSnapData.getPassiveSkills(),defFightSnapData.getUid());
|
||||
}
|
||||
|
||||
public static CommonProto.FightTeamInfo makeFightBySnapDataWithDouble(DefFightSnapData defFightSnapData,Map<String, Double> attackBloodMap){
|
||||
return BloodLogic.getInstance().fightDataMakeUp(defFightSnapData.getHeroSkills(),defFightSnapData.getHeroAttribute(),defFightSnapData.getPokenmonSkills(),defFightSnapData.getPassiveSkills(),attackBloodMap);
|
||||
public static CommonProto.FightTeamInfo makeFightBySnapDataWithDouble(DefFightSnapData defFightSnapData,Map<String, Double> attackBloodMap) throws Exception {
|
||||
return BloodLogic.getInstance().fightDataMakeUp(defFightSnapData.getHeroSkills(),defFightSnapData.getHeroAttribute(),defFightSnapData.getPokenmonSkills(),defFightSnapData.getPassiveSkills(),attackBloodMap,defFightSnapData.getUid());
|
||||
}
|
||||
|
||||
|
||||
|
@ -120,7 +120,7 @@ public class FightUtil {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
public static FightResult getFightForPVP(FightEvent fightEvent,int seed){
|
||||
public static FightResult getFightForPVP(FightEvent fightEvent,int seed) throws Exception {
|
||||
int fightSeed =seed;
|
||||
PVPFightEvent pvpFightEvent = (PVPFightEvent)fightEvent;
|
||||
CommonProto.FightTeamInfo fightTeamInfo = null;
|
||||
|
@ -174,7 +174,7 @@ public class FightUtil {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
public static FightResult getFightForPVP(FightEvent fightEvent){
|
||||
public static FightResult getFightForPVP(FightEvent fightEvent) throws Exception {
|
||||
int fightSeed =getFightSeed();
|
||||
return getFightForPVP(fightEvent,fightSeed);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue