use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class AttackTooltipFactory method extractActionValues.
private static List<MultiValueContainer> extractActionValues(DC_UnitAction el, VALUE[] baseKeys) {
List<MultiValueContainer> list = new ArrayList<>();
Pair<PARAMS, PARAMS> pair;
for (VALUE key : baseKeys) {
pair = ACTION_TOOLTIPS_PARAMS_MAP.get(key);
String name = ActionTooltipMaster.getStringForTableValue(key, el);
String imagePath = ActionTooltipMaster.getIconPathForTableRow(key);
final String leftVal = ActionTooltipMaster.getValueForTableParam(pair.getLeft(), el);
final String rightVal = ActionTooltipMaster.getValueForTableParam(pair.getRight(), el);
MultiValueContainer mvc;
if (!ImageManager.isImage(imagePath)) {
mvc = new MultiValueContainer(name, leftVal, rightVal);
} else {
mvc = new MultiValueContainer(TextureCache.getOrCreateR(imagePath), name, leftVal, rightVal);
}
list.add(mvc);
}
return list;
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class HeroScreenDataSourceImpl method getUnlockedMasteries.
@Override
public List<ValueContainer> getUnlockedMasteries() {
List<ValueContainer> list = new ArrayList<>();
for (PARAMS params : DC_ContentManager.getMasteryParams()) {
Integer v = hero.getIntParam(params);
if (v > 0) {
TextureRegion texture = TextureCache.getOrCreateR(ImageManager.getValueIconPath(params));
list.add(new ValueContainer(texture, params.getName(), String.valueOf(v)));
}
}
return null;
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class XlsMaster method main.
public static void main(String[] args) {
String types = "units;";
for (DC_TYPE type : TYPES) {
types += type.getName() + ";";
}
CoreEngine.setSelectivelyReadTypes(types);
// args[0];
String path = "Y:\\Google Drive\\Project Eidolons\\content\\";
String filename = path + "content.xls";
DC_Engine.mainMenuInit();
int i = 0;
HSSFWorkbook workbook = new HSSFWorkbook();
new DC_Game();
for (DC_TYPE TYPE : TYPES) {
PARAMS[] params = PARAM_ARRAYS[i];
String[] formulas = FORMULA_ARRAYS[i];
createSheet(workbook, TYPE, GROUPS_ARRAYS[i], params, formulas);
i++;
}
try {
FileOutputStream fileOut = new FileOutputStream(filename);
workbook.write(fileOut);
fileOut.close();
} catch (IOException e) {
main.system.ExceptionMaster.printStackTrace(e);
}
System.out.println("Content excel file has been generated!");
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class PrincipleMaster method fixParamBonuses.
private static void fixParamBonuses(ObjType type) {
String prop = type.getProperty(PROPS.PARAMETER_BONUSES);
Map<PARAMS, String> map = new RandomWizard<PARAMS>().constructStringWeightMap(prop, PARAMS.class);
Ref ref = new Ref(type.getGame());
ref.setID(KEYS.INFO, type.getId());
for (PARAMS param : map.keySet()) {
if (!(param.getName().contains(StringMaster.ALIGNMENT) || param.getName().contains(StringMaster.IDENTITY))) {
continue;
}
String string = map.get(param);
// string = TextParser.parse(string, ref,
// TextParser.INFO_PARSING_CODE);
// Ref.setInfoObject(type); TODO support {n} or is it useless?
int amount = StringMaster.getInteger(TextParser.parse(string, ref, TextParser.INFO_PARSING_CODE));
// if (param.getName().contains(StringMaster.ALIGNMENT)) {
//
// type.modifyParameter(param, amount);
// } else if (param.getName().contains(StringMaster.IDENTITY)) {
type.setParameter(param, amount);
String value = param.getName() + StringMaster.wrapInParenthesis(string + "");
type.removeProperty(PROPS.PARAMETER_BONUSES, value);
LogMaster.log(1, value + " move to parameter on " + type);
}
// TODO from prop to params
}
use of eidolons.content.PARAMS in project Eidolons by IDemiurge.
the class ChannelingRule method getChannelingCosts.
public static Costs getChannelingCosts(DC_SpellObj action, boolean activateOrResolve) {
List<Cost> list = new ArrayList<>();
for (PARAMS costParam : activateOrResolve ? costParamsActivate : costParamsResolve) {
PARAMS payParam = DC_ContentManager.getPayParameterForCost(costParam);
Cost cost = DC_CostsFactory.getCost(action, costParam, payParam);
// int mod = 100;
// cost.getPayment().getAmountFormula().applyModifier(mod);
list.add(cost);
}
// Costs costs = getEntity().getCosts();
// Costs channelingResolveCosts = new Costs(costs.getRequirements(), costs.getCosts());
// Costs channelingActivateCosts = new Costs(costs.getRequirements(), costs
// .getCost(PARAMS.C_N_OF_ACTIONS));
// channelingResolveCosts.removeCost(PARAMS.C_N_OF_ACTIONS);
CostRequirements reqs = action.getCosts().getRequirements();
Costs costs = new Costs(reqs, list);
if (!activateOrResolve)
costs.removeRequirement(InfoMaster.COOLDOWN_REASON);
return costs;
}
Aggregations