Search in sources :

Example 26 with Effects

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

Example 27 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class AbilityConstructor method constructAbility.

private static Ability constructAbility(Node node) {
    Effect effects = null;
    Targeting targeting = null;
    for (Node NODE : XML_Converter.getNodeList(node)) {
        if (NODE.getNodeName().equals(EFFECTS) || NODE.getNodeName().contains(EFFECTS)) {
            effects = constructEffects(NODE);
        }
        if (NODE.getNodeName().equals(TARGETING) || NODE.getNodeName().contains(TARGETING)) {
            targeting = constructTargeting(NODE);
        }
    }
    if (effects == null) {
        LogMaster.log(1, "null abil effects!");
        effects = new Effects();
    }
    if (targeting == null) {
        LogMaster.log(1, "null abil targeting!");
        targeting = new FixedTargeting();
    }
    Ability abil = null;
    if (node.getNodeName().equals(ACTIVE_ABILITY)) {
        abil = new ActiveAbility(targeting, effects);
    } else if (node.getNodeName().equals(ONESHOT_ABILITY)) {
        abil = new OneshotAbility(targeting, effects);
    } else if (node.getNodeName().equals(PASSIVE_ABILITY)) {
        abil = new PassiveAbility(targeting, effects);
    }
    abil.setXml(XML_Converter.getStringFromXML(node));
    return abil;
}
Also used : FixedTargeting(main.elements.targeting.FixedTargeting) Targeting(main.elements.targeting.Targeting) FixedTargeting(main.elements.targeting.FixedTargeting) Node(org.w3c.dom.Node) Effect(main.ability.effects.Effect) Effects(main.ability.effects.Effects)

Example 28 with Effects

use of main.ability.effects.Effects 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 29 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class WaitEffect method getAbility.

protected Ability getAbility(Ref ref) {
    Effect effect = new Effects(new RemoveBuffEffect(getBuffName()));
    Ability ability = new ActiveAbility(new FixedTargeting(KEYS.SOURCE), effect);
    ability.setRef(ref);
    return ability;
}
Also used : ActiveAbility(main.ability.ActiveAbility) Ability(main.ability.Ability) ActiveAbility(main.ability.ActiveAbility) RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) FixedTargeting(main.elements.targeting.FixedTargeting) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Effect(main.ability.effects.Effect) MicroEffect(main.ability.effects.MicroEffect) SetCustomModeEffect(eidolons.ability.effects.continuous.SetCustomModeEffect) RemoveBuffEffect(eidolons.ability.effects.oneshot.buff.RemoveBuffEffect) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect) OneshotEffect(main.ability.effects.OneshotEffect) Effects(main.ability.effects.Effects)

Example 30 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class BindingSpellEffect method applyThis.

@Override
public boolean applyThis() {
    // TODO Auto-generated method stub
    Effects effects = null;
    if (!shareOrRedirect) {
        effects = new Effects(new CustomTargetEffect(new FixedTargeting(KEYS.TARGET2), new DuplicateEffect(true)), new CustomTargetEffect(new FixedTargeting(KEYS.TARGET), new InterruptEffect()));
    }
    Effect EFFECT = new DuplicateSpellEffect(KEYS.TARGET.name(), false, true);
    EFFECT.setTargetGroup(ref.getGroup());
    effects = new Effects(EFFECT);
    Event.STANDARD_EVENT_TYPE event_type = Event.STANDARD_EVENT_TYPE.SPELL_RESOLVED;
    conditions.add(ConditionMaster.getPropCondition("EVENT_SPELL", G_PROPS.SPELL_TAGS, SpellEnums.SPELL_TAGS.MIND_AFFECTING.name()));
    return false;
}
Also used : InterruptEffect(main.ability.effects.triggered.InterruptEffect) FixedTargeting(main.elements.targeting.FixedTargeting) CustomTargetEffect(main.ability.effects.continuous.CustomTargetEffect) DuplicateEffect(eidolons.ability.effects.continuous.triggered.DuplicateEffect) DuplicateSpellEffect(eidolons.ability.effects.continuous.triggered.DuplicateSpellEffect) Event(main.game.logic.event.Event) DC_Effect(eidolons.ability.effects.DC_Effect) DuplicateSpellEffect(eidolons.ability.effects.continuous.triggered.DuplicateSpellEffect) DuplicateEffect(eidolons.ability.effects.continuous.triggered.DuplicateEffect) Effect(main.ability.effects.Effect) InterruptEffect(main.ability.effects.triggered.InterruptEffect) CustomTargetEffect(main.ability.effects.continuous.CustomTargetEffect) Effects(main.ability.effects.Effects)

Aggregations

Effects (main.ability.effects.Effects)50 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)23 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)18 Effect (main.ability.effects.Effect)17 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)8 FixedTargeting (main.elements.targeting.FixedTargeting)8 Ref (main.entity.Ref)8 ActiveAbility (main.ability.ActiveAbility)7 Formula (main.system.math.Formula)7 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)6 Targeting (main.elements.targeting.Targeting)6 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)5 AttackEffect (eidolons.ability.effects.oneshot.attack.AttackEffect)5 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)5 DC_Effect (eidolons.ability.effects.DC_Effect)4 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)4 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)4 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)4 RaiseEffect (eidolons.ability.effects.oneshot.unit.RaiseEffect)4 SummonEffect (eidolons.ability.effects.oneshot.unit.SummonEffect)4