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); }
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); }
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); }
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); }