public bool LearnTech(ResearchProjectDef tech)
 {
     if (expertise != null)
     {
         if (!expertise.ContainsKey(tech))
         {
             expertise.Add(tech, 1f);
         }
         else
         {
             expertise[tech] = 1f;
         }
         _knownTechs.AddDistinct(tech);
         _craftableWeapons.AddRange(tech.UnlockedWeapons());
         techLevel = (TechLevel)Mathf.Max((int)tech.techLevel, (int)techLevel);
         LearnCrops(tech);
         Messages.Message("MessageStudyComplete".Translate(pawn, tech.LabelCap), pawn, MessageTypeDefOf.TaskCompletion, true);
         return(true);
     }
     else
     {
         Log.Warning($"[HumanResources] {pawn} tried to learn a technology without being able to.");
         return(false);
     }
 }
        public static void FinishProject_Postfix(ResearchProjectDef proj)
        {
            var weapons = proj.UnlockedWeapons();

            if (weapons.Count > 0)
            {
                ModBaseHumanResources.unlocked.UnlockWeapons(weapons);
                if (Prefs.LogVerbose)
                {
                    Log.Message("[HumanResources] " + proj + " discovered, unlocked weapons: " + weapons.ToStringSafeEnumerable());
                }
            }
        }
        public static void FinishProject_Postfix(ResearchProjectDef proj)
        {
            var weapons = proj.UnlockedWeapons();

            if (weapons.Count > 0)
            {
                ModBaseHumanResources.unlocked.UnlockWeapons(weapons);
                if (Prefs.LogVerbose)
                {
                    Log.Message("[HumanResources] " + proj + " discovered, unlocked weapons: " + weapons.ToStringSafeEnumerable());
                }
            }
            var unlockMgr = ModBaseHumanResources.unlocked;

            if (ResearchTreeHelper.QueueAvailable && !unlockMgr.TechsArchived.ContainsKey(proj))
            {
                unlockMgr.Archive(proj, false);
            }
        }
 public void LearnWeapons(ResearchProjectDef tech)
 {
     proficientWeapons.AddRange(tech.UnlockedWeapons());
 }