mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Refactor achievements to support a core set of achievements that each game mode offers
This commit is contained in:
@@ -41,11 +41,24 @@ public abstract class AchievementCollection implements Iterable<Achievement> {
|
||||
protected AchievementCollection(String name0, String filename0) {
|
||||
name = name0;
|
||||
filename = filename0;
|
||||
buildAchievementList();
|
||||
buildTopShelf();
|
||||
buildCoreShelves();
|
||||
buildBottomShelf();
|
||||
load();
|
||||
}
|
||||
|
||||
protected abstract void buildAchievementList();
|
||||
private void buildCoreShelves() {
|
||||
add("GameWinStreak", new GameWinStreak(10, 25, 50));
|
||||
add("MatchWinStreak", new MatchWinStreak(10, 25, 50));
|
||||
add("TotalGameWins", new TotalGameWins(250, 500, 1000));
|
||||
add("TotalMatchWins", new TotalMatchWins(100, 250, 500));
|
||||
add("Overkill", new Overkill(25, 50, 100));
|
||||
add("LifeToSpare", new LifeToSpare(20, 40, 80));
|
||||
add("Hellbent", new Hellbent());
|
||||
}
|
||||
|
||||
protected abstract void buildTopShelf();
|
||||
protected abstract void buildBottomShelf();
|
||||
|
||||
protected void add(String name, Achievement achievement) {
|
||||
achievements.put(name, achievement);
|
||||
|
||||
@@ -7,14 +7,13 @@ public class ConstructedAchievements extends AchievementCollection {
|
||||
super("Constructed", ForgeConstants.ACHIEVEMENTS_DIR + "constructed.xml");
|
||||
}
|
||||
|
||||
//add achievements that should appear at the top above core achievements for each game mode
|
||||
@Override
|
||||
protected void buildAchievementList() {
|
||||
add("GameWinStreak", new GameWinStreak(10, 25, 50));
|
||||
add("MatchWinStreak", new MatchWinStreak(10, 25, 50));
|
||||
add("TotalGameWins", new TotalGameWins(250, 500, 1000));
|
||||
add("TotalMatchWins", new TotalMatchWins(100, 250, 500));
|
||||
add("Overkill", new Overkill(25, 50, 100));
|
||||
add("LifeToSpare", new LifeToSpare(20, 40, 80));
|
||||
add("Hellbent", new Hellbent());
|
||||
protected void buildTopShelf() {
|
||||
}
|
||||
|
||||
//add achievements that should appear at the bottom below core achievements for each game mode
|
||||
@Override
|
||||
protected void buildBottomShelf() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,13 @@ public class DraftAchievements extends AchievementCollection {
|
||||
super("Booster Draft", ForgeConstants.ACHIEVEMENTS_DIR + "draft.xml");
|
||||
}
|
||||
|
||||
//add achievements that should appear at the top above core achievements for each game mode
|
||||
@Override
|
||||
protected void buildAchievementList() {
|
||||
add("GameWinStreak", new GameWinStreak(10, 25, 50));
|
||||
add("MatchWinStreak", new MatchWinStreak(10, 25, 50));
|
||||
add("TotalGameWins", new TotalGameWins(250, 500, 1000));
|
||||
add("TotalMatchWins", new TotalMatchWins(100, 250, 500));
|
||||
add("Overkill", new Overkill(25, 50, 100));
|
||||
add("LifeToSpare", new LifeToSpare(20, 40, 80));
|
||||
add("Hellbent", new Hellbent());
|
||||
protected void buildTopShelf() {
|
||||
}
|
||||
|
||||
//add achievements that should appear at the bottom below core achievements for each game mode
|
||||
@Override
|
||||
protected void buildBottomShelf() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,13 @@ public class QuestAchievements extends AchievementCollection {
|
||||
super("Quest Mode", ForgeConstants.ACHIEVEMENTS_DIR + "quest.xml");
|
||||
}
|
||||
|
||||
//add achievements that should appear at the top above core achievements for each game mode
|
||||
@Override
|
||||
protected void buildAchievementList() {
|
||||
add("GameWinStreak", new GameWinStreak(10, 25, 50));
|
||||
add("MatchWinStreak", new MatchWinStreak(10, 25, 50));
|
||||
add("TotalGameWins", new TotalGameWins(250, 500, 1000));
|
||||
add("TotalMatchWins", new TotalMatchWins(100, 250, 500));
|
||||
add("Overkill", new Overkill(25, 50, 100));
|
||||
add("LifeToSpare", new LifeToSpare(20, 40, 80));
|
||||
add("Hellbent", new Hellbent());
|
||||
protected void buildTopShelf() {
|
||||
}
|
||||
|
||||
//add achievements that should appear at the bottom below core achievements for each game mode
|
||||
@Override
|
||||
protected void buildBottomShelf() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,13 @@ public class SealedAchievements extends AchievementCollection {
|
||||
super("Sealed Deck", ForgeConstants.ACHIEVEMENTS_DIR + "sealed.xml");
|
||||
}
|
||||
|
||||
//add achievements that should appear at the top above core achievements for each game mode
|
||||
@Override
|
||||
protected void buildAchievementList() {
|
||||
add("GameWinStreak", new GameWinStreak(10, 25, 50));
|
||||
add("MatchWinStreak", new MatchWinStreak(10, 25, 50));
|
||||
add("TotalGameWins", new TotalGameWins(250, 500, 1000));
|
||||
add("TotalMatchWins", new TotalMatchWins(100, 250, 500));
|
||||
add("Overkill", new Overkill(25, 50, 100));
|
||||
add("LifeToSpare", new LifeToSpare(20, 40, 80));
|
||||
add("Hellbent", new Hellbent());
|
||||
protected void buildTopShelf() {
|
||||
}
|
||||
|
||||
//add achievements that should appear at the bottom below core achievements for each game mode
|
||||
@Override
|
||||
protected void buildBottomShelf() {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user