Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
commit
47efe87f3a
|
@ -32,7 +32,8 @@ public interface GlobalItemType {
|
||||||
int SELECTSecretBox=20; // 自选宝箱(前端要区分)
|
int SELECTSecretBox=20; // 自选宝箱(前端要区分)
|
||||||
int SpecialMonster=21; // 灵兽
|
int SpecialMonster=21; // 灵兽
|
||||||
int SpecialMonsterItem=22; // 灵兽碎片
|
int SpecialMonsterItem=22; // 灵兽碎片
|
||||||
int HeroUpItem = 25;//进阶狗粮
|
// 万能狗粮
|
||||||
|
int AllPowerful_DogFood = 25;
|
||||||
//物品使用类型
|
//物品使用类型
|
||||||
int NO_USE = 0 ; //不使用
|
int NO_USE = 0 ; //不使用
|
||||||
int RANDOM_USE = 1; // 随机使用
|
int RANDOM_USE = 1; // 随机使用
|
||||||
|
|
|
@ -10,6 +10,7 @@ import rpc.protocols.HeroInfoProto;
|
||||||
import rpc.protocols.MessageTypeProto;
|
import rpc.protocols.MessageTypeProto;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
@ -36,10 +37,14 @@ public class UpHeroStarHandler extends BaseHandler<HeroInfoProto.UpHeroStarReque
|
||||||
throw new ErrorCodeException(ErrorCode.HONGMENG_ING);
|
throw new ErrorCodeException(ErrorCode.HONGMENG_ING);
|
||||||
}
|
}
|
||||||
// 验证是否可以使用功能,被吞噬
|
// 验证是否可以使用功能,被吞噬
|
||||||
for (int i = 0; i < consumeMaterialsList.size(); i++) {
|
for (HeroInfoProto.ConsumeMaterial material : consumeMaterialsList) {
|
||||||
List<String> heroIdsList = consumeMaterialsList.get(i).getHeroIdsList();
|
List<String> heroIdsList = new ArrayList<>();
|
||||||
String[] heroIds = new String[heroIdsList.size()];
|
// 获取英雄id
|
||||||
heroIdsList.toArray(heroIds);
|
material.getHeroIdsList().stream()
|
||||||
|
.filter(v->v.getType() == 1)
|
||||||
|
.forEach(v->heroIdsList.add(v.getItemId()));
|
||||||
|
String[] heroIds = heroIdsList.toArray(new String[0]);
|
||||||
|
// 验证神将是否可以消耗
|
||||||
useFunction = HeroLogic.getInstance().isUseFunction(iSession.getUid(), HongMengFunctionEnum.PASSIVE_EAT.getPropertyId(), heroIds);
|
useFunction = HeroLogic.getInstance().isUseFunction(iSession.getUid(), HongMengFunctionEnum.PASSIVE_EAT.getPropertyId(), heroIds);
|
||||||
if (!useFunction){
|
if (!useFunction){
|
||||||
throw new ErrorCodeException(ErrorCode.HONGMENG_ING);
|
throw new ErrorCodeException(ErrorCode.HONGMENG_ING);
|
||||||
|
|
|
@ -3137,7 +3137,6 @@ public class MapLogic {
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sDailyChallengeConfig.getReward(), 1, 0, 1);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sDailyChallengeConfig.getReward(), 1, 0, 1);
|
||||||
builder.setDrop(drop);
|
builder.setDrop(drop);
|
||||||
playerInfoManager.addDailyPass(id);
|
playerInfoManager.addDailyPass(id);
|
||||||
consumeCount = true;
|
|
||||||
}else{
|
}else{
|
||||||
isFailed = true;
|
isFailed = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||||
import com.ljsd.jieling.network.server.GlobalidHelper;
|
import com.ljsd.jieling.network.server.GlobalidHelper;
|
||||||
import com.ljsd.jieling.network.server.WorldHelper;
|
import com.ljsd.jieling.network.server.WorldHelper;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import org.luaj.vm2.lib.jse.JseMathLib;
|
||||||
import rpc.protocols.ArenaInfoProto;
|
import rpc.protocols.ArenaInfoProto;
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.FightInfoProto;
|
import rpc.protocols.FightInfoProto;
|
||||||
|
@ -569,31 +570,43 @@ public class ArenaLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRewardByRank(int rank,int type){
|
public String getRewardByRank(int rank,int type){
|
||||||
Map<Integer, SArenaReward> config = STableManager.getConfig(SArenaReward.class);
|
// Map<Integer, SArenaReward> config = STableManager.getConfig(SArenaReward.class);
|
||||||
for(SArenaReward sArenaReward : config.values()){
|
// for(SArenaReward sArenaReward : config.values()){
|
||||||
int minRank = sArenaReward.getMinRank();
|
// int minRank = sArenaReward.getMinRank();
|
||||||
int maxRank = sArenaReward.getMaxRank();
|
// int maxRank = sArenaReward.getMaxRank();
|
||||||
if(rank>=minRank && rank<=maxRank){
|
// if(rank>=minRank && rank<=maxRank){
|
||||||
if(type == GlobalsDef.ARENA_DAILY_REWARD){
|
// if(type == GlobalsDef.ARENA_DAILY_REWARD){
|
||||||
int[][] dailyReward = sArenaReward.getDailyReward();
|
// int[][] dailyReward = sArenaReward.getDailyReward();
|
||||||
return StringUtil.parseArrayToString(dailyReward);
|
// return StringUtil.parseArrayToString(dailyReward);
|
||||||
}else{
|
// }else{
|
||||||
int[][] seasonReward = sArenaReward.getSeasonReward();
|
// int[][] seasonReward = sArenaReward.getSeasonReward();
|
||||||
return StringUtil.parseArrayToString(seasonReward);
|
// return StringUtil.parseArrayToString(seasonReward);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateArenaSeason(int curSeason){
|
public void updateArenaSeason(int curSeason){
|
||||||
this.curSeason = curSeason;
|
this.curSeason = curSeason;
|
||||||
|
//初始化竞技场新周期数据
|
||||||
|
if(curSeason>viewSeason){
|
||||||
|
String oldRedisKey = RedisUtil.getInstence().getKey(RedisKey.ARENA_RANK,String.valueOf(viewSeason));
|
||||||
|
String newRedisKey = RedisUtil.getInstence().getKey(RedisKey.ARENA_RANK,String.valueOf(curSeason));
|
||||||
|
Set<ZSetOperations.TypedTuple<String>> set= RedisUtil.getInstence().getAllZsetRange(oldRedisKey);
|
||||||
|
for(ZSetOperations.TypedTuple<String> item : set){
|
||||||
|
String id = item.getValue();
|
||||||
|
Double score = item.getScore();
|
||||||
|
double time = score - score.intValue();
|
||||||
|
double newScore =(int)(score.intValue()*0.8)+ time;
|
||||||
|
RedisUtil.getInstence().zsetAddOne(newRedisKey,id,newScore);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(this.curSeason!=0){
|
if(this.curSeason!=0){
|
||||||
viewSeason = this.curSeason;
|
viewSeason = this.curSeason;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void playWithSb(ISession session,int challengeUid,int myteamId) throws Exception {
|
public void playWithSb(ISession session,int challengeUid,int myteamId) throws Exception {
|
||||||
User mine = UserManager.getUser(session.getUid());
|
User mine = UserManager.getUser(session.getUid());
|
||||||
User defUser = UserManager.getUser(challengeUid);
|
User defUser = UserManager.getUser(challengeUid);
|
||||||
|
|
|
@ -990,81 +990,108 @@ public class HeroLogic{
|
||||||
if(consumeMaterialInfoByPosition ==null){
|
if(consumeMaterialInfoByPosition ==null){
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
}
|
}
|
||||||
boolean canUse = true;
|
|
||||||
Set<String> removeHeroIds = new HashSet<>();
|
|
||||||
int needTotalHeroNums = 0;
|
int needTotalHeroNums = 0;
|
||||||
if(consumeMaterialInfoByPosition.size()!=consumeMaterialsList.size()){
|
if(consumeMaterialInfoByPosition.size()!=consumeMaterialsList.size()){
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
||||||
}
|
}
|
||||||
//判断编队
|
//判断编队
|
||||||
for(HeroInfoProto.ConsumeMaterial consumeMaterial1 : consumeMaterialsList) {
|
for(HeroInfoProto.ConsumeMaterial consumeMaterial1 : consumeMaterialsList) {
|
||||||
List<String> heroIdsList = consumeMaterial1.getHeroIdsList();
|
List<String> heroIdsList = new ArrayList<>();
|
||||||
ErrorCode err = ItemLogic.getInstance().checkHeroResolve(heroIdsList, user);
|
consumeMaterial1.getHeroIdsList().stream()
|
||||||
|
.filter(v->v.getType() == 1)
|
||||||
|
.forEach(v->heroIdsList.add(v.getItemId()));
|
||||||
|
ErrorCode err = null;
|
||||||
|
if (heroIdsList.size() > 0){
|
||||||
|
err = ItemLogic.getInstance().checkHeroResolve(heroIdsList, user);
|
||||||
|
}
|
||||||
if(null!=err){
|
if(null!=err){
|
||||||
throw new ErrorCodeException(err);
|
throw new ErrorCodeException(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> removeHeroIds = new ArrayList<>();
|
||||||
|
HashMap<Integer, Integer> removeItemMap = new HashMap<>();
|
||||||
StringBuilder reportConsumeHero = new StringBuilder();
|
StringBuilder reportConsumeHero = new StringBuilder();
|
||||||
|
|
||||||
for(HeroInfoProto.ConsumeMaterial consumeMaterial1 : consumeMaterialsList){
|
for(HeroInfoProto.ConsumeMaterial consumeMaterial1 : consumeMaterialsList){
|
||||||
int position = consumeMaterial1.getPosition();
|
int position = consumeMaterial1.getPosition();
|
||||||
SCHero.ConsumeMaterialInfo consumeMaterialInfo = consumeMaterialInfoByPosition.get(position);
|
SCHero.ConsumeMaterialInfo consumeMaterialInfo = consumeMaterialInfoByPosition.get(position);
|
||||||
int nums = consumeMaterialInfo.getNums();
|
int nums = consumeMaterialInfo.getNums();
|
||||||
needTotalHeroNums+=nums;
|
needTotalHeroNums+=nums;
|
||||||
List<String> heroIdsList = consumeMaterial1.getHeroIdsList();
|
List<HeroInfoProto.ConsumeItem> list = consumeMaterial1.getHeroIdsList();
|
||||||
SHeroRankupGroup sHeroRankupGroup = STableManager.getConfig(SHeroRankupGroup.class).get(consumeMaterialInfo.getGroupID());
|
SHeroRankupGroup sHeroRankupGroup = STableManager.getConfig(SHeroRankupGroup.class).get(consumeMaterialInfo.getGroupID());
|
||||||
int isSame = sHeroRankupGroup.getIssame();
|
int isSame = sHeroRankupGroup.getIssame();
|
||||||
int starLimit = sHeroRankupGroup.getStarLimit();
|
int starLimit = sHeroRankupGroup.getStarLimit();
|
||||||
int isSameClan = sHeroRankupGroup.getIsSameClan();
|
int isSameClan = sHeroRankupGroup.getIsSameClan();
|
||||||
int isId = sHeroRankupGroup.getIsId();
|
int isId = sHeroRankupGroup.getIsId();
|
||||||
for(String consumeHero : heroIdsList){
|
// 万能道具代替
|
||||||
Hero hero = heroManager.getHero(consumeHero);
|
List<Integer> items = Arrays.stream(sHeroRankupGroup.getItems()).boxed().collect(Collectors.toList());
|
||||||
if( null == hero ){
|
// 专属道具代替
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
int[][] itemCamp = sHeroRankupGroup.getItemCamp();
|
||||||
}
|
for(HeroInfoProto.ConsumeItem consume : list){
|
||||||
//上报消耗的英雄数据
|
// 英雄
|
||||||
if(reportConsumeHero.length()>0){
|
if (consume.getType() == 1){
|
||||||
reportConsumeHero.append("|");
|
Hero hero = heroManager.getHero(consume.getItemId());
|
||||||
}
|
if( null == hero ){
|
||||||
reportConsumeHero.append(hero.getTemplateId()).append("-").append(hero.getStar()).append("-").append(hero.getLevel(user.getHeroManager()));
|
|
||||||
|
|
||||||
|
|
||||||
if( 1 == isSame) {
|
|
||||||
if(hero.getTemplateId() != targetHero.getTemplateId()){
|
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
||||||
}
|
}
|
||||||
}
|
//上报消耗的英雄数据
|
||||||
|
if(reportConsumeHero.length()>0){
|
||||||
if( starLimit != 0 ) {
|
reportConsumeHero.append("|");
|
||||||
if(hero.getStar() != starLimit){
|
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
|
||||||
}
|
}
|
||||||
}
|
reportConsumeHero.append(hero.getTemplateId()).append("-").append(hero.getStar()).append("-").append(hero.getLevel(user.getHeroManager()));
|
||||||
|
|
||||||
if( 1 == isSameClan) {
|
|
||||||
SCHero scHeroTmp = SCHero.getsCHero().get(hero.getTemplateId());
|
|
||||||
SCHero targetSHero = SCHero.getsCHero().get(targetHero.getTemplateId());
|
|
||||||
if( scHeroTmp.getPropertyName() != targetSHero.getPropertyName() ){
|
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( isId != 0) {
|
if( 1 == isSame) {
|
||||||
if(hero.getTemplateId() != isId){
|
if(hero.getTemplateId() != targetHero.getTemplateId()){
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( starLimit != 0 ) {
|
||||||
|
if(hero.getStar() != starLimit){
|
||||||
|
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( 1 == isSameClan) {
|
||||||
|
SCHero scHeroTmp = SCHero.getsCHero().get(hero.getTemplateId());
|
||||||
|
SCHero targetSHero = SCHero.getsCHero().get(targetHero.getTemplateId());
|
||||||
|
if( scHeroTmp.getPropertyName() != targetSHero.getPropertyName() ){
|
||||||
|
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isId != 0) {
|
||||||
|
if(hero.getTemplateId() != isId){
|
||||||
|
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
removeHeroIds.add(consume.getItemId());
|
||||||
|
}
|
||||||
|
// 道具
|
||||||
|
else {
|
||||||
|
int itemId = Integer.parseInt(consume.getItemId());
|
||||||
|
if (!items.contains(itemId)){
|
||||||
|
boolean camp = upStartItemCamp(scHero.getPropertyName(), itemCamp, itemId);
|
||||||
|
if (!camp){
|
||||||
|
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Integer num = removeItemMap.getOrDefault(itemId, 0);
|
||||||
|
removeItemMap.put(itemId,num+1);
|
||||||
}
|
}
|
||||||
removeHeroIds.add(consumeHero);
|
|
||||||
}
|
}
|
||||||
|
// 校验道具数量
|
||||||
|
boolean cost = ItemUtil.checkCost(user, removeItemMap);
|
||||||
|
if (!cost){
|
||||||
|
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(needTotalHeroNums!=removeHeroIds.size()){
|
if(needTotalHeroNums != (removeHeroIds.size()+removeItemMap.size())){
|
||||||
canUse=false;
|
|
||||||
LOGGER.error("hero num not enough");
|
LOGGER.error("hero num not enough");
|
||||||
}
|
|
||||||
|
|
||||||
if(!canUse){
|
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1074,16 +1101,16 @@ public class HeroLogic{
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//删除hero
|
|
||||||
// CommonProto.Drop.Builder baseBuilder = ItemLogic.getInstance().decomposeHero(session,new LinkedList<>(removeHeroIds),Collections.singleton(26),MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE);
|
|
||||||
//改成归元获得,同时返还法宝获得
|
//改成归元获得,同时返还法宝获得
|
||||||
CommonProto.Drop.Builder baseBuilder = heroBackDrop(user,new ArrayList<>(removeHeroIds),10000,BIReason.UPHERO_DECOMPOS_HERO_REWARD,true);
|
CommonProto.Drop.Builder baseBuilder = heroBackDrop(user,new ArrayList<>(removeHeroIds),10000,BIReason.UPHERO_DECOMPOS_HERO_REWARD,true);
|
||||||
|
|
||||||
|
// 删除英雄
|
||||||
for(String rmHeroId:removeHeroIds){
|
for(String rmHeroId:removeHeroIds){
|
||||||
heroManager.removeHero(uid,rmHeroId);
|
heroManager.removeHero(uid,rmHeroId);
|
||||||
}
|
}
|
||||||
|
// 消耗道具
|
||||||
|
ItemUtil.itemCost(user,removeItemMap,BIReason.COMPLEX_EQUIP_CONSUME,0);
|
||||||
|
|
||||||
// recyleHeroBySystem(user,removeHeroIds);
|
|
||||||
rankUpHeroExecute(targetHero);
|
rankUpHeroExecute(targetHero);
|
||||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getTemplateId(),targetHero.getStar()));
|
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getTemplateId(),targetHero.getStar()));
|
||||||
if (targetHero.getStar()>=5&&targetHero.getStar()!=15){
|
if (targetHero.getStar()>=5&&targetHero.getStar()!=15){
|
||||||
|
@ -1092,15 +1119,13 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(targetHero.getStar()==5){
|
|
||||||
// Poster.getPoster().dispatchEvent(new HeroFiveStarGetEvent(user.getId()));
|
|
||||||
// }
|
|
||||||
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
||||||
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2,targetHero.getTemplateId(),targetHero.getStar());
|
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2,targetHero.getTemplateId(),targetHero.getStar());
|
||||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,targetHero.getTemplateId(),targetHero.getStar());
|
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,targetHero.getTemplateId(),targetHero.getStar());
|
||||||
if(isInTeam(user,heroId,1)){
|
if(isInTeam(user,heroId,1)){
|
||||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_awaken_hero_content_parm)) {
|
if (targetHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_awaken_hero_content_parm)) {
|
||||||
Set<Integer> hongmengMaxLevel = heroManager.getHongmengMaxLevel();
|
Set<Integer> hongmengMaxLevel = heroManager.getHongmengMaxLevel();
|
||||||
boolean add = hongmengMaxLevel.add(targetHero.getTemplateId());
|
boolean add = hongmengMaxLevel.add(targetHero.getTemplateId());
|
||||||
|
@ -1124,9 +1149,26 @@ public class HeroLogic{
|
||||||
|
|
||||||
}
|
}
|
||||||
String consume = StringUtil.parseArrayToString(consumeMaterial);
|
String consume = StringUtil.parseArrayToString(consumeMaterial);
|
||||||
// HERO_STRENGTHEN(13,"hero_strengthen", new CommonEventHandler(),new String[]{"hero_id","old_quality","new_quality","strengthen_type","cost_item_list","cost_hero_list"}),
|
|
||||||
ReportUtil.onReportEvent(user, ReportEventEnum.HERO_STRENGTHEN.getType(),String.valueOf(targetHero.getTemplateId()),String.valueOf(oldStar),String.valueOf(targetHero.getStar()),consume,reportConsumeHero.toString());
|
ReportUtil.onReportEvent(user, ReportEventEnum.HERO_STRENGTHEN.getType(),String.valueOf(targetHero.getTemplateId()),String.valueOf(oldStar),String.valueOf(targetHero.getStar()),consume,reportConsumeHero.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 升星验证同系道具
|
||||||
|
* @param type
|
||||||
|
* @param itemCamp
|
||||||
|
* @param itemId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean upStartItemCamp(int type,int[][] itemCamp,int itemId){
|
||||||
|
for (int[] ints : itemCamp) {
|
||||||
|
if (type == ints[0] && itemId == ints[1]){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void rankUpHeroExecute(Hero hero)throws Exception {
|
private void rankUpHeroExecute(Hero hero)throws Exception {
|
||||||
//是否解锁法宝
|
//是否解锁法宝
|
||||||
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
|
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
|
||||||
|
|
|
@ -569,7 +569,7 @@ public class ItemUtil {
|
||||||
case GlobalItemType.RIDE:
|
case GlobalItemType.RIDE:
|
||||||
case GlobalItemType.SELECTSecretBox:
|
case GlobalItemType.SELECTSecretBox:
|
||||||
case GlobalItemType.SpecialMonsterItem:
|
case GlobalItemType.SpecialMonsterItem:
|
||||||
case GlobalItemType.HeroUpItem:
|
case GlobalItemType.AllPowerful_DogFood:
|
||||||
itemType = GlobalItemType.ITEM;
|
itemType = GlobalItemType.ITEM;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -15,6 +15,9 @@ public class SHeroRankupGroup implements BaseConfig {
|
||||||
|
|
||||||
private int isId;
|
private int isId;
|
||||||
|
|
||||||
|
private int[] items;
|
||||||
|
|
||||||
|
private int[][] itemCamp;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
@ -40,5 +43,11 @@ public class SHeroRankupGroup implements BaseConfig {
|
||||||
return isId;
|
return isId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[] getItems() {
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getItemCamp() {
|
||||||
|
return itemCamp;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -273,10 +273,11 @@ public class NettyClient {
|
||||||
public HeroInfoProto.UpHeroStarRequest upHeroStar(){
|
public HeroInfoProto.UpHeroStarRequest upHeroStar(){
|
||||||
String heroId = "";
|
String heroId = "";
|
||||||
List<HeroInfoProto.ConsumeMaterial> consumeMaterialsList = new ArrayList<>();
|
List<HeroInfoProto.ConsumeMaterial> consumeMaterialsList = new ArrayList<>();
|
||||||
consumeMaterialsList.add(HeroInfoProto.ConsumeMaterial.newBuilder().setPosition(1).addHeroIds("").build());
|
HeroInfoProto.ConsumeItem.Builder builder = HeroInfoProto.ConsumeItem.newBuilder();
|
||||||
consumeMaterialsList.add(HeroInfoProto.ConsumeMaterial.newBuilder().setPosition(2).addHeroIds("").build());
|
consumeMaterialsList.add(HeroInfoProto.ConsumeMaterial.newBuilder().setPosition(1).addHeroIds(builder).build());
|
||||||
consumeMaterialsList.add(HeroInfoProto.ConsumeMaterial.newBuilder().setPosition(3).addHeroIds("").build());
|
consumeMaterialsList.add(HeroInfoProto.ConsumeMaterial.newBuilder().setPosition(2).addHeroIds(builder).build());
|
||||||
consumeMaterialsList.add(HeroInfoProto.ConsumeMaterial.newBuilder().setPosition(4).addHeroIds("").build());
|
consumeMaterialsList.add(HeroInfoProto.ConsumeMaterial.newBuilder().setPosition(3).addHeroIds(builder).build());
|
||||||
|
consumeMaterialsList.add(HeroInfoProto.ConsumeMaterial.newBuilder().setPosition(4).addHeroIds(builder).build());
|
||||||
return HeroInfoProto.UpHeroStarRequest.newBuilder().setHeroId(heroId).addAllConsumeMaterials(consumeMaterialsList).build();
|
return HeroInfoProto.UpHeroStarRequest.newBuilder().setHeroId(heroId).addAllConsumeMaterials(consumeMaterialsList).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue