Search in sources :

Example 11 with PARAMETER

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

the class AttackCalculator method initializeAttackModifiers.

private void initializeAttackModifiers() {
    Integer integer = weapon.getIntParam(PARAMS.ATTACK_MOD);
    addModifier(atkModMap, MOD_IDENTIFIER.WEAPON, PARAMS.ATTACK, integer);
    // }
    if (AoO) {
        integer = attacker.getIntParam(PARAMS.AOO_ATTACK_MOD);
        addModifier(atkModMap, MOD_IDENTIFIER.AOO, PARAMS.ATTACK, integer);
    }
    if (instant) {
        integer = attacker.getIntParam(PARAMS.INSTANT_ATTACK_MOD);
        addModifier(atkModMap, MOD_IDENTIFIER.INSTANT_ATTACK, PARAMS.ATTACK, integer);
        if (WatchRule.checkWatched(attacker, attacked)) {
            addModifier(atkModMap, MOD_IDENTIFIER.WATCHED, PARAMS.ATTACK, MathMaster.applyModIfNotZero(MathMaster.applyModIfNotZero(WatchRule.INSTANT_ATTACK_MOD, attacker.getIntParam(PARAMS.WATCH_ATTACK_MOD)), attacked.getIntParam(PARAMS.WATCHED_ATTACK_MOD)));
        // addModifier(attacked, map, id, param, integer);
        }
    }
    if (counter) {
        integer = attacker.getIntParam(PARAMS.COUNTER_ATTACK_MOD);
        addModifier(atkModMap, MOD_IDENTIFIER.COUNTER_ATTACK, PARAMS.ATTACK, integer);
    }
    if (attack.getInstantAttackType() != null) {
        PARAMETER param = ContentManager.getPARAM(attack.getInstantAttackType().toString() + "_ATTACK_MOD");
        integer = attacked.getIntParam(param);
        addModifier(atkModMap, MOD_IDENTIFIER.INSTANT_ATTACK, PARAMS.ATTACK, integer);
    }
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 12 with PARAMETER

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

the class ActionAnimation method drawCosts.

protected boolean drawCosts(AnimPhase phase) {
    int base = getDefaultIconMapOffsetY();
    boolean invert = false;
    Boolean edge;
    boolean positive;
    if (getTarget() == source || phase.isDrawOnSource()) {
        edge = game.getBattleField().getGrid().isOnEdgeY(source.getCoordinates());
        // TODO
        positive = BooleanMaster.isTrue(edge) || edge == null;
        base = getOffsetBase(positive);
        if (base < 0) {
            invert = true;
        }
    }
    if (getTarget().getCoordinates().isAdjacent(source.getCoordinates())) {
        if (PositionMaster.inLine(source, target)) {
            if (PositionMaster.isAbove(target, source)) {
                invert = true;
            }
            if (PositionMaster.isAbove(source, target)) {
                invert = false;
            }
        }
    }
    Costs costs = (Costs) phase.getArgs()[0];
    Map<Image, String> map = new XLinkedMap<>();
    for (Cost s : costs.getCosts()) {
        if (s.isPaidAlt()) {
            s = s.getAltCost();
        }
        Formula formula = s.getPayment().getAmountFormula();
        PARAMETER param = s.getPayment().getParamToPay();
        Image image = ImageManager.getValueIcon(param);
        if (image == null) {
            continue;
        }
        String string = "" + (-s.getPayment().getLastPaid());
        map.put(image, string);
        List<String> list = new ArrayList<>();
        list.add(string);
        getSubPhaseTooltipMap().put(image, list);
    }
    drawIconMap(map, false, true, base, invert);
    return true;
}
Also used : Costs(main.elements.costs.Costs) XLinkedMap(main.data.XLinkedMap) Cost(main.elements.costs.Cost) Formula(main.system.math.Formula) PARAMETER(main.content.values.parameters.PARAMETER)

Example 13 with PARAMETER

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

the class DC_RequirementsManager method generateClassRequirements.

public Requirements generateClassRequirements(Entity type, int mode) {
    // multi :
    if (mode == RANK_MODE) {
        return generateClassRankRequirements(type);
    }
    Requirements requirements = new Requirements();
    for (PARAMS mastery : DC_ContentManager.getMasteryParams()) {
        PARAMETER req = ContentManager.getReqParam(mastery);
        int param = type.getIntParam(req);
        if (param <= 0) {
            continue;
        }
        Condition c = ConditionMaster.getParamCondition(0, mastery, req);
        String t = InfoMaster.getParamReasonString(type, mastery, req);
        Requirement r = new Requirement(c, t);
        requirements.add(r);
    }
    String cost = HeroManager.getCost(type, getHero());
    Requirement xpReq = new Requirement(ConditionMaster.getParamCondition(0, PARAMS.XP, PARAMS.XP_COST), InfoMaster.getParamReasonString(type, PARAMS.XP, cost));
    ((NumericCondition) xpReq.getCondition()).setComparingValue(new Formula("" + cost));
    requirements.add(xpReq);
    if (ClassView.isMulticlass(type)) {
        // TODO changing to simpler form with baseType?
        requirements.add(getBaseTypeRequirement(type, type.getOBJ_TYPE_ENUM()));
        requirements.add(new Requirement(new PropCondition(PROPS.CLASSES, type.getProperty(PROPS.BASE_CLASSES_TWO), false), InfoMaster.MULTICLASS_SECOND_CLASS + StringMaster.cropLast(type.getProperty(PROPS.BASE_CLASSES_TWO), 2, ";").replace(";", " or ")));
        requirements.add(new Requirement(new MultiClassCondition(type.getName()), InfoMaster.MULTICLASS));
    } else {
        requirements.add(new Requirement(new ClassTreeCondition(type.getName()), InfoMaster.CLASS_TREE));
        Conditions conditions = new OrConditions();
        conditions.add(new EmptyStringCondition(StringMaster.getValueRef(KEYS.SOURCE, PROPS.FIRST_CLASS)));
        conditions.add(new EmptyStringCondition(StringMaster.getValueRef(KEYS.SOURCE, PROPS.SECOND_CLASS)));
        conditions.add(new StringComparison(type.getProperty(G_PROPS.CLASS_GROUP), StringMaster.getValueRef(KEYS.SOURCE, PROPS.FIRST_CLASS), true));
        conditions.add(new StringComparison(type.getProperty(G_PROPS.CLASS_GROUP), StringMaster.getValueRef(KEYS.SOURCE, PROPS.SECOND_CLASS), true));
        requirements.add(new Requirement(conditions, InfoMaster.MAX_CLASSES));
    }
    return requirements;
}
Also used : ClassTreeCondition(eidolons.ability.conditions.req.ClassTreeCondition) SkillPointCondition(eidolons.ability.conditions.req.SkillPointCondition) ValueGroupCondition(eidolons.ability.conditions.req.ValueGroupCondition) MultiClassCondition(eidolons.ability.conditions.req.MultiClassCondition) Formula(main.system.math.Formula) MultiClassCondition(eidolons.ability.conditions.req.MultiClassCondition) PARAMS(eidolons.content.PARAMS) ClassTreeCondition(eidolons.ability.conditions.req.ClassTreeCondition) PARAMETER(main.content.values.parameters.PARAMETER)

Example 14 with PARAMETER

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

the class DC_MathManager method calculateClaimedObjects.

@Override
public int calculateClaimedObjects(Obj obj, String BF_OBJECT_TYPE) {
    Conditions conditions = ConditionMaster.getClaimedBfObjConditions(BF_OBJECT_TYPE);
    Ref ref = new Ref(game, obj.getId());
    int i = new Filter<>(ref, conditions).getObjects().size();
    PARAMETER param = ContentManager.getPARAM("CLAIMED_" + BF_OBJECT_TYPE + "S");
    obj.setParam(param, i);
    return i;
}
Also used : Ref(main.entity.Ref) Filter(main.elements.Filter) Conditions(main.elements.conditions.Conditions) PARAMETER(main.content.values.parameters.PARAMETER)

Example 15 with PARAMETER

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

the class ClassBottomPanel method refresh.

@Override
public void refresh() {
    super.refresh();
    if (lastSelectedType != selectedType) {
        // selectedType.getProperty(PROPS.REQUIREMENTS)
        displayedMasteries.clear();
        for (String req : hero.getGame().getRequirementsManager().getRequirements(selectedType, 0).getReqMap().keySet()) {
            String[] parts = req.split(InfoMaster.PARAM_REASON_STRING);
            if (parts.length < 2) {
                continue;
            }
            PARAMETER param = ContentManager.getMastery(parts[0]);
            if (param != null) {
                if (param.isMastery()) {
                    displayedMasteries.add(param);
                }
            }
        }
        LogMaster.log(1, "displayedMasteries = " + displayedMasteries);
        // masteryCompsPanel.removeAll();
        for (PARAMETER p : displayedMasteries) {
            HC_PointComp comp = generateMasteryComp(p);
            // // wrap
            Object pos = "";
            // i++;
            masteryCompsPanel.add(comp, pos);
        }
    }
    super.refresh();
}
Also used : HC_PointComp(eidolons.client.cc.gui.neo.points.HC_PointComp) 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