Search in sources :

Example 16 with Conditions

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

the class ArcadeManager method generateMaterialQualityForRegion.

public Condition generateMaterialQualityForRegion(ARCADE_REGION region) {
    Conditions c = new Conditions();
    MATERIAL[] materials = new MATERIAL[0];
    QUALITY_LEVEL[] qualities = new QUALITY_LEVEL[0];
    // TODO and what about jewelry?
    switch(region) {
        case DUSK_DALE:
            break;
        case GREYLEAF_WOODS:
            break;
        case WRAITH_MARSHES:
            break;
        case MISTY_SHORES:
            break;
        case BLIGHTSTONE_DESERT:
            qualities = new QUALITY_LEVEL[] { ItemEnums.QUALITY_LEVEL.ANCIENT, ItemEnums.QUALITY_LEVEL.OLD, ItemEnums.QUALITY_LEVEL.MASTERPIECE };
            materials = new MATERIAL[] { ItemEnums.MATERIAL.ADAMANTIUM };
            break;
    }
    OrConditions mC = new OrConditions();
    OrConditions qC = new OrConditions();
    for (MATERIAL m : materials) {
        mC.add(new StringComparison(StringMaster.getValueRef(KEYS.MATCH, G_PROPS.MATERIAL), m.getName(), true));
    }
    for (QUALITY_LEVEL q : qualities) {
        mC.add(new StringComparison(StringMaster.getValueRef(KEYS.MATCH, G_PROPS.QUALITY_LEVEL), q.getName(), true));
    }
    c.add(mC);
    c.add(qC);
    return c;
}
Also used : OrConditions(main.elements.conditions.OrConditions) StringComparison(main.elements.conditions.StringComparison) QUALITY_LEVEL(main.content.enums.entity.ItemEnums.QUALITY_LEVEL) Conditions(main.elements.conditions.Conditions) OrConditions(main.elements.conditions.OrConditions) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 17 with Conditions

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

the class FilterMaster method getUnitsInRadius.

public static List<? extends Entity> getUnitsInRadius(Obj unit, int radius) {
    Conditions conditions = new Conditions(ConditionMaster.getAliveFilterCondition(), ConditionMaster.getDistanceFilterCondition("SOURCE", radius, true));
    Set<Obj> set = new Filter<Obj>(unit.getRef(), conditions, C_OBJ_TYPE.UNITS_CHARS).getObjects();
    return new ArrayList<>(set);
}
Also used : Obj(main.entity.obj.Obj) ArrayList(java.util.ArrayList) Conditions(main.elements.conditions.Conditions)

Example 18 with Conditions

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

the class FilterMaster method getCellsInRadius.

public static Set<Obj> getCellsInRadius(Obj centerObj, Integer radius) {
    Conditions conditions = new Conditions();
    conditions.add(ConditionMaster.getDistanceFilterCondition("SOURCE", radius, true));
    conditions.add(new NotCondition(new OccupiedCondition("MATCH")));
    Set<Obj> set = new Filter<Obj>(centerObj.getRef(), conditions, DC_TYPE.TERRAIN).getObjects();
    return set;
}
Also used : NotCondition(main.elements.conditions.NotCondition) Obj(main.entity.obj.Obj) OccupiedCondition(main.elements.conditions.standard.OccupiedCondition) Conditions(main.elements.conditions.Conditions)

Example 19 with Conditions

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

the class FunctionManager method getSumAdjacentConditions.

public static Condition getSumAdjacentConditions() {
    Conditions c = new Conditions(ConditionMaster.getTYPECondition(DC_TYPE.TERRAIN));
    c.add(ConditionMaster.getAdjacentCondition());
    return c;
}
Also used : Conditions(main.elements.conditions.Conditions)

Example 20 with Conditions

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

the class ActionExecutor method createTargeter.

@Override
protected Targeter createTargeter(DC_ActiveObj active, ActiveMaster entityMaster) {
    return new Targeter(active, entityMaster) {

        @Override
        public Targeting getTargeting() {
            initTargetingMode();
            if (AI_Manager.isRunning()) {
                return super.getTargeting();
            }
            if (getAction().isAttackGeneric()) {
                Conditions conditions = new OrConditions();
                int maxRange = 0;
                for (DC_ActiveObj attack : getAction().getSubActions()) {
                    if (attack.isThrow()) {
                        continue;
                    }
                    if (!attack.canBeActivated()) {
                        continue;
                    }
                    conditions.add(attack.getTargeting().getFilter().getConditions());
                    if (maxRange < attack.getRange()) {
                        maxRange = attack.getRange();
                    }
                }
                conditions.setFastFailOnCheck(true);
                conditions = ConditionMaster.getFilteredConditions(conditions, DistanceCondition.class);
                conditions.add(new DistanceCondition("" + maxRange));
                SelectiveTargeting selectiveTargeting = new SelectiveTargeting(SELECTIVE_TARGETING_TEMPLATES.ATTACK, conditions);
                return selectiveTargeting;
            }
            return super.getTargeting();
        }
    };
}
Also used : SelectiveTargeting(main.elements.targeting.SelectiveTargeting) OrConditions(main.elements.conditions.OrConditions) DistanceCondition(main.elements.conditions.DistanceCondition) Targeter(eidolons.entity.handlers.active.Targeter) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Conditions(main.elements.conditions.Conditions) OrConditions(main.elements.conditions.OrConditions)

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