use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.
the class HT_View method selectAltLink.
private String selectAltLink(String name, String prevData) {
LINK_VARIANT variant;
variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, new ListChooser(SELECTION_MODE.SINGLE, LINK_VARIANT.class).choose());
if (variant == null) {
if (prevData != null) {
} else {
return null;
}
}
String offsetX = "" + DialogMaster.inputInt("offset x", 0);
String offsetY = "" + DialogMaster.inputInt("offset y", 0);
String offsets = offsetX + "," + offsetY;
String suffix = (variant + "");
suffix += "=" + offsets;
String value = name + StringMaster.wrapInParenthesis(suffix);
return value;
}
use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.
the class ScriptParser method parseEvent.
public static STANDARD_EVENT_TYPE parseEvent(String eventPart) {
STANDARD_EVENT_TYPE eventType = getEventByShortcut(eventPart);
if (eventType != null)
return eventType;
eventType = new EnumMaster<STANDARD_EVENT_TYPE>().retrieveEnumConst(STANDARD_EVENT_TYPE.class, eventPart);
if (eventType != null)
return eventType;
return STANDARD_EVENT_TYPE.GAME_STARTED;
}
use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.
the class OptionsMaster method applyGameplayOptions.
private static void applyGameplayOptions(GameplayOptions gameplayOptions) {
for (Object sub : gameplayOptions.getValues().keySet()) {
new EnumMaster<GAMEPLAY_OPTION>().retrieveEnumConst(GAMEPLAY_OPTION.class, gameplayOptions.getValues().get(sub).toString());
GAMEPLAY_OPTION key = gameplayOptions.getKey((sub.toString()));
String value = gameplayOptions.getValue(key);
if (!StringMaster.isInteger(value)) {
switch(key) {
case RULES_SCOPE:
RuleMaster.setScope(new EnumMaster<RULE_SCOPE>().retrieveEnumConst(RULE_SCOPE.class, gameplayOptions.getValues().get(sub).toString()));
break;
case GAME_DIFFICULTY:
if (Eidolons.game != null)
if (Eidolons.game.getBattleMaster() != null)
Eidolons.game.getBattleMaster().getOptionManager().difficultySet(value);
break;
}
}
}
}
use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.
the class ContentGenerator method generateArmorPerDamageType.
public static void generateArmorPerDamageType(ObjType t, MATERIAL material) {
Integer armor = t.getIntParam(PARAMS.ARMOR);
for (DAMAGE_TYPE dmg_type : GenericEnums.DAMAGE_TYPE.values()) {
RESIST_GRADE grade = (material == null) ? getGradeForUnitType(t, dmg_type) : material.getResistGrade(dmg_type);
PROPERTY prop = DC_ContentManager.getResistGradeForDmgType(dmg_type);
if (prop == null) {
continue;
}
t.setProperty(prop, grade.toString());
t.setParam(DC_ContentManager.getArmorParamForDmgType(dmg_type), Math.round(armor * grade.getPercent() / 100));
if (material == null) {
grade = new EnumMaster<RESIST_GRADE>().retrieveEnumConst(RESIST_GRADE.class, t.getProperty(DC_ContentManager.getResistGradeForDmgType(dmg_type)));
} else {
grade = material.getSelfDamageGrade(dmg_type);
}
t.setProperty(DC_ContentManager.getSelfDamageGradeForDmgType(dmg_type), grade.toString());
prop = DC_ContentManager.getSelfDamageGradeForDmgType(dmg_type);
if (prop == null) {
continue;
}
grade = new EnumMaster<RESIST_GRADE>().retrieveEnumConst(RESIST_GRADE.class, t.getProperty(prop));
t.setParam(DC_ContentManager.getArmorSelfDamageParamForDmgType(dmg_type), Math.round(grade.getPercent()));
}
}
use of main.system.auxiliary.EnumMaster in project Eidolons by IDemiurge.
the class DC_MovementManager method getTemplateMoveCoordinate.
@Override
public Coordinates getTemplateMoveCoordinate(MOVE_TEMPLATES template, FACING_DIRECTION facing, Obj obj, Ref ref) {
// getOrCreate some caching to optimize this!
UNIT_DIRECTION direction = template.getDirection();
String range = template.getRange();
Boolean selective = template.isSelectiveTargeting();
if (template.getVarClasses() != null) {
String vars = ref.getObj(KEYS.ACTIVE).getCustomProperty(CustomValueManager.getVarEnumCustomValueName(MOVE_TEMPLATES.class));
List<String> varList = VariableManager.getVarList(vars);
range = varList.get(0);
if (varList.size() > 1) {
direction = new EnumMaster<UNIT_DIRECTION>().retrieveEnumConst(UNIT_DIRECTION.class, varList.get(1));
}
if (varList.size() > 2) {
selective = new Boolean(varList.get(2));
}
}
switch(template) {
}
if (selective == null) {
selective = false;
}
if (selective) {
// create filter by directions and range!
} else {
if (range.equals("1")) {
return obj.getCoordinates().getAdjacentCoordinate(DirectionMaster.getDirectionByFacing(facing, direction));
}
// preCheck int >= formla
}
return null;
}
Aggregations