Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
commit
a5762d9aa9
|
@ -181,6 +181,8 @@ public enum ErrorCode implements IErrorCode {
|
|||
SHOP_XIA_JIA(150,"商品已下架"),
|
||||
SHOP_COLSE(151,"商店已关闭"),
|
||||
SHOP_NO_ITEM(152,"商品不存在"),
|
||||
HERO_RETURN_ONLY_LEVEL_ONE(153,"只有1级的神将才可回退,请先进行归元!"),
|
||||
HERO_RETURN_CAN_NOT(154,"此神将不可回退"),
|
||||
|
||||
GUILD_NOT_AUTHORITY(300,"账号因错误发言导致相关功能封禁中,操作失败"),
|
||||
|
||||
|
|
|
@ -176,6 +176,7 @@ public interface BIReason {
|
|||
|
||||
int ENDLESS_TREASURE_REWARD = 100;//无尽秘宝获得
|
||||
int ENDLESS_RESET = 101;//无尽重置获得
|
||||
int HERO_RETURN = 102;// 神将回退
|
||||
|
||||
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级
|
||||
int SECRETBOX_CONSUME = 1001;//秘盒抽卡
|
||||
|
|
|
@ -21,11 +21,15 @@ public class HeroReturnHandler extends BaseHandler<HeroInfoProto.HeroReturnReque
|
|||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.HeroReturnRequest proto) throws Exception {
|
||||
// 验证是否可以使用功能,神将归元
|
||||
boolean useFunction = HeroLogic.getInstance().isUseFunction(iSession.getUid(), HongMengFunctionEnum.HERO_BACK_TO_BEGIN.getPropertyId(), proto.getHeroId());
|
||||
if (!useFunction){
|
||||
throw new ErrorCodeException(ErrorCode.HONGMENG_ING);
|
||||
if (proto.getType() == 0) {
|
||||
// 验证是否可以使用功能,神将归元
|
||||
boolean useFunction = HeroLogic.getInstance().isUseFunction(iSession.getUid(), HongMengFunctionEnum.HERO_BACK_TO_BEGIN.getPropertyId(), proto.getHeroId());
|
||||
if (!useFunction){
|
||||
throw new ErrorCodeException(ErrorCode.HONGMENG_ING);
|
||||
}
|
||||
HeroLogic.getInstance().heroBack(iSession,proto.getHeroId());
|
||||
} else {
|
||||
HeroLogic.getInstance().heroReturn(iSession,proto.getHeroId());
|
||||
}
|
||||
HeroLogic.getInstance().heroBack(iSession,proto.getHeroId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,6 +115,8 @@ public enum ReportEventEnum {
|
|||
//七界试炼
|
||||
SEVENWORLDS_TRIAL(77 ,"sevenworlds_Trial",CommonEventHandler.getInstance(),new String[]{"sevenworlds_Trial_type","sevenworlds_Trial_id","combat_results","reward_nums_list"}),
|
||||
|
||||
HERO_RETURN(78,"hero_return", CommonEventHandler.getInstance(),new String[]{"hero_id","hero_level","hero_quality","reward_list","reward_nums_list"}),
|
||||
|
||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||
|
||||
private int type;
|
||||
|
|
|
@ -378,11 +378,25 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
public List<CommonProto.ActivityInfo.MissionInfo> getAllMissInfo(User user,ActivityMission activityMission, Set<Integer> filter) {
|
||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||
List<CommonProto.ActivityInfo.MissionInfo> missionInfos = new ArrayList<>(activityProgressInfoMap.size());
|
||||
long now = TimeUtils.now();
|
||||
for (Map.Entry<Integer, ActivityProgressInfo> missionProgress : activityProgressInfoMap.entrySet()) {
|
||||
if (filter != null && !filter.contains(missionProgress.getKey())) {
|
||||
continue;
|
||||
}
|
||||
Integer missionId = missionProgress.getKey();
|
||||
SActivityRewardConfig sActivityRewardConfig = SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId);
|
||||
if (sActivityRewardConfig == null) {
|
||||
continue;
|
||||
}
|
||||
if(id == ActivityType.RechargeTotal){
|
||||
// 2021-12-22 09:00:00 之后开的服,首充不显示累充满100元任务
|
||||
if (now > 1640134800000L) {
|
||||
int value = sActivityRewardConfig.getValues()[0][0];
|
||||
if (value == 100) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
ActivityProgressInfo activityProgressInfo = missionProgress.getValue();
|
||||
missionInfos.add(CommonProto.ActivityInfo.MissionInfo.newBuilder().setMissionId(missionId).setProgress(activityProgressInfo.getProgrss()).setState(activityProgressInfo.getState()).build());
|
||||
}
|
||||
|
|
|
@ -255,7 +255,6 @@ public class HeroLogic {
|
|||
|
||||
|
||||
public void random(ISession session, int type) throws Exception {
|
||||
long time = System.currentTimeMillis();
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
SLotterySetting sLotterySetting = STableManager.getConfig(SLotterySetting.class).get(type);
|
||||
|
@ -4014,6 +4013,81 @@ public class HeroLogic {
|
|||
MessageUtil.sendMessage(session, 1, responseMsgId, build, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 神将回退
|
||||
* 仅限6-9星神将
|
||||
* @param session
|
||||
* @param heroId
|
||||
* @throws Exception
|
||||
*/
|
||||
public void heroReturn(ISession session, String heroId) throws Exception {
|
||||
int uid = session.getUid();
|
||||
int responseMsgId = MessageTypeProto.MessageType.HERO_RETURN_RESPONSE_VALUE;
|
||||
User user = UserManager.getUser(uid);
|
||||
Hero hero = user.getHeroManager().getHero(heroId);
|
||||
if (hero == null || hero.getOriginalLevel() != 1) {
|
||||
throw new ErrorCodeException(ErrorCode.HERO_RETURN_ONLY_LEVEL_ONE);
|
||||
}
|
||||
SCHero scHero = SCHero.sCHero.get(hero.getTemplateId());
|
||||
int[][] returnBook = scHero.getReturnBook();
|
||||
if (returnBook == null || returnBook.length == 0) {
|
||||
throw new ErrorCodeException(ErrorCode.HERO_RETURN_CAN_NOT);
|
||||
}
|
||||
List<int[]> returnPercent = new ArrayList<>(5);
|
||||
for (int i = 0; i < returnBook.length; i++) {
|
||||
if (returnBook[i][0] == hero.getStar()) {
|
||||
returnPercent.add(returnBook[i]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (returnPercent.isEmpty()) {
|
||||
throw new ErrorCodeException(ErrorCode.HERO_RETURN_CAN_NOT);
|
||||
}
|
||||
int[][] returnReward = new int[returnPercent.size()][2];
|
||||
int j = -1;
|
||||
for (int[] ints : returnPercent) {
|
||||
for (int i = 1; i < ints.length; i++) {
|
||||
SHeroRankupGroup sHeroRankupGroup=STableManager.getConfig(SHeroRankupGroup.class).get(ints[i]);
|
||||
if (sHeroRankupGroup == null) {
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
int isSame = sHeroRankupGroup.getIssame();
|
||||
// int starLimit = sHeroRankupGroup.getStarLimit();
|
||||
// int isSameClan = sHeroRankupGroup.getIsSameClan();
|
||||
int isId = sHeroRankupGroup.getIsId();
|
||||
if (isSame == 1) {
|
||||
j++;
|
||||
returnReward[j][0] = hero.getTemplateId();
|
||||
returnReward[j][1] = ints[i];
|
||||
}
|
||||
if (isId != 0) {
|
||||
j++;
|
||||
returnReward[j][0] = isId;
|
||||
returnReward[j][1] = ints[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, returnReward, BIReason.HERO_RETURN);
|
||||
List<CommonProto.Item> itemList = drop.getItemlistList();
|
||||
List<Integer> itemId = new ArrayList<>(itemList.size());
|
||||
List<Integer> itemNum = new ArrayList<>(itemList.size());
|
||||
itemList.forEach(item -> {
|
||||
itemId.add(item.getItemId());
|
||||
itemNum.add((int) item.getItemNum());
|
||||
});
|
||||
// ReportUtil.onReportEvent(user, ReportEventEnum.HERO_RETURN.getType(), String.valueOf(hero.getTemplateId()), hero.getLevel(user.getHeroManager()), hero.getStar(), itemId, itemNum);
|
||||
hero.setLevel(1);
|
||||
hero.setBreakId(0);
|
||||
hero.setStar(5);
|
||||
//鸿蒙阵
|
||||
addOrUpdateHongmeng(session);
|
||||
HeroInfoProto.HeroReturnResponse build = HeroInfoProto.HeroReturnResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session, 1, responseMsgId, build, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 法宝归元
|
||||
*
|
||||
|
|
|
@ -21,7 +21,10 @@ import com.ljsd.jieling.logic.activity.ActivityType;
|
|||
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
||||
import com.ljsd.jieling.logic.activity.activityLogic.WeekCardLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.RechargeInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.VipInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||
|
|
|
@ -544,7 +544,8 @@ public class ItemUtil {
|
|||
private static void getMap(int itemId ,long itemNum,ItemMap itemObj,float dropRatio) throws ErrorCodeException{
|
||||
SItem sItem = SItem.getsItemMap().get(itemId);
|
||||
if(sItem==null){
|
||||
throw new ErrorCodeException("SItem配置不存在 id:"+itemId);
|
||||
LOGGER.info("getMap SItem配置不存在 id:{}", itemId);
|
||||
return;
|
||||
}
|
||||
int itemType =getItemType(sItem);
|
||||
long amount = MathUtils.numRount((itemNum * MathUtils.floatToDouble(dropRatio)));
|
||||
|
@ -1354,6 +1355,10 @@ public class ItemUtil {
|
|||
SItem sItem = SItem.getsItemMap().get(entry.getKey());
|
||||
extraDropAop(user,dropBuilder,sItem);
|
||||
}
|
||||
// 回退所得神将不更新任务或活动
|
||||
if (reason == BIReason.HERO_RETURN) {
|
||||
continue;
|
||||
}
|
||||
fiveStarEvent(user,entry.getKey());
|
||||
if(reason != BIReason.HERO_RANDOM){
|
||||
fiveStarPushByCombine(user,entry.getKey(),count);
|
||||
|
@ -1389,20 +1394,25 @@ public class ItemUtil {
|
|||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
int[] heroStar = SItem.getsItemMap().get(cardId).getHeroStar();
|
||||
Hero hero = new Hero(user.getId(),heroStar[0],heroStar[1]);
|
||||
if (hero.getStar() == GlobalsDef.WUJINGMIBAO_STAR){
|
||||
Poster.getPoster().dispatchEvent(new SummonTreasureEvent(user.getId(),hero.getStar(),1));
|
||||
if (reason != BIReason.HERO_RETURN) {
|
||||
if (hero.getStar() == GlobalsDef.WUJINGMIBAO_STAR){
|
||||
Poster.getPoster().dispatchEvent(new SummonTreasureEvent(user.getId(),hero.getStar(),1));
|
||||
}
|
||||
}
|
||||
heroManager.addHero(hero);
|
||||
// 鸿蒙阵推送
|
||||
HeroLogic.getInstance().addOrUpdateHongmeng(OnlineUserManager.getSessionByUid(user.getId()));
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
||||
if (reason != BIReason.HERO_RETURN && scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("lamp_lottery_content", new Object[]{playerInfoManager.getNameColor(), playerInfoManager.getNickName(), scHero.getStar(), scHero.getReadingName()},new int[]{0,0,0,1});
|
||||
if (!message.isEmpty()){
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,String.valueOf(hero.getTemplateId()),0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
if (reason != BIReason.HERO_RETURN) {
|
||||
return;
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,heroStar[0],heroStar[1]);
|
||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent,reason,GlobalsDef.addReason,cardId,1,heroStar[1]);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_HERO.getType(),String.valueOf(cardId),String.valueOf(hero.getStar()),String.valueOf(reason));
|
||||
|
|
|
@ -74,6 +74,8 @@ public class SCHero implements BaseConfig{
|
|||
|
||||
private Map<Integer, List<Integer>> skillListByStar;
|
||||
|
||||
private int[][] returnBook;
|
||||
|
||||
// 觉醒增加的技能属性
|
||||
private Map<Integer,TreeMap<Integer,List<Integer>>> awakSkillMap;
|
||||
|
||||
|
@ -378,4 +380,8 @@ public class SCHero implements BaseConfig{
|
|||
public int getIsSoulOpen() {
|
||||
return isSoulOpen;
|
||||
}
|
||||
|
||||
public int[][] getReturnBook() {
|
||||
return returnBook;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue