Merge pull request #11612 from TheStonedTurtle/sanfew

This commit is contained in:
Jordan
2020-06-09 00:45:44 -07:00
committed by GitHub
4 changed files with 196 additions and 5 deletions

View File

@@ -158,7 +158,7 @@ public class ItemStatChanges
add(heal(RUN_ENERGY, 20), SUPER_ENERGY1, SUPER_ENERGY2, SUPER_ENERGY3, SUPER_ENERGY4);
add(new SuperRestore(.25, 8), SUPER_RESTORE1, SUPER_RESTORE2, SUPER_RESTORE3, SUPER_RESTORE4,
BLIGHTED_SUPER_RESTORE1, BLIGHTED_SUPER_RESTORE2, BLIGHTED_SUPER_RESTORE3, BLIGHTED_SUPER_RESTORE4);
add(new SuperRestore(.25, 9), SANFEW_SERUM1, SANFEW_SERUM2, SANFEW_SERUM3, SANFEW_SERUM4);
add(new SuperRestore(.30, 4), SANFEW_SERUM1, SANFEW_SERUM2, SANFEW_SERUM3, SANFEW_SERUM4);
add(heal(RUN_ENERGY, 20), STAMINA_POTION1, STAMINA_POTION2, STAMINA_POTION3, STAMINA_POTION4);
// Raids potions (+)

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

@@ -24,6 +24,7 @@
*/
package net.runelite.client.plugins.itemstats.potions;
import com.google.common.annotations.VisibleForTesting;
import java.util.Comparator;
import java.util.stream.Stream;
import lombok.RequiredArgsConstructor;
@@ -47,7 +48,8 @@ public class SuperRestore implements Effect
CONSTRUCTION
};
private final double percR; //percentage restored
@VisibleForTesting
public final double percR; //percentage restored
private final int delta;
@Override
@@ -56,7 +58,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)