use of main.elements.conditions.standard.GroupCondition in project Eidolons by IDemiurge.
the class AlertRule method getWakeUpConditions.
public static Condition getWakeUpConditions() {
// TODO will be checked with a ref from UNIT_ACTION_COMPLETE event!
Conditions conditions = new OrConditions();
// adjacent enemy condition - the problem is that it will then be
// impossible to be *alert* if there are enemies adjacent already... or
// is it a good design?
// action was targeting *source* - directly or as one of the targets -
// the problem is that it won't work for allies which could be exploited
// largely
// all in all, Alert Mode is probably not for *complicated situations*,
// it's for the simple ones when you just wait for the fight
// patiently...
// new PropCondition(prop, str2)
conditions.add(new Conditions(new NotCondition(new OwnershipCondition(KEYS.SOURCE, KEYS.EVENT_SOURCE)), new OrConditions(new RefCondition(KEYS.EVENT_TARGET, KEYS.SOURCE), new GroupCondition(KEYS.SOURCE.toString(), true))));
conditions.add(new ListSizeCondition(true, new Conditions(ConditionMaster.getAliveAndConsciousFilterCondition(), ConditionMaster.getEnemyCondition(), ConditionMaster.getAdjacentCondition()), "1"));
return conditions;
}
use of main.elements.conditions.standard.GroupCondition in project Eidolons by IDemiurge.
the class BindingDamageEffect method applyThis.
@Override
public boolean applyThis() {
// Can be initialized() just once
GroupImpl group = ref.getGroup();
Effects effects = new Effects();
STANDARD_EVENT_TYPE event_type;
if (shareOrRedirect) {
// TODO splitMode!
event_type = STANDARD_EVENT_TYPE.UNIT_IS_DEALT_TOUGHNESS_DAMAGE;
if (spellDmgOnly != null) {
if (spellDmgOnly) {
event_type = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_DEALT_SPELL_DAMAGE;
}
}
if (physicalDmgOnly != null) {
if (physicalDmgOnly) {
event_type = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_DEALT_PHYSICAL_DAMAGE;
}
}
} else {
effects.add(new AlteringEffect(false, formula.getNegative().toString()));
event_type = Event.STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_DAMAGE;
if (spellDmgOnly != null) {
if (spellDmgOnly) {
event_type = STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_SPELL_DAMAGE;
}
}
if (physicalDmgOnly != null) {
if (physicalDmgOnly) {
event_type = STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_PHYSICAL_DAMAGE;
}
}
}
Targeting targeting_other_units = new AutoTargeting(new Conditions(new GroupCondition(Ref.KEYS.MATCH.name(), group), // negative
new RefCondition(KEYS.EVENT_TARGET, KEYS.MATCH, true)));
effects.add(new CustomTargetEffect(targeting_other_units, new DealDamageEffect(getDamageFormula(), GenericEnums.DAMAGE_TYPE.PURE)));
/*
* ensure there is no deadlock
*/
conditions = new Conditions();
conditions.add(new NonTriggeredEventCondition());
KEYS OBJ_REF = Ref.KEYS.EVENT_TARGET;
conditions.add(new GroupCondition(OBJ_REF, group));
// has the group...
Ref REF = Ref.getCopy(ref);
// REF.setTarget(null); // ???
new AddTriggerEffect(event_type, conditions, OBJ_REF, effects).apply(REF);
return true;
}
Aggregations