Example #1
0
 public static void Postfix(ResearchProjectDef ___Research, ref bool __result)
 {
     if (__result && !CustomStorytellerUtility.TechLevelAllowed(___Research.techLevel))
     {
         __result = false;
     }
 }
 public static void Postfix(CompUseEffect_FinishRandomResearchProject __instance, Pawn p, ref string failReason, ref bool __result)
 {
     if (Find.ResearchManager.currentProj == null && CustomStorytellerUtility.AllowedResearchProjectDefs().All(r => r.IsFinished) && CustomStorytellerUtility.TryGetRandomUnfinishedResearchProject(out ResearchProjectDef research))
     {
         failReason = null;
         __result   = true;
     }
 }
 public static void Postfix(CompUseEffect_FinishRandomResearchProject __instance, Pawn usedBy)
 {
     if (Find.ResearchManager.currentProj == null && CustomStorytellerUtility.AllowedResearchProjectDefs().All((ResearchProjectDef r) => r.IsFinished) &&
         CustomStorytellerUtility.TryGetRandomUnfinishedResearchProject(out ResearchProjectDef research))
     {
         NonPublicMethods.CompUseEffect_FinishRandomResearchProject_FinishInstantly(__instance, research, usedBy);
     }
 }
 public static void Postfix(CompUseEffect_FinishRandomResearchProject __instance, Pawn usedBy)
 {
     // If there's no active research project and all storyteller-permitted research projects have been finished, finish a random project instead (favouring lower tech levels)
     if (Find.ResearchManager.currentProj == null && CustomStorytellerUtility.AllowedResearchProjectDefs().All(r => r.IsFinished) && CustomStorytellerUtility.TryGetRandomUnfinishedResearchProject(out ResearchProjectDef research))
     {
         NonPublicMethods.CompUseEffect_FinishRandomResearchProject_FinishInstantly(__instance, research, usedBy);
     }
 }
            // Token: 0x06000028 RID: 40 RVA: 0x00002894 File Offset: 0x00000A94
            public static void Postfix(ResearchProjectDef __instance, ref bool __result)
            {
                bool flag = __result && !CustomStorytellerUtility.TechLevelAllowed(__instance.techLevel);

                if (flag)
                {
                    __result = false;
                }
            }
Example #6
0
 // Token: 0x0600000F RID: 15 RVA: 0x000024A8 File Offset: 0x000006A8
 private static IEnumerable <FactionDef> AllowedFactionDefs(IEnumerable <FactionDef> original)
 {
     return(from f in original
            where CustomStorytellerUtility.FactionAllowed(f)
            select f);
 }
Example #7
0
 private static bool CanQueueResearches(bool original, ResearchProjectDef research)
 {
     return(original && CustomStorytellerUtility.TechLevelAllowed(research.techLevel));
 }
 // Token: 0x0600001C RID: 28 RVA: 0x0000269C File Offset: 0x0000089C
 private static List <ResearchProjectDef> AllowedResearchProjects(List <ResearchProjectDef> originalList)
 {
     return((from r in originalList
             where CustomStorytellerUtility.TechLevelAllowed(r.techLevel)
             select r).ToList <ResearchProjectDef>());
 }
Example #9
0
 private static List <ResearchProjectDef> AllowedResearchProjects(List <ResearchProjectDef> originalList)
 {
     return(originalList.Where(r => CustomStorytellerUtility.TechLevelAllowed(r.techLevel)).ToList());
 }
 // Token: 0x06000050 RID: 80 RVA: 0x00003228 File Offset: 0x00001428
 public static IEnumerable <ResearchProjectDef> AllowedResearchProjectDefs()
 {
     return(from r in DefDatabase <ResearchProjectDef> .AllDefsListForReading
            where CustomStorytellerUtility.TechLevelAllowed(r.techLevel)
            select r);
 }
 // Token: 0x0600004E RID: 78 RVA: 0x000031BC File Offset: 0x000013BC
 public static bool FactionAllowed(FactionDef def)
 {
     return(def.isPlayer || def.hidden || CustomStorytellerUtility.TechLevelAllowed(def.techLevel));
 }
 private static IEnumerable <FactionDef> AllowedFactionDefs(IEnumerable <FactionDef> original)
 {
     return(original.Where(f => CustomStorytellerUtility.FactionAllowed(f)));
 }