Merge branch 'master_test_gn_likable' into master_test_gn
commit
235a3d3a8c
|
@ -70,6 +70,8 @@ public enum FunctionIdEnum {
|
||||||
HongMeng(86,null),
|
HongMeng(86,null),
|
||||||
CrossYuxulundao(87,null),//跨服-玉虚论道
|
CrossYuxulundao(87,null),//跨服-玉虚论道
|
||||||
CrossSevenWorld(112,new SevenWorldFunction()),//七界试炼
|
CrossSevenWorld(112,new SevenWorldFunction()),//七界试炼
|
||||||
|
FourQua(113,null),//四象心法
|
||||||
|
Likable(114,null),//好感度
|
||||||
WeekGood(9091,null),
|
WeekGood(9091,null),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
|
@ -111,6 +111,7 @@ public interface GlobalsDef {
|
||||||
int MAIN_LEVEL_UNLOCK_PRIVILEGE = 2;
|
int MAIN_LEVEL_UNLOCK_PRIVILEGE = 2;
|
||||||
int VIP_UNLOCK_PRIVILEGE = 3;
|
int VIP_UNLOCK_PRIVILEGE = 3;
|
||||||
int RECHARGE_UNLOCK_PRIVILEGE = 4;
|
int RECHARGE_UNLOCK_PRIVILEGE = 4;
|
||||||
|
int LIKABLE_UNLOCK=6;//好感度解锁类型
|
||||||
|
|
||||||
//特殊商店id
|
//特殊商店id
|
||||||
int DAILY_GOODS_FAST_ID = 1004;//每日礼包一键购买的礼包ID
|
int DAILY_GOODS_FAST_ID = 1004;//每日礼包一键购买的礼包ID
|
||||||
|
|
|
@ -347,6 +347,8 @@ public interface BIReason {
|
||||||
|
|
||||||
int SIXIANG_UP_STAR_COST=1106;//四象心法进阶消耗
|
int SIXIANG_UP_STAR_COST=1106;//四象心法进阶消耗
|
||||||
|
|
||||||
|
int HERO_UP_LIKEBLE_COST=1107;//英雄提升好感度消耗
|
||||||
|
|
||||||
int FOUR_CHALLENGE_FIRST = 1201;//四灵试炼首通
|
int FOUR_CHALLENGE_FIRST = 1201;//四灵试炼首通
|
||||||
int FOUR_CHALLENGE_SWEEP = 1202;//四灵试炼扫荡
|
int FOUR_CHALLENGE_SWEEP = 1202;//四灵试炼扫荡
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ public interface GlobalItemType {
|
||||||
int SpecialMonsterItem=22; // 灵兽碎片
|
int SpecialMonsterItem=22; // 灵兽碎片
|
||||||
// 万能狗粮
|
// 万能狗粮
|
||||||
int AllPowerful_DogFood = 25;
|
int AllPowerful_DogFood = 25;
|
||||||
|
int LikableCostItem=27;//好感度功能消耗道具
|
||||||
//物品使用类型
|
//物品使用类型
|
||||||
int NO_USE = 0 ; //不使用
|
int NO_USE = 0 ; //不使用
|
||||||
int RANDOM_USE = 1; // 随机使用
|
int RANDOM_USE = 1; // 随机使用
|
||||||
|
|
|
@ -78,8 +78,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
List<CommonProto.NewPlayerGuidePoint> list = new ArrayList<>();
|
List<CommonProto.NewPlayerGuidePoint> list = new ArrayList<>();
|
||||||
Map<Integer, SPrivilegeTypeConfig> privilegeTypeConfigMap = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap();
|
Map<Integer, SPrivilegeTypeConfig> privilegeTypeConfigMap = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap();
|
||||||
for(Map.Entry<Integer, SPrivilegeTypeConfig> entry:privilegeTypeConfigMap.entrySet()){
|
for(Map.Entry<Integer, SPrivilegeTypeConfig> entry:privilegeTypeConfigMap.entrySet()){
|
||||||
//如果是<4 系统内置特权
|
//如果是<4 系统内置特权 (6是新增的好感度特权收益加成 2021.9.26)
|
||||||
if(entry.getValue().getUnlockType()<4&&!vipInfo.containsKey(entry.getKey())){
|
if(entry.getValue().getUnlockType()<4||entry.getValue().getUnlockType()==6&&!vipInfo.containsKey(entry.getKey())){
|
||||||
playerInfoManager.addVipInfo(entry.getKey());
|
playerInfoManager.addVipInfo(entry.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.ljsd.jieling.handler.hero;
|
||||||
|
|
||||||
|
import com.google.protobuf.GeneratedMessage;
|
||||||
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
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.netty.cocdex.PacketNetData;
|
||||||
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
|
import config.SSpecialConfig;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import rpc.protocols.CommonProto;
|
||||||
|
import rpc.protocols.HeroInfoProto;
|
||||||
|
import rpc.protocols.MessageTypeProto;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
///获取好感度数据请求
|
||||||
|
@Component
|
||||||
|
public class GetLikableDataRequestHandler extends BaseHandler {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.GET_LIKABLE_DATA_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void process(ISession session, PacketNetData netData) throws Exception {
|
||||||
|
int uid = session.getUid();
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
Map<Integer,Integer> likaMap=user.getHeroManager().getHeroLikableMap();
|
||||||
|
List<CommonProto.LikableInfo> _list=new ArrayList<>();
|
||||||
|
for (Map.Entry<Integer, Integer> integerEntry : likaMap.entrySet()) {
|
||||||
|
CommonProto.LikableInfo likaInfo=CommonProto.LikableInfo.newBuilder()
|
||||||
|
.setHeroStaticid(integerEntry.getKey())
|
||||||
|
.setLikableNum(integerEntry.getValue())
|
||||||
|
.build();
|
||||||
|
_list.add(likaInfo);
|
||||||
|
}
|
||||||
|
int remainTime= SSpecialConfig.getIntegerValue(SSpecialConfig.LIKE_ABILITY)-user.getHeroManager().getLikableSendTime();
|
||||||
|
HeroInfoProto.GetLikableDataResponse response=HeroInfoProto.GetLikableDataResponse.newBuilder()
|
||||||
|
.addAllInfoList(_list)
|
||||||
|
.setLikableRemainTime(remainTime)
|
||||||
|
.build();
|
||||||
|
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_LIKABLE_DATA_RESPONSE_VALUE,response,true);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,156 @@
|
||||||
|
package com.ljsd.jieling.handler.hero;
|
||||||
|
|
||||||
|
import com.ljsd.common.mogodb.util.GlobalData;
|
||||||
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
|
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.dao.HeroManager;
|
||||||
|
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.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
|
import config.*;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import rpc.protocols.HeroInfoProto;
|
||||||
|
import rpc.protocols.MessageTypeProto;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
//英雄好感度提升消息
|
||||||
|
@Component
|
||||||
|
public class HeroUpLikableRequestHandler extends BaseHandler<HeroInfoProto.HeroUpLikableRequest> {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.HERO_UP_LIKABLE_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processWithProto(ISession session, HeroInfoProto.HeroUpLikableRequest proto) throws Exception {
|
||||||
|
int heroStaticId=proto.getHeroStaticId();//英雄静态id
|
||||||
|
int itemId=proto.getItemId();//消耗道具id
|
||||||
|
int itemNum=proto.getItemNum();//消耗道具数量
|
||||||
|
int uid = session.getUid();
|
||||||
|
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
HeroManager heroManager=user.getHeroManager();
|
||||||
|
|
||||||
|
if (itemNum+heroManager.getLikableSendTime()> SSpecialConfig.getIntegerValue(SSpecialConfig.LIKE_ABILITY)){
|
||||||
|
LOGGER.error("好感度赠送次数超出每日限制");
|
||||||
|
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
|
||||||
|
}
|
||||||
|
int[][]costArr=new int[1][2];
|
||||||
|
costArr[0][0]=itemId;
|
||||||
|
costArr[0][1]=itemNum;
|
||||||
|
boolean costResult = ItemUtil.itemCost(user,costArr, BIReason.HERO_UP_LIKEBLE_COST,heroStaticId);
|
||||||
|
if (costResult){
|
||||||
|
SItem _item= SItem.getsItemMap().get(itemId);
|
||||||
|
int profession=SCHero.getsCHero().get(heroStaticId).getPropertyName();
|
||||||
|
String[]addArr=_item.getResolveReward().split("\\|");
|
||||||
|
String addStr=addArr[profession-1];
|
||||||
|
int singleAddNum=Integer.parseInt(addStr.split("#")[1]);
|
||||||
|
int allAddNum=singleAddNum*itemNum;
|
||||||
|
int curHeroLikableNum = heroManager.getHeroLikableMap().containsKey(heroStaticId)?user.getHeroManager().getHeroLikableMap().get(heroStaticId):0;
|
||||||
|
int oldLv=GetHeroLikableLvByLikaNum(curHeroLikableNum);
|
||||||
|
curHeroLikableNum+=allAddNum;
|
||||||
|
int curLv=GetHeroLikableLvByLikaNum(curHeroLikableNum);
|
||||||
|
if (curLv>oldLv){
|
||||||
|
Map<Integer,Integer>curHeroPropAdd=GetHeroLikableAddPeop(curLv);
|
||||||
|
heroManager.putHeroLikablePropAddMap(heroStaticId,curHeroPropAdd);
|
||||||
|
}
|
||||||
|
int oldAllLikaLv=GetAllLikableLvByLikaNum(GetAllHeroLikableNum(heroManager.getHeroLikableMap()));
|
||||||
|
heroManager.putHeroLikableMap(heroStaticId,curHeroLikableNum);
|
||||||
|
int curAllLikaLv=GetAllLikableLvByLikaNum(GetAllHeroLikableNum(heroManager.getHeroLikableMap()));
|
||||||
|
if (curAllLikaLv>oldAllLikaLv){
|
||||||
|
Map<Integer,Integer>allHeroPropAdd=GetAllHeroLikableAddPeop(curAllLikaLv);
|
||||||
|
heroManager.putAllLikablePropAddMap(allHeroPropAdd);
|
||||||
|
int[][]condition= SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(2).getCondition();
|
||||||
|
user.getPlayerInfoManager().updateVipPrivilage(1,condition[curAllLikaLv][1]);
|
||||||
|
}
|
||||||
|
int sendTime= heroManager.getLikableSendTime()+itemNum;
|
||||||
|
heroManager.UpdateLikableSendTime(sendTime);
|
||||||
|
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.HERO_UP_LIKABLE_RESPONSE_VALUE, null,true);
|
||||||
|
}else{
|
||||||
|
LOGGER.error("好感度提升材料不足");
|
||||||
|
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
///通过神将好感度获取好感度等级
|
||||||
|
public int GetHeroLikableLvByLikaNum(int _likaNum){
|
||||||
|
int likaLv=0;
|
||||||
|
for (Map.Entry<Integer, Integer> integerEntry : SLikeAbilityConfig.heroLikeAbilityByLevel.entrySet()) {
|
||||||
|
if (integerEntry.getKey()==SLikeAbilityConfig.heroLikeAbilityByLevel.size()-1)break;
|
||||||
|
if (_likaNum>=integerEntry.getValue()){
|
||||||
|
likaLv= integerEntry.getKey()+1;
|
||||||
|
}else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return likaLv;
|
||||||
|
}
|
||||||
|
///通过总好感度获取好感度等级
|
||||||
|
public int GetAllLikableLvByLikaNum(int _likaNum){
|
||||||
|
int likaLv=0;
|
||||||
|
for (Map.Entry<Integer, Integer> integerEntry : SLikeAbilityConfig.allLikeAbilityByLevel.entrySet()) {
|
||||||
|
if (integerEntry.getKey()==SLikeAbilityConfig.allLikeAbilityByLevel.size()-1)break;
|
||||||
|
if (_likaNum>=integerEntry.getValue()){
|
||||||
|
likaLv= integerEntry.getKey()+1;
|
||||||
|
}else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return likaLv;
|
||||||
|
}
|
||||||
|
//通过当前等级获取神将好感度属性加成
|
||||||
|
public Map<Integer,Integer>GetHeroLikableAddPeop(int _lv){
|
||||||
|
Map<Integer,Integer>_propMap=new HashMap<>();
|
||||||
|
for (int i = 0; i <= _lv; i++) {
|
||||||
|
SLikeAbilityConfig _config= SLikeAbilityConfig.heroLikeAbilityConfigMap.get(i);
|
||||||
|
if (_config.getProperty()==null)continue;
|
||||||
|
for (int[] ints : _config.getProperty()) {
|
||||||
|
if (_propMap.containsKey(ints[0])) {
|
||||||
|
int absProp=_propMap.get(ints[0])+ints[1];
|
||||||
|
_propMap.put(ints[0],absProp);
|
||||||
|
}else{
|
||||||
|
_propMap.put(ints[0],ints[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _propMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
//通过当前总好感度等级获取好感度属性加成
|
||||||
|
public Map<Integer,Integer>GetAllHeroLikableAddPeop(int _allLv){
|
||||||
|
Map<Integer,Integer>_propMap=new HashMap<>();
|
||||||
|
for (int i = 0; i <= _allLv; i++) {
|
||||||
|
SLikeAbilityConfig _config= SLikeAbilityConfig.allLikeAbilityConfigMap.get(i);
|
||||||
|
if (_config.getProperty()!=null){
|
||||||
|
for (int[] ints : _config.getProperty()) {
|
||||||
|
if(ints.length<=0)continue;
|
||||||
|
if (_propMap.containsKey(ints[0])) {
|
||||||
|
int absProp=_propMap.get(ints[0])+ints[1];
|
||||||
|
_propMap.put(ints[0],absProp);
|
||||||
|
}else{
|
||||||
|
_propMap.put(ints[0],ints[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _propMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取总的好感度
|
||||||
|
public int GetAllHeroLikableNum(Map<Integer,Integer>_heroLikableMap){
|
||||||
|
int likableNum=0;
|
||||||
|
for (Map.Entry<Integer, Integer> integerEntry : _heroLikableMap.entrySet()) {
|
||||||
|
likableNum+=integerEntry.getValue();
|
||||||
|
}
|
||||||
|
return likableNum;
|
||||||
|
}
|
||||||
|
}
|
|
@ -454,6 +454,7 @@ public class GlobalDataManaager implements IManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fBuilder.setExpeditionLeve(user.getExpeditionManager().getExpeditionLeve());
|
fBuilder.setExpeditionLeve(user.getExpeditionManager().getExpeditionLeve());
|
||||||
|
HeroLogic.getInstance().ResetLikableSendTime(user,fBuilder);//重置好感度次数
|
||||||
if(session.getFiveReady() == 1){ //客户端准备好接受五点刷新请求
|
if(session.getFiveReady() == 1){ //客户端准备好接受五点刷新请求
|
||||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.FIVE_PLAYER_REFLUSH_INDICATION_VALUE,fBuilder.build(),true);
|
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.FIVE_PLAYER_REFLUSH_INDICATION_VALUE,fBuilder.build(),true);
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -5,7 +5,9 @@ import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.activity.event.RemoveHeroEvent;
|
import com.ljsd.jieling.logic.activity.event.RemoveHeroEvent;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
|
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
|
||||||
|
import config.SLikeAbilityConfig;
|
||||||
import config.SSpecialConfig;
|
import config.SSpecialConfig;
|
||||||
|
import org.omg.CORBA.PUBLIC_MEMBER;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
@ -111,6 +113,30 @@ public class HeroManager extends MongoBase {
|
||||||
return sixiangPropUpMap;
|
return sixiangPropUpMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 好感度数据
|
||||||
|
* key: 英雄静态id value:好感度值
|
||||||
|
*/
|
||||||
|
private Map<Integer,Integer> heroLikableMap = new HashMap<>();
|
||||||
|
|
||||||
|
public Map<Integer, Integer> getHeroLikableMap() {
|
||||||
|
return heroLikableMap;
|
||||||
|
}
|
||||||
|
//神将好感度属性加成
|
||||||
|
private Map<Integer,Map<Integer,Integer>>heroLikablePropAddMap=new HashMap<>();
|
||||||
|
|
||||||
|
public Map<Integer,Map<Integer,Integer>>getHeroLikablePropAddMap() {
|
||||||
|
return heroLikablePropAddMap;
|
||||||
|
}
|
||||||
|
//所有神将总好感度带来的属性加成(包含特权加成)
|
||||||
|
private Map<Integer,Integer>allLikablePropAddMap=new HashMap<>();
|
||||||
|
public Map<Integer,Integer>getAllLikablePropAddMap() {
|
||||||
|
return allLikablePropAddMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int likableSendTime;//好感度已赠送次数
|
||||||
|
|
||||||
|
public int getLikableSendTime() { return likableSendTime; }
|
||||||
/**
|
/**
|
||||||
* 心愿可以选择的英雄列表
|
* 心愿可以选择的英雄列表
|
||||||
*/
|
*/
|
||||||
|
@ -158,6 +184,27 @@ public class HeroManager extends MongoBase {
|
||||||
updateString("sixiangPropUpMap."+professionId, _propMap);
|
updateString("sixiangPropUpMap."+professionId, _propMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void putHeroLikableMap(int heroStaticId,int likableNum) {
|
||||||
|
heroLikableMap.put(heroStaticId,likableNum);
|
||||||
|
updateString("heroLikableMap."+heroStaticId, likableNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void putHeroLikablePropAddMap(int heroStaticId,Map<Integer,Integer> _propMap) {
|
||||||
|
heroLikablePropAddMap.put(heroStaticId,_propMap);
|
||||||
|
updateString("heroLikablePropAddMap."+heroStaticId, _propMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void putAllLikablePropAddMap(Map<Integer,Integer> _propMap) {
|
||||||
|
allLikablePropAddMap=_propMap;
|
||||||
|
updateString("allLikablePropAddMap", allLikablePropAddMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
//刷新好感度赠送次数 参数传当日已赠送次数
|
||||||
|
public void UpdateLikableSendTime(int _sendTime) {
|
||||||
|
likableSendTime=_sendTime;
|
||||||
|
updateString("likableSendTime", _sendTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateRandCount(int type, int count){
|
public void updateRandCount(int type, int count){
|
||||||
updateString("totalCount." + type, count);
|
updateString("totalCount." + type, count);
|
||||||
|
@ -493,6 +540,7 @@ public class HeroManager extends MongoBase {
|
||||||
updateString("wishOpenHeroList", wishOpenHeroList);
|
updateString("wishOpenHeroList", wishOpenHeroList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///获取四象心法共鸣等级
|
||||||
public int GetSiXiangGongMingLv(){
|
public int GetSiXiangGongMingLv(){
|
||||||
int gongmingLv=0;
|
int gongmingLv=0;
|
||||||
if (this.sixiangDataMap.size()<4){
|
if (this.sixiangDataMap.size()<4){
|
||||||
|
@ -506,5 +554,24 @@ public class HeroManager extends MongoBase {
|
||||||
}
|
}
|
||||||
return gongmingLv;
|
return gongmingLv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///通过总好感度获取好感度等级
|
||||||
|
public int GetAllLikableLv(){
|
||||||
|
int likaLv=0;
|
||||||
|
int likableNum=0;
|
||||||
|
for (Map.Entry<Integer, Integer> integerEntry : heroLikableMap.entrySet()) {
|
||||||
|
likableNum+=integerEntry.getValue();
|
||||||
|
}
|
||||||
|
for (Map.Entry<Integer, Integer> integerEntry : SLikeAbilityConfig.allLikeAbilityByLevel.entrySet()) {
|
||||||
|
if (likableNum>=integerEntry.getValue()){
|
||||||
|
likaLv= integerEntry.getKey()+1;
|
||||||
|
}else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return likaLv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2361,6 +2361,17 @@ public class HeroLogic{
|
||||||
int[][]skillProp=ItemUtil.mapToArray(skillPropertyMap);
|
int[][]skillProp=ItemUtil.mapToArray(skillPropertyMap);
|
||||||
combinedAttribute(skillProp,heroAllAttribute);
|
combinedAttribute(skillProp,heroAllAttribute);
|
||||||
|
|
||||||
|
//英雄好感度属性加成
|
||||||
|
if (user.getHeroManager().getHeroLikablePropAddMap().containsKey(scHero.getId())){
|
||||||
|
int[][]likableProp=ItemUtil.mapToArray(user.getHeroManager().getHeroLikablePropAddMap().get(scHero.getId()));
|
||||||
|
combinedAttribute(likableProp,heroAllAttribute);
|
||||||
|
}
|
||||||
|
//英雄总好感度属性加成
|
||||||
|
if (user.getHeroManager().getAllLikablePropAddMap().size()>0){
|
||||||
|
int[][]allLikableProp=ItemUtil.mapToArray(user.getHeroManager().getAllLikablePropAddMap());
|
||||||
|
combinedAttribute(allLikableProp,heroAllAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
//装备总战力评分
|
//装备总战力评分
|
||||||
int equipForce=0;
|
int equipForce=0;
|
||||||
Iterator<Map.Entry<Integer, Integer>> iterator = hero.getEquipByHongmengPositionMap(user.getHeroManager()).entrySet().iterator();
|
Iterator<Map.Entry<Integer, Integer>> iterator = hero.getEquipByHongmengPositionMap(user.getHeroManager()).entrySet().iterator();
|
||||||
|
@ -5264,5 +5275,11 @@ public class HeroLogic{
|
||||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.PurpleMansionSealIndication_VALUE,build2,true);
|
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.PurpleMansionSealIndication_VALUE,build2,true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
///0点重置好感度赠送次数
|
||||||
|
public void ResetLikableSendTime(User user,PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder){
|
||||||
|
user.getHeroManager().UpdateLikableSendTime(0);
|
||||||
|
int remainTime=SSpecialConfig.getIntegerValue(SSpecialConfig.LIKE_ABILITY)-user.getHeroManager().getLikableSendTime();
|
||||||
|
fBuilder.setLikableRemainTime(remainTime);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1224,6 +1224,9 @@ public class PlayerLogic {
|
||||||
case GlobalsDef.VIP_UNLOCK_PRIVILEGE:
|
case GlobalsDef.VIP_UNLOCK_PRIVILEGE:
|
||||||
cond = user.getPlayerInfoManager().getVipLevel();
|
cond = user.getPlayerInfoManager().getVipLevel();
|
||||||
break;
|
break;
|
||||||
|
case GlobalsDef.LIKABLE_UNLOCK:
|
||||||
|
cond = user.getHeroManager().GetAllLikableLv();
|
||||||
|
break;
|
||||||
default:{
|
default:{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -531,6 +531,7 @@ public class ItemUtil {
|
||||||
case GlobalItemType.SOUL_MARK:
|
case GlobalItemType.SOUL_MARK:
|
||||||
case GlobalItemType.ITEM:
|
case GlobalItemType.ITEM:
|
||||||
case GlobalItemType.EQUIP:
|
case GlobalItemType.EQUIP:
|
||||||
|
case GlobalItemType.LikableCostItem:
|
||||||
putCountLongMap(itemId,amount, itemObj.getItemMap());
|
putCountLongMap(itemId,amount, itemObj.getItemMap());
|
||||||
break;
|
break;
|
||||||
case GlobalItemType.CARD:
|
case GlobalItemType.CARD:
|
||||||
|
@ -1421,6 +1422,7 @@ public class ItemUtil {
|
||||||
case GlobalItemType.ITEM:
|
case GlobalItemType.ITEM:
|
||||||
case GlobalItemType.SOUL_MARK:
|
case GlobalItemType.SOUL_MARK:
|
||||||
case GlobalItemType.EQUIP:
|
case GlobalItemType.EQUIP:
|
||||||
|
case GlobalItemType.LikableCostItem:
|
||||||
putCountMap(itemId,itemNum,itemMap);
|
putCountMap(itemId,itemNum,itemMap);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
package config;
|
||||||
|
|
||||||
|
import manager.STableManager;
|
||||||
|
import manager.Table;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
@Table(name ="LikeAbility")
|
||||||
|
public class SLikeAbilityConfig implements BaseConfig {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
private int level;
|
||||||
|
|
||||||
|
private int favorDegree;
|
||||||
|
|
||||||
|
private int[][] property;
|
||||||
|
|
||||||
|
private int[][] privilegeProperty;
|
||||||
|
|
||||||
|
|
||||||
|
public static Map<Integer, SLikeAbilityConfig> sLikeAbilityConfigMap;
|
||||||
|
|
||||||
|
public static Map<Integer, SLikeAbilityConfig> heroLikeAbilityConfigMap;
|
||||||
|
public static Map<Integer, Integer> heroLikeAbilityByLevel;
|
||||||
|
|
||||||
|
public static Map<Integer, SLikeAbilityConfig> allLikeAbilityConfigMap;
|
||||||
|
public static Map<Integer, Integer> allLikeAbilityByLevel;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws Exception {
|
||||||
|
heroLikeAbilityConfigMap=new HashMap<>();
|
||||||
|
allLikeAbilityConfigMap=new HashMap<>();
|
||||||
|
heroLikeAbilityByLevel=new TreeMap<>();
|
||||||
|
allLikeAbilityByLevel=new TreeMap<>();
|
||||||
|
sLikeAbilityConfigMap = STableManager.getConfig(SLikeAbilityConfig.class);
|
||||||
|
int heroLike=0;
|
||||||
|
int allLike=0;
|
||||||
|
for (SLikeAbilityConfig value : sLikeAbilityConfigMap.values()) {
|
||||||
|
if (value.type==1){
|
||||||
|
allLikeAbilityConfigMap.put(value.level,value);
|
||||||
|
allLike+=value.getFavorDegree();
|
||||||
|
allLikeAbilityByLevel.put(value.level,allLike);
|
||||||
|
}else {
|
||||||
|
heroLikeAbilityConfigMap.put(value.level,value);
|
||||||
|
heroLike+=value.getFavorDegree();
|
||||||
|
heroLikeAbilityByLevel.put(value.level,heroLike);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFavorDegree() {
|
||||||
|
return favorDegree;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getProperty() {
|
||||||
|
return property;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getPrivilegeProperty() {
|
||||||
|
return privilegeProperty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -114,6 +114,7 @@ public class SSpecialConfig implements BaseConfig {
|
||||||
public static final String PRE_LOAD_REWARD = "PreLoadReward";
|
public static final String PRE_LOAD_REWARD = "PreLoadReward";
|
||||||
|
|
||||||
public static final String QIJIEHOLYCONFIG = "QIJIEHOLYCONFIG";//七界试炼遗物开启层数
|
public static final String QIJIEHOLYCONFIG = "QIJIEHOLYCONFIG";//七界试炼遗物开启层数
|
||||||
|
public static final String LIKE_ABILITY = "LikeAbility";//好感度功能,每日赠予礼物次数上限
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue