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; }
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); }
public override string GetInteractionName(Sim actor, ScienceResearchStation target, InteractionObjectPair iop) { return(base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target))); }
public override string GetInteractionName(Sim actor, ScienceResearchStation target, InteractionObjectPair iop) { return base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target)); }