踏碎凌霄阵容保存
parent
ea35f92275
commit
f53c48e0b0
|
@ -13,12 +13,11 @@ import com.ljsd.jieling.ktbeans.ReportUtil;
|
|||
import com.ljsd.jieling.logic.activity.event.GoldRefreshEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.TaSuiLingXiaoEvent;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
|
@ -35,6 +34,7 @@ import rpc.protocols.MessageTypeProto;
|
|||
import rpc.protocols.CommonProto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -140,7 +140,14 @@ public class TasuilingxiaoHandler extends BaseHandler<ActivityProto.Tasuilingxia
|
|||
if(score==-1||score<lessBlood){
|
||||
List<TeamPosHeroInfo> teamPosForHero = user.getTeamPosManager().getTeamPosForHero().get(1);
|
||||
if(teamPosForHero!=null&&teamPosForHero.size()>0){
|
||||
|
||||
Map<Integer, TaSuiHero> heroMap = new HashMap<>();
|
||||
for(TeamPosHeroInfo hero:teamPosForHero){
|
||||
Hero myHero = user.getHeroManager().getHero(hero.getHeroId());
|
||||
TaSuiHero taSuiHero = new TaSuiHero(myHero.getTemplateId(),myHero.getOriginalLevel(),myHero.getStar());
|
||||
heroMap.put(hero.getPosition(),taSuiHero);
|
||||
}
|
||||
user.getHeroManager().setTaSuiHeroMap(heroMap);
|
||||
user.getHeroManager().setTaSuiLingXiaoRankForce(HeroLogic.getInstance().calTeamTotalForce(user,1,true));
|
||||
}
|
||||
rank.addRank(uid,String.valueOf(proto.getActivityId()),lessBlood);
|
||||
}
|
||||
|
|
|
@ -318,5 +318,24 @@ public class HeroManager extends MongoBase {
|
|||
purpleMansionSeal.put(seal.getSealId(),seal);
|
||||
updateString("purpleMansionSeal", purpleMansionSeal);
|
||||
}
|
||||
|
||||
public int getTaSuiLingXiaoRankForce() {
|
||||
return taSuiLingXiaoRankForce;
|
||||
}
|
||||
|
||||
public Map<Integer, TaSuiHero> getTaSuiHeroMap() {
|
||||
return taSuiHeroMap;
|
||||
}
|
||||
|
||||
public void setTaSuiHeroMap(Map<Integer, TaSuiHero> taSuiHeroMap) {
|
||||
this.taSuiHeroMap = taSuiHeroMap;
|
||||
updateString("taSuiHeroMap", taSuiHeroMap);
|
||||
}
|
||||
|
||||
public void setTaSuiLingXiaoRankForce(int taSuiLingXiaoRankForce) {
|
||||
this.taSuiLingXiaoRankForce = taSuiLingXiaoRankForce;
|
||||
updateString("taSuiLingXiaoRankForce", taSuiLingXiaoRankForce);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,4 +24,10 @@ public class TaSuiHero {
|
|||
public int getStar() {
|
||||
return star;
|
||||
}
|
||||
|
||||
public TaSuiHero(int tempId, int leve, int star) {
|
||||
this.tempId = tempId;
|
||||
this.leve = leve;
|
||||
this.star = star;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -488,7 +488,7 @@ public class PlayerLogic {
|
|||
case 3:
|
||||
Long time3 = null;
|
||||
if(decorationId == 0){
|
||||
time3 = new Long(0);
|
||||
time3 = 0L;
|
||||
}else{
|
||||
time3 = user.getPlayerInfoManager().getUserMountValidTime().get(decorationId);
|
||||
}
|
||||
|
@ -533,24 +533,31 @@ public class PlayerLogic {
|
|||
teamInfo.setTotalForce(HeroLogic.getInstance().calTeamTotalForce(user,teamId,false));
|
||||
|
||||
if(teamId==GlobalsDef.TASUILINGXIAO_CHALLENGE){
|
||||
Map<Integer, TaSuiHero> taSuiHeroMap = user.getHeroManager().getTaSuiHeroMap();
|
||||
for(Map.Entry<Integer,TaSuiHero> entry:taSuiHeroMap.entrySet()){
|
||||
TaSuiHero hero = entry.getValue();
|
||||
CommonProto.TeamSimpleInfo info = CommonProto.TeamSimpleInfo.newBuilder().setHeroTid(hero.getTempId()).setLevel(hero.getLeve()).setStar(hero.getStar()).setPosition(entry.getKey()).build();
|
||||
teamInfo.addTeam(info);
|
||||
}
|
||||
teamInfo.setTotalForce(user.getHeroManager().getTaSuiLingXiaoRankForce());
|
||||
|
||||
}else{
|
||||
if(teamPosManager.getTeamPosForHero().containsKey(teamId)){
|
||||
// 添加队伍信息
|
||||
List<TeamPosHeroInfo> heroInfos = teamPosManager.getTeamPosForHero().get(teamId);
|
||||
for (TeamPosHeroInfo heroInfo:heroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
|
||||
teamInfo.addTeam(CBean2Proto.getSimpleTeamInfoByHero(user, hero,heroInfo.getPosition()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(teamPosManager.getTeamPosForHero().containsKey(teamId)){
|
||||
// 添加队伍信息
|
||||
List<TeamPosHeroInfo> heroInfos = teamPosManager.getTeamPosForHero().get(teamId);
|
||||
for (TeamPosHeroInfo heroInfo:heroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
|
||||
teamInfo.addTeam(CBean2Proto.getSimpleTeamInfoByHero(user, hero,heroInfo.getPosition()));
|
||||
// 紫府神印
|
||||
List<String> collect = heroInfos.stream().map(TeamPosHeroInfo::getHeroId).collect(Collectors.toList());
|
||||
teamInfo.addAllSealShow(CBean2Proto.getPurpleSealShow(user,collect));
|
||||
}
|
||||
|
||||
// 紫府神印
|
||||
List<String> collect = heroInfos.stream().map(TeamPosHeroInfo::getHeroId).collect(Collectors.toList());
|
||||
teamInfo.addAllSealShow(CBean2Proto.getPurpleSealShow(user,collect));
|
||||
}
|
||||
|
||||
|
||||
//加入灵兽信息
|
||||
PokemonManager pokemonManager = user.getPokemonManager();
|
||||
if(!pokemonManager.getPokemonTeamMap().isEmpty()){
|
||||
|
|
Loading…
Reference in New Issue