add pippi radius (close #26)

This commit is contained in:
yugecin 2016-11-20 22:50:49 +01:00
parent 6ef16bce36
commit b6f2101c16
3 changed files with 27 additions and 1 deletions

View File

@ -1091,6 +1091,25 @@ public class Options {
}
},
PIPPI_RADIUS_PERCENT ("Pippi radius", "PippiRad", "Radius of pippi, percentage of circle radius", 200, 0, 200) {
@Override
public String getValueString() {
return (val / 2) + "%";
}
@Override
public void drag(GameContainer container, int d) {
super.drag(container, d);
Pippi.setRadiusPercent(val / 2);
}
@Override
public void read(String s) {
super.read(s);
Pippi.setRadiusPercent(val / 2);
}
},
PIPPI_ANGLE_INC_MUL("Pippi angle increment multiplier", "PippiAngIncMul", "How fast pippi's angle increments", Pippi.angleInc, -200, 200) {
@Override
public String getValueString() {

View File

@ -142,6 +142,7 @@ public class OptionsMenu extends BasicGameState {
}),
PIPPI ("Pippi", new GameOption[] {
GameOption.PIPPI_ENABLE,
GameOption.PIPPI_RADIUS_PERCENT,
GameOption.PIPPI_ANGLE_INC_MUL,
GameOption.PIPPI_ANGLE_INC_MUL_SLIDER,
GameOption.PIPPI_SLIDER_FOLLOW_EXPAND,

View File

@ -28,6 +28,7 @@ public class Pippi {
private static final int targetdelta = 4;
public static boolean enabled = false;
private static int radiusPercent;
public static int angleInc = 10;
public static int angleSliderInc = 50;
public static boolean preventWobblyStreams = true;
@ -40,10 +41,15 @@ public class Pippi {
private static double pippimaxrad;
private static GameObject previous;
public static void setRadiusPercent(int radiusPercent) {
Pippi.radiusPercent = radiusPercent;
pippiminrad = pippirad = (Circle.diameter / 2d - 10d) * radiusPercent / 100d;
}
public static void reset() {
angle = 0;
currentdelta = 0;
pippiminrad = pippirad = Circle.diameter / 2d - 10d;
setRadiusPercent(radiusPercent);
pippimaxrad = Circle.diameter - 10d;
}