Explorar el Código

Tweak archery distance XP function to reward better.

gmcferrin hace 12 años
padre
commit
1e7b54ef0d

+ 2 - 1
src/main/java/com/gmail/nossr50/skills/archery/Archery.java

@@ -29,7 +29,8 @@ public class Archery {
     public static boolean pvpEnabled = Config.getInstance().getArcheryPVP();
     public static boolean pveEnabled = Config.getInstance().getArcheryPVE();
 
-    public static double distanceXpModifer = 0.1;
+    public static double distanceXpModifer = 0.025;
+
     protected static void incrementTrackerValue(LivingEntity livingEntity) {
         for (TrackedEntity trackedEntity : trackedEntities) {
             if (trackedEntity.getLivingEntity().getEntityId() == livingEntity.getEntityId()) {

+ 2 - 2
src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java

@@ -19,9 +19,9 @@ public class ArcheryManager extends SkillManager {
     public void distanceXpBonus(LivingEntity target) {
         Location shooterLocation = player.getEyeLocation();
         Location targetLocation = target.getLocation();
-        double distance = shooterLocation.distance(targetLocation);
+        double squaredDistance = shooterLocation.distanceSquared(targetLocation);
 
-        int bonusXp = (int) (distance * Archery.distanceXpModifer);
+        int bonusXp = (int) (squaredDistance * Archery.distanceXpModifer);
         SkillTools.xpProcessing(player, profile, SkillType.ARCHERY, bonusXp);
     }