mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-02-18 07:39:36 +01:00
Fixing the RNG display calculations for RetroMode
I temporarily disabled the output for graceful roll in the stats, will be turning that on again in the morning.
This commit is contained in:
parent
ef9b3d40e9
commit
a421bd7e4c
@ -71,15 +71,17 @@ public class AcrobaticsCommand extends SkillCommand {
|
|||||||
graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs);
|
graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs);
|
||||||
//damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold();
|
//damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold();
|
||||||
|
|
||||||
|
String rollStrings[] = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.MINING_DOUBLE_DROPS);
|
||||||
|
|
||||||
//Format
|
//Format
|
||||||
double rollChanceLucky = rollChance * 1.333D;
|
double rollChanceLucky = rollChance * 1.333D;
|
||||||
double graceChanceLucky = graceChance * 1.333D;
|
double graceChanceLucky = graceChance * 1.333D;
|
||||||
|
|
||||||
messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, String.valueOf(rollChance))
|
messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, rollStrings[0])
|
||||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", String.valueOf(rollChanceLucky)) : ""));
|
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollStrings[1]) : ""));
|
||||||
|
|
||||||
messages.add(getStatMessage(true, false, SubSkillType.ACROBATICS_ROLL, String.valueOf(graceChance))
|
/*messages.add(getStatMessage(true, false, SubSkillType.ACROBATICS_ROLL, String.valueOf(graceChance))
|
||||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", String.valueOf(graceChanceLucky)) : ""));
|
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", String.valueOf(graceChanceLucky)) : ""));*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,8 +720,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public double getMaximumProbability(SubSkillType subSkillType) {
|
public double getMaximumProbability(SubSkillType subSkillType) {
|
||||||
double maximumProbability = config.getDouble(subSkillType.getAdvConfigAddress() + ".ChanceMax", 100.0D);
|
double maximumProbability = config.getDouble(subSkillType.getAdvConfigAddress() + ".ChanceMax", 100.0D);
|
||||||
|
|
||||||
if(mcMMO.isRetroModeEnabled())
|
/*if(mcMMO.isRetroModeEnabled())
|
||||||
maximumProbability *= 10; // It seems weird but our formulas need this
|
maximumProbability *= 10; // It seems weird but our formulas need this*/
|
||||||
|
|
||||||
return maximumProbability;
|
return maximumProbability;
|
||||||
}
|
}
|
||||||
|
@ -154,10 +154,10 @@ public class RandomChanceUtil
|
|||||||
*
|
*
|
||||||
* @return the chance of success from 0-100 (100 = guaranteed)
|
* @return the chance of success from 0-100 (100 = guaranteed)
|
||||||
*/
|
*/
|
||||||
private static int getChanceOfSuccess(double x, double y, double z)
|
private static int getChanceOfSuccess(double skillLevel, double maxProbability, double maxLevel)
|
||||||
{
|
{
|
||||||
//return (int) (x / (y / LINEAR_CURVE_VAR));
|
//return (int) (x / (y / LINEAR_CURVE_VAR));
|
||||||
return (int) (y * (x/z));
|
return (int) (maxProbability * (skillLevel/maxLevel));
|
||||||
// max probability * (weight/maxlevel) = chance of success
|
// max probability * (weight/maxlevel) = chance of success
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ public class RandomChanceUtil
|
|||||||
public static double getRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap)
|
public static double getRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap)
|
||||||
{
|
{
|
||||||
RandomChanceSkill rcs = new RandomChanceSkill(player, subSkillType, hasCap);
|
RandomChanceSkill rcs = new RandomChanceSkill(player, subSkillType, hasCap);
|
||||||
return getRandomChanceExecutionChance(rcs);
|
return calculateChanceOfSuccess(rcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType)
|
public static double getRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user