private static bool IsPredatorHostileTo(Pawn predator, Faction toFaction) { if (toFaction.HasPredatorRecentlyAttackedAnyone(predator)) { return(true); } if (GenHostility.GetPreyOfMyFaction(predator, toFaction) != null) { return(true); } return(false); }
private static bool IsPredatorHostileTo(Pawn predator, Pawn toPawn) { if (toPawn.Faction == null) { return(false); } if (toPawn.Faction.HasPredatorRecentlyAttackedAnyone(predator)) { return(true); } Pawn preyOfMyFaction = GenHostility.GetPreyOfMyFaction(predator, toPawn.Faction); return(preyOfMyFaction != null && predator.Position.InHorDistOf(preyOfMyFaction.Position, 12f)); }
private static bool IsPredatorHostileTo(Pawn predator, Pawn toPawn) { bool result; if (toPawn.Faction == null) { result = false; } else if (toPawn.Faction.HasPredatorRecentlyAttackedAnyone(predator)) { result = true; } else { Pawn preyOfMyFaction = GenHostility.GetPreyOfMyFaction(predator, toPawn.Faction); result = (preyOfMyFaction != null && predator.Position.InHorDistOf(preyOfMyFaction.Position, 12f)); } return(result); }