use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class UnitLevelManager method upParams.
private void upParams(ObjType newType, int i) {
for (PARAMETER p : ContentManager.getPerLevelParams()) {
if (newType.getIntParam(p) > 0) {
PARAMETER param = ContentManager.getPARAM(p.toString().replace(StringMaster.PER_LEVEL, ""));
newType.modifyParameter(param, newType.getIntParam(p));
}
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class UnitLevelManager method getRandomParameter.
private PARAMETER getRandomParameter(boolean attrs, Entity newType) {
PARAMETER param;
if (attrs) {
ATTRIBUTE a = new RandomWizard<ATTRIBUTE>().getObjectByWeight(newType.getProperty(PROPS.ATTRIBUTE_PROGRESSION), ATTRIBUTE.class);
param = ContentManager.getBaseAttribute(ContentManager.getPARAM(a.toString()));
} else {
MASTERY mstr = new RandomWizard<MASTERY>().getObjectByWeight(newType.getProperty(PROPS.MASTERY_PROGRESSION), MASTERY.class);
if (mstr == null) {
return null;
}
// TODO complete the ENUM!!!
param = ContentManager.getPARAM(mstr.toString());
if (param == null) {
param = ContentManager.findPARAM(mstr.toString());
}
}
return param;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class UnitLevelManager method spendPoints.
public Integer spendPoints(int points, Entity newType, boolean attrs) {
String progression = newType.getProperty((attrs) ? PROPS.ATTRIBUTE_PROGRESSION : PROPS.MASTERY_PROGRESSION);
if (StringMaster.isEmpty(progression)) {
// TODO set for
progression = generateProgression(newType, attrs);
newType.setProperty((attrs) ? PROPS.ATTRIBUTE_PROGRESSION : PROPS.MASTERY_PROGRESSION, // type?
progression);
}
List<String> list = StringMaster.openContainer(progression);
PARAMS pointsParam = (attrs) ? PARAMS.ATTR_POINTS : PARAMS.MASTERY_POINTS;
if (list.isEmpty()) {
return points;
}
Loop.startLoop(50);
while (points > 0 && !Loop.loopEnded()) // for (String valueName : list)
{
PARAMETER param = null;
try {
param = getRandomParameter(attrs, newType);
} catch (Exception e) {
}
if (param == null) {
continue;
}
int cost = PointMaster.getPointCost(newType.getIntParam(param), newType, param);
if (points >= cost) {
newType.modifyParameter(param, 1);
points -= cost;
}
}
newType.setParam(pointsParam, points);
return points;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class SpellResetter method addCustomMods.
@Override
protected void addCustomMods() {
if (getEntity().getOwnerObj().getCustomParamMap() == null) {
return;
}
super.addCustomMods();
for (PARAMETER param : DC_ContentManager.getCostParams()) {
addCustomMod(MetaEnums.CUSTOM_VALUE_TEMPLATE.COST_REDUCTION_SPELL_GROUP, getEntity().getSpellGroup().toString(), param, false);
addCustomMod(MetaEnums.CUSTOM_VALUE_TEMPLATE.COST_REDUCTION_SPELL_POOL, getEntity().getSpellPool().toString(), param, false);
addCustomMod(MetaEnums.CUSTOM_VALUE_TEMPLATE.COST_REDUCTION_SPELL_TYPE, getEntity().getSpellType().toString(), param, false);
addCustomMod(MetaEnums.CUSTOM_VALUE_TEMPLATE.COST_MOD_SPELL_GROUP, getEntity().getSpellGroup().toString(), param, true);
addCustomMod(MetaEnums.CUSTOM_VALUE_TEMPLATE.COST_MOD_SPELL_POOL, getEntity().getSpellPool().toString(), param, true);
addCustomMod(MetaEnums.CUSTOM_VALUE_TEMPLATE.COST_MOD_SPELL_TYPE, getEntity().getSpellType().toString(), param, true);
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class RestMasterOld method applyMacroModeContinuous.
// upon activation
public static void applyMacroModeContinuous(Unit hero) {
MACRO_MODES mode = new EnumMaster<MACRO_MODES>().retrieveEnumConst(MACRO_MODES.class, hero.getProperty(MACRO_PROPS.MACRO_MODE));
String paramString = mode.getContinuousParamString();
Map<PARAMETER, Integer> map = new RandomWizard<PARAMETER>().constructWeightMap(paramString, PARAMETER.class);
for (PARAMETER param : map.keySet()) {
hero.modifyParameter(param, map.get(param));
}
}
Aggregations