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