package emu.nebula;

import java.time.ZoneId;

import emu.nebula.game.inventory.ItemParam;
import emu.nebula.util.WeightedList;

public class GameConstants {
    private static final int DATA_VERSION = 51;
    private static final String VERSION = "1.2.0";
    
    public static final ZoneId UTC_ZONE = ZoneId.of("UTC");
    
    public static final String PROTO_BASE_TYPE_URL = "type.googleapis.com/proto.";
    
    public static final int INTRO_GUIDE_ID = 1;

    public static final int GOLD_ITEM_ID = 1;
    public static final int GEM_ITEM_ID = 2;
    public static final int PREM_GEM_ITEM_ID = 3;
    public static final int ENERGY_BUY_ITEM_ID = GEM_ITEM_ID;
    public static final int STAR_TOWER_GOLD_ITEM_ID = 11;
    public static final int EXP_ITEM_ID = 21;
    
    public static final int MAX_ENERGY = 240;
    public static final int ENERGY_REGEN_TIME = 360; // Seconds
    
    public static final int CHARACTER_MAX_GEMS_PER_SLOT = 4;
    public static final int CHARACTER_MAX_GEM_PRESETS = 3;
    public static final int CHARACTER_MAX_GEM_SLOTS = 3;
    
    public static final int MAX_FORMATIONS = 5;
    public static final int MAX_SHOWCASE_IDS = 5;
    
    public static final int BATTLE_PASS_ID = 1;
    
    public static final int MAX_FRIENDSHIPS = 50;
    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
    
    public static String getGameVersion() {
        return VERSION + "." + getDataVersion();
    }
    
    public static int getDataVersion() {
        return Nebula.getConfig().getCustomDataVersion() > 0 ? Nebula.getConfig().getCustomDataVersion() : DATA_VERSION ;
    }
}
