Beispiel #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);
        }
Beispiel #2
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);
 }