private void BreakLoverAndFianceRelations(Pawn pawn, out List <Pawn> oldLoversAndFiances)
        {
            oldLoversAndFiances = new List <Pawn> {
            };
            List <PawnRelationDef> relationsToBreak = RelationshipUtility.ListOfBreakupRelationships();

            for (int i = 0; i < relationsToBreak.Count(); i++)
            {
                PawnRelationDef relation = relationsToBreak[i];
                List <Pawn>     pawns    = RelationshipUtility.GetAllPawnsWithGivenRelationshipTo(pawn, relation);
                for (int i2 = 1; i2 < pawns.Count(); i2++)
                {
                    Pawn other = pawns[i2];
                    if (!RelationshipUtility.IsPolygamist(pawn) || !RelationshipUtility.IsPolygamist(other))
                    {
                        if (!relation.GetModExtension <RomanticRelationExtension>().isFormalRelationship&& !BreakupUtility.ShouldImplicitlyEndInformalRelationship(pawn, other, relation))
                        {
                            continue;
                        }
                        BreakupUtility.ResolveBreakup(pawn, other, relation);
                        oldLoversAndFiances.Add(other);
                    }
                }
            }
        }
Пример #2
0
        //break all relations of given relation
        public static void BreakAllGivenRelations(Pawn pawn, PawnRelationDef relation, bool testRelations = false)
        {
            if (!RelationshipUtility.IsRomanticOrSexualRelationship(relation))
            {
                return;
            }
            List <Pawn> allPawns = RelationshipUtility.GetAllPawnsWithGivenRelationshipTo(pawn, relation);

            for (int i = 0; i < allPawns.Count(); i++)
            {
                RelationToEx(pawn, allPawns[i], relation);
            }
        }