公会战战力修改

lvxinran 2019-09-26 12:56:11 +08:00
parent 494c3dbe17
commit f708a2f546
4 changed files with 20 additions and 18 deletions

View File

@ -62,7 +62,6 @@ public class BloodLogic {
teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1); teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1);
teamId = 1; teamId = 1;
} }
int force = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
Iterator<TeamPosHeroInfo> it = teamPosHeroInfos.iterator(); Iterator<TeamPosHeroInfo> it = teamPosHeroInfos.iterator();
Map<String, FamilyHeroInfo> heroAllAttribute = new HashMap<>(); Map<String, FamilyHeroInfo> heroAllAttribute = new HashMap<>();
while (it.hasNext()) { while (it.hasNext()) {
@ -75,7 +74,7 @@ public class BloodLogic {
heroAttributeMap = CombatLogic.getInstance().bufferOneHeroAttrAfterEat(heroAttributeMap,buffInfo[i]); heroAttributeMap = CombatLogic.getInstance().bufferOneHeroAttrAfterEat(heroAttributeMap,buffInfo[i]);
} }
} }
heroAllAttribute.put(heroInfo.getHeroId(), new FamilyHeroInfo(hero.getTemplateId(), hero.getLevel(), heroAttributeMap,force)); heroAllAttribute.put(heroInfo.getHeroId(), new FamilyHeroInfo(hero.getTemplateId(), hero.getLevel(), heroAttributeMap));
} }
return heroAllAttribute; return heroAllAttribute;
} }

View File

@ -8,6 +8,7 @@ public class FamilyFightInfo {
private int familyId; private int familyId;
private int buildId; private int buildId;
private int starCount; private int starCount;
private int force;
public Map<String, FamilyHeroInfo> getHeroAttribute() { public Map<String, FamilyHeroInfo> getHeroAttribute() {
return heroAttribute; return heroAttribute;
@ -48,4 +49,12 @@ public class FamilyFightInfo {
public void setStarCount(int starCount) { public void setStarCount(int starCount) {
this.starCount = starCount; this.starCount = starCount;
} }
public int getForce() {
return force;
}
public void setForce(int force) {
this.force = force;
}
} }

View File

@ -7,7 +7,6 @@ public class FamilyHeroInfo {
private int templeteId; private int templeteId;
private int level; private int level;
private Map<Integer,Integer> attribute; private Map<Integer,Integer> attribute;
private int force;
public int getTempleteId() { public int getTempleteId() {
return templeteId; return templeteId;
@ -33,19 +32,10 @@ public class FamilyHeroInfo {
this.attribute = attribute; this.attribute = attribute;
} }
public FamilyHeroInfo(int templeteId, int level, Map<Integer, Integer> attribute,int force) { public FamilyHeroInfo(int templeteId, int level, Map<Integer, Integer> attribute) {
this.templeteId = templeteId; this.templeteId = templeteId;
this.level = level; this.level = level;
this.attribute = attribute; this.attribute = attribute;
this.force = force;
}
public int getForce() {
return force;
}
public void setForce(int force) {
this.force = force;
} }
public FamilyHeroInfo() { public FamilyHeroInfo() {

View File

@ -187,20 +187,17 @@ public class GuildFightLogic {
fightInfo.addBuildBuff(buffInfo); fightInfo.addBuildBuff(buffInfo);
} }
for (Map.Entry<Integer, FamilyFightInfo> entry : fightValues.entrySet()) { for (Map.Entry<Integer, FamilyFightInfo> entry : fightValues.entrySet()) {
int force = HeroLogic.getInstance().calTeamTotalForce(UserManager.getUser(entry.getKey()), 501, false);
if(force==0){
force = HeroLogic.getInstance().calTeamTotalForce(UserManager.getUser(entry.getKey()), 1, false);
}
Family.FamilyFightPlayerInfo.Builder playerInfo = Family.FamilyFightPlayerInfo.newBuilder(); Family.FamilyFightPlayerInfo.Builder playerInfo = Family.FamilyFightPlayerInfo.newBuilder();
playerInfo.setBuildId(entry.getValue().getBuildId()); playerInfo.setBuildId(entry.getValue().getBuildId());
playerInfo.setStarCount(fightValues.get(entry.getKey()).getStarCount()); playerInfo.setStarCount(fightValues.get(entry.getKey()).getStarCount());
PlayerInfoCache player = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(entry.getKey()), PlayerInfoCache.class); PlayerInfoCache player = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(entry.getKey()), PlayerInfoCache.class);
FamilyFightInfo forceInfo = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(guildId), String.valueOf(entry.getKey()), FamilyFightInfo.class);
Family.FamilyUserInfo.Builder userInfo = Family.FamilyUserInfo.newBuilder() Family.FamilyUserInfo.Builder userInfo = Family.FamilyUserInfo.newBuilder()
.setRoleUid(entry.getKey()) .setRoleUid(entry.getKey())
.setUserName(player.getName()) .setUserName(player.getName())
.setUserLevel(player.getLevel()) .setUserLevel(player.getLevel())
.setPosition(player.getGuildPosition()) .setPosition(player.getGuildPosition())
.setSoulForce(force) .setSoulForce(forceInfo.getForce())
.setHead(player.getHead()) .setHead(player.getHead())
.setFrame(player.getHeadFrame()) .setFrame(player.getHeadFrame())
.setContribute(0); .setContribute(0);
@ -294,10 +291,17 @@ public class GuildFightLogic {
int[] buffInfo = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_BUFF, gid.toString(), entry.getValue().toString(), int[].class); int[] buffInfo = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_BUFF, gid.toString(), entry.getValue().toString(), int[].class);
FamilyFightInfo fightInfo = new FamilyFightInfo(); FamilyFightInfo fightInfo = new FamilyFightInfo();
//血量处理buff处理 //血量处理buff处理
int force = HeroLogic.getInstance().calTeamTotalForce(user, 501, false);
if(force==0){
force = HeroLogic.getInstance().calTeamTotalForce(user, 1, false);
}
Map<String, FamilyHeroInfo> heroAllAttribute = BloodLogic.getInstance().battleRecord(user, 501, buffInfo); Map<String, FamilyHeroInfo> heroAllAttribute = BloodLogic.getInstance().battleRecord(user, 501, buffInfo);
fightInfo.setHeroAttribute(heroAllAttribute); fightInfo.setHeroAttribute(heroAllAttribute);
fightInfo.setBuildId(entry.getValue()); fightInfo.setBuildId(entry.getValue());
fightInfo.setStarCount(guildSetting.getStarNum()[memberType-1]); fightInfo.setStarCount(guildSetting.getStarNum()[memberType-1]);
fightInfo.setForce(force);
redisUtil.putMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(guildInfo.getId()), String.valueOf(entry.getKey()), fightInfo); redisUtil.putMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(guildInfo.getId()), String.valueOf(entry.getKey()), fightInfo);
familyTotalStar+=fightInfo.getStarCount(); familyTotalStar+=fightInfo.getStarCount();
} }