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