def __init__(self, sim_info):
     self._sim_info = sim_info
     self._current_away_action = None
     self._on_away_action_started = CallableList()
     self._on_away_action_ended = CallableList()
     self.add_on_away_action_started_callback(self._resend_away_action)
     self.add_on_away_action_ended_callback(self._resend_away_action)
Example #2
0
 def __init__(self, owner, **kwargs):
     super().__init__(owner, **kwargs)
     self.owner = owner
     walkstyle_behavior = self.get_walkstyle_behavior()
     self._walkstyle_requests = [WalkStyleRequest(self.owner, walkstyle=walkstyle_behavior.default_walkstyle, priority=-1)]
     self._walk_style_handles = {}
     self.wading_buff_handle = None
     self.last_route_has_wading_nodes = False
     self._routing_stage_event_callbacks = defaultdict(CallableList)
     if owner.is_sim:
         owner.remove_component(objects.components.types.FOOTPRINT_COMPONENT)
     self._path_plan_context_map = {}
     self.on_slot = None
     self.stand_slot_reservation_removed_callbacks = CallableList()
     self._active_follow_path_weakref = None
     self.on_follow_path = CallableList()
     self.on_plan_path = CallableList()
     self.on_intended_location_changed = CallableList()
     self._current_path = None
     self._routing_slave_data = []
     self._routing_master_ref = None
     self._default_agent_radius = None
     self._route_event_context = RouteEventContext()
     self._route_interaction = None
     self._animation_context = None
     self._initial_carry_targets = None
     self._route_event_provider_requests = None
Example #3
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._zone_curfew_data = {}
     self._curfew_warning_alarm_handle = None
     self._curfew_started_alarm_handle = None
     self._curfew_ended_alarm_handle = None
     self._curfew_message_alarm_handle = None
     self._curfew_warning_callback = CallableList()
     self._curfew_started_callback = CallableList()
     self._curfew_ended_callback = CallableList()
     self._time_set_callback = CallableList()
Example #4
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._crafting_cache = CraftingObjectCache()
     self._sim_spawn_conditions = collections.defaultdict(set)
     self._water_terrain_object_cache = WaterTerrainObjectCache()
     self._client_connect_callbacks = CallableList()
     self._portal_cache = WeakSet()
     self._portal_added_callbacks = CallableList()
     self._portal_removed_callbacks = CallableList()
     self._front_door_candidates_changed_callback = CallableList()
     self._all_bed_tags = self.BED_TAGS.beds | self.BED_TAGS.double_beds | self.BED_TAGS.kid_beds | self.BED_TAGS.other_sleeping_spots
     self._tag_to_object_list = defaultdict(set)
     self._whim_set_cache = Counter()
     self._posture_providing_object_cache = None
     self._objects_to_ignore_portal_validation_cache = []
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._picker_dialogs = {}
     self._text_listeners = CallableList()
     self.existing_text = None
     self.ingredient_check = None
     self._changes_made = False
Example #6
0
 def __init__(self, zone_id, save_slot_data_id):
     self.id = zone_id
     self.neighborhood_id = 0
     self.open_street_id = 0
     self.lot = Lot(zone_id)
     self.entitlement_unlock_handlers = {}
     self._spawner_data = {}
     self._dynamic_spawn_points = {}
     self._zone_state = zone_types.ZoneState.ZONE_INIT
     self._zone_state_callbacks = {}
     self.all_transition_controllers = weakref.WeakSet()
     self.navmesh_change_callbacks = CallableListPreventingRecursion()
     self.wall_contour_update_callbacks = CallableListPreventingRecursion()
     self.foundation_and_level_height_update_callbacks = CallableListPreventingRecursion(
     )
     self.navmesh_id = None
     self.object_count = 0
     self.is_in_build_buy = False
     self.objects_to_fixup_post_bb = None
     self._save_slot_data_id = save_slot_data_id
     self._royalty_alarm_manager = RoyaltyAlarmManager()
     self.current_navmesh_fence_id = 1
     self._first_visit_to_zone = None
     self._active_lot_arrival_spawn_point = None
     self._time_of_last_open_street_save = None
     for key in zone_types.ZoneState:
         while key != zone_types.ZoneState.ZONE_INIT:
             self._zone_state_callbacks[key] = CallableList()
     self._client = None
     self._tick_metrics = None
