2024-08-17 14:54:06 -04:00
|
|
|
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;
|
2024-08-18 13:51:54 -04:00
|
|
|
private static final float goldPctPerLevel = (float)0.2;
|
2024-08-17 14:54:06 -04:00
|
|
|
|
2024-08-18 07:02:56 -04:00
|
|
|
public static final int campLvlAnnounceThreshold = 5;
|
|
|
|
|
public static final int campMaxLvl = 10;
|
2024-08-17 14:54:06 -04:00
|
|
|
|
|
|
|
|
private static final String[] nameMap =
|
|
|
|
|
{
|
|
|
|
|
"",
|
|
|
|
|
" I",
|
|
|
|
|
" II",
|
|
|
|
|
" III",
|
|
|
|
|
" IV",
|
|
|
|
|
" V",
|
|
|
|
|
" VI",
|
|
|
|
|
" VII",
|
|
|
|
|
" VIII",
|
|
|
|
|
" IX",
|
|
|
|
|
" X"
|
|
|
|
|
};
|
|
|
|
|
|
2024-08-18 07:02:56 -04:00
|
|
|
public static String getNameSuffix(Zone zone)
|
2024-08-17 14:54:06 -04:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return nameMap[zone.getCamplvl()];
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ignored)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-18 07:02:56 -04:00
|
|
|
public static float getMaxHealthPctModifier(Zone zone)
|
2024-08-17 14:54:06 -04:00
|
|
|
{
|
2024-08-18 07:02:56 -04:00
|
|
|
return getGenericModifier(zone, healthPctPerLevel);
|
2024-08-17 14:54:06 -04:00
|
|
|
}
|
|
|
|
|
|
2024-08-18 07:02:56 -04:00
|
|
|
public static float getAtrPctModifier(Zone zone)
|
2024-08-17 14:54:06 -04:00
|
|
|
{
|
2024-08-18 07:02:56 -04:00
|
|
|
return getGenericModifier(zone, atrPctPerLevel);
|
2024-08-17 14:54:06 -04:00
|
|
|
}
|
|
|
|
|
|
2024-08-18 07:02:56 -04:00
|
|
|
public static float getDefPctModifier(Zone zone)
|
2024-08-17 14:54:06 -04:00
|
|
|
{
|
2024-08-18 07:02:56 -04:00
|
|
|
return getGenericModifier(zone, defPctPerLevel);
|
2024-08-17 14:54:06 -04:00
|
|
|
}
|
|
|
|
|
|
2024-08-18 07:02:56 -04:00
|
|
|
public static float getLootDropModifier(Zone zone)
|
2024-08-17 14:54:06 -04:00
|
|
|
{
|
2024-08-18 07:02:56 -04:00
|
|
|
return getGenericModifier(zone, lootPctPerLevel);
|
2024-08-17 14:54:06 -04:00
|
|
|
}
|
|
|
|
|
|
2024-08-18 13:51:54 -04:00
|
|
|
public static float getGoldDropModifier(Zone zone)
|
|
|
|
|
{
|
|
|
|
|
return getGenericModifier(zone, goldPctPerLevel);
|
|
|
|
|
}
|
2024-08-17 14:54:06 -04:00
|
|
|
|
2024-08-18 07:02:56 -04:00
|
|
|
private static float getGenericModifier(Zone zone, float modifierPerLevel)
|
2024-08-17 14:54:06 -04:00
|
|
|
{
|
|
|
|
|
float modifier = (float)1.0;
|
|
|
|
|
|
|
|
|
|
if (zone != null)
|
|
|
|
|
{
|
|
|
|
|
modifier += zone.getCamplvl() * modifierPerLevel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return modifier;
|
|
|
|
|
}
|
|
|
|
|
}
|