Fix issue #4105 Fishing shake percentage seems off. (#4649)

This commit is contained in:
Enderaoe 2021-11-09 10:57:32 +08:00 committed by GitHub
parent e287ad47d1
commit 182717eacf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -5,9 +5,9 @@ public class RandomChanceStatic implements RandomChanceExecution {
private final double probabilityCap; private final double probabilityCap;
private final boolean isLucky; private final boolean isLucky;
public RandomChanceStatic(double xPos, boolean isLucky) { public RandomChanceStatic(double xPos, double probabilityCap, boolean isLucky) {
this.xPos = xPos; this.xPos = xPos;
this.probabilityCap = xPos; this.probabilityCap = probabilityCap;
this.isLucky = isLucky; this.isLucky = isLucky;
} }

View File

@ -282,10 +282,10 @@ public class RandomChanceUtil {
} }
public static String @NotNull [] calculateAbilityDisplayValuesStatic(@NotNull Player player, @NotNull PrimarySkillType primarySkillType, double chance) { public static String @NotNull [] calculateAbilityDisplayValuesStatic(@NotNull Player player, @NotNull PrimarySkillType primarySkillType, double chance) {
RandomChanceStatic rcs = new RandomChanceStatic(chance, false); RandomChanceStatic rcs = new RandomChanceStatic(chance, LINEAR_CURVE_VAR, false);
double successChance = getRandomChanceExecutionChance(rcs); double successChance = getRandomChanceExecutionChance(rcs);
RandomChanceStatic rcs_lucky = new RandomChanceStatic(chance, true); RandomChanceStatic rcs_lucky = new RandomChanceStatic(chance, LINEAR_CURVE_VAR, true);
double successChance_lucky = getRandomChanceExecutionChance(rcs_lucky); double successChance_lucky = getRandomChanceExecutionChance(rcs_lucky);
String[] displayValues = new String[2]; String[] displayValues = new String[2];