mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-13 12:54:36 +01:00
Randomize daily shop gift
This commit is contained in:
@@ -2,6 +2,9 @@ package emu.nebula;
|
|||||||
|
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
|
|
||||||
|
import emu.nebula.game.inventory.ItemParam;
|
||||||
|
import emu.nebula.util.WeightedList;
|
||||||
|
|
||||||
public class GameConstants {
|
public class GameConstants {
|
||||||
private static final int DATA_VERSION = 48;
|
private static final int DATA_VERSION = 48;
|
||||||
private static final String VERSION = "1.2.0";
|
private static final String VERSION = "1.2.0";
|
||||||
@@ -34,6 +37,16 @@ public class GameConstants {
|
|||||||
public static final int MAX_FRIENDSHIPS = 50;
|
public static final int MAX_FRIENDSHIPS = 50;
|
||||||
public static final int MAX_PENDING_FRIENDSHIPS = 30;
|
public static final int MAX_PENDING_FRIENDSHIPS = 30;
|
||||||
|
|
||||||
|
// Daily gifts (Custom)
|
||||||
|
|
||||||
|
public static final WeightedList<ItemParam> DAILY_GIFTS = new WeightedList<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
DAILY_GIFTS.add(1000, new ItemParam(GOLD_ITEM_ID, 8888));
|
||||||
|
DAILY_GIFTS.add(250, new ItemParam(GOLD_ITEM_ID, 18888));
|
||||||
|
DAILY_GIFTS.add(10, new ItemParam(GEM_ITEM_ID, 50));
|
||||||
|
}
|
||||||
|
|
||||||
// Helper functions
|
// Helper functions
|
||||||
|
|
||||||
public static String getGameVersion() {
|
public static String getGameVersion() {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import dev.morphia.annotations.Entity;
|
import dev.morphia.annotations.Entity;
|
||||||
import dev.morphia.annotations.Id;
|
import dev.morphia.annotations.Id;
|
||||||
|
import emu.nebula.GameConstants;
|
||||||
import emu.nebula.Nebula;
|
import emu.nebula.Nebula;
|
||||||
import emu.nebula.data.GameData;
|
import emu.nebula.data.GameData;
|
||||||
import emu.nebula.data.resources.WorldClassDef;
|
import emu.nebula.data.resources.WorldClassDef;
|
||||||
@@ -297,8 +297,8 @@ public class QuestManager extends PlayerManager implements GameDatabaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Daily shop reward
|
// Daily shop reward
|
||||||
// TODO randomize
|
var reward = GameConstants.DAILY_GIFTS.next();
|
||||||
var change = this.getPlayer().getInventory().addItem(1, 8888);
|
var change = this.getPlayer().getInventory().addItem(reward.getId(), reward.getCount());
|
||||||
|
|
||||||
// Set and update in database
|
// Set and update in database
|
||||||
this.hasDailyReward = false;
|
this.hasDailyReward = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user