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