增加图鉴神技功能
parent
8582c8d1db
commit
6a6eddff29
|
|
@ -245,6 +245,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.addAllGiftIds(user.getPlayerInfoManager().getPlayerGiftEquipList())
|
||||
.addAllGemLotteryCountByDay(EquipLogic.getInstance().getGemLotteryCountByDay(userId))
|
||||
.setIsStart(PlayerLogic.getCrossStartWeek())
|
||||
.addAllHandBookSkills(user.getPlayerInfoManager().getHandBookSkillList())
|
||||
.build();
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.PurpleMansionSeal;
|
||||
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.network.session.ISession;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 解锁图鉴技能请求
|
||||
*/
|
||||
public class UnLockHandBookSkillRequestHandler extends BaseHandler<PlayerInfoProto.UnLockHandBookSkillRequest> {
|
||||
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.UnLockHandBookSkillRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, PlayerInfoProto.UnLockHandBookSkillRequest proto) throws Exception {
|
||||
HeroLogic.getInstance().unLockHandBookSkill(proto.getHandBookSkillId(),iSession);
|
||||
}
|
||||
}
|
||||
|
|
@ -239,6 +239,8 @@ public class PlayerManager extends MongoBase {
|
|||
return desireDraw;
|
||||
}
|
||||
|
||||
private Map<Integer,Integer> handBookSkills = new HashMap<>();//图鉴神技
|
||||
|
||||
public void putDesireDraw(int type, int tempId) {
|
||||
this.desireDraw.put(type, tempId);
|
||||
updateString("desireDraw", desireDraw);
|
||||
|
|
@ -1543,4 +1545,27 @@ public class PlayerManager extends MongoBase {
|
|||
this.trainingArchitectureMap.put(trainingArchitecture.getId(),trainingArchitecture);
|
||||
updateString("trainingArchitectureMap", this.trainingArchitectureMap);
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getHandBookSkills() {
|
||||
return handBookSkills;
|
||||
}
|
||||
|
||||
public List<Integer> getHandBookSkillList() {
|
||||
List<Integer> list = new ArrayList<>();
|
||||
Map<Integer, Integer> map = this.getHandBookSkills();
|
||||
if(map != null){
|
||||
for(int id:map.values()){
|
||||
list.add(id);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setHandBookSkills(Map<Integer, Integer> handBookSkills) {
|
||||
if(handBookSkills == null){
|
||||
handBookSkills = new HashMap<>();
|
||||
}
|
||||
this.handBookSkills = handBookSkills;
|
||||
updateString("handBookSkills", this.handBookSkills);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public class HeroVo {
|
|||
private Map<String, PropertyItem> faxiangMap = new HashMap<>();
|
||||
private Baubles baubles;
|
||||
private Training training;
|
||||
private Map<Integer,Integer> handBookSkills = new HashMap<>();
|
||||
|
||||
public HeroVo() {
|
||||
}
|
||||
|
|
@ -58,6 +59,10 @@ public class HeroVo {
|
|||
heroVo.jewelMap = CBean2Proto.propertyItemOfLocal(user,hero.getJewelInfo());
|
||||
heroVo.faxiangMap = CBean2Proto.propertyItemOfLocal(user,hero.getFaxiangList());
|
||||
heroVo.training = hero.getTraining();
|
||||
Map<Integer,Integer> handBookSills = user.getPlayerInfoManager().getHandBookSkills();
|
||||
if(handBookSills != null){
|
||||
heroVo.handBookSkills = new HashMap<>(handBookSills);
|
||||
}
|
||||
return heroVo;
|
||||
}
|
||||
|
||||
|
|
@ -136,4 +141,8 @@ public class HeroVo {
|
|||
public Map<Integer, Integer> getTrumpBookStarMap() {
|
||||
return trumpBookStarMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getHandBookSkills() {
|
||||
return handBookSkills;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2146,19 +2146,24 @@ public class HeroLogic {
|
|||
|
||||
int propertyId = heroVo.getPropertyId();
|
||||
// 紫府神印技能
|
||||
for (PurpleMansionSeal seal : heroVo.getPurpleMansionSealMap().values()) {
|
||||
// 使用中神印
|
||||
if (seal.getState() != 1) {
|
||||
continue;
|
||||
}
|
||||
// 通用神印
|
||||
if (seal.getType() == 0) {
|
||||
getPurpleMansionSealSkill(seal.getSealId(), propertyId, skillList);
|
||||
}
|
||||
// 附身神印
|
||||
if (seal.getType() == 1 && seal.getSubId().equals(heroVo.getId())) {
|
||||
getPurpleMansionSealSkill(seal.getSealId(), propertyId, skillList);
|
||||
}
|
||||
// for (PurpleMansionSeal seal : heroVo.getPurpleMansionSealMap().values()) {
|
||||
// // 使用中神印
|
||||
// if (seal.getState() != 1) {
|
||||
// continue;
|
||||
// }
|
||||
// // 通用神印
|
||||
// if (seal.getType() == 0) {
|
||||
// getPurpleMansionSealSkill(seal.getSealId(), propertyId, skillList);
|
||||
// }
|
||||
// // 附身神印
|
||||
// if (seal.getType() == 1 && seal.getSubId().equals(heroVo.getId())) {
|
||||
// getPurpleMansionSealSkill(seal.getSealId(), propertyId, skillList);
|
||||
// }
|
||||
// }
|
||||
//图鉴技能
|
||||
Map<Integer,Integer> handBookSkills = heroVo.getHandBookSkills();
|
||||
for(int handBookSkillId : handBookSkills.values()){
|
||||
getHandBookSkill(handBookSkillId,propertyId,skillList);
|
||||
}
|
||||
|
||||
// 装备套装list初始化
|
||||
|
|
@ -7177,4 +7182,115 @@ public class HeroLogic {
|
|||
public final static HeroLogic instance = new HeroLogic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁天书密卷神技
|
||||
*/
|
||||
public void unLockHandBookSkill(int handBookSkillId,ISession iSession) throws Exception {
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
SXiuXianSkill sXiuXianSkill = STableManager.getConfig(SXiuXianSkill.class).get(handBookSkillId);
|
||||
if (sXiuXianSkill == null){
|
||||
return;
|
||||
}
|
||||
int skillType = sXiuXianSkill.getSkillTtype();
|
||||
if(skillType != 1){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE,"handBookSkill is not handBokkSkill:"+handBookSkillId);
|
||||
}
|
||||
Map<Integer,Integer> handBookSkills = user.getPlayerInfoManager().getHandBookSkills();
|
||||
if(handBookSkills == null){
|
||||
handBookSkills = new HashMap<>();
|
||||
}
|
||||
//已经解锁
|
||||
if(handBookSkills.containsKey(handBookSkillId)){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE,"handBookSkill is unlock:"+handBookSkillId);
|
||||
}
|
||||
int openType = sXiuXianSkill.getOpenType();
|
||||
boolean canUnlock = false;
|
||||
int[][] openValue = sXiuXianSkill.getOpenValue();
|
||||
//无条件,可直接解锁
|
||||
if(openValue == null || openValue.length <1){
|
||||
canUnlock = true;
|
||||
}else{
|
||||
for(int[] rule : openValue){
|
||||
boolean isRule = false;
|
||||
//指定英雄解锁
|
||||
if(openType == 1){
|
||||
int heroId = rule[0];
|
||||
int heroStar = rule[1];
|
||||
for(Hero hero : user.getHeroManager().getHeroMap().values()){
|
||||
if(hero.getTemplateId() == heroId){
|
||||
if(hero.getStar() >= heroStar){
|
||||
isRule = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{//指定法宝解锁
|
||||
int baubleId = rule[0];
|
||||
int baubleLevel = rule[1];
|
||||
List<Baubles> list = user.getEquipManager().getBaublesList();
|
||||
for(Baubles bauble : list){
|
||||
if(bauble.getEquipId() == baubleId){
|
||||
if(bauble.getLevel() >= baubleLevel){
|
||||
isRule = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//只要有一个条件不达标,就不能解锁
|
||||
if(!isRule){
|
||||
canUnlock = false;
|
||||
break;
|
||||
}else{
|
||||
canUnlock = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//条件不满足,不能解锁
|
||||
if(!canUnlock){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE,"handBookSkill is not rule");
|
||||
}
|
||||
//扣除消耗的材料
|
||||
int[][] cost = sXiuXianSkill.getConsume();
|
||||
if(cost != null && cost.length >0){
|
||||
boolean itemCost = ItemUtil.itemCost(user, cost, BIReason.PLAYER_GOD_MERIDIANS_LEVEL, 0);
|
||||
if (!itemCost){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
}
|
||||
handBookSkills.put(handBookSkillId,handBookSkillId);
|
||||
user.getPlayerInfoManager().setHandBookSkills(handBookSkills);
|
||||
PlayerInfoProto.UnLockHandBookSkillResponse build = PlayerInfoProto.UnLockHandBookSkillResponse.newBuilder().
|
||||
setHandBookSkillId(handBookSkillId).build();
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.UnLockHandBookSkillResponse_VALUE, build, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图鉴技能
|
||||
*/
|
||||
private void getHandBookSkill(int sealId, int propertyId, List<Integer> skillList) {
|
||||
SXiuXianSkill xianSkill = STableManager.getConfig(SXiuXianSkill.class).get(sealId);
|
||||
// 技能数组转list
|
||||
int skillId = xianSkill.getSkillId()[0];
|
||||
if (skillId <= 0) {
|
||||
return;
|
||||
}
|
||||
// 适用范围
|
||||
int[] fitList = xianSkill.getFitList();
|
||||
switch (fitList[0]) {
|
||||
case 0:
|
||||
// 不限
|
||||
skillList.add(skillId);
|
||||
break;
|
||||
case 1:
|
||||
case 2:// 阵营限制,职业限制
|
||||
if (propertyId == fitList[1]) {
|
||||
skillList.add(skillId);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,6 +202,9 @@ public class FightDataUtil {
|
|||
for (String s : unitSkill) {
|
||||
int passivityId = Integer.parseInt(s);
|
||||
SPassiveSkillLogicConfig sPassiveSkillLogicConfig = SPassiveSkillLogicConfig.getConfig(passivityId);
|
||||
if(sPassiveSkillLogicConfig == null){
|
||||
continue;
|
||||
}
|
||||
if (sPassiveSkillLogicConfig.getCoverID() != 0) {
|
||||
tempSet.add(sPassiveSkillLogicConfig.getCoverID());
|
||||
}
|
||||
|
|
@ -210,6 +213,9 @@ public class FightDataUtil {
|
|||
LuaValue detail = new LuaTable();
|
||||
int passivityId = Integer.parseInt(s);
|
||||
SPassiveSkillLogicConfig sPassiveSkillLogicConfig = SPassiveSkillLogicConfig.getConfig(passivityId);
|
||||
if(sPassiveSkillLogicConfig == null){
|
||||
continue;
|
||||
}
|
||||
if (sPassiveSkillLogicConfig.getEffectiveRange() != 1) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
String format = MessageFormat.format("目标层数不存在,类型:{0},当前层数:{1},要挑战层数:{2},uid:{3}", 1111, 123123, 23123, 32523523);
|
||||
System.out.println(format);
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
int minute = calendar.get(Calendar.MINUTE);
|
||||
int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
||||
System.out.println(w);
|
||||
// String format = MessageFormat.format("目标层数不存在,类型:{0},当前层数:{1},要挑战层数:{2},uid:{3}", 1111, 123123, 23123, 32523523);
|
||||
// System.out.println(format);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,5 @@
|
|||
#server info
|
||||
server.id = 10221
|
||||
server.id = 10030
|
||||
server.openTime = 20190101000101
|
||||
server.num = 1
|
||||
server.debug = true
|
||||
|
|
@ -16,11 +16,11 @@ server.arenaCross = true
|
|||
spring.redis.database=0
|
||||
#spring.redis.database=2
|
||||
# Redis<69><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
||||
spring.redis.host=60.1.1.32
|
||||
spring.redis.host=154.8.193.157
|
||||
# Redis<69><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ˿<D3B6>
|
||||
spring.redis.port=6379
|
||||
# Redis<69><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루Ĭ<EBA3A8><C4AC>Ϊ<EFBFBD>գ<EFBFBD>
|
||||
spring.redis.password=ysj666
|
||||
spring.redis.password=jieling666
|
||||
# <20><><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ø<EFBFBD>ֵ<EFBFBD><D6B5>ʾû<CABE><C3BB><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>
|
||||
spring.redis.pool.max-active=8
|
||||
# <20><><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD>ʱ<EFBFBD>䣨ʹ<E4A3A8>ø<EFBFBD>ֵ<EFBFBD><D6B5>ʾû<CABE><C3BB><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>
|
||||
|
|
@ -38,8 +38,8 @@ spring.redis.expireTime = -1
|
|||
#spring.data.mongodb.uri = mongodb://mongouser:ysj#2017#ljsd@111.231.54.96:27017/ysj_wx_1
|
||||
#spring.data.mongodb2.uri = mongodb://mongouser:ysj#2017#ljsd@111.231.54.96:27017/develop_ysj_wx_1
|
||||
#mongodb2 develop
|
||||
spring.data.mongodb.uri = mongodb://60.1.1.14:27017/jieling_10221
|
||||
spring.data.mongodbcore.uri = mongodb://60.1.1.14:27017/jl_core
|
||||
spring.data.mongodb.uri = mongodb://root:kaifa&9517@154.8.193.157:27017/jieling_10030?&authSource=admin
|
||||
spring.data.mongodbcore.uri = mongodb://root:kaifa&9517@154.8.193.157:27017/jl_core?&authSource=admin
|
||||
#spring.data.mongodb.uri = mongodb://60.1.1.14:27017/jieling_10212
|
||||
mongodb.options.maxWaitTime = 120000
|
||||
mongodb.options.connectTimeout = 1000
|
||||
|
|
@ -49,13 +49,13 @@ mongodb.options.connectionsPerHost = 50
|
|||
mongodb.options.minConnectionsPerHost = 5
|
||||
mongodb.options.maxConnectionIdleTime = 1000
|
||||
|
||||
|
||||
tamen1naye
|
||||
# netty config
|
||||
netty.tcpPort = 16080
|
||||
netty.tcpPort = 16082
|
||||
netty.chatTcpPort = 20001
|
||||
netty.logintcpPort = 18091
|
||||
netty.udpPort = 18092
|
||||
netty.udpTargetIp=60.1.1.212
|
||||
netty.udpTargetIp=192.168.1.20
|
||||
netty.udpTargetPort=10001
|
||||
netty.reconnectDelay=3000
|
||||
netty.bossThreadCount=1
|
||||
|
|
@ -67,11 +67,11 @@ netty.allTimeout=35
|
|||
|
||||
|
||||
#core
|
||||
services.core.ip=60.1.1.221
|
||||
services.core.port=7900
|
||||
services.core.ip=192.168.1.20
|
||||
services.core.port=7903
|
||||
services.core.area=1000
|
||||
services.core.id=1
|
||||
services.core.gmport = 7902
|
||||
services.core.gmport = 7904
|
||||
services.core.weight=5
|
||||
|
||||
#skyeye
|
||||
|
|
|
|||
|
|
@ -10,12 +10,17 @@ import java.util.Map;
|
|||
public class SXiuXianSkill implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
private int skillTtype;
|
||||
|
||||
private int type;
|
||||
|
||||
private int[] fitList;
|
||||
|
||||
private int[]skillId;
|
||||
private int[][] openSkillSet;
|
||||
private int[][] consume;
|
||||
private int openType;
|
||||
private int[][] openValue;
|
||||
|
||||
|
||||
|
||||
|
|
@ -40,4 +45,24 @@ public class SXiuXianSkill implements BaseConfig {
|
|||
public int[] getSkillId() {
|
||||
return skillId;
|
||||
}
|
||||
|
||||
public int[][] getOpenSkillSet() {
|
||||
return openSkillSet;
|
||||
}
|
||||
|
||||
public int[][] getConsume() {
|
||||
return consume;
|
||||
}
|
||||
|
||||
public int getOpenType() {
|
||||
return openType;
|
||||
}
|
||||
|
||||
public int[][] getOpenValue() {
|
||||
return openValue;
|
||||
}
|
||||
|
||||
public int getSkillTtype() {
|
||||
return skillTtype;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue