mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-02 13:44:43 +02:00
Skill commands now show the perk effect, if any are active
This commit is contained in:
@ -13,6 +13,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
public class TamingCommand extends SkillCommand {
|
||||
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
private String goreChance;
|
||||
private String goreChanceLucky;
|
||||
|
||||
private float goreChanceMax = advancedConfig.getGoreChanceMax();
|
||||
private float goreMaxLevel = advancedConfig.getGoreMaxBonusLevel();
|
||||
@ -39,8 +40,12 @@ public class TamingCommand extends SkillCommand {
|
||||
@Override
|
||||
protected void dataCalculations() {
|
||||
DecimalFormat df = new DecimalFormat("0.0");
|
||||
if(skillValue >= goreMaxLevel) goreChance = df.format(goreChanceMax);
|
||||
else goreChance = df.format(((double) goreChanceMax / (double) goreMaxLevel) * skillValue);
|
||||
float goreChanceF;
|
||||
if(skillValue >= goreMaxLevel) goreChanceF = (goreChanceMax);
|
||||
else goreChanceF = (float) (((double) goreChanceMax / (double) goreMaxLevel) * skillValue);
|
||||
goreChance = df.format(goreChanceF);
|
||||
if(goreChanceF + goreChanceF * 0.3333D >= 100D) goreChanceLucky = df.format(100D);
|
||||
else goreChanceLucky = df.format(goreChanceF + goreChanceF * 0.3333D);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -157,7 +162,10 @@ public class TamingCommand extends SkillCommand {
|
||||
}
|
||||
|
||||
if (canGore) {
|
||||
player.sendMessage(LocaleLoader.getString("Taming.Combat.Chance.Gore", new Object[] { goreChance }));
|
||||
if (player.hasPermission("mcmmo.perks.lucky.taming"))
|
||||
player.sendMessage(LocaleLoader.getString("Taming.Combat.Chance.Gore", new Object[] { goreChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { goreChanceLucky }));
|
||||
else
|
||||
player.sendMessage(LocaleLoader.getString("Taming.Combat.Chance.Gore", new Object[] { goreChance }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user