Fixing styling on Acrobatics, Archery

This commit is contained in:
nossr50 2019-01-21 08:46:08 -08:00
parent c728b233e6
commit f9ce70e310
5 changed files with 44 additions and 16 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);
}
}

View File

@ -135,8 +135,9 @@ Acrobatics.SubSkill.GracefulRoll.Name=Graceful Roll
Acrobatics.SubSkill.GracefulRoll.Description=Twice as effective as a normal Roll
Acrobatics.SubSkill.Dodge.Name=Dodge
Acrobatics.SubSkill.Dodge.Description=Reduce attack damage by half
Acrobatics.SubSkill.Dodge.Stat=Dodge Chance
Acrobatics.Listener=Acrobatics:
Acrobatics.Roll.Text=[[ITALIC]][[BOLD]]**Rolled**
Acrobatics.Roll.Text=[[ITALIC]]**Rolled**
Acrobatics.SkillName=ACROBATICS
#ALCHEMY
Alchemy.SubSkill.Catalysis.Name=Catalysis
@ -150,15 +151,17 @@ Alchemy.Concoctions.Rank=Concoctions Rank: [[YELLOW]]{0}/{1}
Alchemy.Concoctions.Ingredients=Ingredients [[[YELLOW]]{0}[[RED]]]: [[YELLOW]]{1}
Alchemy.SkillName=ALCHEMY
#ARCHERY
Archery.Combat.DazeChance=Chance to Daze: [[YELLOW]]{0}
Archery.Combat.RetrieveChance=Chance to Retrieve Arrows: [[YELLOW]]{0}
Archery.Combat.SkillshotBonus=Skill Shot Bonus Damage: [[YELLOW]]{0}
Archery.SubSkill.SkillShot.Name=Skill Shot
Archery.SubSkill.SkillShot.Description=Increases damage done with bows
Archery.SubSkill.SkillShot.Stat=Skill Shot Bonus Damage
Archery.SubSkill.Daze.Name=Daze
Archery.SubSkill.Daze.Description=Disorients foes and deals {0} DMG
Archery.SubSkill.Daze.Stat=Daze Chance
Archery.SubSkill.ArrowRetrieval.Name=Arrow Retrieval
Archery.SubSkill.ArrowRetrieval.Description=Chance to retrieve arrows from corpses
Archery.SubSkill.ArrowRetrieval.Stat=Arrow Recovery Chance
Archery.Listener=Archery:
Archery.SkillName=ARCHERY
#AXES