back_recharge
lvxinran 2019-07-25 11:08:09 +08:00
commit 08153b9bfd
8 changed files with 27 additions and 17 deletions

View File

@ -22,24 +22,24 @@ public class DunBehavior extends BaseBehavior {
@Override
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
/* int[] behaviorTypeValue = behaviorTypeValues[0];
int[] behaviorTypeValue = behaviorTypeValues[0];
int randomANums = behaviorTypeValue[0];
int randomBNums = behaviorTypeValue[1];
if(randomANums!=0 || randomBNums!=0){
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+randomANums);
MapManager mapManager = user.getMapManager();
List<Integer> randomABPosList = MathUtils.randomForOneArray(behaviorTypeValues[3], randomBNums);
for(Integer pos : randomABPosList){
Integer eventId = randomBEvents.remove(0);
Integer pointId = randomBEvents.remove(0);
eventUpdateResponse.addAddMapInfo(CommonProto.Cell.newBuilder()
.setCellId(pos)
.setPointId(eventId)
.setPointId(randomBEvents.remove(0))
.build());
BehaviorUtil.addBehaviorInfo(eventId,user.getMapManager(),pos);
BehaviorUtil.addBehaviorInfo(pointId,mapManager,pos);
}
}
return true;*/
return false;
return true;
}
}

View File

@ -589,7 +589,8 @@ public class ArenaLogic {
if(type == GlobalsDef.ARENA_DAILY_REWARD){
MissionEventDistributor.requestStart();
user.getUserMissionManager().onGameEvent(user,GameEvent.ARENA_UPDATE_RANK,-rank);
user.getUserMissionManager().onGameEvent(user,GameEvent.ARENA_UPDATE_RANK,rank);
user.getPlayerInfoManager().removeRed(GlobalsDef.ARENA_CHALLENGE_TYPE);
ISession sessionByUid = OnlineUserManager.getSessionByUid(uid);
if(sessionByUid!=null){
MissionEventDistributor.requestEnd(sessionByUid,true);

View File

@ -38,6 +38,8 @@ public class CumulationData {
*/
private Map<Integer,Integer> heroLevleCountMap = new HashMap<>();
public Map<Integer,Integer> levlePassMap = new HashMap<>();
/**
* key: value:
*/
@ -103,6 +105,7 @@ public class CumulationData {
exploreFight.clear();
storyFightInfo.clear();
heroLevleCountMap.clear();
levlePassMap.clear();
clearArray(sEquipQualityCount);
clearArray(heroQualityCount);
}

View File

@ -231,8 +231,8 @@ public class HeroLogic {
if( (alreadyCount + perCount)/lotterySecurityReward[0] > alreadyCount/lotterySecurityReward[0]){
builder.setExtraBox(ItemUtil.drop(user, new int[]{lotterySecurityReward[1]},1F,0,BIReason.HERO_RANDOM));
}
user.getUserMissionManager().onGameEvent(user,GameEvent.RANDOM_HERO,sLotterySetting.getLotteryType(),perCount);
}
user.getUserMissionManager().onGameEvent(user,GameEvent.RANDOM_HERO,sLotterySetting.getLotteryType(),perCount);
heroManager.updateRandCount(type,randCount);
if(tenTimesMustGetItem!=null){
for(int i=0;i<tenTimesMustGetItem.length;i++){

View File

@ -319,10 +319,10 @@ public class MissionLoigc {
count = cumulationData.getsEquipQualityCount()[missionSubType[0]-1];
break;
case LEVEL_STORY_PASS:
if(SLevelDifficultyConfig.getLevelDifficultyMap().containsKey(missionSubType)){
int type = SLevelDifficultyConfig.getLevelDifficultyMap().get(missionSubType).getType();
if(cumulationData.getHeroLevleCountMap().containsKey(type)){
count =missionSubType[0] <=cumulationData.getHeroLevleCountMap().get(type) ?1:0;
if(SLevelDifficultyConfig.getLevelDifficultyMap().containsKey(missionSubType[0])){
int type = SLevelDifficultyConfig.getLevelDifficultyMap().get(missionSubType[0]).getType();
if(cumulationData.levlePassMap.containsKey(type)){
count =missionSubType[0] <=cumulationData.levlePassMap.get(type) ?1:0;
}
}

View File

@ -20,14 +20,14 @@ public class FightDataManager implements BaseDataManager{
}else if(missionType == MissionType.LEVEL_STORY_PASS){
LevelDifficulty levelDifficulty = SLevelDifficultyConfig.getLevelDifficultyMap().get(fightId);
int type = levelDifficulty.getType();
Integer maxFightId = data.getHeroLevleCountMap().get(type);
Integer maxFightId = data.levlePassMap.get(type);
if(maxFightId!=null){
if(fightId>maxFightId){
data.getHeroLevleCountMap().put(type,fightId);
data.levlePassMap.put(type,fightId);
result = new CumulationData.Result(missionType);
}
}else{
data.getHeroLevleCountMap().put(type,fightId);
data.levlePassMap.put(type,fightId);
result = new CumulationData.Result(missionType);
}
}

View File

@ -35,6 +35,7 @@ public class MissionEventDistributor {
List<MissionType> typeList = new ArrayList<>();
typeList.add(MissionType.RECRUITMENT_RANDOM_HEROES);
typeList.add(MissionType.ELEMENT_RANDOM_TIMES);
eventEnumListMap.put(GameEvent.RANDOM_HERO,typeList);
eventProcessor.put(GameEvent.RANDOM_HERO,new CumulationDataEventProcessor());
@ -117,6 +118,8 @@ public class MissionEventDistributor {
typeList = new ArrayList<>();
typeList.add(MissionType.HERO_STORY_PLAY_TIMES);
typeList.add(MissionType.INVASIONBOSS_PLAY_TIMES);
typeList.add(MissionType.FAST_ADVENTUREREWARD_TIMES);
eventEnumListMap.put(GameEvent.PlAY_STORY,typeList);
eventProcessor.put(GameEvent.PlAY_STORY,new CumulationDataEventProcessor());

View File

@ -83,13 +83,16 @@ public class TreasureMissionType extends AbstractMissionType{
if(takeTimes == null){
takeTimes = 0;
}
if(times!=0 && (doingProgress/finishParm>times || (doingProgress!=0 && finishParm<0 && doingProgress>finishParm) )){
if(times!=0 && (finishParm>0 && doingProgress/finishParm>times || (doingProgress!=0 && finishParm<0 && doingProgress>=finishParm) )){
doingMissionIds.remove(id);
getFinishMissionIds().add(id);
MissionStateChangeInfo missionStateChangeInfo = new MissionStateChangeInfo(id, MissionState.FINISH,times,takeTimes);
missionStateChangeInfos.add(missionStateChangeInfo);
continue;
}
if(finishParm<0){
continue;
}
int sendProgress = (doingProgress - takeTimes * finishParm) / finishParm;
if(sendProgress>0){