示例#1
0
 private static bool IsPredatorHostileTo(Pawn predator, Faction toFaction)
 {
     if (toFaction.HasPredatorRecentlyAttackedAnyone(predator))
     {
         return(true);
     }
     if (GenHostility.GetPreyOfMyFaction(predator, toFaction) != null)
     {
         return(true);
     }
     return(false);
 }
示例#2
0
        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));
        }
示例#3
0
        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);
        }