kevin
4 months ago
3 changed files with 115 additions and 2 deletions
@ -0,0 +1,77 @@
@@ -0,0 +1,77 @@
|
||||
package engine.util; |
||||
|
||||
import engine.objects.Zone; |
||||
|
||||
import java.util.Dictionary; |
||||
|
||||
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; |
||||
} |
||||
} |
Loading…
Reference in new issue