Search in sources :

Example 1 with NotCondition

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

the class AshAnnihilationRule method initConditions.

@Override
public void initConditions() {
    conditions = new Conditions(new NumericCondition("{match_blaze_counters}", "0"));
    conditions.add(new NotCondition(new ClassificationCondition(CLASSIFICATIONS.ELEMENTAL)));
    conditions.add(new NotCondition(new PropCondition(G_PROPS.STANDARD_PASSIVES, STANDARD_PASSIVES.IMMATERIAL.getName())));
}
Also used : NotCondition(main.elements.conditions.NotCondition) ClassificationCondition(main.elements.conditions.standard.ClassificationCondition) NumericCondition(main.elements.conditions.NumericCondition) PropCondition(main.elements.conditions.PropCondition) Conditions(main.elements.conditions.Conditions)

Example 2 with NotCondition

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

the class UnitGroupMaster method createGroupLeader.

public static ObjType createGroupLeader(boolean me, Entity faction, int unitGroupLevel) {
    // type =
    List<ObjType> list = DataManager.getTypesSubGroup(DC_TYPE.CHARS, StringMaster.PRESET);
    String backgrounds = faction.getProperty(PROPS.HERO_BACKGROUNDS);
    FilterMaster.filterOut(list, new NotCondition(new StringComparison(backgrounds, StringMaster.getValueRef(KEYS.MATCH, G_PROPS.BACKGROUND), false)));
    FilterMaster.filterOut(list, new NotCondition(new NumericCondition("2", "abs(" + StringMaster.getValueRef(KEYS.MATCH, PARAMS.LEVEL) + "-" + unitGroupLevel + ")", false)));
    String name = ListChooser.chooseType(DataManager.toStringList(list), DC_TYPE.CHARS);
    if (name == null) {
        return null;
    }
    if (me) {
        myHero = name;
    } else {
        enemyHero = name;
    }
    return DataManager.getType(name, DC_TYPE.CHARS);
}
Also used : NotCondition(main.elements.conditions.NotCondition) StringComparison(main.elements.conditions.StringComparison) ObjType(main.entity.type.ObjType) NumericCondition(main.elements.conditions.NumericCondition)

Example 3 with NotCondition

use of main.elements.conditions.NotCondition 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 4 with NotCondition

use of main.elements.conditions.NotCondition 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 5 with NotCondition

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

the class SpellInitializer method initCosts.

@Override
public void initCosts() {
    Costs costs;
    costs = DC_CostsFactory.getCostsForSpell(getEntity(), // isSpell()
    true);
    costs.getRequirements().add(new Requirement(new NotCondition(new StatusCheckCondition(UnitEnums.STATUS.SILENCED)), InfoMaster.SILENCE));
    costs.setActive(getEntity());
    getEntity().getActivator().setCanActivate(costs.canBePaid(getRef()));
    getEntity().setCosts(costs);
}
Also used : Requirement(main.elements.conditions.Requirement) Costs(main.elements.costs.Costs) NotCondition(main.elements.conditions.NotCondition) StatusCheckCondition(eidolons.ability.conditions.StatusCheckCondition)

Aggregations

NotCondition (main.elements.conditions.NotCondition)5 Conditions (main.elements.conditions.Conditions)3 NumericCondition (main.elements.conditions.NumericCondition)3 StatusCheckCondition (eidolons.ability.conditions.StatusCheckCondition)1 PropCondition (main.elements.conditions.PropCondition)1 Requirement (main.elements.conditions.Requirement)1 StringComparison (main.elements.conditions.StringComparison)1 ClassificationCondition (main.elements.conditions.standard.ClassificationCondition)1 OccupiedCondition (main.elements.conditions.standard.OccupiedCondition)1 Costs (main.elements.costs.Costs)1 AutoTargeting (main.elements.targeting.AutoTargeting)1 Obj (main.entity.obj.Obj)1 ObjType (main.entity.type.ObjType)1