Advertisement
Kovitikus

Automatic Room Generation

Dec 30th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.44 KB | None | 0 0
  1. class OOC_Workshop(Room):
  2.     def at_object_creation(self):
  3.         self.db.desc = ("This small workshop has all the basic amenities required "
  4.                         "for creating a fresh body.")
  5.         portal_room = create_object(typeclass="typeclasses.rooms.OOC_Room",
  6.                                     key="Portal Room")
  7.         # Make exits connecting the Portal Room with the Workshop
  8.         exit_to_portal_room = create_object(typeclass="typeclasses.exits.Exit",
  9.                                             key="north", aliases="n", destination=portal_room,
  10.                                             location=self, home=self)
  11.         exit_to_workshop = create_object(typeclass="typeclasses.exits.Exit",
  12.                                             key="south", aliases="s", destination=self,
  13.                                             location=portal_room, home=portal_room)
  14.  
  15.         # Connect the portal room to the Common Room
  16.         common_room = search_object("Common Room")
  17.         print(f"{'Common Room found!' if common_room else 'Common Room NOT found!'}")
  18.         exit_to_common_room = create_object(typeclass="typeclasses.exits.Exit",
  19.                                             key="north", aliases="n", destination=common_room[0],
  20.                                             location=portal_room, home=portal_room)
  21.         print(f"{'Exit to common room created!' if exit_to_common_room else 'Exit to common room NOT created!'}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement