73 lines
1.2 KiB
Python
Executable file
73 lines
1.2 KiB
Python
Executable file
#!/usr/bin/env python
|
|
|
|
from .command import Command
|
|
from evennia import CmdSet
|
|
from evennia.utils import logger
|
|
|
|
|
|
class CmdKnock(Command):
|
|
"""
|
|
The ability to knock on something, like a door.
|
|
|
|
Usage:
|
|
|
|
knock
|
|
|
|
Uh, yeah, you'll need to make sure the ring is in the mouth of the
|
|
door knocker.
|
|
"""
|
|
key = "knock"
|
|
|
|
def func(self):
|
|
logger.log_info(f"Seems like {self.caller.key} wants to knock on me.")
|
|
self.obj.do_knock(self.caller)
|
|
|
|
|
|
class CmdSetKnock(CmdSet):
|
|
def at_cmdset_creation(self):
|
|
self.add(CmdKnock)
|
|
|
|
|
|
class CmdJump(Command):
|
|
"""
|
|
Jump or play in or around puddles.
|
|
|
|
Usage:
|
|
|
|
jump
|
|
|
|
You know you want to do this!
|
|
"""
|
|
key = "jump"
|
|
aliases = ["play"]
|
|
|
|
def func(self):
|
|
self.obj.do_jump(self.caller)
|
|
|
|
|
|
class CmdSetPuddle(CmdSet):
|
|
def at_cmdset_creation(self):
|
|
self.add(CmdJump)
|
|
|
|
|
|
class CmdThrow(Command):
|
|
"""
|
|
Throw a stick or a fish back into the water.
|
|
|
|
Usage:
|
|
|
|
throw [ object ]
|
|
|
|
"""
|
|
key = "throw"
|
|
locks = "holds(stick)"
|
|
# locks = "cmd:holds()"
|
|
|
|
def func(self):
|
|
self.obj.do_throw(self.caller)
|
|
|
|
|
|
class CmdSetStick(CmdSet):
|
|
def at_cmdset_creation(self):
|
|
self.add(CmdThrow)
|