Search in sources :

Example 6 with AddTriggerEffect

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

the class BlockEffect method applyThis.

@Override
public boolean applyThis() {
    // effect interrupt
    String OBJ_REF = null;
    switch(BLOCK_TYPE) {
        case ATTACK:
            event_type = Event.STANDARD_EVENT_TYPE.UNIT_IS_BEING_ATTACKED;
            conditions.add(new RefCondition(KEYS.EVENT_TARGET, KEYS.SOURCE, false));
            break;
        case HOSTILE_ACTION:
            event_type = Event.STANDARD_EVENT_TYPE.HOSTILE_ACTION;
            conditions.add(new RefCondition(KEYS.EVENT_TARGET, KEYS.SOURCE, false));
            break;
        case DAMAGE:
            event_type = Event.STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_TOUGHNESS_DAMAGE;
            break;
        case DAMAGE_FROM_SOURCE:
            break;
        case DAMAGE_TYPE:
            break;
        case HOSTILE_SPELLS:
            event_type = Event.STANDARD_EVENT_TYPE.SPELL_BEING_RESOLVED;
            conditions.add(new RefCondition(KEYS.EVENT_TARGET, KEYS.TARGET, false));
            OBJ_REF = Ref.KEYS.SPELL.name();
            break;
        case SPELLS_FROM_SOURCE:
            break;
        default:
            break;
    }
    effects = new Effects(new InterruptEffect(OBJ_REF));
    ActiveAbility abilities = new ActiveAbility(new FixedTargeting(KEYS.SOURCE), effects);
    abilities.setRef(ref);
    new AddTriggerEffect(event_type, conditions, abilities).apply(ref);
    return true;
}
Also used : ActiveAbility(main.ability.ActiveAbility) InterruptEffect(main.ability.effects.triggered.InterruptEffect) FixedTargeting(main.elements.targeting.FixedTargeting) RefCondition(main.elements.conditions.RefCondition) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect)

Example 7 with AddTriggerEffect

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

the class DamageInversionEffect method applyThis.

@Override
public boolean applyThis() {
    // endurance damage; modify endurance only? above base?
    Targeting targeting = new FixedTargeting(KEYS.SOURCE);
    Effects effects = new Effects();
    if (restoreEndurance) {
        ModifyValueEffect effect = new ModifyValueEffect(PARAMS.C_ENDURANCE, code, formula.toString());
        if (!restoreEnduranceAboveBase) {
            effect.setMaxParam(PARAMS.ENDURANCE);
        }
        effects.add(effect);
    }
    if (restoreToughness) {
        ModifyValueEffect effect = new ModifyValueEffect(PARAMS.C_TOUGHNESS, code, formula.toString());
        if (!restoreToughnessAboveBase) {
            effect.setMaxParam(PARAMS.TOUGHNESS);
        }
        effects.add(effect);
    }
    ActiveAbility ability = new ActiveAbility(targeting, effects);
    new AddTriggerEffect(event_type, conditions, ability).apply(ref);
    return true;
}
Also used : ActiveAbility(main.ability.ActiveAbility) FixedTargeting(main.elements.targeting.FixedTargeting) Targeting(main.elements.targeting.Targeting) FixedTargeting(main.elements.targeting.FixedTargeting) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect)

Example 8 with AddTriggerEffect

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

the class TriggerEffect method applyThis.

@Override
public boolean applyThis() {
    if (!initialized) {
        init();
        initialized = true;
    }
    ActiveAbility ability = new ActiveAbility(targeting, effects);
    triggerEffect = new AddTriggerEffect(event_type, conditions, ability);
    return triggerEffect.apply(ref);
}
Also used : ActiveAbility(main.ability.ActiveAbility) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect)

Aggregations

AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)8 ActiveAbility (main.ability.ActiveAbility)6 Effects (main.ability.effects.Effects)4 RefCondition (main.elements.conditions.RefCondition)4 FixedTargeting (main.elements.targeting.FixedTargeting)4 Conditions (main.elements.conditions.Conditions)3 AutoTargeting (main.elements.targeting.AutoTargeting)3 Targeting (main.elements.targeting.Targeting)3 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)2 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)2 Ref (main.entity.Ref)2 GroupImpl (main.entity.group.GroupImpl)2 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)1 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)1 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)1 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)1 AlteringEffect (eidolons.ability.effects.oneshot.misc.AlteringEffect)1 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)1 ArrayList (java.util.ArrayList)1 Ability (main.ability.Ability)1