Search in sources :

Example 1 with PARAMS

use of eidolons.content.PARAMS in project Eidolons by IDemiurge.

the class UnitCalculator method calculateDamage.

@Deprecated
public Integer calculateDamage(boolean offhand, boolean set) {
    int dmg = DamageCalculator.getUnitAttackDamage(getEntity(), offhand);
    Integer mod;
    mod = getIntParam((offhand) ? PARAMS.OFFHAND_DAMAGE_MOD : PARAMS.DAMAGE_MOD);
    if (mod != 0) {
        dmg = dmg * mod / 100;
    }
    PARAMS minDamage = (offhand) ? PARAMS.OFF_HAND_MIN_DAMAGE : PARAMS.MIN_DAMAGE;
    if (set) {
        setParam(minDamage, dmg);
    }
    PARAMS damage = (offhand) ? PARAMS.OFF_HAND_DAMAGE : PARAMS.DAMAGE;
    DC_WeaponObj weapon = getEntity().getWeapon(offhand);
    if (weapon == null) {
        weapon = getEntity().getNaturalWeapon(offhand);
    }
    Integer dieSize = (weapon == null) ? getIntParam(PARAMS.DIE_SIZE) : weapon.getIntParam(PARAMS.DIE_SIZE);
    if (mod != 0) {
        dieSize = dieSize * mod / 100;
    }
    if (set) {
        setParam(damage, MathMaster.getAverage(dmg, dmg + dieSize));
    }
    PARAMS maxDamage = (offhand) ? PARAMS.OFF_HAND_MAX_DAMAGE : PARAMS.MAX_DAMAGE;
    if (set) {
        setParam(maxDamage, dmg + dieSize);
    }
    if (isDiceAccountedElsewhere()) {
        // TODO review this
        Integer min = getIntParam(minDamage);
        setParameter(damage, min);
        setParameter(maxDamage, min);
        return min;
    }
    return MathMaster.getAverage(dmg, dmg + dieSize);
}
Also used : DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) PARAMS(eidolons.content.PARAMS)

Example 2 with PARAMS

use of eidolons.content.PARAMS 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 3 with PARAMS

use of eidolons.content.PARAMS in project Eidolons by IDemiurge.

the class ActionAnimation method drawMissed.

protected boolean drawMissed(AnimPhase phase) {
    int chance = (int) phase.getArgs()[0];
    boolean concealment_evasion = (boolean) phase.getArgs()[1];
    PARAMS param = concealment_evasion ? PARAMS.CONCEALMENT : PARAMS.EVASION;
    Image val_image = ImageManager.getValueIcon(param);
    // drawValueImageText(param, null, null, ALIGNMENT.WEST);
    setAlignmentX(ALIGNMENT.NORTH);
    setDrawOnTargetOrSource(true);
    drawTextOnTarget("Chance: " + chance, 0, 0);
    Image image = action.getIcon().getImage();
    image = ImageManager.applyBorder(image, BORDER.SPELL_UNAVAILABLE);
    drawOnTargetCenter(image);
    return true;
}
Also used : PARAMS(eidolons.content.PARAMS)

Example 4 with PARAMS

use of eidolons.content.PARAMS 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 5 with PARAMS

use of eidolons.content.PARAMS in project Eidolons by IDemiurge.

the class StatsControlComponent method buyPoints.

public void buyPoints(boolean attr, boolean gold) {
    PARAMS cost_param = (gold) ? PARAMS.GOLD : PARAMS.XP;
    PARAMS param = (attr) ? PARAMS.ATTR_POINTS : PARAMS.MASTERY_POINTS;
    PARAMS buyParam = (attr) ? (gold) ? PARAMS.ATTR_BOUGHT_WITH_GOLD : PARAMS.ATTR_BOUGHT_WITH_XP : (gold) ? PARAMS.MASTERY_BOUGHT_WITH_GOLD : PARAMS.MASTERY_BOUGHT_WITH_XP;
    int amount = DC_MathManager.getBuyCost(attr, gold, bufferType);
    bufferType.modifyParameter(cost_param, -amount);
    bufferType.modifyParameter(param, 1);
    bufferType.modifyParameter(buyParam, 1);
    refresh();
}
Also used : PARAMS(eidolons.content.PARAMS)

Aggregations

PARAMS (eidolons.content.PARAMS)29 PARAMETER (main.content.values.parameters.PARAMETER)8 ArrayList (java.util.ArrayList)7 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)5 UNIT_INFO_PARAMS (eidolons.content.UNIT_INFO_PARAMS)4 ValueTooltip (eidolons.libgdx.gui.tooltips.ValueTooltip)4 G_PROPS (main.content.values.properties.G_PROPS)4 Pair (org.apache.commons.lang3.tuple.Pair)4 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)3 DC_UnitAction (eidolons.entity.active.DC_UnitAction)3 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)3 Unit (eidolons.entity.obj.unit.Unit)3 Tooltip (eidolons.libgdx.gui.tooltips.Tooltip)3 TextureCache (eidolons.libgdx.texture.TextureCache)3 Arrays (java.util.Arrays)3 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 VALUE (main.content.VALUE)3 Ref (main.entity.Ref)3 ImageManager (main.system.images.ImageManager)3