浏览代码

Pummel now calculates correctly

nossr50 6 年之前
父节点
当前提交
399a1529f4

+ 1 - 0
Changelog.txt

@@ -16,6 +16,7 @@ Version 2.1.2
     (Skills) Fixed a bug where Salvage didn't calculate success and failure correctly
     (Skills) Fixed a bug where Flux Mining didn't calculate success correctly
     (Skills) Fixed a bug where Shake didn't calculate correctly
+    (Skills) Fixed a bug where Pummel didn't calculate correctly
     (Skills) Tree Feller now works on Mushroom Stems
     (Skills) Fixed a bug where magic chance would show as null
     (Skills) Fixed a bug where Trap percentages were added to Fishing even though they no longer exist

+ 1 - 0
src/main/java/com/gmail/nossr50/config/AdvancedConfig.java

@@ -989,6 +989,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
 
     /*public int getFastFoodUnlock() { return config.getInt("Skills.Taming.FastFood.UnlockLevel", 50); }*/
     public double getFastFoodChance() { return config.getDouble("Skills.Taming.FastFood.Chance", 50.0D); }
+    public double getPummelChance() { return config.getDouble("Skills.Taming.Pummel.Chance", 10.0D); }
 
     public int getEnviromentallyAwareUnlock() { return config.getInt("Skills.Taming.EnvironmentallyAware.UnlockLevel", 100); }
 

+ 2 - 1
src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java

@@ -18,6 +18,7 @@ import com.gmail.nossr50.util.Permissions;
 import com.gmail.nossr50.util.StringUtils;
 import com.gmail.nossr50.util.player.NotificationManager;
 import com.gmail.nossr50.util.player.UserManager;
+import com.gmail.nossr50.util.random.RandomChanceSkillStatic;
 import com.gmail.nossr50.util.random.RandomChanceUtil;
 import com.gmail.nossr50.util.skills.ParticleEffectUtils;
 import com.gmail.nossr50.util.skills.RankUtils;
@@ -209,7 +210,7 @@ public class TamingManager extends SkillManager {
         if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL))
             return;
 
-        if(!RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.TAMING_PUMMEL, true))
+        if(!RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(AdvancedConfig.getInstance().getPummelChance(), getPlayer(), SubSkillType.TAMING_PUMMEL)))
             return;
 
         ParticleEffectUtils.playGreaterImpactEffect(target);