def _turbolib_add_affordances_to_terrain(): if has_game_loaded(): return try: terrain_object = TerrainService.TERRAIN_DEFINITION.cls affordances_list = list() for affordance_registration in AFFORDANCE_REGISTRATION_CLASSES: try: while affordance_registration.is_terrain(): if affordance_registration.test_for_duplicates(): existing_affordances = tuple( terrain_object._super_affordances) for affordance_instance in affordance_registration._get_affordance_instances( ): if affordance_instance in existing_affordances: pass affordances_list.append(affordance_instance) else: affordances_list += affordance_registration._get_affordance_instances( ) except Exception as ex: log_custom_exception( "[TurboLib] Failed to run 'AffordanceRegistration' class at 'TerrainService.TERRAIN_DEFINITION._super_affordances'.", ex) TerrainService.TERRAIN_DEFINITION.set_class(terrain_object) services.terrain_service.destroy_terrain_object() services.terrain_service.create_terrain_object() except Exception as ex: log_custom_exception( "[TurboLib] Failed to run 'AffordanceRegistration' class at affordances injection to the Terrain object.", ex)
def _wickedwhims_add_nudity_satisfaction_rewards(): if has_game_loaded(): return register_satisfaction_reward(15267048880004589952, 250, TurboTunableUtil.Whims.WhimAwardTypes.TRAIT) register_satisfaction_reward(12422920560197330477, 500, TurboTunableUtil.Whims.WhimAwardTypes.TRAIT)
def _wickedwhims_restart_sex_handlers_on_first_load(): if has_game_loaded(): return for sim in TurboManagerUtil.Sim.get_all_sim_instance_gen(humans=True, pets=False): while sim_ev(sim).active_sex_handler is not None: sim_ev(sim).active_sex_handler.restart()
def _wickedwhims_add_disabled_sex_interactions_to_phone_tuning(): if has_game_loaded(): return TurboTunableUtil.Phone.register_disabled_affordances({ SimInteraction.WW_ROUTE_TO_SEX_LOCATION, SimInteraction.WW_WAIT_FOR_SEX_PARTNER, SimInteraction.WW_SEX_ANIMATION_DEFAULT })
def _wickedwhims_disable_woohoo_whims(): if has_game_loaded(): return if get_sex_setting(SexSetting.DEFAULT_WOOHOO_SWITCH, variable_type=bool): return for whim_id in WOOHOO_WHIMS: whim_instance = TurboResourceUtil.Services.get_instance(TurboResourceUtil.ResourceTypes.SITUATION_GOAL, whim_id) if whim_instance is None: pass whim_instance._pre_tests = TestList((create_impossible_sim_info_age_test(),))
def _wickedwhims_disable_pregnancy_family_leave_notification_loot(): if has_game_loaded(): return action_instance = TurboResourceUtil.Services.get_instance( TurboResourceUtil.ResourceTypes.ACTION, PREGNANCY_FAMILY_LEAVE_NOTIFICATION_LOOT) if action_instance is None: return if hasattr(action_instance, 'loot_actions'): action_instance.loot_actions = ()
def _wickedwhims_disable_pregnancy_start_interaction_outcome(): if has_game_loaded(): return affordance_instance = TurboResourceUtil.Services.get_instance( TurboResourceUtil.ResourceTypes.INTERACTION, PREGNANCY_START_SHOWING_INTERACTION) if affordance_instance is None: return if hasattr(affordance_instance, 'outcome'): affordance_instance.outcome = InteractionOutcomeNone()
def _wickedwhims_neutralize_sims_active_sex_data_on_zone_move(): if not has_game_loaded(): return for sex_handler in ACTIVE_SEX_HANDLERS_LIST: for sim_info in sex_handler.get_actors_sim_info_gen(): if sim_info is None: pass clear_sim_sex_extra_data(sim_info) dress_up_outfit(sim_info) reset_active_sex_handlers()
def _wickedwhims_replace_pregnancy_test_loot(): if has_game_loaded(): return old_loot_actions_instance = TurboResourceUtil.Services.get_instance( TurboResourceUtil.ResourceTypes.ACTION, PREGNANCY_TEST_LOOT) new_loot_actions_instance = TurboResourceUtil.Services.get_instance( TurboResourceUtil.ResourceTypes.ACTION, 13344938130388024666) if old_loot_actions_instance is None or new_loot_actions_instance is None: return old_loot_actions_instance.loot_actions = new_loot_actions_instance.loot_actions
def _wickedwhims_unlock_ask_to_stay_night_for_multiple_sims(): if has_game_loaded(): return ask_to_stay_over_night = TurboResourceUtil.Services.get_instance(TurboResourceUtil.ResourceTypes.INTERACTION, ASK_TO_STAY_NIGHT_INTERACTION) if ask_to_stay_over_night is not None: tests_list = list(ask_to_stay_over_night.test_globals) for test in ask_to_stay_over_night.test_globals: while isinstance(test, SituationRunningTest) and hasattr(test, 'situation_blacklist'): if test.situation_blacklist: tests_list.remove(test) ask_to_stay_over_night.test_globals = TestList(tests_list)
def _wickedwhims_check_for_updates(): if has_game_loaded(): return save_version_dict = get_version_save_data() if save_version_dict is not None and ( len(save_version_dict) > 0 and 'ignore_update' in save_version_dict ) and save_version_dict['ignore_update'] is True: return if not is_mod_outdated(): return open_update_asking_dialog()
def _wickedwhims_add_water_puddle_to_pregnancy_labor_buff(): if has_game_loaded(): return buff_instance = TurboResourceUtil.Services.get_instance( TurboResourceUtil.ResourceTypes.BUFF, PREGNANCY_IN_LABOR_BUFF) loot_action_instance = TurboResourceUtil.Services.get_instance( TurboResourceUtil.ResourceTypes.ACTION, 17130648916201026455) if buff_instance is None or loot_action_instance is None: return loot_actions = list(buff_instance._loot_on_addition) loot_actions.append(loot_action_instance) buff_instance._loot_on_addition = tuple(loot_actions)
def _wickedwhims_enable_nudity_interactions_for_teens(): if has_game_loaded(): return affordance_manager = TurboResourceUtil.Services.get_instance_manager( TurboResourceUtil.ResourceTypes.INTERACTION) for affordance_id in NUDITY_AFFORDANCE_LIST: affordance_instance = TurboResourceUtil.Services.get_instance_from_manager( affordance_manager, affordance_id) if affordance_instance is None: pass if hasattr(affordance_instance, 'test_globals') and affordance_instance.test_globals: affordance_tests_list = list() for test in affordance_instance.test_globals: if TurboTunableUtil.Tests.SimInfo.is_sim_info_test( test) and TurboTunableUtil.Tests.SimInfo.is_age_test( test): test = modify_sim_info_test_ages( test, add_ages=(TurboSimUtil.Age.TEEN, )) affordance_tests_list.append(test) affordance_instance.test_globals = TestList(affordance_tests_list) if hasattr(affordance_instance, 'sim_tests') and affordance_instance.sim_tests: simtests_group_list = list() for test_group in affordance_instance.sim_tests: simtests_test_list = list() for test in test_group: if TurboTunableUtil.Tests.SimInfo.is_sim_info_test( test ) and TurboTunableUtil.Tests.SimInfo.is_age_test(test): test = modify_sim_info_test_ages( test, add_ages=(TurboSimUtil.Age.TEEN, )) simtests_test_list.append(test) simtests_group_list.append(tuple(simtests_test_list)) affordance_instance.sim_tests = CompoundTestList( simtests_group_list) while hasattr(affordance_instance, 'tests') and affordance_instance.tests: tests_group_list = list() for test_group in affordance_instance.tests: test_tests_list = list() for test in test_group: if TurboTunableUtil.Tests.SimInfo.is_sim_info_test( test ) and TurboTunableUtil.Tests.SimInfo.is_age_test(test): test = modify_sim_info_test_ages( test, add_ages=(TurboSimUtil.Age.TEEN, )) test_tests_list.append(test) tests_group_list.append(tuple(test_tests_list)) affordance_instance.tests = CompoundTestList(tests_group_list)
def _wickedwhims_add_sex_satisfaction_rewards(): if has_game_loaded(): return register_satisfaction_reward(3469764812713835673, 1000, TurboTunableUtil.Whims.WhimAwardTypes.TRAIT) register_satisfaction_reward(10438028236933481475, 500, TurboTunableUtil.Whims.WhimAwardTypes.TRAIT) register_satisfaction_reward(12240898038636396224, 1000, TurboTunableUtil.Whims.WhimAwardTypes.TRAIT) register_satisfaction_reward(5499117134932247707, 3000, TurboTunableUtil.Whims.WhimAwardTypes.TRAIT) register_satisfaction_reward(10310333123237709450, 500, TurboTunableUtil.Whims.WhimAwardTypes.TRAIT) register_satisfaction_reward(9341398068450238656, 500, TurboTunableUtil.Whims.WhimAwardTypes.TRAIT)
def _wickedwhims_allow_skinny_dipping_for_all_age(): if has_game_loaded(): return snippet_instance = TurboResourceUtil.Services.get_instance(TurboResourceUtil.ResourceTypes.SNIPPET, SKINNY_DIPPING_TESTSET) if snippet_instance is None: return testset_group_list = list() for test_group in snippet_instance.test: testset_test_list = list() for test in test_group: if TurboTunableUtil.Tests.SimInfo.is_sim_info_test(test) and TurboTunableUtil.Tests.SimInfo.is_age_test(test): test = modify_sim_info_test_ages(test, add_ages=(TurboSimUtil.Age.BABY, TurboSimUtil.Age.TODDLER, TurboSimUtil.Age.CHILD, TurboSimUtil.Age.TEEN)) testset_test_list.append(test) testset_group_list.append(tuple(testset_test_list)) snippet_instance.test = CompoundTestList(list(testset_group_list))
def display_notification(text=None, text_tokens=(), title=None, title_tokens=(), primary_icon=None, secondary_icon=None, is_safe=False, **kwargs): if text is None and title is None: return if not (is_safe is True and has_game_loaded()): return localized_text = TurboL18NUtil.get_localized_string(text, text_tokens) localized_title = TurboL18NUtil.get_localized_string(title, title_tokens) if primary_icon is not None: secondary_icon = TurboManagerUtil.Sim.get_sim_info(primary_icon) or primary_icon if secondary_icon is not None: secondary_icon = TurboManagerUtil.Sim.get_sim_info(secondary_icon) or secondary_icon if primary_icon or secondary_icon: icon_data = (primary_icon, secondary_icon) else: icon_data = None TurboUIUtil.Notification.display(text=localized_text, title=localized_title, icons=icon_data, **kwargs)
def _wickedwhims_disable_share_pregnancy_news_interaction_for_teens(): if has_game_loaded(): return affordance_instance = TurboResourceUtil.Services.get_instance( TurboResourceUtil.ResourceTypes.INTERACTION, SHARE_PREGNANCY_NEWS_INTERACTION) if affordance_instance is None: return if hasattr(affordance_instance, 'test_globals') and affordance_instance.test_globals: tests_list = list() for test in affordance_instance.test_globals: if TurboTunableUtil.Tests.SimInfo.is_sim_info_test( test) and TurboTunableUtil.Tests.SimInfo.is_age_test(test): test = modify_sim_info_test_ages( test, remove_ages=(TurboSimUtil.Age.TEEN, )) tests_list.append(test) affordance_instance.test_globals = TestList(tests_list)
def _wickedwhims_replace_woohoo_date_goals(): if has_game_loaded(): return for (goal_set_id, goal_ids) in GOALS_TO_REPLACE: goal_set_instance = TurboResourceUtil.Services.get_instance( TurboResourceUtil.ResourceTypes.SITUATION_GOAL_SET, goal_set_id) if goal_set_instance is None: pass new_goals = list() for goal_id in goal_ids: goal_instance = TurboResourceUtil.Services.get_instance( TurboResourceUtil.ResourceTypes.SITUATION_GOAL, goal_id) if goal_instance is None: pass immutable_slots_class = TurboResourceUtil.Collections.get_immutable_slots_class( ['goal', 'weight']) immutable_slots = immutable_slots_class( dict(goal=goal_instance, weight=1.0)) new_goals.append(immutable_slots) goal_set_instance.goals = tuple(new_goals)
def _wickedwhims_disable_nudity_buff_broadcaster(): if has_game_loaded(): return buff_instance = TurboResourceUtil.Services.get_instance(TurboResourceUtil.ResourceTypes.BUFF, NUDE_CLOTHING_BUFF) if buff_instance is not None: buff_instance.broadcaster = None
def _wickedwhims_add_relationship_satisfaction_rewards(): if has_game_loaded(): return register_satisfaction_reward(17018140015135385770, 1000, TurboTunableUtil.Whims.WhimAwardTypes.TRAIT)