moss-n-puddles/commands/take.py
Howard Abrams 0850301c65 We can knock on a door.
And a number of bugs squashed.
2025-02-11 21:09:23 -08:00

42 lines
1.1 KiB
Python
Executable file

#!/usr/bin/env python
from commands.command import Command
from evennia import CmdSet
from evennia.utils import logger
class CmdTake(Command):
"""
Steals an object from another.
Added to the default_cmdsets.
"""
key = "take"
aliases = ["remove"]
# only allow this command if command.obj is carried by caller.
# locks = "cmd:holds()"
def func(self):
"""
Implements the take command. Since this command is designed
to work on the object, we operate only on self.obj.
"""
# logger.log_info(f"Dealing with {self.caller.key}")
self.caller.do_take(self.args)
class CmdKnock(Command):
"""
The ability to knock on something, like a door.
While it would be great if it could be attached to a door or some
other exit, we need to attach this to the room.
"""
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)