Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1.     def at_after_traverse(self, traversing_object, source_location):
  2.         """
  3.        Called just after an object successfully used this object to
  4.        traverse to another object (i.e. this object is a type of
  5.        Exit)
  6.  
  7.        Args:
  8.            traversing_object (Object): The object traversing us.
  9.            source_location (Object): Where `traversing_object` came from.
  10.  
  11.        Notes:
  12.            The target location should normally be available as `self.destination`.
  13.  
  14.        Ashlan note: This has to be defined before the rest of the code, probably it's similar for other exit hooks.
  15.        """
  16.  
  17.         if traversing_object.db.dead:
  18.             destination = traversing_object.search("#740", global_search=True)
  19.             traversing_object.move_to(destination, quiet=True)
  20.  
  21.         if traversing_object.db.followed_by:
  22.             destination = traversing_object.location
  23.             for i in traversing_object.db.followed_by:
  24.                 i.msg("test")
  25.                 traversing_object.msg("test") # this works!
  26.                 i.move_to(destination)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement