mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-25 16:45:28 +02:00
@@ -41,7 +41,7 @@ public class ProbabilityUtil {
|
||||
public static double chanceOfSuccessPercentage(@Nullable McMMOPlayer mmoPlayer,
|
||||
@NotNull SubSkillType subSkillType,
|
||||
boolean isLucky) {
|
||||
Probability probability = getSubSkillProbability(subSkillType, mmoPlayer);
|
||||
final Probability probability = getSubSkillProbability(subSkillType, mmoPlayer);
|
||||
//Probability values are on a 0-1 scale and need to be "transformed" into a 1-100 scale
|
||||
double percentageValue = probability.getValue(); //Doesn't need to be scaled
|
||||
|
||||
@@ -437,7 +437,7 @@ public class ProbabilityUtil {
|
||||
return Probability.ofPercent(ceiling);
|
||||
}
|
||||
|
||||
double odds = (skillLevel / maxBonusLevel) * 100D;
|
||||
double odds = ((skillLevel / maxBonusLevel) * ceiling);
|
||||
|
||||
// make sure the odds aren't lower or higher than the floor or ceiling
|
||||
return Probability.ofPercent(Math.min(Math.max(floor, odds), ceiling));
|
||||
|
Reference in New Issue
Block a user