Rename vampireCards in PlayerProgress

This commit is contained in:
Melledy
2025-11-14 19:14:16 -08:00
parent fe712e9d2d
commit 9f4ae13f09
4 changed files with 12 additions and 10 deletions

View File

@@ -42,10 +42,12 @@ public class PlayerProgress extends PlayerManager implements GameDatabaseObject
// Infinite Arena
private Int2IntMap infinityArenaLog;
// Vampire Survivors TODO
// Vampire Survivors
private Map<Integer, VampireSurvivorLog> vampireLog;
private Bitset vampireTalents;
private IntSet vampireCards;
// Fate cards
private IntSet fateCards;
@Deprecated // Morphia only
public PlayerProgress() {
@@ -72,7 +74,7 @@ public class PlayerProgress extends PlayerManager implements GameDatabaseObject
// Vampire Survivor
this.vampireLog = new HashMap<>();
this.vampireTalents = new Bitset();
this.vampireCards = new IntOpenHashSet();
this.fateCards = new IntOpenHashSet();
// Save to database
this.save();

View File

@@ -50,7 +50,7 @@ public class VampireSurvivorGame {
}
public boolean isNewCard(int id) {
return !this.getManager().getProgress().getVampireCards().contains(id);
return !this.getManager().getProgress().getFateCards().contains(id);
}
private void cacheRandomCards() {

View File

@@ -32,7 +32,7 @@ public class VampireSurvivorManager extends PlayerManager {
}
public int getTalentPoints() {
return this.getProgress().getVampireCards().size() * 5;
return this.getProgress().getFateCards().size() * 5;
}
public VampireSurvivorGame apply(int levelId, RepeatedLong builds) {
@@ -112,11 +112,11 @@ public class VampireSurvivorManager extends PlayerManager {
List<Integer> newCards = new ArrayList<>();
for (int card : game.getCards()) {
if (this.getProgress().getVampireCards().contains(card)) {
if (this.getProgress().getFateCards().contains(card)) {
continue;
}
this.getProgress().getVampireCards().add(card);
this.getProgress().getFateCards().add(card);
newCards.add(card);
}
@@ -125,14 +125,14 @@ public class VampireSurvivorManager extends PlayerManager {
}
// Save to database
Nebula.getGameDatabase().addToSet(this.getProgress(), this.getPlayerUid(), "vampireCards", newCards);
Nebula.getGameDatabase().addToSet(this.getProgress(), this.getPlayerUid(), "fateCards", newCards);
// Notify player
this.getPlayer().addNextPackage(
NetMsgId.vampire_survivor_talent_node_notify,
VampireTalentDetailResp.newInstance()
.setNodes(this.getTalents().toByteArray())
.setActiveCount(this.getProgress().getVampireCards().size())
.setActiveCount(this.getProgress().getFateCards().size())
.setObtainCount(newCards.size())
);
}

View File

@@ -18,7 +18,7 @@ public class HandlerVampireTalentDetailReq extends NetHandler {
// Build response
var rsp = VampireTalentDetailResp.newInstance()
.setNodes(manager.getTalents().toByteArray())
.setActiveCount(manager.getProgress().getVampireCards().size());
.setActiveCount(manager.getProgress().getFateCards().size());
// Encode and send
return session.encodeMsg(NetMsgId.vampire_talent_detail_succeed_ack, rsp);