mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-13 12:54:36 +01:00
Rename vampireCards in PlayerProgress
This commit is contained in:
@@ -42,10 +42,12 @@ public class PlayerProgress extends PlayerManager implements GameDatabaseObject
|
|||||||
// Infinite Arena
|
// Infinite Arena
|
||||||
private Int2IntMap infinityArenaLog;
|
private Int2IntMap infinityArenaLog;
|
||||||
|
|
||||||
// Vampire Survivors TODO
|
// Vampire Survivors
|
||||||
private Map<Integer, VampireSurvivorLog> vampireLog;
|
private Map<Integer, VampireSurvivorLog> vampireLog;
|
||||||
private Bitset vampireTalents;
|
private Bitset vampireTalents;
|
||||||
private IntSet vampireCards;
|
|
||||||
|
// Fate cards
|
||||||
|
private IntSet fateCards;
|
||||||
|
|
||||||
@Deprecated // Morphia only
|
@Deprecated // Morphia only
|
||||||
public PlayerProgress() {
|
public PlayerProgress() {
|
||||||
@@ -72,7 +74,7 @@ public class PlayerProgress extends PlayerManager implements GameDatabaseObject
|
|||||||
// Vampire Survivor
|
// Vampire Survivor
|
||||||
this.vampireLog = new HashMap<>();
|
this.vampireLog = new HashMap<>();
|
||||||
this.vampireTalents = new Bitset();
|
this.vampireTalents = new Bitset();
|
||||||
this.vampireCards = new IntOpenHashSet();
|
this.fateCards = new IntOpenHashSet();
|
||||||
|
|
||||||
// Save to database
|
// Save to database
|
||||||
this.save();
|
this.save();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class VampireSurvivorGame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNewCard(int id) {
|
public boolean isNewCard(int id) {
|
||||||
return !this.getManager().getProgress().getVampireCards().contains(id);
|
return !this.getManager().getProgress().getFateCards().contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cacheRandomCards() {
|
private void cacheRandomCards() {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class VampireSurvivorManager extends PlayerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getTalentPoints() {
|
public int getTalentPoints() {
|
||||||
return this.getProgress().getVampireCards().size() * 5;
|
return this.getProgress().getFateCards().size() * 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VampireSurvivorGame apply(int levelId, RepeatedLong builds) {
|
public VampireSurvivorGame apply(int levelId, RepeatedLong builds) {
|
||||||
@@ -112,11 +112,11 @@ public class VampireSurvivorManager extends PlayerManager {
|
|||||||
List<Integer> newCards = new ArrayList<>();
|
List<Integer> newCards = new ArrayList<>();
|
||||||
|
|
||||||
for (int card : game.getCards()) {
|
for (int card : game.getCards()) {
|
||||||
if (this.getProgress().getVampireCards().contains(card)) {
|
if (this.getProgress().getFateCards().contains(card)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getProgress().getVampireCards().add(card);
|
this.getProgress().getFateCards().add(card);
|
||||||
newCards.add(card);
|
newCards.add(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,14 +125,14 @@ public class VampireSurvivorManager extends PlayerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save to database
|
// Save to database
|
||||||
Nebula.getGameDatabase().addToSet(this.getProgress(), this.getPlayerUid(), "vampireCards", newCards);
|
Nebula.getGameDatabase().addToSet(this.getProgress(), this.getPlayerUid(), "fateCards", newCards);
|
||||||
|
|
||||||
// Notify player
|
// Notify player
|
||||||
this.getPlayer().addNextPackage(
|
this.getPlayer().addNextPackage(
|
||||||
NetMsgId.vampire_survivor_talent_node_notify,
|
NetMsgId.vampire_survivor_talent_node_notify,
|
||||||
VampireTalentDetailResp.newInstance()
|
VampireTalentDetailResp.newInstance()
|
||||||
.setNodes(this.getTalents().toByteArray())
|
.setNodes(this.getTalents().toByteArray())
|
||||||
.setActiveCount(this.getProgress().getVampireCards().size())
|
.setActiveCount(this.getProgress().getFateCards().size())
|
||||||
.setObtainCount(newCards.size())
|
.setObtainCount(newCards.size())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class HandlerVampireTalentDetailReq extends NetHandler {
|
|||||||
// Build response
|
// Build response
|
||||||
var rsp = VampireTalentDetailResp.newInstance()
|
var rsp = VampireTalentDetailResp.newInstance()
|
||||||
.setNodes(manager.getTalents().toByteArray())
|
.setNodes(manager.getTalents().toByteArray())
|
||||||
.setActiveCount(manager.getProgress().getVampireCards().size());
|
.setActiveCount(manager.getProgress().getFateCards().size());
|
||||||
|
|
||||||
// Encode and send
|
// Encode and send
|
||||||
return session.encodeMsg(NetMsgId.vampire_talent_detail_succeed_ack, rsp);
|
return session.encodeMsg(NetMsgId.vampire_talent_detail_succeed_ack, rsp);
|
||||||
|
|||||||
Reference in New Issue
Block a user