Advertisement
Kovitikus

Attempt at creating an exit.

Jul 25th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. class CmdPortal(Command):
  2.     """
  3.    Opens or closes a portal.
  4.  
  5.    Usage:
  6.        portal <mark>
  7.        portal close
  8.  
  9.    Open a portal to the destination mark for up to 5 minutes.
  10.    Use the close argument to instead close the portal.
  11.    """
  12.     key = "portal"
  13.    
  14.    
  15.    
  16.     def func(self):
  17.         from evennia.utils import dbref_to_obj
  18.         from evennia import DefaultExit
  19.         from evennia.utils import search
  20.         from evennia.commands.default.building import CmdOpen
  21.         destination = self.caller.db.mark[self.args]
  22.         destination = search(destination)
  23.         destination = dbref_to_obj(destination, 'typeclasses.rooms.Room', raise_errors=True)
  24.  
  25.         #create(cls, key, account, source, dest, **kwargs)
  26.         DefaultExit.create("portal", self.caller.account, self.caller.location, destination)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement