Search in sources :

Example 6 with OwnershipCondition

use of main.elements.conditions.standard.OwnershipCondition in project Eidolons by IDemiurge.

the class FilterMaster method getPlayerControlledUnits.

public static Set<Obj> getPlayerControlledUnits(Player player) {
    Conditions c = new Conditions();
    Ref ref;
    if (player == Player.NEUTRAL) {
        c.add(new OwnershipCondition("MATCH", true));
        c.add(ConditionMaster.getBFObjTypesCondition());
        ref = new Ref(player.getGame());
    } else {
        c.add(new OwnershipCondition("MATCH", "SOURCE"));
        c.add(ConditionMaster.getBFObjTypesCondition());
        ref = player.getHeroObj().getRef();
    }
    // spells too?
    Filter<Obj> filter = new Filter<>(ref, c);
    Set<Obj> set = filter.getObjects();
    return set;
}
Also used : Ref(main.entity.Ref) OwnershipCondition(main.elements.conditions.standard.OwnershipCondition) Filter(main.elements.Filter) Obj(main.entity.obj.Obj) Conditions(main.elements.conditions.Conditions)

Aggregations

OwnershipCondition (main.elements.conditions.standard.OwnershipCondition)6 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)2 Conditions (main.elements.conditions.Conditions)2 Ref (main.entity.Ref)2 FacingCondition (eidolons.ability.conditions.FacingCondition)1 StatusCheckCondition (eidolons.ability.conditions.StatusCheckCondition)1 VisibilityCondition (eidolons.ability.conditions.VisibilityCondition)1 CellCondition (eidolons.ability.conditions.req.CellCondition)1 StdPassiveCondition (eidolons.ability.conditions.shortcut.StdPassiveCondition)1 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 SpectrumEffect (eidolons.ability.effects.common.SpectrumEffect)1 WatchActionEffect (eidolons.ability.effects.oneshot.rule.WatchActionEffect)1 DC_Obj (eidolons.entity.obj.DC_Obj)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 FACING_SINGLE (main.content.enums.entity.UnitEnums.FACING_SINGLE)1 Filter (main.elements.Filter)1