statusorbs: Edit graceful recovery rate calculations
The latest game update changes the way the graceful set works
This commit is contained in:
@@ -187,10 +187,7 @@ public class StatusOrbsOverlay extends Overlay
|
||||
{
|
||||
double recoverRate = (48 + client.getBoostedSkillLevel(Skill.AGILITY)) / 360000.0;
|
||||
|
||||
if (Graceful.hasFullSet(client.getItemContainer(InventoryID.EQUIPMENT)))
|
||||
{
|
||||
recoverRate *= 1.3; // 30% recover rate increase from Graceful set effect
|
||||
}
|
||||
recoverRate *= Graceful.calculateRecoveryRate(client.getItemContainer(InventoryID.EQUIPMENT));
|
||||
|
||||
percentRun += ms * recoverRate;
|
||||
}
|
||||
|
||||
@@ -380,11 +380,7 @@ public class StatusOrbsPlugin extends Plugin
|
||||
|
||||
// Calculate the amount of energy recovered every second
|
||||
double recoverRate = (48 + client.getBoostedSkillLevel(Skill.AGILITY)) / 360.0;
|
||||
|
||||
if (Graceful.hasFullSet(client.getItemContainer(InventoryID.EQUIPMENT)))
|
||||
{
|
||||
recoverRate *= 1.3; // 30% recover rate increase from Graceful set effect
|
||||
}
|
||||
recoverRate *= Graceful.calculateRecoveryRate(client.getItemContainer(InventoryID.EQUIPMENT));
|
||||
|
||||
// Calculate the number of seconds left
|
||||
final double secondsLeft = (100 - client.getEnergy()) / recoverRate;
|
||||
@@ -430,11 +426,8 @@ public class StatusOrbsPlugin extends Plugin
|
||||
private double runRegenPerTick()
|
||||
{
|
||||
double recoverRate = (client.getBoostedSkillLevel(Skill.AGILITY) / 6d + 8) / 100;
|
||||
recoverRate *= Graceful.calculateRecoveryRate(client.getItemContainer(InventoryID.EQUIPMENT));
|
||||
|
||||
if (Graceful.hasFullSet(client.getItemContainer(InventoryID.EQUIPMENT)))
|
||||
{
|
||||
return recoverRate * 1.3;
|
||||
}
|
||||
return recoverRate;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,20 +78,87 @@ public enum Graceful
|
||||
this.ids = ImmutableSet.copyOf(ids);
|
||||
}
|
||||
|
||||
public static boolean hasFullSet(final ItemContainer equipment)
|
||||
public static double calculateRecoveryRate(final ItemContainer equipment)
|
||||
{
|
||||
double rate = 1;
|
||||
|
||||
if (equipment == null)
|
||||
{
|
||||
return false;
|
||||
return rate;
|
||||
}
|
||||
|
||||
final Item[] items = equipment.getItems();
|
||||
|
||||
if (equipment == null || items.length <= EquipmentInventorySlot.BOOTS.getSlotIdx())
|
||||
if (hasFullSet(items))
|
||||
{
|
||||
return false;
|
||||
return 1.3;
|
||||
}
|
||||
|
||||
if (hasHood(items))
|
||||
{
|
||||
rate += 0.03;
|
||||
}
|
||||
|
||||
if (hasTop(items))
|
||||
{
|
||||
rate += 0.04;
|
||||
}
|
||||
|
||||
if (hasLegs(items))
|
||||
{
|
||||
rate += 0.04;
|
||||
}
|
||||
|
||||
if (hasGloves(items))
|
||||
{
|
||||
rate += 0.03;
|
||||
}
|
||||
|
||||
if (hasBoots(items))
|
||||
{
|
||||
rate += 0.03;
|
||||
}
|
||||
|
||||
if (hasCape(items))
|
||||
{
|
||||
rate += 0.03;
|
||||
}
|
||||
|
||||
return rate;
|
||||
}
|
||||
|
||||
public static boolean hasHood(final Item[] items)
|
||||
{
|
||||
return HOOD.ids.contains(items[EquipmentInventorySlot.HEAD.getSlotIdx()].getId());
|
||||
}
|
||||
|
||||
public static boolean hasTop(final Item[] items)
|
||||
{
|
||||
return TOP.ids.contains(items[EquipmentInventorySlot.BODY.getSlotIdx()].getId());
|
||||
}
|
||||
|
||||
public static boolean hasLegs(final Item[] items)
|
||||
{
|
||||
return LEGS.ids.contains(items[EquipmentInventorySlot.LEGS.getSlotIdx()].getId());
|
||||
}
|
||||
|
||||
public static boolean hasGloves(final Item[] items)
|
||||
{
|
||||
return GLOVES.ids.contains(items[EquipmentInventorySlot.GLOVES.getSlotIdx()].getId());
|
||||
}
|
||||
|
||||
public static boolean hasBoots(final Item[] items)
|
||||
{
|
||||
return BOOTS.ids.contains(items[EquipmentInventorySlot.BOOTS.getSlotIdx()].getId());
|
||||
}
|
||||
|
||||
public static boolean hasCape(final Item[] items)
|
||||
{
|
||||
return CAPE.ids.contains(items[EquipmentInventorySlot.CAPE.getSlotIdx()].getId());
|
||||
}
|
||||
|
||||
public static boolean hasFullSet(final Item[] items)
|
||||
{
|
||||
return HOOD.ids.contains(items[EquipmentInventorySlot.HEAD.getSlotIdx()].getId())
|
||||
&& TOP.ids.contains(items[EquipmentInventorySlot.BODY.getSlotIdx()].getId())
|
||||
&& LEGS.ids.contains(items[EquipmentInventorySlot.LEGS.getSlotIdx()].getId())
|
||||
|
||||
Reference in New Issue
Block a user