挑战副本
parent
8564d36577
commit
29dace7812
|
|
@ -43,10 +43,10 @@ public class ChallengeLogic {
|
|||
}
|
||||
|
||||
public static boolean limit(int level, int id) {
|
||||
if (level > id) {
|
||||
return true;
|
||||
if (level < id) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Map<Integer, Integer> dropMap(SChallengeStage sChallengeConfig, int model, int type, int win, long[] result) {
|
||||
|
|
@ -65,7 +65,7 @@ public class ChallengeLogic {
|
|||
} else {
|
||||
comDropMap.put(fix[0], fix[1]);
|
||||
}
|
||||
//LOGGER.info("1111111111111111111111111111111111111111111111111");
|
||||
LOGGER.info("baodi reward");
|
||||
}
|
||||
//总奖励
|
||||
if (model == 2 || (model == 1 && win == 1)) {
|
||||
|
|
@ -76,9 +76,10 @@ public class ChallengeLogic {
|
|||
} else {
|
||||
comDropMap.put(fix[0], fix[1]);
|
||||
}
|
||||
//LOGGER.info("22222222222222222222222222222222");
|
||||
}
|
||||
} else if (model == 1 && win == 1) {
|
||||
LOGGER.info("zong reward");
|
||||
}
|
||||
if (model == 1 && win == 1) {
|
||||
//打过
|
||||
for (int[] fix : sChallengeConfig.getVictoryReward()) {
|
||||
if (comDropMap.containsKey(fix[0])) {
|
||||
|
|
@ -86,8 +87,8 @@ public class ChallengeLogic {
|
|||
} else {
|
||||
comDropMap.put(fix[0], fix[1]);
|
||||
}
|
||||
//LOGGER.info("3333333333333333333333333333333333");
|
||||
}
|
||||
LOGGER.info("tongguan reward");
|
||||
} else if (model == 1 && win == 0) {
|
||||
//没打过
|
||||
int[][] reward1 = sChallengeConfig.getReward1();
|
||||
|
|
@ -118,7 +119,7 @@ public class ChallengeLogic {
|
|||
comDropMap.put(fix[0], (int) (fix[1] * (ratio / 10000)));
|
||||
}
|
||||
}
|
||||
//LOGGER.info("444444444444444444444444444444");
|
||||
LOGGER.info("no pass reward percent");
|
||||
}
|
||||
return comDropMap;
|
||||
|
||||
|
|
@ -175,14 +176,14 @@ public class ChallengeLogic {
|
|||
}
|
||||
int endlessNewReplicaLexel = user.getPlayerInfoManager().getEndlessNewReplica();
|
||||
int treasureReplicaLexel = user.getPlayerInfoManager().getTreasureReplica();
|
||||
//限制
|
||||
boolean consume = PlayerLogic.getInstance().checkAndUpdate(user, sChallengeConfig.getPivilegeID()[1], 1);
|
||||
if (!consume) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
Map<Integer, Integer> comDropMap = new HashMap<>();
|
||||
if (model == 2) {
|
||||
//扫荡
|
||||
boolean consume = PlayerLogic.getInstance().checkAndUpdate(user, sChallengeConfig.getPivilegeID()[1], 1);
|
||||
if (!consume) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
//限制
|
||||
switch (type) {
|
||||
case 1:
|
||||
if (!limit(endlessNewReplicaLexel, id)) {
|
||||
|
|
@ -199,7 +200,6 @@ public class ChallengeLogic {
|
|||
}
|
||||
//扫荡 = 保底 +总奖励
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 1, null);
|
||||
;
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, comDropMap.entrySet().stream().map(n ->
|
||||
new int[]{n.getKey(), n.getValue()}).toArray(int[][]::new), BIReason.EXPLORE_MAP_COST_RETURN);
|
||||
builder.setDrop(drop);
|
||||
|
|
|
|||
Loading…
Reference in New Issue