back_recharge
zhangshanxue 2020-06-03 17:02:38 +08:00
commit ea7f866fbe
10 changed files with 128 additions and 89 deletions

View File

@ -252,5 +252,7 @@ public interface BIReason {
int ECPEDITION_RELIVE_CONSUME = 1061;//大闹天宫消耗 int ECPEDITION_RELIVE_CONSUME = 1061;//大闹天宫消耗
int TRIAL_ADD_HP_CONSUME = 1062;//试炼回春散消耗
} }

View File

@ -17,6 +17,7 @@ import com.ljsd.jieling.logic.fight.GameFightType;
import com.ljsd.jieling.logic.fight.PVEFightEvent; import com.ljsd.jieling.logic.fight.PVEFightEvent;
import com.ljsd.jieling.logic.fight.PVPFightEvent; import com.ljsd.jieling.logic.fight.PVPFightEvent;
import com.ljsd.jieling.logic.fight.result.FightResult; import com.ljsd.jieling.logic.fight.result.FightResult;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.player.PlayerLogic; import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.logic.rank.RankEnum; import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.network.session.ISession;
@ -92,8 +93,7 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
} }
RankEnum.toRank(RankEnum.CAR_DEALY_RANK.getType()).incrementRankScore(uid,"",myscore); RankEnum.toRank(RankEnum.CAR_DEALY_RANK.getType()).incrementRankScore(uid,"",myscore);
RankEnum.toRank(RankEnum.CAR_DEALY_GUILD_RANK.getType()).incrementRankScore(guildInfo.getId(),"",gainScore,isNew?1:0); RankEnum.toRank(RankEnum.CAR_DEALY_GUILD_RANK.getType()).incrementRankScore(guildInfo.getId(),"",gainScore,isNew?1:0);
user.getUserMissionManager().onGameEvent(user, GameEvent.CAR_PLAY,1);
}break; }break;
case 2:{ case 2:{
@ -131,6 +131,7 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
String challenegeKey = RedisUtil.getInstence().getKey(RedisKey.CAR_CHALLENGE_RECORD, String.valueOf(challeageId)); String challenegeKey = RedisUtil.getInstence().getKey(RedisKey.CAR_CHALLENGE_RECORD, String.valueOf(challeageId));
RedisUtil.getInstence().zsetAddOne(key,content + "|" + challeageId,(int)(System.currentTimeMillis()/1000)); RedisUtil.getInstence().zsetAddOne(key,content + "|" + challeageId,(int)(System.currentTimeMillis()/1000));
RedisUtil.getInstence().zsetAddOne(challenegeKey,challengeContent + "|" + uid,(int)(System.currentTimeMillis()/1000)); RedisUtil.getInstence().zsetAddOne(challenegeKey,challengeContent + "|" + uid,(int)(System.currentTimeMillis()/1000));
user.getUserMissionManager().onGameEvent(user, GameEvent.CAR_PLAY_LOOT,1);
}break; }break;
default: default:
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);

View File

@ -2,7 +2,6 @@ package com.ljsd.jieling.handler.map;
import com.ljsd.fight.FightType; import com.ljsd.fight.FightType;
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig; import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
import com.ljsd.jieling.core.FunctionIdEnum;
import com.ljsd.jieling.core.GlobalsDef; import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.core.VipPrivilegeType; import com.ljsd.jieling.core.VipPrivilegeType;
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType; import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
@ -23,7 +22,6 @@ import com.ljsd.jieling.handler.mission.Mission;
import com.ljsd.jieling.ktbeans.KTGameType; import com.ljsd.jieling.ktbeans.KTGameType;
import com.ljsd.jieling.ktbeans.KtEventUtils; import com.ljsd.jieling.ktbeans.KtEventUtils;
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean; import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.OnlineUserManager; import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.activity.event.*; import com.ljsd.jieling.logic.activity.event.*;
import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.*;
@ -1342,14 +1340,9 @@ public class MapLogic {
//删点之前进行查找 //删点之前进行查找
if (sChallengeConfig.getType() == 2) { if (sChallengeConfig.getType() == 2) {
STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTrialInfo().getFloor()); STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTrialInfo().getFloor());
int[][] randomMonsterType = sTrialConfig.getRandomMonsterType();
if(cell.getCellId()!=mapManager.getBossXY()){ if(cell.getCellId()!=mapManager.getBossXY()){
if(mapManager.getTrialInfo().getEnergy()!=-1){ if(mapManager.getTrialInfo().getEnergy()!=-1){
if (randomMonsterType[0][1] == cell.getPointId()) { mapManager.setTrialEnergy(mapManager.getTrialInfo().getEnergy() + sTrialConfig.getNormalEnergy());
mapManager.setTrialEnergy(mapManager.getTrialInfo().getEnergy() + sTrialConfig.getNormalEnergy());
} else {
mapManager.setTrialEnergy(mapManager.getTrialInfo().getEnergy() + sTrialConfig.getEliteEnergy());
}
} }
} }
} }
@ -2575,15 +2568,30 @@ public class MapLogic {
MapManager mapManager = user.getMapManager(); MapManager mapManager = user.getMapManager();
TrialInfo trialInfo = mapManager.getTrialInfo(); TrialInfo trialInfo = mapManager.getTrialInfo();
Map<String, TrailHero> heroInfo = trialInfo.getHeroInfo(); Map<String, TrailHero> heroInfo = trialInfo.getHeroInfo();
if(mapManager.getCurMapId()==0){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
if(heroInfo.size()<1||!heroInfo.containsKey(heroId)){ if(heroInfo.size()<1||!heroInfo.containsKey(heroId)){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
} }
int[] healing = STrialSetting.sTrialSetting.getHealingId();
if(trialInfo.getAddHpCount()>=healing[1]){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
boolean itemCost = ItemUtil.itemCost(user, new int[][]{{healing[0],1}}, BIReason.TRIAL_ADD_HP_CONSUME, 1);
if(!itemCost){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
Map<Integer, Integer> propertyMap = heroInfo.get(heroId).getProperty(); Map<Integer, Integer> propertyMap = heroInfo.get(heroId).getProperty();
int curHp = propertyMap.get(HeroAttributeEnum.CurHP.getPropertyId()); int curHp = propertyMap.get(HeroAttributeEnum.CurHP.getPropertyId());
if(curHp==0){ if(curHp==0){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}else{ }else{
//todo 加血逻辑 //todo 加血逻辑
int maxHp = propertyMap.get(HeroAttributeEnum.Hp.getPropertyId());
propertyMap.put(HeroAttributeEnum.CurHP.getPropertyId(),curHp+maxHp*5000/10000);
trialInfo.getHeroInfo().get(heroId).setProperty(propertyMap);
mapManager.updateTrailHeroInfo(heroInfo);
} }
MessageUtil.sendMessage(session,1,messageType.getNumber(),null); MessageUtil.sendMessage(session,1,messageType.getNumber(),null);
} }
@ -3087,7 +3095,7 @@ public class MapLogic {
* @param messageType * @param messageType
* @throws Exception * @throws Exception
*/ */
public void trialGetBox(ISession session, MessageTypeProto.MessageType messageType) throws Exception { public void trialGetBox(ISession session,int type,MessageTypeProto.MessageType messageType) throws Exception {
User user = UserManager.getUser(session.getUid()); User user = UserManager.getUser(session.getUid());
MapManager mapManager = user.getMapManager(); MapManager mapManager = user.getMapManager();
AbstractMap map = getMap(user); AbstractMap map = getMap(user);
@ -3098,10 +3106,10 @@ public class MapLogic {
int floor = mapManager.getTrialInfo().getFloor(); int floor = mapManager.getTrialInfo().getFloor();
if(floor>10000){ if(floor>10000){
STrialwelfareConfig welfareConfig = STrialwelfareConfig.sTrialwelfareConfigMap.get(floor % 10000); STrialwelfareConfig welfareConfig = STrialwelfareConfig.sTrialwelfareConfigMap.get(floor % 10000);
drop = getBoxReward(welfareConfig.getBoxPosition(),welfareConfig.getBoxReward(),user,curXY); drop = getBoxReward(welfareConfig.getBoxPosition(),welfareConfig.getBoxReward(),user,curXY,type);
}else{ }else{
STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(floor); STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(floor);
drop = getBoxReward(sTrialConfig.getBoxPosition(),sTrialConfig.getBoxReward(),user,curXY); drop = getBoxReward(sTrialConfig.getBoxPosition(),sTrialConfig.getBoxReward(),user,curXY,type);
} }
} }
MapInfoProto.GetTrialBoxRewardResponse response = MapInfoProto.GetTrialBoxRewardResponse.newBuilder().setBoxDrop(drop).build(); MapInfoProto.GetTrialBoxRewardResponse response = MapInfoProto.GetTrialBoxRewardResponse.newBuilder().setBoxDrop(drop).build();
@ -3117,21 +3125,35 @@ public class MapLogic {
* @return * @return
* @throws Exception * @throws Exception
*/ */
private CommonProto.Drop.Builder getBoxReward(int[][] boxPosition,int[][][] boxReward,User user,int curXY) throws Exception { private CommonProto.Drop.Builder getBoxReward(int[][] boxPosition,int[][][] boxReward,User user,int curXY,int type) throws Exception {
MapManager mapManager = user.getMapManager(); MapManager mapManager = user.getMapManager();
CommonProto.Drop.Builder drop= null; CommonProto.Drop.Builder drop= null;
for(int i = 0 ; i<boxPosition.length;i++){ if(type==1){
int xyPos = CellUtil.xy2Pos(boxPosition[i][0], boxPosition[i][1]); List<int[][]> reward = Arrays.asList(boxReward);
Cell cell = mapManager.getMapInfo().get(xyPos); drop = ItemUtil.drop(user,reward,BIReason.MAP_EVENET_REWARD);
if(xyPos==curXY){ for(int[] position:boxPosition){
int xyPos = CellUtil.xy2Pos(position[0], position[1]);
Cell cell = mapManager.getMapInfo().get(xyPos);
if(cell!=null&&cell.getPointId()==STrialSetting.sTrialSetting.getBoxPointId()) { if(cell!=null&&cell.getPointId()==STrialSetting.sTrialSetting.getBoxPointId()) {
cell.setPointId(0); cell.setPointId(0);
int[][] dropArray = boxReward[i];
drop = ItemUtil.drop(user, dropArray, BIReason.MAP_EVENET_REWARD);
mapManager.addOrUpdateCell(cell.getCellId(), cell); mapManager.addOrUpdateCell(cell.getCellId(), cell);
break; }
}else{ }
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); }else{
for(int i = 0 ; i<boxPosition.length;i++){
int xyPos = CellUtil.xy2Pos(boxPosition[i][0], boxPosition[i][1]);
Cell cell = mapManager.getMapInfo().get(xyPos);
if(xyPos==curXY){
if(cell!=null&&cell.getPointId()==STrialSetting.sTrialSetting.getBoxPointId()) {
cell.setPointId(0);
int[][] dropArray = boxReward[i];
drop = ItemUtil.drop(user, dropArray, BIReason.MAP_EVENET_REWARD);
mapManager.addOrUpdateCell(cell.getCellId(), cell);
break;
}else{
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
} }
} }
} }

View File

@ -27,7 +27,7 @@ public class FightBehavior extends BaseBehavior {
// int triggerXY = mapManager.getTriggerXY(); // int triggerXY = mapManager.getTriggerXY();
// Cell cell = mapManager.getMapInfo().get(triggerXY); // Cell cell = mapManager.getMapInfo().get(triggerXY);
// STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTower()); // STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTower());
// int[][] randomMonsterType = sTrialConfig.getRandomMonsterType(); // int[][] randomMonsterType = sTrialConfig.getGameType();
// if (randomMonsterType[0][1] == cell.getPointId()) { // if (randomMonsterType[0][1] == cell.getPointId()) {
// mapManager.setEssenceValue(mapManager.getEssenceValue() + sTrialConfig.getNormalEnergy()); // mapManager.setEssenceValue(mapManager.getEssenceValue() + sTrialConfig.getNormalEnergy());
// } else { // } else {

View File

@ -4,6 +4,7 @@ import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.handler.map.MapLogic; import com.ljsd.jieling.handler.map.MapLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData; import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MapInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto; import com.ljsd.jieling.protocols.MessageTypeProto;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -13,7 +14,7 @@ import org.springframework.stereotype.Component;
* @discribe * @discribe
*/ */
@Component @Component
public class TrialGetBoxRewardHandler extends BaseHandler { public class TrialGetBoxRewardHandler extends BaseHandler<MapInfoProto.GetTrialBoxRewardRequest> {
@Override @Override
@ -22,7 +23,7 @@ public class TrialGetBoxRewardHandler extends BaseHandler {
} }
@Override @Override
public void process(ISession iSession, PacketNetData netData) throws Exception { public void processWithProto(ISession iSession, MapInfoProto.GetTrialBoxRewardRequest proto) throws Exception {
MapLogic.getInstance().trialGetBox(iSession,MessageTypeProto.MessageType.TRIAL_GET_BOX_RESPONSE); MapLogic.getInstance().trialGetBox(iSession,proto.getType(),MessageTypeProto.MessageType.TRIAL_GET_BOX_RESPONSE);
} }
} }

View File

@ -0,0 +1,27 @@
package com.ljsd.jieling.handler.map.mapHandler;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.handler.map.MapLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MapInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import org.springframework.stereotype.Component;
/**
* @author lvxinran
* @date 2020/6/3
* @discribe
*/
@Component
public class UseAddHpHandler extends BaseHandler<MapInfoProto.UseAddHpItemRequest> {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.TRIAL_USE_ADD_HP_ITEM_REQUEST;
}
@Override
public void processWithProto(ISession iSession, MapInfoProto.UseAddHpItemRequest proto) throws Exception {
MapLogic.getInstance().useAddHp(iSession,proto.getHeroId(), MessageTypeProto.MessageType.TRIAL_USE_ADD_HP_ITEM_RESPONSE);
}
}

View File

@ -1,14 +1,11 @@
package com.ljsd.jieling.handler.map.mapType; package com.ljsd.jieling.handler.map.mapType;
import com.ljsd.fight.CheckFight;
import com.ljsd.fight.FightType;
import com.ljsd.jieling.core.GlobalsDef; import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.db.redis.RedisKey; import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil; import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode; import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException; import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.globals.BIReason; import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.handler.map.*; import com.ljsd.jieling.handler.map.*;
import com.ljsd.jieling.handler.map.behavior.BaseBehavior; import com.ljsd.jieling.handler.map.behavior.BaseBehavior;
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil; import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
@ -24,22 +21,17 @@ import com.ljsd.jieling.logic.fight.PVEFightEvent;
import com.ljsd.jieling.logic.fight.result.FightResult; import com.ljsd.jieling.logic.fight.result.FightResult;
import com.ljsd.jieling.logic.hero.HeroAttributeEnum; import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
import com.ljsd.jieling.logic.mission.GameEvent; import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.store.StoreLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto; import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.FightInfoProto; import com.ljsd.jieling.protocols.FightInfoProto;
import com.ljsd.jieling.protocols.MapInfoProto; import com.ljsd.jieling.protocols.MapInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.util.*; import com.ljsd.jieling.util.*;
import config.*; import config.*;
import manager.STableManager; import manager.STableManager;
import org.luaj.vm2.LuaValue;
import util.CellUtil; import util.CellUtil;
import util.MathUtils; import util.MathUtils;
import util.TimeUtils; import util.TimeUtils;
import java.util.*; import java.util.*;
import java.util.stream.Stream;
/** /**
* @author lvxinran * @author lvxinran
@ -164,15 +156,8 @@ public class TowerMap extends AbstractMap {
//删点之前进行查找 //删点之前进行查找
STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTrialInfo().getFloor()); STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTrialInfo().getFloor());
Cell cell = mapManager.getMapInfo().get(mapManager.getTriggerXY()); Cell cell = mapManager.getMapInfo().get(mapManager.getTriggerXY());
int[][] randomMonsterType = sTrialConfig.getRandomMonsterType(); if(cell.getCellId()!=mapManager.getBossXY()&&mapManager.getTrialInfo().getEnergy()>=0){
if(cell.getCellId()!=mapManager.getBossXY()){ mapManager.setTrialEnergy(mapManager.getTrialInfo().getEnergy() + sTrialConfig.getNormalEnergy());
if(mapManager.getTrialInfo().getEnergy()>=0){
if (randomMonsterType[0][1] == cell.getPointId()) {
mapManager.setTrialEnergy(mapManager.getTrialInfo().getEnergy() + sTrialConfig.getNormalEnergy());
} else {
mapManager.setTrialEnergy(mapManager.getTrialInfo().getEnergy() + sTrialConfig.getEliteEnergy());
}
}
} }
} }
public void initMap(MapManager mapManager, User user) throws Exception { public void initMap(MapManager mapManager, User user) throws Exception {
@ -220,8 +205,8 @@ public class TowerMap extends AbstractMap {
Map<Integer, Cell> newMap = new HashMap<>(); Map<Integer, Cell> newMap = new HashMap<>();
Random random = new Random(); Random random = new Random();
Map<Integer, SCMap> scMap = SCMap.sCMap.get(sTrialConfig.getMapId()); Map<Integer, SCMap> scMap = SCMap.sCMap.get(sTrialConfig.getMapId());
Map<Integer, Cell> cellMap1 = new HashMap<>(sTrialConfig.getMonsterCount()[0]); Map<Integer, Cell> cellMap1 = new HashMap<>(sTrialConfig.getGameCount()[0]);
Map<Integer, Cell> cellMap2 = new HashMap<>(sTrialConfig.getMonsterCount()[1]); Map<Integer, Cell> cellMap2 = new HashMap<>(sTrialConfig.getGameCount()[1]);
/* if(mapManager.getTowerStartTime()!=0){ /* if(mapManager.getTowerStartTime()!=0){
mapManager.setCurrTowerTime((TimeUtils.now()-mapManager.getTowerStartTime())/1000); mapManager.setCurrTowerTime((TimeUtils.now()-mapManager.getTowerStartTime())/1000);
@ -243,7 +228,7 @@ public class TowerMap extends AbstractMap {
} }
if (scMap1.getEvent() == 1) { if (scMap1.getEvent() == 1) {
int i = 0; int i = 0;
while (cellMap1.size() < sTrialConfig.getMonsterCount()[0]) { while (cellMap1.size() < sTrialConfig.getGameCount()[0]) {
i++; i++;
if (i >= 10000) { if (i >= 10000) {
break; break;
@ -252,7 +237,7 @@ public class TowerMap extends AbstractMap {
int x = scMap1.getGroups()[randomIndex][0]; int x = scMap1.getGroups()[randomIndex][0];
int y = scMap1.getGroups()[randomIndex][1]; int y = scMap1.getGroups()[randomIndex][1];
int xy = CellUtil.xy2Pos(x, y); int xy = CellUtil.xy2Pos(x, y);
MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(sTrialConfig.getRandomMonsterType()[0][1]); MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(sTrialConfig.getGameType()[0][1]);
if (mapPointConfig == null) { if (mapPointConfig == null) {
LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}", scMap1.getEvent()); LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}", scMap1.getEvent());
continue; continue;
@ -262,7 +247,7 @@ public class TowerMap extends AbstractMap {
} }
} else if (scMap1.getEvent() == 2) { } else if (scMap1.getEvent() == 2) {
int i = 0; int i = 0;
while (cellMap2.size() < sTrialConfig.getMonsterCount()[1]) { while (cellMap2.size() < sTrialConfig.getGameCount()[1]) {
i++; i++;
if (i >= 10000) { if (i >= 10000) {
break; break;
@ -271,7 +256,7 @@ public class TowerMap extends AbstractMap {
int x = scMap1.getGroups()[randomIndex][0]; int x = scMap1.getGroups()[randomIndex][0];
int y = scMap1.getGroups()[randomIndex][1]; int y = scMap1.getGroups()[randomIndex][1];
int xy = CellUtil.xy2Pos(x, y); int xy = CellUtil.xy2Pos(x, y);
MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(sTrialConfig.getRandomMonsterType()[1][1]); MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(sTrialConfig.getGameType()[1][1]);
if (mapPointConfig == null) { if (mapPointConfig == null) {
LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}", scMap1.getEvent()); LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}", scMap1.getEvent());
continue; continue;
@ -279,7 +264,29 @@ public class TowerMap extends AbstractMap {
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId()); Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
cellMap2.put(xy, cellValue); cellMap2.put(xy, cellValue);
} }
} else { } else if (scMap1.getEvent()==99){
//每层只有四个怪
int i = 0;
int[] monster = MathUtils.randomFromWeightWithTaking(sTrialConfig.getMonsterPoint(),4);
while (cellMap2.size() < 4 ) {
if (i >= 10000) {
break;
}
int randomIndex = random.nextInt(scMap1.getGroups().length);
int x = scMap1.getGroups()[randomIndex][0];
int y = scMap1.getGroups()[randomIndex][1];
int xy = CellUtil.xy2Pos(x, y);
MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(monster[i]);
if (mapPointConfig == null) {
LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}", scMap1.getEvent());
continue;
}
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
cellMap2.put(xy, cellValue);
i++;
}
}
else {
// 随机出现的事件点 // 随机出现的事件点
int randomIndex = random.nextInt(scMap1.getGroups().length); int randomIndex = random.nextInt(scMap1.getGroups().length);
int x = scMap1.getGroups()[randomIndex][0]; int x = scMap1.getGroups()[randomIndex][0];

View File

@ -22,6 +22,7 @@ import com.ljsd.jieling.logic.fight.GameFightType;
import com.ljsd.jieling.logic.fight.PVEFightEvent; import com.ljsd.jieling.logic.fight.PVEFightEvent;
import com.ljsd.jieling.logic.fight.result.FightResult; import com.ljsd.jieling.logic.fight.result.FightResult;
import com.ljsd.jieling.logic.mail.MailLogic; import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.rank.RankContext; import com.ljsd.jieling.logic.rank.RankContext;
import com.ljsd.jieling.logic.rank.RankEnum; import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank; import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
@ -267,6 +268,7 @@ public class DeathPathLogic {
if(!deathMaxDamage.containsKey(pathId)||deathMaxDamage.get(pathId)<damage){ if(!deathMaxDamage.containsKey(pathId)||deathMaxDamage.get(pathId)<damage){
user.getGuildMyInfo().setDeathMaxDamage(pathId,damage); user.getGuildMyInfo().setDeathMaxDamage(pathId,damage);
} }
user.getUserMissionManager().onGameEvent(user, GameEvent.TEN_CHALLENGE,1);
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true); MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
} }

View File

@ -32,16 +32,11 @@ public class STrialConfig implements BaseConfig {
*/ */
private int isSaveFloor; private int isSaveFloor;
/** private int[][] gameType;
* "#id
* 1
* 2"
*/
private int[][] randomMonsterType;
/** /**
* *
*/ */
private int[] monsterCount; private int[] gameCount;
/** /**
* "# * "#
* 1boss * 1boss
@ -58,14 +53,10 @@ public class STrialConfig implements BaseConfig {
* *
*/ */
private int normalEnergy; private int normalEnergy;
/**
*
*/
private int eliteEnergy;
private int[][] randomStore; private int[][] randomStore;
private int[] monsterPoint; private int[][] monsterPoint;
/** /**
* *
*/ */
@ -89,12 +80,12 @@ public class STrialConfig implements BaseConfig {
return isSaveFloor; return isSaveFloor;
} }
public int[][] getRandomMonsterType() { public int[][] getGameType() {
return randomMonsterType; return gameType;
} }
public int[] getMonsterCount() { public int[] getGameCount() {
return monsterCount; return gameCount;
} }
public int[][] getRandomBossType() { public int[][] getRandomBossType() {
@ -105,10 +96,6 @@ public class STrialConfig implements BaseConfig {
return normalEnergy; return normalEnergy;
} }
public int getEliteEnergy() {
return eliteEnergy;
}
public int[][][] getRandomMapPointId() { public int[][][] getRandomMapPointId() {
return randomMapPointId; return randomMapPointId;
} }
@ -131,7 +118,7 @@ public class STrialConfig implements BaseConfig {
return boxPosition; return boxPosition;
} }
public int[] getMonsterPoint() { public int[][] getMonsterPoint() {
return monsterPoint; return monsterPoint;
} }
} }

View File

@ -23,15 +23,6 @@ public class STrialSetting implements BaseConfig{
} }
private int id; private int id;
/**
*
*/
private int dailyReset;
/**
*
*/
private int rebornTimes;
/** /**
* id * id
*/ */
@ -51,18 +42,13 @@ public class STrialSetting implements BaseConfig{
private int[] treasureProbability; private int[] treasureProbability;
//回春散
private int[] healingId;
public int getId() { public int getId() {
return id; return id;
} }
public int getDailyReset() {
return dailyReset;
}
public int getRebornTimes() {
return rebornTimes;
}
public int[][] getBombId() { public int[][] getBombId() {
return bombId; return bombId;
} }
@ -98,4 +84,8 @@ public class STrialSetting implements BaseConfig{
public int[] getTreasureProbability() { public int[] getTreasureProbability() {
return treasureProbability; return treasureProbability;
} }
public int[] getHealingId() {
return healingId;
}
} }