Search in sources :

Example 1 with PeriodicEffect

use of main.ability.effects.periodic.PeriodicEffect in project Eidolons by IDemiurge.

the class BuffObj method initTimeEffect.

private void initTimeEffect() {
    // for (String sub : StringMaster.openContainer(getProperty(G_PROPS.PASSIVES))) {
    // timeAbility = AbilityConstructor.newAbility(sub, this, true);
    // }
    timeEffects = new ArrayList<>();
    if (effect instanceof Effects) {
        for (Effect sub : new ArrayList<>(((Effects) effect).getEffects())) {
            if (sub instanceof PeriodicEffect) {
                timeEffects.add((PeriodicEffect) sub);
                ((Effects) effect).remove(sub);
            }
        }
    }
}
Also used : PeriodicEffect(main.ability.effects.periodic.PeriodicEffect) ArrayList(java.util.ArrayList) Effect(main.ability.effects.Effect) PeriodicEffect(main.ability.effects.periodic.PeriodicEffect) Effects(main.ability.effects.Effects)

Example 2 with PeriodicEffect

use of main.ability.effects.periodic.PeriodicEffect 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)

Aggregations

PeriodicEffect (main.ability.effects.periodic.PeriodicEffect)2 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)1 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)1 SetCustomModeEffect (eidolons.ability.effects.continuous.SetCustomModeEffect)1 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)1 DivinationEffect (eidolons.ability.effects.oneshot.spell.DivinationEffect)1 ImmobilizeEffect (eidolons.ability.effects.oneshot.status.ImmobilizeEffect)1 ArrayList (java.util.ArrayList)1 Effect (main.ability.effects.Effect)1 Effects (main.ability.effects.Effects)1 Formula (main.system.math.Formula)1