Search in sources :

Example 6 with Ability

use of main.ability.Ability in project Eidolons by IDemiurge.

the class DC_FeatObj method applyRank.

private void applyRank() {
    Integer rank = getRank();
    if (rank == 0) {
        return;
    }
    Integer mod = rank * getRankFormulaMod();
    for (AbilityObj p : getPassives()) {
        // will affect AddParam effects?
        for (Ability a : p.getAbilities()) {
            for (Effect ef : a.getEffects()) {
                try {
                    ef.resetOriginalFormula();
                    ef.appendFormulaByMod(100 + mod);
                } catch (Exception e) {
                    main.system.ExceptionMaster.printStackTrace(e);
                }
            // some exceptions?
            /*
                     * how widely will this be used?
					 * mostly on simple low-level skills...
					 * but also on auras I guess...
					 * the point is to make things flexible, deeply customizable, and viable for 
					 * no-magic heroes...
					 * 
					 * it's true that with the amount of Masteries/Skills I may not need this on lower
					 * levels, but at some point I will! 
					 * 
					 * how will the rank be saved into hero data? 
					 * >> (var)
					 * >> special prop 
					 * >> prop per rank #
					 */
            }
        }
    }
    for (PARAMETER attr : ContentManager.getAttributes()) {
        PARAMS param = (PARAMS) attr;
        Integer value = getIntParam(param, true);
        if (value <= 0) {
            continue;
        }
        value += Math.round(value * mod / 100);
        setParam(param, value);
    }
    // modifyHeroParameters();
    for (PARAMETER param : DC_ContentManager.getFeatModifyingParams()) {
        Integer value = getIntParam(param, true);
        if (value == 0) {
            continue;
        }
        value += Math.round(value * mod / 100);
        setParam(param, value);
    }
    Integer sdMod = rank * getIntParam(PARAMS.RANK_SD_MOD);
    setParam(PARAMS.SKILL_DIFFICULTY, getIntParam(PARAMS.SKILL_DIFFICULTY, true));
    modifyParamByPercent(PARAMS.SKILL_DIFFICULTY, sdMod);
    rankApplied = true;
}
Also used : Ability(main.ability.Ability) AbilityObj(main.ability.AbilityObj) Effect(main.ability.effects.Effect) PARAMS(eidolons.content.PARAMS) PARAMETER(main.content.values.parameters.PARAMETER)

Aggregations

Ability (main.ability.Ability)6 ActiveAbility (main.ability.ActiveAbility)4 Effect (main.ability.effects.Effect)3 Effects (main.ability.effects.Effects)3 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)2 PARAMETER (main.content.values.parameters.PARAMETER)2 AutoTargeting (main.elements.targeting.AutoTargeting)2 Ref (main.entity.Ref)2 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)1 SetCustomModeEffect (eidolons.ability.effects.continuous.SetCustomModeEffect)1 ActivateEffect (eidolons.ability.effects.oneshot.activation.ActivateEffect)1 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)1 PARAMS (eidolons.content.PARAMS)1 DC_UnitAction (eidolons.entity.active.DC_UnitAction)1 Abilities (main.ability.Abilities)1 AbilityImpl (main.ability.AbilityImpl)1 AbilityObj (main.ability.AbilityObj)1 PassiveAbility (main.ability.PassiveAbility)1 MicroEffect (main.ability.effects.MicroEffect)1