30 lines
866 B
Java
30 lines
866 B
Java
package games.dmg.spigotheights;
|
|
|
|
import java.util.function.IntUnaryOperator;
|
|
|
|
public enum StaturePotion {
|
|
SHIFTING("Potion of Shifting Stature"),
|
|
GROWTH("Potion of Growth"),
|
|
DIMINUTION("Potion of Diminution"),
|
|
RESTORATION("Potion of Restoration");
|
|
|
|
private final String displayName;
|
|
|
|
StaturePotion(String displayName) {
|
|
this.displayName = displayName;
|
|
}
|
|
|
|
public double scaleAfterDrinking(double current, HeightSettings settings, IntUnaryOperator randomIndex) {
|
|
return switch (this) {
|
|
case SHIFTING -> HeightMath.randomScale(settings, randomIndex);
|
|
case GROWTH -> HeightMath.grow(current, settings);
|
|
case DIMINUTION -> HeightMath.shrink(current, settings);
|
|
case RESTORATION -> 1.0;
|
|
};
|
|
}
|
|
|
|
public String displayName() {
|
|
return displayName;
|
|
}
|
|
}
|