Search in sources :

Example 1 with ClassTreeCondition

use of eidolons.ability.conditions.req.ClassTreeCondition 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)

Aggregations

ClassTreeCondition (eidolons.ability.conditions.req.ClassTreeCondition)1 MultiClassCondition (eidolons.ability.conditions.req.MultiClassCondition)1 SkillPointCondition (eidolons.ability.conditions.req.SkillPointCondition)1 ValueGroupCondition (eidolons.ability.conditions.req.ValueGroupCondition)1 PARAMS (eidolons.content.PARAMS)1 PARAMETER (main.content.values.parameters.PARAMETER)1 Formula (main.system.math.Formula)1