Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 20-04-08 16:00:50-04 [a piece of chalk]
- 20-04-08 16:00:50-04 <QuerySet [basket]>
- class CmdPut(Command):
- """
- Usage:
- put <item> in <container>
- Finds an item around the character and puts it in a container.
- """
- key = 'put'
- def parse(self):
- self.item_arg, self.container_arg = self.args.split('in')
- self.item_arg = self.item_arg.strip()
- self.container_arg = self.container_arg.strip()
- def func(self):
- caller = self.caller
- item_arg = self.item_arg
- container_arg = self.container_arg
- # Find the item.
- # Location unset, search conducted within the character and its location.
- item = caller.search(item_arg, quiet=True)
- if item:
- print(item)
- container = caller.search(container_arg, quiet=True)
- if container:
- print(container)
- return
- # if item.location:
- # caller.msg(f"You pick up {item.name} and place it in {container.name}.")
- # caller.msg_contents(f"{caller.name} picks up {item.name} and places it in {container.name}.", exclude=caller)
- # elif item in caller:
- # caller.msg(f"You place {item.name} in {container.name}.")
- # caller.msg_contents(f"{caller.name} places {item.name} in {container.name}.", exclude=caller)
- # item.move_to(container, quiet=True)
- else:
- caller.msg(f"Could not find {container_arg}!")
- else:
- caller.msg(f"Could not find {item_arg}!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement