Example #1
0
 public override bool Test(Sim a, ScienceResearchStation target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (target.Repairable.Broken)
     {
         greyedOutTooltipCallback = new GreyedOutTooltipCallback(target.StationIsBroken);
         return false;
     }
     ScienceSkill element = (ScienceSkill)a.SkillManager.GetElement(SkillNames.Science);
     if ((element == null) || (element.SkillLevel < ScientificSample.CloneFromSample.MinScienceSkillLevel))
     {
         greyedOutTooltipCallback = new GreyedOutTooltipCallback(ScienceResearchStation.DisplayLevelTooLowTooltip);
         return false;
     }
     new List<InventoryStack>();
     bool flag = false;
     foreach (InventoryStack stack in a.Inventory.InventoryItems.Values)
     {
         ScientificSample sample = null;
         if (stack != null)
         {
             sample = stack.List[0].Object as ScientificSample;
         }
         if ((sample != null) && ((sample.ScientificSampleType != ScientificSample.SampleType.Dna) /*|| (!GameUtils.IsUniversityWorld() && a.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.None | CASAgeGenderFlags.Human))*/ ))
         {
             flag = true;
             break;
         }
     }
     if (!flag)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(ScienceResearchStation.LocalizeString("SampleNotPresent", new object[0]));
         return false;
     }
     return flag;
 }
Example #2
0
            public override bool Test(Sim a, ScienceResearchStation target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target.Repairable.Broken)
                {
                    greyedOutTooltipCallback = new GreyedOutTooltipCallback(target.StationIsBroken);
                    return(false);
                }
                ScienceSkill element = (ScienceSkill)a.SkillManager.GetElement(SkillNames.Science);

                if ((element == null) || (element.SkillLevel < ScientificSample.CloneFromSample.MinScienceSkillLevel))
                {
                    greyedOutTooltipCallback = new GreyedOutTooltipCallback(ScienceResearchStation.DisplayLevelTooLowTooltip);
                    return(false);
                }
                new List <InventoryStack>();
                bool flag = false;

                foreach (InventoryStack stack in a.Inventory.InventoryItems.Values)
                {
                    ScientificSample sample = null;
                    if (stack != null)
                    {
                        sample = stack.List[0].Object as ScientificSample;
                    }
                    if ((sample != null) && ((sample.ScientificSampleType != ScientificSample.SampleType.Dna) /*|| (!GameUtils.IsUniversityWorld() && a.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.None | CASAgeGenderFlags.Human))*/))
                    {
                        flag = true;
                        break;
                    }
                }
                if (!flag)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(ScienceResearchStation.LocalizeString("SampleNotPresent", new object[0]));
                    return(false);
                }
                return(flag);
            }
Example #3
0
 public override string GetInteractionName(Sim actor, ScienceResearchStation target, InteractionObjectPair iop)
 {
     return(base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target)));
 }
Example #4
0
 public override string GetInteractionName(Sim actor, ScienceResearchStation target, InteractionObjectPair iop)
 {
     return base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target));
 }