法宝聚灵功能提交
parent
1e166894d2
commit
f8aa4e339b
|
@ -73,6 +73,7 @@ public enum FunctionIdEnum {
|
|||
FourQua(113,null),//四象心法
|
||||
Likable(114,null),//好感度
|
||||
GodSoul(116,null),//神魂
|
||||
FaBaoSoul(119,null),//法宝聚灵
|
||||
WeekGood(9091,null),
|
||||
;
|
||||
|
||||
|
|
|
@ -367,4 +367,6 @@ public interface BIReason {
|
|||
int LEVEL_UP_REWARD = 1220;// 玩家升级赠与的道具
|
||||
int PRACTICE_SKILL_UP_COST=1221;//修行技能升级消耗
|
||||
int WEEK_CARD_REWARD =1222;//周卡奖励
|
||||
|
||||
int FABAO_SOUL_UP_COST =1223;//法宝之魂升级消耗
|
||||
}
|
|
@ -193,6 +193,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
int randomCount =SLotterySpecialConfig.getLotteryListByDifferentType(7).iterator().next().getCount()- user.getHeroManager().getRandomPoolByType().getOrDefault(11,new HashMap<>()).getOrDefault(7,0);
|
||||
StoreLogic.reloadStoreInfo(user,7);//重载功能商店
|
||||
List<CommonProto.PracticeSkillInfo>practiceSkillInfos=getPracticeSkillInfos(heroManager);
|
||||
List<CommonProto.FaBaoSoulInfo>faBaoSoulInfos=getFaBaoSoulInfos(heroManager);
|
||||
// 开服时间戳
|
||||
long openTime = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime());
|
||||
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
|
||||
|
@ -242,6 +243,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.setServerOpenTime((int) (openTime / 1000))
|
||||
.setXiuweiLevel(heroManager.getXiuweiLevel())
|
||||
.addAllPracticeSkillInfos(practiceSkillInfos)
|
||||
.addAllFaBaoSoulInfos(faBaoSoulInfos)
|
||||
.build();
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.APP_LOGIN.getType());
|
||||
try {
|
||||
|
@ -309,6 +311,11 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
return sixiangxinfaInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化修行技能数据
|
||||
* @param heroManager
|
||||
* @return
|
||||
*/
|
||||
private List<CommonProto.PracticeSkillInfo> getPracticeSkillInfos(HeroManager heroManager) {
|
||||
List<CommonProto.PracticeSkillInfo>practiceSkillInfos=new ArrayList<>(heroManager.getPracticeSkillMap().size());
|
||||
for (Map.Entry<Integer, Integer> entry : heroManager.getPracticeSkillMap().entrySet()) {
|
||||
|
@ -321,6 +328,23 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
return practiceSkillInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化法宝之魂数据
|
||||
* @param heroManager
|
||||
* @return
|
||||
*/
|
||||
private List<CommonProto.FaBaoSoulInfo> getFaBaoSoulInfos(HeroManager heroManager) {
|
||||
List<CommonProto.FaBaoSoulInfo>faBaoSoulInfos=new ArrayList<>(heroManager.getFaBaoSoulMap().size());
|
||||
for (Map.Entry<Integer, Integer> entry : heroManager.getFaBaoSoulMap().entrySet()) {
|
||||
CommonProto.FaBaoSoulInfo faBaoInfo=CommonProto.FaBaoSoulInfo.newBuilder()
|
||||
.setId(entry.getKey())
|
||||
.setLevel(entry.getValue())
|
||||
.build();
|
||||
faBaoSoulInfos.add(faBaoInfo);
|
||||
}
|
||||
return faBaoSoulInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化英雄星级map(针对老号)
|
||||
* @param user
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UserMainTeamForceEvent;
|
||||
import com.ljsd.jieling.logic.dao.HeroManager;
|
||||
import com.ljsd.jieling.logic.dao.SixiangProfessionInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SFourQuadrantConfig;
|
||||
import config.STrump;
|
||||
import config.STrumpBook;
|
||||
import config.STrumpLevelupPool;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class FaBaoSoulUpLvRequestHandler extends BaseHandler<HeroInfoProto.FaBaoSoulUpLvRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.FA_BAO_SOUL_UPLV_REQUEST;
|
||||
}
|
||||
|
||||
//法宝之魂强化消息
|
||||
@Override
|
||||
public void processWithProto(ISession session, HeroInfoProto.FaBaoSoulUpLvRequest proto) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
int faBaoId=proto.getId();
|
||||
int faBaoLv=proto.getLevel();
|
||||
STrump trumpConfig=STrump.sTrumpMap.get(faBaoId);
|
||||
if (faBaoLv> trumpConfig.getLvMax()) {
|
||||
LOGGER.error("法宝之魂强化等级已达上限");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
int[][]costArr=new int[1][2];
|
||||
int costLv=faBaoLv-1;
|
||||
costArr[0][0]=trumpConfig.getLvupCostItem();
|
||||
costArr[0][1]=STrumpLevelupPool.levelPoolMap.get(trumpConfig.getLvupPool()).get(costLv).getLvupCostItemNum();
|
||||
boolean costResult = ItemUtil.itemCost(user,costArr, BIReason.FABAO_SOUL_UP_COST,faBaoId);
|
||||
if (!costResult) {
|
||||
LOGGER.error("法宝之魂强化材料不足");
|
||||
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||
}
|
||||
user.getHeroManager().putFaBaoSoulMap(faBaoId,faBaoLv);
|
||||
this.updateFaBaoGongMingLv(user,trumpConfig.getBookId());
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.FA_BAO_SOUL_UPLV_RESPONSE_VALUE,null,true);
|
||||
}
|
||||
|
||||
private void updateFaBaoGongMingLv(User user,int bookId){
|
||||
STrumpBook sTrumpBook=STrumpBook.sTrumpBookMap.get(bookId);
|
||||
int[]trumpList=sTrumpBook.getTrumpList();
|
||||
int gongmingLv=0;
|
||||
for (int trumpId : trumpList) {
|
||||
if (!user.getHeroManager().getFaBaoSoulMap().containsKey(trumpId)) {
|
||||
return;
|
||||
}
|
||||
if (gongmingLv==0){
|
||||
gongmingLv=user.getHeroManager().getFaBaoSoulMap().get(trumpId);
|
||||
}
|
||||
if (user.getHeroManager().getFaBaoSoulMap().get(trumpId)<gongmingLv){
|
||||
gongmingLv=user.getHeroManager().getFaBaoSoulMap().get(trumpId);
|
||||
}
|
||||
}
|
||||
int skillId=sTrumpBook.getSkillList()[gongmingLv-1][1];
|
||||
user.getHeroManager().putFaBaoGongMingSkillMap(bookId,skillId);
|
||||
}
|
||||
}
|
|
@ -150,6 +150,19 @@ public class HeroManager extends MongoBase {
|
|||
private int likableSendTime;//好感度已赠送次数
|
||||
|
||||
public int getLikableSendTime() { return likableSendTime; }
|
||||
|
||||
private Map<Integer,Integer>faBaoSoulMap= new HashMap<>();//法宝之魂数据
|
||||
|
||||
public Map<Integer, Integer> getFaBaoSoulMap() {
|
||||
return faBaoSoulMap;
|
||||
}
|
||||
|
||||
private Map<Integer,Integer>faBaoGongMingSkillMap= new HashMap<>();//法宝之魂共鸣数据<法宝组合id:技能id>
|
||||
|
||||
public Map<Integer, Integer> getFaBaoGongMingSkillMap() {
|
||||
return faBaoGongMingSkillMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 心愿可以选择的英雄列表
|
||||
*/
|
||||
|
@ -202,7 +215,17 @@ public class HeroManager extends MongoBase {
|
|||
updateString("heroLikableMap."+heroStaticId, likableNum);
|
||||
}
|
||||
|
||||
public void putHeroLikablePropAddMap(int heroStaticId,Map<Integer,Integer> _propMap) {
|
||||
public void putFaBaoSoulMap(int fabaoId,int fabaoLv) {
|
||||
faBaoSoulMap.put(fabaoId,fabaoLv);
|
||||
updateString("faBaoSoulMap."+fabaoId, fabaoLv);
|
||||
}
|
||||
|
||||
public void putFaBaoGongMingSkillMap(int bookId,int skillId) {
|
||||
faBaoGongMingSkillMap.put(bookId,skillId);
|
||||
updateString("faBaoGongMingSkillMap."+bookId, skillId);
|
||||
}
|
||||
|
||||
public void putHeroLikablePropAddMap(int heroStaticId, Map<Integer,Integer> _propMap) {
|
||||
heroLikablePropAddMap.put(heroStaticId,_propMap);
|
||||
updateString("heroLikablePropAddMap."+heroStaticId, _propMap);
|
||||
}
|
||||
|
|
|
@ -1978,6 +1978,11 @@ public class HeroLogic {
|
|||
List<Integer> godSoulSkills = GetGodSoulSkill(hero.getTemplateId(), hero.getGodSoulLv());
|
||||
skillList.addAll(godSoulSkills);
|
||||
}
|
||||
if (user.getHeroManager().getFaBaoGongMingSkillMap().size()>0) {
|
||||
List<Integer> faBaoSoulSkills=new ArrayList<>(user.getHeroManager().getFaBaoGongMingSkillMap().values());
|
||||
skillList.addAll(faBaoSoulSkills);
|
||||
}
|
||||
|
||||
return skillList;
|
||||
}
|
||||
|
||||
|
@ -2592,6 +2597,13 @@ public class HeroLogic {
|
|||
combinedAttribute(allLikableProp, heroAllAttribute);
|
||||
}
|
||||
|
||||
///法宝之魂属性加成
|
||||
for (Map.Entry<Integer, Integer> faBaoSoulEntry : user.getHeroManager().getFaBaoSoulMap().entrySet()) {
|
||||
STrump trumpConfig=STrump.sTrumpMap.get(faBaoSoulEntry.getKey());
|
||||
STrumpLevelupPool lvUpProps=STrumpLevelupPool.levelPoolMap.get(trumpConfig.getLvupPool()).get(faBaoSoulEntry.getValue());
|
||||
combinedAttribute(lvUpProps.getLvupProps(), heroAllAttribute);
|
||||
}
|
||||
|
||||
//装备总战力评分
|
||||
int equipForce = 0;
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator = hero.getEquipByHongmengPositionMap(user.getHeroManager()).entrySet().iterator();
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="Trump")
|
||||
public class STrump implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int lvupCostItem;
|
||||
|
||||
private int lvupPool;
|
||||
|
||||
private int lvMax;
|
||||
|
||||
private int xiuxianLimit;
|
||||
|
||||
private int bookId;
|
||||
|
||||
public static Map<Integer, STrump> sTrumpMap;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sTrumpMap=new HashMap<>();
|
||||
sTrumpMap = STableManager.getConfig(STrump.class);
|
||||
}
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getLvupCostItem() {
|
||||
return lvupCostItem;
|
||||
}
|
||||
|
||||
public int getLvupPool() {
|
||||
return lvupPool;
|
||||
}
|
||||
|
||||
public int getLvMax() {
|
||||
return lvMax;
|
||||
}
|
||||
|
||||
public int getXiuxianLimit() {
|
||||
return xiuxianLimit;
|
||||
}
|
||||
|
||||
public int getBookId() {
|
||||
return bookId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="TrumpBook")
|
||||
public class STrumpBook implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int[] trumpList;
|
||||
|
||||
private int[][] skillList;
|
||||
|
||||
public static Map<Integer, STrumpBook> sTrumpBookMap;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sTrumpBookMap=new HashMap<>();
|
||||
sTrumpBookMap = STableManager.getConfig(STrumpBook.class);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int[] getTrumpList() {
|
||||
return trumpList;
|
||||
}
|
||||
|
||||
public int[][] getSkillList() {
|
||||
return skillList;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="TrumpLevelupPool")
|
||||
public class STrumpLevelupPool implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int poolId;
|
||||
|
||||
private int level;
|
||||
|
||||
private int lvupCostItemNum;
|
||||
|
||||
private int[][] lvupProps;
|
||||
|
||||
public static Map<Integer, STrumpLevelupPool> sTrumpLevelupPoolMap;
|
||||
public static Map<Integer, Map<Integer,STrumpLevelupPool>> levelPoolMap;//<升级库:<等级:表数据>>
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sTrumpLevelupPoolMap=new HashMap<>();
|
||||
levelPoolMap=new HashMap<>();
|
||||
sTrumpLevelupPoolMap = STableManager.getConfig(STrumpLevelupPool.class);
|
||||
for (Map.Entry<Integer, STrumpLevelupPool> entry : sTrumpLevelupPoolMap.entrySet()) {
|
||||
STrumpLevelupPool sTrumpLevelupPool=entry.getValue();
|
||||
if (!levelPoolMap.containsKey(entry.getValue().getPoolId())){
|
||||
Map<Integer,STrumpLevelupPool>poolMap=new HashMap<>();
|
||||
levelPoolMap.put(sTrumpLevelupPool.getPoolId(),poolMap);
|
||||
}
|
||||
levelPoolMap.get(sTrumpLevelupPool.getPoolId()).put(sTrumpLevelupPool.getLevel(),sTrumpLevelupPool);
|
||||
}
|
||||
}
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getPoolId() {
|
||||
return poolId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int getLvupCostItemNum() {
|
||||
return lvupCostItemNum;
|
||||
}
|
||||
|
||||
public int[][] getLvupProps() {
|
||||
return lvupProps;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue