Implemented half/double time mod.
Dynamic bpm, map length in song select menu. Fixed replay and spinner with these mods.
This commit is contained in:
@@ -33,7 +33,7 @@ public enum GameMod {
|
||||
"Easy", "Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required."),
|
||||
NO_FAIL (Category.EASY, 1, GameImage.MOD_NO_FAIL, "NF", 1, Input.KEY_W, 0.5f,
|
||||
"NoFail", "You can't fail. No matter what."),
|
||||
HALF_TIME (Category.EASY, 2, GameImage.MOD_HALF_TIME, "HT", 256, Input.KEY_E, 0.3f, false,
|
||||
HALF_TIME (Category.EASY, 2, GameImage.MOD_HALF_TIME, "HT", 256, Input.KEY_E, 0.3f,
|
||||
"HalfTime", "Less zoom."),
|
||||
HARD_ROCK (Category.HARD, 0, GameImage.MOD_HARD_ROCK, "HR", 16, Input.KEY_A, 1.06f,
|
||||
"HardRock", "Everything just got a bit harder..."),
|
||||
@@ -41,7 +41,7 @@ public enum GameMod {
|
||||
"SuddenDeath", "Miss a note and fail."),
|
||||
// PERFECT (Category.HARD, 1, GameImage.MOD_PERFECT, "PF", 64, Input.KEY_S, 1f,
|
||||
// "Perfect", "SS or quit."),
|
||||
DOUBLE_TIME (Category.HARD, 2, GameImage.MOD_DOUBLE_TIME, "DT", 64, Input.KEY_D, 1.12f, false,
|
||||
DOUBLE_TIME (Category.HARD, 2, GameImage.MOD_DOUBLE_TIME, "DT", 64, Input.KEY_D, 1.12f,
|
||||
"DoubleTime", "Zoooooooooom."),
|
||||
// NIGHTCORE (Category.HARD, 2, GameImage.MOD_NIGHTCORE, "NT", 64, Input.KEY_D, 1.12f,
|
||||
// "Nightcore", "uguuuuuuuu"),
|
||||
@@ -170,9 +170,14 @@ public enum GameMod {
|
||||
Collections.reverse(Arrays.asList(VALUES_REVERSED));
|
||||
}
|
||||
|
||||
private static boolean justChanged = false;
|
||||
|
||||
/** The last calculated score multiplier, or -1f if it must be recalculated. */
|
||||
private static float scoreMultiplier = -1f;
|
||||
|
||||
/** */
|
||||
private static float speedMultiplier = -1f;
|
||||
|
||||
/**
|
||||
* Initializes the game mods.
|
||||
* @param width the container width
|
||||
@@ -198,7 +203,7 @@ public enum GameMod {
|
||||
mod.active = false;
|
||||
}
|
||||
|
||||
scoreMultiplier = -1f;
|
||||
scoreMultiplier = speedMultiplier = -1f;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,6 +221,32 @@ public enum GameMod {
|
||||
return scoreMultiplier;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static float getSpeedMultiplier() {
|
||||
if (speedMultiplier < 0f) {
|
||||
float multiplier = 1f;
|
||||
if (DOUBLE_TIME.isActive())
|
||||
multiplier = 1.5f;
|
||||
else if (HALF_TIME.isActive())
|
||||
multiplier = 0.75f;
|
||||
speedMultiplier = multiplier;
|
||||
}
|
||||
return speedMultiplier;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static boolean justChanged() {
|
||||
if (justChanged) {
|
||||
justChanged = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current game mod state (bitwise OR of active mods).
|
||||
*/
|
||||
@@ -233,6 +264,7 @@ public enum GameMod {
|
||||
* @param state the state (bitwise OR of active mods)
|
||||
*/
|
||||
public static void loadModState(int state) {
|
||||
scoreMultiplier = speedMultiplier = -1f;
|
||||
for (GameMod mod : GameMod.values())
|
||||
mod.active = ((state & mod.getBit()) > 0);
|
||||
}
|
||||
@@ -352,7 +384,8 @@ public enum GameMod {
|
||||
return;
|
||||
|
||||
active = !active;
|
||||
scoreMultiplier = -1f;
|
||||
scoreMultiplier = speedMultiplier = -1f;
|
||||
justChanged = true;
|
||||
|
||||
if (checkInverse) {
|
||||
if (AUTO.isActive()) {
|
||||
|
||||
Reference in New Issue
Block a user