Search in sources :

Example 21 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class MasteryIconColumn method refresh.

@Override
public void refresh() {
    updateMasteries();
    removeAll();
    int i = 0;
    for (PARAMETER mastery : masteries) {
        Component icon = getMasteryIconComp(mastery);
        int x = i % 2 == 0 ? -offset : fitSize - offset;
        int y = i / 2 * fitSize;
        // 40x40 override? overlap,
        add(icon, "pos " + x + " " + y);
        // that is... selected
        // on top... custom zorder
        i++;
    // page controls needed? perhaps not!
    }
    // setComponentZOrder(comp, index);
    revalidate();
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent) PARAMETER(main.content.values.parameters.PARAMETER)

Example 22 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class FloatingTextMaster method createAndShowParamModText.

public void createAndShowParamModText(Object o) {
    Pair<PARAMETER, Ref> pair = (Pair<PARAMETER, Ref>) o;
    Entity active = pair.getValue().getObj(KEYS.ACTIVE);
    int amount = 0;
    if (pair.getValue().getAmount() != null)
        amount = pair.getValue().getAmount();
    else {
        return;
    }
    FloatingText text = getFloatingText(active, TEXT_CASES.PARAM_MOD, new ImmutablePair<>(pair.getKey(), amount));
    Obj obj = active.getRef().getTargetObj();
    if (obj == null)
        obj = active.getRef().getSourceObj();
    if (obj != null) {
        BaseView view = DungeonScreen.getInstance().getGridPanel().getViewMap().get(obj);
        if (view != null) {
            Vector2 v = view.localToStageCoordinates(new Vector2(view.getX(), view.getY()));
            text.setPosition(v.x, v.y);
        }
    }
    GuiEventManager.trigger(GuiEventType.ADD_FLOATING_TEXT, text);
}
Also used : Entity(main.entity.Entity) Ref(main.entity.Ref) Vector2(com.badlogic.gdx.math.Vector2) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj) BaseView(eidolons.libgdx.bf.grid.BaseView) PARAMETER(main.content.values.parameters.PARAMETER) Pair(org.apache.commons.lang3.tuple.Pair) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair)

Example 23 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class DataModel method modifyParamByPercent.

public void modifyParamByPercent(String param, String string) {
    PARAMETER p = ContentManager.getPARAM(param);
    int perc = StringMaster.getInteger(string);
    modifyParamByPercent(p, perc);
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 24 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class DataModel method resetPercentage.

public void resetPercentage(PARAMETER p) {
    p = ContentManager.getBaseParameterFromCurrent(p);
    PARAMETER c_p = ContentManager.getCurrentParam(p);
    PARAMETER c_perc = ContentManager.getPercentageParam(p);
    if (c_perc == null || c_perc == p) {
        return;
    }
    int base_value = getIntParam(p);
    Integer c_value = getIntParam(c_p);
    int percentage = MathMaster.getPercentage(c_value, base_value);
    setParam(c_perc, percentage, true);
    LogMaster.log(LogMaster.VALUE_DEBUG, getName() + "'s " + p.getName() + " percentage reset: " + c_value + " out of " + base_value + " = " + percentage);
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 25 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class DataModel method getValue.

public String getValue(VALUE val, boolean base) {
    String value = "";
    if (val instanceof MultiParameter) {
        MultiParameter multiParameter = (MultiParameter) val;
        for (PARAMETER p : multiParameter.getParameters()) {
            value += getParamRounded(p, base) + multiParameter.getSeparator();
        // % sign?
        }
        value = StringMaster.cropLast(value, multiParameter.getSeparator().length());
    } else if (val instanceof PARAMETER) {
        value = getDoubleParam((PARAMETER) val, base);
    } else if (val instanceof PROPERTY) {
        value = getProperty((PROPERTY) val);
    }
    if (value == null) {
        LogMaster.log(LogMaster.VALUE_DEBUG, "Value not found: " + val.getName());
    }
    return value;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) MultiParameter(main.content.values.parameters.MultiParameter) 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