Beispiel #1
0
 public static void EndExistingBestowingCeremonyQuest(Pawn pawn, Faction faction)
 {
     foreach (Quest item in Find.QuestManager.QuestsListForReading)
     {
         if (!item.Historical && item.State != QuestState.Ongoing)
         {
             QuestPart_BestowingCeremony questPart_BestowingCeremony = (QuestPart_BestowingCeremony)item.PartsListForReading.FirstOrDefault((QuestPart p) => p is QuestPart_BestowingCeremony);
             if (questPart_BestowingCeremony != null && questPart_BestowingCeremony.target == pawn && questPart_BestowingCeremony.bestower.Faction == faction)
             {
                 item.End(QuestEndOutcome.InvalidPreAcceptance, sendLetter: false);
             }
         }
     }
 }
Beispiel #2
0
 public static Quest GetCurrentBestowingCeremonyQuest(Pawn pawn, Faction faction)
 {
     foreach (Quest item in Find.QuestManager.QuestsListForReading)
     {
         if (!item.Historical)
         {
             QuestPart_BestowingCeremony questPart_BestowingCeremony = (QuestPart_BestowingCeremony)item.PartsListForReading.FirstOrDefault((QuestPart p) => p is QuestPart_BestowingCeremony);
             if (questPart_BestowingCeremony != null && questPart_BestowingCeremony.target == pawn && questPart_BestowingCeremony.bestower.Faction == faction)
             {
                 return(item);
             }
         }
     }
     return(null);
 }