private void Leave() { GuestUtility.OnLordLeft(lord); var pawns = lord.ownedPawns.ToArray(); // Copy, because recruiting changes lord bool hostile = lord.faction.RelationWith(Faction.OfPlayer).kind == FactionRelationKind.Hostile; bool sentAway = false; foreach (var pawn in pawns) { var compGuest = pawn.CompGuest(); if (compGuest != null) { if (compGuest.sentAway) { sentAway = true; } if (!hostile) { var score = GetVisitScore(pawn); if (score > 0.99f) { LeaveVerySatisfied(pawn, score); } else if (score > 0.65f) { LeaveSatisfied(pawn, score); } } } pawn.Leave(); } // Rescued pawns don't factor in here. If the group is only rescued pawns, we want no message var nonRescuedPawns = lord.ownedPawns.Where(p => p.CompGuest()?.rescued != true).ToArray(); if (nonRescuedPawns.Any() && !hostile) { var avgScore = nonRescuedPawns.Average(GetVisitScore); DisplayLeaveMessage(avgScore, lord.faction, lord.ownedPawns.Count, lord.Map, sentAway); } else { DisplayNoMessage(lord.faction, lord.Map); } }