Search in sources :

Example 1 with OrConditions

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

the class DurabilityRule method getAttackItemDurabilityReductionEffects.

public static Effects getAttackItemDurabilityReductionEffects(int amount) {
    String source_ref = "{EVENT_SOURCE}";
    String target_ref = "{EVENT_TARGET}";
    return new Effects(new ConditionalEffect(new OrConditions(new ItemCondition(source_ref, ItemEnums.ITEM_SLOT.MAIN_HAND.getProp().getName()), new ItemCondition(source_ref, ItemEnums.ITEM_SLOT.OFF_HAND.getProp().getName())), new DurabilityReductionEffect(true, amount)), new ConditionalEffect(new ItemCondition(target_ref, ItemEnums.ITEM_SLOT.ARMOR.getProp().getName()), new DurabilityReductionEffect(false, amount)));
}
Also used : ConditionalEffect(main.ability.effects.container.ConditionalEffect) DurabilityReductionEffect(eidolons.ability.effects.oneshot.rule.DurabilityReductionEffect) OrConditions(main.elements.conditions.OrConditions) Effects(main.ability.effects.Effects) ItemCondition(eidolons.ability.conditions.req.ItemCondition)

Example 2 with OrConditions

use of main.elements.conditions.OrConditions 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 3 with OrConditions

use of main.elements.conditions.OrConditions 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)

Example 4 with OrConditions

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

the class ClassView method getAdditionalTypesData.

@Override
protected List<ObjType> getAdditionalTypesData() {
    String group = vendorPanel.getSelectedTabName();
    List<ObjType> list = getAdditionalTypesMap().get(group);
    if (list != null) {
        return list;
    }
    String types = StringMaster.joinStringList(DataManager.getTypeNamesGroup(getTYPE(), group), ";");
    Filter<ObjType> filter = new Filter<>(hero.getRef(), new Conditions(new StringComparison("{Match_}" + G_PROPS.CLASS_GROUP, MULTICLASS, true), new OrConditions(new Conditions(// ,
    new StringComparison(group, "{Match_}" + G_PROPS.BASE_TYPE, false)), new StringComparison("{Match_}" + PROPS.BASE_CLASSES_ONE, types, false), new StringComparison("{Match_}" + PROPS.BASE_CLASSES_TWO, types, false))), DC_TYPE.CLASSES);
    list = new ArrayList<>(filter.getTypes());
    getAdditionalTypesMap().put(vendorPanel.getSelectedTabName(), list);
    return list;
}
Also used : StringComparison(main.elements.conditions.StringComparison) OrConditions(main.elements.conditions.OrConditions) ObjType(main.entity.type.ObjType) Filter(main.elements.Filter) Conditions(main.elements.conditions.Conditions) OrConditions(main.elements.conditions.OrConditions)

Aggregations

OrConditions (main.elements.conditions.OrConditions)4 Conditions (main.elements.conditions.Conditions)3 StringComparison (main.elements.conditions.StringComparison)2 ItemCondition (eidolons.ability.conditions.req.ItemCondition)1 DurabilityReductionEffect (eidolons.ability.effects.oneshot.rule.DurabilityReductionEffect)1 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 Targeter (eidolons.entity.handlers.active.Targeter)1 Effects (main.ability.effects.Effects)1 ConditionalEffect (main.ability.effects.container.ConditionalEffect)1 MATERIAL (main.content.enums.entity.ItemEnums.MATERIAL)1 QUALITY_LEVEL (main.content.enums.entity.ItemEnums.QUALITY_LEVEL)1 Filter (main.elements.Filter)1 DistanceCondition (main.elements.conditions.DistanceCondition)1 SelectiveTargeting (main.elements.targeting.SelectiveTargeting)1 ObjType (main.entity.type.ObjType)1