def _test_join_to_sex_single_interaction(interaction_sim, interaction_target, sex_category_types): ''' :param interaction_sim: Sim that wants to join to an existing sex interaction :param interaction_target: Sim that owns an existing interaction ''' if interaction_target is None or not TurboTypesUtil.Sims.is_sim(interaction_target): return False if sim_ev(interaction_target).active_sex_handler is None: return False if not is_sim_ready_for_sex(interaction_sim): return False active_sex_handler = sim_ev(interaction_target).active_sex_handler if sim_ev(interaction_target).active_pre_sex_handler is not None and sim_ev(interaction_target).active_pre_sex_handler.get_identifier() != active_sex_handler.get_identifier(): return False genders_list = list() for actor_sim_info in active_sex_handler.get_actors_sim_info_gen(): genders_list.append(get_sim_sex_gender(actor_sim_info)) genders_list.append(get_sim_sex_gender(interaction_sim)) has_animations = False for sex_category_type in sex_category_types: while has_animations_with_params(sex_category_type, active_sex_handler.get_object_identifier(), genders_list): has_animations = True break if has_animations is False: return False test_incest_of_sims = () if get_relationship_setting(RelationshipSetting.INCEST_STATE, variable_type=bool) else tuple(active_sex_handler.get_actors_sim_info_gen()) (min_age_limit, max_age_limit) = get_age_limits_for_sex(tuple(active_sex_handler.get_actors_sim_info_gen())) skip_sims_ids = [TurboManagerUtil.Sim.get_sim_id(actor_sim_info) for actor_sim_info in active_sex_handler.get_actors_sim_info_gen()] target_sim_id = TurboManagerUtil.Sim.get_sim_id(interaction_sim) for sim_id in get_sims_for_sex(relative_sims=test_incest_of_sims, min_sims_age=min_age_limit, max_sims_age=max_age_limit, skip_sims_ids=skip_sims_ids): while sim_id == target_sim_id: return True return False
def get_age_limits_for_sex(sims_list): youngest_sim_age = None oldest_sim_age = None for actor_sim_info in sims_list: if actor_sim_info is None: continue if youngest_sim_age is None or TurboSimUtil.Age.is_younger_than(actor_sim_info, youngest_sim_age): youngest_sim_age = TurboSimUtil.Age.get_age(actor_sim_info) if oldest_sim_age is None or TurboSimUtil.Age.is_older_than(actor_sim_info, oldest_sim_age): oldest_sim_age = TurboSimUtil.Age.get_age(actor_sim_info) is_allowing_teens = get_sex_setting(SexSetting.TEENS_SEX_STATE, variable_type=bool) is_child_only = youngest_sim_age == oldest_sim_age == TurboSimUtil.Age.CHILD is_teen_only = youngest_sim_age == oldest_sim_age == TurboSimUtil.Age.TEEN has_teen = youngest_sim_age == TurboSimUtil.Age.TEEN or oldest_sim_age == TurboSimUtil.Age.TEEN has_child = youngest_sim_age == TurboSimUtil.Age.CHILD or oldest_sim_age == TurboSimUtil.Age.CHILD if not get_relationship_setting(RelationshipSetting.ROMANCE_AGE_RESTRICTION_STATE, variable_type=bool): if is_child_only and is_allowing_teens: return (TurboSimUtil.Age.CHILD, TurboSimUtil.Age.CHILD) if is_teen_only and is_allowing_teens: return (TurboSimUtil.Age.TEEN, TurboSimUtil.Age.TEEN) if has_child and is_allowing_teens: return (TurboSimUtil.Age.CHILD, TurboSimUtil.Age.ELDER) if has_teen and is_allowing_teens: return (TurboSimUtil.Age.TEEN, TurboSimUtil.Age.ELDER) return (TurboSimUtil.Age.YOUNGADULT, TurboSimUtil.Age.ELDER) else: if not CNSimUtils.teen_sex_is_enabled(): return (TurboSimUtil.Age.YOUNGADULT, TurboSimUtil.Age.ELDER) return (TurboSimUtil.Age.CHILD, TurboSimUtil.Age.ELDER)
def is_true_family_relationship(sim_identifier, target_identifier): if get_relationship_setting(RelationshipSetting.INCEST_STATE, variable_type=bool): return False if has_sim_trait(sim_identifier, SimTrait.WW_INCEST) and has_sim_trait( target_identifier, SimTrait.WW_INCEST): return False if not TurboSimUtil.Relationship.is_family(sim_identifier, target_identifier): return False return True
def _wickedwhims_on_incest_prevention_test(original, self, *args, **kwargs): try: target_sim_info = args[0] if get_relationship_setting( RelationshipSetting.INCEST_STATE, variable_type=bool) or has_sim_trait( self, SimTrait.WW_INCEST) and has_sim_trait( target_sim_info, SimTrait.WW_INCEST): return True except Exception as ex: log_custom_exception( "Failed to edit incest test at 'SimInfo.incest_prevention_test'.", ex) return original(self, *args, **kwargs)
def _test_join_to_sex_multiple_interaction(interaction_sim, interaction_target, sex_category_types): if interaction_target is None or not TurboTypesUtil.Sims.is_sim(interaction_target): return False if sim_ev(interaction_sim).active_sex_handler is None: return False active_sex_handler = sim_ev(interaction_sim).active_sex_handler if sim_ev(interaction_target).active_pre_sex_handler is not None and sim_ev(interaction_target).active_pre_sex_handler.get_identifier() != active_sex_handler.get_identifier(): return False if sim_ev(interaction_target).active_sex_handler is None or sim_ev(interaction_sim).active_sex_handler is sim_ev(interaction_target).active_sex_handler: test_incest_of_sims = () if get_relationship_setting(RelationshipSetting.INCEST_STATE, variable_type=bool) else tuple(active_sex_handler.get_actors_sim_info_gen()) (min_age_limit, max_age_limit) = get_age_limits_for_sex(tuple(active_sex_handler.get_actors_sim_info_gen())) skip_sims_ids = [TurboManagerUtil.Sim.get_sim_id(actor_sim_info) for actor_sim_info in active_sex_handler.get_actors_sim_info_gen()] target_sim_id = TurboManagerUtil.Sim.get_sim_id(interaction_target) has_target_sim = False for sim_id in get_nearby_sims_for_sex(active_sex_handler.get_los_position(), radius=16, relative_sims=test_incest_of_sims, min_sims_age=min_age_limit, max_sims_age=max_age_limit, skip_sims_ids=skip_sims_ids): while sim_id == target_sim_id: has_target_sim = True break if interaction_sim is not interaction_target and has_target_sim is False: return False for sex_category_type in sex_category_types: while get_animation_max_amount_of_actors(sex_category_type, active_sex_handler.get_object_identifier()[0]) > active_sex_handler.get_actors_amount() or get_animation_max_amount_of_actors(sex_category_type, active_sex_handler.get_object_identifier()[1]) > active_sex_handler.get_actors_amount(): return True return False
def _jealousy_from_sex_reaction(sim, sex_handler): if not get_relationship_setting(RelationshipSetting.JEALOUSY_STATE, variable_type=bool): return False if sex_handler.get_actors_amount() <= 1: return False if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.CHILD): return False if has_sim_trait(sim, SimTrait.WW_POLYAMOROUS) or has_sim_trait( sim, SimTrait.WW_CUCKOLD): return False (found_lovers, found_non_lovers) = _get_jealousy_sims_from_sex_handler(sim, sex_handler) if found_lovers and found_non_lovers: for target in found_non_lovers: relationship_amount_modifier = -3 if not has_sim_trait( sim, SimTrait.JEALOUS) else -6 change_relationship_with_sim(sim, target, RelationshipTrackType.FRIENDSHIP, relationship_amount_modifier) if get_relationship_with_sim(sim, target, RelationshipTrackType.ROMANCE) > 0: change_relationship_with_sim(sim, target, RelationshipTrackType.ROMANCE, relationship_amount_modifier) for target in found_lovers: jealousy_success = False for jealousy_interaction in JEALOUSY_WOOHOO_REACTION_LIST: result = TurboSimUtil.Interaction.push_affordance( sim, jealousy_interaction, target=target, interaction_context=TurboInteractionUtil. InteractionContext.SOURCE_SCRIPT, insert_strategy=TurboInteractionUtil.QueueInsertStrategy. NEXT, must_run_next=True, priority=TurboInteractionUtil.Priority.High, run_priority=TurboInteractionUtil.Priority.High) if result: jealousy_success = True break if has_sim_buff(sim, SimBuff.JEALOUSY_CHEATER): current_romance_rel_amount = get_relationship_with_sim( sim, target, RelationshipTrackType.ROMANCE) if current_romance_rel_amount >= 30 and has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_ENGAGED) or ( has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_MARRIED) or has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_GETTINGMARRIED) ) or has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_SIGNIFICANT_OTHER): add_sim_buff(sim, SimBuff.JEALOUSY_HIDDEN_WITNESSEDCHEATING) if jealousy_success is True: sim_ev(sim).sex_reaction_cooldown = 5 return True return False
def get_reaction_type(sim, sex_handler, allow_special_types=False): sex_reaction_data = SEX_REACTION_NEUTARL sex_reaction_should_left = True sex_reaction_target_override = None for target in sex_handler.get_actors_sim_instance_gen(): if target is None: continue if allow_special_types is True and ( SEX_REACTION_JEALOUS[0] > sex_reaction_data[0] and (get_relationship_setting(RelationshipSetting.JEALOUSY_STATE, variable_type=bool) and (sex_handler.get_actors_amount() > 1 and not has_sim_trait(sim, SimTrait.WW_POLYAMOROUS))) ) and not has_sim_trait(sim, SimTrait.WW_CUCKOLD): (found_lovers, found_non_lovers) = _get_jealousy_sims_from_sex_handler( sim, sex_handler) if found_lovers and found_non_lovers: sex_reaction_data = SEX_REACTION_JEALOUS sex_reaction_should_left = True if SEX_REACTION_HORRIFIED[0] > sex_reaction_data[0] and ( TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.CHILD) or is_true_family_relationship(sim, target)): sex_reaction_data = SEX_REACTION_HORRIFIED sex_reaction_should_left = True if SEX_REACTION_CUCK_MALE[0] > sex_reaction_data[0] and has_sim_trait( sim, SimTrait.WW_CUCKOLD): (found_lovers, found_non_lovers) = _get_jealousy_sims_from_sex_handler( sim, sex_handler) if found_lovers and found_non_lovers: if TurboSimUtil.Gender.is_male(sim): sex_reaction_data = SEX_REACTION_CUCK_MALE else: sex_reaction_data = SEX_REACTION_CUCK_FEMALE sex_reaction_should_left = False sex_reaction_target_override = found_lovers[0] if SEX_REACTION_ANGRY[0] > sex_reaction_data[0] and ( get_relationship_with_sim( sim, target, RelationshipTrackType.FRIENDSHIP) <= -15 or has_sim_mood(sim, SimMood.STRESSED)): sex_reaction_data = SEX_REACTION_ANGRY sex_reaction_should_left = True if SEX_REACTION_SAD[0] > sex_reaction_data[ 0] and has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_BROKEN_UP ) and has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO): sex_reaction_data = SEX_REACTION_SAD sex_reaction_should_left = True if SEX_REACTION_FLIRTY_MALE[0] > sex_reaction_data[0] and ( has_sim_mood(sim, SimMood.FLIRTY) or get_relationship_with_sim( sim, target, RelationshipTrackType.ROMANCE) >= 40): if TurboSimUtil.Gender.is_male(sim): sex_reaction_data = SEX_REACTION_FLIRTY_MALE else: sex_reaction_data = SEX_REACTION_FLIRTY_FEMALE sex_reaction_should_left = False if SEX_REACTION_FUNNY[0] > sex_reaction_data[0] and ( has_sim_trait(sim, SimTrait.CHILDISH) or has_sim_trait(sim, SimTrait.GOOFBALL)): sex_reaction_data = SEX_REACTION_FUNNY sex_reaction_should_left = True if SEX_REACTION_EXCITED[0] > sex_reaction_data[0] and ( has_sim_mood(sim, SimMood.ENERGIZED) or has_sim_mood(sim, SimMood.CONFIDENT) or has_sim_trait(sim, SimTrait.BRO) and has_sim_trait(target, SimTrait.BRO)): sex_reaction_data = SEX_REACTION_EXCITED sex_reaction_should_left = False if SEX_REACTION_FRIENDLY[0] > sex_reaction_data[ 0] and get_relationship_with_sim( sim, target, RelationshipTrackType.FRIENDSHIP) > 40: sex_reaction_data = SEX_REACTION_FRIENDLY sex_reaction_should_left = True if sex_reaction_data == SEX_REACTION_NEUTARL: if has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_SOULMATES ) or (has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_SWEETHEARTS) or (has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_ROMANTICINTEREST) or (has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_SIGNIFICANT_OTHER) or (has_relationship_bit_with_sim( sim, target, SimRelationshipBit.FRIENDSHIP_BFF) or has_relationship_bit_with_sim( sim, target, SimRelationshipBit.FRIENDSHIP_BFF_BROMANTICPARTNER)))) ) or has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO): sex_reaction_should_left = False return (sex_reaction_data, sex_reaction_should_left, sex_reaction_target_override)
def open_start_sex_sims_picker_dialog(origin_position, pre_sex_handler): @exception_watch() def sim_picker_callback(dialog): if pre_sex_handler is None: return False if not TurboUIUtil.SimPickerDialog.get_response_result(dialog): clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return False selected_sim_id = TurboUIUtil.SimPickerDialog.get_tag_result(dialog) if not selected_sim_id: clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return False selected_sim_info = TurboManagerUtil.Sim.get_sim_info( int(selected_sim_id)) if selected_sim_info is None: clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return False is_sim_sex_allowed = is_sim_allowed_for_animation( tuple(pre_sex_handler.get_actors_sim_info_gen()) + (selected_sim_info, ), pre_sex_handler.get_interaction_type()) if not is_sim_sex_allowed: display_not_allowed_message(is_sim_sex_allowed) clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return False pre_sex_handler.add_sim(selected_sim_id) open_start_sex_animations_picker_dialog(pre_sex_handler) return True creator_sim_info = TurboManagerUtil.Sim.get_sim_info( pre_sex_handler.get_creator_sim_id()) test_incest_of_sims = () if get_relationship_setting( RelationshipSetting.INCEST_STATE, variable_type=bool) else (creator_sim_info, ) (min_age_limit, max_age_limit) = get_age_limits_for_sex( (creator_sim_info, )) skip_males = not has_animations_with_params( pre_sex_handler.get_interaction_type(), pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), SexGenderType.MALE)) skip_females = not has_animations_with_params( pre_sex_handler.get_interaction_type(), pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), SexGenderType.FEMALE)) skip_cmales = not has_animations_with_params( pre_sex_handler.get_interaction_type(), pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), SexGenderType.CMALE)) skip_cfemales = not has_animations_with_params( pre_sex_handler.get_interaction_type(), pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), SexGenderType.CFEMALE)) sims_list = list( get_nearby_sims_for_sex( origin_position, radius=16, relative_sims=test_incest_of_sims, min_sims_age=min_age_limit, max_sims_age=max_age_limit, skip_males=skip_males, skip_females=skip_females, skip_cmales=skip_cmales, skip_cfemales=skip_cfemales, skip_sims_ids=(pre_sex_handler.get_creator_sim_id(), ))) if has_animations_with_params(pre_sex_handler.get_interaction_type(), pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), )): sims_list.insert(0, pre_sex_handler.get_creator_sim_id()) if not sims_list: display_ok_dialog(text=780195446, text_tokens=(get_sex_category_stbl_name( pre_sex_handler.get_interaction_type()), creator_sim_info), title=get_sex_category_animations_stbl_name( pre_sex_handler.get_interaction_type())) clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return display_sim_picker_dialog(text=906772330, title=get_sex_category_animations_stbl_name( pre_sex_handler.get_interaction_type()), sims_id_list=sims_list, callback=sim_picker_callback)
def open_start_random_sex_sims_picker_dialog(origin_position, pre_sex_handler): @exception_watch() def random_sex_sim_picker_callback(dialog): if pre_sex_handler is None: return False if not TurboUIUtil.SimPickerDialog.get_response_result(dialog): clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return False picked_sim_id = TurboUIUtil.SimPickerDialog.get_tag_result(dialog) if not picked_sim_id: clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return False picked_sim = TurboManagerUtil.Sim.get_sim_info(int(picked_sim_id)) if picked_sim is None: clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return False pre_sex_handler.add_sim(picked_sim) random_animation = get_random_animation( pre_sex_handler.get_object_identifier(), tuple(pre_sex_handler.get_actors_sim_info_gen())) if random_animation is None: display_ok_dialog(text=2459296019, title=1890248379) return False pre_sex_handler.set_animation_instance(random_animation) start_sex_interaction_from_pre_sex_handler(pre_sex_handler) return True creator_sim_info = TurboManagerUtil.Sim.get_sim_info( pre_sex_handler.get_creator_sim_id()) test_incest_of_sims = () if get_relationship_setting( RelationshipSetting.INCEST_STATE, variable_type=bool) else (creator_sim_info, ) (min_age_limit, max_age_limit) = get_age_limits_for_sex( (creator_sim_info, )) skip_males = True skip_females = True skip_cmales = True skip_cfemales = True for sex_category_type in (SexCategoryType.TEASING, SexCategoryType.HANDJOB, SexCategoryType.FOOTJOB, SexCategoryType.ORALJOB, SexCategoryType.VAGINAL, SexCategoryType.ANAL): skip_males = not has_animations_with_params( sex_category_type, pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), SexGenderType.MALE)) if skip_males is False: break for sex_category_type in (SexCategoryType.TEASING, SexCategoryType.HANDJOB, SexCategoryType.FOOTJOB, SexCategoryType.ORALJOB, SexCategoryType.VAGINAL, SexCategoryType.ANAL): skip_females = not has_animations_with_params( sex_category_type, pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), SexGenderType.FEMALE)) if skip_females is False: break for sex_category_type in (SexCategoryType.TEASING, SexCategoryType.HANDJOB, SexCategoryType.FOOTJOB, SexCategoryType.ORALJOB, SexCategoryType.VAGINAL, SexCategoryType.ANAL): skip_cmales = not has_animations_with_params( sex_category_type, pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), SexGenderType.CMALE)) if skip_cmales is False: break for sex_category_type in (SexCategoryType.TEASING, SexCategoryType.HANDJOB, SexCategoryType.FOOTJOB, SexCategoryType.ORALJOB, SexCategoryType.VAGINAL, SexCategoryType.ANAL): skip_cfemales = not has_animations_with_params( sex_category_type, pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), SexGenderType.CFEMALE)) if skip_cfemales is False: break sims_list = list( get_nearby_sims_for_sex( origin_position, radius=16, relative_sims=test_incest_of_sims, min_sims_age=min_age_limit, max_sims_age=max_age_limit, skip_males=skip_males, skip_females=skip_females, skip_cmales=skip_cmales, skip_cfemales=skip_cfemales, skip_sims_ids=(pre_sex_handler.get_creator_sim_id(), ))) for sex_category_type in (SexCategoryType.HANDJOB, SexCategoryType.ORALJOB, SexCategoryType.TEASING, SexCategoryType.VAGINAL, SexCategoryType.ANAL, SexCategoryType.FOOTJOB): if has_animations_with_params( sex_category_type, pre_sex_handler.get_object_identifier(), (get_sim_sex_gender(creator_sim_info), )): sims_list.insert(0, pre_sex_handler.get_creator_sim_id()) break if not sims_list: display_ok_dialog(text=2459296019, title=1890248379) clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return if len(get_available_sex_animations()) <= 4: display_ok_dialog(text=1066517691, title=3113927949) display_sim_picker_dialog(text=906772330, title=1890248379, sims_id_list=sims_list, callback=random_sex_sim_picker_callback)
def _wickedwhims_on_sims_talking_desire_interactions_outcome( interaction_instance, outcome_result): sim_info = TurboManagerUtil.Sim.get_sim_info( TurboInteractionUtil.get_interaction_sim(interaction_instance)) target_sim_info = TurboManagerUtil.Sim.get_sim_info( TurboInteractionUtil.get_interaction_target(interaction_instance)) if target_sim_info is None: return if CNSimUtils.is_toddler(sim_info) or CNSimUtils.is_toddler( target_sim_info): return sim_is_child = CNSimUtils.is_child_or_teen(sim_info) target_is_child = CNSimUtils.is_child_or_teen(target_sim_info) if not CNSimUtils.teen_sex_is_enabled() and (sim_is_child or target_is_child): return if sim_is_child and TurboSimUtil.Age.is_older_than(target_sim_info, TurboSimUtil.Age.CHILD): return if get_relationship_setting( RelationshipSetting.ROMANCE_AGE_RESTRICTION_STATE, variable_type=bool ) or target_is_child and TurboSimUtil.Age.is_older_than( sim_info, TurboSimUtil.Age.CHILD): return if has_sim_trait(sim_info, SimTrait.WW_SEXUALLY_ABSTINENT): set_sim_desire_level(sim_info, 0) return if int(GameTag.SOCIAL_FLIRTY) in TurboInteractionUtil.get_affordance_tags( interaction_instance): if outcome_result is True: target_desire_amount = 10 sim_desire_amount = 5 if has_sim_trait(sim_info, SimTrait.ALLURING): target_desire_amount += 3 if has_sim_trait(target_sim_info, SimTrait.ROMANTIC): target_desire_amount += 3 if has_sim_trait( target_sim_info, SimTrait.OCCULTVAMPIRE) and is_sim_on_period(sim_info): target_desire_amount += 3 if has_sim_trait(target_sim_info, SimTrait.UNFLIRTY): target_desire_amount -= 5 sim_outfit_level = get_sim_outfit_level(sim_info) if sim_outfit_level == OutfitLevel.NUDE or sim_outfit_level == OutfitLevel.BATHING: target_desire_amount += 3 change_sim_desire_level(target_sim_info, target_desire_amount) change_sim_desire_level(sim_info, sim_desire_amount) else: change_sim_desire_level(target_sim_info, -7.5) change_sim_desire_level(sim_info, -3.5) elif int( GameTag.INTERACTION_FRIENDLY ) in TurboInteractionUtil.get_affordance_tags(interaction_instance): if outcome_result is True: if get_sim_desire_level( sim_info) < 10 and TurboSimUtil.Gender.get_gender( target_sim_info) in get_sim_preferenced_genders( sim_info): nudity_multiplier = 0.0 target_sim_outfit_level = get_sim_outfit_level(target_sim_info) if target_sim_outfit_level == OutfitLevel.NUDE or target_sim_outfit_level == OutfitLevel.BATHING: nudity_multiplier += 2.0 if has_sim_trait(target_sim_info, SimTrait.INCREDIBLYFRIENDLY): change_sim_desire_level(sim_info, 2.5 * nudity_multiplier) else: change_sim_desire_level(sim_info, 1 * nudity_multiplier) if get_sim_desire_level( target_sim_info) < 5 and TurboSimUtil.Gender.get_gender( sim_info) in get_sim_preferenced_genders( target_sim_info): if has_sim_trait(sim_info, SimTrait.INCREDIBLYFRIENDLY): change_sim_desire_level(target_sim_info, 2.5) else: change_sim_desire_level(target_sim_info, 1) elif int(GameTag.INTERACTION_MEAN ) in TurboInteractionUtil.get_affordance_tags( interaction_instance) and outcome_result is True: if not has_sim_trait(target_sim_info, SimTrait.EVIL): change_sim_desire_level(target_sim_info, -9) if not has_sim_trait(sim_info, SimTrait.EVIL): change_sim_desire_level(sim_info, -5)
def open_join_sims_picker_dialog(pre_sex_handler, sex_category_type, selected_sims_ids=()): @exception_watch() def join_sims_picker_callback(dialog): if pre_sex_handler is None: return False if not TurboUIUtil.SimPickerDialog.get_response_result(dialog): return False picked_sims_ids = TurboUIUtil.SimPickerDialog.get_tag_results(dialog) if not picked_sims_ids: return False picked_sims = list() for sim_id in picked_sims_ids: sim_info = TurboManagerUtil.Sim.get_sim_info(int(sim_id)) if sim_info is None: return False picked_sims.append(sim_info) for sim_info in picked_sims: pre_sex_handler.add_sim(sim_info) genders_list = list() for sim_info in pre_sex_handler.get_actors_sim_info_gen(): genders_list.append(get_sim_sex_gender(sim_info)) if sex_category_type is not None: sex_allowed = is_sim_allowed_for_animation(tuple(picked_sims), sex_category_type, is_joining=True) if not sex_allowed: display_not_allowed_message(sex_allowed) return False has_animations = False if has_animations_with_params( sex_category_type, pre_sex_handler.get_object_identifier(), genders_list): has_animations = True if has_animations is False: display_ok_dialog(text=2693069513, title=get_sex_category_animations_stbl_name( sex_category_type)) return False open_join_sex_animations_picker_dialog(pre_sex_handler, picked_sims, sex_category_type) else: random_animation = get_random_animation( pre_sex_handler.get_object_identifier(), tuple(pre_sex_handler.get_actors_sim_info_gen())) if random_animation is None: display_ok_dialog(text=2693069513, title=1890248379) return False pre_sex_handler.set_animation_instance(random_animation) join_sex_interaction_from_pre_sex_handler(pre_sex_handler, picked_sims) return True if sex_category_type is not None: max_amount_of_actors = max( get_animation_max_amount_of_actors( sex_category_type, pre_sex_handler.get_object_identifier()[0]), get_animation_max_amount_of_actors( sex_category_type, pre_sex_handler.get_object_identifier()[1])) else: max_amount_of_actors = 48 if max_amount_of_actors <= 0: if sex_category_type is not None: display_ok_dialog( text=443330929, text_tokens=(get_sex_category_animations_stbl_name( sex_category_type), ), title=get_sex_category_animations_stbl_name(sex_category_type)) else: display_ok_dialog(text=3121278879, title=1890248379) return creator_sim = TurboManagerUtil.Sim.get_sim_info( pre_sex_handler.get_creator_sim_id()) test_incest_of_sims = () if get_relationship_setting( RelationshipSetting.INCEST_STATE, variable_type=bool) else tuple( pre_sex_handler.get_actors_sim_info_gen()) (min_age_limit, max_age_limit) = get_age_limits_for_sex( tuple(pre_sex_handler.get_actors_sim_info_gen())) skip_sims_ids = [ TurboManagerUtil.Sim.get_sim_id(actor_sim_info) for actor_sim_info in pre_sex_handler.get_actors_sim_info_gen() ] sims_list = tuple( get_nearby_sims_for_sex(pre_sex_handler.get_los_position(), radius=16, relative_sims=test_incest_of_sims, min_sims_age=min_age_limit, max_sims_age=max_age_limit, skip_sims_ids=skip_sims_ids)) if not sims_list: display_ok_dialog( text=2721401338, text_tokens=(get_sex_category_stbl_name(sex_category_type), creator_sim), title=get_sex_category_animations_stbl_name(sex_category_type)) return display_sim_picker_dialog( text=747723284, title=get_sex_category_animations_stbl_name(sex_category_type), sims_id_list=sims_list, selected_sims_id_list=selected_sims_ids, selectable_amount=max_amount_of_actors - pre_sex_handler.get_sims_amount(), sim=creator_sim, callback=join_sims_picker_callback)
def get_relationship_score(sim_identifier, target_sim_identifier, skip_always_accept=False): sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier) target_sim_info = TurboManagerUtil.Sim.get_sim_info(target_sim_identifier) is_npc_exclusive = TurboSimUtil.Sim.is_npc( sim_info) and TurboSimUtil.Sim.is_npc(target_sim_info) if get_sex_setting( SexSetting.ALWAYS_ACCEPT_STATE, variable_type=bool ) and is_npc_exclusive is False and skip_always_accept is False: return 1000 if has_sim_trait(sim_info, SimTrait.WW_SEXUALLY_ABSTINENT): return -1000 if has_sim_trait(sim_info, SimTrait.BASEMENTAL_IS_A_DRUG_DEALER) and ( has_sim_buff(target_sim_info, SimBuff.BASEMENTAL_COCAINE_SEX_PAYMENT_HIDDEN) or has_sim_buff(target_sim_info, SimBuff.BASEMENTAL_AMPHETAMINE_SEX_PAYMENT_HIDDEN) or has_sim_buff(target_sim_info, SimBuff.BASEMENTAL_MDMA_SEX_PAYMENT_HIDDEN)): return 1000 if has_sim_trait( sim_info, SimTrait.BASEMENTAL_IS_A_COCAINE_DRUG_DEALER) and has_sim_buff( target_sim_info, SimBuff.BASEMENTAL_COCAINE_SEX_PAYMENT_HIDDEN): return 1000 if has_sim_trait( sim_info, SimTrait.BASEMENTAL_IS_A_AMPHETAMINE_DRUG_DEALER) and has_sim_buff( target_sim_info, SimBuff.BASEMENTAL_AMPHETAMINE_SEX_PAYMENT_HIDDEN): return 1000 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.BASEMENTAL_DEALER_COCAINE_COMPANION ) and has_relationship_bit_with_sim( target_sim_info, sim_info, SimRelationshipBit.BASEMENTAL_DEALER_COCAINE_COMPANION): return 1000 score = 0 if is_npc_exclusive: pre_sex_handler = sim_ev(sim_info).active_pre_sex_handler or sim_ev( target_sim_info).active_pre_sex_handler if pre_sex_handler is not None and (pre_sex_handler.is_manual_sex() or pre_sex_handler.is_autonomy_sex()): return 1000 if get_sex_setting(SexSetting.AUTONOMY_LEVEL, variable_type=int) == SexAutonomyLevelSetting.LOW: score += 3 elif get_sex_setting( SexSetting.AUTONOMY_LEVEL, variable_type=int) == SexAutonomyLevelSetting.NORMAL: score += 6 elif get_sex_setting( SexSetting.AUTONOMY_LEVEL, variable_type=int) == SexAutonomyLevelSetting.HIGH: score += 20 age_limit = get_age_limits_for_sex((sim_info, )) if TurboSimUtil.Age.is_younger_than( target_sim_info, age_limit[0]) or TurboSimUtil.Age.is_older_than( target_sim_info, age_limit[1]): return -1000 preferred_genders = get_sim_preferenced_genders(sim_info) if TurboSimUtil.Gender.get_gender( target_sim_info) in preferred_genders: score += 5 else: score += -5 if is_true_family_relationship(sim_info, target_sim_info): score += -50 current_charisma_skill_level = get_sim_skill_level( sim_info, SimSkill.ADULTMAJOR_CHARISMA) if 1 <= current_charisma_skill_level <= 2: score += 2 if 3 <= current_charisma_skill_level <= 4: score += 3 if 5 <= current_charisma_skill_level <= 6: score += 6 if 7 <= current_charisma_skill_level <= 8: score += 8 if 9 <= current_charisma_skill_level <= 10: score += 12 if has_sim_trait(sim_info, SimTrait.ALLURING): score += 4 if get_relationship_setting(RelationshipSetting.JEALOUSY_STATE, variable_type=bool) and not has_sim_trait( sim_info, SimTrait.WW_POLYAMOROUS): current_significant_sims = get_sim_relationship_sims(sim_info) if current_significant_sims: if TurboManagerUtil.Sim.get_sim_id( target_sim_info) in current_significant_sims: score += 6 if not has_sim_trait( sim_info, SimTrait.COMMITMENTISSUES) else 3 else: score += -10 if not has_sim_trait( sim_info, SimTrait.COMMITMENTISSUES) else -5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_ROMANCE_STEAMY): score += 12 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_ROMANCE_AMOROUS): score += 7 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.FRIENDSHIP_BFF_BROMANTICPARTNER): score += 6 if has_relationship_bit_with_sim(sim_info, target_sim_info, SimRelationshipBit.FRIENDSHIP_BFF): score += 5 if has_relationship_bit_with_sim(sim_info, target_sim_info, SimRelationshipBit.FRIENDSHIP_BFF_EVIL): score += 4 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_ROMANCE_SUGGESTIVE): score += 5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FRIENDSHIP_FRIENDLY): score += 4 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_FUNNY): score += 4 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_HILARIOUS): score += 4 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_RETAIL_MILDLYINTERESTED): score += 1 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_RETAIL_UNINTERESTED): score += 1 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_RETAIL_VERYINTERESTED): score += 1 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FRIENDSHIP_DISTASTEFUL): score += -5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_BORING): score += -5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_TEDIOUS): score += -8 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_INSUFFERABLYTEDIOUS): score += -15 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FRIENDSHIP_OFFENSIVE): score += -20 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_AWKWARDNESS_AWKWARD): score += -23 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_AWKWARDNESS_VERYAWKWARD): score += -23 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FRIENDSHIP_ABHORRENT): score += -25 current_desire_level = get_sim_desire_level(sim_info) if current_desire_level >= 85: score += 10 elif current_desire_level >= 50: score += 7 current_friendship_rel_amount = get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.FRIENDSHIP) if -100 <= current_friendship_rel_amount <= -70: score += -10 if -70 <= current_friendship_rel_amount <= -30: score += -5 if -30 <= current_friendship_rel_amount <= -15: score += -2 if -15 <= current_friendship_rel_amount <= 25: score += 4 if 25 <= current_friendship_rel_amount <= 60: score += 8 if 60 <= current_friendship_rel_amount <= 100: score += 10 current_romantic_rel_amount = get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.ROMANCE) if -100 <= current_romantic_rel_amount <= -50: score += -6 if -50 <= current_romantic_rel_amount <= 0: score += -3 if 25 <= current_romantic_rel_amount <= 50: score += 10 if 50 <= current_romantic_rel_amount <= 100: score += 25 if has_sim_mood(sim_info, SimMood.FLIRTY): score += 7 if has_sim_mood(sim_info, SimMood.DAZED): score += 7 if has_sim_mood(sim_info, SimMood.CONFIDENT): score += 4 if has_sim_mood(sim_info, SimMood.HAPPY): score += 4 if has_sim_mood(sim_info, SimMood.PLAYFUL): score += 3 if has_sim_mood(sim_info, SimMood.ENERGIZED): score += 2 if has_sim_mood(sim_info, SimMood.FINE): score += 2 if has_sim_mood(sim_info, SimMood.INSPIRED): score += 2 if has_sim_mood(sim_info, SimMood.FOCUSED): score += 2 if has_sim_mood(sim_info, SimMood.INSPIRED): score += 2 if has_sim_mood(sim_info, SimMood.ANGRY): score += -3 if has_sim_mood(sim_info, SimMood.STRESSED): score += -5 if has_sim_mood(sim_info, SimMood.UNCOMFORTABLE): score += -5 if has_sim_mood(sim_info, SimMood.BORED): score += -6 if has_sim_mood(sim_info, SimMood.SAD): score += -10 if has_sim_mood(sim_info, SimMood.EMBARRASSED): score += -13 if has_sim_trait( sim_info, SimTrait.WW_SEXUALLY_ALLURING) and has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.HAS_MET): score += 50 if has_sim_trait( sim_info, SimTrait.EVIL) and get_sim_relationship_sims(target_sim_info): score += 4 if has_sim_trait(sim_info, SimTrait.LONER): score += 3 if has_sim_trait(sim_info, SimTrait.BRO) and has_sim_trait( target_sim_info, SimTrait.BRO): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_PASSIONATE): score += 10 if has_sim_buff(sim_info, SimBuff.CLUBS_PERKS_SOCIALBONUS_ROMANTIC): score += 10 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_FEARLESS): score += 5 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_ELATED): score += 5 if has_sim_buff(sim_info, SimBuff.FESTIVAL_BLOSSOM_TEAGLOW_SAKURA): score += 5 if has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_SUPER_QUALITY ) or (has_sim_buff(sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_HIGH_QUALITY) or has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_GOOD_1_QUALITY)) or has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_GOOD_2_QUALITY): score += 3 if has_sim_buff( sim_info, SimBuff.BASEMENTAL_COCAINE_HIGH_ON_HIGH_QUALITY) or has_sim_buff( sim_info, SimBuff.BASEMENTAL_COCAINE_HIGH_ON_MEDIUM_QUALITY): score += 3 if has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_MEDIUM_QUALITY) or has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_LOW_QUALITY): score += 2 if has_sim_buff( sim_info, SimBuff.BASEMENTAL_COCAINE_VERY_HIGH_ON_HIGH_QUALITY ) or has_sim_buff(sim_info, SimBuff.BASEMENTAL_COCAINE_VERY_HIGH_ON_MEDIUM_QUALITY): score += 3 if has_sim_buff(sim_info, SimBuff.BASEMENTAL_ALCOHOL_TIPSY): score += 1 elif has_sim_buff(sim_info, SimBuff.BASEMENTAL_ALCOHOL_DRUNK): score += 2 elif has_sim_buff(sim_info, SimBuff.BASEMENTAL_ALCOHOL_WASTED): score += 3 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_HUMILIATED) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_MORTIFIED): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_PUMPED): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_INTHEZONE): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_IMAGINATIVE) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_MUSER_TRAITREPLACEMENT) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_MUSERER_TRAITREPLACEMENT): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_SILLY) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_HYSTERICAL): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_DEPRESSED) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_GLOOMIER): score += -5 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_STRESSED): score += -5 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_MISERABLE): score += -5 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_ENRAGED) or (has_sim_buff( sim_info, SimBuff.MOODHIDDEN_FURIOUS) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_HOTHEAD2)) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_HOTHEAD3): score += -5 if has_sim_buff(target_sim_info, SimBuff.OBJECT_DRINK_FLIRTY): score += 10 if has_sim_buff(target_sim_info, SimBuff.BROKENUPORDIVORCED_HIDDEN): score += -5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HASBEENUNFAITHFUL): score += -8 if len( get_sim_ids_with_relationsip_bit( sim_info, SimRelationshipBit.SHORTTERM_JUSTBROKEUPORDIVORCED)) > 0: score += -18 if has_sim_situation_job( sim_info, SimSituationJob.RESTAURANTDINER_SUB_NPC_BADDATE_ANGRYSIM): score += -25 current_higiene_motive = get_sim_motive_value(sim_info, SimMotive.HYGIENE) if current_higiene_motive <= -50: score += -12 if current_higiene_motive == -100: score += -8 return score
def apply_after_sex_relationship(sex_handler, sims_list): if len(sims_list) <= 1: return if get_sex_setting(SexSetting.SEX_RELATIONS_IMPACT_STATE, variable_type=bool): relationship_value = int(min(sex_handler.one_second_counter / 15, 20)) for ((_, sim_info), (_, target_sim_info)) in itertools.combinations(sims_list, 2): relationship_tracks_score = list() if relationship_value > 0: romance_track_score = get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.ROMANCE) if romance_track_score <= 5 or has_sim_trait( sim_info, SimTrait.COMMITMENTISSUES ) and random.uniform(0, 1) <= 0.25 or has_sim_trait( sim_info, SimTrait.INSANE) and random.uniform(0, 1) <= 0.5: relationship_tracks_score.append( (RelationshipTrackType.FRIENDSHIP, relationship_value)) else: relationship_tracks_score.append( (RelationshipTrackType.ROMANCE, relationship_value * 0.8)) relationship_tracks_score.append( (RelationshipTrackType.FRIENDSHIP, relationship_value * 0.2)) for (relationship_track, relationship_score) in relationship_tracks_score: relationship_track_score = get_relationship_with_sim( sim_info, target_sim_info, relationship_track) if -100 <= relationship_track_score <= -40: relationship_score *= 1.0 elif -40 <= relationship_track_score <= 0: relationship_score *= 0.6 elif 0 <= relationship_track_score <= 20: relationship_score *= 0.4 elif 20 <= relationship_track_score <= 40: relationship_score *= 0.3 elif 40 <= relationship_track_score <= 80: relationship_score *= 0.2 elif 80 <= relationship_track_score <= 100: relationship_score *= 0.1 change_relationship_with_sim(sim_info, target_sim_info, relationship_track, relationship_score) if get_relationship_setting(RelationshipSetting.JEALOUSY_STATE, variable_type=bool): while True: for (_, sim_info) in sims_list: relationship_sims_ids = get_sim_relationship_sims(sim_info) while len(relationship_sims_ids) > 0: has_cheated = True for (_, target_sim_info) in sims_list: if sim_info is target_sim_info: pass while TurboManagerUtil.Sim.get_sim_id( target_sim_info) in relationship_sims_ids: has_cheated = False break if has_cheated is True: while True: for (_, target_sim_info) in sims_list: add_relationsip_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_CHEATEDWITH ) for ((_, sim_info), (_, target_sim_info)) in itertools.permutations(sims_list, 2): if not has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO): add_relationsip_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO) if not has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO_RECENTLY): add_relationsip_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO_RECENTLY) while not has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.WW_JUST_HAD_SEX): add_relationsip_bit_with_sim(sim_info, target_sim_info, SimRelationshipBit.WW_JUST_HAD_SEX)