def update_naturism_buffs(sim_info, category_and_index):
    if TurboSimUtil.Age.is_younger_than(sim_info, TurboSimUtil.Age.CHILD):
        return
    has_naturist_buff = has_sim_buff(
        sim_info, SimBuff.WW_NATURISM_SKILL_LEVEL_2) or (
            has_sim_buff(sim_info, SimBuff.WW_NATURISM_SKILL_LEVEL_3) or
            (has_sim_buff(sim_info, SimBuff.WW_NATURISM_SKILL_LEVEL_4)
             or has_sim_buff(sim_info, SimBuff.WW_NATURISM_SKILL_LEVEL_5)))
    sim_outfit_level = get_sim_outfit_level(
        sim_info, outfit_category_and_index=category_and_index)
    is_sim_allowed_for_buff = (sim_outfit_level == OutfitLevel.NUDE
                               or sim_outfit_level == OutfitLevel.BATHING
                               ) and is_sim_naturist(sim_info)
    if has_naturist_buff is False and is_sim_allowed_for_buff is True:
        nudity_skill_level = get_sim_nudity_skill_level(sim_info)
        naturism_buff = None
        if nudity_skill_level <= 1:
            naturism_buff = SimBuff.WW_NATURISM_SKILL_LEVEL_1
        elif nudity_skill_level == 2:
            naturism_buff = SimBuff.WW_NATURISM_SKILL_LEVEL_2
        elif nudity_skill_level == 3:
            naturism_buff = SimBuff.WW_NATURISM_SKILL_LEVEL_3
        elif nudity_skill_level == 4:
            naturism_buff = SimBuff.WW_NATURISM_SKILL_LEVEL_4
        elif nudity_skill_level >= 5:
            naturism_buff = SimBuff.WW_NATURISM_SKILL_LEVEL_5
        if naturism_buff is not None:
            add_sim_buff(sim_info, naturism_buff)
    if has_naturist_buff is True and is_sim_allowed_for_buff is False:
        remove_sim_buff(sim_info, SimBuff.WW_NATURISM_SKILL_LEVEL_2)
        remove_sim_buff(sim_info, SimBuff.WW_NATURISM_SKILL_LEVEL_3)
        remove_sim_buff(sim_info, SimBuff.WW_NATURISM_SKILL_LEVEL_4)
        remove_sim_buff(sim_info, SimBuff.WW_NATURISM_SKILL_LEVEL_5)
def _has_reaction_to_nudity(sim, target):
    if TurboSimUtil.Age.get_age(sim) == TurboSimUtil.Age.TEEN or TurboSimUtil.Age.get_age(sim) == TurboSimUtil.Age.CHILD:
        return True
    if is_sim_naturist(sim) and TurboSimUtil.Age.is_older_than(sim, TurboSimUtil.Age.ADULT, or_equal=True) and (TurboSimUtil.Age.get_age(target) == TurboSimUtil.Age.TEEN or TurboSimUtil.Age.get_age(target) == TurboSimUtil.Age.CHILD):
        return True
    if is_sim_exhibitionist(sim):
        return True
    return False
def update_sim_nudity_skill_on_seeing_nudity(sim, target):
    skill_points = _get_sim_nudity_value(
        target, sim) * get_nudity_skill_points_modifier(
            NuditySkillIncreaseReason.SEEING_NUDITY)
    if TurboSimUtil.Age.get_age(
            sim) == TurboSimUtil.Age.CHILD and is_sim_naturist(target):
        apply_nudity_skill_influence(sim, skill_points, overall_limit=200.0)
        return
    increase_sim_nudity_skill(sim,
                              skill_points,
                              extra_fatigue=0.05,
                              reason=NuditySkillIncreaseReason.SEEING_NUDITY)
def _update_nudity_buffs(sim_info, category_and_index):
    if TurboSimUtil.Age.is_younger_than(sim_info, TurboSimUtil.Age.CHILD):
        return
    if not is_sim_naturist(
            sim_info) or get_sim_nudity_skill_level(sim_info) < 2:
        return
    has_nudity_buff = has_sim_buff(sim_info, SimBuff.WW_NUDITY_IS_NAKED_HIGH)
    sim_outfit_level = get_sim_outfit_level(
        sim_info, outfit_category_and_index=category_and_index)
    is_sim_nude = sim_outfit_level == OutfitLevel.NUDE or sim_outfit_level == OutfitLevel.BATHING
    if has_nudity_buff is False and is_sim_nude is True:
        add_sim_buff(sim_info, SimBuff.WW_NUDITY_IS_NAKED_HIGH)
    if has_nudity_buff is True and is_sim_nude is False:
        remove_sim_buff(sim_info, SimBuff.WW_NUDITY_IS_NAKED_HIGH)
