Reset shop purchases each month

This commit is contained in:
Melledy
2025-12-07 21:06:53 -08:00
parent 8e7ef038ea
commit 209ce83fc9
2 changed files with 19 additions and 0 deletions

View File

@@ -829,6 +829,20 @@ public class Inventory extends PlayerManager implements GameDatabaseObject {
return change.setSuccess(true); return change.setSuccess(true);
} }
public void resetShopPurchases() {
// Clear shop purchases if it's not empty
if (!this.getShopBuyCount().isEmpty()) {
this.getShopBuyCount().clear();
Nebula.getGameDatabase().update(this, this.getUid(), "shopBuyCount", this.getShopBuyCount());
}
// Clear mall purchases if it's not empty
if (!this.getMallBuyCount().isEmpty()) {
this.getMallBuyCount().clear();
Nebula.getGameDatabase().update(this, this.getUid(), "mallBuyCount", this.getMallBuyCount());
}
}
// Database // Database
public void loadFromDatabase() { public void loadFromDatabase() {

View File

@@ -691,6 +691,11 @@ public class Player implements GameDatabaseObject {
// Reset daily quests // Reset daily quests
this.getQuestManager().resetDailyQuests(); this.getQuestManager().resetDailyQuests();
this.getBattlePassManager().getBattlePass().resetDailyQuests(resetWeekly); this.getBattlePassManager().getBattlePass().resetDailyQuests(resetWeekly);
// Reset monthly shop purchases
if (resetMonthly) {
this.getInventory().resetShopPurchases();
}
} }
// Trigger quests + achievements // Trigger quests + achievements