コード例 #1
0
ファイル: CloneFromSampleEx.cs プロジェクト: Robobeurre/NRaas
 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;
 }
コード例 #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);
            }
コード例 #3
0
 public override string GetInteractionName(Sim actor, ScienceResearchStation target, InteractionObjectPair iop)
 {
     return(base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target)));
 }
コード例 #4
0
ファイル: CloneFromSampleEx.cs プロジェクト: Robobeurre/NRaas
 public override string GetInteractionName(Sim actor, ScienceResearchStation target, InteractionObjectPair iop)
 {
     return base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target));
 }