Search in sources :

Example 1 with PARAMETER

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
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 2 with PARAMETER

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;
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 3 with PARAMETER

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);
    }
}
Also used : PRINCIPLES(main.content.enums.entity.HeroEnums.PRINCIPLES) PARAMETER(main.content.values.parameters.PARAMETER)

Example 4 with PARAMETER

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));
    }
}
Also used : PARAMS(eidolons.content.PARAMS) PARAMETER(main.content.values.parameters.PARAMETER)

Example 5 with PARAMETER

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);
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) PARAMETER(main.content.values.parameters.PARAMETER)

Aggregations

PARAMETER (main.content.values.parameters.PARAMETER)136 PROPERTY (main.content.values.properties.PROPERTY)22 ObjType (main.entity.type.ObjType)13 ArrayList (java.util.ArrayList)12 Formula (main.system.math.Formula)12 Ref (main.entity.Ref)9 VALUE (main.content.VALUE)7 Obj (main.entity.obj.Obj)7 PARAMS (eidolons.content.PARAMS)6 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)5 Cost (main.elements.costs.Cost)5 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)4 G_Panel (main.swing.generic.components.G_Panel)4 Node (org.w3c.dom.Node)4 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)3 HashMap (java.util.HashMap)3 DAMAGE_TYPE (main.content.enums.GenericEnums.DAMAGE_TYPE)3 Costs (main.elements.costs.Costs)3 Entity (main.entity.Entity)3 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)3