예제 #1
0
def update_nude_body_data(sim_identifier, force_update=False):
    sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier)
    if TurboSimUtil.Age.is_younger_than(sim_info, TurboSimUtil.Age.CHILD):
        return
    if has_sim_trait(sim_info, SimTrait.GENDEROPTIONS_TOILET_STANDING):
        from wickedwhims.sxex_bridge.penis import get_penis_soft_cas_id, get_penis_soft_texture_cas_id, get_penis_hard_cas_id, get_penis_hard_texture_cas_id
        sim_ev(sim_info).penis_outfit_parts['soft'] = get_penis_soft_cas_id(sim_info)
        sim_ev(sim_info).penis_outfit_parts['soft_texture'] = get_penis_soft_texture_cas_id(sim_info)
        sim_ev(sim_info).penis_outfit_parts['hard'] = get_penis_hard_cas_id(sim_info)
        sim_ev(sim_info).penis_outfit_parts['hard_texture'] = get_penis_hard_texture_cas_id(sim_info)
    from wickedwhims.nudity.nudity_settings import NuditySetting, get_nudity_setting
    if sim_ev(sim_info).nude_outfit_parts[TurboCASUtil.BodyType.UPPER_BODY] == -1 or force_update is True:
        if get_nudity_setting(NuditySetting.NUDITY_ASSURANCE_STATE, variable_type=bool):
            top_body_part_cas_id = get_default_nude_cas_part_id(sim_info, TurboCASUtil.BodyType.UPPER_BODY)
        else:
            top_body_part_cas_id = get_sim_outfit_cas_part_from_bodytype(sim_info, TurboCASUtil.BodyType.UPPER_BODY, outfit_category_and_index=(TurboCASUtil.OutfitCategory.BATHING, 0))
        sim_ev(sim_info).nude_outfit_parts[TurboCASUtil.BodyType.UPPER_BODY] = top_body_part_cas_id
    if sim_ev(sim_info).nude_outfit_parts[TurboCASUtil.BodyType.LOWER_BODY] == -1 or force_update is True:
        if has_sim_trait(sim_info, SimTrait.GENDEROPTIONS_TOILET_STANDING):
            sim_ev(sim_info).nude_outfit_parts[TurboCASUtil.BodyType.LOWER_BODY] = sim_ev(sim_info).penis_outfit_parts['hard'] if sim_ev(sim_info).is_penis_hard is True else sim_ev(sim_info).penis_outfit_parts['soft']
        else:
            if get_nudity_setting(NuditySetting.NUDITY_ASSURANCE_STATE, variable_type=bool):
                bottom_body_part_cas_id = get_default_nude_cas_part_id(sim_info, TurboCASUtil.BodyType.LOWER_BODY)
            else:
                bottom_body_part_cas_id = get_sim_outfit_cas_part_from_bodytype(sim_info, TurboCASUtil.BodyType.LOWER_BODY, outfit_category_and_index=(TurboCASUtil.OutfitCategory.BATHING, 0))
            sim_ev(sim_info).nude_outfit_parts[TurboCASUtil.BodyType.LOWER_BODY] = bottom_body_part_cas_id
    if sim_ev(sim_info).nude_outfit_parts[TurboCASUtil.BodyType.SHOES] == -1 or force_update is True:
        if get_nudity_setting(NuditySetting.NUDITY_ASSURANCE_STATE, variable_type=bool):
            feet_body_part_cas_id = get_default_nude_cas_part_id(sim_info, TurboCASUtil.BodyType.SHOES)
        else:
            feet_body_part_cas_id = get_sim_outfit_cas_part_from_bodytype(sim_info, TurboCASUtil.BodyType.SHOES, outfit_category_and_index=(TurboCASUtil.OutfitCategory.BATHING, 0))
        sim_ev(sim_info).nude_outfit_parts[TurboCASUtil.BodyType.SHOES] = feet_body_part_cas_id
    if (sim_ev(sim_info).nude_outfit_parts[115] == -1 or force_update is True) and has_sim_trait(sim_info, SimTrait.GENDEROPTIONS_TOILET_STANDING):
        sim_ev(sim_info).nude_outfit_parts[115] = sim_ev(sim_info).penis_outfit_parts['hard_texture'] if sim_ev(sim_info).is_penis_hard is True else sim_ev(sim_info).penis_outfit_parts['soft_texture']
def _is_sim_on_birth_control(sim_identifier):
    if get_sex_setting(SexSetting.BIRTH_CONTROL_MODE,
                       variable_type=int) == BirthControlModeSetting.PERFECT:
        if has_sim_trait(sim_identifier,
                         SimTrait.GENDEROPTIONS_PREGNANCY_CANIMPREGNATE
                         ) and sim_ev(sim_identifier).has_condom_on is True:
            return True
        if has_sim_trait(
                sim_identifier,
                SimTrait.GENDEROPTIONS_PREGNANCY_CANBEIMPREGNATED
        ) and sim_ev(
                sim_identifier
        ).day_used_birth_control_pills == TurboWorldUtil.Time.get_absolute_days(
        ):
            return True
        return False
    if get_sex_setting(SexSetting.BIRTH_CONTROL_MODE,
                       variable_type=int) == BirthControlModeSetting.REALISTIC:
        random_inst = random.Random(
            (TurboWorldUtil.Time.get_absolute_days() +
             TurboWorldUtil.Time.get_absolute_hours()) * 768)
        if has_sim_trait(sim_identifier,
                         SimTrait.GENDEROPTIONS_PREGNANCY_CANIMPREGNATE
                         ) and sim_ev(sim_identifier).has_condom_on is True:
            return random_inst.uniform(0, 1) < 0.95
        if has_sim_trait(
                sim_identifier,
                SimTrait.GENDEROPTIONS_PREGNANCY_CANBEIMPREGNATED
        ) and sim_ev(
                sim_identifier
        ).day_used_birth_control_pills == TurboWorldUtil.Time.get_absolute_days(
        ):
            return random_inst.uniform(0, 1) < 0.91
        return False
    return False
