public override void Notify_GeneratedByQuestGen(SitePart part, Slate slate, List <Rule> outExtraDescriptionRules, Dictionary <string, string> outExtraDescriptionConstants)
        {
            base.Notify_GeneratedByQuestGen(part, slate, outExtraDescriptionRules, outExtraDescriptionConstants);
            Pawn pawn = DownedRefugeeQuestUtility.GenerateRefugee(part.site.Tile);

            part.things = new ThingOwner <Pawn>(part, oneStackOnly: true);
            part.things.TryAdd(pawn);
            if (pawn.relations != null)
            {
                pawn.relations.everSeenByPlayer = true;
            }
            Pawn mostImportantColonyRelative = PawnRelationUtility.GetMostImportantColonyRelative(pawn);

            if (mostImportantColonyRelative != null)
            {
                PawnRelationDef mostImportantRelation = mostImportantColonyRelative.GetMostImportantRelation(pawn);
                TaggedString    text = "";
                if (mostImportantRelation != null && mostImportantRelation.opinionOffset > 0)
                {
                    pawn.relations.relativeInvolvedInRescueQuest = mostImportantColonyRelative;
                    text = "\n\n" + "RelatedPawnInvolvedInQuest".Translate(mostImportantColonyRelative.LabelShort, mostImportantRelation.GetGenderSpecificLabel(pawn), mostImportantColonyRelative.Named("RELATIVE"), pawn.Named("PAWN")).AdjustedFor(pawn);
                }
                else
                {
                    PawnRelationUtility.TryAppendRelationsWithColonistsInfo(ref text, pawn);
                }
                outExtraDescriptionRules.Add(new Rule_String("pawnInvolvedInQuestInfo", text));
            }
            slate.Set("refugee", pawn);
        }
Exemplo n.º 2
0
        static bool Prefix(ref ThingSetMaker_RefugeePod __instance, ThingSetMakerParams parms, List <Thing> outThings)
        {
            Faction faction = DownedRefugeeQuestUtility.GetRandomFactionForRefugee();


            if (faction == FactionColonies.getPlayerColonyFaction())
            {
                List <PawnKindDef> list = new List <PawnKindDef>();
                foreach (ThingDef def in Find.World.GetComponent <FactionFC>().raceFilter.AllowedThingDefs)
                {
                    list.Add(def.race.AnyPawnKind);
                }


                Pawn pawn = PawnGenerator.GeneratePawn(new PawnGenerationRequest(PawnKindDefOf.SpaceRefugee, DownedRefugeeQuestUtility.GetRandomFactionForRefugee(), PawnGenerationContext.NonPlayer, -1, false, false, false, false, true, false, 20f, false, true, true, true, false, false, false, false, 0f, null, 1f, null, null, null, null, null, null, null, null, null, null, null, null));
                outThings.Add(pawn);
                HealthUtility.DamageUntilDowned(pawn, true);



                return(false);
            }
            else
            {
                return(true);
            }
        }