精英本扫荡

back_recharge
lvxinran 2019-07-15 16:34:26 +08:00
parent bbbd5d2344
commit 8e727965dd
8 changed files with 224 additions and 50 deletions

View File

@ -50,6 +50,11 @@ public class SChallengeConfig implements BaseConfig {
private int difficultType;
private int[] sweepingOpenRule;
private int[][] sweepingStoreProbability;
public int getId() {
return id;
}
@ -93,4 +98,12 @@ public class SChallengeConfig implements BaseConfig {
public int getDifficultType() {
return difficultType;
}
public int[] getSweepingOpenRule() {
return sweepingOpenRule;
}
public int[][] getSweepingStoreProbability() {
return sweepingStoreProbability;
}
}

View File

@ -577,8 +577,8 @@ public class MapLogic {
}
}
}
MapMissionManager.updateMapMission(mapManager, EventType.updateOptionalEvent, optionId, optionId);
MapMissionManager.updateMapMission(mapManager, EventType.updatePonintEvent, pointId, pointId);
MapMissionManager.updateMapMission(user, EventType.updateOptionalEvent, optionId, optionId);
MapMissionManager.updateMapMission(user, EventType.updatePonintEvent, pointId, pointId);
CommonProto.Drop.Builder dropBuilder = null;
if (sOptionConfig.getReward().length > 0) {
dropBuilder = ItemUtil.drop(user, sOptionConfig.getReward(), 1, 1, BIReason.MAP_EVENET_REWARD);
@ -816,11 +816,13 @@ public class MapLogic {
LOGGER.info("退出地图");
if(challengeConfig.getType()==2){
if(mapManager.getTower()>=1){
mapManager.setHighestTower(mapManager.getTower());
if(TowerRankUtil.getRankNumber(mapManager.getTower(),(int)(mapManager.getCurrTowerTime()/1000))>RedisUtil.getInstence().getZSetScore(RedisKey.TOWER_RANK, "", String.valueOf(user.getId()))){
RedisUtil.getInstence().zsetAddOne(RedisKey.getKey(RedisKey.TOWER_RANK,"",false),String.valueOf(user.getId()),TowerRankUtil.getRankNumber(mapManager.getTower(),(int)(mapManager.getCurrTowerTime()/1000)));
}
mapManager.setMapIntoFlag(1);
if(mapManager.getTower()==STrialConfig.getHighestTower()){
mapManager.setHighestTower(mapManager.getTower());
if(TowerRankUtil.getRankNumber(mapManager.getTower(),(int)(mapManager.getCurrTowerTime()/1000))>RedisUtil.getInstence().getZSetScore(RedisKey.TOWER_RANK, "", String.valueOf(user.getId()))){
RedisUtil.getInstence().zsetAddOne(RedisKey.getKey(RedisKey.TOWER_RANK,"",false),String.valueOf(user.getId()),TowerRankUtil.getRankNumber(mapManager.getTower(),(int)(mapManager.getCurrTowerTime()/1000)));
}
}
}
}
mapManager.setEssenceValue(0);
@ -960,7 +962,7 @@ public class MapLogic {
}
int[] checkResult = CheckFight.getInstance().checkFight(seed, mostTime, getFightData, getOptionData);
List<Integer> remainHp = new ArrayList<>(5);
for (int i = 1; i < checkResult.length; i++) {
for (int i = 2; i < checkResult.length; i++) {
if (checkResult[i] <= 0) {
remainHp.add(0);
} else {
@ -1012,7 +1014,7 @@ public class MapLogic {
for (TeamPosHeroInfo teamPosHeroInfo : team) {
// Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
// hero.setCurHp(checkResult[teamPosHeroInfo.getPosition()]);
mapManager.updateHeroOneAttribute(teamPosHeroInfo.getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[teamPosHeroInfo.getPosition()]);
mapManager.updateHeroOneAttribute(teamPosHeroInfo.getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[teamPosHeroInfo.getPosition()+1]);
}
BehaviorUtil.destoryApointXY(user, destoryXY);
@ -1045,7 +1047,7 @@ public class MapLogic {
fastFightResponse.setEssenceValue(mapManager.getEssenceValue());
// LOGGER.info("endFight() uid=>{},nextEventId=>{}", uid, nextEventId);
MapMissionManager.updateMapMission(mapManager, EventType.fightEvent, groupId, groupId);
MapMissionManager.updateMapMission(user, EventType.fightEvent, groupId, groupId);
// LOGGER.info("endFight() uid=>{} sMonsterGroup.getRewardgroup()=>{} misson=>{} eventDrop=>{}, missionDrop=>{}", uid, sMonsterGroup.getRewardgroup(), fastFightResponse.getMission(), fastFightResponse.getEnventDrop(), fastFightResponse.getMissionDrop());
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fastFightResponse.build(), true);
}
@ -1259,7 +1261,7 @@ public class MapLogic {
fightEndResponse.setEventId(nextEventId);
// LOGGER.info("endFight() uid=>{},nextEventId=>{}", uid, nextEventId);
MapMissionManager.updateMapMission(mapManager, EventType.fightEvent, monsterGroupId, monsterGroupId);
MapMissionManager.updateMapMission(user, EventType.fightEvent, monsterGroupId, monsterGroupId);
// LOGGER.info("endFight() uid=>{} sMonsterGroup.getRewardgroup()=>{} misson=>{} eventDrop=>{}, missionDrop=>{}", uid, sMonsterGroup.getRewardgroup(), fightEndResponse.getMission(), fightEndResponse.getEnventDrop(), fightEndResponse.getMissionDrop());
if (monsterGroupId == mapManager.getSuddenlyBoss()) {
mapManager.findSuddenlyBoss(0, 0);
@ -1492,42 +1494,64 @@ public class MapLogic {
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "not allowed");
return;
}
MapManager mapManager = user.getMapManager();
CrossInfo crossInfo = mapManager.getCrossInfoMap().get(mapId);
if (crossInfo == null) {
LOGGER.info("sweep 未三星通关");
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
return;
}
if (crossInfo.getStars().size() != 3) {
LOGGER.info("sweep 未三星通关");
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
return;
}
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapId);
int type = sChallengeConfig.getType();
if(type==3 || type==1){
int itemId = Global.GENERALSTORY_TICKET;
if (type == 3) {
itemId = Global.HEROSTORY_TICKET;
}
boolean enough = ItemUtil.itemCost(user, new int[][]{{itemId ,count}}, BIReason.MAP_ENTER_CONSUME, mapId);
if (!enough) {
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "no ticket");
MapManager mapManager = user.getMapManager();
if(sChallengeConfig.getSweepingOpenRule().length<1){
MessageUtil.sendErrorResponse(session,0,messageType.getNumber(),"该副本不可扫荡");
return;
}
if(sChallengeConfig.getSweepingOpenRule()[0]==1){
CrossInfo crossInfo = mapManager.getCrossInfoMap().get(mapId);
if (null == crossInfo||crossInfo.getStars().size() < sChallengeConfig.getSweepingOpenRule()[1]) {
LOGGER.info("sweep 未三星通关");
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
return;
}
SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder();
for (int i = 0; i < count; i++) {
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, sChallengeMapConfig.getSweepingAward(), 1, 0, BIReason.MAP_SWEEP_REWARD);
mapSweepResponse.addDrop(dropBuilder);
}else if(sChallengeConfig.getSweepingOpenRule()[0]==2){
MapMission copyMission = mapManager.getCopyMissionProgresById(sChallengeConfig.getMapId());
if(copyMission.getTotalWeight()<sChallengeConfig.getSweepingOpenRule()[1]){
LOGGER.info("sweep 功绩不足");
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
return;
}
user.getUserMissionManager().onGameEvent(user, GameEvent.STORY_FIGHT, mapId,1,count);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapSweepResponse.build(), true);
}else{
LOGGER.info("uid={},type={}",uid,type);
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "now sweep");
LOGGER.info("当前无类型");
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
return;
}
int type = sChallengeConfig.getType();
int itemId = Global.GENERALSTORY_TICKET;
if (type == 3) {
itemId = Global.HEROSTORY_TICKET;
}
boolean enough = ItemUtil.itemCost(user, new int[][]{{itemId ,count}}, BIReason.MAP_ENTER_CONSUME, mapId);
if (!enough) {
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "no ticket");
return;
}
MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder();
int hasStore = 0;
//随机云游商店
if(!user.getStoreManager().getStoreInfoMap().containsKey(3)){
int[][] sweepingStoreProbability = sChallengeConfig.getSweepingStoreProbability();
if(sweepingStoreProbability.length>0){
hasStore = MathUtils.randomFromWeight(sChallengeConfig.getSweepingStoreProbability());
if(hasStore==1){
StoreLogic.initOneStore(user,3);
mapSweepResponse.setCloudStore(hasStore);
}
}
}
SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
for (int i = 0; i < count; i++) {
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, sChallengeMapConfig.getSweepingAward(), 1, 0, BIReason.MAP_SWEEP_REWARD);
mapSweepResponse.addDrop(dropBuilder);
}
user.getUserMissionManager().onGameEvent(user, GameEvent.STORY_FIGHT, mapId,1,count);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapSweepResponse.build(), true);
}
@ -1539,7 +1563,7 @@ public class MapLogic {
* @param iSession
* @param msgId
*/
public void getAllLeveDifficultyInfos(ISession iSession, int msgId) throws Exception {
public void getAllLevelDifficultyInfos(ISession iSession, int msgId) throws Exception {
int uid = iSession.getUid();
User user = UserManager.getUser(uid);
LevelDifficultyManager levelDifficultyManager = user.getLevelDifficultyManager();

View File

@ -5,6 +5,7 @@ import com.ljsd.jieling.config.SAccomplishmentConfig;
import com.ljsd.jieling.config.SCHero;
import com.ljsd.jieling.config.SChallengeConfig;
import com.ljsd.jieling.logic.dao.Hero;
import com.ljsd.jieling.logic.dao.HeroManager;
import com.ljsd.jieling.logic.dao.TeamPosForPokenInfo;
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
import com.ljsd.jieling.logic.dao.root.User;
@ -56,8 +57,9 @@ public class MapMissionManager {
typeByEventTypeMap.put(EventType.passMap,missionTypes);
}
public static int updateMapMission(MapManager mapManager, int eventType, int eventId, int bossIdOrItemId){
LOGGER.info("the eventtype ={},eventId={},bossItemId={}",eventType,eventId,bossIdOrItemId);
public static int updateMapMission(User user, int eventType, int eventId, int time){
LOGGER.info("the eventtype ={},eventId={},bossItemId={}",eventType,eventId,time);
MapManager mapManager = user.getMapManager();
int mapId = mapManager.getCurMapId();
if(mapId==0){
return 0;
@ -100,6 +102,8 @@ public class MapMissionManager {
continue;
}
boolean isNeedReset = false;
for(SAccomplishmentConfig sAccomplishmentConfig : sAccomplishmentConfigs){
int missionId = sAccomplishmentConfig.getId();
Integer missionValue = allMissionProgress.get(missionId);
@ -108,6 +112,106 @@ public class MapMissionManager {
}
int score = sAccomplishmentConfig.getScore();
int[][] values = sAccomplishmentConfig.getValues();
//逻辑类型14
if(mapMissionType==MapMissionType.KILL_BOSS_IN_BOSS_EVENT){
boolean tempResult = true;
if(sChallengeConfig.getDifficultType()==sAccomplishmentConfig.getValues()[0][0]&&eventId==sAccomplishmentConfig.getValues()[0][1]){
HeroManager heroManager = user.getHeroManager();
Map<Integer, SCHero> scHeroMap = SCHero.getsCHero();
for(Map.Entry entry:mapManager.getHeroAllAttributeMap().entrySet()){
SCHero scHero = scHeroMap.get(heroManager.getHero(entry.getKey().toString()).getTemplateId());
if(scHero.getProfession()==sAccomplishmentConfig.getValues()[1][0]){
tempResult = false;
break;
}
}
}
if(tempResult){
allMissionProgress.put(missionId,-1);
}
}
//逻辑类型15
if(mapMissionType==mapMissionType.KILL_BOSS_INTIME_DIFFICULT_EVENT){
boolean tempResult = false;
if(sChallengeConfig.getDifficultType()==sAccomplishmentConfig.getValues()[0][0]&&eventId==sAccomplishmentConfig.getValues()[0][1]){
if(time<sAccomplishmentConfig.getValues()[1][0]){
tempResult = true;
}
}
if(tempResult){
allMissionProgress.put(missionId,-1);
}
}
//逻辑类型16
if(mapMissionType==mapMissionType.KILL_DIFFICULT_BOSS_WITH_TEAM_HERO_COUNT_EVENT){
boolean tempResult = false;
if(sChallengeConfig.getDifficultType()==sAccomplishmentConfig.getValues()[0][0]&&eventId==sAccomplishmentConfig.getValues()[0][1]) {
int alive = 0;
for(Map.Entry entry:mapManager.getHeroAllAttributeMap().entrySet()){
Map<Integer,Integer> value = (Map<Integer,Integer>)entry.getValue();
if(value.get(6)!=0){
alive++;
}
}
if(alive>=sAccomplishmentConfig.getValues()[1][0]){
tempResult = true;
}
}
if(tempResult){
allMissionProgress.put(missionId,-1);
}
}
//逻辑类型19
if(mapMissionType==mapMissionType.KILL_MONSTER_BY_ORDER_DIFFICULT_MAP_EVENT){
if(sChallengeConfig.getDifficultType()!=sAccomplishmentConfig.getValues()[1][0]){
continue;
}
int[] value = sAccomplishmentConfig.getValues()[0];
for(int i = 0 ; i < value.length ; i++){
if(eventId!=value[i]) {
continue;
}
if(i==0&&missionValue==0){
missionValue = value[i];
}else if(i!=0&&missionValue==value[i-1]){
if(i!=value.length-1){
missionValue = value[i];
}else{
missionValue = -1;
}
}else{
missionValue = 0;
}
}
allMissionProgress.put(missionId,missionValue);
}
//逻辑类型18
if(mapMissionType==mapMissionType.FINISH_EVENT_BY_ORDER_DIFFICULT_MAP_EVENT){
int[][] configValues = sAccomplishmentConfig.getValues();
if(sChallengeConfig.getDifficultType()!=configValues[configValues.length-1][0]){
continue;
}
for(int i = 0 ; i <configValues.length-1;i++){
if(eventId!=configValues[i][0]){
continue;
}else if(eventId==configValues[missionValue][0]){
missionValue++;
}else{
missionValue = 0;
}
}
allMissionProgress.put(missionId,missionValue);
}
if(mapMissionType==mapMissionType.NOT_EVENT_FINISH_EVENT_DIFFICULT_MAP_EVENT){
}
int targetEventValue = values[1][0];
if(!updateProgress){
for(int targetEventIdTmp : values[0]){
@ -173,6 +277,7 @@ public class MapMissionManager {
List<MapMissionType> mapMissionTypes = typeByEventTypeMap.get(EventType.passMap);
boolean needUpdate = false;
Set<Integer> takeCopyMisionRewards = mapManager.getTakeCopyMisionRewards();
int addScore = 0;
for(MapMissionType mapMissionType : mapMissionTypes){
List<SAccomplishmentConfig> sAccomplishmentConfigs = SAccomplishmentConfig.getsAccomplishmentConfigByMapIdAndLogic(mapId, mapMissionType.getMissionTypeValue());
if(sAccomplishmentConfigs == null){
@ -218,6 +323,7 @@ public class MapMissionManager {
MissionStateChangeInfo missionStateChangeInfo = new MissionStateChangeInfo(missionId,MissionState.FINISH,missionValue+1);
readySendCopyMission(missionStateChangeInfo);
needUpdate =true;
addScore+=sAccomplishmentConfig.getScore();
}
}else if(mapMissionType == MapMissionType.PASS_INTIME_MAP || mapMissionType == MapMissionType.PASS_TEAM_FORCE_EVENT || mapMissionType == MapMissionType.PASS_DEATH_MAP_EVENT ){
if(parm<targetEventValue){
@ -225,6 +331,7 @@ public class MapMissionManager {
MissionStateChangeInfo missionStateChangeInfo = new MissionStateChangeInfo(missionId,MissionState.FINISH,missionValue+1);
readySendCopyMission(missionStateChangeInfo);
needUpdate =true;
addScore+=sAccomplishmentConfig.getScore();
}
}else{
if(missionValue<targetEventValue){
@ -232,6 +339,7 @@ public class MapMissionManager {
MissionState misisionState = MissionState.DOING;
if(missionValue+1 == targetEventValue){
misisionState= MissionState.FINISH;
addScore+=sAccomplishmentConfig.getScore();
}
MissionStateChangeInfo missionStateChangeInfo = new MissionStateChangeInfo(missionId,misisionState,missionValue+1);
readySendCopyMission(missionStateChangeInfo);
@ -244,6 +352,9 @@ public class MapMissionManager {
}
}
if(needUpdate){
if(addScore!=0){
copyMissionProgres.setTotalWeight(copyMissionProgres.getTotalWeight() + addScore);
}
user.getMapManager().setCopyMissionProgres(copyMissionProgres);
}
}

View File

@ -25,7 +25,7 @@ public class DunBehavior extends BaseBehavior {
List<Integer> randomAEvents = MathUtils.randomForOneArray(behaviorTypeValues[1], randomANums);
List<Integer> randomBEvents = MathUtils.randomForOneArray(behaviorTypeValues[2], randomBNums);
randomBEvents.addAll(randomAEvents);
List<Integer> randomABPosList = MathUtils.randomForOneArray(behaviorTypeValues[3], randomBNums);
List<Integer> randomABPosList = MathUtils.randomForOneArray(behaviorTypeValues[3], randomBNums+randomANums);
for(Integer pos : randomABPosList){
eventUpdateResponse.addAddMapInfo(CommonProto.Cell.newBuilder()
.setCellId(pos)

View File

@ -17,6 +17,6 @@ public class GetAllLeveDifficultyInfostHandler extends BaseHandler {
@Override
public void process(ISession iSession, PacketNetData netData) throws Exception {
MapLogic.getInstance().getAllLeveDifficultyInfos(iSession,MessageTypeProto.MessageType.GET_ALL_LEVE_DIFFICULTT_RESPONSE_VALUE);
MapLogic.getInstance().getAllLevelDifficultyInfos(iSession,MessageTypeProto.MessageType.GET_ALL_LEVE_DIFFICULTT_RESPONSE_VALUE);
}
}

View File

@ -100,7 +100,7 @@ public class CheckFight {
* @param seed
* @param fightData
* @param optionData
* @return {,1,2,3,4,5}
* @return {,1,2,3,4,5}
*/
public synchronized int[] checkFight(int seed,int maxTime, LuaValue fightData, LuaValue optionData){
LuaValue func = transCoderObj.get(LuaValue.valueOf("Execute"));
@ -109,12 +109,14 @@ public class CheckFight {
args.set("maxTime",maxTime);
LuaValue result = func.call( args,fightData,optionData);
int status = result.get("result").toint();
int[] resultCache = new int[6];
int duration = result.get("duration").toint();
int[] resultCache = new int[7];
resultCache[0]=status;
resultCache[1]=duration;
LOGGER.info(" lua check test fight result : "+ status);
for (int i = 1; i <= result.length(); i++) {
resultCache[i] = result.rawget(i).toint();
LOGGER.info(i+" --> 单位剩余血量 : "+ resultCache[i]);
resultCache[i+1] = result.rawget(i).toint();
LOGGER.info(i+" --> 单位剩余血量 : "+ resultCache[i+1]);
}
return resultCache;

View File

@ -160,7 +160,8 @@ public class MissionLoigc {
}
SAccomplishmentConfig sAccomplishmentConfig = SAccomplishmentConfig.getsAccomplishmentConfigByIdMap(missionId);
int mapId = sAccomplishmentConfig.getMapId();
Map<Integer, Integer> allMissionProgress = user.getMapManager().getCopyMissionProgresById(mapId).getAllMissionProgress();
MapMission copyMission = user.getMapManager().getCopyMissionProgresById(mapId);
Map<Integer, Integer> allMissionProgress = copyMission.getAllMissionProgress();
int finsihProgress = SAccomplishmentConfig.getsAccomplishmentConfigByIdMap(missionId).getValues()[1][0];
if(!allMissionProgress.containsKey(missionId) || (allMissionProgress.get(missionId)!=-1&&allMissionProgress.get(missionId) <finsihProgress) ){
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,"mission can not get reward");

View File

@ -0,0 +1,23 @@
package com.ljsd.jieling.logic.store;
public enum StoreType {
SOUL_STORE(1),
GENERAL_STORE(2),
CLOUD_STORE(3),
ARENA_STORE(4),
SOUL_CRYSTAL_STORE(5),
SECRET_STORE(6),
FUNCTION_STORE(7),
TRIAL_STORE(8)
;
private int type;
private StoreType(int type) {
this.type = type;
}
public int getType() {
return type;
}
}