Refactor achievements to support a core set of achievements that each game mode offers

This commit is contained in:
drdev
2014-09-16 17:38:08 +00:00
parent 7a347a50bc
commit 55b55e6abd
5 changed files with 43 additions and 34 deletions

View File

@@ -41,11 +41,24 @@ public abstract class AchievementCollection implements Iterable<Achievement> {
protected AchievementCollection(String name0, String filename0) { protected AchievementCollection(String name0, String filename0) {
name = name0; name = name0;
filename = filename0; filename = filename0;
buildAchievementList(); buildTopShelf();
buildCoreShelves();
buildBottomShelf();
load(); 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) { protected void add(String name, Achievement achievement) {
achievements.put(name, achievement); achievements.put(name, achievement);

View File

@@ -7,14 +7,13 @@ public class ConstructedAchievements extends AchievementCollection {
super("Constructed", ForgeConstants.ACHIEVEMENTS_DIR + "constructed.xml"); super("Constructed", ForgeConstants.ACHIEVEMENTS_DIR + "constructed.xml");
} }
//add achievements that should appear at the top above core achievements for each game mode
@Override @Override
protected void buildAchievementList() { protected void buildTopShelf() {
add("GameWinStreak", new GameWinStreak(10, 25, 50)); }
add("MatchWinStreak", new MatchWinStreak(10, 25, 50));
add("TotalGameWins", new TotalGameWins(250, 500, 1000)); //add achievements that should appear at the bottom below core achievements for each game mode
add("TotalMatchWins", new TotalMatchWins(100, 250, 500)); @Override
add("Overkill", new Overkill(25, 50, 100)); protected void buildBottomShelf() {
add("LifeToSpare", new LifeToSpare(20, 40, 80));
add("Hellbent", new Hellbent());
} }
} }

View File

@@ -7,14 +7,13 @@ public class DraftAchievements extends AchievementCollection {
super("Booster Draft", ForgeConstants.ACHIEVEMENTS_DIR + "draft.xml"); super("Booster Draft", ForgeConstants.ACHIEVEMENTS_DIR + "draft.xml");
} }
//add achievements that should appear at the top above core achievements for each game mode
@Override @Override
protected void buildAchievementList() { protected void buildTopShelf() {
add("GameWinStreak", new GameWinStreak(10, 25, 50)); }
add("MatchWinStreak", new MatchWinStreak(10, 25, 50));
add("TotalGameWins", new TotalGameWins(250, 500, 1000)); //add achievements that should appear at the bottom below core achievements for each game mode
add("TotalMatchWins", new TotalMatchWins(100, 250, 500)); @Override
add("Overkill", new Overkill(25, 50, 100)); protected void buildBottomShelf() {
add("LifeToSpare", new LifeToSpare(20, 40, 80));
add("Hellbent", new Hellbent());
} }
} }

View File

@@ -7,14 +7,13 @@ public class QuestAchievements extends AchievementCollection {
super("Quest Mode", ForgeConstants.ACHIEVEMENTS_DIR + "quest.xml"); super("Quest Mode", ForgeConstants.ACHIEVEMENTS_DIR + "quest.xml");
} }
//add achievements that should appear at the top above core achievements for each game mode
@Override @Override
protected void buildAchievementList() { protected void buildTopShelf() {
add("GameWinStreak", new GameWinStreak(10, 25, 50)); }
add("MatchWinStreak", new MatchWinStreak(10, 25, 50));
add("TotalGameWins", new TotalGameWins(250, 500, 1000)); //add achievements that should appear at the bottom below core achievements for each game mode
add("TotalMatchWins", new TotalMatchWins(100, 250, 500)); @Override
add("Overkill", new Overkill(25, 50, 100)); protected void buildBottomShelf() {
add("LifeToSpare", new LifeToSpare(20, 40, 80));
add("Hellbent", new Hellbent());
} }
} }

View File

@@ -7,14 +7,13 @@ public class SealedAchievements extends AchievementCollection {
super("Sealed Deck", ForgeConstants.ACHIEVEMENTS_DIR + "sealed.xml"); super("Sealed Deck", ForgeConstants.ACHIEVEMENTS_DIR + "sealed.xml");
} }
//add achievements that should appear at the top above core achievements for each game mode
@Override @Override
protected void buildAchievementList() { protected void buildTopShelf() {
add("GameWinStreak", new GameWinStreak(10, 25, 50)); }
add("MatchWinStreak", new MatchWinStreak(10, 25, 50));
add("TotalGameWins", new TotalGameWins(250, 500, 1000)); //add achievements that should appear at the bottom below core achievements for each game mode
add("TotalMatchWins", new TotalMatchWins(100, 250, 500)); @Override
add("Overkill", new Overkill(25, 50, 100)); protected void buildBottomShelf() {
add("LifeToSpare", new LifeToSpare(20, 40, 80));
add("Hellbent", new Hellbent());
} }
} }