Quite pleased with the results. This also fixed a utils issue to see if an object has an item. I'm surprised this isn't in the standard library.
24 lines
645 B
Python
Executable file
24 lines
645 B
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 = ["get", "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)
|