def update_sim_nudity_skill_on_mirror_use(sim_identifier): if sim_ev(sim_identifier ).is_running_mirror_nudity_skill_interaction is False: return if not TurboSimUtil.Interaction.is_running_interaction( sim_identifier, SimInteraction.WW_MIRROR_ADMIRE_YOUR_BODY): sim_ev( sim_identifier).is_running_mirror_nudity_skill_interaction = False return sim_outfit_level = get_sim_outfit_level(sim_identifier) sim_nudity_skill_level = get_sim_nudity_skill_level(sim_identifier) if sim_outfit_level == OutfitLevel.NUDE or sim_outfit_level == OutfitLevel.BATHING: increase_sim_nudity_skill( sim_identifier, get_nudity_skill_points_modifier( NuditySkillIncreaseReason.MIRROR_NAKED_OUTFIT) / sim_nudity_skill_level, extra_fatigue=0.2, reason=NuditySkillIncreaseReason.MIRROR_NAKED_OUTFIT) else: increase_sim_nudity_skill( sim_identifier, get_nudity_skill_points_modifier( NuditySkillIncreaseReason.MIRROR_REVEALING_OUTFIT) / sim_nudity_skill_level, extra_fatigue=0.05, reason=NuditySkillIncreaseReason.MIRROR_REVEALING_OUTFIT)
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 _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)
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)
def _get_desire_nudity_value(target): target_outfit_level = get_sim_outfit_level(target) if target_outfit_level == OutfitLevel.REVEALING: desire_limit = 30 desire_increase = 0.5 elif target_outfit_level == OutfitLevel.UNDERWEAR: desire_limit = 45 desire_increase = 1.0 elif target_outfit_level == OutfitLevel.NUDE or target_outfit_level == OutfitLevel.BATHING: desire_limit = 80 desire_increase = 1.25 else: return (0, 0) if TurboSimUtil.Age.is_older_than(target, TurboSimUtil.Age.ELDER, or_equal=True): desire_limit /= 3 desire_increase /= 3 return (desire_limit, desire_increase)
def test_sim_nudity_permission(sim): if CNSimUtils.is_toddler(sim): return False if CNSimUtils.can_have_sex(sim): return False if sim_ev(sim).is_flashing is True or sim_ev( sim).on_toilet_outfit_state != -1 or sim_ev( sim).on_breast_feeding_outfit_state != -1: return False if not is_sim_in_special_outfit(sim): return False sim_outfit_level = get_sim_outfit_level(sim) if sim_outfit_level != OutfitLevel.NUDE: return False if not is_sim_available(sim): return False for interaction_id in TurboSimUtil.Interaction.get_running_interactions_ids( sim): if interaction_id in NUDITY_EXCEPTION_INTERACTIONS: return for interaction_id in TurboSimUtil.Interaction.get_queued_interactions_ids( sim): if interaction_id in NUDITY_EXCEPTION_INTERACTIONS: return (has_permission, denied_permissions) = has_sim_permission_for_nudity(sim) if has_permission is True: return False sim_ev(sim).last_nudity_denied_permissions = denied_permissions if is_sim_exhibitionist(sim): dress_up_interaction = SimInteraction.WW_EXHIBITIONISM_FORCE_DRESS_UP else: dress_up_interaction = SimInteraction.WW_NATURISM_FORCE_DRESS_UP TurboSimUtil.Interaction.push_affordance( sim, dress_up_interaction, interaction_context=TurboInteractionUtil.InteractionContext. SOURCE_AUTONOMY, insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT, must_run_next=True, run_priority=TurboInteractionUtil.Priority.High, priority=TurboInteractionUtil.Priority.High, skip_if_running=True) return True
def update_sim_nudity_skill_on_active_nudity(sim_identifier): if TurboSimUtil.Age.is_younger_than(sim_identifier, TurboSimUtil.Age.CHILD): return if CNSimUtils.can_have_sex(sim_identifier): return if is_sim_in_sex(sim_identifier) or is_sim_going_to_sex(sim_identifier): return if not is_sim_available(sim_identifier): return sim_outfit_level = get_sim_outfit_level(sim_identifier) if sim_outfit_level == OutfitLevel.OUTFIT: return sims_around_value = _get_sims_around_value(sim_identifier, max_sims=6) if sim_outfit_level == OutfitLevel.NUDE: increase_sim_nudity_skill( sim_identifier, sims_around_value * get_nudity_skill_points_modifier( NuditySkillIncreaseReason.BEING_IN_NAKED_OUTFIT), extra_fatigue=0.05, reason=NuditySkillIncreaseReason.BEING_IN_NAKED_OUTFIT) elif sim_outfit_level == OutfitLevel.BATHING: sim_nudity_skill_level = get_sim_nudity_skill_level(sim_identifier) increase_sim_nudity_skill( sim_identifier, sims_around_value * (get_nudity_skill_points_modifier( NuditySkillIncreaseReason.BEING_IN_BATHING_OUTFIT) / sim_nudity_skill_level), extra_fatigue=0.15, reason=NuditySkillIncreaseReason.BEING_IN_BATHING_OUTFIT) elif sim_outfit_level == OutfitLevel.REVEALING or sim_outfit_level == OutfitLevel.UNDERWEAR: sim_nudity_skill_level = get_sim_nudity_skill_level(sim_identifier) increase_sim_nudity_skill( sim_identifier, sims_around_value * (get_nudity_skill_points_modifier( NuditySkillIncreaseReason.BEING_IN_REVEALING_OUTFIT) / (sim_nudity_skill_level * sim_nudity_skill_level)), extra_fatigue=0.15, reason=NuditySkillIncreaseReason.BEING_IN_REVEALING_OUTFIT)
def _on_outfit_change_from_interaction(sim_info, reason=None, tags=None): if reason is not None and reason not in BLOCK_OUTFIT_CHANGE_REASONS: return if tags and not any(i in tags for i in BLOCK_OUTFIT_CHANGE_TAGS): return sim_outfit_level = get_sim_outfit_level(sim_info) if sim_outfit_level == OutfitLevel.NUDE: return (TurboCASUtil.OutfitCategory.SPECIAL, 0) if sim_outfit_level == OutfitLevel.BATHING: return (TurboCASUtil.OutfitCategory.BATHING, 0) if ( tags and any(i in tags for i in UNDRESSING_OCCASION_OUTFIT_CHANGE_TAGS) or reason is not None ) and reason in UNDRESSING_OCCASION_OUTFIT_CHANGE_REASONS and _has_chance_for_random_undressing( sim_info): reset_sim_bathing_outfits(sim_info) copy_outfit_to_special( sim_info, set_special_outfit=False, outfit_category_and_index=(TurboCASUtil.OutfitCategory.BATHING, 0)) return (TurboCASUtil.OutfitCategory.SPECIAL, 0)
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)
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 increase_sim_nudity_time_statistic(sim_identifier): sim_outfit_level = get_sim_outfit_level(sim_identifier) if sim_outfit_level == OutfitLevel.NUDE or sim_outfit_level == OutfitLevel.BATHING: increase_sim_ww_statistic(sim_identifier, 'time_spent_nude')
def react_to_sims_nudity(sim): if not get_nudity_setting(NuditySetting.REACTION_TO_NUDITY_STATE, variable_type=bool): return False if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.TODDLER, or_equal=True): return False full_reaction_cooldown = sim_ev(sim).full_nudity_reaction_cooldown inner_reaction_cooldown = sim_ev(sim).inner_nudity_reaction_cooldown if full_reaction_cooldown > 0: return False if inner_reaction_cooldown > 0: return False if full_reaction_cooldown > 0 and inner_reaction_cooldown > 0: return False if is_sim_in_sex(sim) or is_sim_going_to_sex(sim): return False if has_sim_situations(sim, (SimSituation.GRIMREAPER, SimSituation.FIRE, SimSituation.BABYBIRTH_HOSPITAL)): return False sim_outfit_level = get_sim_outfit_level(sim) if sim_outfit_level == OutfitLevel.NUDE or sim_outfit_level == OutfitLevel.BATHING: return False if not is_sim_available(sim): return False has_permission_to_nudity = None line_of_sight = TurboMathUtil.LineOfSight.create( TurboSimUtil.Location.get_routing_surface(sim), TurboSimUtil.Location.get_position(sim), 8.0) targets = list() for target in TurboManagerUtil.Sim.get_all_sim_instance_gen(humans=True, pets=False): if sim is target: continue if has_relationship_bit_with_sim(sim, target, SimRelationshipBit.WW_JUST_HAD_SEX): continue if TurboSimUtil.Age.is_younger_than(target, TurboSimUtil.Age.CHILD): continue if is_sim_in_sex(target): continue if not TurboSimUtil.Location.is_visible(target): continue if TurboSimUtil.Spawner.is_leaving(target): continue target_outfit_level = get_sim_outfit_level(target) if target_outfit_level != OutfitLevel.NUDE and target_outfit_level != OutfitLevel.BATHING: continue if not TurboMathUtil.LineOfSight.test( line_of_sight, TurboSimUtil.Location.get_position(target)): continue if target_outfit_level == OutfitLevel.BATHING: extra_skill_level = 1 else: extra_skill_level = 0 update_sim_nudity_skill_on_seeing_nudity(sim, target) if has_permission_to_nudity is None: has_permission_to_nudity = has_sim_permission_for_nudity( sim, extra_skill_level=extra_skill_level)[0] if has_permission_to_nudity is True: continue targets.append(target) if targets: is_mixer_only = _is_only_mixer_reaction(sim) target = random.choice(targets) if _nudity_reaction(sim, target, only_mixer=is_mixer_only): return True return False
def _trigger_nudity_autonomy_on_game_update(): if not get_nudity_setting(NuditySetting.NUDITY_SWITCH_STATE, variable_type=bool): return if get_nudity_setting( NuditySetting.AUTONOMY_TYPE, variable_type=int) == NudityAutonomyTypeSetting.DISABLED: return is_special_lot = TurboWorldUtil.Venue.get_current_venue_type() in ( VenueType.BAR, VenueType.LOUNGE, VenueType.CLUB) for sim in TurboManagerUtil.Sim.get_all_sim_instance_gen(humans=True, pets=False): if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.CHILD): continue if CNSimUtils.can_have_sex(sim): continue if TurboWorldUtil.Time.get_absolute_ticks() <= sim_ev( sim).last_nudity_autonomy: continue if get_nudity_setting( NuditySetting.AUTONOMY_TYPE, variable_type=int ) == NudityAutonomyTypeSetting.NPC_ONLY and TurboSimUtil.Sim.is_player( sim): continue if not is_sim_allowed_for_autonomy(sim): continue if not _is_sim_ready_to_undress(sim): sim_ev( sim ).last_nudity_autonomy = TurboWorldUtil.Time.get_absolute_ticks( ) + 30000 is_sim_on_lot = TurboWorldUtil.Lot.is_position_on_active_lot( TurboSimUtil.Location.get_position(sim)) has_child_sims_on_lot = False for target in TurboManagerUtil.Sim.get_all_sim_instance_gen( humans=True, pets=False): if sim is target: continue if is_special_lot is False and TurboSimUtil.Age.is_younger_than( target, TurboSimUtil.Age.CHILD): has_child_sims_on_lot = True break if get_sim_outfit_level(target) == OutfitLevel.NUDE: if is_sim_on_lot is True and TurboWorldUtil.Lot.is_position_on_active_lot( TurboSimUtil.Location.get_position(target) ) or TurboMathUtil.Position.get_distance( TurboSimUtil.Location.get_position(sim), TurboSimUtil.Location.get_position(target)) <= 12: continue if has_child_sims_on_lot is True: sim_ev( sim ).last_nudity_autonomy = TurboWorldUtil.Time.get_absolute_ticks( ) + 30000 if is_sim_exhibitionist(sim): continue if random.uniform(0, 1) > sim_ev(sim).nudity_autonomy_chance: sim_ev( sim ).last_nudity_autonomy = TurboWorldUtil.Time.get_absolute_ticks( ) + 25000 if trigger_nudity_autonomy(sim): sim_ev( sim ).last_nudity_autonomy = TurboWorldUtil.Time.get_absolute_ticks( ) + 55000 sim_ev(sim).nudity_autonomy_chance = 0.05 return