四灵bug修改和功能优化
parent
38130a2aa0
commit
11073857f8
|
|
@ -20,6 +20,8 @@ import org.springframework.stereotype.Component;
|
|||
import rpc.protocols.ActivityProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/***
|
||||
* 升级建木神树
|
||||
* @author hj
|
||||
|
|
@ -46,20 +48,30 @@ public class UpgradeGodTreeHandler extends BaseHandler<ActivityProto.UpgradeGodT
|
|||
if (!ifOpenGodTree){
|
||||
throw new ErrorCodeException(ErrorCode.PLAYER_LEVE_NOT,"条件不足,功能未开启");
|
||||
}
|
||||
|
||||
//当前等级
|
||||
int treeLevel = user.getPlayerInfoManager().getTreeLevel();
|
||||
// 升级次数
|
||||
int count = proto.getCount();
|
||||
// 消耗道具
|
||||
int[][] items = new int[count][];
|
||||
|
||||
// 读取升级配置表
|
||||
SGodHoodTreeLevel sGodHoodTreeLevel = STableManager.getConfig(SGodHoodTreeLevel.class).get(treeLevel);
|
||||
|
||||
// 等级不存在或已满级
|
||||
if (sGodHoodTreeLevel == null || sGodHoodTreeLevel.getLvupCost().length <= 0){
|
||||
throw new ErrorCodeException(ErrorCode.HAS_AWAKE,"建木神树已满级");
|
||||
ArrayList<Integer> list = new ArrayList<>();
|
||||
for (int i = 0; i < count; i++) {
|
||||
int level = treeLevel+i;
|
||||
// 读取升级配置表
|
||||
SGodHoodTreeLevel sGodHoodTreeLevel = STableManager.getConfig(SGodHoodTreeLevel.class).get(level);
|
||||
// 等级不存在或已满级
|
||||
if (sGodHoodTreeLevel == null || sGodHoodTreeLevel.getLvupCost().length <= 0) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE,"升级超最大等级,操作失败");
|
||||
}
|
||||
// 消耗
|
||||
items[i] = new int[]{sGodHoodTreeLevel.getLvupCost()[0],sGodHoodTreeLevel.getLvupCost()[1]};
|
||||
// 公告
|
||||
if (sGodHoodTreeLevel.getNeedBroadCast() == 1) {
|
||||
list.add(level);
|
||||
}
|
||||
}
|
||||
|
||||
int[][] items = new int[1][];
|
||||
items[0] = new int[]{sGodHoodTreeLevel.getLvupCost()[0],sGodHoodTreeLevel.getLvupCost()[1]};
|
||||
|
||||
// 消耗道具
|
||||
boolean cost = ItemUtil.itemCost(user, items, BIReason.UPGRADE_GOD_TREE, 1);
|
||||
if (!cost){
|
||||
|
|
@ -67,17 +79,18 @@ public class UpgradeGodTreeHandler extends BaseHandler<ActivityProto.UpgradeGodT
|
|||
}
|
||||
|
||||
// 神树升级
|
||||
user.getPlayerInfoManager().addTreeLevel(1);
|
||||
user.getPlayerInfoManager().addTreeLevel(count);
|
||||
|
||||
// 发送公告
|
||||
if (!list.isEmpty()) {
|
||||
for (Integer level : list) {
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("JianMuLevel_Hint", new Object[]{user.getPlayerInfoManager().getNickName(), level}, new int[]{0, 0});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message, Global.DILIGENT_NOTICE, "0", 0, 0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 阵容战力改变
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(uid));
|
||||
|
||||
// 发送公告
|
||||
if (sGodHoodTreeLevel.getNeedBroadCast() == 1){
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("JianMuLevel_Hint", new Object[]{user.getPlayerInfoManager().getNickName(), user.getPlayerInfoManager().getTreeLevel()},new int[]{0,0});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message, Global.DILIGENT_NOTICE, "0", 0, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
return ActivityProto.UpgradeGodTreeResponse.newBuilder().build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,6 +227,7 @@ public class FourChallengeLogic {
|
|||
if (help == 1){
|
||||
// 助战英雄使用状态修改
|
||||
helpHero.setState(1);
|
||||
HelpHeroLogic.addHelpHero(user.getId(),campId,helpHero);
|
||||
// 发送奖励
|
||||
HelpHeroLogic.getInstance().useHelpSendReward(helpHero);
|
||||
// 删除队伍中英雄id
|
||||
|
|
|
|||
|
|
@ -48,9 +48,13 @@ public class HelpHeroLogic {
|
|||
public static HelpHeroLogic getInstance() {
|
||||
return HelpHeroLogic.Instance.instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 我贡献的助战英雄
|
||||
*/
|
||||
public static final String MY = "MY";
|
||||
|
||||
/**
|
||||
* 我拿取的助战英雄
|
||||
*/
|
||||
public static final String CHOOSE = "CHOOSE";
|
||||
|
||||
public static String getSubKey(int uid,String sub){
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ public enum RankEnum {
|
|||
SHAN_HE_SHE_JI_STAR_RANK(30,RedisKey.SHAN_HE_SHE_JI_STAR_RANK,ShanHeSheJiTuStarRank::new,false),//山河社稷星星排行榜
|
||||
TA_SUI_LING_XIAO_RANK(31,RedisKey.TA_SUI_LING_XIAO_RANK,TaSuiLingXiaoRank::new,false),
|
||||
|
||||
FOUR_CHALLENGE_TIER_RANK(37,RedisKey.FOUR_CHALLENGE_TIER_RANK,SituationRank::new,false),//四灵试炼排行榜,param1:层数 param2:无 param3:无
|
||||
|
||||
// 以下为跨服排行榜
|
||||
WARLD_DIS_ARENA_RANK(28,RedisKey.WARLD_DIS_ARENA_RANK,ArenaRank::new,true),//世界服排行
|
||||
|
||||
|
|
@ -54,7 +56,6 @@ public enum RankEnum {
|
|||
CROSS_SHAN_HE_SHE_JI_STAR_RANK(35,RedisKey.SHAN_HE_SHE_JI_STAR_RANK,ForceRank::new,true),//山河社稷星星排行榜
|
||||
CROSS_GUILD_FORCE_RANK(36,RedisKey.GUILD_FORCE_RANK,CrossGuildForceRank::new,true),//跨服公会总战力排行
|
||||
|
||||
FOUR_CHALLENGE_TIER_RANK(37,RedisKey.FOUR_CHALLENGE_TIER_RANK,SituationRank::new,false),//四灵试炼排行榜,param1:层数 param2:无 param3:无
|
||||
;
|
||||
|
||||
private int type;
|
||||
|
|
|
|||
|
|
@ -1392,6 +1392,9 @@ public class ItemUtil {
|
|||
for (int[] costItem : costItems){
|
||||
int itemId = costItem[0];
|
||||
int itemNum = costItem[1];
|
||||
if (itemId == 0 || itemNum == 0){
|
||||
continue;
|
||||
}
|
||||
SItem sItem = SItem.getsItemMap().get(itemId);
|
||||
int itemType = getItemType(sItem);
|
||||
switch (itemType) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue