Search in sources :

Example 1 with ConditionalEffect

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

the class DurabilityRule method getAttackItemDurabilityReductionEffects.

public static Effects getAttackItemDurabilityReductionEffects(int amount) {
    String source_ref = "{EVENT_SOURCE}";
    String target_ref = "{EVENT_TARGET}";
    return new Effects(new ConditionalEffect(new OrConditions(new ItemCondition(source_ref, ItemEnums.ITEM_SLOT.MAIN_HAND.getProp().getName()), new ItemCondition(source_ref, ItemEnums.ITEM_SLOT.OFF_HAND.getProp().getName())), new DurabilityReductionEffect(true, amount)), new ConditionalEffect(new ItemCondition(target_ref, ItemEnums.ITEM_SLOT.ARMOR.getProp().getName()), new DurabilityReductionEffect(false, amount)));
}
Also used : ConditionalEffect(main.ability.effects.container.ConditionalEffect) DurabilityReductionEffect(eidolons.ability.effects.oneshot.rule.DurabilityReductionEffect) OrConditions(main.elements.conditions.OrConditions) Effects(main.ability.effects.Effects) ItemCondition(eidolons.ability.conditions.req.ItemCondition)

Example 2 with ConditionalEffect

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

the class AuraEffect method applyThis.

/*
     *
     * so what really happens?
     *
     * maybe it's OK if it's not Spirit?
     *
     * There aren't really non-ValueMod effect variants, are there?
     * "Damage Aura"? Property Aura, e.g. demonic! :)
     */
public boolean applyThis() {
    if (!on) {
        return true;
    }
    if (game.isSimulation()) {
        return false;
    }
    if (continuous) {
        AutoTargeting targeting = new AutoTargeting(new DistanceCondition(radius.toString()));
        targeting.getConditions().add(ConditionMaster.getAliveCondition(KEYS.MATCH));
        if (onlyEnemiesOrAllies != null) {
            if (onlyEnemiesOrAllies) {
                targeting.getConditions().add(ConditionMaster.getEnemyCondition());
            } else {
                targeting.getConditions().add(ConditionMaster.getAllyCondition());
            }
        }
        // remove aura-bearer from targets list
        targeting.getConditions().add(new NotCondition(new RefCondition(KEYS.MATCH, KEYS.SOURCE)));
        AddBuffEffect buffEffect = new AddBuffEffect(getBuffType(), effect, true);
        Effects auraEffects = new Effects(new ConditionalEffect(ConditionMaster.getAliveCondition(KEYS.SOURCE), new CustomTargetEffect(targeting, buffEffect)));
        auraEffect = new AddBuffEffect(auraEffects);
        // auraEffect.setTransient(false);
        boolean results = auraEffect.apply(ref);
        if (results) {
            if (!notSelf) {
                Effect copy = effect.getCopy();
                copy.apply(Ref.getSelfTargetingRefCopy(ref.getSourceObj()));
            }
        }
        return results;
    }
    // preCheck?
    if (!initialized) {
        init();
    }
    return trigger.apply(ref);
}
Also used : ConditionalEffect(main.ability.effects.container.ConditionalEffect) AutoTargeting(main.elements.targeting.AutoTargeting) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) CustomTargetEffect(main.ability.effects.continuous.CustomTargetEffect) ZoneEffect(eidolons.ability.effects.containers.customtarget.ZoneEffect) AttachmentEffect(main.ability.effects.AttachmentEffect) ConditionalEffect(main.ability.effects.container.ConditionalEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Effect(main.ability.effects.Effect) MicroEffect(main.ability.effects.MicroEffect) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect) CustomTargetEffect(main.ability.effects.continuous.CustomTargetEffect) Effects(main.ability.effects.Effects)

Example 3 with ConditionalEffect

use of main.ability.effects.container.ConditionalEffect 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)

Example 4 with ConditionalEffect

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

the class FreezeRule method getEffect.

@Override
protected Effect getEffect() {
    Effects effects = new Effects(new ModifyValueEffect(PARAMS.ENDURANCE_REGEN, MOD.MODIFY_BY_PERCENT, getCounterRef() + "*" + ENDURANCE_REGEN_PER_COUNTER), new ModifyValueEffect(PARAMS.INITIATIVE_MODIFIER, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + INITIATIVE_PER_COUNTER));
    // if (checkIsFrozen(unit)) {
    effects.add(new ConditionalEffect(new StatusCheckCondition(UnitEnums.STATUS.FROZEN), new Effects(new ModifyValueEffect(RESISTANCES_REDUCED, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + RESISTANCE_REDUCED_PER_COUNTER), new ModifyValueEffect(RESISTANCES_BOOSTED, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + BONUS_RESISTANCE_PER_COUNTER))));
    return effects;
}
Also used : ConditionalEffect(main.ability.effects.container.ConditionalEffect) StatusCheckCondition(eidolons.ability.conditions.StatusCheckCondition) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Aggregations

ConditionalEffect (main.ability.effects.container.ConditionalEffect)4 Effects (main.ability.effects.Effects)3 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)2 Effect (main.ability.effects.Effect)2 StatusCheckCondition (eidolons.ability.conditions.StatusCheckCondition)1 ItemCondition (eidolons.ability.conditions.req.ItemCondition)1 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)1 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)1 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)1 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)1 DurabilityReductionEffect (eidolons.ability.effects.oneshot.rule.DurabilityReductionEffect)1 AttachmentEffect (main.ability.effects.AttachmentEffect)1 MicroEffect (main.ability.effects.MicroEffect)1 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)1 IfElseEffect (main.ability.effects.container.IfElseEffect)1 CustomTargetEffect (main.ability.effects.continuous.CustomTargetEffect)1 Conditions (main.elements.conditions.Conditions)1 NumericCondition (main.elements.conditions.NumericCondition)1 OrConditions (main.elements.conditions.OrConditions)1 OwnershipCondition (main.elements.conditions.standard.OwnershipCondition)1