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_sims_for_sex(skip_males=False, skip_females=False, skip_cmales=False, skip_cfemales=False, only_npc=False, relative_sims=(), min_sims_age=TurboSimUtil.Age.CHILD, max_sims_age=TurboSimUtil.Age.ELDER, skip_sims_ids=()): for sim in TurboManagerUtil.Sim.get_all_sim_instance_gen(humans=True, pets=False): if TurboManagerUtil.Sim.get_sim_id(sim) in skip_sims_ids: continue if only_npc is True and TurboSimUtil.Sim.is_player(sim): continue if skip_cmales is True and get_sim_sex_gender(sim, ignore_sim_specific_gender=True) == SexGenderType.CMALE: continue if skip_males is True and get_sim_sex_gender(sim, ignore_sim_specific_gender=True) == SexGenderType.MALE: continue if skip_cfemales is True and get_sim_sex_gender(sim, ignore_sim_specific_gender=True) == SexGenderType.CFEMALE: continue if skip_females is True and get_sim_sex_gender(sim, ignore_sim_specific_gender=True) == SexGenderType.FEMALE: continue if not TurboSimUtil.Age.is_younger_than(sim, min_sims_age): if TurboSimUtil.Age.is_older_than(sim, max_sims_age): continue if not (is_sim_in_sex(sim) or is_sim_going_to_sex(sim)): if sim_ev(sim).active_pre_sex_handler is not None: continue if has_sim_traits(sim, (SimTrait.HIDDEN_ISEVENTNPC_CHALLENGE, SimTrait.ISGRIMREAPER)): continue if not is_sim_available(sim): continue if relative_sims: is_incest = False for incest_test_sim in relative_sims: if is_true_family_relationship(sim, incest_test_sim): is_incest = True break if is_incest is True: continue yield TurboManagerUtil.Sim.get_sim_id(sim)
def get_random_sex_category_type(object_identifier, sims_info_list): genders = list() for sim_info in sims_info_list: genders.append(get_sim_sex_gender(sim_info)) animations_list = get_animations_for_object( object_identifier, genders, excluded_sex_category_types=(SexCategoryType.CLIMAX, )) allowed_for_random_animations_list = list() for animation in animations_list: while animation.is_allowed_for_random(): allowed_for_random_animations_list.append(animation) animations_list = allowed_for_random_animations_list or animations_list available_sex_category_types = list() for animation in animations_list: while animation.get_sex_category() not in available_sex_category_types: available_sex_category_types.append(animation.get_sex_category()) allowed_sex_category_types = list() for sex_category_type in available_sex_category_types: sex_allowed = is_sim_allowed_for_animation(sims_info_list, sex_category_type) if not sex_allowed: pass allowed_sex_category_types.append(sex_category_type) if len(allowed_sex_category_types) == 0: return return random.choice(allowed_sex_category_types)
def open_start_sex_animations_picker_dialog(pre_sex_handler): @exception_watch() def animations_picker_callback(dialog): if pre_sex_handler is None: return False if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog): open_start_sex_animations_category_picker_dialog(pre_sex_handler) return False animation_instance = TurboUIUtil.ObjectPickerDialog.get_tag_result( dialog) pre_sex_handler.set_animation_instance(animation_instance) start_sex_interaction_from_pre_sex_handler(pre_sex_handler) return True genders_list = list() for sim_info in pre_sex_handler.get_actors_sim_info_gen(): genders_list.append(get_sim_sex_gender(sim_info)) animations_list = get_animations_with_params( pre_sex_handler.get_interaction_type(), pre_sex_handler.get_object_identifier(), genders_list) animations_rows = list() for animation in animations_list: animations_rows.append(animation.get_picker_row()) if len(animations_rows) > 1: animations_rows.insert( 0, ChoiceListRandomAnimationPickerRow( pre_sex_handler, pre_sex_handler.get_interaction_type())) if len(get_available_sex_animations()) <= 4: display_ok_dialog(text=1066517691, title=3113927949) display_picker_list_dialog(title=get_sex_category_animations_stbl_name( pre_sex_handler.get_interaction_type()), picker_rows=animations_rows, callback=animations_picker_callback)
def _get_active_sex_handler(self): active_sex_handler = ActiveSexInteractionHandler( self.get_creator_sim_id(), self.get_object_identifier(), self.get_game_object_id(), self.get_object_height(), self.get_lot_id(), self.location_x, self.location_y, self.location_z, self.location_level, self.location_angle, self.route_x, self.route_y, self.route_z, self.route_level, is_autonomy=self.is_autonomy_sex()) active_sex_handler.is_timer_paused = self._is_timer_paused active_sex_handler.is_animation_paused = self._is_animation_paused active_sex_handler.linked_sex_handler_identifier = self._linked_sex_handler_identifier active_sex_handler.set_animation_instance( self.get_animation_instance()) if active_sex_handler.get_animation_instance() is None: display_notification( text= 'Tried creating sex interaction without animation data!\n\nThis not an intended behaviour and it should be reported.', title='WickedWhims Error', is_safe=True) return from wickedwhims.sex.sex_operators.active_sex_handlers_operator import queue_unregister_active_sex_handler for sim_info in self.get_actors_sim_info_gen(): old_sex_handler = sim_ev(sim_info).active_sex_handler if old_sex_handler is not None: queue_unregister_active_sex_handler(old_sex_handler) if not active_sex_handler.assign_actor( TurboManagerUtil.Sim.get_sim_id(sim_info), get_sim_sex_gender(sim_info)): display_notification( text= 'Tried to assign actor on sex handler creation and failed!', title='WickedWhims Error', is_safe=True) return sim_ev( sim_info).sim_sex_state_snapshot = get_sim_sex_state_snapshot( sim_info) sim_ev( sim_info ).sim_immutable_sex_state_snapshot = get_sim_sex_state_snapshot( sim_info) if not active_sex_handler.is_actors_list_full(): display_notification( text= 'Sex handler is missing actors for selected animation!\n\nRemember the selected animation name, used sims (genders) and settings (gender settings) when reporting this problem!', title='WickedWhims Error', is_safe=True) return return active_sex_handler
def _trigger_autonomy_join_sex_interaction(active_sex_handler, join_sim): object_identifier = active_sex_handler.get_object_identifier() genders = list() sims_list = list(active_sex_handler.get_actors_sim_info_gen()) sims_list.append(join_sim) for sim in sims_list: genders.append(get_sim_sex_gender(sim)) target_sex_category_type = active_sex_handler.get_animation_instance( ).get_sex_category() animation_instance = None for sex_category_type in (target_sex_category_type, SexCategoryType.ORALJOB, SexCategoryType.VAGINAL, SexCategoryType.ANAL, SexCategoryType.HANDJOB, SexCategoryType.FOOTJOB, SexCategoryType.TEASING): if not is_sim_allowed_for_animation(sims_list, sex_category_type): pass animation_instance = get_random_animation_of_type( sex_category_type, object_identifier, genders, ignore_animations=get_autonomy_disabled_sex_animations()) while animation_instance is not None: break if animation_instance is None: return False pre_sex_handler = active_sex_handler.get_pre_sex_handler(is_joining=True) pre_sex_handler.set_animation_instance(animation_instance) for sim in sims_list: pre_sex_handler.add_sim(sim) creator_sim = TurboManagerUtil.Sim.get_sim_info( pre_sex_handler.get_creator_sim_id()) ask_player_to_start = False if get_sex_setting( SexSetting.AUTONOMY_PLAYER_ASK_PLAYER_DIALOG_STATE, variable_type=bool) and TurboSimUtil.Sim.is_player( creator_sim) and TurboSimUtil.Sim.is_player(join_sim): ask_player_to_start = True elif get_sex_setting( SexSetting.AUTONOMY_NPC_ASK_PLAYER_DIALOG_STATE, variable_type=bool) and TurboSimUtil.Sim.is_player( creator_sim) and TurboSimUtil.Sim.is_npc(join_sim): ask_player_to_start = True elif get_sex_setting( SexSetting.AUTONOMY_PLAYER_ASK_NPC_DIALOG_STATE, variable_type=bool) and TurboSimUtil.Sim.is_npc( creator_sim) and TurboSimUtil.Sim.is_player(join_sim): ask_player_to_start = True join_sex_interaction_from_pre_sex_handler( pre_sex_handler, (join_sim, ), ask_player_to_join=ask_player_to_start, ignore_relationship_check=True) return True
def open_change_sex_animations_category_picker_dialog(active_sex_handler): @exception_watch() def animation_categories_picker_callback(dialog): if active_sex_handler is None: return False if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog): return False result_sex_category_type = TurboUIUtil.ObjectPickerDialog.get_tag_result( dialog) open_change_sex_animations_picker_dialog(active_sex_handler, result_sex_category_type) return True genders_list = list() for sim_info in active_sex_handler.get_actors_sim_info_gen(): genders_list.append(get_sim_sex_gender(sim_info)) category_picker_rows = list() animation_categories = ((0, SexCategoryType.TEASING, 77458156), (1, SexCategoryType.HANDJOB, 1425559843), (3, SexCategoryType.FOOTJOB, 223939754), (4, SexCategoryType.ORALJOB, 2747124438), (5, SexCategoryType.VAGINAL, 574589211), (6, SexCategoryType.ANAL, 1610085053), (7, SexCategoryType.CLIMAX, 3986970407)) for (index, animation_sex_category_type, animation_sex_category_name) in animation_categories: if not active_sex_handler.is_at_climax and animation_sex_category_type == SexCategoryType.CLIMAX: pass if not has_animations_with_params( animation_sex_category_type, active_sex_handler.get_object_identifier(), genders_list): pass animations_list = get_animations_with_params( animation_sex_category_type, active_sex_handler.get_object_identifier(), genders_list) if not animations_list: pass picker_row = TurboUIUtil.ObjectPickerDialog.ListPickerRow( index, animation_sex_category_name, TurboL18NUtil.get_localized_string(3166569584, tokens=(str( len(animations_list)), )), skip_tooltip=True, icon=get_arrow_icon(), tag=animation_sex_category_type) category_picker_rows.append(picker_row) if len(category_picker_rows) <= 1: return display_picker_list_dialog(title=2301874612, picker_rows=category_picker_rows, callback=animation_categories_picker_callback)
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
def _test_for_sex_change(interaction_sim, interaction_target, sex_category_types): if interaction_target is None: return False if interaction_sim is interaction_target or TurboTypesUtil.Sims.is_sim(interaction_target) and sim_ev(interaction_sim).active_sex_handler is sim_ev(interaction_target).active_sex_handler or TurboTypesUtil.Objects.is_game_object(interaction_target) and sim_ev(interaction_sim).active_sex_handler is not None and sim_ev(interaction_sim).active_sex_handler.get_game_object_id() == TurboResourceUtil.Resource.get_id(interaction_target): active_sex_handler = sim_ev(interaction_sim).active_sex_handler or (sim_ev(interaction_target).active_sex_handler if TurboTypesUtil.Sims.is_sim(interaction_target) else None) if active_sex_handler is None: return False if active_sex_handler.is_playing is False: 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)) for sex_category_type in sex_category_types: while has_animations_with_params(sex_category_type, active_sex_handler.get_object_identifier(), genders_list): return True return False
def open_change_sex_location_animations_picker_dialog( active_sex_handler, sex_category_type, new_object_identifier, game_object_id, object_height, location_x, location_y, location_z, location_level, location_angle, route_x, route_y, route_z, route_level): @exception_watch() def change_sex_location_animation_picker_callback(dialog): if active_sex_handler is None: return False if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog): return False animation_instance = TurboUIUtil.ObjectPickerDialog.get_tag_result( dialog) active_sex_handler.set_animation_instance(animation_instance, is_manual=True) active_sex_handler.set_object_identifier(new_object_identifier) active_sex_handler.set_game_object_id(game_object_id) active_sex_handler.set_object_height(object_height) active_sex_handler.set_location(location_x, location_y, location_z, location_level, location_angle) active_sex_handler.set_route_position(route_x, route_y, route_z, route_level) active_sex_handler.reassign_actors() active_sex_handler.restart() return True genders_list = list() for sim_info in active_sex_handler.get_actors_sim_info_gen(): genders_list.append(get_sim_sex_gender(sim_info)) animations_list = get_animations_with_params(sex_category_type, new_object_identifier, genders_list) animations_rows = list() for animation in animations_list: animations_rows.append(animation.get_picker_row()) if len(animations_rows) > 1: animations_rows.insert( 0, ChoiceListRandomAnimationPickerRow( active_sex_handler, sex_category_type, object_identifier=new_object_identifier)) display_picker_list_dialog( title=get_sex_category_animations_stbl_name(sex_category_type), picker_rows=animations_rows, callback=change_sex_location_animation_picker_callback)
def open_start_sex_animations_category_picker_dialog(pre_sex_handler): @exception_watch() def animation_categories_picker_callback(dialog): if pre_sex_handler is None: return False if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog): clear_sims_sex_extra_data( tuple(pre_sex_handler.get_actors_sim_info_gen())) return False result_sex_category_type = TurboUIUtil.ObjectPickerDialog.get_tag_result( dialog) pre_sex_handler.set_interaction_type(result_sex_category_type) open_start_sex_animations_picker_dialog(pre_sex_handler) return True genders_list = list() for sim_info in pre_sex_handler.get_actors_sim_info_gen(): genders_list.append(get_sim_sex_gender(sim_info)) category_picker_rows = list() animation_categories = ((0, SexCategoryType.TEASING, 77458156), (1, SexCategoryType.HANDJOB, 1425559843), (3, SexCategoryType.FOOTJOB, 223939754), (4, SexCategoryType.ORALJOB, 2747124438), (5, SexCategoryType.VAGINAL, 574589211), (6, SexCategoryType.ANAL, 1610085053)) for (index, animation_sex_category_type, animation_sex_category_name) in animation_categories: animations_list = get_animations_with_params( animation_sex_category_type, pre_sex_handler.get_object_identifier(), genders_list) if not animations_list: continue picker_row = TurboUIUtil.ObjectPickerDialog.ListPickerRow( index, animation_sex_category_name, TurboL18NUtil.get_localized_string(3166569584, tokens=(str( len(animations_list)), )), skip_tooltip=True, icon=get_arrow_icon(), tag=animation_sex_category_type) category_picker_rows.append(picker_row) display_picker_list_dialog(title=2301874612, picker_rows=category_picker_rows, callback=animation_categories_picker_callback)
def open_change_sex_animations_picker_dialog(active_sex_handler, sex_category_type): @exception_watch() def animation_picker_callback(dialog): if active_sex_handler is None: return False if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog): open_change_sex_animations_category_picker_dialog( active_sex_handler) return False animation_instance = TurboUIUtil.ObjectPickerDialog.get_tag_result( dialog) if animation_instance is not None and animation_instance is not active_sex_handler.get_animation_instance( ): active_sex_handler.set_animation_instance(animation_instance, is_animation_change=True, is_manual=True) active_sex_handler.play(is_animation_change=True) return True return False genders_list = list() for sim_info in active_sex_handler.get_actors_sim_info_gen(): genders_list.append(get_sim_sex_gender(sim_info)) animations_list = get_animations_with_params( sex_category_type, active_sex_handler.get_object_identifier(), genders_list) animations_rows = list() for animation in animations_list: animations_rows.append( animation.get_picker_row( display_selected=animation.get_animation_id() == active_sex_handler.get_animation_instance().get_animation_id()) ) if len(animations_rows) > 1: animations_rows.insert( 0, ChoiceListRandomAnimationPickerRow(active_sex_handler, sex_category_type)) display_picker_list_dialog( title=get_sex_category_animations_stbl_name(sex_category_type), picker_rows=animations_rows, callback=animation_picker_callback)
def reassign_actors(self): current_actors_list_copy = self._actors_list.copy() sims_sex_gender = list() for sim_info in self.get_actors_sim_info_gen(): sims_sex_gender.append((TurboManagerUtil.Sim.get_sim_id(sim_info), get_sim_sex_gender(sim_info))) self._populate_actors_list(force_populate=True) for (sim_id, sim_gender) in sims_sex_gender: if not self.assign_actor(sim_id, sim_gender): display_notification( text= 'Tried to assign an actor on actors reassigning and failed!', title='WickedWhims Error', is_safe=True) self._actors_list = current_actors_list_copy self.stop(hard_stop=True, is_end=True, stop_reason='Failed to reassign actors.') break
def trigger_sex_autonomy_interaction( sims_pair, sex_location, sex_category_types=(SexCategoryType.ORALJOB, SexCategoryType.VAGINAL, SexCategoryType.ANAL, SexCategoryType.HANDJOB, SexCategoryType.FOOTJOB, SexCategoryType.TEASING)): object_identifier = SexInteractionLocationType.get_location_identifier( sex_location) genders = list() for sim in sims_pair: genders.append(get_sim_sex_gender(sim)) animation_instance = None for sex_category_type in sex_category_types: if not is_sim_allowed_for_animation(sims_pair, sex_category_type): continue animation_instance = get_random_animation_of_type( sex_category_type, object_identifier, genders, ignore_animations=get_autonomy_disabled_sex_animations()) if animation_instance is not None: break if animation_instance is None: return False if is_main_debug_flag_enabled(): for sim in sims_pair: sim_name = TurboSimUtil.Name.get_name(sim) display_notification(title='Autonomy Triggered', text=str(sim_name[0]) + ' ' + str(sim_name[1]), secondary_icon=sim) if TurboTypesUtil.Objects.is_game_object(sex_location): display_notification(title='Autonomy Triggered', text=str( animation_instance.get_sex_category()), secondary_icon=sex_location) TurboWorldUtil.Time.set_current_time_speed( TurboWorldUtil.Time.ClockSpeedMode.PAUSED) return start_new_direct_sex_interaction(sims_pair, sex_location, animation_instance, is_autonomy=True)
def get_tag(self): genders = list() for sim_info in self.sex_handler.get_actors_sim_info_gen(): genders.append(get_sim_sex_gender(sim_info)) current_animation = self.sex_handler.get_animation_instance() random_animation = get_random_animation_of_type( self.sex_category_type, self.object_identifier if self.object_identifier is not None else self.sex_handler.get_object_identifier(), genders, ignore_animations_ids=(-1 if current_animation is None else current_animation.get_animation_id(), )) if random_animation is None: display_notification( text=1395546180, title=1890248379, secondary_icon=TurboManagerUtil.Sim.get_sim_info( self.sex_handler.get_creator_sim_id())) return return random_animation
def _test_for_change_sex_location(interaction_context, interaction_sim, interaction_target, sex_category_types): if interaction_target is None: return False active_sex_handler = sim_ev(interaction_sim).active_sex_handler if active_sex_handler is None: return False if active_sex_handler.is_playing is False: return False if TurboTypesUtil.Objects.is_game_object(interaction_target): object_position = TurboObjectUtil.Position.get_position(interaction_target) + get_object_fixed_direction(interaction_target) target_room_id = TurboWorldUtil.Lot.get_room_id(TurboObjectUtil.Position.get_location(interaction_target), position=object_position) elif interaction_context is not None: target_room_id = TurboWorldUtil.Lot.get_room_id(TurboMathUtil.Location.get_location(get_floor_object_position(interaction_target, interaction_context), get_floor_object_level(interaction_target, interaction_context), 0)) else: return False if target_room_id != TurboWorldUtil.Lot.get_room_id(active_sex_handler.get_location()): return False if TurboTypesUtil.Objects.is_game_object(interaction_target): interaction_target = TurboObjectUtil.GameObject.get_parent(interaction_target) if active_sex_handler.get_game_object_id() == TurboResourceUtil.Resource.get_id(interaction_target): return False if not is_sim_allowed_on_active_lot(interaction_sim) and TurboWorldUtil.Lot.is_position_on_active_lot(TurboObjectUtil.Position.get_position(interaction_target)): return False else: if not is_safe_floor_object_position(interaction_target, interaction_context): return False if TurboTypesUtil.Objects.is_terrain(interaction_target) and not is_sim_allowed_on_active_lot(interaction_sim) and TurboWorldUtil.Lot.is_position_on_active_lot(get_floor_object_position(interaction_target, interaction_context)): return False object_identifier = SexInteractionLocationType.get_location_identifier(interaction_target) 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)) has_animations = False for sex_category_type in sex_category_types: while has_animations_with_params(sex_category_type, object_identifier, genders_list): has_animations = True break if has_animations is False: return False return True
def _test_for_sex_start(interaction_context, interaction_sim, interaction_target, sex_category_types): if interaction_target is None: return False if not is_sim_ready_for_sex(interaction_sim) or sim_ev( interaction_sim).active_pre_sex_handler is not None: return False if not CNSimUtils.can_have_sex(interaction_sim): return False if TurboTypesUtil.Objects.is_game_object(interaction_target): interaction_target = TurboObjectUtil.GameObject.get_parent( interaction_target) if not is_sim_allowed_on_active_lot( interaction_sim ) and TurboWorldUtil.Lot.is_position_on_active_lot( TurboObjectUtil.Position.get_position(interaction_target)): return False else: if not is_safe_floor_object_position(interaction_target, interaction_context): return False if TurboTypesUtil.Objects.is_terrain( interaction_target) and not is_sim_allowed_on_active_lot( interaction_sim ) and TurboWorldUtil.Lot.is_position_on_active_lot( get_floor_object_position(interaction_target, interaction_context)): return False object_identifier = SexInteractionLocationType.get_location_identifier( interaction_target) sim_gender = get_sim_sex_gender(interaction_sim) for sex_category_type in sex_category_types: if sex_category_type is None: continue if has_object_identifier_animations(object_identifier, sex_category_type, sim_gender): return True return False
def open_join_sex_animations_picker_dialog(pre_sex_handler, joining_sims_list, sex_category_type, flip_relationship_check=False): @exception_watch() def join_sex_animation_picker_callback(dialog): if pre_sex_handler is None: return False if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog): return False animation_instance = TurboUIUtil.ObjectPickerDialog.get_tag_result( dialog) pre_sex_handler.set_animation_instance(animation_instance) join_sex_interaction_from_pre_sex_handler( pre_sex_handler, joining_sims_list, flip_relationship_check=flip_relationship_check) return True genders_list = list() for sim_info in pre_sex_handler.get_actors_sim_info_gen(): genders_list.append(get_sim_sex_gender(sim_info)) animations_list = get_animations_with_params( sex_category_type, pre_sex_handler.get_object_identifier(), genders_list) animations_rows = list() for animation in animations_list: animations_rows.append(animation.get_picker_row()) if len(animations_list) > 1: animations_rows.insert( 0, ChoiceListRandomAnimationPickerRow(pre_sex_handler, sex_category_type)) display_picker_list_dialog( title=get_sex_category_animations_stbl_name(sex_category_type), picker_rows=animations_rows, sim=pre_sex_handler.get_creator_sim_id(), callback=join_sex_animation_picker_callback)
def _test_for_npc_sex_change(interaction_target, sex_category_types): if not get_sex_setting(SexSetting.MANUAL_NPC_SEX_STATE, variable_type=bool): return False if interaction_target is None or not TurboTypesUtil.Sims.is_sim( interaction_target) or TurboSimUtil.Sim.is_player( interaction_target): return False active_sex_handler = sim_ev(interaction_target).active_sex_handler if active_sex_handler is None: return False if active_sex_handler.is_playing is False or not active_sex_handler.is_npc_only( ): 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)) for sex_category_type in sex_category_types: while has_animations_with_params( sex_category_type, active_sex_handler.get_object_identifier(), genders_list): return True return False
def _get_next_sex_interaction_animation(sex_handler, sims_list, ignored_animations=()): genders = list() for (_, sim_info) in sims_list: genders.append(get_sim_sex_gender(sim_info)) sex_progression_type = get_sex_setting( SexSetting.SEX_PROGRESSION_TYPE, variable_type=int ) if not sex_handler.is_npc_only() else SexProgressionLevelSetting.FULL if sex_progression_type == SexProgressionLevelSetting.RANDOM: return get_next_random_animation( sex_handler.get_object_identifier(), genders, sex_handler.get_animation_instance().get_sex_category(), allow_climax=sex_handler.is_at_climax, ignore_animations=ignored_animations) if sex_progression_type == SexProgressionLevelSetting.STAGE_ONLY: next_stage_animation = get_next_stage_animation( sex_handler.get_animation_instance()) if next_stage_animation is not None and next_stage_animation.get_sex_category( ) == SexCategoryType.CLIMAX and not sex_handler.is_at_climax: return return next_stage_animation if sex_progression_type == SexProgressionLevelSetting.FULL: next_animation = get_next_stage_animation( sex_handler.get_animation_instance()) if not (next_animation is None or next_animation is not None and (next_animation.get_sex_category() == SexCategoryType.CLIMAX and not sex_handler.is_at_climax)): return next_animation return get_next_random_animation( sex_handler.get_object_identifier(), genders, sex_handler.get_animation_instance().get_sex_category(), allow_climax=sex_handler.is_at_climax, ignore_animations=ignored_animations)
def get_random_animation(object_identifier, sims_info_list): genders = list() for sim_info in sims_info_list: genders.append(get_sim_sex_gender(sim_info)) disallowed_sex_category_types = [SexCategoryType.CLIMAX] for sex_category_type in (SexCategoryType.HANDJOB, SexCategoryType.ORALJOB, SexCategoryType.TEASING, SexCategoryType.VAGINAL, SexCategoryType.ANAL, SexCategoryType.FOOTJOB): sex_allowed = is_sim_allowed_for_animation(sims_info_list, sex_category_type) if sex_allowed: pass disallowed_sex_category_types.append(sex_category_type) animations_list = get_animations_for_object( object_identifier, genders, excluded_sex_category_types=disallowed_sex_category_types) if not animations_list: return allowed_for_random_animations_list = list() for animation in animations_list: while animation.is_allowed_for_random(): allowed_for_random_animations_list.append(animation) return random.choice(allowed_for_random_animations_list or animations_list)
def is_compatible_actor(sim_identifier, sim_actor, target_sim_identifier, target_actor): if get_sex_setting(SexSetting.SEX_GENDER_TYPE, variable_type=int) == SexGenderTypeSetting.ANY_BASED: return True swap_from_real_sex_gender = get_sim_sex_gender( sim_identifier) # MALE, FEMALE, CMALE, CFEMALE swap_from_animation_gender = sim_actor.get_gender_type() # BOTH, CBOTH swap_to_real_sex_gender = get_sim_sex_gender( target_sim_identifier) # MALE, FEMALE, CMALE, CFEMALE swap_to_animation_gender = target_actor.get_gender_type() # BOTH, CBOTH gender_sim_identifier = TurboSimUtil.Gender.get_gender(sim_identifier) gender_target_sim_identifier = TurboSimUtil.Gender.get_gender( target_sim_identifier) swap_from_is_adult = swap_from_real_sex_gender == SexGenderType.MALE or swap_from_real_sex_gender == SexGenderType.FEMALE swap_to_is_adult = swap_to_real_sex_gender == SexGenderType.MALE or swap_to_real_sex_gender == SexGenderType.FEMALE swap_from_is_child = swap_from_real_sex_gender == SexGenderType.CMALE or swap_from_real_sex_gender == SexGenderType.CFEMALE swap_to_is_child = swap_to_real_sex_gender == SexGenderType.CMALE or swap_to_real_sex_gender == SexGenderType.CFEMALE if swap_from_animation_gender == swap_to_animation_gender or swap_from_real_sex_gender == swap_to_real_sex_gender or ( gender_sim_identifier == gender_target_sim_identifier and swap_from_is_adult and swap_to_is_adult): return True swap_from_is_both = swap_from_animation_gender == SexGenderType.BOTH and swap_from_is_adult swap_to_is_both = swap_to_animation_gender == SexGenderType.BOTH and swap_to_is_adult swap_from_is_cboth = swap_from_animation_gender == SexGenderType.CBOTH and swap_from_is_child swap_to_is_cboth = swap_to_animation_gender == SexGenderType.CBOTH and swap_to_is_child # SAME GENDER # DIFFERENT GENDER, SAME AGE # DIFFERENT GENDER, DIFFERENT AGE # Adult, Child or Adult, Child if swap_from_is_child != swap_to_is_child or swap_from_is_adult != swap_to_is_adult: return False # BOTH, BOTH or CBOTH, CBOTH if (swap_from_is_both and swap_to_is_both) or (swap_from_is_cboth and swap_to_is_cboth): return True # FEMALE, FEMALE or MALE, MALE or CFEMALE, CFEMALE or CMALE, CMALE if swap_from_real_sex_gender == swap_to_real_sex_gender: return True # Implied from is adult, to is adult if swap_from_is_both and swap_to_is_adult: return True # Implied from is child, to is child if swap_from_is_cboth and swap_to_is_child: return True # Implied to is adult, from is adult if swap_to_is_both and swap_from_is_adult: return True # Implied to is child, from is child if swap_to_is_cboth and swap_from_is_child: return True return False
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)