item stats - Fix revitalisation potion prayer bonus

This commit is contained in:
TheStonedTurtle
2020-05-15 06:33:15 -07:00
parent 37760c9775
commit 1c159c929a
3 changed files with 130 additions and 3 deletions

View File

@@ -35,12 +35,20 @@ import static net.runelite.client.plugins.itemstats.stats.Stats.PRAYER;
public class PrayerPotion extends StatBoost
{
private static final double BASE_PERC = .25;
private final int delta;
private final double perc;
public PrayerPotion(int delta)
{
this(delta, BASE_PERC);
}
PrayerPotion(int delta, double perc)
{
super(PRAYER, false);
this.delta = delta;
this.perc = perc;
}
private static final int RING_SLOT = EquipmentInventorySlot.RING.getSlotIdx();
@@ -93,9 +101,9 @@ public class PrayerPotion extends StatBoost
}
}
double perc = hasHolyWrench ? .27 : .25;
double percent = hasHolyWrench ? perc + .02 : perc;
int max = getStat().getMaximum(client);
return (((int) (max * perc)) * (delta >= 0 ? 1 : -1)) + delta;
return (((int) (max * percent)) * (delta >= 0 ? 1 : -1)) + delta;
}
}

View File

@@ -56,7 +56,7 @@ public class SuperRestore implements Effect
StatsChanges changes = new StatsChanges(0);
SimpleStatBoost calc = new SimpleStatBoost(null, false, perc(percR, delta));
PrayerPotion prayer = new PrayerPotion(delta);
PrayerPotion prayer = new PrayerPotion(delta, percR);
changes.setStatChanges(Stream.concat(
Stream.of(prayer.effect(client)),
Stream.of(superRestoreStats)