Search in sources :

Example 11 with ModifyValueEffect

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

the class ModeEffect method addPeriodicEffect.

private void addPeriodicEffect() {
    String periodicValues = mode.getPeriodicValues();
    if (periodicValues == null)
        return;
    for (String substring : StringMaster.openContainer(periodicValues)) {
        String amount = VariableManager.getVar(substring, 0);
        String maxAmount = VariableManager.getVar(substring, 1);
        String periodicValue = VariableManager.removeVarPart(substring);
        String period = mode.getPeriod();
        Formula max = new Formula(maxAmount);
        Formula formula = new Formula(amount);
        Effect effect = new ModifyValueEffect(periodicValue, MOD.MODIFY_BY_CONST, formula, max);
        Effect fx = new PeriodicEffect(period, effect);
        fx.setRef(Ref.getSelfTargetingRefCopy(ref.getSourceObj()));
        addBuffEffect.addEffect(fx);
    }
}
Also used : PeriodicEffect(main.ability.effects.periodic.PeriodicEffect) Formula(main.system.math.Formula) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) DivinationEffect(eidolons.ability.effects.oneshot.spell.DivinationEffect) SetCustomModeEffect(eidolons.ability.effects.continuous.SetCustomModeEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) ModifyPropertyEffect(eidolons.ability.effects.common.ModifyPropertyEffect) PeriodicEffect(main.ability.effects.periodic.PeriodicEffect) RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) ImmobilizeEffect(eidolons.ability.effects.oneshot.status.ImmobilizeEffect)

Example 12 with ModifyValueEffect

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

the class ModeEffect method addEndTurnEffect.

private void addEndTurnEffect() {
    Condition condition = new StringComparison(prop, mode.toString(), true);
    if (mode == STD_MODES.DIVINATION) {
        Effect effect = new DivinationEffect();
        addBuffEffect.addEffect(new DelayedEffect(effect, condition));
        return;
    }
    String formula = mode.getFormula();
    if (ref.getActive() instanceof DC_ActiveObj) {
        DC_ActiveObj activeObj = (DC_ActiveObj) ref.getActive();
        if (activeObj.getParam(PARAMS.FORMULA).contains(StringMaster.MOD)) {
            formula = StringMaster.wrapInParenthesis(formula) + "*" + activeObj.getParam(PARAMS.FORMULA) + "/100";
        } else if (activeObj.getIntParam(PARAMS.FORMULA) != 0) {
            formula += "+" + activeObj.getIntParam(PARAMS.FORMULA);
        }
    }
    ModifyValueEffect effect = new ModifyValueEffect(mode.getParameter(), MOD.MODIFY_BY_CONST, new Formula("min(0, " + formula + ")"));
    PARAMETER param = ContentManager.getPARAM(mode.getParameter());
    effect.setParam(param);
    effect.setMaxParam(ContentManager.getBaseParameterFromCurrent(param));
    Formula appendedByModifier = new Formula(formula).getAppendedByModifier(timeModifier);
    effect.setFormula(appendedByModifier);
    addBuffEffect.addEffect(new DelayedEffect(effect, condition));
// new DelayedEffect(effect, condition).apply(ref);
}
Also used : Condition(main.elements.conditions.Condition) RefCondition(main.elements.conditions.RefCondition) Formula(main.system.math.Formula) StringComparison(main.elements.conditions.StringComparison) DivinationEffect(eidolons.ability.effects.oneshot.spell.DivinationEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) DivinationEffect(eidolons.ability.effects.oneshot.spell.DivinationEffect) SetCustomModeEffect(eidolons.ability.effects.continuous.SetCustomModeEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) ModifyPropertyEffect(eidolons.ability.effects.common.ModifyPropertyEffect) PeriodicEffect(main.ability.effects.periodic.PeriodicEffect) RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) ImmobilizeEffect(eidolons.ability.effects.oneshot.status.ImmobilizeEffect) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) PARAMETER(main.content.values.parameters.PARAMETER)

Example 13 with ModifyValueEffect

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

the class RaiseEffect method getRevenantBuff.

private AddBuffEffect getRevenantBuff() {
    Effects effect = new Effects();
    for (String s : StringMaster.open(getModifiedParam())) {
        String varPart = VariableManager.getVarPart(s);
        String valueName = s.replace(varPart, "");
        String formula = StringMaster.cropParenthesises(varPart) + "*" + // MAX?
        getParamModFormula(valueName);
        effect.add(new ModifyValueEffect(valueName, MOD.MODIFY_BY_CONST, formula));
    }
    BuffType buffType = new BuffType(DataManager.getType(BUFF_NAME));
    buffType.setName(BUFF_NAME + corpse.getName());
    AddBuffEffect e = new AddBuffEffect(buffType, effect);
    return e;
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) BuffType(main.entity.type.BuffType) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Example 14 with ModifyValueEffect

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

the class UnconsciousRule method getWakeUpEffect.

private static Effect getWakeUpEffect(Unit unit) {
    Effects e = new Effects();
    e.add(new ModifyValueEffect(PARAMS.C_N_OF_ACTIONS, MOD.MODIFY_BY_CONST, "-" + AP_PENALTY));
    e.add(new ModifyValueEffect(DC_Engine.isAtbMode() ? PARAMS.C_INITIATIVE : PARAMS.C_INITIATIVE_BONUS, MOD.MODIFY_BY_CONST, "-" + INITIATIVE_PENALTY));
    e.add(new RemoveBuffEffect("Unconscious"));
    e.setRef(Ref.getSelfTargetingRefCopy(unit));
    return e;
}
Also used : RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Example 15 with ModifyValueEffect

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

the class DiseaseRule method getSpecialRoundEffects.

@Override
protected Effect getSpecialRoundEffects() {
    // spread effects could go here! :)
    ModifyValueEffect modifyValueEffect = new ModifyValueEffect(PARAMS.C_STAMINA, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + STAMINA_PER_COUNTER);
    modifyValueEffect.setMin_max_formula(new Formula("0"));
    Effects effects = new Effects(modifyValueEffect);
    return effects;
}
Also used : Formula(main.system.math.Formula) 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