Exemple #1
0
        public override IEnumerable <InteractionRestricted> GetInteractionRestricted(HumanAI human)
        {
            List <String> orderedMeds = new List <string>();

            foreach (var sub in this.GetOrderedSubSpecializations())
            {
                switch (sub.Name)
                {
                case "Doctor_ProduceMedicine_FluVaccines": orderedMeds.Add("medicine"); break;

                case "Doctor_ProduceMedicine_HealingPotions": orderedMeds.Add("healingPotion"); break;
                }
            }

            if (this.AutoManageSubSpecializations)
            {
                orderedMeds.Sort((x, y) => GetResourceRatio(GameState.GetResourceByString(x)).CompareTo(GetResourceRatio(GameState.GetResourceByString(y))));
            }

            foreach (var med in orderedMeds)
            {
                var intRes = new InteractionRestricted(Interaction.Produce, new InteractionRestrictionProduction(new List <string>()
                {
                    med
                }));
                yield return(intRes);
            }
        }
 private InteractionInfo GetInteractionInfo(InteractionRestricted intRes, Interactable interactable, HumanAI human)
 {
     if (WorkInteractionControllerPatch.CheckInteraction(interactable, intRes, human))
     {
         return new InteractionInfo(intRes.interaction, interactable, intRes.restrictions, true, 50, false, true)
                {
                    data = new InteractionMaxDistanceData(this.MaxDistance)
                }
     }
     ;
     return(null);
 }
Exemple #3
0
 public static bool CheckInteraction(Interactable interactable, InteractionRestricted interactionRestricted, HumanAI human)
 {
     return((bool)AccessTools.Method(instance.GetType(), "CheckInteraction", new Type[] { typeof(Interactable), typeof(InteractionRestricted), typeof(HumanAI) }).Invoke(instance, new object[] { interactable, interactionRestricted, human }));
 }
Exemple #4
0
 public static InteractionInfo CheckInteraction(InteractionRestricted interactionRestricted, HumanAI human)
 {
     return(AccessTools.Method(instance.GetType(), "CheckInteraction", new Type[] { typeof(InteractionRestricted), typeof(HumanAI) }).Invoke(instance, new object[] { interactionRestricted, human }) as InteractionInfo);
 }