mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-16 14:24:57 +01:00
Handle more achievements
This commit is contained in:
@@ -14,7 +14,7 @@ import lombok.Getter;
|
||||
// Because achievements in the data files do not have params, we will hardcode them here
|
||||
public class AchievementHelper {
|
||||
// Cache
|
||||
private static IntSet isTotalAchievementSet = new IntOpenHashSet();
|
||||
private static IntSet incrementalAchievementSet = new IntOpenHashSet();
|
||||
|
||||
@Getter
|
||||
private static Int2ObjectMap<List<AchievementDef>> cache = new Int2ObjectOpenHashMap<>();
|
||||
@@ -25,8 +25,8 @@ public class AchievementHelper {
|
||||
|
||||
//
|
||||
|
||||
public static boolean isTotalAchievement(int condition) {
|
||||
return isTotalAchievementSet.contains(condition);
|
||||
public static boolean isIncrementalAchievement(int condition) {
|
||||
return incrementalAchievementSet.contains(condition);
|
||||
}
|
||||
|
||||
// Fix params
|
||||
@@ -35,12 +35,14 @@ public class AchievementHelper {
|
||||
// Cache total achievements
|
||||
for (var condition : AchievementCondition.values()) {
|
||||
if (condition.name().endsWith("Total")) {
|
||||
isTotalAchievementSet.add(condition.getValue());
|
||||
incrementalAchievementSet.add(condition.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
isTotalAchievementSet.add(AchievementCondition.ItemsAdd.getValue());
|
||||
isTotalAchievementSet.add(AchievementCondition.ItemsDeplete.getValue());
|
||||
incrementalAchievementSet.remove(AchievementCondition.AchievementTotal.getValue());
|
||||
|
||||
incrementalAchievementSet.add(AchievementCondition.ItemsAdd.getValue());
|
||||
incrementalAchievementSet.add(AchievementCondition.ItemsDeplete.getValue());
|
||||
|
||||
// Fix params
|
||||
fixParams();
|
||||
@@ -58,6 +60,33 @@ public class AchievementHelper {
|
||||
addParam(27, GameConstants.GOLD_ITEM_ID, 0);
|
||||
addParam(28, GameConstants.GOLD_ITEM_ID, 0);
|
||||
addParam(29, GameConstants.GOLD_ITEM_ID, 0);
|
||||
|
||||
// Ininfite tower
|
||||
for (int diff = 10, id = 270; diff <= 60; diff += 10) {
|
||||
addParam(id++, 11000 + diff, 0); // Infinite Arena
|
||||
addParam(id++, 51000 + diff, 0); // Shake the Floor
|
||||
addParam(id++, 41000 + diff, 0); // Elegance and Flow
|
||||
addParam(id++, 71000 + diff, 0); // Upbeat Party
|
||||
addParam(id++, 31000 + diff, 0); // Thrilling Beat
|
||||
addParam(id++, 21000 + diff, 0); // Flames and Beats
|
||||
addParam(id++, 61000 + diff, 0); // Sinister Ritual
|
||||
}
|
||||
|
||||
// Character count
|
||||
addParam(393, 1, 0);
|
||||
addParam(394, 1, 0);
|
||||
addParam(395, 1, 0);
|
||||
addParam(396, 1, 0);
|
||||
addParam(397, 1, 0);
|
||||
addParam(398, 1, 0);
|
||||
|
||||
// Disc count
|
||||
addParam(382, 1, 0);
|
||||
addParam(383, 1, 0);
|
||||
addParam(384, 1, 0);
|
||||
addParam(385, 1, 0);
|
||||
addParam(386, 1, 0);
|
||||
addParam(387, 1, 0);
|
||||
}
|
||||
|
||||
private static void addParam(int achievementId, int param1, int param2) {
|
||||
|
||||
Reference in New Issue
Block a user