It uses Standard Resolution Order (found in the Rule Book), which processes friendly allies before opposing allies.