public string GetInspectStringLine()
        {
            if (!carriedPawns.Any())
            {
                return(null);
            }
            tmpPawnLabels.Clear();
            int num = 0;

            for (int i = 0; i < carriedPawns.Count; i++)
            {
                tmpPawnLabels.Add(carriedPawns[i].LabelShort);
                if (caravan.beds.IsInBed(carriedPawns[i]))
                {
                    num++;
                }
            }
            string str    = (tmpPawnLabels.Count > 5) ? (tmpPawnLabels.Take(5).ToCommaList() + "...") : tmpPawnLabels.ToCommaList(useAnd: true);
            string result = CaravanBedUtility.AppendUsingBedsLabel("BeingCarriedDueToIllness".Translate() + ": " + str.CapitalizeFirst(), num);

            tmpPawnLabels.Clear();
            return(result);
        }
        public string GetInspectStringLine()
        {
            if (!this.carriedPawns.Any <Pawn>())
            {
                return(null);
            }
            Caravan_CarryTracker.tmpPawnLabels.Clear();
            int num = 0;

            for (int i = 0; i < this.carriedPawns.Count; i++)
            {
                Caravan_CarryTracker.tmpPawnLabels.Add(this.carriedPawns[i].LabelShort);
                if (this.caravan.beds.IsInBed(this.carriedPawns[i]))
                {
                    num++;
                }
            }
            string str    = (Caravan_CarryTracker.tmpPawnLabels.Count <= 5) ? Caravan_CarryTracker.tmpPawnLabels.ToCommaList(true) : (Caravan_CarryTracker.tmpPawnLabels.Take(5).ToCommaList(false) + "...");
            string result = CaravanBedUtility.AppendUsingBedsLabel("BeingCarriedDueToIllness".Translate() + ": " + str.CapitalizeFirst(), num);

            Caravan_CarryTracker.tmpPawnLabels.Clear();
            return(result);
        }
Beispiel #3
0
        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(base.GetInspectString());
            if (stringBuilder.Length != 0)
            {
                stringBuilder.AppendLine();
            }
            int num  = 0;
            int num2 = 0;
            int num3 = 0;
            int num4 = 0;
            int num5 = 0;

            for (int i = 0; i < pawns.Count; i++)
            {
                if (pawns[i].IsColonist)
                {
                    num++;
                }
                else if (pawns[i].RaceProps.Animal)
                {
                    num2++;
                }
                else if (pawns[i].IsPrisoner)
                {
                    num3++;
                }
                if (pawns[i].Downed)
                {
                    num4++;
                }
                if (pawns[i].InMentalState)
                {
                    num5++;
                }
            }
            stringBuilder.Append("CaravanColonistsCount".Translate(num, (num != 1) ? Faction.OfPlayer.def.pawnsPlural : Faction.OfPlayer.def.pawnSingular));
            if (num2 == 1)
            {
                stringBuilder.Append(", " + "CaravanAnimal".Translate());
            }
            else if (num2 > 1)
            {
                stringBuilder.Append(", " + "CaravanAnimalsCount".Translate(num2));
            }
            if (num3 == 1)
            {
                stringBuilder.Append(", " + "CaravanPrisoner".Translate());
            }
            else if (num3 > 1)
            {
                stringBuilder.Append(", " + "CaravanPrisonersCount".Translate(num3));
            }
            stringBuilder.AppendLine();
            if (num5 > 0)
            {
                stringBuilder.Append("CaravanPawnsInMentalState".Translate(num5));
            }
            if (num4 > 0)
            {
                if (num5 > 0)
                {
                    stringBuilder.Append(", ");
                }
                stringBuilder.Append("CaravanPawnsDowned".Translate(num4));
            }
            if (num5 > 0 || num4 > 0)
            {
                stringBuilder.AppendLine();
            }
            if (pather.Moving)
            {
                if (pather.ArrivalAction != null)
                {
                    stringBuilder.Append(pather.ArrivalAction.ReportString);
                }
                else
                {
                    stringBuilder.Append("CaravanTraveling".Translate());
                }
            }
            else
            {
                SettlementBase settlementBase = CaravanVisitUtility.SettlementVisitedNow(this);
                if (settlementBase != null)
                {
                    stringBuilder.Append("CaravanVisiting".Translate(settlementBase.Label));
                }
                else
                {
                    stringBuilder.Append("CaravanWaiting".Translate());
                }
            }
            if (pather.Moving)
            {
                float num6 = (float)CaravanArrivalTimeEstimator.EstimatedTicksToArrive(this, allowCaching: true) / 60000f;
                stringBuilder.AppendLine();
                stringBuilder.Append("CaravanEstimatedTimeToDestination".Translate(num6.ToString("0.#")));
            }
            if (AllOwnersDowned)
            {
                stringBuilder.AppendLine();
                stringBuilder.Append("AllCaravanMembersDowned".Translate());
            }
            else if (AllOwnersHaveMentalBreak)
            {
                stringBuilder.AppendLine();
                stringBuilder.Append("AllCaravanMembersMentalBreak".Translate());
            }
            else if (ImmobilizedByMass)
            {
                stringBuilder.AppendLine();
                stringBuilder.Append("CaravanImmobilizedByMass".Translate());
            }
            if (needs.AnyPawnOutOfFood(out string malnutritionHediff))
            {
                stringBuilder.AppendLine();
                stringBuilder.Append("CaravanOutOfFood".Translate());
                if (!malnutritionHediff.NullOrEmpty())
                {
                    stringBuilder.Append(" ");
                    stringBuilder.Append(malnutritionHediff);
                    stringBuilder.Append(".");
                }
            }
            if (!pather.MovingNow)
            {
                int usedBedCount = beds.GetUsedBedCount();
                stringBuilder.AppendLine();
                stringBuilder.Append(CaravanBedUtility.AppendUsingBedsLabel("CaravanResting".Translate(), usedBedCount));
            }
            else
            {
                string inspectStringLine = carryTracker.GetInspectStringLine();
                if (!inspectStringLine.NullOrEmpty())
                {
                    stringBuilder.AppendLine();
                    stringBuilder.Append(inspectStringLine);
                }
                string inBedForMedicalReasonsInspectStringLine = beds.GetInBedForMedicalReasonsInspectStringLine();
                if (!inBedForMedicalReasonsInspectStringLine.NullOrEmpty())
                {
                    stringBuilder.AppendLine();
                    stringBuilder.Append(inBedForMedicalReasonsInspectStringLine);
                }
            }
            return(stringBuilder.ToString());
        }