diff --git a/serverlogic/src/main/java/com/ljsd/jieling/core/FunctionIdEnum.java b/serverlogic/src/main/java/com/ljsd/jieling/core/FunctionIdEnum.java index 3697fabca..970798c9a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/core/FunctionIdEnum.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/core/FunctionIdEnum.java @@ -81,6 +81,7 @@ public enum FunctionIdEnum { GemNewAdvanced(145, null),//命格新-高级 Assist(152,null),//助阵 WeekGood(9091,null), + PlayerGodTowerChallenge(159,null),//主角神塔(三队) ; private int functionType; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/core/VipPrivilegeType.java b/serverlogic/src/main/java/com/ljsd/jieling/core/VipPrivilegeType.java index d2b3f4e1c..b0e6f3e2f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/core/VipPrivilegeType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/core/VipPrivilegeType.java @@ -35,6 +35,8 @@ public interface VipPrivilegeType { int DUODUI_TWO_BUY = 43;//双队探索每日购买次数提升至%s int DUODUI_THREE_FREE = 40;//三队探索每日免费次数提升至%s int DUODUI_THREE_BUY = 41;//三队探索每日购买次数提升至%s + int PLAYER_GOD_TOWER_FREE = 10001;//主角神塔探索每日免费次数提升至%s + int PLAYER_GOD_TOWER_BUY = 10002;//主角神塔探索每日购买次数提升至%s //功能项解锁 int UNLOCK_TWO_FIGHT = 501;//解锁2倍速战斗 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java b/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java index 729064c39..8223e06ad 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java @@ -474,4 +474,6 @@ public interface BIReason { int TRAINGING_SPEED_ITEM_COST = 1358;//特训加速道具消耗 int YUXU_DEAL = 1359;//玉虚奖励修正 + + int PLAYER_GOD_MERIDIANS_LEVEL = 1360;//主角六道神脉升级 } \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java index 75d747fac..9c698e5f8 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java @@ -257,6 +257,9 @@ public class GetPlayerInfoHandler extends BaseHandler{ .addAllGiftIds(user.getPlayerInfoManager().getPlayerGiftEquipList()) .addAllGemLotteryCountByDay(EquipLogic.getInstance().getGemLotteryCountByDay(userId)) .setIsStart(PlayerLogic.getCrossStartWeek()) + .setPlayerGodLevel(playerInfoManager.getPlayerGodLevel()) + .setPlayerGodTowerNum(playerInfoManager.getPlayerGodTowerNum()) + .addAllPlayerMeridiansLevel(playerInfoManager.getAllPlayerGodMeridiansLevels()) .build(); try { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/playerGod/PlayerGodLevelUpRequestHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/playerGod/PlayerGodLevelUpRequestHandler.java new file mode 100644 index 000000000..3d5779c40 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/playerGod/PlayerGodLevelUpRequestHandler.java @@ -0,0 +1,41 @@ +package com.ljsd.jieling.handler.playerGod; + +import com.ljsd.jieling.core.FunctionIdEnum; +import com.ljsd.jieling.exception.ErrorCode; +import com.ljsd.jieling.exception.ErrorCodeException; +import com.ljsd.jieling.handler.BaseHandler; +import com.ljsd.jieling.logic.GlobleSystemLogic; +import com.ljsd.jieling.logic.activity.event.Poster; +import com.ljsd.jieling.logic.activity.event.SaveHeroForceEvent; +import com.ljsd.jieling.logic.dao.Hero; +import com.ljsd.jieling.logic.dao.HeroManager; +import com.ljsd.jieling.logic.dao.UserManager; +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.logic.hero.HeroLogic; +import com.ljsd.jieling.logic.playerGod.PlayerGodLogic; +import com.ljsd.jieling.network.session.ISession; +import com.ljsd.jieling.util.MessageUtil; +import config.SCHero; +import config.SGlobalSystemConfig; +import manager.STableManager; +import rpc.protocols.PlayerInfoProto; +import rpc.protocols.MessageTypeProto; + +import java.util.List; + +/** + * 主角成神神脉升级协议处理 + */ +public class PlayerGodLevelUpRequestHandler extends BaseHandler { + + @Override + public MessageTypeProto.MessageType getMessageCode() { + return MessageTypeProto.MessageType.PlayerGodLevelUpRequest; + } + + //主角成神神脉升级绑定协议 + @Override + public void processWithProto(ISession session, PlayerInfoProto.PlayerGodLevelUpRequest proto) throws Exception { + PlayerGodLogic.getInstance().levelUpPlayerGodLevel(session); + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/playerGod/PlayerMeridiansLevelUpRequestHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/playerGod/PlayerMeridiansLevelUpRequestHandler.java new file mode 100644 index 000000000..fe907707b --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/playerGod/PlayerMeridiansLevelUpRequestHandler.java @@ -0,0 +1,41 @@ +package com.ljsd.jieling.handler.playerGod; + +import com.ljsd.jieling.core.FunctionIdEnum; +import com.ljsd.jieling.exception.ErrorCode; +import com.ljsd.jieling.exception.ErrorCodeException; +import com.ljsd.jieling.handler.BaseHandler; +import com.ljsd.jieling.logic.GlobleSystemLogic; +import com.ljsd.jieling.logic.activity.event.Poster; +import com.ljsd.jieling.logic.activity.event.SaveHeroForceEvent; +import com.ljsd.jieling.logic.dao.Hero; +import com.ljsd.jieling.logic.dao.HeroManager; +import com.ljsd.jieling.logic.dao.UserManager; +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.logic.hero.HeroLogic; +import com.ljsd.jieling.logic.playerGod.PlayerGodLogic; +import com.ljsd.jieling.network.session.ISession; +import com.ljsd.jieling.util.MessageUtil; +import config.SCHero; +import config.SGlobalSystemConfig; +import manager.STableManager; +import rpc.protocols.PlayerInfoProto; +import rpc.protocols.MessageTypeProto; + +import java.util.List; + +/** + * 主角成神神脉升级协议处理 + */ +public class PlayerMeridiansLevelUpRequestHandler extends BaseHandler { + + @Override + public MessageTypeProto.MessageType getMessageCode() { + return MessageTypeProto.MessageType.PlayerMeridiansLevelUpRequest; + } + + //主角成神神脉升级绑定协议 + @Override + public void processWithProto(ISession session, PlayerInfoProto.PlayerMeridiansLevelUpRequest proto) throws Exception { + PlayerGodLogic.getInstance().levelUpPlayerMeridiansLevel(session,proto.getType()); + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityType.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityType.java index c7d19f610..e677470f8 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityType.java @@ -162,4 +162,6 @@ public interface ActivityType { int FENGSHEN_TREASURE_THREE = 116;//三队封神 int EVERY_DAY_DISCOUNT = 126;//天天0.1折扣 int FABAO_JULING_GIFT = 20019;//法宝聚灵礼包 + + int PLAYER_GOD_GIFT = 20020;//法宝聚灵礼包 } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityTypeEnum.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityTypeEnum.java index 0435317e4..ec23bb613 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityTypeEnum.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityTypeEnum.java @@ -124,6 +124,7 @@ public enum ActivityTypeEnum { ADVANCED_GEM_CHEST(ActivityType.ADVANCED_GEM_CHEST, GemChestActivity::new),//高级命石宝箱 BAUBLES_SUMMON_GIFT(ActivityType.BAUBLES_SUMMON_GIFT, DefaultEmptyActivity::new),//法宝召唤礼包 FABAO_JULING_GIFT(ActivityType.FABAO_JULING_GIFT, DefaultEmptyActivity::new),//法宝聚灵礼包 + PLAYER_GOD_GIFT(ActivityType.PLAYER_GOD_GIFT, DefaultEmptyActivity::new),//主角成神礼包 BAUBLES_BOOK(ActivityType.BAUBLES_BOOK, BaublesBookNumActivity::new),//法宝图鉴,专武活动 /****************************************************** bt **********************************************************/ diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/CumulationData.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/CumulationData.java index d503d69a7..0ae2e7dff 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/CumulationData.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/CumulationData.java @@ -270,6 +270,7 @@ public class CumulationData { private int yuxuLv;//玉虚论道段位 private int accumulativeRechargeNum;// 累计充值金额 private int fabaojulingNum;//法宝聚灵召唤 + private Map missionIntDatas = new HashMap<>();//所有的int计数类任务统计,后续我所有的统计均在该字段扩充,放置该类字段越来越多 public Result updateData(MissionType missionType, Object...parm) throws Exception { return DataManagerDistributor.updateData(this, missionType,parm); @@ -763,4 +764,29 @@ public class CumulationData { public void setFabaojulingNum(int fabaojulingNum) { this.fabaojulingNum = fabaojulingNum; } + + public Map getMissionIntDatas() { + return missionIntDatas; + } + + public void setMissionIntDatas(Map missionIntDatas) { + this.missionIntDatas = missionIntDatas; + } + + public void setMissionIntData(int missionType,int midddsionData){ + if(this.missionIntDatas == null){ + this.missionIntDatas = new HashMap<>(); + } + this.missionIntDatas.put(missionType,midddsionData); + } + + public int getMissionIntData(int missionType){ + if(this.missionIntDatas == null){ + this.missionIntDatas = new HashMap<>(); + } + if(this.missionIntDatas.containsKey(missionType)){ + return missionIntDatas.get(missionType); + } + return 0; + } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PlayerManager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PlayerManager.java index d4bd34346..45ab2aab7 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PlayerManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PlayerManager.java @@ -238,6 +238,10 @@ public class PlayerManager extends MongoBase { return desireDraw; } + public int playerGodTowerNum;//主角神觉塔层数 + public int playerGodLevel;//主角成神阶数(1半神2神3神王) + public Map playerGodMeridiansLevels = new HashMap();//主角六道神脉等级 + public void putDesireDraw(int type, int tempId) { this.desireDraw.put(type, tempId); updateString("desireDraw", desireDraw); @@ -1551,4 +1555,83 @@ public class PlayerManager extends MongoBase { updateString("trainingArchitectureMap", this.trainingArchitectureMap); } + public int getPlayerGodTowerNum() { + int num = 0; + //主角神塔类型为3 + int[] tower = this.getDuoduiTower(3); + if(tower != null && tower.length > 0){ + num = tower[0]; + } + return num; + } + + public void setPlayerGodTowerNum(int playerGodTowerNum) { + this.playerGodTowerNum = playerGodTowerNum; + updateString("playerGodTowerNum", this.playerGodTowerNum); + } + + public int getPlayerGodLevel() { + return playerGodLevel; + } + + public void setPlayerGodLevel(int playerGodLevel) { + this.playerGodLevel = playerGodLevel; + updateString("playerGodLevel", this.playerGodLevel); + } + + public Map getPlayerGodMeridiansLevels() { + return playerGodMeridiansLevels; + } + + public void setPlayerGodMeridiansLevels(Map playerGodMeridiansLevels) { + if(this.playerGodMeridiansLevels == null){ + this.playerGodMeridiansLevels = new HashMap(); + } + if(playerGodMeridiansLevels != null){ + this.playerGodMeridiansLevels = playerGodMeridiansLevels; + updateString("playerGodMeridiansLevels", this.playerGodMeridiansLevels); + } + } + + /** + * 设置主角某条神脉等级 + * @param type + * @param level + */ + public void setPlayerGodMeridiansLevel(int type,int level){ + if(this.playerGodMeridiansLevels == null){ + this.playerGodMeridiansLevels = new HashMap(); + } + this.playerGodMeridiansLevels.put(type,level); + updateString("playerGodMeridiansLevels", this.playerGodMeridiansLevels); + } + + /** + * 获取主角某条神脉等级 + * @param type + * @return + */ + public int getPlayerGodMeridiansLevel(int type){ + int level = 0; + if(playerGodMeridiansLevels != null && playerGodMeridiansLevels.containsKey(type)){ + if(playerGodMeridiansLevels.get(type) != null){ + level = playerGodMeridiansLevels.get(type); + } + } + return level; + } + + /** + * 获取所有的神脉等级,需要按照顺序传,没有初始化的也要传0级 + * @return + */ + public List getAllPlayerGodMeridiansLevels(){ + List list = new ArrayList(); + for(int type = 1;type <=6;type++){ + int level = this.getPlayerGodMeridiansLevel(type); + list.add(level); + } + return list; + } + } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/TeamEnum.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/TeamEnum.java index f81b09654..8e469216a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/TeamEnum.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/TeamEnum.java @@ -58,6 +58,10 @@ public enum TeamEnum { LUOFU_TEMA_2(3209,"罗浮争锋队伍2",1,1,1), LUOFU_TEMA_3(3210,"罗浮争锋队伍3",1,1,1), LUOFU_TEMA_4(3211,"罗浮争锋队伍4",1,1,1), + + PLAYER_GOD_THREE_TEAM_1(3301,"主角成神塔三队1",1,0), + PLAYER_GOD_THREE_TEAM_2(3302,"主角成神塔三队2",1,0), + PLAYER_GOD_THREE_TEAM_3(3303,"主角成神塔三队3",1,0), ; /** diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/DuoduiTowerLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/DuoduiTowerLogic.java index 508f1b4a7..2441cf6cb 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/DuoduiTowerLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/DuoduiTowerLogic.java @@ -55,7 +55,7 @@ public class DuoduiTowerLogic { User user = UserManager.getUser(iSession.getUid()); DuoduiRank duoduiRank = (DuoduiRank) RankEnum.toRank(RankEnum.DUO_DUI_RANK.getType()); FightInfoProto.DuoduiInfoResponse.Builder builder = FightInfoProto.DuoduiInfoResponse.newBuilder(); - for (int i = 1; i < 3; i++) { + for (int i = 1; i <= 3; i++) { int rank = (int) duoduiRank.getRank(i, user.getId()); int[] tower = user.getPlayerInfoManager().getDuoduiTower(i); CommonProto.DuoduiInfo.Builder info = CommonProto.DuoduiInfo.newBuilder().setType(i).setTier(tower[0]).setRank(rank).setTime(tower[1]); @@ -83,6 +83,18 @@ public class DuoduiTowerLogic { DuoduiRank duoduiRank = (DuoduiRank) RankEnum.toRank(RankEnum.DUO_DUI_RANK.getType()); // 当前层数 int rankTier = Math.max(user.getPlayerInfoManager().getDuoduiTower(type)[0], 0); + //主角神塔有挑战上限 + if(type == 3){ + int dayNum = SSpecialConfig.getIntegerValue("BecomeAGod_Tower"); + long createTime = user.getPlayerInfoManager().getCreateTime(); + long createBegin = TimeUtils.getBeginOfDay(createTime); + long nowBegin = TimeUtils.getBeginOfDay(System.currentTimeMillis()); + int day = (int)((nowBegin - createBegin) / TimeUtils.ONE_DAY) + 1; + int total = dayNum * day; + if(rankTier + 1 >=total){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "playerGodTowerNum cannot channel"); + } + } // 最终结果 boolean result = true; // 奖励 @@ -208,8 +220,10 @@ public class DuoduiTowerLogic { int vipId; if (type == 1){ vipId = VipPrivilegeType.DUODUI_TWO_FREE; - }else { + }else if(type == 2){ vipId = VipPrivilegeType.DUODUI_THREE_FREE; + }else{ + vipId = VipPrivilegeType.PLAYER_GOD_TOWER_FREE; } return PlayerLogic.getInstance().checkAndUpdate(user, vipId, 1); } @@ -224,8 +238,10 @@ public class DuoduiTowerLogic { SGlobalSystemConfig systemConfig; if (type == 1) { systemConfig = SGlobalSystemConfig.getConfigById(FunctionIdEnum.TwoTowerChallenge.getFunctionType()); - } else { + } else if(type == 2){ systemConfig = SGlobalSystemConfig.getConfigById(FunctionIdEnum.ThereTowerChallenge.getFunctionType()); + }else{ + systemConfig = SGlobalSystemConfig.getConfigById(FunctionIdEnum.PlayerGodTowerChallenge.getFunctionType()); } return GlobleSystemLogic.checkOpen(user, systemConfig); } @@ -243,12 +259,19 @@ public class DuoduiTowerLogic { LOGGER.error("双队阵容有空队伍"); result = false; } - } else//三队塔 + } else if(type == 2)//三队塔 { if (!teams.containsKey(TeamEnum.DUODUI_TOWER_THREE_TEAM_1.getTeamId()) || !teams.containsKey(TeamEnum.DUODUI_TOWER_THREE_TEAM_2.getTeamId()) || !teams.containsKey(TeamEnum.DUODUI_TOWER_THREE_TEAM_3.getTeamId())) { - LOGGER.error("双队阵容有空队伍"); + LOGGER.error("三队阵容有空队伍"); + result = false; + } + }else{//主角成神三队塔 + if (!teams.containsKey(TeamEnum.PLAYER_GOD_THREE_TEAM_1.getTeamId()) || + !teams.containsKey(TeamEnum.PLAYER_GOD_THREE_TEAM_2.getTeamId()) || + !teams.containsKey(TeamEnum.PLAYER_GOD_THREE_TEAM_3.getTeamId())) { + LOGGER.error("主角成神三队阵容有空队伍"); result = false; } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index 9eb6835aa..17ddd5b69 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -39,6 +39,7 @@ import com.ljsd.jieling.logic.mail.MailLogic; import com.ljsd.jieling.logic.mission.GameEvent; import com.ljsd.jieling.logic.mission.MissionType; import com.ljsd.jieling.logic.player.PlayerLogic; +import com.ljsd.jieling.logic.playerGod.PlayerGodAddSystemType; import com.ljsd.jieling.logic.rank.RankEnum; import com.ljsd.jieling.logic.redpacket.WelfareRedPackEvent; import com.ljsd.jieling.logic.redpacket.WelfareRedPacketType; @@ -2795,10 +2796,12 @@ public class HeroLogic { Map heroAllAttribute = calHeroAllAttribute(user, hero, isForce); heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAllAttribute.get(GlobalsDef.HP_TYPE)); + // 主角六道神脉(要先计算并返回对灵兽,神兵,变身卡的属性加成,用于他们的系统计算) + Map systemPropAdd = applyPlayerMeridiansAttribute(heroAllAttribute,user); // 主角属性加成 - applyPlayerAndSkill(heroAllAttribute, user); + applyPlayerAndSkill(heroAllAttribute, user,systemPropAdd); // 灵兽和神兵 - applyPokemonAndMagicSoldierAttribute(heroAllAttribute, teamId, user); + applyPokemonAndMagicSoldierAttribute(heroAllAttribute, teamId, user,systemPropAdd); // 图鉴,皮肤,称号,坐骑等。。。 applyBonusesAttribute(heroAllAttribute, hero.getSkin(), user); // 四象心法增加总属性 @@ -2847,7 +2850,7 @@ public class HeroLogic { return heroAllAttribute; } - private void applyPokemonAndMagicSoldierAttribute(Map heroAllAttribute, int teamId, User user) { + private void applyPokemonAndMagicSoldierAttribute(Map heroAllAttribute, int teamId, User user,Map add) { // ... 灵兽和神兵属性加成逻辑 ... int num = Optional.ofNullable(user.getTeamPosManager().getTeamPosForHero().get(teamId)).map(List::size).orElse(0); if (num == 0) { @@ -2855,14 +2858,28 @@ public class HeroLogic { } //森罗环境固定为5 int heroNum = teamId == TeamEnum.TRIAL_TEAM.getTeamId() ? 5 : num; - // 灵兽战力 + // 灵兽属性 int[][] pokemonAttr = calPokemonAttribute(user.getPokemonManager()); for (int i = 0; i < pokemonAttr.length; i++) { pokemonAttr[i][1] = pokemonAttr[i][1] / heroNum; } - combinedAttribute(pokemonAttr, heroAllAttribute); - // 神兵战力 + // 神兵属性 int[][] magicSoldierAttribute = calMagicSoldierAttribute(user.getMagicSoldierManager()); + if(add != null && add.size() > 0){ + if(add.containsKey(PlayerGodAddSystemType.LING_SHOU)){ + int value = add.get(PlayerGodAddSystemType.LING_SHOU); + for (int i = 0; i < pokemonAttr.length; i++) { + pokemonAttr[i][1] = (int)(pokemonAttr[i][1] * (1 + value / 10000d)); + } + } + if(add.containsKey(PlayerGodAddSystemType.SHEN_BING)){ + int value = add.get(PlayerGodAddSystemType.SHEN_BING); + for (int i = 0; i < magicSoldierAttribute.length; i++) { + magicSoldierAttribute[i][1] = (int)(magicSoldierAttribute[i][1] * (1 + value / 10000d)); + } + } + } + combinedAttribute(pokemonAttr, heroAllAttribute); combinedAttribute(magicSoldierAttribute, heroAllAttribute); } @@ -3036,7 +3053,7 @@ public class HeroLogic { } } - private void applyPlayerAndSkill(Map heroAllAttribute, User user) { + private void applyPlayerAndSkill(Map heroAllAttribute, User user,Map add) { // ... 主角属性和主角技能 ... SPlayerLevelConfig playerLevelConfig = SPlayerLevelConfig.sPlayerLevelConfigMap.get(user.getPlayerInfoManager().getLevel()); if (playerLevelConfig != null) { @@ -3045,8 +3062,8 @@ public class HeroLogic { // 主角技能 for (TransformationInfo info : user.getHeroManager().getTransformationList().values()) { - // 英雄属性 - calPlayerCardToHeroAttribute(heroAllAttribute, info.getCardId(), info.getStar(), info.getLevel()); + // 变身卡英雄属性 + calPlayerCardToHeroAttribute(heroAllAttribute, info.getCardId(), info.getStar(), info.getLevel(),add); } // 主角属性加成 @@ -3518,6 +3535,62 @@ public class HeroLogic { return totalAdd; } + /** + * 计算英雄六道神脉属性加成并返回对其他系统的加成系数 + * @param heroAllAttribute + * @param user + */ + private Map applyPlayerMeridiansAttribute(Map heroAllAttribute, User user) { + Map prop = new HashMap<>(); + Map map = user.getPlayerInfoManager().getPlayerGodMeridiansLevels(); + if(map == null || map.size() <=0){ + return prop; + } + //获取用户神觉塔层数 + int towerNum = user.getPlayerInfoManager().getPlayerGodTowerNum(); + HashMap attrMap = new HashMap<>(); + for(int type:map.keySet()){ + if(!map.containsKey(type)){ + continue; + } + SBecomeAGodSetting config = SBecomeAGodSetting.getConfigBytype(type); + if(config == null){ + continue; + } + //根据层数获取解锁的属性库 + int[] floor = config.getFloor(); + int[] propertyGit = config.getPropertyGit(); + int num = 0; + int level = map.get(type); + for(int i = 0;i= 1) { + for (int[] ints : propConfig.getProperty()) { + prop.put(ints[0], prop.getOrDefault(ints[0], 0) + ints[1]); + } + } + } + }else{ + break; + } + } + } + combinedAttribute(attrMap, heroAllAttribute); + return prop; + } + /** * ... 修行和修仙 ... * @@ -3842,6 +3915,9 @@ public class HeroLogic { public void combinedAttribute(int[][] otherAttriMap, Map heroAttributeMap) { for (int[] item : otherAttriMap) { + if(item == null || item.length < 1){ + continue; + } int propertyId = item[0]; int propertyValue = item[1]; heroAttributeMap.put(propertyId, heroAttributeMap.getOrDefault(propertyId, 0L) + propertyValue); @@ -4277,7 +4353,7 @@ public class HeroLogic { } /** - * 计算整队灵兽得战力 + * 计算整队灵兽得属性 * * @param pokemonManager * @return @@ -4310,7 +4386,7 @@ public class HeroLogic { // 主角变身卡属性 for (TransformationInfo info : heroManager.getTransformationList().values()) { - calPlayerAttribute(attrMap, info.getCardId(), info.getStar(), info.getLevel()); + calPlayerCardAttribute(attrMap, info.getCardId(), info.getStar(), info.getLevel()); } // 主角礼物属性 @@ -4332,12 +4408,25 @@ public class HeroLogic { combinedAttribute(playerProperty, attrMap); } } + + //主角神觉(成神)的主角技增伤加成 + int playerGodLevel = playerInfoManager.getPlayerGodLevel(); + if(playerGodLevel <=0){ + return; + } + SBecomeAGodLevel godLevelConfig = SBecomeAGodLevel.map.get(playerGodLevel); + if(godLevelConfig != null){ + int [][] godProp = godLevelConfig.getProperty(); + if(godProp != null && godProp.length > 0){ + combinedAttribute(godProp, attrMap); + } + } } /** * 计算变身卡主角属性 */ - public void calPlayerAttribute(Map attrMap, int tmpId, int star, int level) { + public void calPlayerCardAttribute(Map attrMap, int tmpId, int star, int level) { try { SChangingCard card = SChangingCard.map.get(tmpId); // 基础属性 @@ -4346,11 +4435,13 @@ public class HeroLogic { Map cardLevelMap = SChangingCardLevel.getConfigByPoolId(card.getLevelUpPool()); if (cardLevelMap != null) { SChangingCardLevel cardLevel = cardLevelMap.get(level); - combinedAttribute(cardLevel.getPlayerPropList(), attrMap); + int[][] cardLevelProp = cardLevel.getPlayerPropList(); + combinedAttribute(cardLevelProp, attrMap); } //星级 SChangingCardStar cardStar = SChangingCardStar.getPoolMap().get(card.getStar()).get(star); - combinedAttribute(cardStar.getPlayerPropList(), attrMap); + int[][] starProp = cardStar.getPlayerPropList(); + combinedAttribute(starProp, attrMap); } catch (Exception e) { LOGGER.error("计算主角属性报错,error:{}", e.getMessage(), e); } @@ -4364,7 +4455,7 @@ public class HeroLogic { * @param star * @param level */ - public void calPlayerCardToHeroAttribute(Map attrMap, int tmpId, int star, int level) { + public void calPlayerCardToHeroAttribute(Map attrMap, int tmpId, int star, int level,Map add) { try { // 身外化身加成 Map changingCardMap = STableManager.getConfig(SChangingCard.class); @@ -4372,19 +4463,43 @@ public class HeroLogic { if (card == null) { return; } + int value = 0; + if(add!= null && add.size() > 0){ + if(add.containsKey(PlayerGodAddSystemType.BIAN_SHEN)){ + value = add.get(PlayerGodAddSystemType.BIAN_SHEN); + } + } // 变身卡单独提供得属性 - combinedAttribute(card.getPropList(), attrMap); + int[][] cardProp = card.getPropList(); + if(value > 0){ + for (int i = 0; i < cardProp.length; i++) { + cardProp[i][1] = (int)(cardProp[i][1] * (1 + value / 10000d)); + } + } + combinedAttribute(cardProp, attrMap); //变身卡升星属性 SChangingCardStar cardStar = SChangingCardStar.getPoolMap().get(card.getStar()).get(star); if (cardStar != null) { - combinedAttribute(cardStar.getExp(), attrMap); + int[][] starProp = cardStar.getExp(); + if(value > 0){ + for (int i = 0; i < starProp.length; i++) { + starProp[i][1] = (int)(starProp[i][1] * (1 + value / 10000d)); + } + } + combinedAttribute(starProp, attrMap); } //变身卡升级属性 Map poolConfig = SChangingCardLevel.getConfigByPoolId(card.getLevelUpPool()); if (poolConfig != null) { List levelList = poolConfig.values().stream().filter(n -> n.getLevel() == level).collect(Collectors.toList()); if (!levelList.isEmpty()) { - combinedAttribute(levelList.get(0).getPropList(), attrMap); + int[][] levelProp = levelList.get(0).getPropList(); + if(value > 0){ + for (int i = 0; i < levelProp.length; i++) { + levelProp[i][1] = (int)(levelProp[i][1] * (1 + value / 10000d)); + } + } + combinedAttribute(levelProp, attrMap); } } } catch (Exception e) { @@ -7265,12 +7380,12 @@ public class HeroLogic { } HeroInfoProto.PotentialUpLvResponse.Builder builder = HeroInfoProto.PotentialUpLvResponse.newBuilder(); builder.setUpLv(hero.getPotentialLv(type)); - builder.setGiftLv(getGiftPotentialLv(user, hero) + getBookPotentialLv(user)); + builder.setGiftLv(getGiftPotentialLv(user, hero) + getBookPotentialLv(user) + getPlayerGodPotentialLv(user)); MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.PotentialUpLvResponse_VALUE, builder.build(), true); } /** - * 获取礼物加成得潜能等级 + * 获取礼物和命石加成得潜能等级 */ public int getGiftPotentialLv(User user, Hero hero) { Map configMap = SEquipConfig.equipConfigMap; @@ -7293,7 +7408,7 @@ public class HeroLogic { } /** - * 获取礼物加成得潜能等级 + * 获取图鉴加成得潜能等级 */ public int getBookPotentialLv(User user) { int result = 0; @@ -7312,6 +7427,19 @@ public class HeroLogic { return result; } + /** + * 获取主角成神成得潜能等级 + */ + public int getPlayerGodPotentialLv(User user) { + int result = 0; + int playerGodLevel = user.getPlayerInfoManager().getPlayerGodLevel(); + SBecomeAGodLevel config = SBecomeAGodLevel.map.get(playerGodLevel); + if(config != null){ + result += config.getPotentialNew(); + } + return result; + } + /** * 潜能回退 */ @@ -7368,7 +7496,8 @@ public class HeroLogic { int giftPotentialLv = getGiftPotentialLv(user, hero); int bookPotentialLv = getBookPotentialLv(user); int potentialLv = hero.getPotentialLv(type); - int totalPotenialLv = potentialLv + giftPotentialLv + bookPotentialLv; + int playerGodPotentialLv = getPlayerGodPotentialLv(user); + int totalPotenialLv = potentialLv + giftPotentialLv + bookPotentialLv + playerGodPotentialLv; SPotentialNew potentialNew = SPotentialNew.typeMap.get(type).get(totalPotenialLv); if (potentialNew == null) { return 0; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/GameEvent.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/GameEvent.java index f7a08ee50..6f1d1354d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/GameEvent.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/GameEvent.java @@ -69,4 +69,6 @@ public enum GameEvent { EVERY_DAY_TASK_REFRESH,//每日任务初始化 EVERY_DAY_UPDATE,//每日任务更新 + PLAYER_GOD_MERIDIANS_LEVEL,//主角成神神脉升级 + } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionType.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionType.java index 892825ba0..8caed1d90 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/MissionType.java @@ -188,6 +188,7 @@ public enum MissionType { SOLDIER_LAYER(166),//小兵层数 RECHARGE_ACCUMULATIVE_NUM(167),//累计充值金额 FABAO_JULING_NUM(168),//法宝聚灵召唤次数 + PLAYER_GOD_MERIDIANS_LEVEL(169),//主角成神神脉总等级 ; private int missionType; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/data/DataManagerDistributor.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/data/DataManagerDistributor.java index 990a4719c..08103a419 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/data/DataManagerDistributor.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/data/DataManagerDistributor.java @@ -214,6 +214,8 @@ public class DataManagerDistributor { judges.put(MissionType.RECHARGE_ACCUMULATIVE_NUM,new RechargeAccumulativeNumManager());//每日累充 //法宝聚灵召唤 judges.put(MissionType.FABAO_JULING_NUM,new FabaoJulingTaskManager()); + //主角成神神脉任务 + judges.put(MissionType.PLAYER_GOD_MERIDIANS_LEVEL,new PlayerGodMeridiansLevelTaskManager()); } public static CumulationData.Result updateData(CumulationData data, MissionType missionType, Object...parm) throws Exception { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/data/PlayerGodMeridiansLevelTaskManager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/data/PlayerGodMeridiansLevelTaskManager.java new file mode 100644 index 000000000..0ecdedb56 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/data/PlayerGodMeridiansLevelTaskManager.java @@ -0,0 +1,28 @@ +package com.ljsd.jieling.logic.mission.data; + +import com.ljsd.jieling.logic.dao.CumulationData; +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.logic.mission.MissionType; + +/** + * 主角成神神脉任务处理器 + */ +public class PlayerGodMeridiansLevelTaskManager extends AbstractDataManager{ + @Override + public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) { + data.setMissionIntData(MissionType.PLAYER_GOD_MERIDIANS_LEVEL.getMissionTypeValue(),(int)parm[0]); + return new CumulationData.Result(missionType); + } + + @Override + public int getProcess(User user, CumulationData data, int[] missionSubType) { + int value = data.getMissionIntData(MissionType.PLAYER_GOD_MERIDIANS_LEVEL.getMissionTypeValue()); + return value ; + } + + @Override + public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) { + int value = data.getMissionIntData(MissionType.PLAYER_GOD_MERIDIANS_LEVEL.getMissionTypeValue()); + return value >= cfgValue[1][0]; + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/event/MissionEventDistributor.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/event/MissionEventDistributor.java index 0ba14ea6c..d7350ca6f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/event/MissionEventDistributor.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/mission/event/MissionEventDistributor.java @@ -239,6 +239,10 @@ public class MissionEventDistributor { // 单一任务类型任务处理 eventProcessor.put(GameEvent.ONE_MISSION_TYPE_CONSUME, new OneMissionTypeUpdateProcessor()); + typeList = new ArrayList<>(); + typeList.add(MissionType.PLAYER_GOD_MERIDIANS_LEVEL); + eventEnumListMap.put(GameEvent.PLAYER_GOD_MERIDIANS_LEVEL,typeList); + eventProcessor.put(GameEvent.PLAYER_GOD_MERIDIANS_LEVEL,new CumulationDataEventProcessor()); } public static final ThreadLocal>> threadMissionChangeList = new ThreadLocal<>(); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java index 7531127e6..820cb8817 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java @@ -1052,8 +1052,8 @@ public class PlayerLogic { builder.setForce(HeroLogic.getInstance().calForce(heroNotBufferAttribute)); // 英雄 builder.setHero(CBean2Proto.getHongmengHero(userInMem, hero)); - // 礼物等级 - builder.setPlayerGiftLv(HeroLogic.getInstance().getGiftPotentialLv(userInMem, hero) + HeroLogic.getInstance().getBookPotentialLv(userInMem)); + // 所有的潜能等级 + builder.setPlayerGiftLv(HeroLogic.getInstance().getGiftPotentialLv(userInMem, hero) + HeroLogic.getInstance().getBookPotentialLv(userInMem) + HeroLogic.getInstance().getPlayerGodPotentialLv(userInMem)); // 公会技能 Map guildSkill = userInMem.getGuildMyInfo().getGuildSkill(); int profession = SCHero.getsCHero().get(hero.getTemplateId()).getProfession(); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerGodAddSystemType.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerGodAddSystemType.java new file mode 100644 index 000000000..b77ceee5c --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerGodAddSystemType.java @@ -0,0 +1,8 @@ +package com.ljsd.jieling.logic.playerGod; + +public interface PlayerGodAddSystemType { + + public int LING_SHOU = 1;//灵兽 + public int BIAN_SHEN = 2;//变身卡 + public int SHEN_BING = 3;//神兵 +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerGodLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerGodLogic.java new file mode 100644 index 000000000..cc2f74562 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerGodLogic.java @@ -0,0 +1,134 @@ +package com.ljsd.jieling.logic.playerGod; + +import com.ljsd.jieling.exception.ErrorCode; +import com.ljsd.jieling.exception.ErrorCodeException; +import com.ljsd.jieling.globals.BIReason; +import com.ljsd.jieling.logic.dao.Hero; +import com.ljsd.jieling.logic.dao.PlayerManager; +import com.ljsd.jieling.logic.dao.UserManager; +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.logic.mission.GameEvent; +import com.ljsd.jieling.network.session.ISession; +import com.ljsd.jieling.util.ItemUtil; +import com.ljsd.jieling.util.MessageUtil; +import config.SBecomeAGodLevel; +import config.SBecomeAGodMaterialGit; +import config.SBecomeAGodPropertyGit; +import config.SBecomeAGodSetting; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import rpc.protocols.MessageTypeProto; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 主角神觉逻辑处理类 + */ +public class PlayerGodLogic { + + private static final Logger LOGGER = LoggerFactory.getLogger(PlayerGodLogic.class); + private PlayerGodLogic(){ + } + static class InnerClass{ + public final static PlayerGodLogic instance = new PlayerGodLogic(); + } + + public static PlayerGodLogic getInstance(){ + return InnerClass.instance; + } + + /** + * 升级主角六道神脉等级 + * @param session + * @param type + */ + public void levelUpPlayerMeridiansLevel(ISession session,int type) throws Exception { + User user = UserManager.getUser(session.getUid()); + //不是合法的类型 + if(!PlayerMeridiansType.isExistType(type)){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "type error"); + } + PlayerManager playerManager = user.getPlayerInfoManager(); + int playerMeridiansLevel = playerManager.getPlayerGodMeridiansLevel(type); + //寻找对应的材料库 + SBecomeAGodSetting config = SBecomeAGodSetting.getConfigBytype(type); + if(config == null){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "SBecomeAGodSetting error"); + } + SBecomeAGodMaterialGit materialConfig = SBecomeAGodMaterialGit.getSBecomeAGodMaterialGitByTypeAndLevel(config.getMaterialGit(),playerMeridiansLevel); + if(materialConfig == null){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "SBecomeAGodMaterialGit error"); + } + int[][] cost = materialConfig.getlvupCost(); + //已达最大等级 + if(cost == null || cost.length <=0){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "PlayerMeridiansLevel max"); + } + // + boolean itemCost = ItemUtil.itemCost(user, cost, BIReason.PLAYER_GOD_MERIDIANS_LEVEL, 0); + if (!itemCost){ + throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH); + } + playerManager.setPlayerGodMeridiansLevel(type,playerMeridiansLevel + 1); + //获取总等级,触发任务计次 + List list = playerManager.getAllPlayerGodMeridiansLevels(); + int totalLevel = 0; + for(int level:list){ + totalLevel +=level; + } + user.getUserMissionManager().onGameEvent(user, GameEvent.PLAYER_GOD_MERIDIANS_LEVEL,totalLevel); + MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.PlayerMeridiansLevelUpResponse_VALUE, null, true); + } + + /** + * 进阶主角成神阶数 + * @param session + */ + public void levelUpPlayerGodLevel(ISession session) throws Exception { + User user = UserManager.getUser(session.getUid()); + PlayerManager playerManager = user.getPlayerInfoManager(); + int playerGodLevel = playerManager.getPlayerGodLevel(); + //已达最大阶等级,不能进阶 + if(playerGodLevel >= PlayerGodType.PLAYER_GOD_KING){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "playerGodLevel max"); + } + int nextLevel = playerGodLevel + 1; + SBecomeAGodLevel config = SBecomeAGodLevel.map.get(nextLevel); + if(config == null){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "playerGodLevel config null"); + } + //获取主角的所有神脉等级,只要有一个不符合就不能进阶 + int needLevel = config.getLevelConfine(); + Map map = playerManager.getPlayerGodMeridiansLevels(); + for(int i=1;i<=6;i++){ + if(!map.containsKey(i)){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "playerMeridiansLevel not enough"); + } + int playerMeridiansLevel = map.get(i); + if(playerMeridiansLevel < needLevel){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "playerMeridiansLevel not enough"); + } + } + int[] herosNeed = config.getHeroConfine(); + if(herosNeed == null || herosNeed.length <=0){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "playerMeridiansLevel herosNeed null"); + } + //获取指定星数英雄数量,不满足不能进阶 + int num = 0; + int needNum = herosNeed[0]; + int star = herosNeed[1]; + for(Hero hero : user.getHeroManager().getHeroMap().values()){ + if(hero.getStar() >= star){ + num++; + } + } + if(num < needNum){ + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE, "playerMeridiansLevel herosNeed num notEnough"); + } + //进阶等级 + playerManager.setPlayerGodLevel(nextLevel); + MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.PlayerGodLevelUpResponse_VALUE, null, true); + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerGodType.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerGodType.java new file mode 100644 index 000000000..9eb5b9244 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerGodType.java @@ -0,0 +1,10 @@ +package com.ljsd.jieling.logic.playerGod; + +/** + * 主角神阶等级 + */ +public interface PlayerGodType { + public int PLAYER_HALF_GOD = 1;//半神 + public int PLAYER_GOD = 2;//神 + public int PLAYER_GOD_KING = 3;//神王 +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerMeridiansType.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerMeridiansType.java new file mode 100644 index 000000000..6fc434cc6 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/playerGod/PlayerMeridiansType.java @@ -0,0 +1,22 @@ +package com.ljsd.jieling.logic.playerGod; + +/** + * 主角六道神脉类型 + */ +public class PlayerMeridiansType { + + public static int TIAN_DAO = 1;//天道 + public static int DI_DAO = 2;//人道 + public static int AXIULUO_DAO = 3;//阿修罗道 + public static int DIYU_DAO = 4;//地狱道 + public static int EGUI_DAO = 5;//恶鬼道 + public static int CHUSHENG_DAO = 6;//畜生道 + + + public static boolean isExistType(int type){ + if(type <1 || type > 6){ + return false; + } + return true; + } +} diff --git a/tablemanager/src/main/java/config/SBecomeAGodLevel.java b/tablemanager/src/main/java/config/SBecomeAGodLevel.java new file mode 100644 index 000000000..a7a452dcd --- /dev/null +++ b/tablemanager/src/main/java/config/SBecomeAGodLevel.java @@ -0,0 +1,58 @@ +package config; + +import manager.STableManager; +import manager.Table; + +import java.util.HashMap; +import java.util.Map; + +@Table(name ="BecomeAGodLevel") +public class SBecomeAGodLevel implements BaseConfig { + + private int id; + + private int levelConfine; + + private int[] heroConfine; + + private int[][] property; + + private int potentialNew; + private int duplicate; + private int magicNumber; + + public static Map map = new HashMap<>(); + + @Override + public void init() throws Exception { + map = STableManager.getConfig(SBecomeAGodLevel.class); + } + + public int getId() { + return id; + } + + public int getLevelConfine() { + return levelConfine; + } + + public int[] getHeroConfine() { + return heroConfine; + } + + public int[][] getProperty() { + return property; + } + + public int getPotentialNew() { + return potentialNew; + } + + public int getDuplicate() { + return duplicate; + } + + public int getMagicNumber() { + return magicNumber; + } +} \ No newline at end of file diff --git a/tablemanager/src/main/java/config/SBecomeAGodMaterialGit.java b/tablemanager/src/main/java/config/SBecomeAGodMaterialGit.java new file mode 100644 index 000000000..35b0162d1 --- /dev/null +++ b/tablemanager/src/main/java/config/SBecomeAGodMaterialGit.java @@ -0,0 +1,70 @@ +package config; + +import manager.STableManager; +import manager.Table; + +import java.util.HashMap; +import java.util.Map; + +@Table(name ="BecomeAGodMaterialGit") +public class SBecomeAGodMaterialGit implements BaseConfig { + + private int id; + + private int type; + + private int level; + + private int[][] lvupCost; + + public static Map map = new HashMap<>(); + //按库类型和等级存储的主角神脉升级消耗表 + public static Map> levelMaps = new HashMap<>(); + + @Override + public void init() throws Exception { + map = STableManager.getConfig(SBecomeAGodMaterialGit.class); + Map> _levelMaps = new HashMap<>(); + for(SBecomeAGodMaterialGit config : map.values()){ + if(!_levelMaps.containsKey(config.getType())){ + Map subMaps = new HashMap<>(); + subMaps.put(config.getLevel(),config); + _levelMaps.put(config.getType(),subMaps); + }else{ + Map subMaps = _levelMaps.get(config.getType()); + subMaps.put(config.getLevel(),config); + } + } + levelMaps = _levelMaps; + } + + public int getId() { + return id; + } + + public int getType() { + return type; + } + + public int getLevel() { + return level; + } + + public int[][] getlvupCost() { + return lvupCost; + } + + public static SBecomeAGodMaterialGit getSBecomeAGodMaterialGitByTypeAndLevel(int type,int level){ + if(!levelMaps.containsKey(type)){ + return null; + } + Map map = levelMaps.get(type); + if(map == null){ + return null; + } + if(!map.containsKey(level)){ + return null; + } + return map.get(level); + } +} \ No newline at end of file diff --git a/tablemanager/src/main/java/config/SBecomeAGodPropertyGit.java b/tablemanager/src/main/java/config/SBecomeAGodPropertyGit.java new file mode 100644 index 000000000..5fa1bf81f --- /dev/null +++ b/tablemanager/src/main/java/config/SBecomeAGodPropertyGit.java @@ -0,0 +1,76 @@ +package config; + +import manager.STableManager; +import manager.Table; + +import java.util.HashMap; +import java.util.Map; + +@Table(name ="BecomeAGodPropertyGit") +public class SBecomeAGodPropertyGit implements BaseConfig { + + private int id; + + private int type; + + private int level; + + private int[][] property; + private int[][] systemProperty; + + public static Map map = new HashMap<>(); + //按库类型和等级存储的主角神脉属性表 + public static Map> levelMaps = new HashMap<>(); + + @Override + public void init() throws Exception { + map = STableManager.getConfig(SBecomeAGodPropertyGit.class); + Map> _levelMaps = new HashMap<>(); + for(SBecomeAGodPropertyGit config : map.values()){ + if(!_levelMaps.containsKey(config.getType())){ + Map subMaps = new HashMap<>(); + subMaps.put(config.getLevel(),config); + _levelMaps.put(config.getType(),subMaps); + }else{ + Map subMaps = _levelMaps.get(config.getType()); + subMaps.put(config.getLevel(),config); + } + } + levelMaps = _levelMaps; + } + + public int getId() { + return id; + } + + public int getType() { + return type; + } + + public int getLevel() { + return level; + } + + public int[][] getProperty() { + return property; + } + + public int[][] getSystemProperty() { + return systemProperty; + } + + public static SBecomeAGodPropertyGit getSBecomeAGodPropertyGitByTypeAndLevel(int type,int level){ + if(!levelMaps.containsKey(type)){ + return null; + } + Map map = levelMaps.get(type); + if(map == null){ + return null; + } + if(!map.containsKey(level)){ + return null; + } + return map.get(level); + } + +} \ No newline at end of file diff --git a/tablemanager/src/main/java/config/SBecomeAGodSetting.java b/tablemanager/src/main/java/config/SBecomeAGodSetting.java new file mode 100644 index 000000000..6f5cec0d1 --- /dev/null +++ b/tablemanager/src/main/java/config/SBecomeAGodSetting.java @@ -0,0 +1,62 @@ +package config; + +import manager.STableManager; +import manager.Table; + +import java.util.HashMap; +import java.util.Map; + +@Table(name ="BecomeAGodSetting") +public class SBecomeAGodSetting implements BaseConfig { + + private int id; + + private int type; + + private int materialGit; + + private int[] floor; + + private int[] propertyGit; + + public static Map map = new HashMap<>(); + public static Map typeMap = new HashMap<>(); + + @Override + public void init() throws Exception { + map = STableManager.getConfig(SBecomeAGodSetting.class); + for(SBecomeAGodSetting config : map.values()){ + typeMap.put(config.getType(),config); + } + } + + + public int getId() { + return id; + } + + public int getType() { + return type; + } + + public int getMaterialGit() { + return materialGit; + } + + public int[] getFloor() { + return floor; + } + + public int[] getPropertyGit() { + return propertyGit; + } + + public static SBecomeAGodSetting getConfigBytype(int type){ + if(typeMap != null && typeMap.containsKey(type)){ + return typeMap.get(type); + } + return null; + } + + +} \ No newline at end of file