Search in sources :

Example 1 with NumericCondition

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

the class ScenarioPrecombatMaster method getSelectHeroConditions.

public static Condition getSelectHeroConditions() {
    // generic - level!
    Conditions conditions = new Conditions(ConditionMaster.toConditions(scenario.getProperty(MACRO_PROPS.HERO_SELECTION_FILTER_CONDITIONS)));
    String level = scenario.getParam(PARAMS.LEVEL);
    if (!level.isEmpty()) {
        // extract
        conditions.add(new NumericCondition("{MATCH_LEVEL}", level));
    }
    return conditions;
}
Also used : NumericCondition(main.elements.conditions.NumericCondition) Conditions(main.elements.conditions.Conditions)

Example 2 with NumericCondition

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

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

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

the class CostRequirements method initConditions.

private void initConditions(List<Payment> toPay, Ref ref) {
    reqMap.clear();
    reqMap.putAll(additionalReqList);
    for (Payment payment : toPay) {
        if (payment.getAmountFormula().toString().equals("0")) {
            continue;
        }
        Formula amountFormula = payment.getAmountFormula();
        if (amountFormula.toString().contains(StringMaster.FORMULA_FUNC_OPEN_CHAR)) {
            continue;
        }
        String value = "" + amountFormula.getInt(ref);
        String r = InfoMaster.getParamReasonString(value, payment.getParamToPay());
        Condition c = new NumericCondition(false, StringMaster.getValueRef(KEYS.SOURCE.toString(), payment.getParamToPay().toString()), value);
        reqMap.put(r, c);
    }
}
Also used : NumericCondition(main.elements.conditions.NumericCondition) Condition(main.elements.conditions.Condition) Formula(main.system.math.Formula) NumericCondition(main.elements.conditions.NumericCondition)

Example 5 with NumericCondition

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

Aggregations

NumericCondition (main.elements.conditions.NumericCondition)10 Conditions (main.elements.conditions.Conditions)5 NotCondition (main.elements.conditions.NotCondition)3 Condition (main.elements.conditions.Condition)2 Formula (main.system.math.Formula)2 StdPassiveCondition (eidolons.ability.conditions.shortcut.StdPassiveCondition)1 AttackCondition (eidolons.ability.conditions.special.AttackCondition)1 RollCondition (eidolons.ability.conditions.special.RollCondition)1 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)1 DC_SpellObj (eidolons.entity.active.DC_SpellObj)1 ArrayList (java.util.ArrayList)1 Effect (main.ability.effects.Effect)1 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)1 ConditionalEffect (main.ability.effects.container.ConditionalEffect)1 IfElseEffect (main.ability.effects.container.IfElseEffect)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