use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DebugUtilities method setGodParams.
private static void setGodParams(Entity entity) {
int i = 0;
for (PARAMETER p : GOD_MODE_INFINITE_PARAMETERS) {
entity.setParam(p, GOD_MODE_INFINITE_VALS[i]);
i++;
}
i = 0;
// for (PARAMETER portrait : GOD_MODE_INFINITE_PARAMETERS) {
// portrait = ContentManager.getCurrentParam(portrait);
// entity.setParam(portrait, GOD_MODE_INFINITE_VALS[i]);
// i++;
// }
// entity.setParam(PARAMS.C_MORALE, QUASI_INFINITE_VALUE / 10);
entity.setParam(PARAMS.C_INITIATIVE, QUASI_INFINITE_VALUE / 100);
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class TextGenerator method generatePerkParamBonuses.
public static String generatePerkParamBonuses(Entity e) {
List<List<VALUE>> pages = ValuePageManager.getValuesForHCInfoPages(e.getOBJ_TYPE_ENUM());
String string = PREFIX;
for (List<VALUE> list : pages) {
boolean prop = false;
for (VALUE v : list) {
if (v instanceof PARAMETER) {
if (!ContentManager.isValueForOBJ_TYPE(DC_TYPE.CHARS, v)) {
continue;
}
String amount = e.getValue(v);
amount = TextParser.parse(amount, e.getRef());
int n = new Formula(amount).getInt(e.getRef());
if (n != 0) {
string += n + " " + v.getName() + ", ";
}
} else {
prop = true;
break;
}
}
if (!prop && !list.equals(pages.get(pages.size() - 1))) {
string += StringMaster.NEW_LINE;
}
}
// StringMaster.replaceLast(" ," "and
string.substring(0, string.length() - 2);
return string;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class ContentManager method initCharParams.
private static void initCharParams() {
charParameters = new ArrayList<>(getParamList().size());
for (PARAMETER p : getParamList()) {
if (p.getEntityType().equals(DC_TYPE.CHARS.getName())) {
charParameters.add(p);
continue;
}
if (Arrays.asList(p.getEntityTypes()).contains((DC_TYPE.CHARS.getName()))) {
charParameters.add(p);
}
}
filteredCharParameters = new ArrayList<>(charParameters.size());
for (PARAMETER p : charParameters) {
if (!p.isDynamic()) {
if (!p.isLowPriority()) {
filteredCharParameters.add(p);
}
}
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class ContentManager method getBaseParameterFromCurrent.
public static PARAMETER getBaseParameterFromCurrent(PARAMETER param) {
PARAMETER baseParam = new MapMaster<PARAMETER, PARAMETER>().getKeyForValue(currentCache, param);
if (baseParam != null) {
return baseParam;
}
if (!param.name().startsWith(StringMaster.CURRENT)) {
return param;
}
baseParam = getPARAM(param.getFullName().replace(StringMaster.CURRENT, ""), true);
currentCache.put(baseParam, param);
return baseParam;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class ContentManager method getParamsForType.
public static List<PARAMETER> getParamsForType(String entity, boolean dynamic) {
List<PARAMETER> paramList = (dynamic) ? paramListsMap.get(entity) : paramListsMapAV.get(entity);
if (paramList != null) {
return paramList;
}
paramList = new ArrayList<>();
for (PARAMETER param : params) {
if (!dynamic) {
if (param.isDynamic() && !param.isWriteToType()) {
continue;
}
}
if (isValueForOBJ_TYPE(entity, param)) {
paramList.add(param);
}
}
if (!dynamic) {
paramListsMapAV.put(entity, paramList);
} else {
paramListsMap.put(entity, paramList);
}
return paramList;
}
Aggregations