def on_interaction_test(cls, interaction_context, interaction_target): if not TurboTypesUtil.Sims.is_sim(interaction_target): return False sim = cls.get_interaction_sim(interaction_context) if not CNSimUtils.teen_sex_is_enabled() and ( CNSimUtils.is_child_or_teen(sim) or CNSimUtils.is_child_or_teen(interaction_target)): return False skill_level = get_sim_nudity_skill_level(sim) if skill_level <= 1: return False if is_sim_in_sex(sim) or (is_sim_going_to_sex(sim) or is_sim_in_sex(interaction_target) ) or is_sim_going_to_sex(interaction_target): return False if not has_sim_permission_for_nudity(sim)[0]: return False if is_sim_outfit_fullbody(interaction_target): return True if get_sim_body_state(interaction_target, 6) == BodyState.OUTFIT: return True if get_sim_body_state(interaction_target, 7) == BodyState.OUTFIT: return True return False
def get_available_for_sex_sims(only_on_hypersexual_lot=False, forbidden_traits=()): sims_list = set() for sim in TurboManagerUtil.Sim.get_all_sim_instance_gen(humans=True, pets=False): if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.CHILD): continue if not CNSimUtils.teen_sex_is_enabled( ) and CNSimUtils.is_child_or_teen(sim): continue if not get_sex_setting( SexSetting.PLAYER_AUTONOMY_STATE, variable_type=bool) and TurboSimUtil.Sim.is_player(sim): continue object_id = TurboResourceUtil.Resource.get_id(sim) if is_autonomy_sex_locations_disabled(object_id): continue if TurboWorldUtil.Time.get_absolute_ticks() < sim_ev( sim ).last_sex_autonomy + get_time_between_sex_autonomy_attempts(): continue if not sim_ev(sim).active_sex_handler is not None: if sim_ev(sim).active_pre_sex_handler is not None: continue if not is_sim_allowed_for_autonomy(sim): continue if not _is_sim_needs_fine(sim): continue if _is_sim_fearing_possible_pregnancy(sim): continue if not is_sim_available(sim): continue if _has_sim_sex_forbidden_traits( sim, forbidden_traits=forbidden_traits): continue if _has_sim_sex_forbidden_buffs(sim): continue if _is_sim_in_sex_forbidden_situation(sim): continue if only_on_hypersexual_lot is True and not TurboWorldUtil.Lot.is_position_on_active_lot( TurboSimUtil.Location.get_position(sim)): continue sims_list.add(sim) return sims_list
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 _wickedwhims_on_sex_autonomy_romance_interactions_outcome( interaction_instance, outcome_result): if outcome_result is False: return if get_sex_setting(SexSetting.AUTONOMY_LEVEL, variable_type=int) == SexAutonomyLevelSetting.DISABLED: return if not get_sex_setting(SexSetting.AUTONOMY_ROMANCE_SEX_STATE, variable_type=bool): return interaction_guid = TurboResourceUtil.Resource.get_guid64( interaction_instance) if interaction_guid == SimInteraction.WW_SOCIAL_MIXER_ASK_FOR_SEX_DEFAULT or interaction_guid == SimInteraction.WW_SOCIAL_MIXER_AUTONOMY_ASK_FOR_SEX_DEFAULT: return sim_info = TurboManagerUtil.Sim.get_sim_info( TurboInteractionUtil.get_interaction_sim(interaction_instance)) if not sim_ev(sim_info).is_ready(): return if sim_ev(sim_info).active_sex_handler is not None or sim_ev( sim_info).active_pre_sex_handler is not None: return if is_autonomy_sex_locations_disabled( TurboResourceUtil.Resource.get_id(sim_info)): return target_sim_info = TurboManagerUtil.Sim.get_sim_info( TurboInteractionUtil.get_interaction_target(interaction_instance)) if target_sim_info is None: return if sim_ev(target_sim_info).active_sex_handler is not None or sim_ev( target_sim_info).active_pre_sex_handler is not None: return if is_autonomy_sex_locations_disabled( TurboResourceUtil.Resource.get_id(target_sim_info)): return if not get_sex_setting( SexSetting.PLAYER_AUTONOMY_STATE, variable_type=bool) and TurboSimUtil.Sim.is_player( sim_info) and TurboSimUtil.Sim.is_player(target_sim_info): return if not CNSimUtils.teen_sex_is_enabled() and ( CNSimUtils.is_child_or_teen(sim_info) or CNSimUtils.is_child_or_teen(target_sim_info)): return if int( GameTag.SOCIAL_FLIRTY ) not in TurboInteractionUtil.get_affordance_tags(interaction_instance): return if not is_sim_allowed_for_autonomy( TurboManagerUtil.Sim.get_sim_instance(sim_info)): return if TurboWorldUtil.Time.get_absolute_ticks( ) < sim_ev(sim_info ).last_sex_autonomy + get_time_between_sex_autonomy_attempts(): return if get_sex_pair_score( sim_info, target_sim_info) < get_relationship_sex_acceptance_threshold(): return is_flirty_conversation = TurboSimUtil.Mood.get_mood( sim_info) == SimMood.FLIRTY and TurboSimUtil.Mood.get_mood( target_sim_info) == SimMood.FLIRTY has_target_high_desire = get_sim_desire_level(target_sim_info) >= 80 if get_sex_setting(SexSetting.AUTONOMY_LEVEL, variable_type=int) == SexAutonomyLevelSetting.HIGH: random_chance = 0.25 + (0.25 if is_flirty_conversation else 0.0) + ( 0.25 if has_target_high_desire else 0.0) elif get_sex_setting(SexSetting.AUTONOMY_LEVEL, variable_type=int) == SexAutonomyLevelSetting.LOW: random_chance = 0.05 + (0.1 if is_flirty_conversation else 0.0) + (0.1 if has_target_high_desire else 0.0) else: random_chance = 0.1 + (0.2 if is_flirty_conversation else 0.0) + (0.2 if has_target_high_desire else 0.0) if random.uniform(0, 1) <= random_chance: sims_pair = (sim_info, target_sim_info) location_style_and_delay = get_sex_location_style_and_chance(sims_pair) if location_style_and_delay[ 0] != LocationStyleType.NONE and random.uniform( 0, 1) <= location_style_and_delay[1]: sex_location = get_sex_autonomy_location( sims_pair, location_style=location_style_and_delay[0]) if sex_location is not None: trigger_sex_autonomy_interaction(sims_pair, sex_location)