def can_create_pregnancy_together(sim_info_a: SimInfo, sim_info_b: SimInfo, ignore_gender_options=False) -> bool: """can_create_pregnancy_together(sim_info_a, sim_info_b, ignore_gender_options=False) Determine if two Sims can create a pregnancy together. :param sim_info_a: An instance of a Sim. :type sim_info_a: SimInfo :param sim_info_b: An instance of a Sim. :type sim_info_b: SimInfo :param ignore_gender_options: If set to True, pregnancy gender options will be ignored.\ If set to False, each Sim will be checked for having either Can Impregnate or Can Be Impregnated. Default is False. :type ignore_gender_options: bool, optional :return: True, if the Sim can produce a pregnancy. False, if not. :rtype: bool """ if not S4CMSimPregnancyUtils.can_create_pregnancy(sim_info_a, ignore_gender_options=ignore_gender_options)\ or not S4CMSimPregnancyUtils.can_create_pregnancy(sim_info_b, ignore_gender_options=ignore_gender_options): return False if not CommonSpeciesUtils.are_same_species(sim_info_a, sim_info_b): # If both Sims are dogs, that is an ok combination, even though their species do not match. if not CommonSpeciesUtils.is_dog( sim_info_a) or not CommonSpeciesUtils.is_dog(sim_info_b): return False if not S4CMSettingUtils.is_sim_allowed_to_perform_adult_sim_operations( sim_info_a ) or not S4CMSettingUtils.is_sim_allowed_to_perform_adult_sim_operations( sim_info_b): return False if not S4CMSettingUtils.are_allowed_romantic_relationship( sim_info_a, sim_info_b): return False return True
def are_same_age_and_species(sim_info: SimInfo, other_sim_info: SimInfo) -> bool: """are_same_age_and_species(sim_info, other_sim_info) Determine if two Sims are the same Age and the same Species. :param sim_info: The Sim to check. :type sim_info: SimInfo :param other_sim_info: The other Sim to compare to. :type other_sim_info: SimInfo :return: True, if both Sims are the same Age and Species. False, if they are not. :rtype: bool """ return CommonAgeUtils.are_same_age( sim_info, other_sim_info) and CommonSpeciesUtils.are_same_species( sim_info, other_sim_info)
def are_allowed_romantic_relationship(sim_info_a: SimInfo, sim_info_b: SimInfo) -> bool: """Whether or not two Sims are allowed to have a Romantic relationship together.""" if not S4CMSettingUtils.is_allowed_romantic_relationship( sim_info_a ) or not S4CMSettingUtils.is_allowed_romantic_relationship(sim_info_b): return False if CommonRelationshipUtils.are_blood_relatives(sim_info_a, sim_info_b): return False if not CommonSpeciesUtils.are_same_species(sim_info_a, sim_info_b): return False if CommonAgeUtils.is_teen(sim_info_a) and CommonAgeUtils.is_teen( sim_info_b): return True # Teen to Teen is ok, this check prevents Teen to Adult/Elder/etc. like vanilla has it. if CommonAgeUtils.is_teen(sim_info_a) or CommonAgeUtils.is_teen( sim_info_b): return False # If the Sims are not Adults, they can be assumed to be either a Young Adult, Adult, or Elder return CommonAgeUtils.is_adult_or_elder(sim_info_a)\ and CommonAgeUtils.is_adult_or_elder(sim_info_b)
def are_allowed_family_relationship_bits(sim_info_a: SimInfo, sim_info_b: SimInfo) -> bool: """Whether or not two Sims are allowed to have a family relationship bits.""" return CommonSpeciesUtils.are_same_species(sim_info_a, sim_info_b)
def are_same_age_and_species(sim_info: SimInfo, other_sim_info: SimInfo) -> bool: """ Determine if two Sims are the same Age and the same Species. """ return CommonAgeUtils.are_same_age(sim_info, other_sim_info) and CommonSpeciesUtils.are_same_species(sim_info, other_sim_info)