没小怪时不能使用炸弹
parent
9797af171b
commit
5c0a4802b9
|
|
@ -627,10 +627,6 @@ public class TowerMap extends AbstractMap {
|
|||
if(mapManager.getTrialInfo().getEnergy()==-1){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_BOSS);
|
||||
}
|
||||
boolean isUse = ItemUtil.itemCost(user,bomb,BIReason.BOMB_CONSUME,mapManager.getCurMapId());
|
||||
if(!isUse){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_NO_BOSS);
|
||||
}
|
||||
Map<Integer,SEventPointConfig> sEventPointConfig = STableManager.getConfig(SEventPointConfig.class);
|
||||
Set<Integer> destoryCell = new HashSet<>();
|
||||
Map<Integer, MapPointConfig> configMap = MapPointConfig.scMapEventMap;
|
||||
|
|
@ -656,6 +652,14 @@ public class TowerMap extends AbstractMap {
|
|||
destoryCell.add(entry.getValue().getPointId());
|
||||
}
|
||||
}
|
||||
if(monsterAmount==0){
|
||||
//没有小怪,无需使用炸弹
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
boolean isUse = ItemUtil.itemCost(user,bomb,BIReason.BOMB_CONSUME,mapManager.getCurMapId());
|
||||
if(!isUse){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_NO_BOSS);
|
||||
}
|
||||
LOGGER.info("几种:{}",mapInfo.size());
|
||||
int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray();
|
||||
BehaviorUtil.destoryPoints(user,x);
|
||||
|
|
|
|||
Loading…
Reference in New Issue