예제 #3
0
def _can_sim_receive_cum(interaction_sim, interaction_target, cum_type):
    if interaction_target is None or not TurboTypesUtil.Sims.is_sim(interaction_target):
        return False
    if not get_sex_setting(SexSetting.MANUAL_NPC_SEX_STATE, variable_type=bool):
        if sim_ev(interaction_sim).active_sex_handler is None:
            return False
        if sim_ev(interaction_sim).active_sex_handler is not sim_ev(interaction_target).active_sex_handler:
            return False
    elif sim_ev(interaction_target).active_sex_handler is None:
        return False
    active_sex_handler = sim_ev(interaction_target).active_sex_handler
    if active_sex_handler.is_at_climax is False:
        return False
    if cum_type == CumLayerType.V****A and has_sim_trait(interaction_target, SimTrait.GENDEROPTIONS_TOILET_STANDING):
        return False
    has_sim_that_can_cum = False
    for actor_sim_info in active_sex_handler.get_actors_sim_info_gen():
        if TurboManagerUtil.Sim.get_sim_id(actor_sim_info) == TurboManagerUtil.Sim.get_sim_id(interaction_target):
            pass
        if not has_sim_trait(actor_sim_info, SimTrait.GENDEROPTIONS_TOILET_STANDING):
            pass
        has_sim_that_can_cum = True
        break
    if has_sim_that_can_cum is False:
        return False
    if has_sim_cas_part_id(interaction_target, get_cum_layer_cas_id(cum_type)):
        return False
    return True
예제 #4
0
def _is_sim_needs_fine(sim_identifier):
    sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier)
    is_sim_vampire = has_sim_trait(sim_info, SimTrait.OCCULTVAMPIRE)
    is_sim_plant = has_sim_trait(sim_info, SimTrait.PLANTSIM)
    is_sim_normal = not is_sim_vampire and not is_sim_plant
    hygiene_motive = get_sim_motive_value(sim_info, SimMotive.HYGIENE)
    if hygiene_motive < -89:
        return False
    if is_sim_normal is True:
        bladder_motive = get_sim_motive_value(sim_info, SimMotive.BLADDER)
        if bladder_motive < -59:
            return False
    if is_sim_normal or is_sim_plant:
        hunger_motive = get_sim_motive_value(sim_info, SimMotive.HUNGER)
        if hunger_motive < -59:
            return False
    if is_sim_normal or is_sim_plant:
        energy_motive = get_sim_motive_value(sim_info, SimMotive.ENERGY)
        if energy_motive < -51:
            return False
    if is_sim_vampire:
        power_motive = get_sim_motive_value(sim_info, SimMotive.VAMPIRE_POWER)
        if power_motive < -91:
            return False
    if is_sim_vampire:
        thirst_motive = get_sim_motive_value(sim_info,
                                             SimMotive.VAMPIRE_THIRST)
        if thirst_motive < -59:
            return False
    if is_sim_plant:
        water_motive = get_sim_motive_value(sim_info, SimMotive.PLANTSIM_WATER)
        if water_motive < -59:
            return False
    return True
예제 #5
0
def get_sim_current_menstrual_pregnancy_chance(sim_identifier):
    if has_sim_trait(sim_identifier, SimTrait.WW_INFERTILE):
        return 0.0
    if has_sim_trait(sim_identifier,
                     SimTrait.GENDEROPTIONS_PREGNANCY_CANBEIMPREGNATED):
        return _get_sim_current_menstrual_pregnancy_chance(sim_identifier)
    if has_sim_trait(sim_identifier,
                     SimTrait.GENDEROPTIONS_PREGNANCY_CANIMPREGNATE):
        return _get_sim_current_menstrual_impregnation_chance(sim_identifier)
    return 0.0
def try_sim_pregnancy_from_sex_handler(sex_handler, sims_list, actor_id,
                                       sim_info):
    if not can_sim_get_pregnant(sim_info):
        return False
    if TurboSimUtil.Pregnancy.is_pregnant(sim_info):
        return False
    sim_pregnancy_chance = get_sim_current_pregnancy_chance(sim_info)
    if get_sex_setting(
            SexSetting.PREGNANCY_MODE, variable_type=int
    ) == PregnancyModeSetting.SIMPLE and sim_pregnancy_chance <= 0.0:
        return False
    pregnancy_partners = _get_possible_partners(sex_handler, sims_list,
                                                actor_id, sim_info)
    absolute_days = TurboWorldUtil.Time.get_absolute_days()
    enable_pregnancy_discovery = False
    for (partner_sim_id, is_cum_inside) in pregnancy_partners:
        partner_sim_info = TurboManagerUtil.Sim.get_sim_info(partner_sim_id)
        if partner_sim_info is None:
            pass
        if has_relationship_bit_with_sim(
                sim_info, partner_sim_info,
                SimRelationshipBit.WW_POTENTIAL_PREGNANCY_PARENT):
            pass
        if get_sex_setting(
                SexSetting.BIRTH_CONTROL_MODE,
                variable_type=int) == BirthControlModeSetting.REALISTIC:
            enable_pregnancy_discovery = True
        if _is_sim_on_birth_control(partner_sim_info):
            pass
        enable_pregnancy_discovery = True
        partner_pregnancy_chance = get_sim_current_pregnancy_chance(
            partner_sim_info)
        if partner_pregnancy_chance <= 0.0:
            pass
        if is_cum_inside is False:
            if has_sim_trait(partner_sim_info, SimTrait.LAZY) or has_sim_trait(
                    partner_sim_info, SimTrait.CLUMSY):
                partner_pregnancy_chance /= 2.0
            else:
                partner_pregnancy_chance /= 4.0
        chance_value = random.Random(
            (absolute_days, TurboManagerUtil.Sim.get_sim_id(sim_info),
             partner_sim_id)).uniform(0, 1)
        while chance_value <= sim_pregnancy_chance and (
                sim_ev(sim_info).pregnancy_fertility_boost[0] > 0
                or chance_value <= partner_pregnancy_chance):
            sim_ev(sim_info).pregnancy_coming_flag = True
            add_relationsip_bit_with_sim(
                sim_info, partner_sim_info,
                SimRelationshipBit.WW_POTENTIAL_PREGNANCY_PARENT)
            enable_pregnancy_discovery = True
    if enable_pregnancy_discovery is True and sex_handler.has_displayed_pregnancy_notification is False:
        set_sim_pregnancy_discovery(sim_info, True)
        sex_handler.has_displayed_pregnancy_notification = True
예제 #7
0
def is_true_family_relationship(sim_identifier, target_identifier):
    if get_relationship_setting(RelationshipSetting.INCEST_STATE,
                                variable_type=bool):
        return False
    if has_sim_trait(sim_identifier, SimTrait.WW_INCEST) and has_sim_trait(
            target_identifier, SimTrait.WW_INCEST):
        return False
    if not TurboSimUtil.Relationship.is_family(sim_identifier,
                                               target_identifier):
        return False
    return True
def can_sim_impregnate(sim_identifier):
    if TurboSimUtil.Age.is_younger_than(sim_identifier,
                                        TurboSimUtil.Age.CHILD):
        return False
    if not has_sim_trait(
            sim_identifier,
            SimTrait.GENDEROPTIONS_PREGNANCY_CANIMPREGNATE) or has_sim_trait(
                sim_identifier,
                SimTrait.GENDEROPTIONS_PREGNANCY_CANNOTIMPREGNATE):
        return False
    if has_sim_trait(sim_identifier, SimTrait.WW_INFERTILE):
        return False
    return True
예제 #9
0
def _wickedwhims_on_incest_prevention_test(original, self, *args, **kwargs):
    try:
        target_sim_info = args[0]
        if get_relationship_setting(
                RelationshipSetting.INCEST_STATE,
                variable_type=bool) or has_sim_trait(
                    self, SimTrait.WW_INCEST) and has_sim_trait(
                        target_sim_info, SimTrait.WW_INCEST):
            return True
    except Exception as ex:
        log_custom_exception(
            "Failed to edit incest test at 'SimInfo.incest_prevention_test'.",
            ex)
    return original(self, *args, **kwargs)
예제 #10
0
def is_sim_birth_control_safe(sim_identifier, allow_potentially=True):
    if (not has_sim_trait(sim_identifier, SimTrait.GENDEROPTIONS_PREGNANCY_CANBEIMPREGNATED) or has_sim_trait(sim_identifier, SimTrait.GENDEROPTIONS_PREGNANCY_CANNOT_BEIMPREGNATED)) and (not has_sim_trait(sim_identifier, SimTrait.GENDEROPTIONS_PREGNANCY_CANIMPREGNATE) or has_sim_trait(sim_identifier, SimTrait.GENDEROPTIONS_PREGNANCY_CANNOTIMPREGNATE)):
        return True
    if has_sim_trait(sim_identifier, SimTrait.WW_INFERTILE):
        return True
    if has_sim_trait(sim_identifier, SimTrait.GENDEROPTIONS_TOILET_STANDING):
        if sim_ev(sim_identifier).has_condom_on is True:
            return True
        if get_object_amount_in_sim_inventory(sim_identifier, get_condom_wrapper_object_id()) > 0:
            return True
    elif sim_ev(sim_identifier).day_used_birth_control_pills == TurboWorldUtil.Time.get_absolute_days():
        return True
    if allow_potentially is True and is_sim_allowed_for_free_birth_control(sim_identifier):
        return True
    return False
def _wickedwhims_register_basemental_drugs_callback():
    if not get_sex_setting(SexSetting.MISCARRIAGE_SWITCH, variable_type=bool):
        return
    for sim_info in TurboManagerUtil.Sim.get_all_sim_info_gen(humans=True,
                                                              pets=False):
        while not not has_sim_trait(
                sim_info, SimTrait.GENDEROPTIONS_PREGNANCY_CANBEIMPREGNATED):
            if has_sim_trait(
                    sim_info,
                    SimTrait.GENDEROPTIONS_PREGNANCY_CANNOT_BEIMPREGNATED):
                pass
            if has_sim_trait(sim_info, SimTrait.WW_INFERTILE):
                pass
            TurboSimUtil.Buff.register_for_buff_added_callback(
                sim_info, _on_sim_basemental_drugs_buff_added)
예제 #12
0
def _try_to_take_and_use_condoms(sim_identifier):
    sim = TurboManagerUtil.Sim.get_sim_instance(sim_identifier)
    if sim is None:
        return (False, 0)
    if sim_ev(sim).active_sex_handler is None:
        return (False, 0)
    sims_that_can_impregnate_list = list()
    for actor_sim in sim_ev(sim).active_sex_handler.get_actors_sim_info_gen():
        while sim_ev(actor_sim).has_condom_on is False and has_sim_trait(
                actor_sim, SimTrait.GENDEROPTIONS_PREGNANCY_CANIMPREGNATE):
            sims_that_can_impregnate_list.append(actor_sim)
    if not sims_that_can_impregnate_list:
        return (False, 0)
    condoms_count = get_object_amount_in_sim_inventory(
        sim, CONDOM_WRAPPER_OBJECT_ID)
    if condoms_count < len(sims_that_can_impregnate_list):
        return (False, condoms_count)
    if not remove_object_from_sim_inventory(
            sim, CONDOM_WRAPPER_OBJECT_ID, len(sims_that_can_impregnate_list)):
        return (False, len(sims_that_can_impregnate_list))
    for actor_sim in sims_that_can_impregnate_list:
        sim_ev(actor_sim).has_condom_on = True
        _update_sim_condom_status_buff(actor_sim)
        increase_sim_ww_statistic(actor_sim, 'times_used_contraception')
    return (True, len(sims_that_can_impregnate_list))
예제 #13
0
def set_sim_penis_state(sim_identifier,
                        is_hard,
                        length,
                        set_if_nude=False,
                        force=False):
    sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier)
    if not has_sim_trait(sim_info, SimTrait.GENDEROPTIONS_TOILET_STANDING):
        return
    has_to_update_state = sim_ev(
        sim_info).is_penis_hard != is_hard or force is True
    sim_ev(sim_info).is_penis_hard = is_hard
    sim_ev(sim_info).penis_hard_cooldown = length
    if has_to_update_state is True:
        update_nude_body_data(sim_info, force_update=True)
        current_outfit = TurboSimUtil.CAS.get_current_outfit(sim_info)
        if set_if_nude is True and (
                current_outfit[0] == TurboCASUtil.OutfitCategory.SPECIAL
                and current_outfit[1] == 0
                or current_outfit[0] == TurboCASUtil.OutfitCategory.BATHING):
            bottom_body_state = get_sim_body_state(
                sim_info, TurboCASUtil.BodyType.LOWER_BODY)
            if bottom_body_state == BodyState.NUDE:
                set_bodytype_caspart(sim_info,
                                     (TurboCASUtil.OutfitCategory.SPECIAL, 0),
                                     TurboCASUtil.BodyType.LOWER_BODY,
                                     sim_ev(sim_info).nude_outfit_parts[7])
                update_sim_penis_texture(sim_info)
                try:
                    TurboSimUtil.CAS.refresh_outfit(sim_info)
                except:
                    pass
예제 #14
0
def get_sim_menstrual_pregnancy_chance_matrix(sim_identifier):
    menstrual_cycle_days = get_sim_menstrual_cycle_days(sim_identifier)
    (before_fertile_window_start, fertile_window_start,
     most_fertile_window_start,
     ovulation_day) = get_fertility_days_data(menstrual_cycle_days)
    (before_fertile_window_chance, fertile_window_chance,
     most_fertile_window_chance,
     ovulation_day_chance) = get_fertility_chances_data()
    sim_id = TurboManagerUtil.Sim.get_sim_id(sim_identifier)
    absolute_days = max(
        1,
        TurboWorldUtil.Time.get_absolute_days() + ABSOLUTE_DAYS_OFFSET)
    random_int = random.Random(sim_id / absolute_days)
    fertility_bonus = has_sim_trait(sim_identifier, SimTrait.FERTILE)
    pregnancy_matrix = dict()
    for day in range(menstrual_cycle_days):
        if not day > ovulation_day:
            if day < before_fertile_window_start:
                continue
            if day == ovulation_day:
                pregnancy_matrix[day] = random_int.uniform(
                    *ovulation_day_chance)
            elif day >= most_fertile_window_start:
                pregnancy_matrix[day] = random_int.uniform(
                    *most_fertile_window_chance)
            elif day >= fertile_window_start:
                pregnancy_matrix[day] = random_int.uniform(
                    *fertile_window_chance)
            elif day >= before_fertile_window_start:
                pregnancy_matrix[day] = random_int.uniform(
                    *before_fertile_window_chance)
            if fertility_bonus is True:
                pregnancy_matrix[day] += pregnancy_matrix[day] * 0.2
    return pregnancy_matrix
def _wickedwhims_register_basemental_drugs_callback_on_new_sim(sim_info):
    if is_game_loading():
        return
    if not get_sex_setting(SexSetting.MISCARRIAGE_SWITCH, variable_type=bool):
        return
    if TurboSimUtil.Species.is_human(sim_info):
        if not has_sim_trait(
                sim_info, SimTrait.GENDEROPTIONS_PREGNANCY_CANBEIMPREGNATED
        ) or has_sim_trait(
                sim_info,
                SimTrait.GENDEROPTIONS_PREGNANCY_CANNOT_BEIMPREGNATED):
            return
        if has_sim_trait(sim_info, SimTrait.WW_INFERTILE):
            return
        TurboSimUtil.Buff.register_for_buff_added_callback(
            sim_info, _on_sim_basemental_drugs_buff_added)
예제 #16
0
def _after_sex_cum(sex_handler, actor_id, sim_info):
    if sex_handler.get_animation_instance() is None or not get_sex_setting(
            SexSetting.CUM_VISIBILITY_STATE, variable_type=bool):
        return
    cum_layers = sex_handler.get_animation_instance(
    ).get_actor_received_cum_layers(actor_id)
    if not cum_layers:
        actions = sex_handler.get_animation_instance(
        ).get_actor_received_actions(actor_id)
        for (action_actor_id, action_type, is_cum_inside) in actions:
            if is_cum_inside is True:
                pass
            cum_layer_type = get_cum_layer_from_sex_category(action_type)
            while cum_layer_type is not CumLayerType.NONE:
                cum_layers.append((action_actor_id, (cum_layer_type, )))
    for (action_actor_id, cum_layer_types) in cum_layers:
        action_actor_sim_id = sex_handler.get_sim_id_by_actor_id(
            action_actor_id)
        if action_actor_sim_id is None:
            pass
        action_actor_sim_info = TurboManagerUtil.Sim.get_sim_info(
            action_actor_sim_id)
        if not has_sim_trait(action_actor_sim_info,
                             SimTrait.GENDEROPTIONS_TOILET_STANDING):
            pass
        if not get_sex_setting(
                SexSetting.CUM_VISIBILITY_WITH_CONDOM_STATE, variable_type=bool
        ) and sim_ev(action_actor_sim_info).has_condom_on is True:
            pass
        apply_sim_cum_layer(sim_info, cum_layer_types)
예제 #17
0
def update_sim_underwear_data(sim_identifier):
    sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier)
    current_outfit_category = TurboSimUtil.CAS.get_current_outfit(sim_info)[0]
    if current_outfit_category == TurboCASUtil.OutfitCategory.SPECIAL:
        return
    from wickedwhims.nudity.nudity_settings import get_nudity_setting, NuditySetting
    if get_nudity_setting(
            NuditySetting.UNDERWEAR_SWITCH_STATE,
            variable_type=bool) and not has_sim_trait(
                sim_info, SimTrait.WW_NO_UNDERWEAR) and is_underwear_outfit(
                    current_outfit_category):
        set_sim_top_underwear_state(
            sim_info,
            True if TurboSimUtil.Gender.is_female(sim_info) else False)
        set_sim_bottom_underwear_state(sim_info, True)
        top_state = get_sim_body_state(sim_info, 6)
        bottom_state = get_sim_body_state(sim_info, 7)
        if top_state == BodyState.UNDERWEAR:
            set_sim_top_underwear_state(sim_info, True)
        elif top_state == BodyState.NUDE:
            set_sim_top_underwear_state(sim_info, False)
        if bottom_state == BodyState.UNDERWEAR:
            set_sim_bottom_underwear_state(sim_info, True)
        else:
            set_sim_bottom_underwear_state(sim_info, False)
    else:
        set_sim_top_underwear_state(sim_info, False)
        set_sim_bottom_underwear_state(sim_info, False)
def get_chance_for_random_sex_autonomy(sims_list,
                                       skip_hypersexual_lot_check=False):
    if skip_hypersexual_lot_check and False and is_sims_list_at_hypersexual_lot(
            sims_list):
        return 1.0
    self_assured_multiplier = [
        has_sim_trait(sim_info, SimTrait.SELFASSURED) for sim_info in sims_list
    ].count(True)
    is_at_night = TurboWorldUtil.Time.get_hour_of_day(
    ) <= 5 or TurboWorldUtil.Time.get_hour_of_day() >= 23
    is_at_weekend = TurboWorldUtil.Time.get_day_of_week() >= 5
    if get_sex_setting(SexSetting.AUTONOMY_LEVEL,
                       variable_type=int) == SexAutonomyLevelSetting.HIGH:
        return SEX_AUTONOMY_HIGH_LEVEL_BASE_CHANCE + (
            0.017 if is_at_weekend else 0.0
        ) + (
            0.005 if is_at_night else 0.0
        ) + 0.003 * self_assured_multiplier + get_sex_autonomy_failure_chance(
        )
    if get_sex_setting(SexSetting.AUTONOMY_LEVEL,
                       variable_type=int) == SexAutonomyLevelSetting.NORMAL:
        return SEX_AUTONOMY_NORMAL_LEVEL_BASE_CHANCE + (
            0.015 if is_at_weekend else 0.0
        ) + (
            0.003 if is_at_night else 0.0
        ) + 0.002 * self_assured_multiplier + get_sex_autonomy_failure_chance(
        )
    return SEX_AUTONOMY_LOW_LEVEL_BASE_CHANCE + (
        0.015 if is_at_weekend else 0.0
    ) + (
        0.003 if is_at_night else 0.0
    ) + 0.002 * self_assured_multiplier + get_sex_autonomy_failure_chance()
예제 #19
0
def increase_sim_nudity_skill(sim_identifier,
                              amount,
                              extra_fatigue=0.0,
                              reason=NuditySkillIncreaseReason.NONE):
    if amount <= 0:
        return
    if TurboSimUtil.Age.is_younger_than(sim_identifier,
                                        TurboSimUtil.Age.CHILD):
        return
    if CNSimUtils.can_have_sex(sim_identifier):
        return
    if reason == NuditySkillIncreaseReason.BEING_IN_NAKED_OUTFIT or reason == NuditySkillIncreaseReason.BEING_IN_BATHING_OUTFIT or reason == NuditySkillIncreaseReason.BEING_IN_REVEALING_OUTFIT:
        if has_sim_trait(sim_identifier, SimTrait.SHAMELESS):
            amount += get_nudity_skill_points_modifier(
                NuditySkillIncreaseReason.SHAMELESS_BONUS_BONUS)
        if has_sim_mood(sim_identifier, SimMood.CONFIDENT) or has_sim_trait(
                sim_identifier, SimTrait.SELFASSURED):
            amount += get_nudity_skill_points_modifier(
                NuditySkillIncreaseReason.CONFIDENCE_BONUS)
    elif (reason == NuditySkillIncreaseReason.MIRROR_REVEALING_OUTFIT
          or reason == NuditySkillIncreaseReason.MIRROR_NAKED_OUTFIT or reason
          == NuditySkillIncreaseReason.SEEING_NUDITY) and has_sim_trait(
              sim_identifier, SimTrait.LONER):
        amount += get_nudity_skill_points_modifier(
            NuditySkillIncreaseReason.SHAMELESS_BONUS_BONUS)
    nudity_skill_level = get_sim_nudity_skill_level(sim_identifier)
    amount /= nudity_skill_level
    nudity_skill_fatigue = get_sim_statistic_value(
        sim_identifier, SimCommodity.WW_NUDITY_SKILL_FATIGUE, add=True)
    amount *= nudity_skill_fatigue / 100
    set_sim_statistic_value(
        sim_identifier,
        max(
            0, nudity_skill_fatigue -
            (amount * nudity_skill_level + extra_fatigue)),
        SimCommodity.WW_NUDITY_SKILL_FATIGUE)
    if has_current_lot_trait(LotTrait.WW_LOTTRAIT_NUDIST):
        sim = TurboManagerUtil.Sim.get_sim_instance(sim_identifier)
        if sim is not None and TurboWorldUtil.Lot.is_position_on_active_lot(
                TurboSimUtil.Location.get_position(sim)):
            amount *= 0.25
    change_sim_skill_percentage_value(
        sim_identifier, amount, get_nudity_nudity_skill_type(sim_identifier))
    set_sim_statistic_value(sim_identifier,
                            get_sim_nudity_skill_level(sim_identifier),
                            SimCommodity.WW_NUDITY_SKILL_LEVEL)
def _is_positive_to_sim_nudity(sim, target):
    if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.CHILD):
        return False
    if has_relationship_bit_with_sim(
            sim, target, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO):
        return True
    if has_relationship_bit_with_sim(
            sim, target, SimRelationshipBit.
            ROMANTIC_ENGAGED) or has_relationship_bit_with_sim(
                sim, target, SimRelationshipBit.ROMANTIC_MARRIED
            ) or has_relationship_bit_with_sim(
                sim, target, SimRelationshipBit.ROMANTIC_SIGNIFICANT_OTHER):
        return True
    if has_relationship_bit_with_sim(
            sim, target, SimRelationshipBit.FRIENDSHIP_BFF
    ) or has_relationship_bit_with_sim(
            sim, target, SimRelationshipBit.FRIENDSHIP_BFF_EVIL
    ) or has_relationship_bit_with_sim(
            sim, target, SimRelationshipBit.FRIENDSHIP_BFF_BROMANTICPARTNER):
        return True
    if is_true_family_relationship(sim, target):
        return False
    if get_relationship_with_sim(sim, target, RelationshipTrackType.FRIENDSHIP
                                 ) >= 60 or get_relationship_with_sim(
                                     sim, target,
                                     RelationshipTrackType.FRIENDSHIP) >= 50:
        return True
    if has_sim_trait(sim, SimTrait.UNFLIRTY):
        return False
    if TurboSimUtil.Gender.get_gender(
            target) not in get_sim_preferenced_genders(sim):
        chance = 0.15
        if TurboSimUtil.Age.get_age(
                sim) == TurboSimUtil.Age.TEEN or TurboSimUtil.Age.get_age(
                    sim) == TurboSimUtil.Age.CHILD:
            chance += 0.05
        if has_sim_mood(sim, SimMood.FLIRTY):
            chance += 0.05
        if has_sim_trait(sim, SimTrait.BRO) and has_sim_trait(
                target, SimTrait.BRO):
            chance += 0.05
        if has_sim_trait(sim, SimTrait.LONER):
            chance += 0.025
        return chance >= 1.0 or random.Random(
            TurboManagerUtil.Sim.get_sim_id(sim)).uniform(0, 1) <= chance
    return False
예제 #21
0
def get_sex_pair_score(sim_identifier, target_sim_identifier):
    if sim_identifier is target_sim_identifier:
        return -1
    age_limit = get_age_limits_for_sex((sim_identifier, target_sim_identifier))
    if TurboSimUtil.Age.is_younger_than(
            sim_identifier, age_limit[0]) or TurboSimUtil.Age.is_older_than(
                sim_identifier, age_limit[1]):
        return -1
    if TurboSimUtil.Age.is_younger_than(
            target_sim_identifier,
            age_limit[0]) or TurboSimUtil.Age.is_older_than(
                target_sim_identifier, age_limit[1]):
        return -1
    if TurboSimUtil.Gender.get_gender(
            sim_identifier) not in get_sim_preferenced_genders(
                target_sim_identifier):
        return -1
    if TurboSimUtil.Gender.get_gender(
            target_sim_identifier) not in get_sim_preferenced_genders(
                sim_identifier):
        return -1
    if is_true_family_relationship(sim_identifier, target_sim_identifier):
        return -1
    if not has_sim_trait(sim_identifier,
                         SimTrait.WW_POLYAMOROUS) and not has_sim_trait(
                             sim_identifier, SimTrait.COMMITMENTISSUES):
        sim_significant_relationships = get_sim_relationship_sims(
            sim_identifier)
        if sim_significant_relationships and TurboManagerUtil.Sim.get_sim_id(
                target_sim_identifier) not in sim_significant_relationships:
            return -1
    if get_sex_setting(
            SexSetting.AUTONOMY_RELATIONSHIP_AWARENESS,
            variable_type=bool) and not has_sim_trait(
                target_sim_identifier,
                SimTrait.WW_POLYAMOROUS) and not has_sim_trait(
                    target_sim_identifier, SimTrait.COMMITMENTISSUES):
        target_significant_relationships = get_sim_relationship_sims(
            target_sim_identifier)
        if target_significant_relationships and TurboManagerUtil.Sim.get_sim_id(
                sim_identifier) not in target_significant_relationships:
            return -1
    relationship_score = get_test_relationship_score(
        (sim_identifier, target_sim_identifier), skip_always_accept=True)
    return relationship_score
예제 #22
0
def can_sim_have_period(sim_identifier):
    if TurboSimUtil.Age.is_younger_than(sim_identifier,
                                        TurboSimUtil.Age.CHILD):
        return False
    if TurboSimUtil.Age.is_older_than(sim_identifier,
                                      TurboSimUtil.Age.ELDER,
                                      or_equal=True):
        return False
    if not CNSimUtils.can_have_sex(sim_identifier):
        return False
    if not has_sim_trait(sim_identifier,
                         SimTrait.GENDEROPTIONS_PREGNANCY_CANBEIMPREGNATED):
        return False
    if has_sim_trait(sim_identifier, SimTrait.WW_INFERTILE):
        return False
    if has_sim_trait(sim_identifier, SimTrait.PLANTSIM):
        return False
    return True
예제 #23
0
def update_cum_buffs(sim_info, outfit_category_and_index=None):
    if TurboSimUtil.Age.is_younger_than(sim_info, TurboSimUtil.Age.CHILD):
        return
    has_positive_buff = has_sim_buff(sim_info, SimBuff.WW_CUM_ON_BODY_POSITIVE)
    has_negative_buff = has_sim_buff(sim_info, SimBuff.WW_CUM_ON_BODY_NEGATIVE)
    if has_sim_cas_part_id(sim_info, (CUM_FACE_LAYER, CUM_CHEST_LAYER, CUM_BACK_LAYER, CUM_VAGINA_LAYER, CUM_BUTT_LAYER, CUM_FEET_LAYER), outfit_category_and_index=outfit_category_and_index):
        if has_positive_buff is False and has_negative_buff is False:
            if has_sim_trait(sim_info, SimTrait.WW_CUMSLUT) or has_sim_trait(sim_info, SimTrait.ROMANTIC):
                add_sim_buff(sim_info, SimBuff.WW_CUM_ON_BODY_POSITIVE)
            elif has_sim_trait(sim_info, SimTrait.HATESCHILDREN):
                return
            else:
                add_sim_buff(sim_info, SimBuff.WW_CUM_ON_BODY_NEGATIVE)
        return
    if has_positive_buff is True:
        remove_sim_buff(sim_info, SimBuff.WW_CUM_ON_BODY_POSITIVE)
    if has_negative_buff is True:
        remove_sim_buff(sim_info, SimBuff.WW_CUM_ON_BODY_NEGATIVE)
예제 #24
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,))
예제 #25
0
def get_sim_underwear_data(sim_identifier, outfit_category_and_index):
    sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier)
    sim_is_child = TurboSimUtil.Age.get_age(sim_info) is TurboSimUtil.Age.CHILD
    if not get_nudity_setting(NuditySetting.UNDERWEAR_SWITCH_STATE,
                              variable_type=bool) or has_sim_trait(
                                  sim_info, SimTrait.WW_NO_UNDERWEAR):
        return (-1, -1)
    outfit_category = outfit_category_and_index[0]
    outfit_index = outfit_category_and_index[1]
    if outfit_category == TurboCASUtil.OutfitCategory.CAREER or outfit_category == TurboCASUtil.OutfitCategory.SITUATION:
        outfit_category = TurboCASUtil.OutfitCategory.EVERYDAY
        outfit_index = 0
    if outfit_category == TurboCASUtil.OutfitCategory.SPECIAL and outfit_index == 0:
        modified_outfit = get_modified_outfit(sim_info)
        outfit_category = modified_outfit[0]
        outfit_index = modified_outfit[1]
    outfit_code = _get_outfit_category_and_index_code(
        (outfit_category, outfit_index))
    if outfit_code in sim_ev(sim_info).underwear_outfits_parts:
        underwear_data = sim_ev(sim_info).underwear_outfits_parts[outfit_code]
    elif TurboSimUtil.Sim.is_npc(sim_info):
        underwear_data = list(get_random_underwear_set(sim_info))
    else:
        underwear_data = [-1, -1]
    if sim_is_child:
        if TurboSimUtil.Gender.is_male(sim_info):
            if underwear_data[
                    1] == -1 or not TurboCASUtil.Outfit.is_cas_part_loaded(
                        underwear_data[1]):
                underwear_data[1] = DEFAULT_UNDERWEAR_BOTTOM_CHILD_MALE
        else:
            if underwear_data[
                    0] == -1 or not TurboCASUtil.Outfit.is_cas_part_loaded(
                        underwear_data[0]):
                underwear_data[0] = DEFAULT_UNDERWEAR_TOP_CHILD_FEMALE
            if underwear_data[
                    1] == -1 or not TurboCASUtil.Outfit.is_cas_part_loaded(
                        underwear_data[1]):
                underwear_data[1] = DEFAULT_UNDERWEAR_BOTTOM_CHILD_FEMALE
    else:
        if TurboSimUtil.Gender.is_male(sim_info):
            if underwear_data[
                    1] == -1 or not TurboCASUtil.Outfit.is_cas_part_loaded(
                        underwear_data[1]):
                underwear_data[1] = DEFAULT_UNDERWEAR_BOTTOM_MALE
        else:
            if underwear_data[
                    0] == -1 or not TurboCASUtil.Outfit.is_cas_part_loaded(
                        underwear_data[0]):
                underwear_data[0] = DEFAULT_UNDERWEAR_TOP_FEMALE
            if underwear_data[
                    1] == -1 or not TurboCASUtil.Outfit.is_cas_part_loaded(
                        underwear_data[1]):
                underwear_data[1] = DEFAULT_UNDERWEAR_BOTTOM_FEMALE
    set_sim_underwear_data(sim_info, underwear_data, outfit_category_and_index)
    return underwear_data
def can_sim_get_pregnant(sim_identifier):
    if TurboSimUtil.Age.is_younger_than(sim_identifier,
                                        TurboSimUtil.Age.CHILD):
        return False
    if TurboSimUtil.Age.is_older_than(sim_identifier, TurboSimUtil.Age.ADULT):
        return False
    if not has_sim_trait(
            sim_identifier, SimTrait.GENDEROPTIONS_PREGNANCY_CANBEIMPREGNATED
    ) or has_sim_trait(sim_identifier,
                       SimTrait.GENDEROPTIONS_PREGNANCY_CANNOT_BEIMPREGNATED):
        return False
    if has_sim_trait(sim_identifier, SimTrait.WW_INFERTILE):
        return False
    household = TurboSimUtil.Household.get_household(sim_identifier)
    if household is None:
        return False
    if TurboWorldUtil.Household.get_free_sims_slots(household) <= 0:
        return False
    return True
예제 #27
0
def try_late_assign_birth_control(sim_identifier):
    if get_sex_setting(SexSetting.NPC_BIRTH_CONTROL_MODE, variable_type=int) == NPCBirthControlModeSetting.UNSAFE:
        return False
    if TurboSimUtil.Sim.is_player(sim_identifier):
        return False
    if is_sim_birth_control_safe(sim_identifier, allow_potentially=False):
        return True
    if not is_sim_allowed_for_free_birth_control(sim_identifier):
        return False
    if has_sim_trait(sim_identifier, SimTrait.GENDEROPTIONS_TOILET_STANDING):
        return give_sim_condoms(sim_identifier, amount=1)
    return take_birth_control_pill(sim_identifier, no_inventory=True)
예제 #28
0
def _is_sim_requiring_condom_auto_use(sim_identifier, condoms_count):
    if has_sim_trait(sim_identifier, SimTrait.HATESCHILDREN) and (
            sim_ev(sim_identifier).has_condom_on is False
            or sim_ev(sim_identifier).day_used_birth_control_pills !=
            TurboWorldUtil.Time.get_absolute_days()):
        return True
    if get_sex_setting(
            SexSetting.BIRTH_CONTROL_AUTO_USE, variable_type=bool
    ) and sim_ev(
            sim_identifier).auto_use_of_condoms is True and condoms_count > 0:
        return True
    return False
예제 #29
0
def start_cuckold_solo_sex_interaction(sim_identifier, active_sex_handler):
    sim = TurboManagerUtil.Sim.get_sim_instance(sim_identifier)
    if has_sim_trait(sim, SimTrait.GENDEROPTIONS_TOILET_STANDING):
        animation_instance = _get_animation_with_stage_name(
            get_hidden_animations(),
            'TURBODRIVER:SAM:Solo_Male_Masturbation_1')
    else:
        animation_instance = _get_animation_with_stage_name(
            get_hidden_animations(),
            'TURBODRIVER:Amra72:Solo_Female_Masturbation_1')
    if animation_instance is None:
        return False
    location = TurboWorldUtil.Zone.find_good_location(
        TurboSimUtil.Location.get_location(sim))
    location_position = TurboMathUtil.Location.get_location_translation(
        location)
    line_of_sight = TurboMathUtil.LineOfSight.create(
        TurboSimUtil.Location.get_routing_surface(sim), location_position, 8.0)
    if not TurboMathUtil.LineOfSight.test(
            line_of_sight,
            TurboMathUtil.Location.get_location_translation(
                active_sex_handler.get_location())):
        return False
    location_level = TurboMathUtil.Location.get_location_level(location)
    location_angle = TurboMathUtil.Orientation.get_angle_between_vectors(
        location_position,
        TurboMathUtil.Location.get_location_translation(
            active_sex_handler.get_location()))
    pre_sex_handler = PreSexInteractionHandler(
        SexCategoryType.HANDJOB,
        TurboManagerUtil.Sim.get_sim_id(sim),
        SexInteractionLocationType.FLOOR_TYPE,
        -1,
        0,
        TurboWorldUtil.Lot.get_active_lot_id(),
        location_position.x,
        location_position.y,
        location_position.z,
        location_level,
        location_angle,
        location_position.x,
        location_position.y,
        location_position.z,
        location_level,
        is_autonomy=True)
    pre_sex_handler.set_animation_instance(animation_instance)
    pre_sex_handler.pause_timer()
    pre_sex_handler.pause_animation()
    pre_sex_handler.link_active_sex_handler(active_sex_handler)
    pre_sex_handler.add_sim(TurboManagerUtil.Sim.get_sim_id(sim))
    sim_ev(sim).active_pre_sex_handler = pre_sex_handler
    return start_sex_interaction_from_pre_sex_handler(pre_sex_handler)
예제 #30
0
def _wickedwhims_on_broadcaster_can_affect(original, self, *args, **kwargs):
    result = original(self, *args, **kwargs)
    try:
        sim = args[0]
        while sim is not None and (sim.is_sim and self.allow_sims
                                   ) and TurboResourceUtil.Resource.get_guid64(
                                       self) in JEALOUSY_BROADCASTERS_LIST:
            if has_sim_trait(sim, SimTrait.WW_POLYAMOROUS):
                return False
    except Exception as ex:
        log_custom_exception(
            "Failed to prevent broadcaster effect at 'Broadcaster.can_affect'.",
            ex)
    return result