mirror of
https://github.com/Melledy/Nebula.git
synced 2026-09-20 01:29:54 +02:00
Clear current player level ids when settling
This commit is contained in:
@@ -13,7 +13,6 @@ import lombok.Getter;
|
||||
public class InfinityTowerManager extends PlayerManager {
|
||||
private InfinityTowerLevelDef levelData;
|
||||
private int levelId;
|
||||
|
||||
private long buildId;
|
||||
|
||||
public InfinityTowerManager(Player player) {
|
||||
@@ -79,6 +78,10 @@ public class InfinityTowerManager extends PlayerManager {
|
||||
// Trigger achievement
|
||||
this.getPlayer().trigger(AchievementCondition.InfinityTowerClearSpecificFloor, 10, this.getLevelId(), 0);
|
||||
|
||||
// Clear instance
|
||||
this.levelId = 0;
|
||||
this.buildId = 0;
|
||||
|
||||
// Success
|
||||
return change.setSuccess(true);
|
||||
}
|
||||
|
||||
@@ -70,6 +70,10 @@ public class InstanceManager extends PlayerManager {
|
||||
// Set extra data
|
||||
change.setExtraData(settleData);
|
||||
|
||||
// Clear instance
|
||||
this.curInstanceId = 0;
|
||||
this.rewardType = 0;
|
||||
|
||||
// Success
|
||||
return change.setSuccess(true);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ public class StoryManager extends PlayerManager implements GameDatabaseObject {
|
||||
// Note: Story options are seperate from regular story ids to save database space, since most stories do not have options
|
||||
private Map<Integer, StoryOptionLog> options;
|
||||
|
||||
// Current story
|
||||
private transient int storyId;
|
||||
|
||||
@Deprecated // Morphia only
|
||||
public StoryManager() {
|
||||
|
||||
@@ -53,6 +56,10 @@ public class StoryManager extends PlayerManager implements GameDatabaseObject {
|
||||
this.save();
|
||||
}
|
||||
|
||||
public void apply(int idx) {
|
||||
this.storyId = idx;
|
||||
}
|
||||
|
||||
public boolean hasNew() {
|
||||
if (this.getCompletedStories().size() < GameData.getStoryDataTable().size()) {
|
||||
return true;
|
||||
@@ -111,6 +118,9 @@ public class StoryManager extends PlayerManager implements GameDatabaseObject {
|
||||
Nebula.getGameDatabase().addToSet(this, this.getPlayerUid(), "evidences", id);
|
||||
}
|
||||
|
||||
// Clear current story
|
||||
this.storyId = 0;
|
||||
|
||||
// Complete
|
||||
return change;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user