Example #5
0
def _get_sim_value(sim, target):
    base_sim_value = 25
    sim_value_modifier = 0
    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 base_sim_value / 4
    if has_relationship_bit_with_sim(sim, target,
                                     SimRelationshipBit.WW_JUST_HAD_SEX):
        return base_sim_value / 4
    if has_relationship_bit_with_sim(
            sim, target, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO_RECENTLY):
        return base_sim_value / 2
    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 base_sim_value / 2
    current_nudity_level = get_sim_nudity_skill_level(sim)
    if is_sim_naturist(sim) and TurboSimUtil.Relationship.is_family(
            sim, target):
        base_sim_value = 22.5
    elif current_nudity_level == 2:
        sim_value_modifier = 69.1
    if is_sim_exhibitionist(sim):
        sim_value_modifier += -5
    current_friendship_score = int(
        get_relationship_with_sim(sim, target,
                                  RelationshipTrackType.FRIENDSHIP))
    current_friendship_score *= 0.45 * current_nudity_level if current_friendship_score > 0 else 0.45 * (
        6 - current_nudity_level)
    current_romance_score = int(
        get_relationship_with_sim(sim, target, RelationshipTrackType.ROMANCE))
    current_romance_score *= 0.8 * current_nudity_level if current_romance_score > 0 else 0.8 * (
        6 - current_nudity_level)
    current_relationship_amount = (current_friendship_score +
                                   current_romance_score) / 2
    if current_relationship_amount > 0:
        return base_sim_value * (
            1 - current_relationship_amount / 100) + sim_value_modifier
    if current_relationship_amount < 0:
        return base_sim_value + base_sim_value * (
            abs(current_relationship_amount) / 100) + sim_value_modifier
    return base_sim_value + sim_value_modifier
def _get_sim_nudity_value(sim_identifier, target_sim_identifier):
    sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier)
    target_sim_info = TurboManagerUtil.Sim.get_sim_info(target_sim_identifier)
    score_collection = list()
    if TurboSimUtil.Age.get_age(target_sim_info) == TurboSimUtil.Age.TODDLER:
        base_modifier = -0.5
    else:
        sim_outfit_level = get_sim_outfit_level(sim_info)
        target_outfit_level = get_sim_outfit_level(target_sim_info)
        if TurboSimUtil.Age.is_older_than(
                target_sim_info,
                TurboSimUtil.Age.get_age(sim_identifier),
                or_equal=True):
            base_modifier = 1.0
        else:
            base_modifier = 0.8
        if target_outfit_level >= sim_outfit_level:
            base_modifier = -base_modifier
    if TurboSimUtil.Household.is_same_household(sim_info, target_sim_info):
        if is_sim_naturist(sim_info):
            score_collection.append(-0.01 * base_modifier)
        else:
            score_collection.append(-0.05 * base_modifier)
    if is_true_family_relationship(sim_info, target_sim_info):
        if is_sim_naturist(sim_info):
            score_collection.append(-0.05 * base_modifier)
        else:
            score_collection.append(-0.1 * base_modifier)
    if has_relationship_bit_with_sim(sim_info, target_sim_info,
                                     SimRelationshipBit.WW_JUST_HAD_SEX):
        score_collection.append(-0.15 * base_modifier)
    if has_relationship_bit_with_sim(
            sim_info, target_sim_info,
            SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO_RECENTLY):
        score_collection.append(-0.1 * base_modifier)
    elif has_relationship_bit_with_sim(
            sim_info, target_sim_info,
            SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO):
        score_collection.append(-0.02 * base_modifier)
    if has_relationship_bit_with_sim(
            sim_info, target_sim_info, SimRelationshipBit.
            ROMANTIC_ENGAGED) or has_relationship_bit_with_sim(
                sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_MARRIED
            ) or has_relationship_bit_with_sim(
                sim_info, target_sim_info,
                SimRelationshipBit.ROMANTIC_SIGNIFICANT_OTHER):
        score_collection.append(-0.15 * base_modifier)
    current_romance_rel_amount = (get_relationship_with_sim(
        sim_info, target_sim_info, RelationshipTrackType.ROMANCE) +
                                  100) / 200 * 100
    score_collection.append(
        max(0, 1.0 * ((100 - current_romance_rel_amount) / 100)) *
        base_modifier)
    if has_relationship_bit_with_sim(
            sim_info, target_sim_info, SimRelationshipBit.
            FRIENDSHIP_BFF) or has_relationship_bit_with_sim(
                sim_info, target_sim_info, SimRelationshipBit.
                FRIENDSHIP_BFF_EVIL) or has_relationship_bit_with_sim(
                    sim_info, target_sim_info,
                    SimRelationshipBit.FRIENDSHIP_BFF_BROMANTICPARTNER):
        score_collection.append(-0.15 * base_modifier)
    current_friendship_rel_amount = (get_relationship_with_sim(
        sim_info, target_sim_info, RelationshipTrackType.FRIENDSHIP) +
                                     100) / 200 * 100
    score_collection.append(
        max(0, 1.0 * ((100 - current_friendship_rel_amount) / 100)) *
        base_modifier)
    return sum(score_collection) / len(score_collection)
Example #7
0
 def on_interaction_start(cls, interaction_instance):
     sim = cls.get_interaction_target(interaction_instance)
     nudity_debug_info = ''
     nudity_debug_info += 'Body States:\n'
     nudity_debug_info += '  Top: ' + str(get_sim_body_state(sim, 6)) + '\n'
     nudity_debug_info += '  Bottom: ' + str(get_sim_body_state(sim,
                                                                7)) + '\n'
     nudity_debug_info += '\nBody Additional States:\n'
     nudity_debug_info += '  Top: ' + str(
         get_sim_additional_body_state(sim, 6, get_sim_body_state(
             sim, 6))) + '\n'
     nudity_debug_info += '  Bottom: ' + str(
         get_sim_additional_body_state(sim, 7, get_sim_body_state(
             sim, 7))) + '\n'
     nudity_debug_info += '\nBody Actual States:\n'
     nudity_debug_info += '  Top: ' + str(get_sim_actual_body_state(
         sim, 6)) + '\n'
     nudity_debug_info += '  Bottom: ' + str(
         get_sim_actual_body_state(sim, 7)) + '\n'
     nudity_debug_info += '\nOutfit Body Types:\n'
     nudity_debug_info += '  Has Top: ' + str(
         has_sim_outfit_top(sim)) + '\n'
     nudity_debug_info += '  Has Bottom: ' + str(
         has_sim_outfit_bottom(sim)) + '\n'
     nudity_debug_info += '  Has Full Body: ' + str(
         is_sim_outfit_fullbody(sim)) + '\n'
     nudity_debug_info += '\nNudity Outfit Parts:\n'
     nudity_debug_info += '  Top: ' + str(
         sim_ev(sim).nude_outfit_parts[6]) + '\n'
     nudity_debug_info += '  Bottom: ' + str(
         sim_ev(sim).nude_outfit_parts[7]) + '\n'
     nudity_debug_info += '  Feet: ' + str(
         sim_ev(sim).nude_outfit_parts[8]) + '\n'
     nudity_debug_info += '  Penis Texture: ' + str(
         sim_ev(sim).nude_outfit_parts[115]) + '\n'
     nudity_debug_info += '\nPenis Outfit Parts:\n'
     nudity_debug_info += '  Soft: ' + str(
         sim_ev(sim).penis_outfit_parts['soft']) + '\n'
     nudity_debug_info += '  Hard: ' + str(
         sim_ev(sim).penis_outfit_parts['hard']) + '\n'
     nudity_debug_info += '\nPenis Parts Authors:\n'
     nudity_debug_info += '  Soft: ' + str(
         sim_ev(sim).outfit_soft_penis_author) + '\n'
     nudity_debug_info += '  Hard: ' + str(
         sim_ev(sim).outfit_hard_penis_author) + '\n'
     nudity_debug_info += '\nPenis State:\n'
     nudity_debug_info += '  Is Hard: ' + str(
         sim_ev(sim).is_penis_hard) + '\n'
     nudity_debug_info += '  Penis Cooldown: ' + str(
         sim_ev(sim).penis_hard_cooldown) + '\n'
     nudity_debug_info += '\nOriginal Outfit Data:\n'
     nudity_debug_info += '  Has Modifications: ' + str(
         sim_ev(sim).has_original_outfit_modifications) + '\n'
     nudity_debug_info += '  Category: ' + str(
         sim_ev(sim).original_outfit_category) + '\n'
     nudity_debug_info += '  Index: ' + str(
         sim_ev(sim).original_outfit_index) + '\n'
     nudity_debug_info += '  Update Locked: ' + str(
         sim_ev(sim).is_outfit_update_locked) + '\n'
     nudity_debug_info += '\nNudity Skill:\n'
     nudity_debug_info += '  Is Naturist/Is Exhibitionist: ' + str(
         is_sim_naturist(sim)) + '/' + str(is_sim_exhibitionist(sim)) + '\n'
     nudity_debug_info += '  Level: ' + str(
         get_sim_nudity_skill_level(sim) +
         get_sim_nudity_skill_progress(sim)) + '\n'
     nudity_debug_info += '  Influence Score: ' + str(
         sim_ev(sim).nudity_skill_influence_score) + '\n'
     nudity_debug_info += '  Fatigue: ' + str(
         get_sim_statistic_value(
             sim, SimCommodity.WW_NUDITY_SKILL_FATIGUE)) + '\n'
     nudity_debug_info += '\nNudity Reaction:\n'
     nudity_debug_info += '  Full Reaction Cooldown: ' + str(
         sim_ev(sim).full_nudity_reaction_cooldown) + '\n'
     nudity_debug_info += '  Inner Reaction Cooldown: ' + str(
         sim_ev(sim).inner_nudity_reaction_cooldown) + '\n'
     nudity_debug_info += '\nSpecial:\n'
     nudity_debug_info += '  Is Flashing: ' + str(
         sim_ev(sim).is_flashing) + '\n'
     nudity_debug_info += '  Toilet Use Outfit State: ' + str(
         sim_ev(sim).on_toilet_outfit_state) + '\n'
     nudity_debug_info += '  Breast Feeding Outfit State: ' + str(
         sim_ev(sim).on_breast_feeding_outfit_state) + '\n'
     display_notification(text=nudity_debug_info,
                          title=str(TurboSimUtil.Name.get_name(sim)[0]) +
                          ' ' + str(TurboSimUtil.Name.get_name(sim)[1]) +
                          ' Nudity Debug',
                          secondary_icon=sim)
Example #8
0
def trigger_nudity_autonomy(sim):
    if is_sim_naturist(sim):
        if is_sim_outfit_fullbody(sim):
            set_sim_top_underwear_state(sim, False)
            set_sim_bottom_underwear_state(sim, False)
            return TurboSimUtil.Interaction.push_affordance(
                sim,
                SimInteraction.WW_NATURISM_UNDRESS_OUTFIT,
                interaction_context=TurboInteractionUtil.InteractionContext.
                SOURCE_AUTONOMY,
                insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT,
                priority=TurboInteractionUtil.Priority.High,
                run_priority=TurboInteractionUtil.Priority.High,
                skip_if_running=True)
        top_outfit_state = get_sim_actual_body_state(sim,
                                                     6) == BodyState.OUTFIT
        if top_outfit_state is True:
            set_sim_top_underwear_state(sim, False)
            return TurboSimUtil.Interaction.push_affordance(
                sim,
                SimInteraction.WW_NATURISM_UNDRESS_OUTFIT_TOP,
                interaction_context=TurboInteractionUtil.InteractionContext.
                SOURCE_AUTONOMY,
                insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT,
                priority=TurboInteractionUtil.Priority.High,
                run_priority=TurboInteractionUtil.Priority.High,
                skip_if_running=True)
        bottom_outfit_state = get_sim_actual_body_state(sim,
                                                        7) == BodyState.OUTFIT
        if bottom_outfit_state is True:
            set_sim_bottom_underwear_state(sim, False)
            return TurboSimUtil.Interaction.push_affordance(
                sim,
                SimInteraction.WW_NATURISM_UNDRESS_OUTFIT_BOTTOM,
                interaction_context=TurboInteractionUtil.InteractionContext.
                SOURCE_AUTONOMY,
                insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT,
                priority=TurboInteractionUtil.Priority.High,
                run_priority=TurboInteractionUtil.Priority.High,
                skip_if_running=True)
        return False
    else:
        if is_sim_outfit_fullbody(sim):
            set_sim_top_underwear_state(sim, False)
            set_sim_bottom_underwear_state(sim, False)
            return TurboSimUtil.Interaction.push_affordance(
                sim,
                SimInteraction.WW_EXHIBITIONISM_UNDRESS_OUTFIT,
                interaction_context=TurboInteractionUtil.InteractionContext.
                SOURCE_AUTONOMY,
                insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT,
                priority=TurboInteractionUtil.Priority.High,
                run_priority=TurboInteractionUtil.Priority.High,
                skip_if_running=True)
        top_outfit_state = get_sim_actual_body_state(sim,
                                                     6) == BodyState.OUTFIT
        if top_outfit_state is True:
            set_sim_top_underwear_state(sim, False)
            return TurboSimUtil.Interaction.push_affordance(
                sim,
                SimInteraction.WW_EXHIBITIONISM_UNDRESS_OUTFIT_TOP,
                interaction_context=TurboInteractionUtil.InteractionContext.
                SOURCE_AUTONOMY,
                insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT,
                priority=TurboInteractionUtil.Priority.High,
                run_priority=TurboInteractionUtil.Priority.High,
                skip_if_running=True)
        bottom_outfit_state = get_sim_actual_body_state(sim,
                                                        7) == BodyState.OUTFIT
        if bottom_outfit_state is True:
            set_sim_bottom_underwear_state(sim, False)
            return TurboSimUtil.Interaction.push_affordance(
                sim,
                SimInteraction.WW_EXHIBITIONISM_UNDRESS_OUTFIT_BOTTOM,
                interaction_context=TurboInteractionUtil.InteractionContext.
                SOURCE_AUTONOMY,
                insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT,
                priority=TurboInteractionUtil.Priority.High,
                run_priority=TurboInteractionUtil.Priority.High,
                skip_if_running=True)
        return False