Search in sources :

Example 1 with ChangeFacingEffect

use of eidolons.ability.effects.oneshot.mechanic.ChangeFacingEffect in project Eidolons by IDemiurge.

the class Choice method getTurns.

public Boolean[] getTurns() {
    if (actions.size() == 1 || turns != null) {
        return turns;
    }
    try {
        List<Boolean> list = new ArrayList<>();
        for (Action a : actions) {
            DC_ActiveObj active = a.getActive();
            if (active.getName().contains("lockwise")) {
                if (!active.isConstructed()) {
                    active.construct();
                }
                for (Effect e : active.getAbilities().getEffects()) {
                    if (e instanceof ChangeFacingEffect) {
                        list.add(((ChangeFacingEffect) e).isClockwise());
                    }
                }
            }
        }
        turns = list.toArray(new Boolean[list.size()]);
        return turns;
    } catch (Exception e) {
    }
    return null;
}
Also used : Action(eidolons.game.battlecraft.ai.elements.actions.Action) ChangeFacingEffect(eidolons.ability.effects.oneshot.mechanic.ChangeFacingEffect) ArrayList(java.util.ArrayList) ChangeFacingEffect(eidolons.ability.effects.oneshot.mechanic.ChangeFacingEffect) Effect(main.ability.effects.Effect) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj)

Aggregations

ChangeFacingEffect (eidolons.ability.effects.oneshot.mechanic.ChangeFacingEffect)1 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 Action (eidolons.game.battlecraft.ai.elements.actions.Action)1 ArrayList (java.util.ArrayList)1 Effect (main.ability.effects.Effect)1