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