Beispiel #1
0
        public static QuestPart_SpawnThing SpawnSkyfaller(this Quest quest, Map map, ThingDef skyfallerDef, IEnumerable <Thing> innerThings, Faction factionForSafeSpot = null, IntVec3?cell = null, string inSignal = null, bool lookForSafeSpot = false, bool tryLandInShipLandingZone = false, Thing tryLandNearThing = null, Pawn mapParentOfPawn = null)
        {
            Skyfaller            thing = SkyfallerMaker.MakeSkyfaller(skyfallerDef, innerThings);
            QuestPart_SpawnThing questPart_SpawnThing = new QuestPart_SpawnThing();

            questPart_SpawnThing.thing                 = thing;
            questPart_SpawnThing.mapParent             = map?.Parent;
            questPart_SpawnThing.mapParentOfPawn       = mapParentOfPawn;
            questPart_SpawnThing.factionForFindingSpot = factionForSafeSpot;
            if (cell.HasValue)
            {
                questPart_SpawnThing.cell = cell.Value;
            }
            questPart_SpawnThing.inSignal                 = inSignal ?? QuestGen.slate.Get <string>("inSignal");
            questPart_SpawnThing.lookForSafeSpot          = lookForSafeSpot;
            questPart_SpawnThing.tryLandInShipLandingZone = tryLandInShipLandingZone;
            questPart_SpawnThing.tryLandNearThing         = tryLandNearThing;
            quest.AddPart(questPart_SpawnThing);
            return(questPart_SpawnThing);
        }
Beispiel #2
0
        protected override void RunInt()
        {
            Slate                slate = QuestGen.slate;
            Map                  map   = QuestGen.slate.Get <Map>("map");
            Skyfaller            thing = SkyfallerMaker.MakeSkyfaller(skyfallerDef.GetValue(slate), innerThings.GetValue(slate));
            QuestPart_SpawnThing questPart_SpawnThing = new QuestPart_SpawnThing();

            questPart_SpawnThing.thing     = thing;
            questPart_SpawnThing.mapParent = map.Parent;
            if (factionOfForSafeSpot.GetValue(slate) != null)
            {
                questPart_SpawnThing.factionForFindingSpot = factionOfForSafeSpot.GetValue(slate).Faction;
            }
            if (cell.GetValue(slate).HasValue)
            {
                questPart_SpawnThing.cell = cell.GetValue(slate).Value;
            }
            questPart_SpawnThing.inSignal                 = (QuestGenUtility.HardcodedSignalWithQuestID(inSignal.GetValue(slate)) ?? QuestGen.slate.Get <string>("inSignal"));
            questPart_SpawnThing.lookForSafeSpot          = lookForSafeSpot.GetValue(slate);
            questPart_SpawnThing.tryLandInShipLandingZone = tryLandInShipLandingZone.GetValue(slate);
            QuestGen.quest.AddPart(questPart_SpawnThing);
        }