Implement tutorial levels

This commit is contained in:
Melledy
2025-11-15 00:52:54 -08:00
parent b19667315d
commit 66b2d84945
8 changed files with 197 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import dev.morphia.annotations.Id;
import emu.nebula.Nebula;
import emu.nebula.data.GameData;
import emu.nebula.database.GameDatabaseObject;
import emu.nebula.game.tutorial.TutorialLevelLog;
import emu.nebula.game.vampire.VampireSurvivorLog;
import emu.nebula.proto.PlayerData.PlayerInfo;
import emu.nebula.proto.Public.CharGemInstance;
@@ -48,6 +49,9 @@ public class PlayerProgress extends PlayerManager implements GameDatabaseObject
// Fate cards
private IntSet fateCards;
// Tutorial
private Map<Integer, TutorialLevelLog> tutorialLog;
@Deprecated // Morphia only
public PlayerProgress() {
@@ -74,8 +78,13 @@ public class PlayerProgress extends PlayerManager implements GameDatabaseObject
// Vampire Survivor
this.vampireLog = new HashMap<>();
this.vampireTalents = new Bitset();
// Fate cards
this.fateCards = new IntOpenHashSet();
// Tutorials
this.tutorialLog = new HashMap<>();
// Save to database
this.save();
}
@@ -219,5 +228,10 @@ public class PlayerProgress extends PlayerManager implements GameDatabaseObject
vsProto.addRecords(log.toProto());
}
}
// Tutorials
for (var tutorial : this.getTutorialLog().values()) {
proto.addTutorialLevels(tutorial.toProto());
}
}
}