Example #1
0
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 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
Example #4
0
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
Example #5
0
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
Example #6
0
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 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)