Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import services
- from event_testing.test_variants import SimInfoTest, UserRunningInteractionTest
- from event_testing.tests import CompoundTestList, TestList
- from interactions import ParticipantType
- from sims.phone_tuning import PhoneTuning
- from sims.sim_info_types import Age
- from sims4.collections import make_immutable_slots_class, ListSet
- from sims4.localization import TunableLocalizedStringFactory
- from sims4.resources import Types, get_resource_key
- from sims4.tuning.instance_manager import InstanceManager
- from wickedwoohoo.global_manager import register_game_load_listener
- from wickedwoohoo.utils_enums import SimInteraction
- from wickedwoohoo.utils_injector import injector
- from wickedwoohoo.utils_tunings import get_sim_info_age_test, create_impossible_sim_info_age_test
- NUDE_CLOTHING_BUFF = 128807
- NUDE_TEENS_TEST_SETS = (129064,)
- NUDITY_AFFORDANCE_LIST = (120455, 120453, 128625, 129163, 117339, 26878)
- ALL_SIMS_AFFORDANCE_LIST = (125127, 125129)
- DISABLE_AFFORDANCE_LIST = (128922, 129168, 128960, 142210)
- @register_game_load_listener()
- def _add_test_to_phone_tuning(is_first_load):
- if is_first_load is False:
- return
- affordance_manager = services.get_instance_manager(Types.INTERACTION)
- affordances = {affordance_manager.get(get_resource_key(SimInteraction.WW_SEX_INTERACTION, Types.INTERACTION)), affordance_manager.get(get_resource_key(SimInteraction.WW_SETUP_SEX, Types.INTERACTION)), affordance_manager.get(get_resource_key(SimInteraction.WW_WAIT_FOR_SEX_PARTNER, Types.INTERACTION)), affordance_manager.get(get_resource_key(SimInteraction.WW_GO_TO_GROUP_SEX_DESTINATION, Types.INTERACTION)), affordance_manager.get(get_resource_key(SimInteraction.WW_GO_TO_JOIN_GROUP_SEX_DESTINATION, Types.INTERACTION)), affordance_manager.get(get_resource_key(SimInteraction.WW_GO_TO_SEX_DESTINATION, Types.INTERACTION))}
- test = UserRunningInteractionTest(participant=ParticipantType.Actor, affordances=affordances, affordance_lists=list(), test_for_not_running=False, all_participants_running=False)
- immutable_slots_class = make_immutable_slots_class(['test', 'tooltip'])
- immutable_slots = immutable_slots_class(dict(test=test, tooltip=TunableLocalizedStringFactory._Wrapper(1181912093)))
- items_list = list(PhoneTuning.DISABLE_PHONE_TESTS)
- items_list.append(immutable_slots)
- PhoneTuning.DISABLE_PHONE_TESTS = ListSet(items_list)
- @injector(InstanceManager, 'load_data_into_class_instances')
- def _wickedwoohoo_load_data_and_disable_interactions(original, self, *args, **kwargs):
- result = original(self, *args, **kwargs)
- if self.TYPE != Types.INTERACTION:
- return result
- for affordance_id in ALL_SIMS_AFFORDANCE_LIST:
- affordance_key = get_resource_key(affordance_id, Types.INTERACTION)
- affordance_instance = self._tuned_classes.get(affordance_key)
- if affordance_instance is None:
- pass
- while hasattr(affordance_instance, 'test_globals') and affordance_instance.test_globals:
- affordance_tests_list = []
- for test in affordance_instance.test_globals:
- test = get_sim_info_age_test(test, add_age=(Age(2), Age(4), Age(8), Age(16), Age(32), Age(64)))
- affordance_tests_list.append(test)
- affordance_instance.test_globals = TestList(affordance_tests_list)
- return result
- @injector(InstanceManager, 'load_data_into_class_instances')
- def _wickedwoohoo_load_data_and_disable_interactions(original, self, *args, **kwargs):
- result = original(self, *args, **kwargs)
- if self.TYPE != Types.INTERACTION:
- return result
- for affordance_id in DISABLE_AFFORDANCE_LIST:
- affordance_key = get_resource_key(affordance_id, Types.INTERACTION)
- affordance_instance = self._tuned_classes.get(affordance_key)
- if affordance_instance is None:
- pass
- while hasattr(affordance_instance, 'test_globals') and affordance_instance.test_globals:
- affordance_tests_list = []
- has_age_test = False
- for test in affordance_instance.test_globals:
- if isinstance(test, SimInfoTest):
- test = create_impossible_sim_info_age_test()
- has_age_test = True
- affordance_tests_list.append(test)
- if has_age_test is False:
- affordance_tests_list.append(create_impossible_sim_info_age_test())
- affordance_instance.test_globals = TestList(affordance_tests_list)
- return result
- @injector(InstanceManager, 'load_data_into_class_instances')
- def _wickedwoohoo_load_data_into_nudity_buff(original, self, *args, **kwargs):
- result = original(self, *args, **kwargs)
- if self.TYPE != Types.BUFF:
- return result
- key = get_resource_key(NUDE_CLOTHING_BUFF, Types.BUFF)
- buff_instance = self._tuned_classes.get(key)
- if buff_instance is None:
- return result
- buff_instance.broadcaster = None
- return result
- @injector(InstanceManager, 'load_data_into_class_instances')
- def _wickedwoohoo_load_data_into_nudity_testsets(original, self, *args, **kwargs):
- result = original(self, *args, **kwargs)
- if self.TYPE != Types.SNIPPET:
- return result
- for snippet_id in NUDE_TEENS_TEST_SETS:
- snippet_key = get_resource_key(snippet_id, Types.SNIPPET)
- snippet_instance = self._tuned_classes.get(snippet_key)
- if snippet_instance is None:
- pass
- testset_groups_list = []
- for test_group in snippet_instance.test:
- testset_tests_list = []
- for test in test_group:
- test = get_sim_info_age_test(test, add_age=(Age(1), Age(2), Age(4), Age(8)))
- testset_tests_list.append(test)
- testset_groups_list.append(tuple(testset_tests_list))
- snippet_instance.test = CompoundTestList(list(testset_groups_list))
- return result
- @injector(InstanceManager, 'load_data_into_class_instances')
- def _wickedwoohoo_load_data_into_nudity_interactions(original, self, *args, **kwargs):
- result = original(self, *args, **kwargs)
- if self.TYPE != Types.INTERACTION:
- return result
- for affordance_id in NUDITY_AFFORDANCE_LIST:
- affordance_key = get_resource_key(affordance_id, Types.INTERACTION)
- affordance_instance = self._tuned_classes.get(affordance_key)
- if affordance_instance is None:
- pass
- if hasattr(affordance_instance, 'test_globals') and affordance_instance.test_globals:
- affordance_tests_list = []
- for test in affordance_instance.test_globals:
- test = get_sim_info_age_test(test, add_age=(Age(8),))
- 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 = []
- for test_group in affordance_instance.sim_tests:
- simtest_tests_list = []
- for test in test_group:
- test = get_sim_info_age_test(test, add_age=(Age(8),))
- simtest_tests_list.append(test)
- simtests_group_list.append(tuple(simtest_tests_list))
- affordance_instance.sim_tests = CompoundTestList(simtests_group_list)
- while hasattr(affordance_instance, 'tests') and affordance_instance.tests:
- tests_group_list = []
- for test_group in affordance_instance.tests:
- test_tests_list = []
- for test in test_group:
- test = get_sim_info_age_test(test, add_age=(Age(8),))
- test_tests_list.append(test)
- tests_group_list.append(tuple(test_tests_list))
- affordance_instance.tests = CompoundTestList(tests_group_list)
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement