添加关卡附加条件功能提交
parent
9a7a6f71f5
commit
8a77b7c2d5
|
@ -34,8 +34,10 @@ import com.ljsd.jieling.logic.dao.*;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageLogic;
|
||||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
|
||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
|
@ -2102,6 +2104,11 @@ public class MapLogic {
|
|||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
boolean isOpenRule=CheckFigthLevelOpen(user,sMainLevelConfig.getOpenRule());
|
||||
if (!isOpenRule){
|
||||
LOGGER.info("startMainLevelFight==> uid={},fightId={}, levelDifficulty is not allow ", uid, fightId);
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
if (teamPosHeroInfos == null || teamPosHeroInfos.size() == 0) {
|
||||
|
@ -2123,6 +2130,71 @@ public class MapLogic {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测附加关卡解锁条件
|
||||
* 0:无限制
|
||||
* 1:山河星数(3-20后)
|
||||
* 2:心魔层数(3-10后)
|
||||
* 3:鸿蒙阵等级(6-15后)
|
||||
* 4:指定星级(运算星级)装备数量(初始可用)
|
||||
* 5:英雄总好感度等级(5-10后)
|
||||
* @param user
|
||||
* @param openRule
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private boolean CheckFigthLevelOpen(User user,int[][] openRule) throws Exception {
|
||||
boolean isOpen = true;
|
||||
for (int[] ints : openRule) {
|
||||
int type = ints[0];
|
||||
if (type == 0) {
|
||||
break;
|
||||
}
|
||||
switch (type) {
|
||||
case 1:{
|
||||
if (ints[1]> HardStageLogic.getHardStageStarsSum(user)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (ints[1]> user.getMapManager().getLastMonsterAttack()-1) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3:{
|
||||
HongMengAddAttribute hongMengAddAttribute = user.getHeroManager().getResonanceAddition().get(HongMengAttributeEnum.LEVEL);
|
||||
if (hongMengAddAttribute==null||ints[1]> hongMengAddAttribute.value) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4:{
|
||||
int num=0;
|
||||
Map<Integer,SEquipConfig>equipConfig=STableManager.getConfig(SEquipConfig.class);
|
||||
for (Map.Entry<Integer, Long> entry : user.getItemManager().getEquipBookMap().entrySet()) {
|
||||
if (equipConfig.get(entry.getKey()).getStar()>=ints[1]) {
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if (ints[2]>num) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5:{
|
||||
if (ints[1]> user.getHeroManager().GetAllLikableLv()) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return isOpen;
|
||||
}
|
||||
|
||||
public void endMainLevelFight(ISession session, String frames, int fightId, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
|
|
|
@ -15,6 +15,8 @@ public class SMainLevelConfig implements BaseConfig {
|
|||
|
||||
private int levelLimit;
|
||||
|
||||
private int[][] openRule;//附加关卡解锁条件
|
||||
|
||||
private int monsterGroup;
|
||||
|
||||
private int[] reward;
|
||||
|
@ -31,6 +33,7 @@ public class SMainLevelConfig implements BaseConfig {
|
|||
|
||||
private int[][] invasionBossReward;
|
||||
|
||||
|
||||
private int invasionBossTime;
|
||||
|
||||
private int invasionBossRefresh;
|
||||
|
@ -143,4 +146,8 @@ public class SMainLevelConfig implements BaseConfig {
|
|||
public int getPlotId() {
|
||||
return storyId;
|
||||
}
|
||||
|
||||
public int[][] getOpenRule() {
|
||||
return openRule;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue