Exemplo n.º 1
0
def _wickedwhims_increase_sim_nudity_skill_on_related_interactions(interaction_instance):
    if not get_nudity_setting(NuditySetting.NUDITY_SWITCH_STATE, variable_type=bool):
        return
    interaction_guid = TurboResourceUtil.Resource.get_guid64(interaction_instance)
    sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
    for (interaction_id, direct_target, skill_points) in NUDE_REWARD_INTERACTION_IDS:
        if interaction_id != interaction_guid:
            continue
        if direct_target is True:
            target_sim = TurboInteractionUtil.get_interaction_target(interaction_instance) or sim
            if target_sim is None:
                target_sim = sim
        else:
            target_sim = sim
        if target_sim is None:
            return
        sim_info = TurboManagerUtil.Sim.get_sim_info(target_sim)
        if sim_info is None:
            return
        target_outfit_level = get_sim_outfit_level(target_sim)
        target_nudity_skill_level = get_sim_nudity_skill_level(target_sim)
        if target_outfit_level == OutfitLevel.NUDE or target_outfit_level == OutfitLevel.BATHING:
            increase_sim_nudity_skill(target_sim, skill_points, extra_fatigue=2.0)
        else:
            if target_outfit_level == OutfitLevel.REVEALING or target_outfit_level == OutfitLevel.UNDERWEAR:
                increase_sim_nudity_skill(target_sim, skill_points/target_nudity_skill_level, extra_fatigue=2.0)
Exemplo n.º 2
0
def _wickedwhims_on_kiss_interactions_outcome(interaction_instance, outcome_result):
    if outcome_result:
        interaction_guid = TurboResourceUtil.Resource.get_guid64(interaction_instance)
        if interaction_guid in SIM_KISS_INTERACTIONS:
            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 not None and (has_sim_trait(target_sim_info, SimTrait.WW_CUMSLUT) or has_sim_trait(target_sim_info, SimTrait.SLOB)):
                if has_sim_cas_part_id(sim_info, CUM_FACE_LAYER):
                    apply_sim_cum_layer(target_sim_info, (CumLayerType.FACE,))
Exemplo n.º 3
0
def _wickedwhims_block_sim_interaction_queue_during_sex(interaction_instance):
    interaction_guid = TurboResourceUtil.Resource.get_guid64(
        interaction_instance)
    sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
    target = TurboInteractionUtil.get_interaction_target(
        interaction_instance) if TurboTypesUtil.Sims.is_sim(
            TurboInteractionUtil.get_interaction_target(
                interaction_instance)) else None
    if _block_sim_interactions_during_sex(
            sim,
            interaction_guid) is False or _block_sim_interactions_during_sex(
                target, interaction_guid) is False:
        return False
    return True
Exemplo n.º 4
0
 def on_interaction_start(cls, interaction_instance):
     sim = cls.get_interaction_sim(interaction_instance)
     pre_sex_handler = sim_ev(sim).active_pre_sex_handler
     sim_ev(sim).is_ready_to_sex = True
     if pre_sex_handler is None:
         clear_sim_sex_extra_data(sim, only_pre_active_data=True)
         unprepare_npc_sim_from_sex(sim)
         return False
     if not _attempt_sex_init(pre_sex_handler):
         result = TurboSimUtil.Interaction.push_affordance(
             sim,
             SimInteraction.WW_WAIT_FOR_SEX_PARTNER,
             insert_strategy=TurboInteractionUtil.QueueInsertStrategy.FIRST,
             run_priority=TurboInteractionUtil.Priority.Critical,
             priority=TurboInteractionUtil.Priority.Critical,
             skip_if_running=True)
         if result:
             sim_ev(
                 sim
             ).in_sex_process_interaction = TurboInteractionUtil.get_interaction_from_enqueue_result(
                 result)
         cls.cancel_interaction(
             interaction_instance,
             finishing_type=TurboInteractionUtil.FinishingType.NATURAL)
     else:
         interaction_instance.has_proceeded = True
Exemplo n.º 5
0
def _wickedwhims_undress_bottom_on_toilet_use(interaction_instance):
    global HAS_SIMS_USING_TOILET
    if not get_nudity_setting(NuditySetting.TOILET_USE_UNDRESS_STATE, variable_type=bool):
        return
    interaction_guid = TurboResourceUtil.Resource.get_guid64(interaction_instance)
    if interaction_guid not in TOILET_USE_INTERACTIONS:
        return
    HAS_SIMS_USING_TOILET = True
    sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
    if sim_ev(sim).on_toilet_outfit_state != OutfitStateBeforeToiletUse.NONE:
        return
    if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.CHILD):
        return
    if has_sim_outfit_bottom(sim):
        bottom_body_state = get_sim_body_state(sim, 7)
        if bottom_body_state != BodyState.NUDE:
            strip_result = strip_outfit(sim, strip_type_bottom=StripType.NUDE, allow_stripping_feet=False)
            if strip_result is True:
                sim_ev(sim).on_toilet_outfit_state = int(OutfitStateBeforeToiletUse.UNDERWEAR if bottom_body_state == BodyState.UNDERWEAR else OutfitStateBeforeToiletUse.OUTFIT)
                set_sim_bottom_naked_state(sim, True)
                set_sim_bottom_underwear_state(sim, False)
            else:
                sim_ev(sim).on_toilet_outfit_state = int(OutfitStateBeforeToiletUse.NONE)
    else:
        top_state = StripType.NUDE if TurboSimUtil.Gender.is_male(sim) else StripType.UNDERWEAR if is_sim_top_underwear(sim) else StripType.NUDE
        strip_result = strip_outfit(sim, strip_type_top=top_state, strip_type_bottom=StripType.NUDE)
        if is_sim_outfit_fullbody(sim) and strip_result is True:
            sim_ev(sim).on_toilet_outfit_state = int(OutfitStateBeforeToiletUse.OUTFIT)
            set_sim_top_naked_state(sim, True)
            set_sim_bottom_naked_state(sim, True)
            set_sim_bottom_underwear_state(sim, False)
Exemplo n.º 6
0
def _cum_reaction(sim, target, only_mixer=False):
    si_result = TurboSimUtil.Interaction.push_affordance(
        sim,
        SimInteraction.WW_SEX_CUM_REACTION,
        target=target,
        interaction_context=TurboInteractionUtil.InteractionContext.
        SOURCE_SCRIPT,
        insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT
    ) if only_mixer is False else None
    if not si_result and (
            si_result is None or
            TurboInteractionUtil.can_interaction_fallback_to_mixer_interaction(
                sim, si_result.execute_result.interaction)):
        si_result = TurboSimUtil.Interaction.push_affordance(
            sim,
            SimInteraction.WW_SEX_CUM_REACTION_MIXER,
            target=target,
            interaction_context=TurboInteractionUtil.InteractionContext.
            SOURCE_REACTION,
            insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT)
    if si_result:
        cooldown_offset = random.randint(-1, 2)
        sim_ev(sim).full_cum_reaction_cooldown = 12 + cooldown_offset
        sim_ev(sim).inner_cum_reaction_cooldown = 6 + cooldown_offset
        return True
    return False
def _start_solo_sex_interaction(pre_sex_handler):
    creator_sim = TurboManagerUtil.Sim.get_sim_instance(
        pre_sex_handler.get_creator_sim_id())
    if creator_sim is None:
        clear_sim_sex_extra_data(
            TurboManagerUtil.Sim.get_sim_info(
                pre_sex_handler.get_creator_sim_id()))
        return False
    sim_ev(creator_sim).is_in_process_to_sex = True
    for interaction_id in TurboSimUtil.Interaction.get_queued_interactions_ids(
            creator_sim):
        TurboSimUtil.Interaction.cancel_queued_interaction(
            creator_sim, interaction_id)
    TurboSimUtil.Interaction.unlock_queue(creator_sim)
    TurboSimUtil.Routing.refresh_portals(creator_sim)
    result = TurboSimUtil.Interaction.push_affordance(
        creator_sim,
        SimInteraction.WW_ROUTE_TO_SEX_LOCATION,
        insert_strategy=TurboInteractionUtil.QueueInsertStrategy.FIRST,
        run_priority=TurboInteractionUtil.Priority.Critical,
        priority=TurboInteractionUtil.Priority.Critical)
    if result:
        sim_ev(
            creator_sim
        ).in_sex_process_interaction = TurboInteractionUtil.get_interaction_from_enqueue_result(
            result)
    return bool(result)
Exemplo n.º 8
0
 def on_interaction_asm_setup(cls, interaction_instance, interaction_asm):
     sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
     active_sex_handler = sim_ev(sim).active_sex_handler
     if active_sex_handler is None:
         cls.cancel_interaction(
             interaction_instance,
             finishing_type=TurboInteractionUtil.FinishingType.NATURAL)
         display_notification(text='Missing Active Sex Handler Instance!',
                              title='WickedWhims Error',
                              secondary_icon=sim,
                              is_safe=True)
         return False
     if TurboManagerUtil.Sim.get_sim_id(
             sim) != active_sex_handler.get_creator_sim_id():
         return True
     game_object_target = TurboObjectUtil.GameObject.get_object_with_id(
         active_sex_handler.get_game_object_id())
     actors_list = active_sex_handler.get_sims_list()
     for i in range(len(actors_list)):
         actor_id = actors_list[i][0]
         actor_sim = TurboManagerUtil.Sim.get_sim_instance(
             actors_list[i][1])
         interaction_asm.set_parameter(
             'animation_name_a' + str(i),
             active_sex_handler.get_actor_animation_clip_name(actor_id))
         interaction_asm.set_actor('a' + str(i), actor_sim)
     if game_object_target is not None:
         interaction_asm.set_parameter(
             'object_animation_name',
             active_sex_handler.get_animation_instance().
             get_object_animation_clip_name())
         interaction_asm.set_actor('o', game_object_target)
     interaction_asm.enter()
     return True
Exemplo n.º 9
0
 def _wickedwhims_debug_interaction_run_event(interaction_instance):
     sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
     interaction_guid = TurboResourceUtil.Resource.get_guid64(
         interaction_instance)
     display_notification(text='ID: ' + str(interaction_guid) + '\nData: ' +
                          interaction_instance.__class__.__name__.lower(),
                          title='Interaction Run',
                          secondary_icon=sim)
Exemplo n.º 10
0
def _wickedwhims_special_additional_los_test(privacy_instance, tested_sim):
    privacy_interaction = TurboPrivacyUtil.get_privacy_interaction(privacy_instance)
    if TurboResourceUtil.Resource.get_guid64(privacy_interaction) == SimInteraction.WW_MIRROR_ADMIRE_YOUR_BODY:
        sim = TurboInteractionUtil.get_interaction_sim(privacy_interaction)
        line_of_sight = TurboMathUtil.LineOfSight.create(TurboSimUtil.Location.get_routing_surface(sim), TurboSimUtil.Location.get_position(sim), 10.0)
        if not TurboPrivacyUtil.is_sim_allowed_by_privacy(tested_sim, privacy_instance) and TurboMathUtil.LineOfSight.test(line_of_sight, TurboSimUtil.Location.get_position(tested_sim)):
            return PrivacyResult.BLOCK
        return PrivacyResult.ALLOW
    return PrivacyResult.DEFAULT
def _nudity_reaction(sim, target, only_mixer=False, force=False):
    increase_sim_ww_statistic(sim, 'times_reacted_to_nudity')
    increase_sim_ww_statistic(target, 'times_been_seen_nude')
    if _is_positive_to_sim_nudity(sim, target):
        positive_reaction_affordance = random.choice(
            (SimInteraction.WW_NUDITY_REACTION_POSITIVE_1,
             SimInteraction.WW_NUDITY_REACTION_POSITIVE_2,
             SimInteraction.WW_NUDITY_REACTION_POSITIVE_3))
        si_result = TurboSimUtil.Interaction.push_affordance(
            sim,
            positive_reaction_affordance,
            target=target,
            interaction_context=TurboInteractionUtil.InteractionContext.
            SOURCE_SCRIPT,
            insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT if
            force is False else TurboInteractionUtil.QueueInsertStrategy.FIRST,
            priority=TurboInteractionUtil.Priority.High
            if force is False else TurboInteractionUtil.Priority.Critical,
            run_priority=TurboInteractionUtil.Priority.High
            if force is False else TurboInteractionUtil.Priority.Critical
        ) if only_mixer is False else None
    else:
        si_result = TurboSimUtil.Interaction.push_affordance(
            sim,
            SimInteraction.WW_NUDITY_REACTION_SHOCK,
            target=target,
            interaction_context=TurboInteractionUtil.InteractionContext.
            SOURCE_SCRIPT,
            insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT if
            force is False else TurboInteractionUtil.QueueInsertStrategy.FIRST,
            priority=TurboInteractionUtil.Priority.High
            if force is False else TurboInteractionUtil.Priority.Critical,
            run_priority=TurboInteractionUtil.Priority.High
            if force is False else TurboInteractionUtil.Priority.Critical
        ) if only_mixer is False else None
    if not si_result and (
            si_result is None or
            TurboInteractionUtil.can_interaction_fallback_to_mixer_interaction(
                sim, si_result.execute_result.interaction)):
        si_result = TurboSimUtil.Interaction.push_affordance(
            sim,
            SimInteraction.WW_NUDITY_REACTION_MIXER,
            target=target,
            interaction_context=TurboInteractionUtil.InteractionContext.
            SOURCE_REACTION,
            insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT)
    if si_result:
        if TurboSimUtil.Age.get_age(sim) == TurboSimUtil.Age.CHILD:
            add_sim_buff(sim, SimBuff.PRIVACY_EMBARRASSED)
        cooldown_offset = random.randint(-1, 2)
        sim_ev(sim).full_nudity_reaction_cooldown = 12 + cooldown_offset
        sim_ev(sim).inner_nudity_reaction_cooldown = 6 + cooldown_offset
        set_sim_penis_state(sim, True, 8, set_if_nude=True)
        return True
    return False
Exemplo n.º 12
0
 def get_interaction_name(cls, interaction_instance):
     sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
     active_sex_handler = sim_ev(sim).active_sex_handler
     if active_sex_handler is None:
         return TurboL18NUtil.get_localized_string(2175203501)
     return TurboL18NUtil.get_localized_string(
         2667173688,
         tokens=(
             active_sex_handler.get_animation_instance().get_display_name(
                 string_hash=True),
             active_sex_handler.get_animation_instance().get_author()))
Exemplo n.º 13
0
def _wickedwhims_reset_sex_handler_on_sim_stand_posture(interaction_instance):
    interaction_guid = TurboResourceUtil.Resource.get_guid64(
        interaction_instance)
    if interaction_guid == SimInteraction.SIM_STAND:
        sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
        if sim_ev(sim).is_ready() and sim_ev(
                sim).active_sex_handler is not None and sim_ev(
                    sim).active_sex_handler.is_playing is True:
            sim_ev(sim).active_sex_handler.stop(
                hard_stop=True,
                is_end=True,
                stop_reason='On Sim stand posture!')
Exemplo n.º 14
0
def _wickedwhims_is_sim_allowed_for_nudity(privacy_instance, tested_sim):
    if get_nudity_setting(NuditySetting.NUDITY_PRIVACY, variable_type=bool) or TurboResourceUtil.Resource.get_guid64(TurboPrivacyUtil.get_privacy_interaction(privacy_instance)) in PRIVACY_NUDE_INTERACTIONS:
        return PrivacyResult.ALLOW
    if get_nudity_setting(NuditySetting.NUDITY_SWITCH_STATE, variable_type=bool):
        privacy_interaction = TurboPrivacyUtil.get_privacy_interaction(privacy_instance)
        if TurboResourceUtil.Resource.get_guid64(privacy_interaction) in PRIVACY_NUDE_INTERACTIONS:
            (sim_has_permission, _) = has_sim_permission_for_nudity(TurboInteractionUtil.get_interaction_sim(privacy_interaction), ignore_location_test=True, targets=(tested_sim,))
            if sim_has_permission is True:
                (target_has_permission, _) = has_sim_permission_for_nudity(tested_sim, ignore_location_test=True, targets=(TurboInteractionUtil.get_interaction_sim(privacy_interaction),))
                if target_has_permission is True:
                    return PrivacyResult.ALLOW
    return PrivacyResult.DEFAULT
def _wickedwhims_on_basemental_drugs_use_interaction(interaction_instance):
    if not get_sex_setting(SexSetting.MISCARRIAGE_SWITCH, variable_type=bool):
        return
    if not is_basemental_drugs_installed():
        return
    sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
    if not can_sim_get_pregnant(
            sim) and not TurboSimUtil.Pregnancy.is_pregnant(sim):
        return
    interaction_guid = TurboResourceUtil.Resource.get_guid64(
        interaction_instance)
    for (interaction_id, miscarriage_value) in DRUGS_INTERACTIONS:
        while interaction_guid == interaction_id:
            break
Exemplo n.º 16
0
def route_sim_away_from_interaction(source_interaction, target_sim):
    embarrassed_affordance = TurboResourceUtil.Services.get_instance(
        TurboResourceUtil.ResourceTypes.INTERACTION,
        SimInteraction.STAND_PASSIVE)
    privacy = Privacy(source_interaction, (), (), 8, 30, 0.35, 0.01, 0.1,
                      False, None, None, embarrassed_affordance, None)
    for sim in TurboManagerUtil.Sim.get_all_sim_instance_gen(humans=True,
                                                             pets=False):
        privacy.add_exempt_sim(sim)
    privacy.build_privacy(
        target=TurboInteractionUtil.get_interaction_target(source_interaction))
    privacy.remove_privacy()
    result = privacy._route_sim_away(target_sim)
    return bool(result)
Exemplo n.º 17
0
def _wickedwhims_strip_clothing_while_admiring_your_body(interaction_instance):
    interaction_guid = TurboResourceUtil.Resource.get_guid64(interaction_instance)
    if interaction_guid in ADMIRE_YOUR_BODY_AFFORDANCES:
        sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
        skill_level = get_sim_nudity_skill_level(sim)
        strip_nude = skill_level >= 3 or skill_level == 2 and TurboWorldUtil.Lot.is_sim_on_home_lot(sim)
        if strip_nude is True:
            strip_result = strip_outfit(sim, strip_type_top=StripType.NUDE, strip_type_bottom=StripType.NUDE, save_original=False)
            set_sim_top_naked_state(sim, True)
            set_sim_bottom_naked_state(sim, True)
            set_sim_top_underwear_state(sim, False)
            set_sim_bottom_underwear_state(sim, False)
        else:
            if not TurboSimUtil.CAS.has_outfit(sim, (TurboCASUtil.OutfitCategory.SWIMWEAR, 0)):
                TurboSimUtil.CAS.generate_outfit(sim, (TurboCASUtil.OutfitCategory.SWIMWEAR, 0))
            TurboSimUtil.CAS.set_current_outfit(sim, (TurboCASUtil.OutfitCategory.SWIMWEAR, 0))
Exemplo n.º 18
0
def _wickedwhims_clean_cum_on_hygiene_interactions(interaction_instance):
    interaction_guid = TurboResourceUtil.Resource.get_guid64(interaction_instance)
    sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
    if interaction_guid in SIM_CLEAN_FULL_INTERACTIONS:
        clean_sim_cum_layers(sim)
        return
    if interaction_guid in SIM_CLEAN_VAGINA_INTERACTIONS:
        clean_sim_cum_layers(sim, layers_to_clean=(CumLayerType.V****A,))
        return
    if interaction_guid in SIM_CLEAN_BUTT_INTERACTIONS:
        clean_sim_cum_layers(sim, layers_to_clean=(CumLayerType.V****A, CumLayerType.BUTT))
        return
    if interaction_guid in SIM_CLEAN_FACE_INTERACTIONS:
        clean_sim_cum_layers(sim, layers_to_clean=(CumLayerType.FACE,))
        return
    if TurboTypesUtil.Interactions.is_npc_leave_lot_interaction(interaction_instance):
        clean_sim_cum_layers(sim)
        return
Exemplo n.º 19
0
 def on_interaction_cancel(cls, interaction_instance, finishing_type):
     sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
     if finishing_type == TurboInteractionUtil.FinishingType.USER_CANCEL:
         if sim_ev(sim).active_sex_handler is not None:
             sim_ev(sim).active_sex_handler.is_canceled = True
             sim_ev(sim).active_sex_handler.stop(
                 is_end=True,
                 stop_reason='On interaction cancel: ' +
                 finishing_type.name)
         else:
             TurboSimUtil.Sim.reset_sim(sim, hard_reset_on_exception=True)
     elif finishing_type == TurboInteractionUtil.FinishingType.NATURAL and sim_ev(
             sim).active_sex_handler is not None:
         if sim_ev(sim).active_sex_handler.is_canceled is True:
             sim_ev(sim).active_sex_handler.stop(
                 is_end=True,
                 stop_reason='On interaction cancel: ' +
                 finishing_type.name)
Exemplo n.º 20
0
def _wickedwhims_undress_top_on_breast_feeding(interaction_instance):
    if not get_nudity_setting(NuditySetting.BREAST_FEEDING_UNDRESS_STATE,
                              variable_type=bool):
        return
    interaction_guid = TurboResourceUtil.Resource.get_guid64(
        interaction_instance)
    if interaction_guid != BREAST_FEEDING_INTERACTIONS:
        return
    sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
    if sim_ev(
            sim
    ).on_breast_feeding_outfit_state != OutfitStateBeforeBreastFeeding.NONE:
        return
    if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.CHILD):
        return
    if has_sim_outfit_top(sim):
        top_body_state = get_sim_body_state(sim, 6)
        if top_body_state != BodyState.NUDE:
            strip_result = strip_outfit(sim,
                                        strip_type_top=StripType.NUDE,
                                        allow_stripping_gloves=False)
            if strip_result is True:
                sim_ev(sim).on_breast_feeding_outfit_state = int(
                    OutfitStateBeforeBreastFeeding.
                    UNDERWEAR if top_body_state == BodyState.
                    UNDERWEAR else OutfitStateBeforeBreastFeeding.OUTFIT)
                set_sim_top_naked_state(sim, True)
                set_sim_top_underwear_state(sim, False)
            else:
                sim_ev(sim).on_breast_feeding_outfit_state = int(
                    OutfitStateBeforeBreastFeeding.NONE)
    else:
        bottom_state = StripType.UNDERWEAR if is_sim_bottom_underwear(
            sim) else StripType.NUDE
        strip_result = strip_outfit(sim,
                                    strip_type_top=StripType.NUDE,
                                    strip_type_bottom=bottom_state)
        if is_sim_outfit_fullbody(sim) and strip_result is True:
            sim_ev(sim).on_breast_feeding_outfit_state = int(
                OutfitStateBeforeBreastFeeding.OUTFIT)
            set_sim_top_naked_state(sim, True)
            set_sim_top_underwear_state(sim, False)
            set_sim_bottom_naked_state(sim, True)
def _join_sex_interaction_from_pre_handler(pre_sex_handler, join_sims_list):
    creator_sim_info = TurboManagerUtil.Sim.get_sim_info(
        pre_sex_handler.get_creator_sim_id())
    sim_ev(creator_sim_info).active_sex_handler.has_joining_sims = True
    for sim_info in pre_sex_handler.get_actors_sim_info_gen():
        sim_ev(sim_info).active_pre_sex_handler = pre_sex_handler
        while sim_ev(sim_info).active_sex_handler is not None:
            sim_ev(sim_info).is_ready_to_sex = True
    is_instant = get_sex_setting(
        SexSetting.ALWAYS_ACCEPT_STATE,
        variable_type=bool) and get_sex_setting(
            SexSetting.SEX_INITIATION_TYPE,
            variable_type=int) == SexInitiationTypeSetting.INSTANT_TELEPORT
    for join_sim_info in join_sims_list:
        join_sim_info = TurboManagerUtil.Sim.get_sim_info(join_sim_info)
        prepare_npc_sim_to_sex(join_sim_info)
        while is_instant is False:
            sim_ev(join_sim_info).is_in_process_to_sex = True
            TurboSimUtil.Interaction.unlock_queue(join_sim_info)
            TurboSimUtil.Routing.refresh_portals(join_sim_info)
            result = TurboSimUtil.Interaction.push_affordance(
                join_sim_info,
                SimInteraction.WW_ROUTE_TO_SEX_LOCATION,
                insert_strategy=TurboInteractionUtil.QueueInsertStrategy.FIRST,
                priority=TurboInteractionUtil.Priority.Critical,
                run_priority=TurboInteractionUtil.Priority.Critical)
            if result:
                sim_ev(
                    join_sim_info
                ).in_sex_process_interaction = TurboInteractionUtil.get_interaction_from_enqueue_result(
                    result)
    if is_instant is True:
        sim_ev(creator_sim_info).active_sex_handler.stop(
            hard_stop=True,
            no_teleport=True,
            is_joining_stop=True,
            stop_reason='On join interaction!')
        pre_sex_handler.start_sex_interaction()
def update_sim_to_route_for_sex(sim):
    if sim_ev(sim).is_in_process_to_sex is True:
        if sim_ev(sim).active_pre_sex_handler is not None:
            TurboSimUtil.Interaction.unlock_queue(sim)
            TurboSimUtil.Routing.refresh_portals(sim)
            result = TurboSimUtil.Interaction.push_affordance(
                sim,
                SimInteraction.WW_ROUTE_TO_SEX_LOCATION,
                insert_strategy=TurboInteractionUtil.QueueInsertStrategy.FIRST,
                priority=TurboInteractionUtil.Priority.Critical,
                run_priority=TurboInteractionUtil.Priority.Critical,
                skip_if_running=True)
            if result:
                sim_ev(
                    sim
                ).in_sex_process_interaction = TurboInteractionUtil.get_interaction_from_enqueue_result(
                    result)
            else:
                clear_sim_sex_extra_data(sim, only_pre_active_data=True)
                unprepare_npc_sim_from_sex(sim)
        else:
            clear_sim_sex_extra_data(sim, only_pre_active_data=True)
            unprepare_npc_sim_from_sex(sim)
Exemplo n.º 23
0
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)
Exemplo n.º 25
0
def _wickedwhims_flag_on_nudity_skill_mirror_use(interaction_instance):
    interaction_guid = TurboResourceUtil.Resource.get_guid64(
        interaction_instance)
    if interaction_guid == SimInteraction.WW_MIRROR_ADMIRE_YOUR_BODY:
        sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
        sim_ev(sim).is_running_mirror_nudity_skill_interaction = True
Exemplo n.º 26
0
def _wickedwhims_undress_swimwear_on_jumping_to_water(interaction_instance):
    if not get_nudity_setting(NuditySetting.NUDITY_SWITCH_STATE,
                              variable_type=bool):
        return
    interaction_guid = TurboResourceUtil.Resource.get_guid64(
        interaction_instance)
    if interaction_guid not in JUMPING_INTERACTIONS:
        return
    sim_info = TurboManagerUtil.Sim.get_sim_info(
        TurboInteractionUtil.get_interaction_sim(interaction_instance))
    if TurboSimUtil.Age.is_younger_than(sim_info, TurboSimUtil.Age.CHILD):
        return
    if get_modified_outfit(
            sim_info)[0] != TurboCASUtil.OutfitCategory.SWIMWEAR:
        return
    if is_sim_outfit_fullbody(sim_info):
        return
    if random.uniform(0, 1) > 0.1:
        return
    has_stripped = False
    if TurboSimUtil.Gender.is_male(sim_info):
        if get_sim_body_state(sim_info, 7) != BodyState.OUTFIT:
            return
        strip_result = strip_outfit(sim_info, strip_type_bottom=StripType.NUDE)
        if strip_result is True:
            set_sim_bottom_naked_state(sim_info, True)
            has_stripped = True
    else:
        can_undress_top = get_sim_body_state(sim_info, 6) == BodyState.OUTFIT
        can_undress_bottom = get_sim_body_state(sim_info,
                                                7) == BodyState.OUTFIT
        undress_top = False
        undress_bottom = False
        if can_undress_top is True and can_undress_bottom is True:
            if bool(random.getrandbits(1)):
                undress_top = True
            else:
                undress_bottom = True
        elif can_undress_top is True:
            undress_top = True
        elif can_undress_bottom is True:
            undress_bottom = True
        if undress_top is False and undress_bottom is False:
            return
        if undress_top is True:
            strip_result = strip_outfit(sim_info,
                                        strip_type_top=StripType.NUDE)
            if strip_result is True:
                set_sim_top_naked_state(sim_info, True)
                has_stripped = True
        elif undress_bottom is True:
            strip_result = strip_outfit(sim_info,
                                        strip_type_bottom=StripType.NUDE)
            if strip_result is True:
                set_sim_bottom_naked_state(sim_info, True)
                has_stripped = True
    if has_stripped is True:
        display_notification(text=267480274,
                             text_tokens=(sim_info, ),
                             secondary_icon=sim_info)
        if not has_sim_permission_for_nudity(sim_info)[0]:
            add_sim_buff(sim_info,
                         SimBuff.OBJECT_JUMPSTAND_SWIMSUITMALFUNCTION)
        if random.uniform(0, 1) <= 0.45:
            add_sim_buff(sim_info, SimBuff.WW_NUDITY_TEMPORARY_BRAVE)