Search in sources :

Example 1 with IfElseEffect

use of main.ability.effects.container.IfElseEffect in project Eidolons by IDemiurge.

the class ClaimRule method initEffects.

@Override
public void initEffects() {
    Conditions conditions = new Conditions();
    conditions.add(new NumericCondition("0", CLAIM_COUNTERS));
    Conditions conditions2 = new Conditions();
    conditions2.add(new OwnershipCondition(KEYS.EVENT_TARGET.name(), true));
    conditions2.add(nOfCounters);
    RemoveBuffEffect removeBuffEffect = new RemoveBuffEffect(buffName);
    Effect effect = new OwnershipChangeEffect(false);
    AddBuffEffect addBuffEffect = new AddBuffEffect(new NumericCondition("{BASIS_CLAIM_COUNTERS}", "0"), buffName, effect);
    effects = new IfElseEffect(removeBuffEffect, conditions, new ConditionalEffect(conditions2, addBuffEffect));
}
Also used : ConditionalEffect(main.ability.effects.container.ConditionalEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) OwnershipCondition(main.elements.conditions.standard.OwnershipCondition) RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) NumericCondition(main.elements.conditions.NumericCondition) ConditionalEffect(main.ability.effects.container.ConditionalEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Effect(main.ability.effects.Effect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) IfElseEffect(main.ability.effects.container.IfElseEffect) Conditions(main.elements.conditions.Conditions) IfElseEffect(main.ability.effects.container.IfElseEffect)

Aggregations

AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)1 Effect (main.ability.effects.Effect)1 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)1 ConditionalEffect (main.ability.effects.container.ConditionalEffect)1 IfElseEffect (main.ability.effects.container.IfElseEffect)1 Conditions (main.elements.conditions.Conditions)1 NumericCondition (main.elements.conditions.NumericCondition)1 OwnershipCondition (main.elements.conditions.standard.OwnershipCondition)1