Example #7
0
 def __init__(self, owner, resolver=None, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._owner = owner.ref()
     self._resolver = resolver
     self._additional_responses = {}
     self.response = None
     self._timestamp = None
     self._listeners = CallableList()
 def __init__(self, sim_info):
     super().__init__()
     self._sim_info = sim_info
     self._relationships = {}
     self._suppress_client_updates = False
     self.spouse_sim_id = None
     self._relationship_multipliers = {}
     self._create_relationship_callbacks = CallableList()
Example #9
0
 def __init__(self, sim):
     self._super_interactions = set()
     self._removing_interactions = set()
     self._resetting = False
     self._sim = sim.ref() if sim else None
     self._watchers = {}
     self._constraints = {}
     self.on_changed = CallableList()
Example #10
0
 def __init__(self, *args, manager_id=0, **kwargs):
     super().__init__(*args, **kwargs)
     self.id = manager_id
     self._objects = {}
     self._objects_to_be_removed = []
     self._registered_callbacks = {}
     for key in CallbackTypes:
         self._registered_callbacks[key] = CallableList()
 def _register_home_street_change_callback(callbacks, street, callback):
     if street is None or callback is None:
         logger.error(
             'Attempt to register an incomplete callback: {} for street {}',
             callback, street)
         return
     if street not in callbacks:
         callbacks[street] = CallableList()
     callbacks[street].append(callback)
Example #12
0
 def __init__(self, owner):
     super().__init__(owner)
     self._crafting_process = None
     self._use_base_recipe = False
     self.object_mutated_listeners = CallableList()
     self._servings_statistic_tracker_handle = None
     self._quality_change_callback_added = False
     self._spoil_listener_handle = None
     self._is_final_product = False
 def __init__(self, path, type_enum, use_guid_for_ref=False):
     self._tuned_classes = {}
     self._callback_helper = {}
     self._verify_tunable_callback_helper = {}
     self._class_templates = []
     self.PATH = path
     self.TYPE = type_enum
     self._load_all_complete = False
     self._load_all_complete_callbacks = CallableList()
     self._use_guid_for_ref = use_guid_for_ref
Example #14
0
 def __init__(self, lot_id, zone_id, routing_surface=None):
     self.center = None
     self.lot_id = lot_id
     self._tags = set()
     if routing_surface is None:
         routing_surface = routing.SurfaceIdentifier(
             zone_id, 0, routing.SURFACETYPE_WORLD)
     self._routing_surface = routing_surface
     self._valid_slots = 0
     self._on_spawn_points_changed = CallableList()
Example #15
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._alarm_handle = None
     self._processing_task = None
     self._on_update_callbacks = CallableList()
     self._pending_broadcasters = []
     self._active_broadcasters = []
     self._cluster_requests = {}
     self._object_cache = None
     self._pending_update = False
     self._quadtrees = defaultdict(sims4.geometry.QuadTree)
 def register_sim_removed_callback(self, street, callback):
     if street is None or callback is None:
         logger.error(
             'Attempted to register an incomplete callback: {} for street {}',
             callback, street)
         return
     if street not in self._street_sim_removed_callbacks:
         self._street_sim_removed_callbacks[street] = CallableList()
     callback_list = self._street_sim_removed_callbacks[street]
     if callback not in callback_list:
         callback_list.register(callback)
Example #17
0
 def __init__(self, owner):
     super().__init__(owner)
     self._crafting_process = None
     self._use_base_recipe = False
     self.object_mutated_listeners = CallableList()
     self._servings_statistic_tracker_handle = None
     self._quality_change_callback_added = False
     self._spoil_listener_handle = None
     self._is_final_product = False
     self._last_spoiled_time = None
     self._spoil_timer_state_value = CraftingTuning.SPOILED_STATE_VALUE
Example #18
0
 def __init__(self, owner):
     super().__init__(owner)
     self._active_buffs = {}
     self._get_next_handle_id = UniqueIdGenerator()
     self._success_chance_modification = 0
     self._active_mood = self.DEFAULT_MOOD
     self._active_mood_intensity = 0
     self._active_mood_buff_handle = None
     self.on_mood_changed = CallableList()
     self.on_mood_changed.append(self._publish_mood_update)
     self.on_mood_changed.append(self._send_mood_changed_event)
     self.load_in_progress = False
     self.on_buff_added = CallableList()
     self.on_buff_removed = CallableList()
     self.buff_update_alarms = {}
     if self._active_mood is None:
         logger.error('No default mood tuned in buff_component.py')
     elif self._active_mood.buffs:
         initial_buff_ref = self._active_mood.buffs[0]
         if initial_buff_ref and initial_buff_ref.buff_type:
             self._active_mood_buff_handle = self.add_buff(initial_buff_ref.buff_type)
Example #19
0
 def __init__(self, asm_key, context, posture_manifest_overrides=None):
     super().__init__(asm_key)
     self.context = context
     self._posture_manifest_overrides = posture_manifest_overrides
     self._prop_overrides = {}
     self._prop_state_values = {}
     self._vfx_overrides = {}
     self._sound_overrides = {}
     self._actors = {}
     self._virtual_actors = defaultdict(set)
     self._virtual_actor_relationships = {}
     self._on_state_changed_events = CallableList()
Example #20
0
 def __init__(self,
              sim_info=None,
              situation=None,
              goal_id=0,
              count=0,
              **kwargs):
     self._sim_info = sim_info
     self._situation = situation
     self.id = goal_id
     self._on_goal_completed_callbacks = CallableList()
     self._completed_time = None
     self._count = count
Example #21
0
 def __init__(self, path, type_enum, use_guid_for_ref=False, base_game_only=False, require_reference=False):
     self._tuned_classes = {}
     self._remapped_keys = {}
     self._callback_helper = {}
     self._verify_tunable_callback_helper = {}
     self._class_templates = []
     self.PATH = path
     self.TYPE = type_enum
     self._load_all_complete = False
     self._load_all_complete_callbacks = CallableList()
     self._use_guid_for_ref = use_guid_for_ref
     self._base_game_only = base_game_only
     self._require_reference = require_reference
Example #22
0
 def __init__(self,
              *args,
              sim_id: int = 0,
              gender: Gender = Gender.MALE,
              age: Age = Age.ADULT,
              species: SpeciesExtended = SpeciesExtended.HUMAN,
              first_name: str = '',
              last_name: str = '',
              breed_name: str = '',
              full_name_key=0,
              breed_name_key=0,
              physique: str = '',
              skin_tone=1,
              **kwargs):
     super().__init__(*args, **kwargs)
     self.sim_id = sim_id or id_generator.generate_object_id()
     self.primitives = distributor.ops.DistributionSet(self)
     self.manager = None
     self._base = BaseSimInfo(sim_id, first_name, last_name, breed_name,
                              full_name_key, breed_name_key, age, gender,
                              species, skin_tone, physique)
     self._base.voice_pitch = 0.0
     self._base.voice_actor = 0
     self._base.voice_effect = 0
     self._base.facial_attributes = ''
     self._base.custom_texture = 0
     self._base.pelt_layers = ''
     self._species = SpeciesExtended.get_species(species)
     self.on_base_characteristic_changed = CallableList()
     self.on_outfit_changed = CallableList()
     self.on_outfit_generated = CallableList()
     self._set_current_outfit_without_distribution(
         (OutfitCategory.EVERYDAY, 0))
     self._previous_outfit = (OutfitCategory.EVERYDAY, 0)
     self._preload_outfit_list = []
     self.on_preload_outfits_changed = CallableList()
     self.appearance_tracker = AppearanceTracker(self)
     self.visible_to_client = False
Example #23
0
 def __init__(self, asm_key, context, posture_manifest_overrides=None):
     super().__init__(asm_key)
     self.context = context
     self._posture_manifest_overrides = posture_manifest_overrides
     self._prop_overrides = {}
     self._alt_prop_definitions = {}
     self._prop_state_values = {}
     self._vfx_overrides = {}
     self._sound_overrides = {}
     self._actors = {}
     self._virtual_actors = defaultdict(set)
     self._virtual_actor_relationships = {}
     self._on_state_changed_events = CallableList()
     self._boundary_condition_dirty = asm_key in sims4.resources.localwork_no_groupid
 def __init__(self):
     super().__init__()
     self._save_locks = []
     self._read_write_locked = False
     self._save_game_data_proto = serialization.SaveGameData()
     self.save_timeline = None
     self._unlocked_callbacks = CallableList()
     self.once_per_session_telemetry_sent = False
     self.save_error_code = persistence_error_types.ErrorCodes.NO_ERROR
     self._zone_data_pb_cache = {}
     self._world_id_to_region_id_cache = {}
     self._sim_data_pb_cache = None
     self._household_pb_cache = None
     self._world_ids = frozenset()
Example #25
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._sim_infos_saved_in_zone = []
     self._sim_infos_saved_in_plex_group = []
     self._sim_infos_saved_in_open_street = []
     self._sims_traveled_to_zone = []
     self._sim_infos_injected_into_zone = []
     self._sim_info_to_spin_up_action = None
     self._startup_time = None
     self._sim_ids_to_skip_preroll = set()
     self.on_sim_info_removed = CallableList()
     self._firemeter = None
     self._sim_info_telemetry_manager = SimInfoTelemetryManager()
     self._start_all_sims_opted_out_of_fame = False
     self._sim_info_cap_override = None
Example #26
0
 def __init__(self,
              sim_id,
              rabbit_hole_id=None,
              starting_phase=RabbitHolePhase.STARTING,
              picked_skill=None):
     self.rabbit_hole_id = rabbit_hole_id or id_generator.generate_object_id(
     )
     self.sim_id = sim_id
     self.alarm_handle = None
     self.callbacks = CallableList()
     self.linked_rabbit_holes = []
     self.picked_skill = picked_skill
     self.ignore_travel_cancel_callbacks = False
     self.current_phase = starting_phase
     self._selected_affordance = None
     self.time_remaining_on_load = None
Example #27
0
 def __init__(self):
     self._persisted_background_event_id = None
     self._persisted_special_event_id = None
     self._special_event_start_alarm = None
     self._source_venue = None
     self._active_venue = None
     self._zone_director = None
     self._requested_zone_directors = []
     self._prior_zone_director_proto = None
     self._open_street_director_requests = []
     self._prior_open_street_director_proto = None
     self.build_buy_edit_mode = False
     self.on_venue_type_changed = CallableList()
     self._venue_start_time = None
     self._university_housing_household_validation_alarm = None
     self._university_housing_kick_out_completed = False
Example #28
0
 def __init__(self, session_id, account, household_id):
     self.id = session_id
     self.manager = None
     self._account = account
     self._household_id = household_id
     self._choice_menu = None
     self._interaction_parameters = {}
     self.active = True
     self.zone_id = sims4.zone_utils.get_zone_id()
     self._selectable_sims = SelectableSims(self)
     self._active_sim_info = None
     self._active_sim_changed = CallableList()
     self.ui_objects = weakref.WeakSet()
     self.primitives = ()
     self._live_drag_objects = []
     self._live_drag_start_system = LiveDragLocation.INVALID
     self._live_drag_is_stack = False
     self._live_drag_sell_dialog_active = False
Example #29
0
 def detach(self, *detaching_objects):
     global _nested_arb_detach_callbacks
     if self.master not in detaching_objects:
         for detaching_object in detaching_objects:
             self._attached_actors.remove(detaching_object)
         super().detach(*detaching_objects)
         return
     if _nested_arb_depth > 0:
         if _nested_arb_detach_callbacks is None:
             _nested_arb_detach_callbacks = CallableList()
         super_self = super()
         _nested_arb_detach_callbacks.append(
             lambda: super_self.detach(*self._attached_actors))
         return True
     if _nested_arb_detach_callbacks is not None:
         cl = _nested_arb_detach_callbacks
         _nested_arb_detach_callbacks = None
         cl()
     super().detach(*self._attached_actors)
Example #30
0
 def __init__(self,
              sim_info=None,
              situation=None,
              goal_id=0,
              count=0,
              locked=False,
              completed_time=None,
              secondary_sim_info=None,
              **kwargs):
     self._sim_info = sim_info
     self._secondary_sim_info = secondary_sim_info
     self._situation = situation
     self.id = goal_id
     self._on_goal_completed_callbacks = CallableList()
     self._completed_time = completed_time
     self._count = count
     self._locked = locked
     self._score_override = None
     self._goal_status_override = None
     self._setup = False