Ejemplo n.º 1
0
        public static string GetPawnSituationLabel(Pawn pawn, Pawn fromPOV)
        {
            if (pawn.Dead)
            {
                return("Dead".Translate());
            }
            if (pawn.Destroyed)
            {
                return("Missing".Translate());
            }
            if (PawnUtility.IsKidnappedPawn(pawn))
            {
                return("Kidnapped".Translate());
            }
            QuestPart_LendColonistsToFaction questPart_LendColonistsToFaction = QuestUtility.GetAllQuestPartsOfType <QuestPart_LendColonistsToFaction>().FirstOrDefault((QuestPart_LendColonistsToFaction p) => p.LentColonistsListForReading.Contains(pawn));

            if (questPart_LendColonistsToFaction != null)
            {
                return("Lent".Translate(questPart_LendColonistsToFaction.lendColonistsToFaction.Named("FACTION"), questPart_LendColonistsToFaction.returnLentColonistsInTicks.ToStringTicksToDays("0.0")));
            }
            if (pawn.kindDef == PawnKindDefOf.Slave)
            {
                return("Slave".Translate());
            }
            if (PawnUtility.IsFactionLeader(pawn))
            {
                return("FactionLeader".Translate());
            }
            Faction faction = pawn.Faction;

            if (faction != fromPOV.Faction)
            {
                if (faction == null || fromPOV.Faction == null)
                {
                    return("Neutral".Translate());
                }
                switch (faction.RelationKindWith(fromPOV.Faction))
                {
                case FactionRelationKind.Hostile:
                    return("Hostile".Translate() + ", " + faction.Name);

                case FactionRelationKind.Neutral:
                    return("Neutral".Translate() + ", " + faction.Name);

                case FactionRelationKind.Ally:
                    return("Ally".Translate() + ", " + faction.Name);

                default:
                    return("");
                }
            }
            return("");
        }