森罗环境游戏等级限制加入提交
parent
25ff3772e9
commit
a7346c0837
|
@ -54,6 +54,7 @@ public class TowerMap extends AbstractMap {
|
|||
mapManager.updateTrialMapInfo(mapManager.getMapInfo());
|
||||
mapManager.updateTrialCurXY(mapManager.getCurXY());
|
||||
mapManager.updateTrialExitMapId(mapManager.getCurMapId());
|
||||
// ItemUtil.addTemporaryItemToBag(user,mapManager.getTemporaryItems(),true);
|
||||
if(mapManager.getTowerUnusedBuffer()!=null){
|
||||
mapManager.setTowerUnusedBuffer(new HashMap<>());
|
||||
}
|
||||
|
@ -107,14 +108,6 @@ public class TowerMap extends AbstractMap {
|
|||
}else{
|
||||
super.enterMap(uid, mapId, teamId,mapEnterResponse);
|
||||
}
|
||||
// if(mapManager.getTowerUnusedBuffer()!=null&&mapManager.getTowerUnusedBuffer().size()>=1){
|
||||
// List<MapInfoProto.TowerBuff> towerBuffs = new ArrayList<>();
|
||||
// for(Map.Entry<Integer,Integer> buffer:mapManager.getTowerUnusedBuffer().entrySet()){
|
||||
// TowerBuff towerBuff = new TowerBuff(buffer.getKey(),buffer.getValue());
|
||||
// towerBuffs.add(CBean2Proto.getTowerBuff(towerBuff));
|
||||
// }
|
||||
// MapEnterResponse.addAllBuf(towerBuffs);
|
||||
// }
|
||||
Map<String, TrailHero> heroInfo = trialInfo.getHeroInfo();
|
||||
if(!heroInfo.isEmpty()){
|
||||
for(Map.Entry<String,TrailHero> entry:heroInfo.entrySet()){
|
||||
|
@ -178,29 +171,6 @@ public class TowerMap extends AbstractMap {
|
|||
int floor = mapManager.getTrialInfo().getFloor();
|
||||
STrialConfig sTrialConfig;
|
||||
if(floor>10000){
|
||||
// int realFloor = floor%10000;
|
||||
// Map<Integer,STrialwelfareConfig> welfareMap = STableManager.getConfig(STrialwelfareConfig.class);
|
||||
// STrialwelfareConfig useConfig = null;
|
||||
// for(STrialwelfareConfig config :welfareMap.values()){
|
||||
// int[] section = config.getSection();
|
||||
// if(realFloor>section[0]&&realFloor<=section[1]){
|
||||
// useConfig = config;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// Map<Integer, Cell> newMap = new HashMap<>();
|
||||
// if(useConfig!=null&&useConfig.getBoxPosition()!=null){
|
||||
// for(int[] position:useConfig.getBoxPosition()){
|
||||
// int cellXY = CellUtil.xy2Pos(position[0], position[1]);
|
||||
// Cell cell = new Cell(cellXY,0,STrialSetting.sTrialSetting.getBoxPointId());
|
||||
// newMap.put(cellXY,cell);
|
||||
// }
|
||||
// }
|
||||
// //生成普通传送门
|
||||
|
||||
// mapManager.setMapInfo(newMap);
|
||||
// return;
|
||||
|
||||
TreeMap<Integer,STrialConfig> sTrialConfigMap = (TreeMap<Integer,STrialConfig>) STrialConfig.sTrialConfigMap;
|
||||
sTrialConfig = sTrialConfigMap.ceilingEntry(floor).getValue();
|
||||
}else{
|
||||
|
@ -223,9 +193,6 @@ public class TowerMap extends AbstractMap {
|
|||
Map<Integer, Cell> cellMap3 = new HashMap<>(sTrialConfig.getGameCount()[2]);
|
||||
Map<Integer, Cell> cellMap4 = new HashMap<>(4);//4个怪
|
||||
|
||||
/* if(mapManager.getTowerStartTime()!=0){
|
||||
mapManager.setCurrTowerTime((TimeUtils.now()-mapManager.getTowerStartTime())/1000);
|
||||
}*/
|
||||
int boxPointId = STrialSetting.sTrialSetting.getBoxPointId();
|
||||
mapManager.setTowerStartTime(TimeUtils.now());
|
||||
for(int[] box:sTrialConfig.getBoxPosition()){
|
||||
|
@ -454,6 +421,7 @@ public class TowerMap extends AbstractMap {
|
|||
SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(groupId);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sMonsterGroup.getRewardgroup(), 1, 1, BIReason.MAP_FAST_FIGHT_REWARD);
|
||||
|
||||
// mapManager.
|
||||
if (mapManager.getMonsterId() > 0) {
|
||||
BaseBehavior baseBehavior = baseBehaviorMap.get(10);
|
||||
baseBehavior.afterFastFight(user, groupId, fastFightResponseBuilder);
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.Set;
|
|||
* @discribe 探索游戏,炸弹gg
|
||||
*/
|
||||
@Component
|
||||
public class BombGame implements MapGame {
|
||||
public class BombGame extends ColorGame {
|
||||
@Override
|
||||
public int getType() {
|
||||
return 18;
|
||||
|
@ -32,7 +32,7 @@ public class BombGame implements MapGame {
|
|||
@Override
|
||||
public void initGame(User user) {
|
||||
int type = getType();
|
||||
List<STrialGameConfig> configs = STrialGameConfig.trialGameMapByType.get(type);
|
||||
List<STrialGameConfig> configs =getUnlockConfigs(user);
|
||||
int[] idArray = new int[configs.size()];
|
||||
int index = 0 ;
|
||||
for(STrialGameConfig config:configs){
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.List;
|
|||
* @discribe 轮盘游戏
|
||||
*/
|
||||
@Component
|
||||
public class CircleGame implements MapGame {
|
||||
public class CircleGame extends ColorGame{
|
||||
@Override
|
||||
public int getType() {
|
||||
return 17;
|
||||
|
@ -28,7 +28,7 @@ public class CircleGame implements MapGame {
|
|||
@Override
|
||||
public void initGame(User user) {
|
||||
int type = getType();
|
||||
List<STrialGameConfig> configs = STrialGameConfig.trialGameMapByType.get(type);
|
||||
List<STrialGameConfig> configs =getUnlockConfigs(user);
|
||||
int[] idArray = new int[configs.size()];
|
||||
int index = 0 ;
|
||||
for(STrialGameConfig config:configs){
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package com.ljsd.jieling.handler.map.miniGame;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
import config.STrialGameConfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/6/25
|
||||
* @discribe
|
||||
*/
|
||||
public abstract class ColorGame implements MapGame {
|
||||
|
||||
|
||||
@Override
|
||||
public abstract int getType();
|
||||
|
||||
@Override
|
||||
public abstract void initGame(User user);
|
||||
|
||||
@Override
|
||||
public abstract MapInfoProto.MapGameUpdateResponse updateGame(User user, Object... params) throws Exception;
|
||||
|
||||
protected List<STrialGameConfig> getUnlockConfigs(User user){
|
||||
int level = user.getPlayerInfoManager().getLevel();
|
||||
List<STrialGameConfig> configs = STrialGameConfig.trialGameMapByType.get(getType());
|
||||
if(configs==null||configs.isEmpty()){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<STrialGameConfig> collect = configs.stream().filter(config -> config.getUnlockLv() > level).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
}
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
|||
* @discribe 招财猫游戏
|
||||
*/
|
||||
@Component
|
||||
public class MapLuckyCatGame implements MapGame {
|
||||
public class MapLuckyCatGame extends ColorGame {
|
||||
@Override
|
||||
public int getType() {
|
||||
return 16;
|
||||
|
@ -27,7 +27,7 @@ public class MapLuckyCatGame implements MapGame {
|
|||
@Override
|
||||
public void initGame(User user) {
|
||||
int type = getType();
|
||||
List<STrialGameConfig> configs = STrialGameConfig.trialGameMapByType.get(type);
|
||||
List<STrialGameConfig> configs =getUnlockConfigs(user);
|
||||
int[][] idArray = new int[configs.size()][];
|
||||
int i = 0 ;
|
||||
for(STrialGameConfig config:configs){
|
||||
|
|
|
@ -23,6 +23,8 @@ public class STrialGameConfig implements BaseConfig {
|
|||
|
||||
private int max;
|
||||
|
||||
private int unlockLv;
|
||||
|
||||
public static Map<Integer,STrialGameConfig> trialGameConfigMap;
|
||||
|
||||
public static Map<Integer, List<STrialGameConfig>> trialGameMapByType;
|
||||
|
@ -63,5 +65,7 @@ public class STrialGameConfig implements BaseConfig {
|
|||
return max;
|
||||
}
|
||||
|
||||
|
||||
public int getUnlockLv() {
|
||||
return unlockLv;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue