private static float PlanRevisit(Faction faction, float targetGoodwill, Map currentMap, bool sentAway)
        {
            float days;

            if (faction.defeated)
            {
                return(100);
            }
            else if (targetGoodwill > 0)
            {
                days = Mathf.Lerp(Rand.Range(6f, 12f), Rand.Range(3f, 6f), targetGoodwill / 100f);
            }
            else
            {
                days = Mathf.Lerp(Rand.Range(12f, 24f), Rand.Range(25f, 30f), targetGoodwill / -100f);
            }

            if (targetGoodwill < -25)
            {
                days += (-targetGoodwill - 25);
            }
            if (sentAway)
            {
                days += 5;
            }

            Map randomVisitMap = Rand.Value < 0.1f ? Find.Maps.Where(m => m.IsPlayerHome).RandomElement() : currentMap;

            if (Rand.Value < targetGoodwill / 100f && Rand.Value < 0.2f)
            {
                // Send another friendly faction as well (start walking now)
                if (Find.FactionManager.AllFactionsVisible.Where(f => f != faction && !f.defeated && !f.HostileTo(Faction.OfPlayer) && !f.IsPlayer).TryRandomElement(out var newFaction))
                {
                    GenericUtility.TryCreateVisit(randomVisitMap, 0, newFaction);
                }
            }

            //Log.Message(faction.def.LabelCap + " will visit again in " + days + " days (+" + GenericUtility.GetTravelDays(faction, randomVisitMap)*2 + " days for travel).");
            GenericUtility.TryCreateVisit(randomVisitMap, days, faction, 2);
            return(days);
        }