public void LockOnUnits(FormationParty party)
 {
     for (int i = 0; i < OverlaySlots.Count; i++)
     {
         if (i < party.Units.Count)
         {
             OverlaySlots[i].LockOnUnit(party.Units[i]);
         }
         else
         {
             OverlaySlots[i].ClearTarget();
         }
     }
 }
    public List<FormationUnit> GetAvailableTargets(FormationUnit performer, FormationParty friends, FormationParty enemies)
    {
        if (TargetRanks.IsSelfTarget)
            return new List<FormationUnit>(new FormationUnit[] { performer });

        if (TargetRanks.IsSelfFormation)
            return friends.Units.FindAll(unit =>
                (((unit == performer) && TargetRanks.IsTargetableUnit(unit) && IsSelfValid) ||
                ((unit != performer) && TargetRanks.IsTargetableUnit(unit))) && (unit.Character.BattleModifiers == null ||
                unit.Character.BattleModifiers.IsValidFriendlyTarget != false));
        else
            return enemies.Units.FindAll(unit =>
                ((unit != performer) && TargetRanks.IsTargetableUnit(unit)));
    }
 public void RedistributeParty(FormationParty party)
 {
     for (int i = 0; i < Slots.Count; i++)
     {
         if (i < party.Units.Count)
         {
             Slots[i].PutInSlot(party.Units[party.Units.Count - i - 1]);
         }
         else
         {
             Slots[i].ClearSlot();
         }
     }
 }
    public void DistributeParty(FormationParty party)
    {
        for (int i = 0; i < Slots.Count; i++)
        {
            if (i < party.Units.Count)
            {
                Slots[i].PutInSlot(party.Units[party.Units.Count - i - 1]);
            }
            else
            {
                Slots[i].ClearSlot();
            }
        }

        if (!facingRight)
        {
            for (int i = 0; i < party.Units.Count; i++)
            {
                party.Units[i].InstantFlip();
            }
        }
    }
    public bool HasAvailableTargets(FormationUnit performer, FormationParty friends, FormationParty enemies)
    {
        if (TargetRanks.IsSelfTarget)
            return true;

        if (TargetRanks.IsSelfFormation)
            for (int i = 0; i < friends.Units.Count; i++)
            {
                if (performer == friends.Units[i])
                {
                    if (IsSelfValid && TargetRanks.IsTargetableUnit(friends.Units[i]))
                        return true;
                }
                else if (TargetRanks.IsTargetableUnit(friends.Units[i]))
                    return true;
            }
        else 
            for (int i = 0; i < enemies.Units.Count; i++)
                if (TargetRanks.IsTargetableUnit(enemies.Units[i]))
                    return true;

        return false;
    }
示例#6
0
    public bool HasAvailableTargets(FormationUnit performer, FormationParty friends, FormationParty enemies)
    {
        if (TargetRanks.IsSelfTarget)
        {
            return(true);
        }

        if (TargetRanks.IsSelfFormation)
        {
            for (int i = 0; i < friends.Units.Count; i++)
            {
                if (performer == friends.Units[i])
                {
                    if (IsSelfValid && TargetRanks.IsTargetableUnit(friends.Units[i]))
                    {
                        return(true);
                    }
                }
                else if (TargetRanks.IsTargetableUnit(friends.Units[i]))
                {
                    return(true);
                }
            }
        }
        else
        {
            for (int i = 0; i < enemies.Units.Count; i++)
            {
                if (TargetRanks.IsTargetableUnit(enemies.Units[i]))
                {
                    return(true);
                }
            }
        }

        return(false);
    }