use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DC_FeatObj method addParamBonuses.
private void addParamBonuses() {
float quotientSum = 0;
for (PARAMETER param : getBonusMap().keySet()) {
Integer amount = StringMaster.getInteger(getBonusMap().get(param), getRef());
float d = new Float(amount * getRankTotalFormulaMod()) / 100;
if (param.isAttribute()) {
quotientSum += d - Math.floor(d);
} else {
amount += Math.round(d);
}
getHero().modifyParameter(param, amount, getName());
}
if (quotientSum != 0) {
String paramName;
if (getOBJ_TYPE_ENUM() == DC_TYPE.CLASSES) {
paramName = DC_ContentManager.getMainAttributeForClass(this);
if (paramName.contains(StringMaster.AND)) {
quotientSum = quotientSum / paramName.split(StringMaster.AND).length;
}
} else {
paramName = StringMaster.openContainer(VariableManager.removeVarPart(getProperty(PROPS.ATTRIBUTE_BONUSES))).get(0);
}
int rounded = Math.round(quotientSum);
getHero().modifyParameter(paramName, "" + rounded);
}
// save .x
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class UnitCalculator method calculateInitiative.
public int calculateInitiative(boolean current) {
PARAMETER param = PARAMS.N_OF_ACTIONS;
if (current) {
param = ContentManager.getCurrentParam(param);
}
int initiative = getIntParam(param) * getIntParam(PARAMS.INITIATIVE_MODIFIER);
initiative += getIntParam(PARAMS.C_INITIATIVE_BONUS);
if (game.isDummyMode()) {
if (!getChecker().isBfObj()) {
if (!getChecker().isNeutral()) {
if (!getEntity().getOwner().isMe()) {
initiative = Math.min(10, getGame().getRules().getTimeRule().getTimeRemaining() + 1);
}
}
}
}
return initiative;
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class UnitInitializer method initIntegrityAlignments.
public void initIntegrityAlignments() {
Map<PRINCIPLES, Integer> map = new RandomWizard<PRINCIPLES>().constructWeightMap(getProperty(G_PROPS.PRINCIPLES), PRINCIPLES.class);
for (PRINCIPLES principle : map.keySet()) {
Integer amount = map.get(principle);
if (amount == 0) {
continue;
}
PARAMETER alignmentParam = DC_ContentManager.getAlignmentForPrinciple(principle);
getEntity().modifyParameter(alignmentParam, amount);
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class UnitResetter method resetMasteryScores.
public void resetMasteryScores() {
for (PARAMS mastery : DC_ContentManager.getMasteryParams()) {
PARAMETER score = ContentManager.getMasteryScore(mastery);
getEntity().getType().setParam(score, getIntParam(mastery));
getEntity().setParam(score, getIntParam(mastery));
}
}
use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.
the class DC_HeroItemObj method apply.
@Override
public void apply() {
super.apply();
applyDurability();
for (PROPERTY prop : props) {
initProp(prop);
}
for (PARAMETER param : params) {
initParam(param);
}
// hero.modifyParameter(PARAMS.CARRYING_WEIGHT, getWeight());
getHero().setDirty(true);
}
Aggregations