protected override void RunInt() { Slate slate = QuestGen.slate; if (contents.GetValue(slate) == null) { return; } QuestPart_DropPods dropPods = new QuestPart_DropPods(); dropPods.inSignal = QuestGenUtility.HardcodedSignalWithQuestID(inSignal.GetValue(slate)) ?? QuestGen.slate.Get <string>("inSignal"); if (!customLetterLabel.GetValue(slate).NullOrEmpty() || customLetterLabelRules.GetValue(slate) != null) { QuestGen.AddTextRequest("root", delegate(string x) { dropPods.customLetterLabel = x; }, QuestGenUtility.MergeRules(customLetterLabelRules.GetValue(slate), customLetterLabel.GetValue(slate), "root")); } if (!customLetterText.GetValue(slate).NullOrEmpty() || customLetterTextRules.GetValue(slate) != null) { QuestGen.AddTextRequest("root", delegate(string x) { dropPods.customLetterText = x; }, QuestGenUtility.MergeRules(customLetterTextRules.GetValue(slate), customLetterText.GetValue(slate), "root")); } dropPods.sendStandardLetter = sendStandardLetter.GetValue(slate) ?? dropPods.sendStandardLetter; dropPods.useTradeDropSpot = useTradeDropSpot.GetValue(slate); dropPods.joinPlayer = joinPlayer.GetValue(slate); dropPods.makePrisoners = makePrisoners.GetValue(slate); dropPods.mapParent = QuestGen.slate.Get <Map>("map").Parent; dropPods.Things = contents.GetValue(slate); if (thingsToExcludeFromHyperlinks.GetValue(slate) != null) { dropPods.thingsToExcludeFromHyperlinks.AddRange(from t in thingsToExcludeFromHyperlinks.GetValue(slate) select t.GetInnerIfMinified().def); } QuestGen.quest.AddPart(dropPods); }
public static QuestPart_DropPods DropPods(this Quest quest, MapParent mapParent, IEnumerable <Thing> contents, string customLetterLabel = null, RulePack customLetterLabelRules = null, string customLetterText = null, RulePack customLetterTextRules = null, bool?sendStandardLetter = true, bool useTradeDropSpot = false, bool joinPlayer = false, bool makePrisoners = false, string inSignal = null, IEnumerable <Thing> thingsToExcludeFromHyperlinks = null, QuestPart.SignalListenMode signalListenMode = QuestPart.SignalListenMode.OngoingOnly, IntVec3?dropSpot = null, bool destroyItemsOnCleanup = true) { QuestPart_DropPods dropPods = new QuestPart_DropPods(); dropPods.inSignal = QuestGenUtility.HardcodedSignalWithQuestID(inSignal) ?? QuestGen.slate.Get <string>("inSignal"); dropPods.signalListenMode = signalListenMode; if (!customLetterLabel.NullOrEmpty() || customLetterLabelRules != null) { QuestGen.AddTextRequest("root", delegate(string x) { dropPods.customLetterLabel = x; }, QuestGenUtility.MergeRules(customLetterLabelRules, customLetterLabel, "root")); } if (!customLetterText.NullOrEmpty() || customLetterTextRules != null) { QuestGen.AddTextRequest("root", delegate(string x) { dropPods.customLetterText = x; }, QuestGenUtility.MergeRules(customLetterTextRules, customLetterText, "root")); } dropPods.sendStandardLetter = sendStandardLetter ?? dropPods.sendStandardLetter; dropPods.useTradeDropSpot = useTradeDropSpot; dropPods.joinPlayer = joinPlayer; dropPods.makePrisoners = makePrisoners; dropPods.mapParent = mapParent; dropPods.Things = contents; dropPods.destroyItemsOnCleanup = destroyItemsOnCleanup; if (dropSpot.HasValue) { dropPods.dropSpot = dropSpot.Value; } if (thingsToExcludeFromHyperlinks != null) { dropPods.thingsToExcludeFromHyperlinks.AddRange(thingsToExcludeFromHyperlinks.Select((Thing t) => t.GetInnerIfMinified().def)); } QuestGen.quest.AddPart(dropPods); return(dropPods); }