mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-17 06:44:35 +01:00
Implement !battlepass command
Examples: `!battlepass premium` = Activates elite grant `!battlepass lv40` = Unlocks the rewards up to level 40
This commit is contained in:
@@ -30,7 +30,7 @@ public class BattlePass implements GameDatabaseObject {
|
||||
private int uid;
|
||||
private transient BattlePassManager manager;
|
||||
|
||||
private int battlePassId;
|
||||
private int battlePassId; // Season id
|
||||
private int mode;
|
||||
private int level;
|
||||
private int exp;
|
||||
@@ -71,6 +71,13 @@ public class BattlePass implements GameDatabaseObject {
|
||||
return manager.getPlayer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the mode directly
|
||||
*/
|
||||
public synchronized void setMode(int mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public boolean isPremium() {
|
||||
return this.mode > 0;
|
||||
}
|
||||
@@ -79,6 +86,14 @@ public class BattlePass implements GameDatabaseObject {
|
||||
return GameData.getBattlePassRewardDataTable().get((this.getBattlePassId() << 16) + level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the level directly, use getMaxExp() instead if adding exp.
|
||||
*/
|
||||
public synchronized void setLevel(int level) {
|
||||
this.level = level;
|
||||
this.exp = 0;
|
||||
}
|
||||
|
||||
public int getMaxExp() {
|
||||
var data = GameData.getBattlePassLevelDataTable().get(this.getLevel() + 1);
|
||||
return data != null ? data.getExp() : 0;
|
||||
|
||||
Reference in New Issue
Block a user