挑战副本奖励算法修改

grimm 2023-12-23 15:14:30 +08:00
parent bb0372370d
commit c313d27871
1 changed files with 3 additions and 3 deletions

View File

@ -71,17 +71,17 @@ public class ChallengeLogic {
int ratio = 0;
int[][] value = stage.getReward1();
if (type == 1){
ratio = Arrays.stream(value).filter(v -> bout > v[0]).mapToInt(v -> v[1]).max().orElse(0);
ratio = Arrays.stream(value).filter(v -> bout >= v[0]).mapToInt(v -> v[1]).max().orElse(0);
}
if (type == 2){
ratio = Arrays.stream(value).filter(v -> bout < v[0]).mapToInt(v -> v[1]).min().orElse(0);
ratio = Arrays.stream(value).filter(v -> bout <= v[0]).mapToInt(v -> v[1]).max().orElse(0);
}
builder.setLossBloodOrTimes(bout);
// 加成百分比
for (int[] fix : stage.getPassReward()) {
Integer num = comDropMap.getOrDefault(fix[0], 0);
num = num + (int)(fix[1] * (ratio/10000d+1d));
num = num + (int)(fix[1] * (ratio/10000d));
comDropMap.put(fix[0], num);
}
builder.setPercentReward(ratio);