27 lines
759 B
Python
Executable file
27 lines
759 B
Python
Executable file
#!/usr/bin/env python
|
|
|
|
from commands.command import Command
|
|
from evennia.commands.default.general import NumberedTargetCommand
|
|
|
|
|
|
class CmdTake(Command, NumberedTargetCommand):
|
|
"""
|
|
Steals an object from another.
|
|
Added to the default_cmdsets.
|
|
"""
|
|
key = "take"
|
|
aliases = ["steal"]
|
|
rhs_split = ("=", " from ")
|
|
|
|
def func(self):
|
|
"""
|
|
Implements the take command. Since this command is designed
|
|
to work on the object, we operate only on self.obj.
|
|
"""
|
|
if not self.args:
|
|
self.caller.msg("What do you want to take?")
|
|
elif not self.rhs:
|
|
self.caller.msg(f"You want to take {self.lhs}, but from whom?")
|
|
else:
|
|
self.caller.do_take(self.lhs, self.rhs)
|