package engine.util;

import engine.objects.Zone;

public class ZoneLevel {

    private static final float healthPctPerLevel = (float)0.2;
    private static final float atrPctPerLevel = (float)0.2;
    private static final float defPctPerLevel = (float)0.2;
    private static final float lootPctPerLevel = (float)0.1;

    public static final int campLvlAnnounceThreshold = 5;
    public static final int campMaxLvl = 10;

    private static final String[] nameMap =
            {
              "",
              " I",
              " II",
              " III",
              " IV",
              " V",
              " VI",
              " VII",
              " VIII",
              " IX",
              " X"
            };

    public static String getNameSuffix(Zone zone)
    {
        try {
            return nameMap[zone.getCamplvl()];
        }
        catch (Exception ignored)
        {
        }

        return "";
    }

    public static float getMaxHealthPctModifier(Zone zone)
    {
        return getGenericModifier(zone, healthPctPerLevel);
    }

    public static float getAtrPctModifier(Zone zone)
    {
        return getGenericModifier(zone, atrPctPerLevel);
    }

    public static float getDefPctModifier(Zone zone)
    {
        return getGenericModifier(zone, defPctPerLevel);
    }

    public static float getLootDropModifier(Zone zone)
    {
        return getGenericModifier(zone, lootPctPerLevel);
    }



    private static float getGenericModifier(Zone zone, float modifierPerLevel)
    {
        float modifier = (float)1.0;

        if (zone != null)
        {
            modifier += zone.getCamplvl() * modifierPerLevel;
        }

        return modifier;
    }
}
