语序论道修改补充

master_zzxx
grimm 2024-06-20 17:35:37 +08:00
parent f41cc0d164
commit 669fe9d91d
3 changed files with 58 additions and 58 deletions

View File

@ -33,9 +33,9 @@ public class ViewHeroInfoHandler extends BaseHandler<PlayerInfoProto.ViewHeroInf
if(sArenaRobotConfig != null){
viewHeroInfoResponse = PlayerLogic.getInstance().viewRobotHeroInfo(sArenaRobotConfig, heroId, teamId);
}
else if(TeamEnum.isYuxuTeam(teamId)){
viewHeroInfoResponse = PlayerLogic.getInstance().viewYuxuHeroInfo(targetUid, heroId);
}
// else if(TeamEnum.isYuxuTeam(teamId)){
// viewHeroInfoResponse = PlayerLogic.getInstance().viewYuxuHeroInfo(targetUid, heroId);
// }
else {
viewHeroInfoResponse = PlayerLogic.getInstance().viewHeroInfo(targetUid, heroId, 1);
}

View File

@ -133,13 +133,13 @@ public class HeroLogic {
pokemonTemplate.add(HeroAttributeEnum.CureFacter.getPropertyId()); // 受治疗
}
Map<Integer, Hero> yuxuHeros = new HashMap<>();
// Map<Integer, Hero> yuxuHeros = new HashMap<>();
public HeroLogic() {
//英雄事件监听
Poster.getPoster().listenEvent(new HeroFiveStarGetEventHandler(), HeroFiveStarGetEvent.class);
Poster.getPoster().listenEvent(new PokemonFiveStarGetEventHandler(), PokemonFiveStarGetEvent.class);
this.initYuxuHero();
// this.initYuxuHero();
}
public static HeroLogic getInstance() {
@ -1257,10 +1257,10 @@ public class HeroLogic {
if (trueHero == null) {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
Hero hero = this.getYuHero(trueHero.getTemplateId());
if (hero == null) {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
// Hero hero = this.getYuHero(trueHero.getTemplateId());
// if (hero == null) {
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
// }
}
heroIds.forEach(heroId -> set.add(heroManager.getHero(heroId.getHeroId()).getTemplateId()));
}
@ -6785,12 +6785,12 @@ public class HeroLogic {
/**
*
*/
private void initYuxuHero() {
for (Map.Entry<Integer, SEndlessHeroProp> entry : STableManager.getConfig(SEndlessHeroProp.class).entrySet()) {
Hero hero = new Hero(entry.getKey(), -1);
yuxuHeros.put(hero.getTemplateId(), hero);
}
}
// private void initYuxuHero() {
// for (Map.Entry<Integer, SEndlessHeroProp> entry : STableManager.getConfig(SEndlessHeroProp.class).entrySet()) {
// Hero hero = new Hero(entry.getKey(), -1);
// yuxuHeros.put(hero.getTemplateId(), hero);
// }
// }
/**
* id
@ -6798,12 +6798,12 @@ public class HeroLogic {
* @param heroTemplateId
* @return
*/
public Hero getYuHero(int heroTemplateId) {
if (this.yuxuHeros.containsKey(heroTemplateId)) {
return yuxuHeros.get(heroTemplateId);
}
return null;
}
// public Hero getYuHero(int heroTemplateId) {
// if (this.yuxuHeros.containsKey(heroTemplateId)) {
// return yuxuHeros.get(heroTemplateId);
// }
// return null;
// }
/**
* , ,

View File

@ -850,19 +850,19 @@ public class PlayerLogic {
continue;
}
//玉虚取通用属性
Hero yuxuHero = HeroLogic.getInstance().getYuHero(hero.getTemplateId());
if(yuxuHero == null){
continue;
}
// Hero yuxuHero = HeroLogic.getInstance().getYuHero(hero.getTemplateId());
// if(yuxuHero == null){
// continue;
// }
teamOneTeamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder()
.setHeroid(hero.getId())
.setHeroTid(hero.getTemplateId())
.setLevel(yuxuHero.getLevel(user))
.setStar(yuxuHero.getStar())
.setLevel(hero.getLevel(user))
.setStar(hero.getStar())
.setPosition(heroInfo.getPosition())
.setSkinId(hero.getSkin())
.setGodSoulLv(yuxuHero.getGodSoulLv())
.setPropertyId(yuxuHero.getPropertyId())
.setGodSoulLv(hero.getGodSoulLv())
.setPropertyId(hero.getPropertyId())
.build());
}
}
@ -1447,35 +1447,35 @@ public class PlayerLogic {
/**
*
*/
public PlayerInfoProto.ViewHeroInfoResponse viewYuxuHeroInfo(int uid,String heroId) throws Exception {
User userInMem = UserManager.getUserNotCache(uid);
if(userInMem == null){
throw new ErrorCodeException(ErrorCode.FRIENDS_USER_NULL);
}
Hero hero = userInMem.getHeroManager().getHeroMap().get(heroId);
if(hero == null){
throw new ErrorCodeException(ErrorCode.newDefineCode("hero no"));
}
Hero yuxuHero = HeroLogic.getInstance().getYuHero(hero.getTemplateId());
if(yuxuHero == null){
throw new ErrorCodeException(ErrorCode.newDefineCode("hero no"));
}
Map<Integer, SEndlessHeroProp> config = STableManager.getConfig(SEndlessHeroProp.class);
SEndlessHeroProp sEndlessHeroProp = config.get(hero.getTemplateId());
Map<Integer, Long> heroAttributeMap = new HashMap<>();
for (int[] prop : sEndlessHeroProp.getProps()) {
heroAttributeMap.put(prop[0], (long) prop[1]);
}
PlayerInfoProto.ViewHeroInfoResponse.Builder builder = PlayerInfoProto.ViewHeroInfoResponse.newBuilder();
for(Map.Entry<Integer,Long> item : heroAttributeMap.entrySet()){
builder.addSpecialEffects(CommonProto.SpecialEffects.newBuilder().setPropertyId(item.getKey()).setPropertyValue(item.getValue().intValue()).build());
}
builder.setForce(HeroLogic.getInstance().calForce(heroAttributeMap));
builder.setHero(CBean2Proto.getYuxuHero(yuxuHero));
//公会等级统一为0
builder.setGuildSkill(0);
return builder.build();
}
// public PlayerInfoProto.ViewHeroInfoResponse viewYuxuHeroInfo(int uid,String heroId) throws Exception {
// User userInMem = UserManager.getUserNotCache(uid);
// if(userInMem == null){
// throw new ErrorCodeException(ErrorCode.FRIENDS_USER_NULL);
// }
// Hero hero = userInMem.getHeroManager().getHeroMap().get(heroId);
// if(hero == null){
// throw new ErrorCodeException(ErrorCode.newDefineCode("hero no"));
// }
// Hero yuxuHero = HeroLogic.getInstance().getYuHero(hero.getTemplateId());
// if(yuxuHero == null){
// throw new ErrorCodeException(ErrorCode.newDefineCode("hero no"));
// }
// Map<Integer, SEndlessHeroProp> config = STableManager.getConfig(SEndlessHeroProp.class);
// SEndlessHeroProp sEndlessHeroProp = config.get(hero.getTemplateId());
// Map<Integer, Long> heroAttributeMap = new HashMap<>();
// for (int[] prop : sEndlessHeroProp.getProps()) {
// heroAttributeMap.put(prop[0], (long) prop[1]);
// }
// PlayerInfoProto.ViewHeroInfoResponse.Builder builder = PlayerInfoProto.ViewHeroInfoResponse.newBuilder();
// for(Map.Entry<Integer,Long> item : heroAttributeMap.entrySet()){
// builder.addSpecialEffects(CommonProto.SpecialEffects.newBuilder().setPropertyId(item.getKey()).setPropertyValue(item.getValue().intValue()).build());
// }
// builder.setForce(HeroLogic.getInstance().calForce(heroAttributeMap));
// builder.setHero(CBean2Proto.getYuxuHero(yuxuHero));
// //公会等级统一为0
// builder.setGuildSkill(0);
// return builder.build();
// }
/**
*