A WIP Evennia escape room themed MUD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
723 B

'''
Command and command set for using a Keypad
'''
from evennia import Command, CmdSet
class CmdUseKeypad(Command):
'''
Use a keypad
Usage:
use [the] keypad
'''
key = 'use keypad'
aliases = ['use the keypad', 'unlock']
def func(self):
'''
Implement the command
'''
# Have to yield here since Evennia only allows yield in command func
keycode = yield('Enter keycode: ')
self.obj.attempt_unlock(self.caller, keycode)
class CmdSetKeypad(CmdSet):
'''
Command set for using a keypad
'''
key = 'cmdset_keypad'
def at_cmdset_creation(self):
'Attach commands to the command set'
self.add(CmdUseKeypad())