use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class TextMaster method initValueDescriptionsFolder.
public static void initValueDescriptionsFolder() {
for (PARAMS p : PARAMS.values()) {
String path = getParamsPath();
String name = p.getName();
if (p.isMastery()) {
path += "mastery\\";
}
if (p.isAttribute()) {
path += "attributes\\";
}
if (p.isDynamic()) {
name = name.replace("c ", "");
}
String descr = FileManager.readFile(path + name);
if (!descr.isEmpty()) {
p.setDescr(descr);
}
}
for (PROPS p : PROPS.values()) {
String path = getPropsPath();
String name = p.getName();
if (p.isPrinciple()) {
path += "principles\\";
}
String descr = FileManager.readFile(path + name);
if (!descr.isEmpty()) {
p.setDescr(descr);
}
}
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class XlsMaster method createSheet.
private static void createSheet(HSSFWorkbook workbook, DC_TYPE TYPE, String[] groups, PARAMS[] params, String[] formulas) {
HSSFSheet sheet = workbook.createSheet(TYPE.getName());
int row = 0;
HSSFRow rowhead = sheet.createRow((short) row);
rowhead.createCell(0).setCellValue("Name");
int column = 1;
for (String formula : formulas) {
rowhead.createCell(column).setCellValue(formula.split(formula_sep)[0]);
column++;
}
for (PARAMS param : params) {
rowhead.createCell(column).setCellValue((param).getShortName());
column++;
}
row++;
for (String group : groups) {
rowhead = sheet.createRow((short) row);
row++;
rowhead.createCell(0).setCellValue(group);
for (ObjType objType : DataManager.getTypesGroup(TYPE, group)) {
rowhead = sheet.createRow((short) row);
row++;
column = 0;
rowhead.createCell(column).setCellValue(objType.getName());
column++;
final ObjType simUnit = DataManager.getType(simUnitName, C_OBJ_TYPE.UNITS_CHARS);
Ref ref = new Ref() {
@Override
public ObjType getType(String string) {
if (string.equalsIgnoreCase(TYPE_KEY))
return objType;
return simUnit;
}
};
Map<VALUE, Integer> valueMap = null;
int simUnitRow = 0;
// Map<VALUE, Integer> entityMap;
for (String raw_formula : formulas) {
String formula = getFormula(raw_formula, row, column, valueMap, simUnitRow);
rowhead.createCell(column).setCellFormula(formula);
column++;
}
for (PARAMS param : params) {
rowhead.createCell(column).setCellValue(objType.getParam(param));
column++;
}
}
}
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class ResistPanel method updateAct.
@Override
public void updateAct(float delta) {
List<Pair<PARAMETER, String>> source = (List<Pair<PARAMETER, String>>) getUserObject();
source.forEach(pair -> {
PARAMS param = (PARAMS) pair.getLeft();
DAMAGE_TYPE damageType = getFromParams(param);
if (map.containsKey(damageType)) {
final ValueContainer container = map.get(damageType);
ValueTooltip valueTooltip = new ValueTooltip();
valueTooltip.setUserObject((Supplier) () -> Arrays.asList(new ValueContainer(param.getName(), "")));
container.addListener(valueTooltip.getController());
container.updateValue(pair.getRight() + "%");
}
});
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class DC_FeatObj method applyRank.
private void applyRank() {
Integer rank = getRank();
if (rank == 0) {
return;
}
Integer mod = rank * getRankFormulaMod();
for (AbilityObj p : getPassives()) {
// will affect AddParam effects?
for (Ability a : p.getAbilities()) {
for (Effect ef : a.getEffects()) {
try {
ef.resetOriginalFormula();
ef.appendFormulaByMod(100 + mod);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
// some exceptions?
/*
* how widely will this be used?
* mostly on simple low-level skills...
* but also on auras I guess...
* the point is to make things flexible, deeply customizable, and viable for
* no-magic heroes...
*
* it's true that with the amount of Masteries/Skills I may not need this on lower
* levels, but at some point I will!
*
* how will the rank be saved into hero data?
* >> (var)
* >> special prop
* >> prop per rank #
*/
}
}
}
for (PARAMETER attr : ContentManager.getAttributes()) {
PARAMS param = (PARAMS) attr;
Integer value = getIntParam(param, true);
if (value <= 0) {
continue;
}
value += Math.round(value * mod / 100);
setParam(param, value);
}
// modifyHeroParameters();
for (PARAMETER param : DC_ContentManager.getFeatModifyingParams()) {
Integer value = getIntParam(param, true);
if (value == 0) {
continue;
}
value += Math.round(value * mod / 100);
setParam(param, value);
}
Integer sdMod = rank * getIntParam(PARAMS.RANK_SD_MOD);
setParam(PARAMS.SKILL_DIFFICULTY, getIntParam(PARAMS.SKILL_DIFFICULTY, true));
modifyParamByPercent(PARAMS.SKILL_DIFFICULTY, sdMod);
rankApplied = true;
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class BuffRulesTest method buffRuleTest.
@Test
public void buffRuleTest() {
// root_params
int i = 0;
for (PARAMS root_param : root_params) {
// also test rule's state?
Integer initial = entity.getIntParam(reduced_params[i]);
entity.setParam(root_param, new Formula(value_low[i]).getInt(new Ref(entity)));
game.getStateManager().reset(entity);
Integer reduced = entity.getIntParam(reduced_params[i]);
if (isReductionOn(root_param)) {
printingAsserts.assertGreaterThanAndLog(initial, reduced, root_param + " rule");
}
if (!isIncreaseOn(root_param)) {
i++;
continue;
}
if (reduced_params[i] != increased_params[i]) {
initial = entity.getIntParam(increased_params[i]);
}
entity.setParam(root_param, new Formula(value_high[i]).getInt(new Ref(entity)));
game.getStateManager().reset(entity);
Integer increased = entity.getIntParam(increased_params[i]);
printingAsserts.assertGreaterThanAndLog(increased, initial, root_param + " rule");
i++;
}
}
Aggregations