mirror of
https://github.com/Melledy/Nebula.git
synced 2026-09-20 01:29:54 +02:00
Implement boss blitz
This commit is contained in:
@@ -18,6 +18,7 @@ import emu.nebula.game.instance.InstanceManager;
|
||||
import emu.nebula.game.inventory.Inventory;
|
||||
import emu.nebula.game.mail.Mailbox;
|
||||
import emu.nebula.game.quest.QuestManager;
|
||||
import emu.nebula.game.scoreboss.ScoreBossManager;
|
||||
import emu.nebula.game.story.StoryManager;
|
||||
import emu.nebula.game.tower.StarTowerManager;
|
||||
import emu.nebula.net.GameSession;
|
||||
@@ -64,7 +65,8 @@ public class Player implements GameDatabaseObject {
|
||||
|
||||
// Managers
|
||||
private final transient CharacterStorage characters;
|
||||
private transient GachaManager gachaManager;
|
||||
private final transient GachaManager gachaManager;
|
||||
private final transient ScoreBossManager scoreBossManager;
|
||||
|
||||
// Referenced data
|
||||
private transient Inventory inventory;
|
||||
@@ -80,9 +82,12 @@ public class Player implements GameDatabaseObject {
|
||||
|
||||
@Deprecated // Morphia only
|
||||
public Player() {
|
||||
// Init player managers
|
||||
this.characters = new CharacterStorage(this);
|
||||
this.gachaManager = new GachaManager(this);
|
||||
this.scoreBossManager = new ScoreBossManager(this);
|
||||
|
||||
// Init next packages stack
|
||||
this.nextPackages = new Stack<>();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package emu.nebula.game.scoreboss;
|
||||
|
||||
import emu.nebula.data.GameData;
|
||||
import emu.nebula.data.resources.ScoreBossControlDef;
|
||||
import emu.nebula.game.player.Player;
|
||||
import emu.nebula.game.player.PlayerManager;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class ScoreBossManager extends PlayerManager {
|
||||
private int levelId;
|
||||
private long buildId;
|
||||
|
||||
public ScoreBossManager(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public int getControlId() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public ScoreBossControlDef getControlData() {
|
||||
return GameData.getScoreBossControlDataTable().get(this.getControlId());
|
||||
}
|
||||
|
||||
public boolean apply(int levelId, long buildId) {
|
||||
// Get level
|
||||
var control = getControlData();
|
||||
if (control == null || !control.getLevelGroup().contains(levelId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get build
|
||||
var build = this.getPlayer().getStarTowerManager().getBuildById(buildId);
|
||||
if (build == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set
|
||||
this.levelId = levelId;
|
||||
this.buildId = buildId;
|
||||
|
||||
// Success
|
||||
return true;
|
||||
}
|
||||
|
||||
public void settle(int star, int score) {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user