Search in sources :

Example 26 with Conditions

use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.

the class RayEffect method initTargeting.

public void initTargeting() {
    Conditions conditions = new Conditions();
    if (distance != null) {
        conditions.add(ConditionMaster.getDistanceFilterCondition(KEYS.SOURCE.toString(), distance));
    }
    if (PositionMaster.inLine(ref.getTargetObj().getCoordinates(), ref.getSourceObj().getCoordinates())) {
        conditions.add(ConditionMaster.getLineCondition(ref.getSourceObj(), ref.getTargetObj(), false));
    } else {
        conditions.add(ConditionMaster.getDiagonalLineCondition(ref.getSourceObj(), ref.getTargetObj(), false));
    }
    // conditions.add(ConditionMaster.getUnitTypeCondition());
    conditions.add(ConditionMaster.getNotDeadCondition());
    if (allyOrEnemyOnly != null) {
        if (allyOrEnemyOnly) {
            conditions.add(ConditionMaster.getAllyCondition());
        } else {
            conditions.add(ConditionMaster.getEnemyCondition());
        }
    }
    if (ref.getObj(KEYS.ACTIVE).checkBool(GenericEnums.STD_BOOLS.BLOCKED)) {
        conditions.add(DC_ConditionMaster.getClearShotFilterCondition());
    }
    this.targeting = new AutoTargeting(conditions, DataManager.BF_TYPES);
    setFilteringConditions(conditions);
}
Also used : AutoTargeting(main.elements.targeting.AutoTargeting) Conditions(main.elements.conditions.Conditions)

Example 27 with Conditions

use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.

the class ZoneEffect method initTargeting.

public void initTargeting() {
    Conditions conditions = new Conditions();
    int spell_radius = radius.getInt(ref);
    // if (spell_radius == 0) {
    // spell_radius = ref.getObj(KEYS.ACTIVE.name()).getIntParam(G_PARAMS.RADIUS);
    // }
    NumericCondition condition = ConditionMaster.getDistanceFilterCondition(KEYS.TARGET.name(), spell_radius);
    conditions.add(condition);
    if (// just on same cell
    spell_radius == 0)
        condition.setStrict(false);
    // TODO really???
    conditions.add(ConditionMaster.getNotDeadCondition());
    if (notSelf) {
        conditions.add(new NotCondition(ConditionMaster.getSelfFilterCondition()));
    }
    if (// TODO target filtering - targeting
    allyOrEnemyOnly != null) // modifiers?
    {
        conditions.add(allyOrEnemyOnly ? ConditionMaster.getAllyCondition() : ConditionMaster.getEnemyCondition());
    }
    // legacy?
    // if (allyOrEnemyOnly==null)
    // conditions.add(ConditionMaster.getEnemyCondition());
    // else if (!allyOrEnemyOnly) {
    // conditions.add(allyOrEnemyOnly? ConditionMaster.getAllyCondition() :
    // ConditionMaster.getEnemyCondition());
    // }
    // if (effects.getSpell() != null)
    // if (effects.getSpell().checkBool(STD_BOOLS.APPLY_THRU))
    this.targeting = new AutoTargeting(conditions, C_OBJ_TYPE.BF);
    if (targeting == null) {
        this.targeting = new AutoTargeting(conditions, C_OBJ_TYPE.BF_OBJ);
    }
    setFilteringConditions(conditions);
}
Also used : AutoTargeting(main.elements.targeting.AutoTargeting) NotCondition(main.elements.conditions.NotCondition) NumericCondition(main.elements.conditions.NumericCondition) Conditions(main.elements.conditions.Conditions)

Example 28 with Conditions

use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.

the class HeroObjectModifyingEffect method initFilterConditions.

protected void initFilterConditions() {
    if (conditions == null) {
        conditions = new Conditions(getDefaultConditions());
        conditions.add(getSpecialConditions());
        conditions.add(ConditionMaster.toConditions(conditionString));
    }
}
Also used : Conditions(main.elements.conditions.Conditions)

Example 29 with Conditions

use of main.elements.conditions.Conditions 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 30 with Conditions

use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.

the class ClaimRule method initConditions.

@Override
public void initConditions() {
    conditions = new Conditions();
    // conditions.add(nOfCounters);
    conditions.add(counterCheck);
}
Also used : Conditions(main.elements.conditions.Conditions)

Aggregations

Conditions (main.elements.conditions.Conditions)43 Ref (main.entity.Ref)12 Condition (main.elements.conditions.Condition)7 SelectiveTargeting (main.elements.targeting.SelectiveTargeting)6 Obj (main.entity.obj.Obj)6 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)5 ArrayList (java.util.ArrayList)5 NumericCondition (main.elements.conditions.NumericCondition)5 AutoTargeting (main.elements.targeting.AutoTargeting)5 Unit (eidolons.entity.obj.unit.Unit)4 ObjType (main.entity.type.ObjType)4 Coordinates (main.game.bf.Coordinates)4 FacingCondition (eidolons.ability.conditions.FacingCondition)3 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)3 TemplateSelectiveTargeting (eidolons.ability.targeting.TemplateSelectiveTargeting)3 Effects (main.ability.effects.Effects)3 OrConditions (main.elements.conditions.OrConditions)3 RefCondition (main.elements.conditions.RefCondition)3 Targeting (main.elements.targeting.Targeting)3 GroupImpl (main.entity.group.GroupImpl)3