use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.
the class RayEffect method initTargeting.
public void initTargeting() {
Conditions conditions = new Conditions();
if (distance != null) {
conditions.add(ConditionMaster.getDistanceFilterCondition(KEYS.SOURCE.toString(), distance));
}
if (PositionMaster.inLine(ref.getTargetObj().getCoordinates(), ref.getSourceObj().getCoordinates())) {
conditions.add(ConditionMaster.getLineCondition(ref.getSourceObj(), ref.getTargetObj(), false));
} else {
conditions.add(ConditionMaster.getDiagonalLineCondition(ref.getSourceObj(), ref.getTargetObj(), false));
}
// conditions.add(ConditionMaster.getUnitTypeCondition());
conditions.add(ConditionMaster.getNotDeadCondition());
if (allyOrEnemyOnly != null) {
if (allyOrEnemyOnly) {
conditions.add(ConditionMaster.getAllyCondition());
} else {
conditions.add(ConditionMaster.getEnemyCondition());
}
}
if (ref.getObj(KEYS.ACTIVE).checkBool(GenericEnums.STD_BOOLS.BLOCKED)) {
conditions.add(DC_ConditionMaster.getClearShotFilterCondition());
}
this.targeting = new AutoTargeting(conditions, DataManager.BF_TYPES);
setFilteringConditions(conditions);
}
use of main.elements.conditions.Conditions 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);
}
use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.
the class HeroObjectModifyingEffect method initFilterConditions.
protected void initFilterConditions() {
if (conditions == null) {
conditions = new Conditions(getDefaultConditions());
conditions.add(getSpecialConditions());
conditions.add(ConditionMaster.toConditions(conditionString));
}
}
use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.
the class ClaimRule method initEffects.
@Override
public void initEffects() {
Conditions conditions = new Conditions();
conditions.add(new NumericCondition("0", CLAIM_COUNTERS));
Conditions conditions2 = new Conditions();
conditions2.add(new OwnershipCondition(KEYS.EVENT_TARGET.name(), true));
conditions2.add(nOfCounters);
RemoveBuffEffect removeBuffEffect = new RemoveBuffEffect(buffName);
Effect effect = new OwnershipChangeEffect(false);
AddBuffEffect addBuffEffect = new AddBuffEffect(new NumericCondition("{BASIS_CLAIM_COUNTERS}", "0"), buffName, effect);
effects = new IfElseEffect(removeBuffEffect, conditions, new ConditionalEffect(conditions2, addBuffEffect));
}
use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.
the class ClaimRule method initConditions.
@Override
public void initConditions() {
conditions = new Conditions();
// conditions.add(nOfCounters);
conditions.add(counterCheck);
}
Aggregations