Search in sources :

Example 46 with PARAMETER

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

Example 47 with PARAMETER

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;
}
Also used : ATTRIBUTE(eidolons.content.DC_ContentManager.ATTRIBUTE) MASTERY(main.content.enums.entity.SkillEnums.MASTERY) PARAMETER(main.content.values.parameters.PARAMETER)

Example 48 with PARAMETER

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

Example 49 with PARAMETER

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

Example 50 with PARAMETER

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));
    }
}
Also used : MACRO_MODES(eidolons.game.module.adventure.entity.MacroActionManager.MACRO_MODES) 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