back_recharge
lvxinran 2019-10-30 20:46:51 +08:00
commit db6dd9e9b6
5 changed files with 24 additions and 13 deletions

View File

@ -1952,7 +1952,7 @@ public class MapLogic {
}
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(user.getMapManager().getFindSuddenlyBossMapId());
BehaviorUtil.getLevelDifficultyifficuFightInfo(user, suddenlyBoss, teamId, sChallengeConfig.getMostTime(), fightStartResponse, RedisKey.SUDDLENLY_FIGHT);
BehaviorUtil.getLevelDifficultyifficuFightInfo(user,FightType.MapExploreFight, suddenlyBoss, teamId, sChallengeConfig.getMostTime(), fightStartResponse, RedisKey.SUDDLENLY_FIGHT);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightStartResponse.build(), true);
}
@ -2078,7 +2078,7 @@ public class MapLogic {
RedisUtil.getInstence().set(key, fightInfo, -1);
//扣除预先道具
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
BehaviorUtil.getLevelDifficultyifficuFightInfo(user, sMainLevelConfig.getMonsterGroup(), teamId, sMainLevelConfig.getRankTime(), fightStartResponse, RedisKey.LEVE_DIFFICULTY_FIGHT);
BehaviorUtil.getLevelDifficultyifficuFightInfo(user, FightType.StoryFight,sMainLevelConfig.getMonsterGroup(), teamId, sMainLevelConfig.getRankTime(), fightStartResponse, RedisKey.LEVE_DIFFICULTY_FIGHT);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightStartResponse.build(), true);
}
@ -2292,7 +2292,7 @@ public class MapLogic {
RedisUtil.getInstence().set(key, fightInfo, -1);
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
BehaviorUtil.getLevelDifficultyifficuFightInfo(user, sFloodConfig.getMonster(), teamId, sFloodConfig.getBattleTime(), fightStartResponse, RedisKey.CHALLENGE_MONSTER_ATTACK);
BehaviorUtil.getLevelDifficultyifficuFightInfo(user,FightType.MonterFight, sFloodConfig.getMonster(), teamId, sFloodConfig.getBattleTime(), fightStartResponse, RedisKey.CHALLENGE_MONSTER_ATTACK);
user.getUserMissionManager().onGameEvent(user,GameEvent.MONSTER_ATTACK_PLAY);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightStartResponse.build(), true);
}

View File

@ -180,8 +180,10 @@ public class BehaviorUtil {
// int seed = 1553167956;
fightData.setFightSeed(seed);
fightData.setFightMaxTime(maxTime);
fightData.setFightType(FightType.MapExploreFight.getType());
fightStartRespons.setFightData(fightData);
String key = RedisKey.getKey(RedisKey.FIGHT, Integer.toString(user.getId()), false);
Map<String,Object> fightInfo = new HashMap<>();
@ -260,6 +262,7 @@ public class BehaviorUtil {
newBuilder()
.addAllFightUnitList(heroFightInfos)
.setTeamSkillList(HeroLogic.getInstance().getRobotPokenmonSkills(sArenaRobotConfig))
.setTeamPassiveList(HeroLogic.getInstance().getRobotPokenmonPassiveSkills(sArenaRobotConfig))
.build();
}
@ -350,7 +353,7 @@ public class BehaviorUtil {
}
}
public static void getLevelDifficultyifficuFightInfo(User user,int groupId,int teamId, int maxTime,FightInfoProto.FightStartResponse.Builder fightStartRespons,String fightKey) {
public static void getLevelDifficultyifficuFightInfo(User user,FightType fightType,int groupId,int teamId, int maxTime,FightInfoProto.FightStartResponse.Builder fightStartRespons,String fightKey) {
CommonProto.FightData.Builder fightData = CommonProto.FightData.newBuilder();
CommonProto.FightTeamInfo fightTeamInfo = getFightTeamInfo(user, teamId,true);
fightData.setHeroFightInfos(fightTeamInfo);
@ -364,7 +367,7 @@ public class BehaviorUtil {
//设置战斗随机种子
int seed = (int)(System.currentTimeMillis()/1000);
fightData.setFightSeed(seed);
fightData.setFightType(FightType.StoryFight.getType());
fightData.setFightType(fightType.getType());
fightData.setFightMaxTime(maxTime);
fightStartRespons.setFightData(fightData);

View File

@ -258,10 +258,10 @@ public class CombatLogic {
}
}
int[] randomRewardMin = targetMainLevelConfig.getRandomRewardMin();
ItemUtil.combineReward(user,randomRewardMin, times,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
ItemUtil.combineReward(user,false,randomRewardMin, times,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
int timesTemp =times;
while (timesTemp-->0){
ItemUtil.combineReward(user,targetMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
ItemUtil.combineReward(user,true,targetMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
}
ItemUtil.drop(user,baseBuilder,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
ItemUtil.drop(user,randomBuilder,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
@ -900,10 +900,10 @@ public class CombatLogic {
Integer times = fightStateInfoItem.getValue();
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(fightId);
int[] randomRewardMin = sMainLevelConfig.getRandomRewardMin();
ItemUtil.combineReward(user,randomRewardMin, times,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
ItemUtil.combineReward(user,true,randomRewardMin, times,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
int timesTemp =times;
while (!viewBaseReward&&timesTemp-->0){
ItemUtil.combineReward(user,sMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
ItemUtil.combineReward(user,false,sMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
}
takeTimes+=times;
}
@ -918,13 +918,14 @@ public class CombatLogic {
if(maxTimes>0){
times = times > maxTimes?maxTimes:times;
int[] randomRewardMin = targetMainLevelConfig.getRandomRewardMin();
ItemUtil.combineReward(user,randomRewardMin, times,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
ItemUtil.combineReward(user,false,randomRewardMin, times,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
int timesTemp =times;
while (!viewBaseReward&&timesTemp-->0){
ItemUtil.combineReward(user,targetMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
ItemUtil.combineReward(user,true,targetMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
}
lastTimeTakes=times;
}
ItemUtil.extraAddItem(user,baseItemMap);
if(viewBaseReward){
myResult = true;
rewardStr = ItemUtil.getReward(baseItemMap, baseCardMap, baseEquipMap, baseRandomMap);

View File

@ -329,7 +329,7 @@ public class ItemLogic {
}
}
ItemUtil.combineReward(user, StringUtil.parseFiledInt(reward.toString()),1,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,-1);
ItemUtil.combineReward(user,false, StringUtil.parseFiledInt(reward.toString()),1,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,-1);
int reson = BIReason.DECOMPOS_HERO_REWARD;
if(null!=filterItem){

View File

@ -257,8 +257,15 @@ public class ItemUtil {
public static void combineReward(User user,int[] dropGroupIds,float dropRatio, Map<Integer, Integer> itemMap, Map<Integer, Integer> cardMap, Map<Integer, Integer> equipMap, Map<Integer, Integer> randomMap,int reason){
public static void combineReward(User user,boolean isLoop,int[] dropGroupIds,float dropRatio, Map<Integer, Integer> itemMap, Map<Integer, Integer> cardMap, Map<Integer, Integer> equipMap, Map<Integer, Integer> randomMap,int reason){
combineRewardDropGroup(user, dropGroupIds, dropRatio, itemMap, cardMap, equipMap, randomMap);
if(!isLoop){
extraAddItem(user,itemMap);
}
}
public static void extraAddItem(User user, Map<Integer, Integer> itemMap){
ItemManager itemManager = user.getItemManager();
for(Map.Entry<Integer,Integer> item : itemMap.entrySet()){
Integer itemId = item.getKey();