private static bool IsSimGoodForRoleCommonTest(IMiniSimDescription desc, RoleData data, IRoleGiver roleGiver, out string reason) { WorldName homeWorld = desc.HomeWorld; /* * bool isCelebrity = desc.IsCelebrity; * if (!data.CanBeCelebrity && isCelebrity) * { * reason = "Celebrity Fail"; * return false; * } */ if ((CASUtils.CASAGSAvailabilityFlagsFromCASAgeGenderFlags(desc.Age | desc.Species) & data.AvailableAgeSpecies) == CASAGSAvailabilityFlags.None) { reason = "Age/Species Fail"; return(false); } SimDescription description = desc as SimDescription; if (((description != null) && (description.CreatedSim == null)) && (description.WillAgeUpOnInstantiation && ((CASUtils.CASAGSAvailabilityFlagsFromCASAgeGenderFlags(AgingState.GetNextOlderAge(desc.Age, desc.Species) | desc.Species) & data.AvailableAgeSpecies) == CASAGSAvailabilityFlags.None))) { reason = "Age/Species Fail"; return(false); } if (data.FillRoleFrom == Role.RoleFillFrom.PeopleWhoDontLiveInThisWorld) { if ((homeWorld != WorldName.TouristWorld) && (GameUtils.GetWorldType(homeWorld) != WorldType.Vacation) && (GameUtils.GetWorldType(homeWorld) != WorldType.Future)) { reason = "Vacation World Fail"; return(false); } if (homeWorld == GameUtils.GetCurrentWorld()) { reason = "Home World Fail"; return(false); } if (GameUtils.GetWorldType(homeWorld) == WorldType.Future) { if (Sims3.Gameplay.Queries.CountObjects <ITimePortal>() == 0) { reason = "Time Portal Fail"; return(false); } } } /* * else if (data.FillRoleFrom == RoleFillFrom.CustomCreatedSim) * { * return false; * } */ IRoleGiverCustomIsSimGoodTest test = roleGiver as IRoleGiverCustomIsSimGoodTest; if ((test != null) && (!test.IsSimGoodForRole(desc))) { reason = "Role Giver Fail"; return(false); } reason = "Success"; return(true); }