Search in sources :

Example 6 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.

the class WaterRule method initSubmergedEffects.

private Effects initSubmergedEffects(float factor) {
    Effects effects = new Effects();
    Formula formula = new Formula("x*50");
    effects.add(new ModifyValueEffect(PARAMS.STEALTH, MOD.MODIFY_BY_PERCENT, formula.substituteVarValue("x", factor + "").toString()));
    effects.add(new ModifyValueEffect(PARAMS.NOISE, MOD.MODIFY_BY_PERCENT, formula.substituteVarValue("x", factor + "").toString()));
    formula = new Formula("-x*50");
    effects.add(new ModifyValueEffect(PARAMS.DEFENSE, MOD.MODIFY_BY_PERCENT, formula.substituteVarValue("x", factor + "").toString()));
    effects.add(new ModifyValueEffect(PARAMS.FIRE_RESISTANCE, MOD.MODIFY_BY_CONST, formula.substituteVarValue("x", factor + "").toString()));
    return effects;
}
Also used : Formula(main.system.math.Formula) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Example 7 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.

the class DivinationMaster method applyKnownSpellDivinationEffect.

private static void applyKnownSpellDivinationEffect(DC_SpellObj spell) {
    if (hero.checkPassive(UnitEnums.STANDARD_PASSIVES.DRUIDIC_VISIONS)) {
        Ref ref = Ref.getSelfTargetingRefCopy(hero);
        ref.setID(KEYS.SPELL, spell.getId());
        new ModifyValueEffect(PARAMS.C_ESSENCE, MOD.MODIFY_BY_CONST, DC_Formulas.DRUIDIC_VISIONS_ESSENCE).apply(ref);
        return;
    }
    if (hero.checkPassive(UnitEnums.STANDARD_PASSIVES.HOLY_PRAYER)) {
        Ref ref = Ref.getSelfTargetingRefCopy(hero);
        ref.setID(KEYS.SPELL, spell.getId());
        new ModifyValueEffect(PARAMS.C_MORALE, MOD.MODIFY_BY_CONST, DC_Formulas.HOLY_PRAYER_MORALE).apply(ref);
    // ++ REMOVE COOLDOWN FROM SPELL?
    }
    Ref ref = Ref.getSelfTargetingRefCopy(spell);
    AddBuffEffect buffEffect = new AddBuffEffect(BUFF_FAVORED, new Effects(new ModifyValueEffect(PARAMS.ESS_COST, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.FOC_REQ, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.FOC_COST, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.STA_COST, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.SPELLPOWER_MOD, MOD.MODIFY_BY_PERCENT, "25")));
    buffEffect.apply(ref);
    buffEffect.getBuff().setDuration((// TODO
    hero.getIntParam(PARAMS.CHARISMA) + // GRACE!
    hero.getIntParam(PARAMS.DIVINATION_MASTERY)) / 5);
    buffEffect.getBuff().setProperty(G_PROPS.STD_BOOLS, "" + GenericEnums.STD_BOOLS.STACKING, true);
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Ref(main.entity.Ref) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Example 8 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.

the class EffectFinder method initParamModEffects.

public static void initParamModEffects(Effects modEffects, Map<PARAMETER, String> map, Ref ref) {
    for (PARAMETER param : map.keySet()) {
        String amount = map.get(param);
        MOD code = MOD.MODIFY_BY_CONST;
        if (!amount.contains(StringMaster.BASE_CHAR)) {
            if (amount.contains(StringMaster.MOD)) {
                code = MOD.MODIFY_BY_PERCENT;
                amount = amount.replace(StringMaster.MOD, "");
            }
            if (amount.contains(StringMaster.SET)) {
                code = MOD.SET;
                amount = amount.replace(StringMaster.SET, "");
            }
        }
        if (ref.getId(KEYS.INFO) == null) {
            ref.setID(KEYS.INFO, ref.getId(KEYS.SKILL));
        }
        amount = TextParser.parse(amount, ref, TextParser.INFO_PARSING_CODE);
        modEffects.add(new ModifyValueEffect(param, code, amount));
    }
}
Also used : MOD(main.ability.effects.Effect.MOD) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) PARAMETER(main.content.values.parameters.PARAMETER)

Example 9 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.

the class WatchBuffEffect method generateEffects.

private static Effect generateEffects(Unit watcher, List<DC_Obj> list) {
    // some triggers? for the list...
    // preCheck specials per watcher!
    Effects e = new Effects();
    if (!watcher.getMode().equals(STD_MODES.ALERT)) {
        e.add(new ModifyValueEffect(PARAMS.DEFENSE_MOD, MOD.MODIFY_BY_CONST, WatchRule.getDefenseModVsOthers(watcher, list)));
        e.add(new ModifyValueEffect(PARAMS.ATTACK_MOD, MOD.MODIFY_BY_CONST, WatchRule.getAttackModVsOthers(watcher, list)));
        e.add(new ModifyValueEffect(PARAMS.AP_PENALTY, MOD.MODIFY_BY_CONST, WatchRule.getApPenaltyMod(watcher, list)));
    } else {
    }
    // 
    return e;
}
Also used : ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Example 10 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.

the class CreateObjectEffect method applyParamBuff.

private void applyParamBuff() {
    Effects param_effects = new Effects();
    for (String s : StringMaster.open(param_mods)) {
        String varPart = VariableManager.getVarPart(s);
        String valueName = s.replace(varPart, "");
        String formula = StringMaster.cropParenthesises(varPart) + // MAX?
        " *({Summoner_Spellpower}+{Summoner_Mastery}) ";
        param_effects.add(new ModifyValueEffect(valueName, MOD.MODIFY_BY_CONST, formula));
    }
    BuffMaster.applyBuff(getBuffName(), param_effects, unit, // retain only
    ContentManager.INFINITE_VALUE);
// while
// summoner
// alive?
}
Also used : ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Aggregations

ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)27 Effects (main.ability.effects.Effects)17 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)11 Ref (main.entity.Ref)8 Formula (main.system.math.Formula)7 PARAMETER (main.content.values.parameters.PARAMETER)5 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)4 ActiveAbility (main.ability.ActiveAbility)4 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)3 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)3 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)3 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)3 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)3 RaiseEffect (eidolons.ability.effects.oneshot.unit.RaiseEffect)3 SummonEffect (eidolons.ability.effects.oneshot.unit.SummonEffect)3 Abilities (main.ability.Abilities)3 Effect (main.ability.effects.Effect)3 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)3 InstantDeathEffect (main.ability.effects.oneshot.InstantDeathEffect)3 Targeting (main.elements.targeting.Targeting)3