def _is_only_mixer_reaction(sim): is_ready_for_inner = sim_ev(sim).inner_cum_reaction_cooldown <= 0 if is_ready_for_inner is True and has_sim_situations( sim, (SimSituation.BARISTA_VENUE, SimSituation.HIREDNPC_BARISTA, SimSituation.BARBARTENDER, SimSituation.BARTENDER_RESTAURANT, SimSituation.HIREDNPC_BARTENDER, SimSituation.HIREDNPC_CATERER, SimSituation.HIREDNPC_CATERER_VEGETARIAN, SimSituation.HIREDNPC_DJ, SimSituation.HIREDNPC_DJ_LEVEL10, SimSituation.SINGLEJOB_CLUB_DJ, SimSituation.SINGLEJOB_CLUB_DJ_LEVEL10, SimSituation.HIREDNPC_ENTERTAINER_GUITAR, SimSituation.HIREDNPC_ENTERTAINER_MICCOMEDY, SimSituation.HIREDNPC_ENTERTAINER_ORGAN, SimSituation.HIREDNPC_ENTERTAINER_PIANO, SimSituation.HIREDNPC_ENTERTAINER_VIOLIN, SimSituation.BUTLER_SITUATION, SimSituation.GYMTRAINER_VENUE, SimSituation.MAID_SITUATION, SimSituation.MAILMAN_SITUATION, SimSituation.PIZZADELIVERY_NEW, SimSituation.REPAIR_SITUATION, SimSituation.MASSAGETHERAPIST_VENUE, SimSituation.MASSAGETHERAPIST_SERVICECALL, SimSituation.CHEFSITUATION, SimSituation.HOST_1, SimSituation.RESTAURANT_WAITSTAFF, SimSituation.CAREER_DOCTOR_NPC_DOCTOR, SimSituation.CAREER_DOCTOR_NPC_ASSISTANT, SimSituation.CAREER_DOCTOR_NPC_DOCTOR_DIAGNOSER, SimSituation.CAREER_DOCTOR_NPC_NURSE, SimSituation.CAREER_DOCTOR_NPC_PATIENT_ADMITTED, SimSituation.DETECTIVE_APB, SimSituation.DETECTIVE_APBNEUTRAL, SimSituation.CAREER_DETECTIVE_APBPLAYER)): return True is_ready_for_full = sim_ev(sim).full_cum_reaction_cooldown <= 0 if is_ready_for_full is False: return True return False
def _trigger_desire_reaction_on_game_update(): 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 not CNSimUtils.can_have_sex(sim): continue if not is_sim_in_sex(sim): if is_sim_going_to_sex(sim): continue if has_sim_situations(sim, (SimSituation.GRIMREAPER, SimSituation.FIRE, SimSituation.BABYBIRTH_HOSPITAL)): continue if not is_sim_available(sim): continue line_of_sight = TurboMathUtil.LineOfSight.create(TurboSimUtil.Location.get_routing_surface(sim), TurboSimUtil.Location.get_position(sim), 8.0) 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 not _has_reaction_to_nudity(sim, target): continue if TurboSimUtil.Gender.get_gender(target) not in get_sim_preferenced_genders(sim): continue if not TurboSimUtil.Location.is_visible(target): continue if TurboSimUtil.Spawner.is_leaving(target): continue (desire_limit, desire_increase) = _get_desire_nudity_value(target) if not desire_limit <= 0 and desire_increase > 0: if get_sim_desire_level(sim) > desire_limit: continue if not TurboMathUtil.LineOfSight.test(line_of_sight, TurboSimUtil.Location.get_position(target)): continue change_sim_desire_level(sim, desire_increase)
def _sim_miscarriage_reaction(sim_identifier): line_of_sight = TurboMathUtil.LineOfSight.create( TurboSimUtil.Location.get_routing_surface(sim_identifier), TurboSimUtil.Location.get_position(sim_identifier), 8.0) for sim in TurboManagerUtil.Sim.get_all_sim_instance_gen(humans=True, pets=False): if sim is sim_identifier: pass if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.BABY, or_equal=True): pass while not is_sim_in_sex(sim): if is_sim_going_to_sex(sim): pass if has_sim_situations(sim, (SimSituation.GRIMREAPER, )): pass if not is_sim_available(sim): pass if not TurboMathUtil.LineOfSight.test( line_of_sight, TurboSimUtil.Location.get_position(sim)): pass TurboSimUtil.Interaction.push_affordance( sim, SimInteraction.WW_PREGNANCY_MISCARRIAGE_REACTION, target=sim_identifier, interaction_context=TurboInteractionUtil.InteractionContext. SOURCE_SCRIPT, insert_strategy=TurboInteractionUtil.QueueInsertStrategy.NEXT, must_run_next=True, priority=TurboInteractionUtil.Priority.Critical, run_priority=TurboInteractionUtil.Priority.Critical)
def _is_sim_ready_to_undress(sim): if is_sim_in_sex(sim) or is_sim_going_to_sex(sim): return False if get_sim_actual_body_state( sim, 6) == BodyState.NUDE and get_sim_actual_body_state( sim, 7) == BodyState.NUDE: return False if has_sim_traits(sim, (SimTrait.HIDDEN_ISEVENTNPC_CHALLENGE, )): return False if has_sim_situations( sim, (SimSituation.BARISTA_VENUE, SimSituation.HIREDNPC_BARISTA, SimSituation.BARBARTENDER, SimSituation.BARTENDER_RESTAURANT, SimSituation.HIREDNPC_BARTENDER, SimSituation.HIREDNPC_CATERER, SimSituation.HIREDNPC_CATERER_VEGETARIAN, SimSituation.HIREDNPC_DJ, SimSituation.HIREDNPC_DJ_LEVEL10, SimSituation.SINGLEJOB_CLUB_DJ, SimSituation.SINGLEJOB_CLUB_DJ_LEVEL10, SimSituation.HIREDNPC_ENTERTAINER_GUITAR, SimSituation.HIREDNPC_ENTERTAINER_MICCOMEDY, SimSituation.HIREDNPC_ENTERTAINER_ORGAN, SimSituation.HIREDNPC_ENTERTAINER_PIANO, SimSituation.HIREDNPC_ENTERTAINER_VIOLIN, SimSituation.BUTLER_SITUATION, SimSituation.GARDENER_SERVICE_SITUATION, SimSituation.NANNY_SITUATION, SimSituation.GYMTRAINER_VENUE, SimSituation.LANDLORD, SimSituation.LIBRARYVENUE_LIBRARIAN, SimSituation.MAID_SITUATION, SimSituation.MAILMAN_SITUATION, SimSituation.PIZZADELIVERY_NEW, SimSituation.FORESTRANGER_VACATIONARRIVAL, SimSituation.REFLEXOLOGIST_VENUE, SimSituation.REPAIR_SITUATION, SimSituation.TRAGICCLOWN, SimSituation.YOGAINSTRUCTOR_VENUE, SimSituation.MASSAGETHERAPIST_VENUE, SimSituation.MASSAGETHERAPIST_SERVICECALL, SimSituation.CHEFSITUATION, SimSituation.HOST_1, SimSituation.RESTAURANT_WAITSTAFF, SimSituation.RESTAURANTDINER_SUB_NPC_CRITIC, SimSituation.RETAILEMPLOYEE_HARDWORKER, SimSituation.RETAILEMPLOYEE_NPCSTORE_HARDWORKER, SimSituation.SINGLEJOB_COWORKER_RETAILEMPLOYEE, SimSituation.HIREDNPC_STALLVENDOR, SimSituation.HIREDNPC_VENDORSTALL, SimSituation.OPENSTREETS_STALLVENDOR, SimSituation.CAREER_DOCTOR_NPC_DOCTOR, SimSituation.CAREER_DOCTOR_NPC_ASSISTANT, SimSituation.CAREER_DOCTOR_NPC_DOCTOR_DIAGNOSER, SimSituation.CAREER_DOCTOR_NPC_NURSE, SimSituation.CAREER_DOCTOR_NPC_PATIENT_ADMITTED, SimSituation.DETECTIVE_APB, SimSituation.DETECTIVE_APBNEUTRAL, SimSituation.CAREER_DETECTIVE_APBPLAYER, SimSituation.SINGLEJOB_COWORKER_SCIENTIST, SimSituation.SINGLEJOB_COWORKER_SCIENTIST_FRONTDESK, SimSituation.CAREEREVENTSITUATIONS_SCIENTISTCAREER_MAIN, SimSituation.GRIMREAPER, SimSituation.FIRE, SimSituation.BABYBIRTH_HOSPITAL, SimSituation.PARK_CHILDPLAYING, SimSituation.CAREGIVER_TODDLER, SimSituation.DATE, SimSituation.DATE_TEEN)): return False if not is_sim_available(sim): return False if not has_sim_permission_for_nudity(sim)[0]: return False return True
def _after_sex_dress_up(sim_info): if get_sex_setting(SexSetting.OUTFIT_AUTO_DRESS_UP_AFTER_SEX_STATE, variable_type=bool): dress_up_outfit(sim_info) elif TurboSimUtil.Sim.is_npc(sim_info) and has_sim_situations( sim_info, (SimSituation.LEAVE, SimSituation.LEAVE_NOW_MUST_RUN, SimSituation.SINGLESIMLEAVE)): dress_up_outfit(sim_info)
def _react_to_sims_sex(sim): if not get_sex_setting(SexSetting.REACTION_TO_SEX_STATE, variable_type=bool): return False if TurboSimUtil.Age.is_younger_than(sim, TurboSimUtil.Age.BABY, or_equal=True): return False registered_sex_handlers = get_active_sex_handlers() if not registered_sex_handlers: return False try_to_react = True if sim_ev(sim).sex_reaction_attempt_cooldown > 0: try_to_react = False if sim_ev(sim).sex_reaction_cooldown > 0: try_to_react = False if try_to_react is False: 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 if not is_sim_available(sim): return False for interaction_id in TurboSimUtil.Interaction.get_running_interactions_ids( sim): if interaction_id == SimInteraction.WW_STOP_SEX: return True line_of_sight = TurboMathUtil.LineOfSight.create( TurboSimUtil.Location.get_routing_surface(sim), TurboSimUtil.Location.get_position(sim), 8.0) for sex_handler in registered_sex_handlers: if not sex_handler.is_playing is False: if sex_handler.is_ready_to_unregister is True: continue if sex_handler.get_identifier() in sim_ev( sim).sex_reaction_handlers_list: continue if sex_handler.get_creator_sim_id( ) == TurboManagerUtil.Sim.get_sim_id(sim): continue sex_interaction_los_position = sex_handler.get_los_position() if not TurboMathUtil.LineOfSight.test( line_of_sight, sex_interaction_los_position): continue sim_ev(sim).sex_reaction_attempt_cooldown = 2 if _jealousy_from_sex_reaction(sim, sex_handler): return True if _general_sex_reaction(sim, sex_handler): return True return False
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 _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 _is_sim_in_sex_forbidden_situation(sim_identifier): if has_sim_situations( sim_identifier, (SimSituation.BARISTA_VENUE, SimSituation.HIREDNPC_BARISTA, SimSituation.BARBARTENDER, SimSituation.BARTENDER_RESTAURANT, SimSituation.HIREDNPC_BARTENDER, SimSituation.HIREDNPC_CATERER, SimSituation.HIREDNPC_CATERER_VEGETARIAN, SimSituation.HIREDNPC_DJ, SimSituation.HIREDNPC_DJ_LEVEL10, SimSituation.SINGLEJOB_CLUB_DJ, SimSituation.SINGLEJOB_CLUB_DJ_LEVEL10, SimSituation.HIREDNPC_ENTERTAINER_GUITAR, SimSituation.HIREDNPC_ENTERTAINER_MICCOMEDY, SimSituation.HIREDNPC_ENTERTAINER_ORGAN, SimSituation.HIREDNPC_ENTERTAINER_PIANO, SimSituation.HIREDNPC_ENTERTAINER_VIOLIN, SimSituation.BUTLER_SITUATION, SimSituation.GARDENER_SERVICE_SITUATION, SimSituation.NANNY_SITUATION, SimSituation.GYMTRAINER_VENUE, SimSituation.LANDLORD, SimSituation.LIBRARYVENUE_LIBRARIAN, SimSituation.MAID_SITUATION, SimSituation.MAILMAN_SITUATION, SimSituation.PIZZADELIVERY_NEW, SimSituation.FORESTRANGER_VACATIONARRIVAL, SimSituation.REFLEXOLOGIST_VENUE, SimSituation.REPAIR_SITUATION, SimSituation.TRAGICCLOWN, SimSituation.YOGAINSTRUCTOR_VENUE, SimSituation.MASSAGETHERAPIST_VENUE, SimSituation.MASSAGETHERAPIST_SERVICECALL, SimSituation.CHEFSITUATION, SimSituation.HOST_1, SimSituation.RESTAURANT_WAITSTAFF, SimSituation.RESTAURANTDINER_SUB_NPC_CRITIC, SimSituation.RESTAURANTDINERBACKGROUND_NPC_CRITIC, SimSituation.RETAILEMPLOYEE_HARDWORKER, SimSituation.RETAILEMPLOYEE_NPCSTORE_HARDWORKER, SimSituation.SINGLEJOB_COWORKER_RETAILEMPLOYEE, SimSituation.HIREDNPC_STALLVENDOR, SimSituation.HIREDNPC_VENDORSTALL, SimSituation.OPENSTREETS_STALLVENDOR, SimSituation.CAREER_DOCTOR_NPC_DOCTOR, SimSituation.CAREER_DOCTOR_NPC_ASSISTANT, SimSituation.CAREER_DOCTOR_NPC_DOCTOR_DIAGNOSER, SimSituation.CAREER_DOCTOR_NPC_NURSE, SimSituation.PATIENTEMERGENCY_COLLAPSEDPATIENT, SimSituation.PATIENTEMERGENCY_DELIVERBABY, SimSituation.PATIENTEMERGENCY_SAMPLEANALYSIS, SimSituation.CAREER_DOCTOR_NPC_PATIENT_ADMITTED, SimSituation.CAREER_DOCTOR_NPC_PATIENT_ADMITTED_RECLINE, SimSituation.CAREER_DOCTOR_AWAYEVENTS_HOUSECALLPATIENT, SimSituation.CAREER_DOCTOR_AWAYEVENTS_OUTBREAKPATIENT, SimSituation. CAREEREVENTSITUATIONS_DOCTOR_UNDERSTAFFED_COLLAPSEDPATIENT, SimSituation. CAREEREVENTSITUATIONS_DOCTORCAREER_ROUNDS_MID_COLLAPSEDPATIENT, SimSituation. CAREEREVENTSITUATIONS_DOCTORCAREER_ROUNDSHIGH_COLLAPSEDPATIENT, SimSituation.HOSPITALPATIENT_LOWLEVEL, SimSituation.HOSPITALPATIENT_LOWLEVEL_ELDER, SimSituation.HOSPITALPATIENT_LOWLEVEL_CHILD, SimSituation.HOSPITALPATIENT_HIGHLEVEL, SimSituation.HOSPITALPATIENT_DIAGNOSED_STARRYEYES, SimSituation.HOSPITALPATIENT_DIAGNOSED_LLAMAFLU, SimSituation.HOSPITALPATIENT_DIAGNOSED_GASANDGIGGLES, SimSituation.HOSPITALPATIENT_DIAGNOSED_BLOATYHEAD, SimSituation.HOSPITALPATIENT_ADMITTED, SimSituation.VET_EMPLOYEE, SimSituation.DETECTIVE_APB, SimSituation.DETECTIVE_APBNEUTRAL, SimSituation.CAREER_DETECTIVE_APBPLAYER, SimSituation.SINGLEJOB_COWORKER_SCIENTIST, SimSituation.SINGLEJOB_COWORKER_SCIENTIST_FRONTDESK, SimSituation.CAREEREVENTSITUATIONS_SCIENTISTCAREER_MAIN, SimSituation.GRIMREAPER, SimSituation.FIRE, SimSituation.BABYBIRTH_HOSPITAL, SimSituation.PARK_CHILDPLAYING, SimSituation.CAREGIVER_TODDLER, SimSituation.WEDDING)): return True return False
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