mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-15 13:54:51 +01:00
Implement daily activity missions
This commit is contained in:
@@ -17,6 +17,7 @@ import emu.nebula.game.gacha.GachaManager;
|
||||
import emu.nebula.game.instance.InstanceManager;
|
||||
import emu.nebula.game.inventory.Inventory;
|
||||
import emu.nebula.game.mail.Mailbox;
|
||||
import emu.nebula.game.quest.QuestCondType;
|
||||
import emu.nebula.game.quest.QuestManager;
|
||||
import emu.nebula.game.scoreboss.ScoreBossManager;
|
||||
import emu.nebula.game.story.StoryManager;
|
||||
@@ -366,8 +367,14 @@ public class Player implements GameDatabaseObject {
|
||||
return change == null ? new PlayerChangeInfo() : change;
|
||||
}
|
||||
|
||||
// Consume energy
|
||||
change = modifyEnergy(-amount, change);
|
||||
|
||||
// Trigger quest
|
||||
this.getQuestManager().triggerQuest(QuestCondType.EnergyDeplete, amount);
|
||||
|
||||
// Complete
|
||||
return modifyEnergy(-amount, change);
|
||||
return change;
|
||||
}
|
||||
|
||||
private PlayerChangeInfo modifyEnergy(int amount, PlayerChangeInfo change) {
|
||||
@@ -445,6 +452,10 @@ public class Player implements GameDatabaseObject {
|
||||
this.questManager = this.loadManagerFromDatabase(QuestManager.class);
|
||||
}
|
||||
|
||||
public void onLogin() {
|
||||
this.getQuestManager().triggerQuest(QuestCondType.LoginTotal, 1);
|
||||
}
|
||||
|
||||
// Next packages
|
||||
|
||||
public void addNextPackage(int msgId, ProtoMessage<?> proto) {
|
||||
@@ -556,6 +567,10 @@ public class Player implements GameDatabaseObject {
|
||||
quests.addList(quest.toProto());
|
||||
}
|
||||
|
||||
for (int id : this.getQuestManager().getClaimedActiveIds()) {
|
||||
proto.addDailyActiveIds(id);
|
||||
}
|
||||
|
||||
// Add dictionary tabs
|
||||
for (var dictionaryData : GameData.getDictionaryTabDataTable()) {
|
||||
var dictionaryProto = DictionaryTab.newInstance()
|
||||
|
||||
Reference in New Issue
Block a user