v2.0.0: added proper unlock logic for the Duelist

This commit is contained in:
Evan Debenham
2023-03-09 17:50:13 -05:00
parent 2449769a64
commit 37b687caae
3 changed files with 12 additions and 4 deletions

View File

@@ -40,7 +40,9 @@ public class ShatteredPixelDungeon extends Game {
public static final int v1_1_2 = 588;
public static final int v1_2_3 = 628;
public static final int v1_3_2 = 648;
public static final int v1_4_0 = 660;
public static final int v1_4_3 = 668;
public static final int v2_0_0 = 684;
public ShatteredPixelDungeon( PlatformSupport platform ) {
super( sceneClass == null ? WelcomeScene.class : sceneClass, platform );

View File

@@ -293,9 +293,6 @@ public enum HeroClass {
//always unlock on debug builds
if (DeviceCompat.isDebug()) return true;
//For Beta/Alpha testers, TODO disable for full release!
if (this == DUELIST) return true;
switch (this){
case WARRIOR: default:
return true;

View File

@@ -284,6 +284,15 @@ public class WelcomeScene extends PixelScene {
}
//pre-unlock Duelist for those who already have a win
if (previousVersion <= ShatteredPixelDungeon.v2_0_0){
Badges.loadGlobal();
if (Badges.isUnlocked(Badges.Badge.VICTORY) && !Badges.isUnlocked(Badges.Badge.UNLOCK_DUELIST)){
Badges.unlock(Badges.Badge.UNLOCK_DUELIST);
Badges.saveGlobal();
}
}
SPDSettings.version(ShatteredPixelDungeon.versionCode);
}