protected override void RunInt() { Slate slate = QuestGen.slate; QuestPart_Letter questPart_Letter = new QuestPart_Letter(); questPart_Letter.inSignal = (QuestGenUtility.HardcodedSignalWithQuestID(inSignal.GetValue(slate)) ?? slate.Get <string>("inSignal")); LetterDef letterDef = this.letterDef.GetValue(slate) ?? LetterDefOf.NeutralEvent; if (typeof(ChoiceLetter).IsAssignableFrom(letterDef.letterClass)) { ChoiceLetter choiceLetter = LetterMaker.MakeLetter("error", "error", letterDef, QuestGenUtility.ToLookTargets(lookTargets, slate), relatedFaction.GetValue(slate), QuestGen.quest); questPart_Letter.letter = choiceLetter; QuestGen.AddTextRequest("root", delegate(string x) { choiceLetter.label = x; }, QuestGenUtility.MergeRules(labelRules.GetValue(slate), label.GetValue(slate), "root")); QuestGen.AddTextRequest("root", delegate(string x) { choiceLetter.text = x; }, QuestGenUtility.MergeRules(textRules.GetValue(slate), text.GetValue(slate), "root")); } else { questPart_Letter.letter = LetterMaker.MakeLetter(letterDef); questPart_Letter.letter.lookTargets = QuestGenUtility.ToLookTargets(lookTargets, slate); questPart_Letter.letter.relatedFaction = relatedFaction.GetValue(slate); } questPart_Letter.chosenPawnSignal = QuestGenUtility.HardcodedSignalWithQuestID(chosenPawnSignal.GetValue(slate)); questPart_Letter.useColonistsOnMap = useColonistsOnMap.GetValue(slate); questPart_Letter.useColonistsFromCaravanArg = useColonistsFromCaravanArg.GetValue(slate); questPart_Letter.signalListenMode = (signalListenMode.GetValue(slate) ?? QuestPart.SignalListenMode.OngoingOnly); questPart_Letter.filterDeadPawnsFromLookTargets = filterDeadPawnsFromLookTargets.GetValue(slate); QuestGen.quest.AddPart(questPart_Letter); }
protected override void RunInt() { Slate slate = QuestGen.slate; QuestPart_Message message = new QuestPart_Message(); message.inSignal = (QuestGenUtility.HardcodedSignalWithQuestID(inSignal.GetValue(slate)) ?? slate.Get <string>("inSignal")); message.messageType = (messageType.GetValue(slate) ?? MessageTypeDefOf.NeutralEvent); message.lookTargets = QuestGenUtility.ToLookTargets(lookTargets, slate); QuestGen.AddTextRequest("root", delegate(string x) { message.message = x; }, QuestGenUtility.MergeRules(rules.GetValue(slate), text.GetValue(slate), "root")); QuestGen.quest.AddPart(message); }
public static QuestPart_Letter Letter(this Quest quest, LetterDef letterDef, string inSignal = null, string chosenPawnSignal = null, Faction relatedFaction = null, MapParent useColonistsOnMap = null, bool useColonistsFromCaravanArg = false, QuestPart.SignalListenMode signalListenMode = QuestPart.SignalListenMode.OngoingOnly, IEnumerable <object> lookTargets = null, bool filterDeadPawnsFromLookTargets = false, string text = null, RulePack textRules = null, string label = null, RulePack labelRules = null, string getColonistsFromSignal = null) { Slate slate = QuestGen.slate; QuestPart_Letter questPart_Letter = new QuestPart_Letter(); questPart_Letter.inSignal = QuestGenUtility.HardcodedSignalWithQuestID(inSignal) ?? slate.Get <string>("inSignal"); LetterDef letterDef2 = letterDef ?? LetterDefOf.NeutralEvent; if (typeof(ChoiceLetter).IsAssignableFrom(letterDef2.letterClass)) { ChoiceLetter choiceLetter = LetterMaker.MakeLetter("error", "error", letterDef2, QuestGenUtility.ToLookTargets(lookTargets), relatedFaction, QuestGen.quest); questPart_Letter.letter = choiceLetter; QuestGen.AddTextRequest("root", delegate(string x) { choiceLetter.label = x; }, QuestGenUtility.MergeRules(labelRules, label, "root")); QuestGen.AddTextRequest("root", delegate(string x) { choiceLetter.text = x; }, QuestGenUtility.MergeRules(textRules, text, "root")); } else { questPart_Letter.letter = LetterMaker.MakeLetter(letterDef2); questPart_Letter.letter.lookTargets = QuestGenUtility.ToLookTargets(lookTargets); questPart_Letter.letter.relatedFaction = relatedFaction; } questPart_Letter.chosenPawnSignal = QuestGenUtility.HardcodedSignalWithQuestID(chosenPawnSignal); questPart_Letter.useColonistsOnMap = useColonistsOnMap; questPart_Letter.useColonistsFromCaravanArg = useColonistsFromCaravanArg; questPart_Letter.signalListenMode = signalListenMode; questPart_Letter.filterDeadPawnsFromLookTargets = filterDeadPawnsFromLookTargets; questPart_Letter.getColonistsFromSignal = getColonistsFromSignal; QuestGen.quest.AddPart(questPart_Letter); return(questPart_Letter); }