Example #1
0
        string[] GetFactionsToIgnore(string faction)
        {
            bool canAttackWizards = false;

            if (faction == A_TEAM)
            {
                canAttackWizards = manager.AllUnitsDestroyed(B_TEAM);
            }
            else if (faction == B_TEAM)
            {
                canAttackWizards = manager.AllUnitsDestroyed(A_TEAM);
            }

            string[] ignoreFactions = new string[] { faction, WIZARDS };
            if (faction == WIZARDS || canAttackWizards)
            {
                //wizards ignore only their own faction
                //and other units stop ignoring wizards if there are no units alive in the other team
                ignoreFactions = new string[] { faction };
            }

            return(ignoreFactions);
        }