moss-n-puddles/commands/take.py
Howard Abrams 542e140013 Figured the give and take system
Now the Knocker will only accept the ring, and not berries.
2025-04-03 18:54:20 -07:00

26 lines
744 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.msg("What do you want to take?")
elif not self.rhs:
self.msg(f"You want to take {self.lhs}, but from whom?")
else:
self.caller.do_take(self.lhs, self.rhs)