浏览代码

Fixed bug where Iron Grip was using the attacker's skill values rather
than the defender's

GJ 12 年之前
父节点
当前提交
18a4f5ed40
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 0
      Changelog.txt
  2. 2 3
      src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java

+ 1 - 0
Changelog.txt

@@ -23,6 +23,7 @@ Version 1.4.00-dev
  = Fixed Leaf Blower not respecting the unlock level set in advanced.yml
  = Fixed abilities activating with the wrong tool in hand
  = Fixed Experience.Gains.Mobspawners.Enabled not being used correctly (the check was inverted)
+ = Fixed bug where Iron Grip was using the attacker's skill values rather than the defender's.
  ! Changed how Berserk handles not picking up items to avoid listening to PlayerPickupItemEvent
  ! Moved Hylian Luck into a separate listener since it actually cancels the event and shouldn't just be on MONITOR.
  ! Changed how Tree Feller is handled, it should now put less stress on the CPU

+ 2 - 3
src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java

@@ -84,10 +84,9 @@ public class UnarmedManager extends SkillManager {
 
         IronGripEventHandler eventHandler = new IronGripEventHandler(this, defender);
 
-        float chance = (float) ((Unarmed.ironGripMaxChance / Unarmed.ironGripMaxBonusLevel) * skillLevel);
-        if (chance > Unarmed.ironGripMaxChance) chance = (float) Unarmed.ironGripMaxChance;
+        double chance = (Unarmed.ironGripMaxChance / Unarmed.ironGripMaxBonusLevel) * eventHandler.skillModifier;
 
-        if (chance > Misc.getRandom().nextInt(activationChance)) {
+        if (chance > Misc.getRandom().nextInt(Misc.calculateActivationChance(Permissions.luckyUnarmed(defender)))) {
             eventHandler.sendAbilityMessages();
             return true;
         }