From b6f2101c167286df4c44b6f6ab1b9dc2b480e18d Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 20 Nov 2016 22:50:49 +0100 Subject: [PATCH] add pippi radius (close #26) --- src/itdelatrisu/opsu/Options.java | 19 +++++++++++++++++++ src/itdelatrisu/opsu/states/OptionsMenu.java | 1 + src/yugecin/opsudance/Pippi.java | 8 +++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index f5cbed58..5b846729 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -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() { diff --git a/src/itdelatrisu/opsu/states/OptionsMenu.java b/src/itdelatrisu/opsu/states/OptionsMenu.java index 8478095c..cd31ac48 100644 --- a/src/itdelatrisu/opsu/states/OptionsMenu.java +++ b/src/itdelatrisu/opsu/states/OptionsMenu.java @@ -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, diff --git a/src/yugecin/opsudance/Pippi.java b/src/yugecin/opsudance/Pippi.java index e8322344..591f24ee 100644 --- a/src/yugecin/opsudance/Pippi.java +++ b/src/yugecin/opsudance/Pippi.java @@ -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; }