Skip to content

Commit

Permalink
Adding roll stats to Acrobatic's stat display
Browse files Browse the repository at this point in the history
  • Loading branch information
nossr50 committed Jan 21, 2019
1 parent 6d720e6 commit ebbfe72
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.gmail.nossr50.commands.skills;

import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.listeners.InteractionManager;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.SkillUtils;
Expand Down Expand Up @@ -58,16 +61,27 @@ protected List<String> effectsDisplay() {
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<String>();

/*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 (canRoll) {
messages.add(LocaleLoader.getString("Acrobatics.Roll.GraceChance", gracefulRollChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", gracefulRollChanceLucky) : ""));
}*/

AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName("Roll");

if(abstractSubSkill != null)
{
double maxBonusLevel = AdvancedConfig.getInstance().getMaxBonusLevel(abstractSubSkill);
double maxChance = AdvancedConfig.getInstance().getMaxChance(abstractSubSkill);
double rollChance = SkillUtils.getChanceOfSuccess(skillValue, maxBonusLevel, maxChance);
double graceChance = SkillUtils.getChanceOfSuccess(skillValue, maxBonusLevel, maxChance / 2);

String rollChanceLucky = isLucky ? percent.format(Math.min(rollChance * 1.3333D, 100.0D) / 100.0D) : null;
String graceChanceLucky = isLucky ? percent.format(Math.min(rollChance * 1.3333D, 100.0D) / 100.0D) : null;


messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, percent.format(rollChance))
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollChanceLucky) : ""));
messages.add(getStatMessage(true, false, SubSkillType.ACROBATICS_ROLL, percent.format(graceChance))
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", graceChanceLucky) : ""));
}
}

if (canDodge) {
messages.add(getStatMessage(SubSkillType.ACROBATICS_DODGE, dodgeChance)
Expand Down
5 changes: 2 additions & 3 deletions src/main/resources/locale/locale_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ XPBar.Complex.Template={0} [[DARK_AQUA]] {4}[[WHITE]]% [[DARK_AQUA]]([[WHITE]]{1
#ACROBATICS
Acrobatics.Ability.Proc=[[GREEN]]**Graceful Landing**
Acrobatics.Combat.Proc=[[GREEN]]**Dodged**
Acrobatics.DodgeChance=Dodge Chance: [[YELLOW]]{0}
Acrobatics.SubSkill.Roll.Stats=[[GOLD]]Roll Chance [[YELLOW]]{0}%[[GOLD]] Graceful Roll Chance[[YELLOW]] {1}%
Acrobatics.SubSkill.Roll.Stat=Roll Chance
Acrobatics.SubSkill.Roll.Stat.Extra=Graceful Roll Chance
Acrobatics.SubSkill.Roll.Name=Roll
Acrobatics.SubSkill.Roll.Description=Land strategically to avoid damage.
Acrobatics.SubSkill.Roll.Chance=Roll Chance: [[YELLOW]]{0}
Expand Down Expand Up @@ -206,7 +206,6 @@ Excavation.SubSkill.GigaDrillBreaker.Description=3x Drop Rate, 3x EXP, +Speed
Excavation.SubSkill.GigaDrillBreaker.Stat=Giga Drill Breaker Duration
Excavation.SubSkill.Archaeology.Name=Archaeology
Excavation.SubSkill.Archaeology.Description=Unearth the secrets of the land!
Excavation.Effect.Length=Giga Drill Breaker Length: [[YELLOW]]{0}s
Excavation.Listener=Excavation:
Excavation.SkillName=EXCAVATION
Excavation.Skills.GigaDrillBreaker.Off=**Giga Drill Breaker has worn off**
Expand Down

0 comments on commit ebbfe72

Please sign in to comment.