Example #1
0
        public static QuestPart_QuestEnd MakeAndAddEndNodeWithLetter(Quest quest, string inSignalActivate, QuestEndOutcome outcome, Letter letter)
        {
            QuestPart_Letter questPart_Letter = new QuestPart_Letter();

            questPart_Letter.letter   = letter;
            questPart_Letter.inSignal = inSignalActivate;
            quest.AddPart(questPart_Letter);
            QuestPart_QuestEnd questPart_QuestEnd = new QuestPart_QuestEnd();

            questPart_QuestEnd.inSignal = inSignalActivate;
            questPart_QuestEnd.outcome  = outcome;
            quest.AddPart(questPart_QuestEnd);
            return(questPart_QuestEnd);
        }
Example #2
0
 protected override void OnSetupHandle(RimWorld.Quest handle)
 {
     handle.AddPart(new QuestPart_CityQuest {
         factions = new[] { alliedFaction },
         targets  = new GlobalTargetInfo[] { target },
     });
 }
Example #3
0
        public static T MakeAndAddEndCondition <T>(Quest quest, string inSignalActivate, QuestEndOutcome outcome, Letter letter = null) where T : QuestPartActivable, new()
        {
            T val = new T();

            val.inSignalEnable = inSignalActivate;
            quest.AddPart(val);
            if (letter != null)
            {
                QuestPart_Letter questPart_Letter = new QuestPart_Letter();
                questPart_Letter.letter   = letter;
                questPart_Letter.inSignal = val.OutSignalCompleted;
                quest.AddPart(questPart_Letter);
            }
            QuestPart_QuestEnd questPart_QuestEnd = new QuestPart_QuestEnd();

            questPart_QuestEnd.inSignal = val.OutSignalCompleted;
            questPart_QuestEnd.outcome  = outcome;
            quest.AddPart(questPart_QuestEnd);
            return(val);
        }
Example #4
0
        public static QuestPart_Delay MakeAndAddQuestTimeoutDelay(Quest quest, int delayTicks, WorldObject worldObject)
        {
            QuestPart_WorldObjectTimeout questPart_WorldObjectTimeout = new QuestPart_WorldObjectTimeout();

            questPart_WorldObjectTimeout.delayTicks                = delayTicks;
            questPart_WorldObjectTimeout.expiryInfoPart            = "QuestExpiresIn".Translate();
            questPart_WorldObjectTimeout.expiryInfoPartTip         = "QuestExpiresOn".Translate();
            questPart_WorldObjectTimeout.isBad                     = true;
            questPart_WorldObjectTimeout.outcomeCompletedSignalArg = QuestEndOutcome.Fail;
            questPart_WorldObjectTimeout.inSignalEnable            = quest.InitiateSignal;
            quest.AddPart(questPart_WorldObjectTimeout);
            string text = "Quest" + quest.id + ".DelayingWorldObject";

            QuestUtility.AddQuestTag(ref worldObject.questTags, text);
            questPart_WorldObjectTimeout.inSignalDisable = text + ".MapGenerated";
            QuestPart_QuestEnd questPart_QuestEnd = new QuestPart_QuestEnd();

            questPart_QuestEnd.inSignal = questPart_WorldObjectTimeout.OutSignalCompleted;
            quest.AddPart(questPart_QuestEnd);
            return(questPart_WorldObjectTimeout);
        }
Example #5
0
 protected override void OnSetupHandle(RimWorld.Quest handle)
 {
     handle.AddPart(new QuestPart_CityQuest {
         targets = new GlobalTargetInfo[] { city },
     });
 }