示例#1
0
        private bool CellHasHostile(Cell TargetCell)
        {
            if (TargetCell == null)
            {
                return(false);
            }
            bool flag = false;

            foreach (GameObject GO in TargetCell.GetObjectsWithPart("Combat"))
            {
                if ((GO.IsPlayer() || GO.Blueprint != ParentBrain.ParentObject.Blueprint) && (ParentBrain.IsHostileTowards(GO) && ParentBrain.ParentObject.SamePhaseAs(GO)))
                {
                    flag = true;
                }
            }
            return(flag);
        }
示例#2
0
        private bool CellHasHostile(Cell TargetCell)
        {
            if (TargetCell == null)
            {
                return(false);
            }
            bool result = false;

            foreach (GameObject item in TargetCell.LoopObjectsWithPart("Combat"))
            {
                if ((item.IsPlayer() || item.Blueprint != ParentBrain.ParentObject.Blueprint) && ParentBrain.IsHostileTowards(item) && ParentBrain.ParentObject.PhaseAndFlightMatches(item))
                {
                    result = true;
                }
            }
            return(result);
        }
示例#3
0
 private GameObject CellHasFriendly(Cell TargetCell)
 {
     if (TargetCell == null)
     {
         return(null);
     }
     foreach (GameObject GO in TargetCell.GetObjectsWithPart("Combat"))
     {
         if (ParentBrain != null && GO != ParentBrain.Target)
         {
             bool flag = true;
             if ((GO.IsPlayer() || GO.Blueprint != ParentBrain.ParentObject.Blueprint) && !ParentBrain.IsHostileTowards(GO))
             {
                 flag = false;
             }
             if (flag)
             {
                 return(GO);
             }
         }
     }
     return(null);
 }
示例#4
0
        private GameObject CellHasFriendly(Cell TargetCell)
        {
            if (TargetCell == null)
            {
                return(null);
            }
            bool flag = false;

            foreach (GameObject item in TargetCell.LoopObjectsWithPart("Combat"))
            {
                if (ParentBrain != null && item != ParentBrain.Target)
                {
                    flag = true;
                    if ((item.IsPlayer() || item.Blueprint != ParentBrain.ParentObject.Blueprint) && !ParentBrain.IsHostileTowards(item))
                    {
                        flag = false;
                    }
                    if (flag)
                    {
                        return(item);
                    }
                }
            }
            return(null);
        }