Merge branches 'master' and 'master' of 60.1.1.230:backend/jieling_server
commit
4622b3ff8e
|
@ -2023,7 +2023,7 @@ public class MapLogic {
|
||||||
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.getRandomMonsterType()[1][1]);
|
||||||
if (mapPointConfig == null) {
|
if (mapPointConfig == null) {
|
||||||
LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}", scMap1.getEvent());
|
LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}", scMap1.getEvent());
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -84,14 +84,16 @@ public class SweepLogic {
|
||||||
boolean change = false;
|
boolean change = false;
|
||||||
List<CommonProto.Drop> dropList = new CopyOnWriteArrayList<>();
|
List<CommonProto.Drop> dropList = new CopyOnWriteArrayList<>();
|
||||||
for (int i = 0 ; i < sweepTimes ;i++){
|
for (int i = 0 ; i < sweepTimes ;i++){
|
||||||
|
if (targetItem!= 0){
|
||||||
|
Item item = user.getItemManager().getItem(targetItem);
|
||||||
|
if(item!=null && item.getItemNum()>=targetNum){
|
||||||
|
sweepTimes=i;
|
||||||
|
change = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sLevelDifficultyConfig.getRandomReward(), 1, 0, BIReason.LEVELDIFFICULTY_SWEEP_REWARD);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sLevelDifficultyConfig.getRandomReward(), 1, 0, BIReason.LEVELDIFFICULTY_SWEEP_REWARD);
|
||||||
dropList.add(drop.build());
|
dropList.add(drop.build());
|
||||||
Item item = user.getItemManager().getItem(targetItem);
|
|
||||||
if(item!=null && item.getItemNum()>=targetNum){
|
|
||||||
sweepTimes=i;
|
|
||||||
change = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(change){
|
if(change){
|
||||||
cost = MapLogic.getInstance().getCost(sLevelDifficultyConfig, sweepTimes);
|
cost = MapLogic.getInstance().getCost(sLevelDifficultyConfig, sweepTimes);
|
||||||
|
@ -99,6 +101,7 @@ public class SweepLogic {
|
||||||
//扣除道具
|
//扣除道具
|
||||||
ItemUtil.itemCost(user, cost,BIReason.SWEEP_FIGHT_CONSUME,fightId);
|
ItemUtil.itemCost(user, cost,BIReason.SWEEP_FIGHT_CONSUME,fightId);
|
||||||
MapLogic.getInstance().userLevelUp(user,sLevelDifficultyConfig.getExp() * sweepTimes);
|
MapLogic.getInstance().userLevelUp(user,sLevelDifficultyConfig.getExp() * sweepTimes);
|
||||||
|
LOGGER.info("sweepFight=>uid={},sweepTimes={},exp={}",uid,sweepTimes,sLevelDifficultyConfig.getExp());
|
||||||
FightInfoProto.SweepRightResponse.Builder builder = FightInfoProto.SweepRightResponse.newBuilder();
|
FightInfoProto.SweepRightResponse.Builder builder = FightInfoProto.SweepRightResponse.newBuilder();
|
||||||
builder.addAllDrop(dropList);
|
builder.addAllDrop(dropList);
|
||||||
levelDifficulty.setChallengeTimes(levelDifficulty.getChallengeTimes() +sweepTimes);
|
levelDifficulty.setChallengeTimes(levelDifficulty.getChallengeTimes() +sweepTimes);
|
||||||
|
|
Loading…
Reference in New Issue