Search in sources :

Example 11 with AddBuffEffect

use of eidolons.ability.effects.attachment.AddBuffEffect in project Eidolons by IDemiurge.

the class WaitEffect method applyThis.

@Override
public boolean applyThis() {
    if (ref.getTargetObj() == ref.getSourceObj()) {
        ref.getGame().fireEvent(new Event(STANDARD_EVENT_TYPE.UNIT_WAITS, game));
        return true;
    }
    Ref REF = Ref.getCopy(ref);
    REF.setValue(KEYS.TARGET2, ref.getTarget() + "");
    REF.setTarget(ref.getSource());
    boolean result = new AddBuffEffect(getRetainConditions(), getBuffName(), getEffects(REF)).apply(REF);
    if (!result) {
        return false;
    }
    try {
        WaitRule.addWaitingUnit((Unit) ref.getSourceObj(), (Unit) ref.getTargetObj());
    } catch (Exception e) {
        return false;
    }
    return result;
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Ref(main.entity.Ref) Event(main.game.logic.event.Event)

Example 12 with AddBuffEffect

use of eidolons.ability.effects.attachment.AddBuffEffect 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 13 with AddBuffEffect

use of eidolons.ability.effects.attachment.AddBuffEffect in project Eidolons by IDemiurge.

the class BuffMaster method applyBuff.

public static void applyBuff(String buffName, Effect effect, Obj target, Integer duration) {
    AddBuffEffect addBuffEffect = new AddBuffEffect(buffName, effect);
    if (duration != null) {
        addBuffEffect.setDuration(duration);
    }
    addBuffEffect.apply(Ref.getSelfTargetingRefCopy(target));
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect)

Example 14 with AddBuffEffect

use of eidolons.ability.effects.attachment.AddBuffEffect in project Eidolons by IDemiurge.

the class TimeRule method addBuff.

private void addBuff(Unit unitObj, boolean preliminary) {
    if (unitObj.isBfObj()) {
        return;
    }
    AddStatusEffect effect;
    effect = new AddStatusEffect(UnitEnums.STATUS.LATE);
    new AddBuffEffect((preliminary) ? BUFF_NAME_PRELIMINARY : BUFF_NAME, effect, 1).apply(Ref.getSelfTargetingRefCopy(unitObj));
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) AddStatusEffect(main.ability.effects.common.AddStatusEffect)

Example 15 with AddBuffEffect

use of eidolons.ability.effects.attachment.AddBuffEffect 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)22 Effects (main.ability.effects.Effects)12 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)9 Effect (main.ability.effects.Effect)9 Ref (main.entity.Ref)6 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)5 Conditions (main.elements.conditions.Conditions)5 Formula (main.system.math.Formula)5 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)4 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)3 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)3 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)3 DC_Effect (eidolons.ability.effects.DC_Effect)2 WaveEffect (eidolons.ability.effects.containers.customtarget.WaveEffect)2 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)2 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)2 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)2 AttackEffect (eidolons.ability.effects.oneshot.attack.AttackEffect)2 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)2 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)2