Beispiel #1
0
 def enter_env(self, new_env, enter_action=None):
     entry_msg = Broadcast(getattr(enter_action, 'entry_msg', self.entry_msg), self, silent=True)
     entry_msg.target = getattr(enter_action, 'from_name', None)
     new_env.entity_enters(self, enter_action, entry_msg)
     new_instance = getattr(self.env, 'instance', None)
     if self.instance != new_instance:
         if self.instance:
             self.instance.remove_entity(self)
             del self.instance_id
         if new_instance:
             new_instance.add_entity(self)
             self.instance_id = new_instance.instance_id
     if self.instance:
         self.instance_room_id = self.env.dbo_id
     elif self.env.dbo_id:
         self.room_id = self.env.dbo_id
     self.env.first_look(self)
Beispiel #2
0
 def preview(source, target, b_map, self_source, **_):
     broadcast = Broadcast(BroadcastMap(**b_map), source, source if self_source else target)
     return {broadcast_type['id']: broadcast.substitute(broadcast_type['id']) for broadcast_type in broadcast_types}
Beispiel #3
0
 def broadcast(self, **kwargs):
     broadcast = Broadcast(**kwargs)
     broadcast.source = self
     if self.env:
         self.env.receive_broadcast(broadcast)
Beispiel #4
0
 def preview(self):
     content = self._content()
     broadcast = Broadcast(BroadcastMap(**content.b_map), content.source, content.source if content.self_source else content.target)
     return {broadcast_type['id']: broadcast.substitute(broadcast_type['id']) for broadcast_type in broadcast_types}