public static float IncestOpinionOffsetFor(Pawn other, Pawn pawn) { float num = 0f; List <DirectPawnRelation> directRelations = other.relations.DirectRelations; for (int i = 0; i < directRelations.Count; i++) { if (LovePartnerRelationUtility.IsLovePartnerRelation(directRelations[i].def)) { if (directRelations[i].otherPawn != pawn) { if (!directRelations[i].otherPawn.Dead) { foreach (PawnRelationDef pawnRelationDef in other.GetRelations(directRelations[i].otherPawn)) { float incestOpinionOffset = pawnRelationDef.incestOpinionOffset; if (incestOpinionOffset < num) { num = incestOpinionOffset; } } } } } } return(num); }
public static DirectPawnRelation ExistingMostLikedLovePartnerRel(Pawn p, bool allowDead) { if (!p.RaceProps.IsFlesh) { return(null); } DirectPawnRelation directPawnRelation = null; int num = int.MinValue; List <DirectPawnRelation> directRelations = p.relations.DirectRelations; for (int i = 0; i < directRelations.Count; i++) { if (allowDead || !directRelations[i].otherPawn.Dead) { if (LovePartnerRelationUtility.IsLovePartnerRelation(directRelations[i].def)) { int num2 = p.relations.OpinionOf(directRelations[i].otherPawn); if (directPawnRelation == null || num2 > num) { directPawnRelation = directRelations[i]; num = num2; } } } } return(directPawnRelation); }
public static bool HasAnyLovePartnerOfTheOppositeGender(Pawn pawn) { return(pawn.relations.DirectRelations.Find((DirectPawnRelation x) => LovePartnerRelationUtility.IsLovePartnerRelation(x.def) && x.otherPawn.gender != pawn.gender) != null); }
internal bool <> m__0(DirectPawnRelation x) { return(LovePartnerRelationUtility.IsLovePartnerRelation(x.def) && x.otherPawn.gender == this.pawn.gender); }