def _update_sim_statistics(sim_identifier): sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier) set_sim_ww_statistic(sim_info, 'unique_sex_partners', 0) set_sim_ww_statistic(sim_info, 'unique_sex_partner_teen', 0) set_sim_ww_statistic(sim_info, 'unique_sex_partner_youngadult', 0) set_sim_ww_statistic(sim_info, 'unique_sex_partner_adult', 0) set_sim_ww_statistic(sim_info, 'unique_sex_partner_elder', 0) for target_sim_info in TurboManagerUtil.Sim.get_all_sim_info_gen( humans=True, pets=False): if sim_info is not target_sim_info and has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO): increase_sim_ww_statistic(sim_info, 'unique_sex_partners') if TurboSimUtil.Age.get_age( target_sim_info ) == TurboSimUtil.Age.TEEN or TurboSimUtil.Age.get_age( target_sim_info) == TurboSimUtil.Age.CHILD: increase_sim_ww_statistic(sim_info, 'unique_sex_partner_teen') elif TurboSimUtil.Age.get_age( target_sim_info) == TurboSimUtil.Age.YOUNGADULT: increase_sim_ww_statistic(sim_info, 'unique_sex_partner_youngadult') elif TurboSimUtil.Age.get_age( target_sim_info) == TurboSimUtil.Age.ADULT: increase_sim_ww_statistic(sim_info, 'unique_sex_partner_adult') elif TurboSimUtil.Age.get_age( target_sim_info) == TurboSimUtil.Age.ELDER: increase_sim_ww_statistic(sim_info, 'unique_sex_partner_elder')
def _get_possible_partners(sex_handler, sims_list, actor_id, sim_info): checked_sim_ids = set() pregnancy_pairs = set() actions = sex_handler.get_animation_instance().get_actor_received_actions( actor_id) for (action_actor_id, action_type, is_cum_inside) in actions: if action_type != SexCategoryType.VAGINAL: pass if actor_id == action_actor_id: pass actor_sim_id = sex_handler.get_sim_id_by_actor_id(action_actor_id) if actor_sim_id in checked_sim_ids: pass actor_sim_info = TurboManagerUtil.Sim.get_sim_info(actor_sim_id) while not actor_sim_info is None: if actor_sim_info is sim_info: pass if has_relationship_bit_with_sim( sim_info, actor_sim_info, SimRelationshipBit.WW_POTENTIAL_PREGNANCY_PARENT): checked_sim_ids.add(actor_sim_id) if not can_sim_impregnate(actor_sim_info): pass pregnancy_pairs.add((actor_sim_id, is_cum_inside)) checked_sim_ids.add(actor_sim_id) if len(sims_list) == 2 and sex_handler.get_animation_instance( ).get_sex_category() == SexCategoryType.VAGINAL: for (action_actor_id, actor_sim_info) in sims_list: if actor_id == action_actor_id: pass if action_actor_id in checked_sim_ids: pass if actor_sim_info is sim_info: pass actor_sim_id = TurboManagerUtil.Sim.get_sim_id(actor_sim_info) if has_relationship_bit_with_sim( sim_info, actor_sim_info, SimRelationshipBit.WW_POTENTIAL_PREGNANCY_PARENT): checked_sim_ids.add(actor_sim_id) if not can_sim_impregnate(actor_sim_info): pass pregnancy_pairs.add((actor_sim_id, True)) checked_sim_ids.add(actor_sim_id) return pregnancy_pairs
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
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 _reaction_to_sims_cum(sim): if not get_sex_setting(SexSetting.REACTION_TO_CUM_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_cum_reaction_cooldown inner_reaction_cooldown = sim_ev(sim).inner_cum_reaction_cooldown 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 not is_sim_available(sim): return False if has_sim_situations(sim, (SimSituation.GRIMREAPER, SimSituation.FIRE, SimSituation.BABYBIRTH_HOSPITAL)): return False if _has_sim_visible_cum(sim): return False line_of_sight = TurboMathUtil.LineOfSight.create( TurboSimUtil.Location.get_routing_surface(sim), TurboSimUtil.Location.get_position(sim), 2.5) targets = list() for target in TurboManagerUtil.Sim.get_all_sim_instance_gen(humans=True, pets=False): if sim is target: continue if TurboSimUtil.Age.is_younger_than(target, TurboSimUtil.Age.CHILD): continue if has_relationship_bit_with_sim(sim, target, SimRelationshipBit.WW_JUST_HAD_SEX): continue if not _has_sim_visible_cum(target): continue if not TurboSimUtil.Location.is_visible(target): continue if TurboSimUtil.Spawner.is_leaving(target): continue if not TurboMathUtil.LineOfSight.test( line_of_sight, TurboSimUtil.Location.get_position(target)): continue targets.append(target) if targets: is_mixer_only = _is_only_mixer_reaction(sim) target = random.choice(targets) if _cum_reaction(sim, target, only_mixer=is_mixer_only): return True return False
def _get_jealousy_sims_from_sex_handler(sim, sex_handler): found_lovers = list() found_non_lovers = list() for target in sex_handler.get_actors_sim_instance_gen(): if target is None: continue if has_sim_trait(target, SimTrait.PLAYER): continue current_romance_rel_amount = get_relationship_with_sim( sim, target, RelationshipTrackType.ROMANCE) 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_GETTINGMARRIED): found_lovers.append(target) if current_romance_rel_amount > 0 and ( has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_SOULMATES) or (has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_SWEETHEARTS) or has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_ROMANTICINTEREST)) or has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_SIGNIFICANT_OTHER)): found_lovers.append(target) if current_romance_rel_amount > 10 and has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_AWKWARDLOVERS): found_lovers.append(target) if current_romance_rel_amount > 10 and has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_ENEMIESWITHBENEFITS): found_lovers.append(target) if current_romance_rel_amount >= 75: found_lovers.append(target) found_non_lovers.append(target) return (found_lovers, found_non_lovers)
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
def _reaction_to_teen_sims_pregnancy(sim): if not get_sex_setting(SexSetting.REACTION_TO_TEEN_PREGNANCY_STATE, variable_type=bool): return False if TurboSimUtil.Age.get_age(sim) != TurboSimUtil.Age.TEEN: return False if not TurboSimUtil.Pregnancy.is_pregnant(sim): return False if not has_sim_buffs(sim, TEEN_PREGNANCY_REACTION_BUFFS): return False if not TurboSimUtil.Location.is_visible(sim): return False if TurboSimUtil.Spawner.is_leaving(sim): return False sim_parents_ids = get_sim_ids_with_relationsip_bit(sim, SimRelationshipBit.FAMILY_PARENT) if not sim_parents_ids: return False sim_pregnancy_partner = TurboSimUtil.Pregnancy.get_partner(sim) parent_sims = list() for parent_sim_id in sim_parents_ids: parent_sim = TurboManagerUtil.Sim.get_sim_info(parent_sim_id) if parent_sim is None: pass if has_relationship_bit_with_sim(parent_sim, sim, SimRelationshipBit.WW_KNOWS_ABOUT_TEEN_PREGNANCY): pass if sim_pregnancy_partner is not None and TurboManagerUtil.Sim.get_sim_id(sim_pregnancy_partner) == parent_sim_id: pass parent_sims.append(parent_sim) if not parent_sims: return False line_of_sight = TurboMathUtil.LineOfSight.create(TurboSimUtil.Location.get_routing_surface(sim), TurboSimUtil.Location.get_position(sim), 8.0) for parent_sim_info in parent_sims: target = TurboManagerUtil.Sim.get_sim_instance(parent_sim_info) if target is None: pass if has_sim_situations(target, (SimSituation.GRIMREAPER, SimSituation.FIRE, SimSituation.BABYBIRTH_HOSPITAL)): pass if not is_sim_available(target): pass if not TurboMathUtil.LineOfSight.test(line_of_sight, TurboSimUtil.Location.get_position(target)): pass while _reaction_to_pregnancy(target, sim): return True return False
def _get_sex_satisfaction_level(sim_info, sims_list, sex_handler=None): sim_state_snapshot = sim_ev(sim_info).sim_immutable_sex_state_snapshot satisfaction_threshold = 0.0 for (_, target_sim_info) in sims_list: if sim_info is target_sim_info: continue sim_satisfaction_threshold = 1.0 if (get_relationship_with_sim(sim_info, target_sim_info, RelationshipTrackType.FRIENDSHIP) + get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.ROMANCE)) / 2 >= 40: sim_satisfaction_threshold = 0.85 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.WW_KNOWS_SEX_FANTASY): sim_satisfaction_threshold = 0.75 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit. ROMANTICCOMBO_SOULMATES) or has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit. ROMANTICCOMBO_LOVERS) or has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTICCOMBO_SWEETHEARTS): sim_satisfaction_threshold = 0.6 if has_sim_trait(sim_info, SimTrait.ROMANTIC) or has_sim_trait( sim_info, SimTrait.JEALOUS) or has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.WW_KNOWS_SEX_FANTASY): sim_satisfaction_threshold = 0.55 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_GETTINGMARRIED) 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): sim_satisfaction_threshold = 0.5 if has_sim_trait(sim_info, SimTrait.FAMILYORIENTED) or has_sim_trait( sim_info, SimTrait.FAMILYSIM): sim_satisfaction_threshold = 0.45 if has_sim_trait(sim_info, SimTrait.COMMITMENTISSUES ) and sim_satisfaction_threshold <= 0.55: sim_satisfaction_threshold = 0.55 satisfaction_threshold += sim_satisfaction_threshold satisfaction_threshold /= max(1, len(sims_list) - 1) satisfaction_value = 0.0 for (_, target_sim_info) in sims_list: if sim_info is target_sim_info: continue target_state_snapshot = sim_ev( target_sim_info).sim_immutable_sex_state_snapshot if 'motive_hygiene' in target_state_snapshot: hygiene_motive_snapshot = target_state_snapshot['motive_hygiene'] if not has_sim_trait(sim_info, SimTrait.SLOB): satisfaction_value += 0.25 if has_sim_trait(sim_info, SimTrait.NEAT) and hygiene_motive_snapshot >= 90: satisfaction_value += 0.4 elif hygiene_motive_snapshot >= 50: satisfaction_value += 0.25 elif hygiene_motive_snapshot <= -55: satisfaction_value += -0.15 if not has_sim_trait( sim_info, SimTrait.NEAT) and not has_sim_trait( sim_info, SimTrait.SQUEAMISH) else -0.2 if 'motive_energy' in target_state_snapshot: energy_motive_snapshot = target_state_snapshot['motive_energy'] if energy_motive_snapshot >= 90: satisfaction_value += 0.25 elif energy_motive_snapshot >= 50: satisfaction_value += 0.2 elif energy_motive_snapshot <= -55: satisfaction_value += -0.05 sim_mood = sim_state_snapshot[ 'mood'] if 'mood' in sim_state_snapshot else TurboResourceUtil.Resource.get_guid64( TurboSimUtil.Mood.get_mood(sim_info)) target_mood = target_state_snapshot[ 'mood'] if 'mood' in target_state_snapshot else TurboResourceUtil.Resource.get_guid64( TurboSimUtil.Mood.get_mood(target_sim_info)) if target_mood in POSITIVE_MOODS: if sim_mood in POSITIVE_MOODS: satisfaction_value += 0.4 elif sim_mood in NEGATIVE_MOODS: satisfaction_value += 0.5 elif target_mood in NEGATIVE_MOODS: if sim_mood in POSITIVE_MOODS and has_sim_trait( sim_info, SimTrait.MEAN): satisfaction_value += 0.3 elif has_sim_trait(sim_info, SimTrait.GOOD) or has_sim_trait( sim_info, SimTrait.CHEERFUL): satisfaction_value += 0.15 elif has_sim_trait(sim_info, SimTrait.EVIL): satisfaction_value += 0.4 else: satisfaction_value += -0.1 sims_age_difference = AGE_INDEX.index( TurboSimUtil.Age.get_age(sim_info)) - AGE_INDEX.index( TurboSimUtil.Age.get_age(target_sim_info)) if TurboSimUtil.Gender.is_male(sim_info): if sims_age_difference > 0: satisfaction_value += 0.075 * (sims_age_difference + 1) elif sims_age_difference == 0 or sims_age_difference == -1: satisfaction_value += 0.1 elif sims_age_difference == 0: satisfaction_value += 0.1 elif abs(sims_age_difference) == 1: satisfaction_value += 0.15 if TurboSimUtil.Gender.is_female( sim_info) and TurboSimUtil.Gender.is_male(target_sim_info): target_sim_age = TurboSimUtil.Age.get_age(target_sim_info) if (target_sim_age == TurboSimUtil.Age.TEEN or target_sim_age == TurboSimUtil.Age.CHILD) and random.uniform(0, 1) < 0.25: satisfaction_value += -0.05 elif target_sim_age == TurboSimUtil.Age.YOUNGADULT and random.uniform( 0, 1) < 0.1: satisfaction_value += -0.1 elif target_sim_age == TurboSimUtil.Age.ADULT and random.uniform( 0, 1) < 0.1: satisfaction_value += -0.1 elif target_sim_age == TurboSimUtil.Age.ELDER and random.uniform( 0, 1) < 0.3: satisfaction_value += -0.05 if has_sim_trait(target_sim_info, SimTrait.LAZY): satisfaction_value += -0.05 if has_sim_trait(target_sim_info, SimTrait.CHILDISH): satisfaction_value += -0.05 if has_sim_trait(target_sim_info, SimTrait.CLUMSY) and random.uniform(0, 1) <= 0.25: satisfaction_value += -0.05 if has_sim_trait(target_sim_info, SimTrait.ACTIVE): satisfaction_value += 0.05 if has_sim_trait(target_sim_info, SimTrait.DANCEMACHINE): satisfaction_value += 0.05 if has_sim_trait(target_sim_info, SimTrait.GOOFBALL) and random.uniform(0, 1) <= 0.25: satisfaction_value += 0.1 if has_sim_trait(sim_info, SimTrait.SNOB) and has_sim_trait( target_sim_info, SimTrait.SNOB): satisfaction_value += 0.1 if has_sim_trait(sim_info, SimTrait.BRO) and has_sim_trait( target_sim_info, SimTrait.BRO): satisfaction_value += 0.1 if has_sim_trait(sim_info, SimTrait.ROMANTIC) and has_sim_trait( target_sim_info, SimTrait.ALLURING): satisfaction_value += 0.05 if get_sim_skill_level(target_sim_info, SimSkill.FITNESS) >= 7: satisfaction_value += 0.05 satisfaction_value /= max(1, len(sims_list) - 1) if 'motive_energy' in sim_state_snapshot: energy_motive_snapshot = sim_state_snapshot['motive_energy'] if energy_motive_snapshot >= 90: satisfaction_value += 0.15 elif energy_motive_snapshot >= 50: satisfaction_value += 0.1 elif energy_motive_snapshot <= -55: satisfaction_value += -0.05 if 'motive_bladder' in sim_state_snapshot: bladder_motive_snapshot = sim_state_snapshot['motive_bladder'] if bladder_motive_snapshot >= -50 and bladder_motive_snapshot < -25: satisfaction_value += 0.1 if has_sim_trait(sim_info, SimTrait.OUTGOING) and len(sims_list) > 2: satisfaction_value += 0.1 if has_sim_trait(sim_info, SimTrait.WW_EXHIBITIONIST) and ( sex_handler is not None and TurboWorldUtil.Venue.get_current_venue_type() not in (VenueType.RESIDENTIAL, VenueType.PENTHOUSE, VenueType.RENTABLE_CABIN) ) and not TurboWorldUtil.Lot.is_sim_on_home_lot(sim_info): satisfaction_value += 0.1 if has_sim_trait(sim_info, SimTrait.LOVESOUTDOORS) and ( sex_handler is not None and TurboWorldUtil.Lot.is_location_outside( sex_handler.get_location()) ) and TurboWorldUtil.Lot.is_sim_on_home_lot(sim_info): satisfaction_value += 0.05 if has_sim_trait(sim_info, SimTrait.INSANE) and random.uniform(0, 1) <= 0.3: if random.uniform(0, 1) <= 0.5: satisfaction_value += 0.25 else: satisfaction_value += -0.25 if 'has_positive_desire_buff' in sim_state_snapshot and sim_state_snapshot[ 'has_positive_desire_buff'] is True: satisfaction_value += 0.2 if sex_handler is not None and sex_handler.has_reacted_sims_list: reactions_satisfaction_value = 0.0 for reacted_sim_id in sex_handler.has_reacted_sims_list: reacted_sim_info = TurboManagerUtil.Sim.get_sim_info( reacted_sim_id) if reacted_sim_info is not None: (sex_reaction_data, _, _) = get_reaction_type(reacted_sim_info, sex_handler, allow_special_types=True) if sex_reaction_data[0] in POSITIVE_REACTIONS: reactions_satisfaction_value += 0.05 if not has_sim_trait( sim_info, SimTrait.WW_EXHIBITIONIST) else 0.1 elif sex_reaction_data[0] == SexReactionType.CUCK: reactions_satisfaction_value += 0.15 elif sex_reaction_data[0] == SexReactionType.JEALOUS: reactions_satisfaction_value += -0.1 elif sex_reaction_data[ 0] in NEGATIVE_REACTIONS and not has_sim_trait( sim_info, SimTrait.WW_EXHIBITIONIST): reactions_satisfaction_value += -0.05 satisfaction_value += reactions_satisfaction_value / len( sex_handler.has_reacted_sims_list) satisfaction_level_value = satisfaction_value / satisfaction_threshold if satisfaction_level_value <= 0.0: return 0.0 if satisfaction_level_value < 1.0: if random.uniform(0, 1) <= satisfaction_level_value: return 1.0 return 0.0 return round(satisfaction_level_value)
def _get_sim_satisfaction_type(sim_info, sims_list, satisfaction_level, sex_handler=None): sim_state_snapshot = sim_ev(sim_info).sim_immutable_sex_state_snapshot if satisfaction_level <= 0: satisfaction_type = SexUnsatisfactionType.GENERIC if SexUnsatisfactionType.BAD_EXPERIENICE < satisfaction_type: sim_mood = sim_state_snapshot[ 'mood'] if 'mood' in sim_state_snapshot else TurboResourceUtil.Resource.get_guid64( TurboSimUtil.Mood.get_mood(sim_info)) for (_, target_sim_info) in sims_list: if sim_info is target_sim_info: continue if (sim_mood == SimMood.FLIRTY or has_sim_trait(sim_info, SimTrait.ROMANTIC) or has_sim_trait(sim_info, SimTrait.JEALOUS) ) and (get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType. FRIENDSHIP) + get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.ROMANCE)) / 2 >= 40: satisfaction_type = SexUnsatisfactionType.BAD_EXPERIENICE break if has_sim_trait(sim_info, SimTrait.FAMILYORIENTED) or has_sim_trait( sim_info, SimTrait.FAMILYSIM): 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_GETTINGMARRIED) 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): satisfaction_type = SexUnsatisfactionType.BAD_EXPERIENICE break if SexUnsatisfactionType.BAD_PERFORMANCE < satisfaction_type: if has_sim_trait(sim_info, SimTrait.ACTIVE) or get_sim_skill_level( sim_info, SimSkill.FITNESS) >= 7: satisfaction_type = SexUnsatisfactionType.BAD_PERFORMANCE else: satisfaction_type = SexSatisfactionType.GENERIC if not (SexSatisfactionType.STRANGER_SEX < satisfaction_type and has_sim_trait(sim_info, SimTrait.LONER)): for (_, target_sim_info) in sims_list: if sim_info is target_sim_info: continue friendship_track_score = get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.FRIENDSHIP) romance_track_score = get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.ROMANCE) if friendship_track_score < 30 and romance_track_score < 10: satisfaction_type = SexSatisfactionType.STRANGER_SEX break if SexSatisfactionType.YOUNG_SEX < satisfaction_type: for (_, target_sim_info) in sims_list: if sim_info is target_sim_info: continue if TurboSimUtil.Age.get_age( target_sim_info ) < TurboSimUtil.Age.get_age(sim_info) and abs( AGE_INDEX.index(TurboSimUtil.Age.get_age(sim_info)) - AGE_INDEX.index( TurboSimUtil.Age.get_age(target_sim_info))) >= 2: satisfaction_type = SexSatisfactionType.YOUNG_SEX break if has_sim_trait( sim_info, SimTrait.WW_EXHIBITIONIST ) and TurboWorldUtil.Venue.get_current_venue_type() not in ( VenueType.RESIDENTIAL, VenueType.PENTHOUSE, VenueType.RENTABLE_CABIN ) and not TurboWorldUtil.Lot.is_sim_on_home_lot(sim_info): satisfaction_type = SexSatisfactionType.PUBLIC_SEX if SexSatisfactionType.PUBLIC_SEX < satisfaction_type and ( has_sim_trait(sim_info, SimTrait.LOVESOUTDOORS) and sex_handler is not None) and random.uniform(0, 1) <= 0.25: if TurboWorldUtil.Lot.is_location_outside(sex_handler.get_location( )) and not TurboWorldUtil.Lot.is_sim_on_home_lot(sim_info): satisfaction_type = SexSatisfactionType.PUBLIC_SEX if SexSatisfactionType.AUDIENCE < satisfaction_type and ( not has_sim_trait(sim_info, SimTrait.UNFLIRTY) and sex_handler is not None) and sex_handler.has_reacted_sims_list: reaction_sims_list = sex_handler.has_reacted_sims_list.difference( sex_handler.go_away_sims_list) reactions_count = 0 for reacted_sim_id in reaction_sims_list: reacted_sim_info = TurboManagerUtil.Sim.get_sim_info( reacted_sim_id) if reacted_sim_info is not None: (sex_reaction_data, _, _) = get_reaction_type(reacted_sim_info, sex_handler) if sex_reaction_data[0] in POSITIVE_REACTIONS: reactions_count += 1 elif sex_reaction_data[0] == SexReactionType.CUCK: reactions_count += 2 elif sex_reaction_data[0] == SexReactionType.JEALOUS: reactions_count -= 2 elif sex_reaction_data[ 0] in NEGATIVE_REACTIONS and not has_sim_trait( sim_info, SimTrait.WW_EXHIBITIONIST): reactions_count -= 1 if reactions_count > 0: satisfaction_type = SexSatisfactionType.AUDIENCE if SexSatisfactionType.FAMILY_SEX < satisfaction_type and ( has_sim_trait(sim_info, SimTrait.FAMILYORIENTED) or has_sim_trait(sim_info, SimTrait.FAMILYSIM)): for (_, target_sim_info) in sims_list: if sim_info is target_sim_info: continue 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_GETTINGMARRIED ) or has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_MARRIED): satisfaction_type = SexSatisfactionType.FAMILY_SEX break if SexSatisfactionType.GHOST_SEX < satisfaction_type: for (_, target_sim_info) in sims_list: if sim_info is target_sim_info: continue if TurboSimUtil.Sim.is_npc( target_sim_info) and TurboSimUtil.Occult.is_ghost( target_sim_info): satisfaction_type = SexSatisfactionType.GHOST_SEX break if SexSatisfactionType.GROUP_SEX < satisfaction_type and len( sims_list) > 2: satisfaction_type = SexSatisfactionType.GROUP_SEX return satisfaction_type
def _jealousy_from_sex_reaction(sim, sex_handler): if not get_relationship_setting(RelationshipSetting.JEALOUSY_STATE, variable_type=bool): return False if sex_handler.get_actors_amount() <= 1: return False if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.CHILD): return False if has_sim_trait(sim, SimTrait.WW_POLYAMOROUS) or has_sim_trait( sim, SimTrait.WW_CUCKOLD): return False (found_lovers, found_non_lovers) = _get_jealousy_sims_from_sex_handler(sim, sex_handler) if found_lovers and found_non_lovers: for target in found_non_lovers: relationship_amount_modifier = -3 if not has_sim_trait( sim, SimTrait.JEALOUS) else -6 change_relationship_with_sim(sim, target, RelationshipTrackType.FRIENDSHIP, relationship_amount_modifier) if get_relationship_with_sim(sim, target, RelationshipTrackType.ROMANCE) > 0: change_relationship_with_sim(sim, target, RelationshipTrackType.ROMANCE, relationship_amount_modifier) for target in found_lovers: jealousy_success = False for jealousy_interaction in JEALOUSY_WOOHOO_REACTION_LIST: result = TurboSimUtil.Interaction.push_affordance( sim, jealousy_interaction, target=target, interaction_context=TurboInteractionUtil. InteractionContext.SOURCE_SCRIPT, insert_strategy=TurboInteractionUtil.QueueInsertStrategy. NEXT, must_run_next=True, priority=TurboInteractionUtil.Priority.High, run_priority=TurboInteractionUtil.Priority.High) if result: jealousy_success = True break if has_sim_buff(sim, SimBuff.JEALOUSY_CHEATER): current_romance_rel_amount = get_relationship_with_sim( sim, target, RelationshipTrackType.ROMANCE) if current_romance_rel_amount >= 30 and 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_GETTINGMARRIED) ) or has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_SIGNIFICANT_OTHER): add_sim_buff(sim, SimBuff.JEALOUSY_HIDDEN_WITNESSEDCHEATING) if jealousy_success is True: sim_ev(sim).sex_reaction_cooldown = 5 return True return False
def get_reaction_type(sim, sex_handler, allow_special_types=False): sex_reaction_data = SEX_REACTION_NEUTARL sex_reaction_should_left = True sex_reaction_target_override = None for target in sex_handler.get_actors_sim_instance_gen(): if target is None: continue if allow_special_types is True and ( SEX_REACTION_JEALOUS[0] > sex_reaction_data[0] and (get_relationship_setting(RelationshipSetting.JEALOUSY_STATE, variable_type=bool) and (sex_handler.get_actors_amount() > 1 and not has_sim_trait(sim, SimTrait.WW_POLYAMOROUS))) ) and not has_sim_trait(sim, SimTrait.WW_CUCKOLD): (found_lovers, found_non_lovers) = _get_jealousy_sims_from_sex_handler( sim, sex_handler) if found_lovers and found_non_lovers: sex_reaction_data = SEX_REACTION_JEALOUS sex_reaction_should_left = True if SEX_REACTION_HORRIFIED[0] > sex_reaction_data[0] and ( TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.CHILD) or is_true_family_relationship(sim, target)): sex_reaction_data = SEX_REACTION_HORRIFIED sex_reaction_should_left = True if SEX_REACTION_CUCK_MALE[0] > sex_reaction_data[0] and has_sim_trait( sim, SimTrait.WW_CUCKOLD): (found_lovers, found_non_lovers) = _get_jealousy_sims_from_sex_handler( sim, sex_handler) if found_lovers and found_non_lovers: if TurboSimUtil.Gender.is_male(sim): sex_reaction_data = SEX_REACTION_CUCK_MALE else: sex_reaction_data = SEX_REACTION_CUCK_FEMALE sex_reaction_should_left = False sex_reaction_target_override = found_lovers[0] if SEX_REACTION_ANGRY[0] > sex_reaction_data[0] and ( get_relationship_with_sim( sim, target, RelationshipTrackType.FRIENDSHIP) <= -15 or has_sim_mood(sim, SimMood.STRESSED)): sex_reaction_data = SEX_REACTION_ANGRY sex_reaction_should_left = True if SEX_REACTION_SAD[0] > sex_reaction_data[ 0] and has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_BROKEN_UP ) and has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO): sex_reaction_data = SEX_REACTION_SAD sex_reaction_should_left = True if SEX_REACTION_FLIRTY_MALE[0] > sex_reaction_data[0] and ( has_sim_mood(sim, SimMood.FLIRTY) or get_relationship_with_sim( sim, target, RelationshipTrackType.ROMANCE) >= 40): if TurboSimUtil.Gender.is_male(sim): sex_reaction_data = SEX_REACTION_FLIRTY_MALE else: sex_reaction_data = SEX_REACTION_FLIRTY_FEMALE sex_reaction_should_left = False if SEX_REACTION_FUNNY[0] > sex_reaction_data[0] and ( has_sim_trait(sim, SimTrait.CHILDISH) or has_sim_trait(sim, SimTrait.GOOFBALL)): sex_reaction_data = SEX_REACTION_FUNNY sex_reaction_should_left = True if SEX_REACTION_EXCITED[0] > sex_reaction_data[0] and ( has_sim_mood(sim, SimMood.ENERGIZED) or has_sim_mood(sim, SimMood.CONFIDENT) or has_sim_trait(sim, SimTrait.BRO) and has_sim_trait(target, SimTrait.BRO)): sex_reaction_data = SEX_REACTION_EXCITED sex_reaction_should_left = False if SEX_REACTION_FRIENDLY[0] > sex_reaction_data[ 0] and get_relationship_with_sim( sim, target, RelationshipTrackType.FRIENDSHIP) > 40: sex_reaction_data = SEX_REACTION_FRIENDLY sex_reaction_should_left = True if sex_reaction_data == SEX_REACTION_NEUTARL: if has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_SOULMATES ) or (has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_SWEETHEARTS) or (has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTICCOMBO_ROMANTICINTEREST) or (has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_SIGNIFICANT_OTHER) or (has_relationship_bit_with_sim( sim, target, SimRelationshipBit.FRIENDSHIP_BFF) or has_relationship_bit_with_sim( sim, target, SimRelationshipBit.FRIENDSHIP_BFF_BROMANTICPARTNER)))) ) or has_relationship_bit_with_sim( sim, target, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO): sex_reaction_should_left = False return (sex_reaction_data, sex_reaction_should_left, sex_reaction_target_override)
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 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 get_relationship_score(sim_identifier, target_sim_identifier, skip_always_accept=False): sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier) target_sim_info = TurboManagerUtil.Sim.get_sim_info(target_sim_identifier) is_npc_exclusive = TurboSimUtil.Sim.is_npc( sim_info) and TurboSimUtil.Sim.is_npc(target_sim_info) if get_sex_setting( SexSetting.ALWAYS_ACCEPT_STATE, variable_type=bool ) and is_npc_exclusive is False and skip_always_accept is False: return 1000 if has_sim_trait(sim_info, SimTrait.WW_SEXUALLY_ABSTINENT): return -1000 if has_sim_trait(sim_info, SimTrait.BASEMENTAL_IS_A_DRUG_DEALER) and ( has_sim_buff(target_sim_info, SimBuff.BASEMENTAL_COCAINE_SEX_PAYMENT_HIDDEN) or has_sim_buff(target_sim_info, SimBuff.BASEMENTAL_AMPHETAMINE_SEX_PAYMENT_HIDDEN) or has_sim_buff(target_sim_info, SimBuff.BASEMENTAL_MDMA_SEX_PAYMENT_HIDDEN)): return 1000 if has_sim_trait( sim_info, SimTrait.BASEMENTAL_IS_A_COCAINE_DRUG_DEALER) and has_sim_buff( target_sim_info, SimBuff.BASEMENTAL_COCAINE_SEX_PAYMENT_HIDDEN): return 1000 if has_sim_trait( sim_info, SimTrait.BASEMENTAL_IS_A_AMPHETAMINE_DRUG_DEALER) and has_sim_buff( target_sim_info, SimBuff.BASEMENTAL_AMPHETAMINE_SEX_PAYMENT_HIDDEN): return 1000 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.BASEMENTAL_DEALER_COCAINE_COMPANION ) and has_relationship_bit_with_sim( target_sim_info, sim_info, SimRelationshipBit.BASEMENTAL_DEALER_COCAINE_COMPANION): return 1000 score = 0 if is_npc_exclusive: pre_sex_handler = sim_ev(sim_info).active_pre_sex_handler or sim_ev( target_sim_info).active_pre_sex_handler if pre_sex_handler is not None and (pre_sex_handler.is_manual_sex() or pre_sex_handler.is_autonomy_sex()): return 1000 if get_sex_setting(SexSetting.AUTONOMY_LEVEL, variable_type=int) == SexAutonomyLevelSetting.LOW: score += 3 elif get_sex_setting( SexSetting.AUTONOMY_LEVEL, variable_type=int) == SexAutonomyLevelSetting.NORMAL: score += 6 elif get_sex_setting( SexSetting.AUTONOMY_LEVEL, variable_type=int) == SexAutonomyLevelSetting.HIGH: score += 20 age_limit = get_age_limits_for_sex((sim_info, )) if TurboSimUtil.Age.is_younger_than( target_sim_info, age_limit[0]) or TurboSimUtil.Age.is_older_than( target_sim_info, age_limit[1]): return -1000 preferred_genders = get_sim_preferenced_genders(sim_info) if TurboSimUtil.Gender.get_gender( target_sim_info) in preferred_genders: score += 5 else: score += -5 if is_true_family_relationship(sim_info, target_sim_info): score += -50 current_charisma_skill_level = get_sim_skill_level( sim_info, SimSkill.ADULTMAJOR_CHARISMA) if 1 <= current_charisma_skill_level <= 2: score += 2 if 3 <= current_charisma_skill_level <= 4: score += 3 if 5 <= current_charisma_skill_level <= 6: score += 6 if 7 <= current_charisma_skill_level <= 8: score += 8 if 9 <= current_charisma_skill_level <= 10: score += 12 if has_sim_trait(sim_info, SimTrait.ALLURING): score += 4 if get_relationship_setting(RelationshipSetting.JEALOUSY_STATE, variable_type=bool) and not has_sim_trait( sim_info, SimTrait.WW_POLYAMOROUS): current_significant_sims = get_sim_relationship_sims(sim_info) if current_significant_sims: if TurboManagerUtil.Sim.get_sim_id( target_sim_info) in current_significant_sims: score += 6 if not has_sim_trait( sim_info, SimTrait.COMMITMENTISSUES) else 3 else: score += -10 if not has_sim_trait( sim_info, SimTrait.COMMITMENTISSUES) else -5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_ROMANCE_STEAMY): score += 12 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_ROMANCE_AMOROUS): score += 7 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.FRIENDSHIP_BFF_BROMANTICPARTNER): score += 6 if has_relationship_bit_with_sim(sim_info, target_sim_info, SimRelationshipBit.FRIENDSHIP_BFF): score += 5 if has_relationship_bit_with_sim(sim_info, target_sim_info, SimRelationshipBit.FRIENDSHIP_BFF_EVIL): score += 4 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_ROMANCE_SUGGESTIVE): score += 5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FRIENDSHIP_FRIENDLY): score += 4 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_FUNNY): score += 4 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_HILARIOUS): score += 4 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_RETAIL_MILDLYINTERESTED): score += 1 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_RETAIL_UNINTERESTED): score += 1 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_RETAIL_VERYINTERESTED): score += 1 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FRIENDSHIP_DISTASTEFUL): score += -5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_BORING): score += -5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_TEDIOUS): score += -8 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FUN_INSUFFERABLYTEDIOUS): score += -15 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FRIENDSHIP_OFFENSIVE): score += -20 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_AWKWARDNESS_AWKWARD): score += -23 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_AWKWARDNESS_VERYAWKWARD): score += -23 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.SOCIALCONTEXT_FRIENDSHIP_ABHORRENT): score += -25 current_desire_level = get_sim_desire_level(sim_info) if current_desire_level >= 85: score += 10 elif current_desire_level >= 50: score += 7 current_friendship_rel_amount = get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.FRIENDSHIP) if -100 <= current_friendship_rel_amount <= -70: score += -10 if -70 <= current_friendship_rel_amount <= -30: score += -5 if -30 <= current_friendship_rel_amount <= -15: score += -2 if -15 <= current_friendship_rel_amount <= 25: score += 4 if 25 <= current_friendship_rel_amount <= 60: score += 8 if 60 <= current_friendship_rel_amount <= 100: score += 10 current_romantic_rel_amount = get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.ROMANCE) if -100 <= current_romantic_rel_amount <= -50: score += -6 if -50 <= current_romantic_rel_amount <= 0: score += -3 if 25 <= current_romantic_rel_amount <= 50: score += 10 if 50 <= current_romantic_rel_amount <= 100: score += 25 if has_sim_mood(sim_info, SimMood.FLIRTY): score += 7 if has_sim_mood(sim_info, SimMood.DAZED): score += 7 if has_sim_mood(sim_info, SimMood.CONFIDENT): score += 4 if has_sim_mood(sim_info, SimMood.HAPPY): score += 4 if has_sim_mood(sim_info, SimMood.PLAYFUL): score += 3 if has_sim_mood(sim_info, SimMood.ENERGIZED): score += 2 if has_sim_mood(sim_info, SimMood.FINE): score += 2 if has_sim_mood(sim_info, SimMood.INSPIRED): score += 2 if has_sim_mood(sim_info, SimMood.FOCUSED): score += 2 if has_sim_mood(sim_info, SimMood.INSPIRED): score += 2 if has_sim_mood(sim_info, SimMood.ANGRY): score += -3 if has_sim_mood(sim_info, SimMood.STRESSED): score += -5 if has_sim_mood(sim_info, SimMood.UNCOMFORTABLE): score += -5 if has_sim_mood(sim_info, SimMood.BORED): score += -6 if has_sim_mood(sim_info, SimMood.SAD): score += -10 if has_sim_mood(sim_info, SimMood.EMBARRASSED): score += -13 if has_sim_trait( sim_info, SimTrait.WW_SEXUALLY_ALLURING) and has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.HAS_MET): score += 50 if has_sim_trait( sim_info, SimTrait.EVIL) and get_sim_relationship_sims(target_sim_info): score += 4 if has_sim_trait(sim_info, SimTrait.LONER): score += 3 if has_sim_trait(sim_info, SimTrait.BRO) and has_sim_trait( target_sim_info, SimTrait.BRO): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_PASSIONATE): score += 10 if has_sim_buff(sim_info, SimBuff.CLUBS_PERKS_SOCIALBONUS_ROMANTIC): score += 10 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_FEARLESS): score += 5 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_ELATED): score += 5 if has_sim_buff(sim_info, SimBuff.FESTIVAL_BLOSSOM_TEAGLOW_SAKURA): score += 5 if has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_SUPER_QUALITY ) or (has_sim_buff(sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_HIGH_QUALITY) or has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_GOOD_1_QUALITY)) or has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_GOOD_2_QUALITY): score += 3 if has_sim_buff( sim_info, SimBuff.BASEMENTAL_COCAINE_HIGH_ON_HIGH_QUALITY) or has_sim_buff( sim_info, SimBuff.BASEMENTAL_COCAINE_HIGH_ON_MEDIUM_QUALITY): score += 3 if has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_MEDIUM_QUALITY) or has_sim_buff( sim_info, SimBuff.BASEMENTAL_MDMA_HIGH_ON_LOW_QUALITY): score += 2 if has_sim_buff( sim_info, SimBuff.BASEMENTAL_COCAINE_VERY_HIGH_ON_HIGH_QUALITY ) or has_sim_buff(sim_info, SimBuff.BASEMENTAL_COCAINE_VERY_HIGH_ON_MEDIUM_QUALITY): score += 3 if has_sim_buff(sim_info, SimBuff.BASEMENTAL_ALCOHOL_TIPSY): score += 1 elif has_sim_buff(sim_info, SimBuff.BASEMENTAL_ALCOHOL_DRUNK): score += 2 elif has_sim_buff(sim_info, SimBuff.BASEMENTAL_ALCOHOL_WASTED): score += 3 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_HUMILIATED) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_MORTIFIED): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_PUMPED): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_INTHEZONE): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_IMAGINATIVE) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_MUSER_TRAITREPLACEMENT) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_MUSERER_TRAITREPLACEMENT): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_SILLY) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_HYSTERICAL): score += 1 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_DEPRESSED) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_GLOOMIER): score += -5 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_STRESSED): score += -5 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_MISERABLE): score += -5 if has_sim_buff(sim_info, SimBuff.MOODHIDDEN_ENRAGED) or (has_sim_buff( sim_info, SimBuff.MOODHIDDEN_FURIOUS) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_HOTHEAD2)) or has_sim_buff( sim_info, SimBuff.MOODHIDDEN_HOTHEAD3): score += -5 if has_sim_buff(target_sim_info, SimBuff.OBJECT_DRINK_FLIRTY): score += 10 if has_sim_buff(target_sim_info, SimBuff.BROKENUPORDIVORCED_HIDDEN): score += -5 if has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HASBEENUNFAITHFUL): score += -8 if len( get_sim_ids_with_relationsip_bit( sim_info, SimRelationshipBit.SHORTTERM_JUSTBROKEUPORDIVORCED)) > 0: score += -18 if has_sim_situation_job( sim_info, SimSituationJob.RESTAURANTDINER_SUB_NPC_BADDATE_ANGRYSIM): score += -25 current_higiene_motive = get_sim_motive_value(sim_info, SimMotive.HYGIENE) if current_higiene_motive <= -50: score += -12 if current_higiene_motive == -100: score += -8 return score
def apply_after_sex_relationship(sex_handler, sims_list): if len(sims_list) <= 1: return if get_sex_setting(SexSetting.SEX_RELATIONS_IMPACT_STATE, variable_type=bool): relationship_value = int(min(sex_handler.one_second_counter / 15, 20)) for ((_, sim_info), (_, target_sim_info)) in itertools.combinations(sims_list, 2): relationship_tracks_score = list() if relationship_value > 0: romance_track_score = get_relationship_with_sim( sim_info, target_sim_info, RelationshipTrackType.ROMANCE) if romance_track_score <= 5 or has_sim_trait( sim_info, SimTrait.COMMITMENTISSUES ) and random.uniform(0, 1) <= 0.25 or has_sim_trait( sim_info, SimTrait.INSANE) and random.uniform(0, 1) <= 0.5: relationship_tracks_score.append( (RelationshipTrackType.FRIENDSHIP, relationship_value)) else: relationship_tracks_score.append( (RelationshipTrackType.ROMANCE, relationship_value * 0.8)) relationship_tracks_score.append( (RelationshipTrackType.FRIENDSHIP, relationship_value * 0.2)) for (relationship_track, relationship_score) in relationship_tracks_score: relationship_track_score = get_relationship_with_sim( sim_info, target_sim_info, relationship_track) if -100 <= relationship_track_score <= -40: relationship_score *= 1.0 elif -40 <= relationship_track_score <= 0: relationship_score *= 0.6 elif 0 <= relationship_track_score <= 20: relationship_score *= 0.4 elif 20 <= relationship_track_score <= 40: relationship_score *= 0.3 elif 40 <= relationship_track_score <= 80: relationship_score *= 0.2 elif 80 <= relationship_track_score <= 100: relationship_score *= 0.1 change_relationship_with_sim(sim_info, target_sim_info, relationship_track, relationship_score) if get_relationship_setting(RelationshipSetting.JEALOUSY_STATE, variable_type=bool): while True: for (_, sim_info) in sims_list: relationship_sims_ids = get_sim_relationship_sims(sim_info) while len(relationship_sims_ids) > 0: has_cheated = True for (_, target_sim_info) in sims_list: if sim_info is target_sim_info: pass while TurboManagerUtil.Sim.get_sim_id( target_sim_info) in relationship_sims_ids: has_cheated = False break if has_cheated is True: while True: for (_, target_sim_info) in sims_list: add_relationsip_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_CHEATEDWITH ) for ((_, sim_info), (_, target_sim_info)) in itertools.permutations(sims_list, 2): if not has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO): add_relationsip_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO) if not has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO_RECENTLY): add_relationsip_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.ROMANTIC_HAVEDONEWOOHOO_RECENTLY) while not has_relationship_bit_with_sim( sim_info, target_sim_info, SimRelationshipBit.WW_JUST_HAD_SEX): add_relationsip_bit_with_sim(sim_info, target_sim_info, SimRelationshipBit.WW_JUST_HAD_SEX)