use of eidolons.ability.conditions.special.GraveCondition in project Eidolons by IDemiurge.
the class ActivesConstructor method addTargetingMods.
public static void addTargetingMods(Targeting targeting, DC_ActiveObj obj) {
Conditions c = new Conditions();
String property = obj.getProperty(PROPS.TARGETING_MODIFIERS);
if (obj.getActionGroup() == ActionEnums.ACTION_TYPE_GROUPS.MOVE) {
// SPELL_TAGS.TELEPORT
if (!obj.checkProperty(G_PROPS.ACTION_TAGS, ActionEnums.ACTION_TAGS.FLYING.toString())) {
if (!obj.checkProperty(PROPS.TARGETING_MODIFIERS, AbilityEnums.TARGETING_MODIFIERS.CLEAR_SHOT.toString())) {
property += AbilityEnums.TARGETING_MODIFIERS.CLEAR_SHOT.toString();
}
if (!obj.checkProperty(PROPS.TARGETING_MODIFIERS, AbilityEnums.TARGETING_MODIFIERS.SPACE.toString())) {
property += AbilityEnums.TARGETING_MODIFIERS.SPACE.toString();
}
}
}
if (StringMaster.isEmpty(property)) {
return;
}
for (String mod : StringMaster.open(property)) {
Condition targetingModConditions;
TARGETING_MODIFIERS MOD = new EnumMaster<TARGETING_MODIFIERS>().retrieveEnumConst(TARGETING_MODIFIERS.class, mod);
if (MOD == null) {
targetingModConditions = ConditionMaster.toConditions(mod);
} else {
targetingModConditions = DC_ConditionMaster.getTargetingModConditions(MOD);
}
if (targetingModConditions != null) {
if (!c.contains(targetingModConditions)) // if (ConditionMaster.contains(c,
// targetingModConditions.getClass())) //you sure?
{
c.add(targetingModConditions);
}
}
}
if (targeting instanceof TemplateSelectiveTargeting) {
TemplateSelectiveTargeting tst = (TemplateSelectiveTargeting) targeting;
if (tst.getTemplate() == SELECTIVE_TARGETING_TEMPLATES.GRAVE_CELL) {
// TODO
if (tst.getConditions() != null) {
try {
((GraveCondition) tst.getConditions().get(0)).getConditions().add(c);
} catch (Exception e) {
main.system.auxiliary.log.LogMaster.log(1, tst.getConditions().get(0) + " in " + obj);
main.system.ExceptionMaster.printStackTrace(e);
}
}
}
}
if (!c.isEmpty()) {
targeting.getFilter().addCondition(c);
}
targeting.setModsAdded(true);
}
Aggregations