mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
Fixing styling on Acrobatics, Archery
This commit is contained in:
@ -58,19 +58,20 @@ public class AcrobaticsCommand extends SkillCommand {
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
/*
|
||||
if (canRoll) {
|
||||
/*if (canRoll) {
|
||||
messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, dazeChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dazeChanceLucky) : ""));
|
||||
messages.add(LocaleLoader.getString("Acrobatics.Roll.Chance", rollChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canGracefulRoll) {
|
||||
if (canRoll) {
|
||||
messages.add(LocaleLoader.getString("Acrobatics.Roll.GraceChance", gracefulRollChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", gracefulRollChanceLucky) : ""));
|
||||
}
|
||||
*/
|
||||
}*/
|
||||
|
||||
|
||||
if (canDodge) {
|
||||
messages.add(LocaleLoader.getString("Acrobatics.DodgeChance", dodgeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dodgeChanceLucky) : ""));
|
||||
|
||||
messages.add(getStatMessage(SubSkillType.ACROBATICS_DODGE, dodgeChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dodgeChanceLucky) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
|
@ -80,15 +80,17 @@ public class ArcheryCommand extends SkillCommand {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canSkillShot) {
|
||||
messages.add(LocaleLoader.getString("Archery.Combat.SkillshotBonus", skillShotBonus));
|
||||
messages.add(getStatMessage(SubSkillType.ARCHERY_SKILL_SHOT, skillShotBonus));
|
||||
}
|
||||
|
||||
if (canDaze) {
|
||||
messages.add(LocaleLoader.getString("Archery.Combat.DazeChance", dazeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dazeChanceLucky) : ""));
|
||||
messages.add(getStatMessage(SubSkillType.ARCHERY_DAZE, dazeChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dazeChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canRetrieve) {
|
||||
messages.add(LocaleLoader.getString("Archery.Combat.RetrieveChance", retrieveChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", retrieveChanceLucky) : ""));
|
||||
messages.add(getStatMessage(SubSkillType.ARCHERY_ARROW_RETRIEVAL, retrieveChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", retrieveChanceLucky) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
|
@ -235,6 +235,16 @@ public abstract class SkillCommand implements TabExecutor {
|
||||
return new String[] { String.valueOf(length), String.valueOf(enduranceLength) };
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the stat string for a given subskill
|
||||
* @param subSkillType target subskill
|
||||
*/
|
||||
protected String getStatMessage(SubSkillType subSkillType, String stat)
|
||||
{
|
||||
String statDescription = subSkillType.getLocaleStatDescription();
|
||||
return subSkillType.getLocaleStat(statDescription, stat);
|
||||
}
|
||||
|
||||
protected abstract void dataCalculations(Player player, float skillValue, boolean isLucky);
|
||||
|
||||
protected abstract void permissionsCheck(Player player);
|
||||
|
@ -242,11 +242,23 @@ public enum SubSkillType {
|
||||
|
||||
public String getLocaleName()
|
||||
{
|
||||
return LocaleLoader.getString(getLocaleKeyRoot()+".Name");
|
||||
return getFromLocaleSubAddress(".Name");
|
||||
}
|
||||
|
||||
public String getLocaleDescription()
|
||||
{
|
||||
return LocaleLoader.getString(getLocaleKeyRoot()+".Description");
|
||||
return getFromLocaleSubAddress(".Description");
|
||||
}
|
||||
|
||||
public String getLocaleStatDescription() { return getFromLocaleSubAddress(".Stat"); }
|
||||
|
||||
public String getLocaleStat(String... vars)
|
||||
{
|
||||
String statMsg = LocaleLoader.getString("Ability.Generic.Template", (Object[]) vars);
|
||||
return statMsg;
|
||||
}
|
||||
|
||||
private String getFromLocaleSubAddress(String s) {
|
||||
return LocaleLoader.getString(getLocaleKeyRoot() + s);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user