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;
}
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;
}
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);
}
Aggregations